WooCommerce Gutenberg Products Block - Version 7.6.0

Version Description

  • 2022-05-09 =

Enhancements

  • Featured Category: Add background color option. (6368)
  • Featured Product: Add background color option. (6367)
  • Added media controls allowing the user to edit images within the editor on a Featured Category block. (6360)
  • Added media controls allowing the user to edit images within the editor on a Featured Product block. (6348)
  • Add the alt text control to the Featured Category block media settings. (6341)
  • Hide the Product Tag Cloud from the Widgets screen in classic themes. (6327)
  • Add the alt text control to the Featured Product block media settings. (6308)
  • GridContentControl: Add product image control. (6302)

Bug Fixes

  • Fix: Align Empty Mini Cart Contents block center in the Site Editor. (6379)
  • Remove the Template panel from the Setting Sidebar for Shop page. (6366)
  • Parse categories coming from the back-end as a json array. (6358)
  • Update the default width of Classic Template to Wide width. (6356)
  • Fix: Mini Cart block is not available from the Edit template screen. (6351)
  • Fix Filter Products by Attribute block not working on PHP templates when Filter button was enabled. (6332)
Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 7.6.0
Comparing to
See all releases

Code changes from version 7.5.0 to 7.6.0

Files changed (67) hide show
  1. assets/js/base/hocs/with-reviews.js +8 -4
  2. assets/js/blocks/active-filters/block.js +80 -5
  3. assets/js/blocks/active-filters/index.js +24 -1
  4. assets/js/blocks/active-filters/utils.js +23 -11
  5. assets/js/blocks/attribute-filter/block.js +45 -45
  6. assets/js/blocks/attribute-filter/index.js +28 -1
  7. assets/js/blocks/classic-template/editor.scss +6 -0
  8. assets/js/blocks/classic-template/index.tsx +6 -0
  9. assets/js/blocks/classic-template/style.scss +5 -0
  10. assets/js/blocks/featured-category/block.js +102 -12
  11. assets/js/blocks/featured-category/block.json +96 -0
  12. assets/js/blocks/featured-category/example.js +1 -0
  13. assets/js/blocks/featured-category/index.js +0 -203
  14. assets/js/blocks/featured-category/index.tsx +90 -0
  15. assets/js/blocks/featured-category/style.scss +15 -0
  16. assets/js/blocks/featured-product/block.js +101 -10
  17. assets/js/blocks/featured-product/block.json +100 -0
  18. assets/js/blocks/featured-product/example.js +1 -0
  19. assets/js/blocks/featured-product/index.js +0 -209
  20. assets/js/blocks/featured-product/index.tsx +89 -0
  21. assets/js/blocks/featured-product/style.scss +15 -0
  22. assets/js/blocks/handpicked-products/index.js +1 -0
  23. assets/js/blocks/mini-cart/mini-cart-contents/editor.scss +3 -1
  24. assets/js/blocks/mini-cart/mini-cart-contents/index.tsx +1 -0
  25. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/block.json +2 -1
  26. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx +3 -1
  27. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/block.json +2 -1
  28. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/block.json +2 -1
  29. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/block.json +2 -1
  30. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.json +2 -1
  31. assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/block.json +2 -1
  32. assets/js/blocks/mini-cart/style.scss +1 -1
  33. assets/js/blocks/price-filter/block.js +36 -6
  34. assets/js/blocks/price-filter/index.js +24 -4
  35. assets/js/blocks/product-tag/index.js +1 -0
  36. assets/js/blocks/products-by-attribute/index.js +1 -0
  37. assets/js/blocks/stock-filter/block.js +10 -0
  38. assets/js/blocks/stock-filter/test/block.js +14 -0
  39. assets/js/editor-components/grid-content-control/index.js +18 -1
  40. assets/js/utils/shared-attributes.js +1 -0
  41. build/active-filters-frontend.asset.php +1 -1
  42. build/active-filters-frontend.js +8 -6
  43. build/active-filters.asset.php +1 -1
  44. build/active-filters.js +10 -8
  45. build/all-products-frontend.asset.php +1 -1
  46. build/all-products-frontend.js +4 -4
  47. build/all-products.asset.php +1 -1
  48. build/all-products.js +13 -13
  49. build/all-reviews.asset.php +1 -1
  50. build/all-reviews.js +3 -3
  51. build/attribute-filter-frontend.asset.php +1 -1
  52. build/attribute-filter-frontend.js +7 -7
  53. build/attribute-filter.asset.php +1 -1
  54. build/attribute-filter.js +11 -11
  55. build/blocks-checkout.asset.php +1 -1
  56. build/cart-blocks/cart-express-payment-frontend.js +2 -2
  57. build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js +2 -2
  58. build/cart-blocks/cart-line-items-frontend.js +1 -1
  59. build/cart-blocks/cart-order-summary-frontend.js +1 -1
  60. build/cart-blocks/order-summary-discount-frontend.js +1 -1
  61. build/cart-blocks/order-summary-heading-frontend.js +1 -1
  62. build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js +1 -1
  63. build/cart-blocks/order-summary-shipping-frontend.js +1 -1
  64. build/cart-blocks/order-summary-taxes-frontend.js +1 -1
  65. build/cart-blocks/proceed-to-checkout-frontend.js +1 -1
  66. build/cart-frontend.asset.php +1 -1
  67. build/cart-frontend.js +3 -4
assets/js/base/hocs/with-reviews.js CHANGED
@@ -106,10 +106,14 @@ const withReviews = ( OriginalComponent ) => {
106
  offset: reviewsToSkip,
107
  };
108
 
109
- if ( categoryIds && categoryIds.length ) {
110
- args.category_id = Array.isArray( categoryIds )
111
- ? categoryIds.join( ',' )
112
- : categoryIds;
 
 
 
 
113
  }
114
 
115
  if ( productId ) {
106
  offset: reviewsToSkip,
107
  };
108
 
109
+ if ( categoryIds ) {
110
+ const categories = Array.isArray( categoryIds )
111
+ ? categoryIds
112
+ : JSON.parse( categoryIds );
113
+
114
+ args.category_id = Array.isArray( categories )
115
+ ? categories.join( ',' )
116
+ : categories;
117
  }
118
 
119
  if ( productId ) {
assets/js/blocks/active-filters/block.js CHANGED
@@ -1,14 +1,15 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { __ } from '@wordpress/i18n';
5
  import { useQueryStateByKey } from '@woocommerce/base-context/hooks';
6
  import { getSetting, getSettingWithCoercion } from '@woocommerce/settings';
7
- import { useMemo } from '@wordpress/element';
8
  import classnames from 'classnames';
9
  import PropTypes from 'prop-types';
10
  import Label from '@woocommerce/base-components/label';
11
  import { isBoolean } from '@woocommerce/types';
 
12
 
13
  /**
14
  * Internal dependencies
@@ -19,7 +20,7 @@ import {
19
  formatPriceRange,
20
  renderRemovableListItem,
21
  removeArgsFromFilterUrl,
22
- getBaseUrl,
23
  } from './utils';
24
  import ActiveAttributeFilters from './active-attribute-filters';
25
 
@@ -124,10 +125,74 @@ const ActiveFiltersBlock = ( {
124
  } );
125
  }, [ productAttributes, blockAttributes.displayStyle ] );
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  const hasFilters = () => {
128
  return (
129
  productAttributes.length > 0 ||
130
  productStockStatus.length > 0 ||
 
131
  Number.isFinite( minPrice ) ||
132
  Number.isFinite( maxPrice )
133
  );
@@ -138,6 +203,16 @@ const ActiveFiltersBlock = ( {
138
  }
139
 
140
  const TagName = `h${ blockAttributes.headingLevel }`;
 
 
 
 
 
 
 
 
 
 
141
  const listClasses = classnames( 'wc-block-active-filters__list', {
142
  'wc-block-active-filters__list--chips':
143
  blockAttributes.displayStyle === 'chips',
@@ -182,6 +257,7 @@ const ActiveFiltersBlock = ( {
182
  { activePriceFilters }
183
  { activeStockStatusFilters }
184
  { activeAttributeFilters }
 
185
  </>
186
  ) }
187
  </ul>
@@ -189,8 +265,7 @@ const ActiveFiltersBlock = ( {
189
  className="wc-block-active-filters__clear-all"
190
  onClick={ () => {
191
  if ( filteringForPhpTemplate ) {
192
- window.location.href = getBaseUrl();
193
- return;
194
  }
195
  setMinPrice( undefined );
196
  setMaxPrice( undefined );
1
  /**
2
  * External dependencies
3
  */
4
+ import { __, sprintf } from '@wordpress/i18n';
5
  import { useQueryStateByKey } from '@woocommerce/base-context/hooks';
6
  import { getSetting, getSettingWithCoercion } from '@woocommerce/settings';
7
+ import { useMemo, useEffect } from '@wordpress/element';
8
  import classnames from 'classnames';
9
  import PropTypes from 'prop-types';
10
  import Label from '@woocommerce/base-components/label';
11
  import { isBoolean } from '@woocommerce/types';
12
+ import { getUrlParameter } from '@woocommerce/utils';
13
 
14
  /**
15
  * Internal dependencies
20
  formatPriceRange,
21
  renderRemovableListItem,
22
  removeArgsFromFilterUrl,
23
+ cleanFilterUrl,
24
  } from './utils';
25
  import ActiveAttributeFilters from './active-attribute-filters';
26
 
125
  } );
126
  }, [ productAttributes, blockAttributes.displayStyle ] );
127
 
128
+ const [ productRatings, setProductRatings ] = useQueryStateByKey(
129
+ 'ratings'
130
+ );
131
+
132
+ /**
133
+ * Parse the filter URL to set the active rating fitlers.
134
+ * This code should be moved to Rating Filter block once it's implemented.
135
+ */
136
+ useEffect( () => {
137
+ if ( ! filteringForPhpTemplate ) {
138
+ return;
139
+ }
140
+
141
+ if ( productRatings.length && productRatings.length > 0 ) {
142
+ return;
143
+ }
144
+
145
+ const currentRatings = getUrlParameter( 'rating_filter' )?.toString();
146
+
147
+ if ( ! currentRatings ) {
148
+ return;
149
+ }
150
+
151
+ setProductRatings( currentRatings.split( ',' ) );
152
+ }, [ filteringForPhpTemplate, productRatings, setProductRatings ] );
153
+
154
+ const activeRatingFilters = useMemo( () => {
155
+ if ( productRatings.length > 0 ) {
156
+ return productRatings.map( ( slug ) => {
157
+ return renderRemovableListItem( {
158
+ type: __( 'Rating', 'woo-gutenberg-products-block' ),
159
+ name: sprintf(
160
+ /* translators: %s is referring to the average rating value */
161
+ __(
162
+ 'Rated %s out of 5',
163
+ 'woo-gutenberg-products-block'
164
+ ),
165
+ slug
166
+ ),
167
+ removeCallback: () => {
168
+ if ( filteringForPhpTemplate ) {
169
+ return removeArgsFromFilterUrl( {
170
+ rating_filter: slug,
171
+ } );
172
+ }
173
+ const newRatings = productRatings.filter(
174
+ ( rating ) => {
175
+ return rating !== slug;
176
+ }
177
+ );
178
+ setProductRatings( newRatings );
179
+ },
180
+ displayStyle: blockAttributes.displayStyle,
181
+ } );
182
+ } );
183
+ }
184
+ }, [
185
+ productRatings,
186
+ setProductRatings,
187
+ blockAttributes.displayStyle,
188
+ filteringForPhpTemplate,
189
+ ] );
190
+
191
  const hasFilters = () => {
192
  return (
193
  productAttributes.length > 0 ||
194
  productStockStatus.length > 0 ||
195
+ productRatings.length > 0 ||
196
  Number.isFinite( minPrice ) ||
197
  Number.isFinite( maxPrice )
198
  );
203
  }
204
 
205
  const TagName = `h${ blockAttributes.headingLevel }`;
206
+ const hasFilterableProducts = getSettingWithCoercion(
207
+ 'has_filterable_products',
208
+ false,
209
+ isBoolean
210
+ );
211
+
212
+ if ( ! hasFilterableProducts ) {
213
+ return null;
214
+ }
215
+
216
  const listClasses = classnames( 'wc-block-active-filters__list', {
217
  'wc-block-active-filters__list--chips':
218
  blockAttributes.displayStyle === 'chips',
257
  { activePriceFilters }
258
  { activeStockStatusFilters }
259
  { activeAttributeFilters }
260
+ { activeRatingFilters }
261
  </>
262
  ) }
263
  </ul>
265
  className="wc-block-active-filters__clear-all"
266
  onClick={ () => {
267
  if ( filteringForPhpTemplate ) {
268
+ return cleanFilterUrl();
 
269
  }
270
  setMinPrice( undefined );
271
  setMaxPrice( undefined );
assets/js/blocks/active-filters/index.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { registerBlockType } from '@wordpress/blocks';
6
  import { toggle } from '@woocommerce/icons';
7
  import { Icon } from '@wordpress/icons';
8
  import classNames from 'classnames';
@@ -55,6 +55,29 @@ registerBlockType( 'woocommerce/active-filters', {
55
  default: 3,
56
  },
57
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  edit,
59
  // Save the props to post content.
60
  save( { attributes } ) {
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { toggle } from '@woocommerce/icons';
7
  import { Icon } from '@wordpress/icons';
8
  import classNames from 'classnames';
55
  default: 3,
56
  },
57
  },
58
+ transforms: {
59
+ from: [
60
+ {
61
+ type: 'block',
62
+ blocks: [ 'core/legacy-widget' ],
63
+ // We can't transform if raw instance isn't shown in the REST API.
64
+ isMatch: ( { idBase, instance } ) =>
65
+ idBase === 'woocommerce_layered_nav_filters' &&
66
+ !! instance?.raw,
67
+ transform: ( { instance } ) =>
68
+ createBlock( 'woocommerce/active-filters', {
69
+ displayStyle: 'list',
70
+ heading:
71
+ instance?.raw?.title ||
72
+ __(
73
+ 'Active filters',
74
+ 'woo-gutenberg-products-block'
75
+ ),
76
+ headingLevel: 3,
77
+ } ),
78
+ },
79
+ ],
80
+ },
81
  edit,
82
  // Save the props to post content.
83
  save( { attributes } ) {
assets/js/blocks/active-filters/utils.js CHANGED
@@ -44,7 +44,7 @@ export const formatPriceRange = ( minPrice, maxPrice ) => {
44
  * @param {Object} listItem The removable item to render.
45
  * @param {string} listItem.type Type string.
46
  * @param {string} listItem.name Name string.
47
- * @param {string} listItem.prefix Prefix shown before item name.
48
  * @param {Function} listItem.removeCallback Callback to remove item.
49
  * @param {string} listItem.displayStyle Whether it's a list or chips.
50
  * @param {boolean} [listItem.showLabel=true] Should the label be shown for
@@ -53,7 +53,7 @@ export const formatPriceRange = ( minPrice, maxPrice ) => {
53
  export const renderRemovableListItem = ( {
54
  type,
55
  name,
56
- prefix,
57
  removeCallback = () => {},
58
  showLabel = true,
59
  displayStyle,
@@ -172,17 +172,29 @@ export const removeArgsFromFilterUrl = ( ...args ) => {
172
  };
173
 
174
  /**
175
- * Get the base URL for the current page.
176
- *
177
- * @return {string} The current URL without the query args.
178
  */
179
- export const getBaseUrl = () => {
180
  const url = window.location.href;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
- const queryStringIndex = url.indexOf( '?' );
183
- if ( queryStringIndex === -1 ) {
184
- return url;
185
- }
186
 
187
- return url.substring( 0, queryStringIndex );
188
  };
44
  * @param {Object} listItem The removable item to render.
45
  * @param {string} listItem.type Type string.
46
  * @param {string} listItem.name Name string.
47
+ * @param {string} [listItem.prefix=''] Prefix shown before item name.
48
  * @param {Function} listItem.removeCallback Callback to remove item.
49
  * @param {string} listItem.displayStyle Whether it's a list or chips.
50
  * @param {boolean} [listItem.showLabel=true] Should the label be shown for
53
  export const renderRemovableListItem = ( {
54
  type,
55
  name,
56
+ prefix = '',
57
  removeCallback = () => {},
58
  showLabel = true,
59
  displayStyle,
172
  };
173
 
174
  /**
175
+ * Clean the filter URL.
 
 
176
  */
177
+ export const cleanFilterUrl = () => {
178
  const url = window.location.href;
179
+ const args = getQueryArgs( url );
180
+ const cleanUrl = removeQueryArgs( url, ...Object.keys( args ) );
181
+ const remainingArgs = Object.fromEntries(
182
+ Object.keys( args )
183
+ .filter( ( arg ) => {
184
+ if (
185
+ arg.includes( 'min_price' ) ||
186
+ arg.includes( 'max_price' ) ||
187
+ arg.includes( 'rating_filter' ) ||
188
+ arg.includes( 'filter_' ) ||
189
+ arg.includes( 'query_type_' )
190
+ ) {
191
+ return false;
192
+ }
193
 
194
+ return true;
195
+ } )
196
+ .map( ( key ) => [ key, args[ key ] ] )
197
+ );
198
 
199
+ window.location.href = addQueryArgs( cleanUrl, remainingArgs );
200
  };
assets/js/blocks/attribute-filter/block.js CHANGED
@@ -63,6 +63,12 @@ const AttributeFilterBlock = ( {
63
  attributes: blockAttributes,
64
  isEditor = false,
65
  } ) => {
 
 
 
 
 
 
66
  const filteringForPhpTemplate = getSettingWithCoercion(
67
  'is_rendering_php_template',
68
  false,
@@ -268,35 +274,47 @@ const AttributeFilterBlock = ( {
268
  [ pageUrl, attributeObject?.taxonomy ]
269
  );
270
 
271
- const onSubmit = useCallback(
272
- ( isChecked ) => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  if ( isEditor ) {
274
  return;
275
  }
276
 
277
- const query = updateAttributeFilter(
278
- productAttributesQuery,
279
- setProductAttributesQuery,
280
- attributeObject,
281
- getSelectedTerms( isChecked ),
282
- blockAttributes.queryType === 'or' ? 'in' : 'and'
283
- );
284
-
285
- // This is for PHP rendered template filtering only.
286
- if ( filteringForPhpTemplate && hasSetPhpFilterDefaults ) {
287
- redirectPageForPhpTemplate( query, isChecked.length === 0 );
288
  }
289
  },
290
  [
291
- hasSetPhpFilterDefaults,
292
- filteringForPhpTemplate,
293
- redirectPageForPhpTemplate,
294
  isEditor,
 
295
  productAttributesQuery,
296
  setProductAttributesQuery,
297
  attributeObject,
298
  getSelectedTerms,
299
  blockAttributes.queryType,
 
300
  ]
301
  );
302
 
@@ -316,17 +334,13 @@ const AttributeFilterBlock = ( {
316
  ! isShallowEqual( previousCheckedQuery, currentCheckedQuery ) && // checked query changed
317
  ! isShallowEqual( checked, currentCheckedQuery ) // checked query doesn't match the UI
318
  ) {
319
- setChecked( currentCheckedQuery );
320
- if ( ! blockAttributes.showFilterButton ) {
321
- onSubmit( currentCheckedQuery );
322
- }
323
  }
324
  }, [
325
  checked,
326
  currentCheckedQuery,
327
  previousCheckedQuery,
328
- onSubmit,
329
- blockAttributes.showFilterButton,
330
  ] );
331
 
332
  const multiple =
@@ -413,18 +427,9 @@ const AttributeFilterBlock = ( {
413
  }
414
  }
415
 
416
- setChecked( newChecked );
417
- if ( ! blockAttributes.showFilterButton ) {
418
- onSubmit( newChecked );
419
- }
420
  },
421
- [
422
- checked,
423
- displayedOptions,
424
- multiple,
425
- onSubmit,
426
- blockAttributes.showFilterButton,
427
- ]
428
  );
429
 
430
  /**
@@ -466,7 +471,7 @@ const AttributeFilterBlock = ( {
466
  * Important: For PHP rendered block templates only.
467
  *
468
  * When we set the default parameter values which we get from the URL in the above useEffect(),
469
- * we need to run onSubmit which will set these values in state for the Active Filters block.
470
  */
471
  useEffect( () => {
472
  if ( filteringForPhpTemplate ) {
@@ -480,26 +485,21 @@ const AttributeFilterBlock = ( {
480
  ! attributeTermsLoading
481
  ) {
482
  setHasSetPhpFilterDefaults( true );
483
- updateAttributeFilter(
484
- productAttributesQuery,
485
- setProductAttributesQuery,
486
- attributeObject,
487
- getSelectedTerms( activeFilters ),
488
- blockAttributes.queryType === 'or' ? 'in' : 'and'
489
- );
490
  }
491
  }
492
  }, [
493
- productAttributesQuery,
494
- setProductAttributesQuery,
495
  attributeObject,
496
- blockAttributes.queryType,
497
- getSelectedTerms,
498
  filteringForPhpTemplate,
499
  hasSetPhpFilterDefaults,
500
  attributeTermsLoading,
 
501
  ] );
502
 
 
 
 
 
503
  // Short-circuit if no attribute is selected.
504
  if ( ! attributeObject ) {
505
  if ( isEditor ) {
63
  attributes: blockAttributes,
64
  isEditor = false,
65
  } ) => {
66
+ const hasFilterableProducts = getSettingWithCoercion(
67
+ 'has_filterable_products',
68
+ false,
69
+ isBoolean
70
+ );
71
+
72
  const filteringForPhpTemplate = getSettingWithCoercion(
73
  'is_rendering_php_template',
74
  false,
274
  [ pageUrl, attributeObject?.taxonomy ]
275
  );
276
 
277
+ const onSubmit = ( checkedFilters ) => {
278
+ const query = updateAttributeFilter(
279
+ productAttributesQuery,
280
+ setProductAttributesQuery,
281
+ attributeObject,
282
+ getSelectedTerms( checkedFilters ),
283
+ blockAttributes.queryType === 'or' ? 'in' : 'and'
284
+ );
285
+
286
+ // This is for PHP rendered template filtering only.
287
+ if ( filteringForPhpTemplate ) {
288
+ redirectPageForPhpTemplate( query, checkedFilters.length === 0 );
289
+ }
290
+ };
291
+
292
+ const updateCheckedFilters = useCallback(
293
+ ( checkedFilters ) => {
294
  if ( isEditor ) {
295
  return;
296
  }
297
 
298
+ setChecked( checkedFilters );
299
+ if ( ! blockAttributes.showFilterButton ) {
300
+ updateAttributeFilter(
301
+ productAttributesQuery,
302
+ setProductAttributesQuery,
303
+ attributeObject,
304
+ getSelectedTerms( checkedFilters ),
305
+ blockAttributes.queryType === 'or' ? 'in' : 'and'
306
+ );
 
 
307
  }
308
  },
309
  [
 
 
 
310
  isEditor,
311
+ setChecked,
312
  productAttributesQuery,
313
  setProductAttributesQuery,
314
  attributeObject,
315
  getSelectedTerms,
316
  blockAttributes.queryType,
317
+ blockAttributes.showFilterButton,
318
  ]
319
  );
320
 
334
  ! isShallowEqual( previousCheckedQuery, currentCheckedQuery ) && // checked query changed
335
  ! isShallowEqual( checked, currentCheckedQuery ) // checked query doesn't match the UI
336
  ) {
337
+ updateCheckedFilters( currentCheckedQuery );
 
 
 
338
  }
339
  }, [
340
  checked,
341
  currentCheckedQuery,
342
  previousCheckedQuery,
343
+ updateCheckedFilters,
 
344
  ] );
345
 
346
  const multiple =
427
  }
428
  }
429
 
430
+ updateCheckedFilters( newChecked );
 
 
 
431
  },
432
+ [ checked, displayedOptions, multiple, updateCheckedFilters ]
 
 
 
 
 
 
433
  );
434
 
435
  /**
471
  * Important: For PHP rendered block templates only.
472
  *
473
  * When we set the default parameter values which we get from the URL in the above useEffect(),
474
+ * we need to run updateCheckedFilters which will set these values in state for the Active Filters block.
475
  */
476
  useEffect( () => {
477
  if ( filteringForPhpTemplate ) {
485
  ! attributeTermsLoading
486
  ) {
487
  setHasSetPhpFilterDefaults( true );
488
+ updateCheckedFilters( activeFilters );
 
 
 
 
 
 
489
  }
490
  }
491
  }, [
 
 
492
  attributeObject,
 
 
493
  filteringForPhpTemplate,
494
  hasSetPhpFilterDefaults,
495
  attributeTermsLoading,
496
+ updateCheckedFilters,
497
  ] );
498
 
499
+ if ( ! hasFilterableProducts ) {
500
+ return null;
501
+ }
502
+
503
  // Short-circuit if no attribute is selected.
504
  if ( ! attributeObject ) {
505
  if ( isEditor ) {
assets/js/blocks/attribute-filter/index.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { registerBlockType } from '@wordpress/blocks';
6
  import { useBlockProps } from '@wordpress/block-editor';
7
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
8
  import { Icon, category } from '@wordpress/icons';
@@ -89,6 +89,33 @@ registerBlockType( 'woocommerce/attribute-filter', {
89
  default: false,
90
  },
91
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  edit,
93
  // Save the props to post content.
94
  save( { attributes } ) {
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { useBlockProps } from '@wordpress/block-editor';
7
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
8
  import { Icon, category } from '@wordpress/icons';
89
  default: false,
90
  },
91
  },
92
+ transforms: {
93
+ from: [
94
+ {
95
+ type: 'block',
96
+ blocks: [ 'core/legacy-widget' ],
97
+ // We can't transform if raw instance isn't shown in the REST API.
98
+ isMatch: ( { idBase, instance } ) =>
99
+ idBase === 'woocommerce_layered_nav' && !! instance?.raw,
100
+ transform: ( { instance } ) =>
101
+ createBlock( 'woocommerce/attribute-filter', {
102
+ attributeId: 0,
103
+ showCounts: true,
104
+ queryType: instance?.raw?.query_type || 'or',
105
+ heading:
106
+ instance?.raw?.title ||
107
+ __(
108
+ 'Filter by attribute',
109
+ 'woo-gutenberg-products-block'
110
+ ),
111
+ headingLevel: 3,
112
+ displayStyle: instance?.raw?.display_type || 'list',
113
+ showFilterButton: false,
114
+ isPreview: false,
115
+ } ),
116
+ },
117
+ ],
118
+ },
119
  edit,
120
  // Save the props to post content.
121
  save( { attributes } ) {
assets/js/blocks/classic-template/editor.scss CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  .wp-block-woocommerce-classic-template__placeholder-copy {
2
  max-width: 900px;
3
  margin-bottom: 30px;
1
+ :where(.wp-block-woocommerce-legacy-template) {
2
+ margin-left: auto;
3
+ margin-right: auto;
4
+ max-width: 1000px;
5
+ }
6
+
7
  .wp-block-woocommerce-classic-template__placeholder-copy {
8
  max-width: 900px;
9
  margin-bottom: 30px;
assets/js/blocks/classic-template/index.tsx CHANGED
@@ -12,11 +12,13 @@ import { box, Icon } from '@wordpress/icons';
12
  * Internal dependencies
13
  */
14
  import './editor.scss';
 
15
  import { TEMPLATES } from './constants';
16
 
17
  interface Props {
18
  attributes: {
19
  template: string;
 
20
  };
21
  }
22
 
@@ -109,6 +111,10 @@ registerBlockType( 'woocommerce/legacy-template', {
109
  type: 'string',
110
  default: 'any',
111
  },
 
 
 
 
112
  },
113
  edit: Edit,
114
  save: () => null,
12
  * Internal dependencies
13
  */
14
  import './editor.scss';
15
+ import './style.scss';
16
  import { TEMPLATES } from './constants';
17
 
18
  interface Props {
19
  attributes: {
20
  template: string;
21
+ align: string;
22
  };
23
  }
24
 
111
  type: 'string',
112
  default: 'any',
113
  },
114
+ align: {
115
+ type: 'string',
116
+ default: 'wide',
117
+ },
118
  },
119
  edit: Edit,
120
  save: () => null,
assets/js/blocks/classic-template/style.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ :where(div[data-block-name="woocommerce/legacy-template"]) {
2
+ margin-left: auto;
3
+ margin-right: auto;
4
+ max-width: 1000px;
5
+ }
assets/js/blocks/featured-category/block.js CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * External dependencies
5
  */
6
- import { useCallback } from 'react';
7
  import { __ } from '@wordpress/i18n';
8
  import {
9
  AlignmentToolbar,
@@ -13,6 +13,8 @@ import {
13
  MediaReplaceFlow,
14
  RichText,
15
  __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
 
 
16
  __experimentalPanelColorGradientSettings as PanelColorGradientSettings,
17
  __experimentalUseGradient as useGradient,
18
  } from '@wordpress/block-editor';
@@ -24,10 +26,13 @@ import {
24
  RangeControl,
25
  Spinner,
26
  ToggleControl,
 
27
  ToolbarGroup,
28
  withSpokenMessages,
29
  __experimentalToggleGroupControl as ToggleGroupControl,
30
  __experimentalToggleGroupControlOption as ToggleGroupControlOption,
 
 
31
  } from '@wordpress/components';
32
  import classnames from 'classnames';
33
  import { Component } from '@wordpress/element';
@@ -35,7 +40,7 @@ import { withSelect } from '@wordpress/data';
35
  import { compose, createHigherOrderComponent } from '@wordpress/compose';
36
  import PropTypes from 'prop-types';
37
  import { folderStarred } from '@woocommerce/icons';
38
- import { Icon } from '@wordpress/icons';
39
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
40
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
41
  import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
@@ -52,6 +57,11 @@ import { withCategory } from '../../hocs';
52
  import { calculateBackgroundImagePosition } from '../featured-product/utils';
53
  import { ConstrainedResizable } from '../featured-product/block';
54
 
 
 
 
 
 
55
  /**
56
  * Component to handle edit mode of "Featured Category".
57
  *
@@ -77,11 +87,18 @@ const FeaturedCategory = ( {
77
  debouncedSpeak,
78
  triggerUrlUpdate = () => void null,
79
  } ) => {
 
 
 
 
80
  const { setGradient } = useGradient( {
81
  gradientAttribute: 'overlayGradient',
82
  customGradientAttribute: 'overlayGradient',
83
  } );
84
 
 
 
 
85
  const onResize = useCallback(
86
  ( _event, _direction, elt ) => {
87
  setAttributes( { minHeight: parseInt( elt.style.height, 10 ) } );
@@ -89,6 +106,10 @@ const FeaturedCategory = ( {
89
  [ setAttributes ]
90
  );
91
 
 
 
 
 
92
  const renderApiError = () => (
93
  <ErrorPlaceholder
94
  className="wc-block-featured-category-error"
@@ -99,8 +120,7 @@ const FeaturedCategory = ( {
99
  );
100
 
101
  const getBlockControls = () => {
102
- const { contentAlign, mediaSrc } = attributes;
103
- const mediaId = attributes.mediaId || getCategoryImageId( category );
104
 
105
  return (
106
  <BlockControls>
@@ -111,8 +131,18 @@ const FeaturedCategory = ( {
111
  } }
112
  />
113
  <ToolbarGroup>
 
 
 
 
 
 
 
 
 
 
114
  <MediaReplaceFlow
115
- mediaId={ mediaId }
116
  mediaURL={ mediaSrc }
117
  accept="image/*"
118
  onSelect={ ( media ) => {
@@ -123,7 +153,7 @@ const FeaturedCategory = ( {
123
  } }
124
  allowedTypes={ [ 'image' ] }
125
  />
126
- { mediaId && mediaSrc ? (
127
  <TextToolbarButton
128
  onClick={ () =>
129
  setAttributes( { mediaId: 0, mediaSrc: '' } )
@@ -152,7 +182,6 @@ const FeaturedCategory = ( {
152
  };
153
 
154
  const getInspectorControls = () => {
155
- const url = attributes.mediaSrc || getCategoryImageSrc( category );
156
  const { focalPoint = { x: 0.5, y: 0.5 } } = attributes;
157
  // FocalPointPicker was introduced in Gutenberg 5.0 (WordPress 5.2),
158
  // so we need to check if it exists before using it.
@@ -174,7 +203,7 @@ const FeaturedCategory = ( {
174
  }
175
  />
176
  </PanelBody>
177
- { !! url && (
178
  <>
179
  { focalPointPickerExists && (
180
  <PanelBody
@@ -232,7 +261,7 @@ const FeaturedCategory = ( {
232
  'Focal Point Picker',
233
  'woo-gutenberg-products-block'
234
  ) }
235
- url={ url }
236
  value={ focalPoint }
237
  onChange={ ( value ) =>
238
  setAttributes( {
@@ -240,6 +269,30 @@ const FeaturedCategory = ( {
240
  } )
241
  }
242
  />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  </PanelBody>
244
  ) }
245
  <PanelColorGradientSettings
@@ -393,7 +446,6 @@ const FeaturedCategory = ( {
393
  dimRatio,
394
  focalPoint,
395
  imageFit,
396
- mediaSrc,
397
  minHeight,
398
  overlayColor,
399
  overlayGradient,
@@ -417,8 +469,6 @@ const FeaturedCategory = ( {
417
  borderRadius: style?.border?.radius,
418
  };
419
 
420
- const backgroundImageSrc = mediaSrc || getCategoryImageSrc( category );
421
-
422
  const wrapperStyle = {
423
  ...getSpacingClassesAndStyles( attributes ).style,
424
  minHeight,
@@ -457,6 +507,12 @@ const FeaturedCategory = ( {
457
  className="wc-block-featured-category__background-image"
458
  src={ backgroundImageSrc }
459
  style={ backgroundImageStyle }
 
 
 
 
 
 
460
  />
461
  ) }
462
  <h2
@@ -509,6 +565,40 @@ const FeaturedCategory = ( {
509
  return renderEditMode();
510
  }
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  return (
513
  <>
514
  { getBlockControls() }
3
  /**
4
  * External dependencies
5
  */
6
+ import { useCallback, useEffect, useState } from 'react';
7
  import { __ } from '@wordpress/i18n';
8
  import {
9
  AlignmentToolbar,
13
  MediaReplaceFlow,
14
  RichText,
15
  __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
16
+ __experimentalImageEditingProvider as ImageEditingProvider,
17
+ __experimentalImageEditor as ImageEditor,
18
  __experimentalPanelColorGradientSettings as PanelColorGradientSettings,
19
  __experimentalUseGradient as useGradient,
20
  } from '@wordpress/block-editor';
26
  RangeControl,
27
  Spinner,
28
  ToggleControl,
29
+ ToolbarButton,
30
  ToolbarGroup,
31
  withSpokenMessages,
32
  __experimentalToggleGroupControl as ToggleGroupControl,
33
  __experimentalToggleGroupControlOption as ToggleGroupControlOption,
34
+ TextareaControl,
35
+ ExternalLink,
36
  } from '@wordpress/components';
37
  import classnames from 'classnames';
38
  import { Component } from '@wordpress/element';
40
  import { compose, createHigherOrderComponent } from '@wordpress/compose';
41
  import PropTypes from 'prop-types';
42
  import { folderStarred } from '@woocommerce/icons';
43
+ import { crop, Icon } from '@wordpress/icons';
44
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
45
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
46
  import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
57
  import { calculateBackgroundImagePosition } from '../featured-product/utils';
58
  import { ConstrainedResizable } from '../featured-product/block';
59
 
60
+ const DEFAULT_EDITOR_SIZE = {
61
+ height: 500,
62
+ width: 500,
63
+ };
64
+
65
  /**
66
  * Component to handle edit mode of "Featured Category".
67
  *
87
  debouncedSpeak,
88
  triggerUrlUpdate = () => void null,
89
  } ) => {
90
+ const { mediaId, mediaSrc } = attributes;
91
+
92
+ const [ isEditingImage, setIsEditingImage ] = useState( false );
93
+ const [ backgroundImageSize, setBackgroundImageSize ] = useState( {} );
94
  const { setGradient } = useGradient( {
95
  gradientAttribute: 'overlayGradient',
96
  customGradientAttribute: 'overlayGradient',
97
  } );
98
 
99
+ const backgroundImageSrc = mediaSrc || getCategoryImageSrc( category );
100
+ const backgroundImageId = mediaId || getCategoryImageId( category );
101
+
102
  const onResize = useCallback(
103
  ( _event, _direction, elt ) => {
104
  setAttributes( { minHeight: parseInt( elt.style.height, 10 ) } );
106
  [ setAttributes ]
107
  );
108
 
109
+ useEffect( () => {
110
+ setIsEditingImage( false );
111
+ }, [ isSelected ] );
112
+
113
  const renderApiError = () => (
114
  <ErrorPlaceholder
115
  className="wc-block-featured-category-error"
120
  );
121
 
122
  const getBlockControls = () => {
123
+ const { contentAlign, editMode } = attributes;
 
124
 
125
  return (
126
  <BlockControls>
131
  } }
132
  />
133
  <ToolbarGroup>
134
+ { backgroundImageSrc && ! isEditingImage && (
135
+ <ToolbarButton
136
+ onClick={ () => setIsEditingImage( true ) }
137
+ icon={ crop }
138
+ label={ __(
139
+ 'Edit category image',
140
+ 'woo-gutenberg-products-block'
141
+ ) }
142
+ />
143
+ ) }
144
  <MediaReplaceFlow
145
+ mediaId={ backgroundImageId }
146
  mediaURL={ mediaSrc }
147
  accept="image/*"
148
  onSelect={ ( media ) => {
153
  } }
154
  allowedTypes={ [ 'image' ] }
155
  />
156
+ { backgroundImageId && mediaSrc ? (
157
  <TextToolbarButton
158
  onClick={ () =>
159
  setAttributes( { mediaId: 0, mediaSrc: '' } )
182
  };
183
 
184
  const getInspectorControls = () => {
 
185
  const { focalPoint = { x: 0.5, y: 0.5 } } = attributes;
186
  // FocalPointPicker was introduced in Gutenberg 5.0 (WordPress 5.2),
187
  // so we need to check if it exists before using it.
203
  }
204
  />
205
  </PanelBody>
206
+ { !! backgroundImageSrc && (
207
  <>
208
  { focalPointPickerExists && (
209
  <PanelBody
261
  'Focal Point Picker',
262
  'woo-gutenberg-products-block'
263
  ) }
264
+ url={ backgroundImageSrc }
265
  value={ focalPoint }
266
  onChange={ ( value ) =>
267
  setAttributes( {
269
  } )
270
  }
271
  />
272
+ <TextareaControl
273
+ label={ __(
274
+ 'Alt text (alternative text)',
275
+ 'woo-gutenberg-products-block'
276
+ ) }
277
+ value={ attributes.alt }
278
+ onChange={ ( alt ) => {
279
+ setAttributes( { alt } );
280
+ } }
281
+ help={
282
+ <>
283
+ <ExternalLink href="https://www.w3.org/WAI/tutorials/images/decision-tree">
284
+ { __(
285
+ 'Describe the purpose of the image',
286
+ 'woo-gutenberg-products-block'
287
+ ) }
288
+ </ExternalLink>
289
+ { __(
290
+ 'Leaving it empty will use the category name.',
291
+ 'woo-gutenberg-products-block'
292
+ ) }
293
+ </>
294
+ }
295
+ />
296
  </PanelBody>
297
  ) }
298
  <PanelColorGradientSettings
446
  dimRatio,
447
  focalPoint,
448
  imageFit,
 
449
  minHeight,
450
  overlayColor,
451
  overlayGradient,
469
  borderRadius: style?.border?.radius,
470
  };
471
 
 
 
472
  const wrapperStyle = {
473
  ...getSpacingClassesAndStyles( attributes ).style,
474
  minHeight,
507
  className="wc-block-featured-category__background-image"
508
  src={ backgroundImageSrc }
509
  style={ backgroundImageStyle }
510
+ onLoad={ ( e ) => {
511
+ setBackgroundImageSize( {
512
+ height: e.target?.naturalHeight,
513
+ width: e.target?.naturalWidth,
514
+ } );
515
+ } }
516
  />
517
  ) }
518
  <h2
565
  return renderEditMode();
566
  }
567
 
568
+ if ( isEditingImage ) {
569
+ return (
570
+ <>
571
+ <ImageEditingProvider
572
+ id={ backgroundImageId }
573
+ url={ backgroundImageSrc }
574
+ naturalHeight={
575
+ backgroundImageSize.height || DEFAULT_EDITOR_SIZE.height
576
+ }
577
+ naturalWidth={
578
+ backgroundImageSize.width || DEFAULT_EDITOR_SIZE.width
579
+ }
580
+ onSaveImage={ ( { id, url } ) => {
581
+ setAttributes( { mediaId: id, mediaSrc: url } );
582
+ } }
583
+ isEditing={ isEditingImage }
584
+ onFinishEditing={ () => setIsEditingImage( false ) }
585
+ >
586
+ <ImageEditor
587
+ url={ backgroundImageSrc }
588
+ height={
589
+ backgroundImageSize.height ||
590
+ DEFAULT_EDITOR_SIZE.height
591
+ }
592
+ width={
593
+ backgroundImageSize.width ||
594
+ DEFAULT_EDITOR_SIZE.width
595
+ }
596
+ />
597
+ </ImageEditingProvider>
598
+ </>
599
+ );
600
+ }
601
+
602
  return (
603
  <>
604
  { getBlockControls() }
assets/js/blocks/featured-category/block.json ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "woocommerce/featured-category",
3
+ "version": "1.0.0",
4
+ "title": "Featured Category",
5
+ "category": "woocommerce",
6
+ "keywords": [
7
+ "WooCommerce"
8
+ ],
9
+ "description": "Visually highlight a product category and encourage prompt action.",
10
+ "supports": {
11
+ "align": [
12
+ "wide",
13
+ "full"
14
+ ],
15
+ "html": false,
16
+ "color": {
17
+ "background": true,
18
+ "text": true,
19
+ "__experimentalDuotone": ".wc-block-featured-category__background-image"
20
+ },
21
+ "spacing": {
22
+ "padding": true,
23
+ "__experimentalDefaultControls": {
24
+ "padding": true
25
+ },
26
+ "__experimentalSkipSerialization": true
27
+ },
28
+ "__experimentalBorder": {
29
+ "color": true,
30
+ "radius": true,
31
+ "width": true,
32
+ "__experimentalSkipSerialization": true
33
+ }
34
+ },
35
+ "attributes": {
36
+ "alt": {
37
+ "type": "string",
38
+ "default": ""
39
+ },
40
+ "contentAlign": {
41
+ "type": "string",
42
+ "default": "center"
43
+ },
44
+ "dimRatio": {
45
+ "type": "number",
46
+ "default": 50
47
+ },
48
+ "editMode": {
49
+ "type": "boolean",
50
+ "default": true
51
+ },
52
+ "focalPoint": {
53
+ "type": "object",
54
+ "default": false
55
+ },
56
+ "imageFit": {
57
+ "type": "string",
58
+ "default": "none"
59
+ },
60
+ "mediaId": {
61
+ "type": "number",
62
+ "default": 0
63
+ },
64
+ "mediaSrc": {
65
+ "type": "string",
66
+ "default": ""
67
+ },
68
+ "minHeight": {
69
+ "type": "number",
70
+ "default": 500
71
+ },
72
+ "linkText": {
73
+ "type": "string"
74
+ },
75
+ "categoryId": {
76
+ "type": "number"
77
+ },
78
+ "overlayColor": {
79
+ "type": "string",
80
+ "default": "#000000"
81
+ },
82
+ "overlayGradient": {
83
+ "type": "string"
84
+ },
85
+ "previewCategory": {
86
+ "type": "object",
87
+ "default": null
88
+ },
89
+ "showDesc": {
90
+ "type": "boolean",
91
+ "default": true
92
+ }
93
+ },
94
+ "textdomain": "woo-gutenberg-products-block",
95
+ "apiVersion": 2
96
+ }
assets/js/blocks/featured-category/example.js CHANGED
@@ -6,6 +6,7 @@ import { previewCategories } from '@woocommerce/resource-previews';
6
 
7
  export const example = {
8
  attributes: {
 
9
  contentAlign: 'center',
10
  dimRatio: 50,
11
  editMode: false,
6
 
7
  export const example = {
8
  attributes: {
9
+ alt: '',
10
  contentAlign: 'center',
11
  dimRatio: 50,
12
  editMode: false,
assets/js/blocks/featured-category/index.js CHANGED
@@ -1,203 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
- import { InnerBlocks } from '@wordpress/block-editor';
6
- import { registerBlockType } from '@wordpress/blocks';
7
- import { getSetting } from '@woocommerce/settings';
8
- import { folderStarred } from '@woocommerce/icons';
9
- import { Icon } from '@wordpress/icons';
10
- import { isFeaturePluginBuild } from '@woocommerce/block-settings';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import './style.scss';
16
- import './editor.scss';
17
- import { example } from './example';
18
- import { Edit } from './edit';
19
-
20
- /**
21
- * Register and run the "Featured Category" block.
22
- */
23
- registerBlockType( 'woocommerce/featured-category', {
24
- apiVersion: 2,
25
- title: __( 'Featured Category', 'woo-gutenberg-products-block' ),
26
- icon: {
27
- src: (
28
- <Icon
29
- icon={ folderStarred }
30
- className="wc-block-editor-components-block-icon"
31
- />
32
- ),
33
- },
34
- category: 'woocommerce',
35
- keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
36
- description: __(
37
- 'Visually highlight a product category and encourage prompt action.',
38
- 'woo-gutenberg-products-block'
39
- ),
40
- supports: {
41
- align: [ 'wide', 'full' ],
42
- html: false,
43
- color: {
44
- background: false,
45
- text: true,
46
- ...( isFeaturePluginBuild() && {
47
- __experimentalDuotone:
48
- '.wc-block-featured-category__background-image',
49
- } ),
50
- },
51
- spacing: {
52
- padding: true,
53
- ...( isFeaturePluginBuild() && {
54
- __experimentalDefaultControls: {
55
- padding: true,
56
- },
57
- __experimentalSkipSerialization: true,
58
- } ),
59
- },
60
- ...( isFeaturePluginBuild() && {
61
- __experimentalBorder: {
62
- color: true,
63
- radius: true,
64
- width: true,
65
- __experimentalSkipSerialization: true,
66
- },
67
- } ),
68
- },
69
- example,
70
- attributes: {
71
- /**
72
- * Alignment of content inside block.
73
- */
74
- contentAlign: {
75
- type: 'string',
76
- default: 'center',
77
- },
78
-
79
- /**
80
- * Percentage opacity of overlay.
81
- */
82
- dimRatio: {
83
- type: 'number',
84
- default: 50,
85
- },
86
-
87
- /**
88
- * Toggle for edit mode in the block preview.
89
- */
90
- editMode: {
91
- type: 'boolean',
92
- default: true,
93
- },
94
-
95
- /**
96
- * Focus point for the background image
97
- */
98
- focalPoint: {
99
- type: 'object',
100
- },
101
-
102
- /**
103
- * Whether the image should fit the container or not be resized
104
- *
105
- * Note: when the image is resized to fit the container, the user loses
106
- * the ability to have full control over the focus.
107
- */
108
- imageFit: {
109
- type: 'string',
110
- default: 'none',
111
- },
112
-
113
- /**
114
- * ID for a custom image, overriding the product's featured image.
115
- */
116
- mediaId: {
117
- type: 'number',
118
- default: 0,
119
- },
120
-
121
- /**
122
- * URL for a custom image, overriding the product's featured image.
123
- */
124
- mediaSrc: {
125
- type: 'string',
126
- default: '',
127
- },
128
-
129
- /**
130
- * A minimum height for the block.
131
- *
132
- * Note: if padding is increased, this way the inner content will never
133
- * overflow, but instead will resize the container.
134
- *
135
- * It was decided to change this to make this block more in line with
136
- * the “Cover” block.
137
- */
138
- minHeight: {
139
- type: 'number',
140
- default: getSetting( 'default_height', 500 ),
141
- },
142
-
143
- /**
144
- * Text for the category link.
145
- */
146
- linkText: {
147
- type: 'string',
148
- default: __( 'Shop now', 'woo-gutenberg-products-block' ),
149
- },
150
-
151
- /**
152
- * The category ID to display.
153
- */
154
- categoryId: {
155
- type: 'number',
156
- },
157
-
158
- /**
159
- * Color for the overlay layer on top of the product image.
160
- */
161
- overlayColor: {
162
- type: 'string',
163
- default: '#000000',
164
- },
165
-
166
- /**
167
- * Gradient for the overlay layer on top of the product image.
168
- */
169
- overlayGradient: {
170
- type: 'string',
171
- },
172
-
173
- /**
174
- * Category preview.
175
- */
176
- previewCategory: {
177
- type: 'object',
178
- default: null,
179
- },
180
-
181
- /**
182
- * Show the category description.
183
- */
184
- showDesc: {
185
- type: 'boolean',
186
- default: true,
187
- },
188
- },
189
-
190
- /**
191
- * Renders and manages the block.
192
- *
193
- * @param {Object} props Props to pass to block.
194
- */
195
- edit: Edit,
196
-
197
- /**
198
- * Block content is rendered in PHP, not via save function.
199
- */
200
- save: () => {
201
- return <InnerBlocks.Content />;
202
- },
203
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/blocks/featured-category/index.tsx ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { InnerBlocks } from '@wordpress/block-editor';
5
+ import { registerBlockType } from '@wordpress/blocks';
6
+ import { getSetting } from '@woocommerce/settings';
7
+ import { folderStarred } from '@woocommerce/icons';
8
+ import { Icon } from '@wordpress/icons';
9
+ import { isFeaturePluginBuild } from '@woocommerce/block-settings';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import './style.scss';
15
+ import './editor.scss';
16
+ import { example } from './example';
17
+ import { Edit } from './edit';
18
+ import metadata from './block.json';
19
+
20
+ /**
21
+ * Register and run the "Featured Category" block.
22
+ */
23
+ registerBlockType( metadata, {
24
+ icon: {
25
+ src: (
26
+ <Icon
27
+ icon={ folderStarred }
28
+ className="wc-block-editor-components-block-icon"
29
+ />
30
+ ),
31
+ },
32
+ attributes: {
33
+ ...metadata.attributes,
34
+ /**
35
+ * A minimum height for the block.
36
+ *
37
+ * Note: if padding is increased, this way the inner content will never
38
+ * overflow, but instead will resize the container.
39
+ *
40
+ * It was decided to change this to make this block more in line with
41
+ * the “Cover” block.
42
+ */
43
+ minHeight: {
44
+ type: 'number',
45
+ default: getSetting( 'default_height', 500 ),
46
+ },
47
+ },
48
+ supports: {
49
+ ...metadata.supports,
50
+ color: {
51
+ background: true,
52
+ text: true,
53
+ ...( isFeaturePluginBuild() && {
54
+ __experimentalDuotone:
55
+ '.wc-block-featured-category__background-image',
56
+ } ),
57
+ },
58
+ spacing: {
59
+ padding: true,
60
+ ...( isFeaturePluginBuild() && {
61
+ __experimentalDefaultControls: {
62
+ padding: true,
63
+ },
64
+ __experimentalSkipSerialization: true,
65
+ } ),
66
+ },
67
+ ...( isFeaturePluginBuild() && {
68
+ __experimentalBorder: {
69
+ color: true,
70
+ radius: true,
71
+ width: true,
72
+ __experimentalSkipSerialization: true,
73
+ },
74
+ } ),
75
+ },
76
+ example,
77
+ /**
78
+ * Renders and manages the block.
79
+ *
80
+ * @param {Object} props Props to pass to block.
81
+ */
82
+ edit: Edit,
83
+
84
+ /**
85
+ * Block content is rendered in PHP, not via save function.
86
+ */
87
+ save: () => {
88
+ return <InnerBlocks.Content />;
89
+ },
90
+ } );
assets/js/blocks/featured-category/style.scss CHANGED
@@ -16,6 +16,21 @@
16
  height: auto !important;
17
  }
18
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
21
  .wc-block-featured-category {
16
  height: auto !important;
17
  }
18
  }
19
+
20
+ // Applying image edits
21
+ .is-applying {
22
+ .components-spinner {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ margin-top: -9px;
27
+ margin-left: -9px;
28
+ }
29
+
30
+ img {
31
+ opacity: 0.3;
32
+ }
33
+ }
34
  }
35
 
36
  .wc-block-featured-category {
assets/js/blocks/featured-product/block.js CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * External dependencies
5
  */
6
- import { useCallback, useState } from 'react';
7
  import { __ } from '@wordpress/i18n';
8
  import {
9
  AlignmentToolbar,
@@ -13,19 +13,24 @@ import {
13
  MediaReplaceFlow,
14
  RichText,
15
  __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
 
 
16
  __experimentalPanelColorGradientSettings as PanelColorGradientSettings,
17
  __experimentalUseGradient as useGradient,
18
  } from '@wordpress/block-editor';
19
  import { withSelect } from '@wordpress/data';
20
  import {
21
  Button,
 
22
  FocalPointPicker,
23
  PanelBody,
24
  Placeholder,
25
  RangeControl,
26
  ResizableBox,
27
  Spinner,
 
28
  ToggleControl,
 
29
  ToolbarGroup,
30
  withSpokenMessages,
31
  __experimentalToggleGroupControl as ToggleGroupControl,
@@ -40,7 +45,7 @@ import ProductControl from '@woocommerce/editor-components/product-control';
40
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
41
  import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
42
  import { withProduct } from '@woocommerce/block-hocs';
43
- import { Icon, starEmpty } from '@wordpress/icons';
44
 
45
  /**
46
  * Internal dependencies
@@ -52,6 +57,11 @@ import {
52
  } from '../../utils/products';
53
  import { useThrottle } from '../../utils/useThrottle';
54
 
 
 
 
 
 
55
  export const ConstrainedResizable = ( {
56
  className = '',
57
  onResize,
@@ -110,10 +120,18 @@ const FeaturedProduct = ( {
110
  setAttributes,
111
  triggerUrlUpdate = () => void null,
112
  } ) => {
 
 
 
 
113
  const { setGradient } = useGradient( {
114
  gradientAttribute: 'overlayGradient',
115
  customGradientAttribute: 'overlayGradient',
116
  } );
 
 
 
 
117
  const onResize = useCallback(
118
  ( _event, _direction, elt ) => {
119
  setAttributes( { minHeight: parseInt( elt.style.height, 10 ) } );
@@ -130,6 +148,10 @@ const FeaturedProduct = ( {
130
  />
131
  );
132
 
 
 
 
 
133
  const renderEditMode = () => {
134
  const onDone = () => {
135
  setAttributes( { editMode: false } );
@@ -180,8 +202,7 @@ const FeaturedProduct = ( {
180
  };
181
 
182
  const getBlockControls = () => {
183
- const { contentAlign, editMode, mediaSrc } = attributes;
184
- const mediaId = attributes.mediaId || getImageIdFromProduct( product );
185
 
186
  return (
187
  <BlockControls>
@@ -192,8 +213,18 @@ const FeaturedProduct = ( {
192
  } }
193
  />
194
  <ToolbarGroup>
 
 
 
 
 
 
 
 
 
 
195
  <MediaReplaceFlow
196
- mediaId={ mediaId }
197
  mediaURL={ mediaSrc }
198
  accept="image/*"
199
  onSelect={ ( media ) => {
@@ -204,7 +235,7 @@ const FeaturedProduct = ( {
204
  } }
205
  allowedTypes={ [ 'image' ] }
206
  />
207
- { mediaId && mediaSrc ? (
208
  <TextToolbarButton
209
  onClick={ () =>
210
  setAttributes( { mediaId: 0, mediaSrc: '' } )
@@ -339,6 +370,30 @@ const FeaturedProduct = ( {
339
  } )
340
  }
341
  />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  </PanelBody>
343
  ) }
344
  <PanelColorGradientSettings
@@ -400,7 +455,6 @@ const FeaturedProduct = ( {
400
  dimRatio,
401
  focalPoint,
402
  imageFit,
403
- mediaSrc,
404
  minHeight,
405
  overlayColor,
406
  overlayGradient,
@@ -430,9 +484,6 @@ const FeaturedProduct = ( {
430
  minHeight,
431
  };
432
 
433
- const backgroundImageSrc =
434
- mediaSrc || getImageSrcFromProduct( product );
435
-
436
  const backgroundImageStyle = {
437
  ...calculateBackgroundImagePosition( focalPoint ),
438
  objectFit: imageFit,
@@ -465,6 +516,12 @@ const FeaturedProduct = ( {
465
  className="wc-block-featured-product__background-image"
466
  src={ backgroundImageSrc }
467
  style={ backgroundImageStyle }
 
 
 
 
 
 
468
  />
469
  <h2
470
  className="wc-block-featured-product__title"
@@ -580,6 +637,40 @@ const FeaturedProduct = ( {
580
  return renderEditMode();
581
  }
582
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  return (
584
  <>
585
  { getBlockControls() }
3
  /**
4
  * External dependencies
5
  */
6
+ import { useCallback, useEffect, useState } from 'react';
7
  import { __ } from '@wordpress/i18n';
8
  import {
9
  AlignmentToolbar,
13
  MediaReplaceFlow,
14
  RichText,
15
  __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
16
+ __experimentalImageEditingProvider as ImageEditingProvider,
17
+ __experimentalImageEditor as ImageEditor,
18
  __experimentalPanelColorGradientSettings as PanelColorGradientSettings,
19
  __experimentalUseGradient as useGradient,
20
  } from '@wordpress/block-editor';
21
  import { withSelect } from '@wordpress/data';
22
  import {
23
  Button,
24
+ ExternalLink,
25
  FocalPointPicker,
26
  PanelBody,
27
  Placeholder,
28
  RangeControl,
29
  ResizableBox,
30
  Spinner,
31
+ TextareaControl,
32
  ToggleControl,
33
+ ToolbarButton,
34
  ToolbarGroup,
35
  withSpokenMessages,
36
  __experimentalToggleGroupControl as ToggleGroupControl,
45
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
46
  import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
47
  import { withProduct } from '@woocommerce/block-hocs';
48
+ import { crop, Icon, starEmpty } from '@wordpress/icons';
49
 
50
  /**
51
  * Internal dependencies
57
  } from '../../utils/products';
58
  import { useThrottle } from '../../utils/useThrottle';
59
 
60
+ const DEFAULT_EDITOR_SIZE = {
61
+ height: 500,
62
+ width: 500,
63
+ };
64
+
65
  export const ConstrainedResizable = ( {
66
  className = '',
67
  onResize,
120
  setAttributes,
121
  triggerUrlUpdate = () => void null,
122
  } ) => {
123
+ const { mediaId, mediaSrc } = attributes;
124
+
125
+ const [ isEditingImage, setIsEditingImage ] = useState( false );
126
+ const [ backgroundImageSize, setBackgroundImageSize ] = useState( {} );
127
  const { setGradient } = useGradient( {
128
  gradientAttribute: 'overlayGradient',
129
  customGradientAttribute: 'overlayGradient',
130
  } );
131
+
132
+ const backgroundImageSrc = mediaSrc || getImageSrcFromProduct( product );
133
+ const backgroundImageId = mediaId || getImageIdFromProduct( product );
134
+
135
  const onResize = useCallback(
136
  ( _event, _direction, elt ) => {
137
  setAttributes( { minHeight: parseInt( elt.style.height, 10 ) } );
148
  />
149
  );
150
 
151
+ useEffect( () => {
152
+ setIsEditingImage( false );
153
+ }, [ isSelected ] );
154
+
155
  const renderEditMode = () => {
156
  const onDone = () => {
157
  setAttributes( { editMode: false } );
202
  };
203
 
204
  const getBlockControls = () => {
205
+ const { contentAlign, editMode } = attributes;
 
206
 
207
  return (
208
  <BlockControls>
213
  } }
214
  />
215
  <ToolbarGroup>
216
+ { backgroundImageSrc && ! isEditingImage && (
217
+ <ToolbarButton
218
+ onClick={ () => setIsEditingImage( true ) }
219
+ icon={ crop }
220
+ label={ __(
221
+ 'Edit product image',
222
+ 'woo-gutenberg-products-block'
223
+ ) }
224
+ />
225
+ ) }
226
  <MediaReplaceFlow
227
+ mediaId={ backgroundImageId }
228
  mediaURL={ mediaSrc }
229
  accept="image/*"
230
  onSelect={ ( media ) => {
235
  } }
236
  allowedTypes={ [ 'image' ] }
237
  />
238
+ { backgroundImageId && mediaSrc ? (
239
  <TextToolbarButton
240
  onClick={ () =>
241
  setAttributes( { mediaId: 0, mediaSrc: '' } )
370
  } )
371
  }
372
  />
373
+ <TextareaControl
374
+ label={ __(
375
+ 'Alt text (alternative text)',
376
+ 'woo-gutenberg-products-block'
377
+ ) }
378
+ value={ attributes.alt }
379
+ onChange={ ( alt ) => {
380
+ setAttributes( { alt } );
381
+ } }
382
+ help={
383
+ <>
384
+ <ExternalLink href="https://www.w3.org/WAI/tutorials/images/decision-tree">
385
+ { __(
386
+ 'Describe the purpose of the image',
387
+ 'woo-gutenberg-products-block'
388
+ ) }
389
+ </ExternalLink>
390
+ { __(
391
+ 'Leaving it empty will use the product name.',
392
+ 'woo-gutenberg-products-block'
393
+ ) }
394
+ </>
395
+ }
396
+ />
397
  </PanelBody>
398
  ) }
399
  <PanelColorGradientSettings
455
  dimRatio,
456
  focalPoint,
457
  imageFit,
 
458
  minHeight,
459
  overlayColor,
460
  overlayGradient,
484
  minHeight,
485
  };
486
 
 
 
 
487
  const backgroundImageStyle = {
488
  ...calculateBackgroundImagePosition( focalPoint ),
489
  objectFit: imageFit,
516
  className="wc-block-featured-product__background-image"
517
  src={ backgroundImageSrc }
518
  style={ backgroundImageStyle }
519
+ onLoad={ ( e ) => {
520
+ setBackgroundImageSize( {
521
+ height: e.target?.naturalHeight,
522
+ width: e.target?.naturalWidth,
523
+ } );
524
+ } }
525
  />
526
  <h2
527
  className="wc-block-featured-product__title"
637
  return renderEditMode();
638
  }
639
 
640
+ if ( isEditingImage ) {
641
+ return (
642
+ <>
643
+ <ImageEditingProvider
644
+ id={ backgroundImageId }
645
+ url={ backgroundImageSrc }
646
+ naturalHeight={
647
+ backgroundImageSize.height || DEFAULT_EDITOR_SIZE.height
648
+ }
649
+ naturalWidth={
650
+ backgroundImageSize.width || DEFAULT_EDITOR_SIZE.width
651
+ }
652
+ onSaveImage={ ( { id, url } ) => {
653
+ setAttributes( { mediaId: id, mediaSrc: url } );
654
+ } }
655
+ isEditing={ isEditingImage }
656
+ onFinishEditing={ () => setIsEditingImage( false ) }
657
+ >
658
+ <ImageEditor
659
+ url={ backgroundImageSrc }
660
+ height={
661
+ backgroundImageSize.height ||
662
+ DEFAULT_EDITOR_SIZE.height
663
+ }
664
+ width={
665
+ backgroundImageSize.width ||
666
+ DEFAULT_EDITOR_SIZE.width
667
+ }
668
+ />
669
+ </ImageEditingProvider>
670
+ </>
671
+ );
672
+ }
673
+
674
  return (
675
  <>
676
  { getBlockControls() }
assets/js/blocks/featured-product/block.json ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "woocommerce/featured-product",
3
+ "version": "1.0.0",
4
+ "title": "Featured Product",
5
+ "description": "Visually highlight a product or variation and encourage prompt action.",
6
+ "category": "woocommerce",
7
+ "keywords": [ "WooCommerce" ],
8
+ "supports": {
9
+ "align": [
10
+ "wide",
11
+ "full"
12
+ ],
13
+ "html": false,
14
+ "color": {
15
+ "background": true,
16
+ "text": true,
17
+ "__experimentalDuotone": ".wc-block-featured-product__background-image"
18
+ },
19
+ "spacing": {
20
+ "padding": true,
21
+ "__experimentalDefaultControls": {
22
+ "padding": true
23
+ },
24
+ "__experimentalSkipSerialization": true
25
+ },
26
+ "__experimentalBorder": {
27
+ "color": true,
28
+ "radius": true,
29
+ "width": true,
30
+ "__experimentalSkipSerialization": true
31
+ },
32
+ "multiple": true
33
+ },
34
+ "attributes": {
35
+ "alt": {
36
+ "type": "string",
37
+ "default": ""
38
+ },
39
+ "contentAlign": {
40
+ "type": "string",
41
+ "default": "center"
42
+ },
43
+ "dimRatio": {
44
+ "type": "number",
45
+ "default": 50
46
+ },
47
+ "editMode": {
48
+ "type": "boolean",
49
+ "default": true
50
+ },
51
+ "focalPoint": {
52
+ "type": "object",
53
+ "default": false
54
+ },
55
+ "imageFit": {
56
+ "type": "string",
57
+ "default": "none"
58
+ },
59
+ "mediaId": {
60
+ "type": "number",
61
+ "default": 0
62
+ },
63
+ "mediaSrc": {
64
+ "type": "string",
65
+ "default": ""
66
+ },
67
+ "minHeight": {
68
+ "type": "number",
69
+ "default": 500
70
+ },
71
+ "linkText": {
72
+ "type": "string",
73
+ "default": "Shop now"
74
+ },
75
+ "overlayColor": {
76
+ "type": "string",
77
+ "default": "#000000"
78
+ },
79
+ "overlayGradient": {
80
+ "type": "string"
81
+ },
82
+ "productId": {
83
+ "type": "number"
84
+ },
85
+ "previewProduct": {
86
+ "type": "object",
87
+ "default": null
88
+ },
89
+ "showDesc": {
90
+ "type": "boolean",
91
+ "default": true
92
+ },
93
+ "showPrice": {
94
+ "type": "boolean",
95
+ "default": true
96
+ }
97
+ },
98
+ "textdomain": "woo-gutenberg-products-block",
99
+ "apiVersion": 2
100
+ }
assets/js/blocks/featured-product/example.js CHANGED
@@ -6,6 +6,7 @@ import { previewProducts } from '@woocommerce/resource-previews';
6
 
7
  export const example = {
8
  attributes: {
 
9
  contentAlign: 'center',
10
  dimRatio: 50,
11
  editMode: false,
6
 
7
  export const example = {
8
  attributes: {
9
+ alt: '',
10
  contentAlign: 'center',
11
  dimRatio: 50,
12
  editMode: false,
assets/js/blocks/featured-product/index.js DELETED
@@ -1,209 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
- import { InnerBlocks } from '@wordpress/block-editor';
6
- import { registerBlockType } from '@wordpress/blocks';
7
- import { getSetting } from '@woocommerce/settings';
8
- import { isFeaturePluginBuild } from '@woocommerce/block-settings';
9
- import { Icon, starEmpty } from '@wordpress/icons';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import './style.scss';
15
- import { example } from './example';
16
- import { Edit } from './edit';
17
-
18
- /**
19
- * Register and run the "Featured Product" block.
20
- */
21
- registerBlockType( 'woocommerce/featured-product', {
22
- apiVersion: 2,
23
- title: __( 'Featured Product', 'woo-gutenberg-products-block' ),
24
- icon: {
25
- src: (
26
- <Icon
27
- icon={ starEmpty }
28
- className="wc-block-editor-components-block-icon"
29
- />
30
- ),
31
- },
32
- category: 'woocommerce',
33
- keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
34
- description: __(
35
- 'Visually highlight a product or variation and encourage prompt action.',
36
- 'woo-gutenberg-products-block'
37
- ),
38
- supports: {
39
- align: [ 'wide', 'full' ],
40
- html: false,
41
- color: {
42
- background: false,
43
- text: true,
44
- ...( isFeaturePluginBuild() && {
45
- __experimentalDuotone:
46
- '.wc-block-featured-product__background-image',
47
- } ),
48
- },
49
- spacing: {
50
- padding: true,
51
- ...( isFeaturePluginBuild() && {
52
- __experimentalDefaultControls: {
53
- padding: true,
54
- },
55
- __experimentalSkipSerialization: true,
56
- } ),
57
- },
58
- ...( isFeaturePluginBuild() && {
59
- __experimentalBorder: {
60
- color: true,
61
- radius: true,
62
- width: true,
63
- __experimentalSkipSerialization: true,
64
- },
65
- } ),
66
- },
67
- example,
68
- attributes: {
69
- /**
70
- * Alignment of content inside block.
71
- */
72
- contentAlign: {
73
- type: 'string',
74
- default: 'center',
75
- },
76
-
77
- /**
78
- * Percentage opacity of overlay.
79
- */
80
- dimRatio: {
81
- type: 'number',
82
- default: 50,
83
- },
84
-
85
- /**
86
- * Toggle for edit mode in the block preview.
87
- */
88
- editMode: {
89
- type: 'boolean',
90
- default: true,
91
- },
92
-
93
- /**
94
- * Focus point for the background image
95
- */
96
- focalPoint: {
97
- type: 'object',
98
- },
99
-
100
- /**
101
- * Whether the image should fit the container or not be resized
102
- *
103
- * Note: when the image is resized to fit the container, the user loses
104
- * the ability to have full control over the focus.
105
- */
106
- imageFit: {
107
- type: 'string',
108
- default: 'none',
109
- },
110
-
111
- /**
112
- * ID for a custom image, overriding the product's featured image.
113
- */
114
- mediaId: {
115
- type: 'number',
116
- default: 0,
117
- },
118
-
119
- /**
120
- * URL for a custom image, overriding the product's featured image.
121
- */
122
- mediaSrc: {
123
- type: 'string',
124
- default: '',
125
- },
126
-
127
- /**
128
- * A minimum height for the block.
129
- *
130
- * Note: if padding is increased, this way the inner content will never
131
- * overflow, but instead will resize the container.
132
- *
133
- * It was decided to change this to make this block more in line with
134
- * the “Cover” block.
135
- */
136
- minHeight: {
137
- type: 'number',
138
- default: getSetting( 'default_height', 500 ),
139
- },
140
-
141
- /**
142
- * Text for the product link.
143
- */
144
- linkText: {
145
- type: 'string',
146
- default: __( 'Shop now', 'woo-gutenberg-products-block' ),
147
- },
148
-
149
- /**
150
- * Color for the overlay layer on top of the product image.
151
- */
152
- overlayColor: {
153
- type: 'string',
154
- default: '#000000',
155
- },
156
-
157
- /**
158
- * Gradient for the overlay layer on top of the product image.
159
- */
160
- overlayGradient: {
161
- type: 'string',
162
- },
163
-
164
- /**
165
- * The product ID to display.
166
- */
167
- productId: {
168
- type: 'number',
169
- },
170
-
171
- /**
172
- * Product preview.
173
- */
174
- previewProduct: {
175
- type: 'object',
176
- default: null,
177
- },
178
-
179
- /**
180
- * Show the product description.
181
- */
182
- showDesc: {
183
- type: 'boolean',
184
- default: true,
185
- },
186
-
187
- /**
188
- * Show the product price.
189
- */
190
- showPrice: {
191
- type: 'boolean',
192
- default: true,
193
- },
194
- },
195
-
196
- /**
197
- * Renders and manages the block.
198
- *
199
- * @param {Object} props Props to pass to block.
200
- */
201
- edit: Edit,
202
-
203
- /**
204
- * Block content is rendered in PHP, not via save function.
205
- */
206
- save() {
207
- return <InnerBlocks.Content />;
208
- },
209
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/blocks/featured-product/index.tsx ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { InnerBlocks } from '@wordpress/block-editor';
5
+ import { registerBlockType } from '@wordpress/blocks';
6
+ import { getSetting } from '@woocommerce/settings';
7
+ import { isFeaturePluginBuild } from '@woocommerce/block-settings';
8
+ import { Icon, starEmpty } from '@wordpress/icons';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import './style.scss';
14
+ import { example } from './example';
15
+ import { Edit } from './edit';
16
+ import metadata from './block.json';
17
+
18
+ /**
19
+ * Register and run the "Featured Product" block.
20
+ */
21
+ registerBlockType( metadata, {
22
+ icon: {
23
+ src: (
24
+ <Icon
25
+ icon={ starEmpty }
26
+ className="wc-block-editor-components-block-icon"
27
+ />
28
+ ),
29
+ },
30
+ attributes: {
31
+ ...metadata.attributes,
32
+ /**
33
+ * A minimum height for the block.
34
+ *
35
+ * Note: if padding is increased, this way the inner content will never
36
+ * overflow, but instead will resize the container.
37
+ *
38
+ * It was decided to change this to make this block more in line with
39
+ * the “Cover” block.
40
+ */
41
+ minHeight: {
42
+ type: 'number',
43
+ default: getSetting( 'default_height', 500 ),
44
+ },
45
+ },
46
+ supports: {
47
+ ...metadata.supports,
48
+ color: {
49
+ background: true,
50
+ text: true,
51
+ ...( isFeaturePluginBuild() && {
52
+ __experimentalDuotone:
53
+ '.wc-block-featured-product__background-image',
54
+ } ),
55
+ },
56
+ spacing: {
57
+ padding: true,
58
+ ...( isFeaturePluginBuild() && {
59
+ __experimentalDefaultControls: {
60
+ padding: true,
61
+ },
62
+ __experimentalSkipSerialization: true,
63
+ } ),
64
+ },
65
+ ...( isFeaturePluginBuild() && {
66
+ __experimentalBorder: {
67
+ color: true,
68
+ radius: true,
69
+ width: true,
70
+ __experimentalSkipSerialization: true,
71
+ },
72
+ } ),
73
+ },
74
+ example,
75
+
76
+ /**
77
+ * Renders and manages the block.
78
+ *
79
+ * @param {Object} props Props to pass to block.
80
+ */
81
+ edit: Edit,
82
+
83
+ /**
84
+ * Block content is rendered in PHP, not via save function.
85
+ */
86
+ save: () => {
87
+ return <InnerBlocks.Content />;
88
+ },
89
+ } );
assets/js/blocks/featured-product/style.scss CHANGED
@@ -16,6 +16,21 @@
16
  height: auto !important;
17
  }
18
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
21
  .wc-block-featured-product {
16
  height: auto !important;
17
  }
18
  }
19
+
20
+ // Applying image edits
21
+ .is-applying {
22
+ .components-spinner {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ margin-top: -9px;
27
+ margin-left: -9px;
28
+ }
29
+
30
+ img {
31
+ opacity: 0.3;
32
+ }
33
+ }
34
  }
35
 
36
  .wc-block-featured-product {
assets/js/blocks/handpicked-products/index.js CHANGED
@@ -70,6 +70,7 @@ registerBlockType( 'woocommerce/handpicked-products', {
70
  contentVisibility: {
71
  type: 'object',
72
  default: {
 
73
  title: true,
74
  price: true,
75
  rating: true,
70
  contentVisibility: {
71
  type: 'object',
72
  default: {
73
+ image: true,
74
  title: true,
75
  price: true,
76
  rating: true,
assets/js/blocks/mini-cart/mini-cart-contents/editor.scss CHANGED
@@ -55,19 +55,21 @@
55
  }
56
 
57
  .wp-block-woocommerce-empty-mini-cart-contents-block {
 
58
  overflow-y: unset;
59
  padding: 0;
60
 
61
  > .block-editor-inner-blocks {
 
62
  max-height: 100vh;
63
  overflow-y: auto;
64
- box-sizing: border-box;
65
  padding: $gap-largest $gap $gap;
66
  }
67
 
68
  // Temporary fix after the appender button was positioned absolute
69
  // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168
70
  .block-list-appender {
 
71
  position: relative;
72
  }
73
 
55
  }
56
 
57
  .wp-block-woocommerce-empty-mini-cart-contents-block {
58
+ min-height: 100vh;
59
  overflow-y: unset;
60
  padding: 0;
61
 
62
  > .block-editor-inner-blocks {
63
+ box-sizing: border-box;
64
  max-height: 100vh;
65
  overflow-y: auto;
 
66
  padding: $gap-largest $gap $gap;
67
  }
68
 
69
  // Temporary fix after the appender button was positioned absolute
70
  // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168
71
  .block-list-appender {
72
+ margin-top: $gap;
73
  position: relative;
74
  }
75
 
assets/js/blocks/mini-cart/mini-cart-contents/index.tsx CHANGED
@@ -40,6 +40,7 @@ const settings: BlockConfiguration = {
40
  color: {
41
  link: true,
42
  },
 
43
  },
44
  attributes: {
45
  isPreview: {
40
  color: {
41
  link: true,
42
  },
43
+ lock: false,
44
  },
45
  attributes: {
46
  isPreview: {
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/block.json CHANGED
@@ -9,7 +9,8 @@
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
- "inserter": false
 
13
  },
14
  "attributes": {
15
  "lock": {
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
+ "inserter": false,
13
+ "lock": false
14
  },
15
  "attributes": {
16
  "lock": {
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx CHANGED
@@ -33,7 +33,9 @@ const EmptyMiniCartContentsBlock = ( {
33
 
34
  return (
35
  <div tabIndex={ -1 } ref={ elementRef } className={ className }>
36
- { children }
 
 
37
  </div>
38
  );
39
  };
33
 
34
  return (
35
  <div tabIndex={ -1 } ref={ elementRef } className={ className }>
36
+ <div className="wc-block-mini-cart__empty-cart-wrapper">
37
+ { children }
38
+ </div>
39
  </div>
40
  );
41
  };
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/block.json CHANGED
@@ -9,7 +9,8 @@
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
- "inserter": false
 
13
  },
14
  "attributes": {
15
  "lock": {
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
+ "inserter": false,
13
+ "lock": false
14
  },
15
  "attributes": {
16
  "lock": {
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/block.json CHANGED
@@ -9,7 +9,8 @@
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
- "inserter": false
 
13
  },
14
  "attributes": {
15
  "lock": {
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
+ "inserter": false,
13
+ "lock": false
14
  },
15
  "attributes": {
16
  "lock": {
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/block.json CHANGED
@@ -9,7 +9,8 @@
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
- "inserter": false
 
13
  },
14
  "attributes": {
15
  "lock": {
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
+ "inserter": false,
13
+ "lock": false
14
  },
15
  "attributes": {
16
  "lock": {
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.json CHANGED
@@ -9,7 +9,8 @@
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
- "inserter": false
 
13
  },
14
  "attributes": {
15
  "lock": {
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
+ "inserter": false,
13
+ "lock": false
14
  },
15
  "attributes": {
16
  "lock": {
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/block.json CHANGED
@@ -9,7 +9,8 @@
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
- "inserter": false
 
13
  },
14
  "attributes": {
15
  "lock": {
9
  "html": false,
10
  "multiple": false,
11
  "reusable": false,
12
+ "inserter": false,
13
+ "lock": false
14
  },
15
  "attributes": {
16
  "lock": {
assets/js/blocks/mini-cart/style.scss CHANGED
@@ -84,7 +84,7 @@
84
  justify-content: space-between;
85
  }
86
 
87
- .wp-block-woocommerce-empty-mini-cart-contents-block {
88
  overflow-y: auto;
89
  padding: $gap-largest $gap $gap;
90
  }
84
  justify-content: space-between;
85
  }
86
 
87
+ .wp-block-woocommerce-empty-mini-cart-contents-block .wc-block-mini-cart__empty-cart-wrapper {
88
  overflow-y: auto;
89
  padding: $gap-largest $gap $gap;
90
  }
assets/js/blocks/price-filter/block.js CHANGED
@@ -12,8 +12,9 @@ import PriceSlider from '@woocommerce/base-components/price-slider';
12
  import { useDebouncedCallback } from 'use-debounce';
13
  import PropTypes from 'prop-types';
14
  import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
15
- import { getSetting } from '@woocommerce/settings';
16
  import { addQueryArgs, removeQueryArgs } from '@wordpress/url';
 
17
 
18
  /**
19
  * Internal dependencies
@@ -68,9 +69,16 @@ function formatPrice( value, minorUnit ) {
68
  * @param {boolean} props.isEditor Whether in editor context or not.
69
  */
70
  const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
71
- const filteringForPhpTemplate = getSetting(
 
 
 
 
 
 
72
  'is_rendering_php_template',
73
- ''
 
74
  );
75
 
76
  /**
@@ -178,7 +186,7 @@ const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
178
  setMinPriceQuery,
179
  setMaxPriceQuery,
180
  filteringForPhpTemplate,
181
- currency,
182
  ]
183
  );
184
 
@@ -194,13 +202,30 @@ const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
194
  if ( prices[ 1 ] !== maxPrice ) {
195
  setMaxPrice( prices[ 1 ] );
196
  }
 
 
 
 
 
 
 
 
197
  },
198
- [ minPrice, maxPrice, setMinPrice, setMaxPrice ]
 
 
 
 
 
 
 
 
 
199
  );
200
 
201
  // Track price STATE changes - if state changes, update the query.
202
  useEffect( () => {
203
- if ( ! attributes.showFilterButton ) {
204
  debouncedUpdateQuery( minPrice, maxPrice );
205
  }
206
  }, [
@@ -208,6 +233,7 @@ const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
208
  maxPrice,
209
  attributes.showFilterButton,
210
  debouncedUpdateQuery,
 
211
  ] );
212
 
213
  // Track price query/price constraint changes so the slider reflects current filters.
@@ -251,6 +277,10 @@ const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
251
  previousMaxPriceQuery,
252
  ] );
253
 
 
 
 
 
254
  if (
255
  ! isLoading &&
256
  ( minConstraint === null ||
12
  import { useDebouncedCallback } from 'use-debounce';
13
  import PropTypes from 'prop-types';
14
  import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
15
+ import { getSettingWithCoercion } from '@woocommerce/settings';
16
  import { addQueryArgs, removeQueryArgs } from '@wordpress/url';
17
+ import { isBoolean } from '@woocommerce/types';
18
 
19
  /**
20
  * Internal dependencies
69
  * @param {boolean} props.isEditor Whether in editor context or not.
70
  */
71
  const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
72
+ const hasFilterableProducts = getSettingWithCoercion(
73
+ 'has_filterable_products',
74
+ false,
75
+ isBoolean
76
+ );
77
+
78
+ const filteringForPhpTemplate = getSettingWithCoercion(
79
  'is_rendering_php_template',
80
+ false,
81
+ isBoolean
82
  );
83
 
84
  /**
186
  setMinPriceQuery,
187
  setMaxPriceQuery,
188
  filteringForPhpTemplate,
189
+ currency.minorUnit,
190
  ]
191
  );
192
 
202
  if ( prices[ 1 ] !== maxPrice ) {
203
  setMaxPrice( prices[ 1 ] );
204
  }
205
+
206
+ if (
207
+ filteringForPhpTemplate &&
208
+ hasSetPhpFilterDefaults &&
209
+ ! attributes.showFilterButton
210
+ ) {
211
+ debouncedUpdateQuery( prices[ 0 ], prices[ 1 ] );
212
+ }
213
  },
214
+ [
215
+ minPrice,
216
+ maxPrice,
217
+ setMinPrice,
218
+ setMaxPrice,
219
+ filteringForPhpTemplate,
220
+ hasSetPhpFilterDefaults,
221
+ debouncedUpdateQuery,
222
+ attributes.showFilterButton,
223
+ ]
224
  );
225
 
226
  // Track price STATE changes - if state changes, update the query.
227
  useEffect( () => {
228
+ if ( ! attributes.showFilterButton && ! filteringForPhpTemplate ) {
229
  debouncedUpdateQuery( minPrice, maxPrice );
230
  }
231
  }, [
233
  maxPrice,
234
  attributes.showFilterButton,
235
  debouncedUpdateQuery,
236
+ filteringForPhpTemplate,
237
  ] );
238
 
239
  // Track price query/price constraint changes so the slider reflects current filters.
277
  previousMaxPriceQuery,
278
  ] );
279
 
280
+ if ( ! hasFilterableProducts ) {
281
+ return null;
282
+ }
283
+
284
  if (
285
  ! isLoading &&
286
  ( minConstraint === null ||
assets/js/blocks/price-filter/index.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { registerBlockType } from '@wordpress/blocks';
6
  import classNames from 'classnames';
7
  import { Icon, currencyDollar } from '@wordpress/icons';
8
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
@@ -64,10 +64,30 @@ registerBlockType( 'woocommerce/price-filter', {
64
  default: 3,
65
  },
66
  },
67
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  edit,
69
-
70
- // Save the props to post content.
71
  save( { attributes } ) {
72
  const {
73
  className,
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import classNames from 'classnames';
7
  import { Icon, currencyDollar } from '@wordpress/icons';
8
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
64
  default: 3,
65
  },
66
  },
67
+ transforms: {
68
+ from: [
69
+ {
70
+ type: 'block',
71
+ blocks: [ 'core/legacy-widget' ],
72
+ // We can't transform if raw instance isn't shown in the REST API.
73
+ isMatch: ( { idBase, instance } ) =>
74
+ idBase === 'woocommerce_price_filter' && !! instance?.raw,
75
+ transform: ( { instance } ) =>
76
+ createBlock( 'woocommerce/price-filter', {
77
+ showInputFields: false,
78
+ showFilterButton: true,
79
+ heading:
80
+ instance?.raw?.title ||
81
+ __(
82
+ 'Filter by price',
83
+ 'woo-gutenberg-products-block'
84
+ ),
85
+ headingLevel: 3,
86
+ } ),
87
+ },
88
+ ],
89
+ },
90
  edit,
 
 
91
  save( { attributes } ) {
92
  const {
93
  className,
assets/js/blocks/product-tag/index.js CHANGED
@@ -71,6 +71,7 @@ registerBlockType( 'woocommerce/product-tag', {
71
  contentVisibility: {
72
  type: 'object',
73
  default: {
 
74
  title: true,
75
  price: true,
76
  rating: true,
71
  contentVisibility: {
72
  type: 'object',
73
  default: {
74
+ image: true,
75
  title: true,
76
  price: true,
77
  rating: true,
assets/js/blocks/products-by-attribute/index.js CHANGED
@@ -78,6 +78,7 @@ registerBlockType( blockTypeName, {
78
  contentVisibility: {
79
  type: 'object',
80
  default: {
 
81
  title: true,
82
  price: true,
83
  rating: true,
78
  contentVisibility: {
79
  type: 'object',
80
  default: {
81
+ image: true,
82
  title: true,
83
  price: true,
84
  rating: true,
assets/js/blocks/stock-filter/block.js CHANGED
@@ -336,6 +336,16 @@ const StockStatusFilterBlock = ( {
336
  const isLoading = ! blockAttributes.isPreview && ! STOCK_STATUS_OPTIONS;
337
  const isDisabled = ! blockAttributes.isPreview && filteredCountsLoading;
338
 
 
 
 
 
 
 
 
 
 
 
339
  return (
340
  <>
341
  { ! isEditor && blockAttributes.heading && (
336
  const isLoading = ! blockAttributes.isPreview && ! STOCK_STATUS_OPTIONS;
337
  const isDisabled = ! blockAttributes.isPreview && filteredCountsLoading;
338
 
339
+ const hasFilterableProducts = getSettingWithCoercion(
340
+ 'has_filterable_products',
341
+ false,
342
+ isBoolean
343
+ );
344
+
345
+ if ( ! hasFilterableProducts ) {
346
+ return null;
347
+ }
348
+
349
  return (
350
  <>
351
  { ! isEditor && blockAttributes.heading && (
assets/js/blocks/stock-filter/test/block.js CHANGED
@@ -29,6 +29,20 @@ jest.mock( '@woocommerce/base-context/hooks', () => {
29
  };
30
  } );
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  const StockFilterBlock = ( props ) => <Block { ...props } />;
33
  describe( 'Testing stock filter', () => {
34
  beforeEach( () => {
29
  };
30
  } );
31
 
32
+ jest.mock( '@woocommerce/settings', () => {
33
+ return {
34
+ ...jest.requireActual( '@woocommerce/settings' ),
35
+ getSettingWithCoercion: jest
36
+ .fn()
37
+ .mockImplementation( ( key, defaultValue ) => {
38
+ if ( key === 'has_filterable_products' ) {
39
+ return true;
40
+ }
41
+ return defaultValue;
42
+ } ),
43
+ };
44
+ } );
45
+
46
  const StockFilterBlock = ( props ) => <Block { ...props } />;
47
  describe( 'Testing stock filter', () => {
48
  beforeEach( () => {
assets/js/editor-components/grid-content-control/index.js CHANGED
@@ -13,9 +13,25 @@ import { ToggleControl } from '@wordpress/components';
13
  * @param {Object} props.settings
14
  */
15
  const GridContentControl = ( { onChange, settings } ) => {
16
- const { button, price, rating, title } = settings;
17
  return (
18
  <>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  <ToggleControl
20
  label={ __( 'Product title', 'woo-gutenberg-products-block' ) }
21
  help={
@@ -92,6 +108,7 @@ GridContentControl.propTypes = {
92
  * The current title visibility.
93
  */
94
  settings: PropTypes.shape( {
 
95
  button: PropTypes.bool.isRequired,
96
  price: PropTypes.bool.isRequired,
97
  rating: PropTypes.bool.isRequired,
13
  * @param {Object} props.settings
14
  */
15
  const GridContentControl = ( { onChange, settings } ) => {
16
+ const { image, button, price, rating, title } = settings;
17
  return (
18
  <>
19
+ <ToggleControl
20
+ label={ __( 'Product image', 'woo-gutenberg-products-block' ) }
21
+ help={
22
+ image
23
+ ? __(
24
+ 'Product image is visible.',
25
+ 'woo-gutenberg-products-block'
26
+ )
27
+ : __(
28
+ 'Product image is hidden.',
29
+ 'woo-gutenberg-products-block'
30
+ )
31
+ }
32
+ checked={ image }
33
+ onChange={ () => onChange( { ...settings, image: ! image } ) }
34
+ />
35
  <ToggleControl
36
  label={ __( 'Product title', 'woo-gutenberg-products-block' ) }
37
  help={
108
  * The current title visibility.
109
  */
110
  settings: PropTypes.shape( {
111
+ image: PropTypes.bool.isRequired,
112
  button: PropTypes.bool.isRequired,
113
  price: PropTypes.bool.isRequired,
114
  rating: PropTypes.bool.isRequired,
assets/js/utils/shared-attributes.js CHANGED
@@ -58,6 +58,7 @@ export default {
58
  contentVisibility: {
59
  type: 'object',
60
  default: {
 
61
  title: true,
62
  price: true,
63
  rating: true,
58
  contentVisibility: {
59
  type: 'object',
60
  default: {
61
+ image: true,
62
  title: true,
63
  price: true,
64
  rating: true,
build/active-filters-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '153a9eb256b8f342e75d23e26f70f7e9');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f96ba0b2380bc2f722b271c440b487b5');
build/active-filters-frontend.js CHANGED
@@ -1,13 +1,15 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=222)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(6);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const c=e.filter(e=>e.attribute===r.taxonomy),s=c.length?c[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(o)))return;const a=s.slug.filter(e=>e!==o),l=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),l.push(s)),t(Object(n.sortBy)(l,"attribute"))},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const s=e.filter(e=>e.attribute!==r.taxonomy);return 0===o.length?t(s):(s.push({attribute:r.taxonomy,operator:c,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute"))),s}},104:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},11:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},110:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(2);const o=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return r.id&&e.push(r),e},[]),c=e=>{if(e)return o.find(t=>t.id===e)},s=e=>{if(e)return o.find(t=>t.taxonomy===e)}},12:function(e,t){e.exports=window.wp.isShallowEqual},120:function(e,t){},124:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},14:function(e,t){e.exports=window.wp.primitives},15:function(e,t,r){"use strict";var n=r(19),o=r.n(n),c=r(0),s=r(3),a=r(1),l=r(44),i=e=>{let{imageUrl:t=l.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:i,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),i&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},i))):null};r(33);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:u,hasError:b}=this.state;return b?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(i,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:l}):this.props.children}}t.a=u},16:function(e,t){e.exports=window.wp.url},18:function(e,t){e.exports=window.wp.htmlEntities},19:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},196:function(e,t,r){"use strict";var n=r(0),o=r(14);const c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=c},2:function(e,t){e.exports=window.wc.wcSettings},200:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),s=r(4),a=r.n(s),l=r(1),i=r(104),u=r(196);r(120);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:l="small",children:i=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),d=Boolean(r&&r!==t);return Object(c.createElement)(b,o()({className:p},u),Object(c.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(c.createElement)("span",{className:"screen-reader-text"},r),i)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...f}=e;const g=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
- Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=p?O:{},_=p?{"aria-hidden":!0}:O;return Object(c.createElement)(b,o()({},f,j,{className:a()(r,"is-removable"),element:p?"button":f.element,screenReaderText:m,text:d}),Object(c.createElement)(g,o()({className:"wc-block-components-chip__remove"},_),Object(c.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},22:function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:s,wrapperProps:a={}}=e;const l=null!=r,i=null!=o;return!l&&i?(t=s||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,o)):(t=s||n.Fragment,l&&i&&r!==o?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,a,r))}},222:function(e,t,r){e.exports=r(243)},223:function(e,t){},23:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},243:function(e,t,r){"use strict";r.r(t);var n=r(48),o=r(0),c=r(1),s=r(35),a=r(2),l=r(4),i=r.n(l),u=r(22),b=r(124),p=(r(223),r(110)),d=r(37),m=r(200),f=r(16);const g=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(c.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
- Object(c.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
8
  /* translators: %s min price */
9
- Object(c.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(c.sprintf)(
10
  /* translators: %s max price */
11
- Object(c.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t)),O=e=>{let{type:t,name:r,prefix:n,removeCallback:s=(()=>{}),showLabel:a=!0,displayStyle:l}=e;const i=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,b=Object(c.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
- Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===l?Object(o.createElement)(m.a,{element:"span",text:i,onRemove:s,radius:"large",ariaLabel:b}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(u.a,{screenReaderLabel:b}))))},j=function(){const e=window.location.href,t=Object(f.getQueryArgs)(e),r=Object(f.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];o.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const s=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t}));window.location.href=Object(f.addQueryArgs)(r,s)};var _=r(62),w=r(18),y=r(100),E=e=>{let{attributeObject:t={},slugs:r=[],operator:n="in",displayStyle:l}=e;const{results:i,isLoading:u}=Object(_.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[p,d]=Object(s.b)("attributes",[]);if(u)return null;const m=t.label,f=Object(a.getSettingWithCoercion)("is_rendering_php_template",!1,b.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},m,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const s=i.find(t=>t.slug===e);if(!s)return null;let a="";return r>0&&"and"===n&&(a=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(c.__)("and","woo-gutenberg-products-block"))),O({type:m,name:Object(w.decodeEntities)(s.name||e),prefix:a,removeCallback:()=>{if(f)return 1===p.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name}).slug.length?j("query_type_"+t.name,"filter_"+t.name):j({["filter_"+t.name]:e});Object(y.a)(p,d,t,e)},showLabel:!1,displayStyle:l})})))};Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(a.getSettingWithCoercion)("is_rendering_php_template",!1,b.a),[l,d]=Object(s.b)("attributes",[]),[m,f]=Object(s.b)("stock_status",[]),[_,w]=Object(s.b)("min_price"),[y,h]=Object(s.b)("max_price"),v=Object(a.getSetting)("stockStatusOptions",[]),k=Object(o.useMemo)(()=>{if(m.length>0)return m.map(e=>O({type:Object(c.__)("Stock Status","woo-gutenberg-products-block"),name:v[e],removeCallback:()=>{if(n)return j({filter_stock_status:e});const t=m.filter(t=>t!==e);f(t)},displayStyle:t.displayStyle}))},[v,m,f,t.displayStyle,n]),S=Object(o.useMemo)(()=>Number.isFinite(_)||Number.isFinite(y)?O({type:Object(c.__)("Price","woo-gutenberg-products-block"),name:g(_,y),removeCallback:()=>{if(n)return j("max_price","min_price");w(void 0),h(void 0)},displayStyle:t.displayStyle}):null,[_,y,t.displayStyle,w,h,n]),x=Object(o.useMemo)(()=>l.map(e=>{const r=Object(p.b)(e.attribute);return Object(o.createElement)(E,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[l,t.displayStyle]);if(!(l.length>0||m.length>0||Number.isFinite(_)||Number.isFinite(y)||r))return null;const P="h"+t.headingLevel,N=i()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(P,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:N},r?Object(o.createElement)(o.Fragment,null,O({type:Object(c.__)("Size","woo-gutenberg-products-block"),name:Object(c.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),O({type:Object(c.__)("Color","woo-gutenberg-products-block"),name:Object(c.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,S,k,x)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{n?window.location.href=(()=>{const e=window.location.href,t=e.indexOf("?");return-1===t?e:e.substring(0,t)})():(w(void 0),h(void 0),d([]),f([]))}},Object(o.createElement)(u.a,{label:Object(c.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Clear All Filters","woo-gutenberg-products-block")}))))},getProps:e=>({attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3},isEditor:!1})})},3:function(e,t){e.exports=window.React},30:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(12),c=r.n(o);function s(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},33:function(e,t){},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(5),o=r(7),c=r(0),s=r(12),a=r.n(s),l=r(30),i=r(58),u=r(23);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{s(e,t)},[e,s])]},p=(e,t,r)=>{const s=Object(u.a)();r=r||s;const a=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:l}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{l(r,e,t)},[r,e,l])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=b(t),s=Object(l.a)(n),p=Object(l.a)(e),d=Object(i.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(d,p)||(o(Object.assign({},s,p)),m.current=!0)},[s,p,d,o]),m.current?[n,o]:[e,o]}},37:function(e,t){e.exports=window.wc.priceFormat},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},44:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return s})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return l})),r.d(t,"i",(function(){return i})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return O})),r.d(t,"b",(function(){return j}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=c.pluginUrl+"images/",a=c.pluginUrl+"build/",l=c.buildPhase,i=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),O=Object(o.getSetting)("shippingStates",{}),j=Object(o.getSetting)("allowedStates",{})},48:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(11),o=r.n(n),c=r(0),s=r(15);const a=[".wp-block-woocommerce-cart"],l=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const l=n(e,r),i=a(e,r),u={...e.dataset,...l.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:l={}}=e;Object(c.render)(Object(c.createElement)(s.a,l,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:l,attributes:u,errorBoundaryProps:i})})},i=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const s=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const s=c.querySelectorAll(o);l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},5:function(e,t){e.exports=window.wc.wcBlocksData},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},6:function(e,t){e.exports=window.lodash},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),o=r(7),c=r(0),s=r(30),a=r(72);const l=e=>{const{namespace:t,resourceName:r,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(c.useRef)({results:[],isLoading:!0}),p=Object(s.a)(i),d=Object(s.a)(l),m=Object(a.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,p,d],s=o.getCollectionError(...c);if(s){if(!(s instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(s)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,d,p,u]);return null!==f&&(b.current=f),b.current}},7:function(e,t){e.exports=window.wp.data},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}}});
 
 
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=222)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},101:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(6);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const c=e.filter(e=>e.attribute===r.taxonomy),s=c.length?c[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(o)))return;const a=s.slug.filter(e=>e!==o),l=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),l.push(s)),t(Object(n.sortBy)(l,"attribute"))},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const s=e.filter(e=>e.attribute!==r.taxonomy);return 0===o.length?t(s):(s.push({attribute:r.taxonomy,operator:c,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute"))),s}},105:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},11:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},110:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(2);const o=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return r.id&&e.push(r),e},[]),c=e=>{if(e)return o.find(t=>t.id===e)},s=e=>{if(e)return o.find(t=>t.taxonomy===e)}},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},12:function(e,t){e.exports=window.wp.isShallowEqual},122:function(e,t){},14:function(e,t){e.exports=window.wp.url},15:function(e,t){e.exports=window.wp.primitives},16:function(e,t,r){"use strict";var n=r(19),o=r.n(n),c=r(0),s=r(3),a=r(1),l=r(44),i=e=>{let{imageUrl:t=l.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:i,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),i&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},i))):null};r(33);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:u,hasError:b}=this.state;return b?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(i,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:l}):this.props.children}}t.a=u},18:function(e,t){e.exports=window.wp.htmlEntities},19:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},196:function(e,t,r){"use strict";var n=r(0),o=r(15);const c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=c},2:function(e,t){e.exports=window.wc.wcSettings},200:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),s=r(4),a=r.n(s),l=r(1),i=r(105),u=r(196);r(122);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:l="small",children:i=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),d=Boolean(r&&r!==t);return Object(c.createElement)(b,o()({className:p},u),Object(c.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(c.createElement)("span",{className:"screen-reader-text"},r),i)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:f="",...m}=e;const g=p?"span":"button";if(!t){const e=f&&"string"==typeof f?f:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
+ Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=p?O:{},_=p?{"aria-hidden":!0}:O;return Object(c.createElement)(b,o()({},m,j,{className:a()(r,"is-removable"),element:p?"button":m.element,screenReaderText:f,text:d}),Object(c.createElement)(g,o()({className:"wc-block-components-chip__remove"},_),Object(c.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},22:function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:s,wrapperProps:a={}}=e;const l=null!=r,i=null!=o;return!l&&i?(t=s||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,o)):(t=s||n.Fragment,l&&i&&r!==o?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,a,r))}},222:function(e,t,r){e.exports=r(243)},223:function(e,t){},23:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},243:function(e,t,r){"use strict";r.r(t);var n=r(48),o=r(0),c=r(1),s=r(35),a=r(2),l=r(4),i=r.n(l),u=r(22),b=r(119),p=r(98),d=(r(223),r(110)),f=r(37),m=r(200),g=r(14);const O=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(c.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
+ Object(c.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(f.formatPrice)(e),Object(f.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
8
  /* translators: %s min price */
9
+ Object(c.__)("From %s","woo-gutenberg-products-block"),Object(f.formatPrice)(e)):Object(c.sprintf)(
10
  /* translators: %s max price */
11
+ Object(c.__)("Up to %s","woo-gutenberg-products-block"),Object(f.formatPrice)(t)),j=e=>{let{type:t,name:r,prefix:n="",removeCallback:s=(()=>{}),showLabel:a=!0,displayStyle:l}=e;const i=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,b=Object(c.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
+ Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===l?Object(o.createElement)(m.a,{element:"span",text:i,onRemove:s,radius:"large",ariaLabel:b}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(u.a,{screenReaderLabel:b}))))},_=function(){const e=window.location.href,t=Object(g.getQueryArgs)(e),r=Object(g.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];o.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const s=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t}));window.location.href=Object(g.addQueryArgs)(r,s)};var y=r(62),w=r(18),h=r(101),E=e=>{let{attributeObject:t={},slugs:r=[],operator:n="in",displayStyle:l}=e;const{results:i,isLoading:u}=Object(y.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[p,d]=Object(s.b)("attributes",[]);if(u)return null;const f=t.label,m=Object(a.getSettingWithCoercion)("is_rendering_php_template",!1,b.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},f,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const s=i.find(t=>t.slug===e);if(!s)return null;let a="";return r>0&&"and"===n&&(a=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(c.__)("and","woo-gutenberg-products-block"))),j({type:f,name:Object(w.decodeEntities)(s.name||e),prefix:a,removeCallback:()=>{if(m)return 1===p.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name}).slug.length?_("query_type_"+t.name,"filter_"+t.name):_({["filter_"+t.name]:e});Object(h.a)(p,d,t,e)},showLabel:!1,displayStyle:l})})))};Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(a.getSettingWithCoercion)("is_rendering_php_template",!1,b.a),[l,f]=Object(s.b)("attributes",[]),[m,y]=Object(s.b)("stock_status",[]),[w,h]=Object(s.b)("min_price"),[v,k]=Object(s.b)("max_price"),S=Object(a.getSetting)("stockStatusOptions",[]),x=Object(o.useMemo)(()=>{if(m.length>0)return m.map(e=>j({type:Object(c.__)("Stock Status","woo-gutenberg-products-block"),name:S[e],removeCallback:()=>{if(n)return _({filter_stock_status:e});const t=m.filter(t=>t!==e);y(t)},displayStyle:t.displayStyle}))},[S,m,y,t.displayStyle,n]),P=Object(o.useMemo)(()=>Number.isFinite(w)||Number.isFinite(v)?j({type:Object(c.__)("Price","woo-gutenberg-products-block"),name:O(w,v),removeCallback:()=>{if(n)return _("max_price","min_price");h(void 0),k(void 0)},displayStyle:t.displayStyle}):null,[w,v,t.displayStyle,h,k,n]),N=Object(o.useMemo)(()=>l.map(e=>{const r=Object(d.b)(e.attribute);return Object(o.createElement)(E,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[l,t.displayStyle]),[R,A]=Object(s.b)("ratings");Object(o.useEffect)(()=>{var e;if(!n)return;if(R.length&&R.length>0)return;const t=null===(e=Object(p.c)("rating_filter"))||void 0===e?void 0:e.toString();t&&A(t.split(","))},[n,R,A]);const T=Object(o.useMemo)(()=>{if(R.length>0)return R.map(e=>j({type:Object(c.__)("Rating","woo-gutenberg-products-block"),name:Object(c.sprintf)(
14
+ /* translators: %s is referring to the average rating value */
15
+ Object(c.__)("Rated %s out of 5","woo-gutenberg-products-block"),e),removeCallback:()=>{if(n)return _({rating_filter:e});const t=R.filter(t=>t!==e);A(t)},displayStyle:t.displayStyle}))},[R,A,t.displayStyle,n]);if(!(l.length>0||m.length>0||R.length>0||Number.isFinite(w)||Number.isFinite(v)||r))return null;const C="h"+t.headingLevel;if(!Object(a.getSettingWithCoercion)("has_filterable_products",!1,b.a))return null;const B=i()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(C,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:B},r?Object(o.createElement)(o.Fragment,null,j({type:Object(c.__)("Size","woo-gutenberg-products-block"),name:Object(c.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),j({type:Object(c.__)("Color","woo-gutenberg-products-block"),name:Object(c.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,P,x,N,T)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{if(n)return(()=>{const e=window.location.href,t=Object(g.getQueryArgs)(e),r=Object(g.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!(e.includes("min_price")||e.includes("max_price")||e.includes("rating_filter")||e.includes("filter_")||e.includes("query_type_"))).map(e=>[e,t[e]]));window.location.href=Object(g.addQueryArgs)(r,n)})();h(void 0),k(void 0),f([]),y([])}},Object(o.createElement)(u.a,{label:Object(c.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Clear All Filters","woo-gutenberg-products-block")}))))},getProps:e=>({attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3},isEditor:!1})})},3:function(e,t){e.exports=window.React},30:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(12),c=r.n(o);function s(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},33:function(e,t){},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(5),o=r(7),c=r(0),s=r(12),a=r.n(s),l=r(30),i=r(58),u=r(23);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{s(e,t)},[e,s])]},p=(e,t,r)=>{const s=Object(u.a)();r=r||s;const a=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:l}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{l(r,e,t)},[r,e,l])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=b(t),s=Object(l.a)(n),p=Object(l.a)(e),d=Object(i.a)(p),f=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(d,p)||(o(Object.assign({},s,p)),f.current=!0)},[s,p,d,o]),f.current?[n,o]:[e,o]}},37:function(e,t){e.exports=window.wc.priceFormat},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},44:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return s})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return l})),r.d(t,"i",(function(){return i})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return O})),r.d(t,"b",(function(){return j}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=c.pluginUrl+"images/",a=c.pluginUrl+"build/",l=c.buildPhase,i=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),f=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),O=Object(o.getSetting)("shippingStates",{}),j=Object(o.getSetting)("allowedStates",{})},48:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(11),o=r.n(n),c=r(0),s=r(16);const a=[".wp-block-woocommerce-cart"],l=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const l=n(e,r),i=a(e,r),u={...e.dataset,...l.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:l={}}=e;Object(c.render)(Object(c.createElement)(s.a,l,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:l,attributes:u,errorBoundaryProps:i})})},i=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const s=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const s=c.querySelectorAll(o);l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},5:function(e,t){e.exports=window.wc.wcBlocksData},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},6:function(e,t){e.exports=window.lodash},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),o=r(7),c=r(0),s=r(30),a=r(72);const l=e=>{const{namespace:t,resourceName:r,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(c.useRef)({results:[],isLoading:!0}),p=Object(s.a)(i),d=Object(s.a)(l),f=Object(a.a)(),m=Object(o.useSelect)(e=>{if(!u)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,p,d],s=o.getCollectionError(...c);if(s){if(!(s instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");f(s)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,d,p,u]);return null!==m&&(b.current=m),b.current}},7:function(e,t){e.exports=window.wp.data},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},98:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return s}));var n=r(14);const o="query_type_",c="filter_";function s(e){return window?Object(n.getQueryArg)(window.location.href,e):null}}});
build/active-filters.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '4f5bfcb718cf4fa48b1cf66446fafca6');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f75158b8dfb0cf43af5b5e0174bed6a4');
build/active-filters.js CHANGED
@@ -1,15 +1,17 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var n,l,a=t[0],s=t[1],i=t[2],b=0,p=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&p.push(r[l][0]),r[l]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,i||[]),c()}function c(){for(var e,t=0;t<o.length;t++){for(var c=o[t],n=!0,a=1;a<c.length;a++){var s=c[a];0!==r[s]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=c[0]))}return e}var n={},r={6:0},o=[];function l(t){if(n[t])return n[t].exports;var c=n[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=e,l.c=n,l.d=function(e,t,c){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(l.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(c,n,function(t){return e[t]}.bind(null,n));return c},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([413,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},106:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(8);function r(e,t){const c=Object(n.useRef)();return Object(n.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},118:function(e,t,c){"use strict";var n=c(0),r=c(5),o=c(10),l=c(1);c(153),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:c,onChange:o,heading:a,instanceId:s}=e;const i="h"+c;return Object(n.createElement)(i,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(r.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},12:function(e,t){e.exports=window.wp.primitives},121:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(0);const r=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},122:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(18),r=c(9),o=c(0),l=c(48),a=c(121);const s=e=>{const{namespace:t,resourceName:c,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(l.a)(i),d=Object(l.a)(s),m=Object(a.a)(),f=Object(r.useSelect)(e=>{if(!u)return null;const r=e(n.COLLECTIONS_STORE_KEY),o=[t,c,p,d],l=r.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(l)}return{results:r.getCollection(...o),isLoading:!r.hasFinishedResolution("getCollection",o)}},[t,c,d,p,u]);return null!==f&&(b.current=f),b.current}},13:function(e,t){e.exports=window.wp.blocks},14:function(e,t){e.exports=window.wp.htmlEntities},153:function(e,t){},154:function(e,t){},166:function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));var n=c(7);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===c.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(r)))return;const a=l.slug.filter(e=>e!==r),s=e.filter(e=>e.attribute!==c.taxonomy);a.length>0&&(l.slug=a.sort(),s.push(l)),t(Object(n.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const l=e.filter(e=>e.attribute!==c.taxonomy);return 0===r.length?t(l):(l.push({attribute:c.taxonomy,operator:o,slug:r.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(l,"attribute"))),l}},17:function(e,t){e.exports=window.wp.url},18:function(e,t){e.exports=window.wc.wcBlocksData},192:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var n=c(2);const r=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const c=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return c.id&&e.push(c),e},[]),o=e=>{if(e)return r.find(t=>t.id===e)},l=e=>{if(e)return r.find(t=>t.taxonomy===e)}},2:function(e,t){e.exports=window.wc.wcSettings},202:function(e,t,c){"use strict";var n=c(6),r=c.n(n),o=c(0),l=c(4),a=c.n(l),s=c(1),i=c(110),u=c(536);c(154);var b=e=>{let{text:t,screenReaderText:c="",element:n="li",className:l="",radius:s="small",children:i=null,...u}=e;const b=n,p=a()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+s),d=Boolean(c&&c!==t);return Object(o.createElement)(b,r()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:n=!1,onRemove:l=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...f}=e;const O=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
- Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
- Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const g={"aria-label":t,disabled:n,onClick:l,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||l()}},h=p?g:{},j=p?{"aria-hidden":!0}:g;return Object(o.createElement)(b,r()({},f,h,{className:a()(c,"is-removable"),element:p?"button":f.element,screenReaderText:m,text:d}),Object(o.createElement)(O,r()({className:"wc-block-components-chip__remove"},j),Object(o.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},25:function(e,t){e.exports=window.wp.isShallowEqual},27:function(e,t){e.exports=window.wc.priceFormat},283:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},3:function(e,t){e.exports=window.wp.components},30:function(e,t,c){"use strict";var n=c(0),r=c(4),o=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=c,i=null!=r;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,r)):(t=l||n.Fragment,s&&i&&c!==r?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},r)):Object(n.createElement)(t,a,c))}},413:function(e,t,c){e.exports=c(479)},414:function(e,t){},479:function(e,t,c){"use strict";c.r(t);var n=c(6),r=c.n(n),o=c(0),l=c(1),a=c(13),s=c(12),i=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),u=c(110),b=c(4),p=c.n(b),d=c(5),m=c(99),f=c(118),O=c(3),g=c(76),h=c(2),j=c(30),w=c(283),v=(c(414),c(192)),_=c(27),y=c(202),E=c(17);const k=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(l.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
- Object(l.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(l.sprintf)(
8
  /* translators: %s min price */
9
- Object(l.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(l.sprintf)(
10
  /* translators: %s max price */
11
- Object(l.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t)),x=e=>{let{type:t,name:c,prefix:n,removeCallback:r=(()=>{}),showLabel:a=!0,displayStyle:s}=e;const i=n?Object(o.createElement)(o.Fragment,null,n," ",c):c,u=Object(l.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
- Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),c);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+c},a&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(y.a,{element:"span",text:i,onRemove:r,radius:"large",ariaLabel:u}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:r},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(j.a,{screenReaderLabel:u}))))},S=function(){const e=window.location.href,t=Object(E.getQueryArgs)(e),c=Object(E.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const c=Object.keys(e)[0],n=t[c].split(",");t[c]=n.filter(t=>t!==e[c]).join(",")}});const l=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t}));window.location.href=Object(E.addQueryArgs)(c,l)};var C=c(122),N=c(14),L=c(166),T=e=>{let{attributeObject:t={},slugs:c=[],operator:n="in",displayStyle:r}=e;const{results:a,isLoading:s}=Object(C.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[i,u]=Object(g.b)("attributes",[]);if(s)return null;const b=t.label,p=Object(h.getSettingWithCoercion)("is_rendering_php_template",!1,w.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},b,":"),Object(o.createElement)("ul",null,c.map((e,c)=>{const s=a.find(t=>t.slug===e);if(!s)return null;let d="";return c>0&&"and"===n&&(d=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(l.__)("and","woo-gutenberg-products-block"))),x({type:b,name:Object(N.decodeEntities)(s.name||e),prefix:d,removeCallback:()=>{if(p)return 1===i.find(e=>{let{attribute:c}=e;return c==="pa_"+t.name}).slug.length?S("query_type_"+t.name,"filter_"+t.name):S({["filter_"+t.name]:e});Object(L.a)(i,u,t,e)},showLabel:!1,displayStyle:r})})))},H=e=>{let{attributes:t,isEditor:c=!1}=e;const n=Object(h.getSettingWithCoercion)("is_rendering_php_template",!1,w.a),[r,a]=Object(g.b)("attributes",[]),[s,i]=Object(g.b)("stock_status",[]),[u,b]=Object(g.b)("min_price"),[d,m]=Object(g.b)("max_price"),f=Object(h.getSetting)("stockStatusOptions",[]),O=Object(o.useMemo)(()=>{if(s.length>0)return s.map(e=>x({type:Object(l.__)("Stock Status","woo-gutenberg-products-block"),name:f[e],removeCallback:()=>{if(n)return S({filter_stock_status:e});const t=s.filter(t=>t!==e);i(t)},displayStyle:t.displayStyle}))},[f,s,i,t.displayStyle,n]),_=Object(o.useMemo)(()=>Number.isFinite(u)||Number.isFinite(d)?x({type:Object(l.__)("Price","woo-gutenberg-products-block"),name:k(u,d),removeCallback:()=>{if(n)return S("max_price","min_price");b(void 0),m(void 0)},displayStyle:t.displayStyle}):null,[u,d,t.displayStyle,b,m,n]),y=Object(o.useMemo)(()=>r.map(e=>{const c=Object(v.b)(e.attribute);return Object(o.createElement)(T,{attributeObject:c,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[r,t.displayStyle]);if(!(r.length>0||s.length>0||Number.isFinite(u)||Number.isFinite(d)||c))return null;const E="h"+t.headingLevel,C=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!c&&t.heading&&Object(o.createElement)(E,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},c?Object(o.createElement)(o.Fragment,null,x({type:Object(l.__)("Size","woo-gutenberg-products-block"),name:Object(l.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(l.__)("Color","woo-gutenberg-products-block"),name:Object(l.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,O,y)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{n?window.location.href=(()=>{const e=window.location.href,t=e.indexOf("?");return-1===t?e:e.substring(0,t)})():(b(void 0),m(void 0),a([]),i([]))}},Object(o.createElement)(j.a,{label:Object(l.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(l.__)("Clear All Filters","woo-gutenberg-products-block")}))))},R=Object(O.withSpokenMessages)(e=>{let{attributes:t,setAttributes:c}=e;const{className:n,displayStyle:r,heading:a,headingLevel:s}=t,i=Object(d.useBlockProps)({className:n});return Object(o.createElement)("div",i,Object(o.createElement)(d.InspectorControls,{key:"inspector"},Object(o.createElement)(O.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(O.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:r,onChange:e=>c({displayStyle:e})},Object(o.createElement)(O.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woo-gutenberg-products-block")}),Object(o.createElement)(O.__experimentalToggleGroupControlOption,{value:"chips",label:Object(l.__)("Chips","woo-gutenberg-products-block")})),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(m.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:s,onChange:e=>c({headingLevel:e})}))),Object(o.createElement)(f.a,{className:"wc-block-active-filters__title",headingLevel:s,heading:a,onChange:e=>c({heading:e})}),Object(o.createElement)(O.Disabled,null,Object(o.createElement)(H,{attributes:t,isEditor:!0})))});Object(a.registerBlockType)("woocommerce/active-filters",{apiVersion:2,title:Object(l.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:i,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(l.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(l.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1,color:{text:!0,background:!1}},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(l.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:R,save(e){let{attributes:t}=e;const{className:c,displayStyle:n,heading:l,headingLevel:a}=t,s={"data-display-style":n,"data-heading":l,"data-heading-level":a};return Object(o.createElement)("div",r()({},d.useBlockProps.save({className:p()("is-loading",c)}),s),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},48:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var n=c(0),r=c(25),o=c.n(r);function l(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},49:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(0);const r=Object(n.createContext)("page"),o=()=>Object(n.useContext)(r);r.Provider},5:function(e,t){e.exports=window.wp.blockEditor},7:function(e,t){e.exports=window.lodash},76:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return p})),c.d(t,"c",(function(){return d}));var n=c(18),r=c(9),o=c(0),l=c(25),a=c.n(l),s=c(48),i=c(106),u=c(49);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},p=(e,t,c)=>{const l=Object(u.a)();c=c||l;const a=Object(r.useSelect)(r=>r(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:s}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(c,e,t)},[c,e,s])]},d=(e,t)=>{const c=Object(u.a)();t=t||c;const[n,r]=b(t),l=Object(s.a)(n),p=Object(s.a)(e),d=Object(i.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(d,p)||(r(Object.assign({},l,p)),m.current=!0)},[l,p,d,r]),m.current?[n,r]:[e,r]}},8:function(e,t){e.exports=window.React},9:function(e,t){e.exports=window.wp.data},99:function(e,t,c){"use strict";var n=c(0),r=c(7),o=c(1),l=c(3),a=c(12);function s(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(n.createElement)(a.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(a.Path,{d:c[t]})):null}class i extends n.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(n.createElement)(s,{level:e}),title:Object(o.sprintf)(
 
 
14
  /* translators: %s: heading level e.g: "2", "3", "4" */
15
- Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:o,onChange:a}=this.props;return Object(n.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(s,{level:o}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,o,a))})}}t.a=i}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var c,l,i=t[0],a=t[1],s=t[2],b=0,p=[];b<i.length;b++)l=i[b],Object.prototype.hasOwnProperty.call(n,l)&&n[l]&&p.push(n[l][0]),n[l]=0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],c=!0,i=1;i<r.length;i++){var a=r[i];0!==n[a]&&(c=!1)}c&&(o.splice(t--,1),e=l(l.s=r[0]))}return e}var c={},n={6:0},o=[];function l(t){if(c[t])return c[t].exports;var r=c[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=c,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)l.d(r,c,function(t){return e[t]}.bind(null,c));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=a;return o.push([416,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},106:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(8);function n(e,t){const r=Object(c.useRef)();return Object(c.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},11:function(e,t){e.exports=window.wp.primitives},118:function(e,t,r){"use strict";var c=r(0),n=r(5),o=r(10),l=r(1);r(153),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:r,onChange:o,heading:i,instanceId:a}=e;const s="h"+r;return Object(c.createElement)(s,{className:t},Object(c.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+a},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(c.createElement)(n.PlainText,{id:"block-title-"+a,className:"wc-block-editor-components-title",value:i,onChange:o}))})},121:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(0);const n=()=>{const[,e]=Object(c.useState)();return Object(c.useCallback)(t=>{e(()=>{throw t})},[])}},122:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var c=r(18),n=r(9),o=r(0),l=r(48),i=r(121);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:s={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(l.a)(s),d=Object(l.a)(a),m=Object(i.a)(),f=Object(n.useSelect)(e=>{if(!u)return null;const n=e(c.COLLECTIONS_STORE_KEY),o=[t,r,p,d],l=n.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(l)}return{results:n.getCollection(...o),isLoading:!n.hasFinishedResolution("getCollection",o)}},[t,r,d,p,u]);return null!==f&&(b.current=f),b.current}},13:function(e,t){e.exports=window.wp.blocks},14:function(e,t){e.exports=window.wp.htmlEntities},153:function(e,t){},154:function(e,t){},16:function(e,t){e.exports=window.wp.url},163:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return l}));var c=r(16);const n="query_type_",o="filter_";function l(e){return window?Object(c.getQueryArg)(window.location.href,e):null}},167:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));var c=r(7);const n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===r.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(n)))return;const i=l.slug.filter(e=>e!==n),a=e.filter(e=>e.attribute!==r.taxonomy);i.length>0&&(l.slug=i.sort(),a.push(l)),t(Object(c.sortBy)(a,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const l=e.filter(e=>e.attribute!==r.taxonomy);return 0===n.length?t(l):(l.push({attribute:r.taxonomy,operator:o,slug:n.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(c.sortBy)(l,"attribute"))),l}},18:function(e,t){e.exports=window.wc.wcBlocksData},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return l}));var c=r(2);const n=Object(c.getSetting)("attributes",[]).reduce((e,t)=>{const r=(c=t)&&c.attribute_name?{id:parseInt(c.attribute_id,10),name:c.attribute_name,taxonomy:"pa_"+c.attribute_name,label:c.attribute_label}:null;var c;return r.id&&e.push(r),e},[]),o=e=>{if(e)return n.find(t=>t.id===e)},l=e=>{if(e)return n.find(t=>t.taxonomy===e)}},2:function(e,t){e.exports=window.wc.wcSettings},202:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),l=r(4),i=r.n(l),a=r(1),s=r(110),u=r(541);r(154);var b=e=>{let{text:t,screenReaderText:r="",element:c="li",className:l="",radius:a="small",children:s=null,...u}=e;const b=c,p=i()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+a),d=Boolean(r&&r!==t);return Object(o.createElement)(b,n()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},r),s)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:c=!1,onRemove:l=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...f}=e;const g=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
+ Object(a.__)("Remove","woo-gutenberg-products-block"):Object(a.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
+ Object(a.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:c,onClick:l,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||l()}},j=p?O:{},h=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,n()({},f,j,{className:i()(r,"is-removable"),element:p?"button":f.element,screenReaderText:m,text:d}),Object(o.createElement)(g,n()({className:"wc-block-components-chip__remove"},h),Object(o.createElement)(s.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},235:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));const c=e=>"boolean"==typeof e},25:function(e,t){e.exports=window.wp.isShallowEqual},27:function(e,t){e.exports=window.wc.priceFormat},3:function(e,t){e.exports=window.wp.components},30:function(e,t,r){"use strict";var c=r(0),n=r(4),o=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:l,wrapperProps:i={}}=e;const a=null!=r,s=null!=n;return!a&&s?(t=l||"span",i={...i,className:o()(i.className,"screen-reader-text")},Object(c.createElement)(t,i,n)):(t=l||c.Fragment,a&&s&&r!==n?Object(c.createElement)(t,i,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,i,r))}},416:function(e,t,r){e.exports=r(483)},417:function(e,t){},48:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var c=r(0),n=r(25),o=r.n(n);function l(e){const t=Object(c.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},483:function(e,t,r){"use strict";r.r(t);var c=r(6),n=r.n(c),o=r(0),l=r(1),i=r(13),a=r(11),s=Object(o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),u=r(110),b=r(4),p=r.n(b),d=r(5),m=r(99),f=r(118),g=r(3),O=r(76),j=r(2),h=r(30),w=r(235),v=r(163),_=(r(417),r(192)),y=r(27),k=r(202),E=r(16);const x=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(l.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
+ Object(l.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(y.formatPrice)(e),Object(y.formatPrice)(t)):Number.isFinite(e)?Object(l.sprintf)(
8
  /* translators: %s min price */
9
+ Object(l.__)("From %s","woo-gutenberg-products-block"),Object(y.formatPrice)(e)):Object(l.sprintf)(
10
  /* translators: %s max price */
11
+ Object(l.__)("Up to %s","woo-gutenberg-products-block"),Object(y.formatPrice)(t)),S=e=>{let{type:t,name:r,prefix:c="",removeCallback:n=(()=>{}),showLabel:i=!0,displayStyle:a}=e;const s=c?Object(o.createElement)(o.Fragment,null,c," ",r):r,u=Object(l.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
+ Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},i&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===a?Object(o.createElement)(k.a,{element:"span",text:s,onRemove:n,radius:"large",ariaLabel:u}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},s,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:n},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(h.a,{screenReaderLabel:u}))))},C=function(){const e=window.location.href,t=Object(E.getQueryArgs)(e),r=Object(E.removeQueryArgs)(e,...Object.keys(t));for(var c=arguments.length,n=new Array(c),o=0;o<c;o++)n[o]=arguments[o];n.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],c=t[r].split(",");t[r]=c.filter(t=>t!==e[r]).join(",")}});const l=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t}));window.location.href=Object(E.addQueryArgs)(r,l)};var N=r(122),L=r(14),R=r(167),T=e=>{let{attributeObject:t={},slugs:r=[],operator:c="in",displayStyle:n}=e;const{results:i,isLoading:a}=Object(N.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[s,u]=Object(O.b)("attributes",[]);if(a)return null;const b=t.label,p=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,w.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},b,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const a=i.find(t=>t.slug===e);if(!a)return null;let d="";return r>0&&"and"===c&&(d=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(l.__)("and","woo-gutenberg-products-block"))),S({type:b,name:Object(L.decodeEntities)(a.name||e),prefix:d,removeCallback:()=>{if(p)return 1===s.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name}).slug.length?C("query_type_"+t.name,"filter_"+t.name):C({["filter_"+t.name]:e});Object(R.a)(s,u,t,e)},showLabel:!1,displayStyle:n})})))},H=e=>{let{attributes:t,isEditor:r=!1}=e;const c=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,w.a),[n,i]=Object(O.b)("attributes",[]),[a,s]=Object(O.b)("stock_status",[]),[u,b]=Object(O.b)("min_price"),[d,m]=Object(O.b)("max_price"),f=Object(j.getSetting)("stockStatusOptions",[]),g=Object(o.useMemo)(()=>{if(a.length>0)return a.map(e=>S({type:Object(l.__)("Stock Status","woo-gutenberg-products-block"),name:f[e],removeCallback:()=>{if(c)return C({filter_stock_status:e});const t=a.filter(t=>t!==e);s(t)},displayStyle:t.displayStyle}))},[f,a,s,t.displayStyle,c]),y=Object(o.useMemo)(()=>Number.isFinite(u)||Number.isFinite(d)?S({type:Object(l.__)("Price","woo-gutenberg-products-block"),name:x(u,d),removeCallback:()=>{if(c)return C("max_price","min_price");b(void 0),m(void 0)},displayStyle:t.displayStyle}):null,[u,d,t.displayStyle,b,m,c]),k=Object(o.useMemo)(()=>n.map(e=>{const r=Object(_.b)(e.attribute);return Object(o.createElement)(T,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[n,t.displayStyle]),[N,L]=Object(O.b)("ratings");Object(o.useEffect)(()=>{var e;if(!c)return;if(N.length&&N.length>0)return;const t=null===(e=Object(v.c)("rating_filter"))||void 0===e?void 0:e.toString();t&&L(t.split(","))},[c,N,L]);const R=Object(o.useMemo)(()=>{if(N.length>0)return N.map(e=>S({type:Object(l.__)("Rating","woo-gutenberg-products-block"),name:Object(l.sprintf)(
14
+ /* translators: %s is referring to the average rating value */
15
+ Object(l.__)("Rated %s out of 5","woo-gutenberg-products-block"),e),removeCallback:()=>{if(c)return C({rating_filter:e});const t=N.filter(t=>t!==e);L(t)},displayStyle:t.displayStyle}))},[N,L,t.displayStyle,c]);if(!(n.length>0||a.length>0||N.length>0||Number.isFinite(u)||Number.isFinite(d)||r))return null;const H="h"+t.headingLevel;if(!Object(j.getSettingWithCoercion)("has_filterable_products",!1,w.a))return null;const V=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(H,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:V},r?Object(o.createElement)(o.Fragment,null,S({type:Object(l.__)("Size","woo-gutenberg-products-block"),name:Object(l.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),S({type:Object(l.__)("Color","woo-gutenberg-products-block"),name:Object(l.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,y,g,k,R)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{if(c)return(()=>{const e=window.location.href,t=Object(E.getQueryArgs)(e),r=Object(E.removeQueryArgs)(e,...Object.keys(t)),c=Object.fromEntries(Object.keys(t).filter(e=>!(e.includes("min_price")||e.includes("max_price")||e.includes("rating_filter")||e.includes("filter_")||e.includes("query_type_"))).map(e=>[e,t[e]]));window.location.href=Object(E.addQueryArgs)(r,c)})();b(void 0),m(void 0),i([]),s([])}},Object(o.createElement)(h.a,{label:Object(l.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(l.__)("Clear All Filters","woo-gutenberg-products-block")}))))},V=Object(g.withSpokenMessages)(e=>{let{attributes:t,setAttributes:r}=e;const{className:c,displayStyle:n,heading:i,headingLevel:a}=t,s=Object(d.useBlockProps)({className:c});return Object(o.createElement)("div",s,Object(o.createElement)(d.InspectorControls,{key:"inspector"},Object(o.createElement)(g.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(g.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:n,onChange:e=>r({displayStyle:e})},Object(o.createElement)(g.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woo-gutenberg-products-block")}),Object(o.createElement)(g.__experimentalToggleGroupControlOption,{value:"chips",label:Object(l.__)("Chips","woo-gutenberg-products-block")})),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(m.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:a,onChange:e=>r({headingLevel:e})}))),Object(o.createElement)(f.a,{className:"wc-block-active-filters__title",headingLevel:a,heading:i,onChange:e=>r({heading:e})}),Object(o.createElement)(g.Disabled,null,Object(o.createElement)(H,{attributes:t,isEditor:!0})))});Object(i.registerBlockType)("woocommerce/active-filters",{apiVersion:2,title:Object(l.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:s,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(l.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(l.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1,color:{text:!0,background:!1}},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(l.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_layered_nav_filters"===t&&!(null==r||!r.raw)},transform:e=>{var t;let{instance:r}=e;return Object(i.createBlock)("woocommerce/active-filters",{displayStyle:"list",heading:(null==r||null===(t=r.raw)||void 0===t?void 0:t.title)||Object(l.__)("Active filters","woo-gutenberg-products-block"),headingLevel:3})}}]},edit:V,save(e){let{attributes:t}=e;const{className:r,displayStyle:c,heading:l,headingLevel:i}=t,a={"data-display-style":c,"data-heading":l,"data-heading-level":i};return Object(o.createElement)("div",n()({},d.useBlockProps.save({className:p()("is-loading",r)}),a),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var c=r(0);const n=Object(c.createContext)("page"),o=()=>Object(c.useContext)(n);n.Provider},5:function(e,t){e.exports=window.wp.blockEditor},7:function(e,t){e.exports=window.lodash},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var c=r(18),n=r(9),o=r(0),l=r(25),i=r.n(l),a=r(48),s=r(106),u=r(49);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(n.useSelect)(t=>t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(n.useDispatch)(c.QUERY_STATE_STORE_KEY);return[r,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},p=(e,t,r)=>{const l=Object(u.a)();r=r||l;const i=Object(n.useSelect)(n=>n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:a}=Object(n.useDispatch)(c.QUERY_STATE_STORE_KEY);return[i,Object(o.useCallback)(t=>{a(r,e,t)},[r,e,a])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[c,n]=b(t),l=Object(a.a)(c),p=Object(a.a)(e),d=Object(s.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{i()(d,p)||(n(Object.assign({},l,p)),m.current=!0)},[l,p,d,n]),m.current?[c,n]:[e,n]}},8:function(e,t){e.exports=window.React},9:function(e,t){e.exports=window.wp.data},99:function(e,t,r){"use strict";var c=r(0),n=r(7),o=r(1),l=r(3),i=r(11);function a(e){let{level:t}=e;const r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(c.createElement)(i.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(i.Path,{d:r[t]})):null}class s extends c.Component{createLevelControl(e,t,r){const n=e===t;return{icon:Object(c.createElement)(a,{level:e}),title:Object(o.sprintf)(
16
  /* translators: %s: heading level e.g: "2", "3", "4" */
17
+ Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:n,onClick:()=>r(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:r,selectedLevel:o,onChange:i}=this.props;return Object(c.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(c.createElement)(a,{level:o}),controls:Object(n.range)(t,r).map(e=>this.createLevelControl(e,o,i))})}}t.a=s}});
build/all-products-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'd63c19bd5f37558269868c07cbb7b0e4');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '6eea3de907b68e7b358eb8ad23715d8b');
build/all-products-frontend.js CHANGED
@@ -1,11 +1,11 @@
1
- !function(e){function t(t){for(var r,o,c=t[0],i=t[1],s=0,l=[];s<c.length;s++)o=c[s],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&l.push(n[o][0]),n[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(a&&a(t);l.length;)l.shift()()}var r={},n={9:0,73:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var c=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=c);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+""+({0:"vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66",1:"vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6",58:"product-add-to-cart",59:"product-button",60:"product-category-list",61:"product-image",62:"product-price",63:"product-rating",64:"product-sale-badge",65:"product-sku",66:"product-stock-indicator",67:"product-summary",68:"product-tag-list",69:"product-title",74:"vendors--product-add-to-cart"}[e]||e)+"-frontend.js?ver="+{0:"071743a9ca2cfdafd79f",1:"d7438a60524d4125b57c",58:"50eff8f5fff70dc8610a",59:"85c7aa511649d41b446a",60:"fc6ea771f3d6ff7f62b2",61:"19b8d0fd15c71c4481e8",62:"2f1bbff8a6369e12fa5b",63:"53cf1dfb63b6890c3ae9",64:"cba6ec9fb455cc190d63",65:"5cc21a8abd18cd74ad1d",66:"ed797f65df0077428e38",67:"24022c280e7ca710cf3a",68:"d39a7dfbae31b75dee45",69:"b1f2ea70a9f3fe1b0910",74:"8edd5bf541b656986ee3"}[e]}(e);var a=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",a.name="ChunkLoadError",a.type=o,a.request=c,r[1](a)}n[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:s})}),12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var a=i;o(o.s=207)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},,,function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";var n=r(19),o=r.n(n),c=r(0),i=r(3),s=r(1),a=r(44),l=e=>{let{imageUrl:t=a.l+"/block-error.svg",header:r=Object(s.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(s.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:i=Object(s.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(33);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:i,renderError:s,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof s?s({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.a11y},,function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:i,wrapperProps:s={}}=e;const a=null!=r,l=null!=o;return!a&&l?(t=i||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,o)):(t=i||n.Fragment,a&&l&&r!==o?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,s,r))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},function(e,t,r){"use strict";(function(e){var n=r(0);r(38);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(63))},function(e,t){e.exports=window.wp.apiFetch},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(n.useContext)(o)},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(12),c=r.n(o);function i(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(6),o=r(0),c=r(5),i=r(7),s=r(18),a=r(117),l=r(26),u=r(68);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},f={...m,email:""},g={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(s.decodeEntities)(r)]})),E={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:m,shippingRates:c.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),s=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();b();const p=Object(i.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return E;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:m,extensions:c.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),b=o.isCustomerDataUpdating(),{receiveCart:g}=n(c.CART_STORE_KEY),O=h(i.billingAddress),w=i.needsShipping?h(i.shippingAddress):O,j=i.fees.length>0?i.fees.map(e=>h(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:j,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingAddress:Object(a.a)(O),shippingAddress:Object(a.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,isLoadingRates:b,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:g}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.deprecated},function(e,t){},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(5),o=r(7),c=r(0),i=r(12),s=r.n(i),a=r(30),l=r(58),u=r(23);const d=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,r)=>{const i=Object(u.a)();r=r||i;const s=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:a}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[s,Object(c.useCallback)(t=>{a(r,e,t)},[r,e,a])]},b=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=d(t),i=Object(a.a)(n),p=Object(a.a)(e),b=Object(l.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{s()(b,p)||(o(Object.assign({},i,p)),m.current=!0)},[i,p,b,o]),m.current?[n,o]:[e,o]}},,function(e,t){e.exports=window.wc.priceFormat},function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(39),o=r(0),c=r(31);const i=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";var n=r(8),o=r(0),c=r(14),i=function({icon:e,className:t,...r}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:c},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(i,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===c.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(c.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return s})),r.d(t,"m",(function(){return a})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return E}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",s=c.pluginUrl+"build/",a=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),c=r(69),i=r(52);const s=Object(n.getSetting)("countryLocale",{}),a=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(c.a)(e.priority)&&(t.index=e.priority),Object(i.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(s).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,a(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(11),o=r.n(n),c=r(0),i=r(15);const s=[".wp-block-woocommerce-cart"],a=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:s=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const a=n(e,r),l=s(e,r),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:s={},errorBoundaryProps:a={}}=e;Object(c.render)(Object(c.createElement)(i.a,a,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},s,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(s.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},,function(e,t,r){"use strict";var n=r(8),o=r(0),c=r(4),i=r.n(c),s=r(6),a=r(32),l=r.n(a),u=r(13),d=r(51),p=r(93),b=r(1);function m(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const c=o.getBoundingClientRect();return new n.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function g(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=f)}let h=0;function E(){return Object(o.useEffect)(()=>(0===h&&g(!0),++h,()=>{1===h&&g(!1),--h}),[]),null}var O=r(24);function w(e){const t=Object(o.useContext)(O.a),r=t.slots[e]||{},n=t.fills[e],c=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var j=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:r,unregisterFill:n}){const c=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(j),[n,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),r(()=>{c(t(e))})),[e]),n})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,i.current),()=>n(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(n(i.current.name,i.current),i.current.name=e,r(e,i.current))},[e]),c&&c.node?(Object(s.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var y=e=>Object(o.createElement)(j.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(v,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,c=Object(s.map)(n(t,this),e=>{const t=Object(s.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(s.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(s.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(s.isFunction)(e)?e(c):c)}}var x=e=>Object(o.createElement)(j.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:c})=>Object(o.createElement)(_,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:c})));function k(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function S({name:e,children:t}){const r=w(e),n=Object(o.useRef)({rerender:k()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...c},i){const s=Object(o.useContext)(O.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(s.registerSlot(e,a,t),()=>{s.unregisterSlot(e,a)}),[s.registerSlot,s.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([i,a])},c))}));function P(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,e),Object(o.createElement)(S,e))}r(12),o.Component;const R=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(C,Object(n.a)({},t,{ref:r})):Object(o.createElement)(x,t));function N(e){return"appear"===e?"top":"left"}function T(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const s=r?parseInt(r,10):0,a=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-u,height:e.height-s-a,left:e.left+l,right:e.right-u,top:e.top+s,bottom:e.bottom-a}}function L(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function B(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function A(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const M=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:c,noArrow:s=!0,isAlternate:a,position:f="bottom right",range:g,focusOnMount:h="firstElement",anchorRef:O,shouldAnchorIncludePadding:j,anchorRect:v,getAnchorRect:y,expandOnMobile:_,animate:x=!0,onClickOutside:k,onFocusOutside:S,__unstableStickyBoundaryElement:C,__unstableSlotName:R="Popover",__unstableObserveElement:M,__unstableBoundaryParent:F,__unstableForcePosition:I,__unstableForceXAlignment:D,...z},H)=>{const W=Object(o.useRef)(null),V=Object(o.useRef)(null),Y=Object(o.useRef)(),U=Object(u.useViewportMatch)("medium","<"),[q,G]=Object(o.useState)(),K=w(R),X=_&&U,[J,Z]=Object(u.useResizeObserver)();s=X||s,Object(o.useLayoutEffect)(()=>{if(X)return A(Y.current,"is-without-arrow",s),A(Y.current,"is-alternate",a),L(Y.current,"data-x-axis"),L(Y.current,"data-y-axis"),B(Y.current,"top"),B(Y.current,"left"),B(V.current,"maxHeight"),void B(V.current,"maxWidth");const e=()=>{if(!Y.current||!V.current)return;let e=function(e,t,r,n=!1,o,c){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return m(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,c);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=m(n.getBoundingClientRect(),n.ownerDocument,c);return o?e:T(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=m(new window.DOMRect(r.left,r.top,r.width,i.bottom-r.top),e.ownerDocument,c);return o?s:T(s,n)}if(!e.current)return;const{parentNode:i}=e.current,s=i.getBoundingClientRect();return o?s:T(s,i)}(W,v,y,O,j,Y.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=Y.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var c;F&&(n=null===(c=Y.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=Z.height?Z:V.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:g,contentHeight:h,contentWidth:E}=function(e,t,r="top",n,o,c,i,s,a){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,c,i,s){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a};let b,m=r,f=null;if(!o&&!s)if("middle"===r&&u.contentHeight===a)m="middle";else if("top"===r&&d.contentHeight===a)m="top";else if("bottom"===r&&p.contentHeight===a)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;f=e!==a?e:null}return b="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:b,contentHeight:f}}(e,t,l,d,n,0,c,s);return{...function(e,t,r,n,o,c,i,s,a){const{width:l}=t;"left"===r&&Object(b.isRTL)()?r="right":"right"===r&&Object(b.isRTL)()&&(r="left"),"left"===n&&Object(b.isRTL)()?n="right":"right"===n&&Object(b.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===c||a||(p=u);let m=e.right;"left"===n?m=e.left:"middle"===c||a||(m=u);const f={popoverLeft:p,contentWidth:p-l>0?l:p},g={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let h,E=r,O=null;if(!o&&!s)if("center"===r&&d.contentWidth===l)E="center";else if("left"===r&&f.contentWidth===l)E="left";else if("right"===r&&g.contentWidth===l)E="right";else{E=f.contentWidth>g.contentWidth?"left":"right";const e="left"===E?f.contentWidth:g.contentWidth;l>window.innerWidth&&(O=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(h="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:g.popoverLeft,i){const e=i.getBoundingClientRect();h=Math.min(h,e.right-l),Object(b.isRTL)()||(h=Math.max(h,0))}return{xAxis:E,popoverLeft:h,contentWidth:O}}(e,t,u,d,n,p.yAxis,i,s,a),...p}}(e,i,f,C,Y.current,o,n,I,D);"number"==typeof l&&"number"==typeof u&&(B(Y.current,"top",l+"px"),B(Y.current,"left",u+"px")),A(Y.current,"is-without-arrow",s||"center"===p&&"middle"===g),A(Y.current,"is-alternate",a),L(Y.current,"data-x-axis",p),L(Y.current,"data-y-axis",g),B(V.current,"maxHeight","number"==typeof h?h+"px":""),B(V.current,"maxWidth","number"==typeof E?E+"px":""),G(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=Y.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const c=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",c),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),M&&(l=new r.MutationObserver(e),l.observe(M,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",c),r.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,v,y,O,j,f,Z,C,M,F]);const $=(e,r)=>{if("focus-outside"===e&&S)S(r);else if("focus-outside"===e&&k){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),k(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:h,__unstableOnClose:$,onClose:$}),re=Object(u.useMergeRefs)([Y,ee,H]),ne=Boolean(x&&q)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:r=N(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(n.a)({className:i()("components-popover",c,ne,{"is-expanded":X,"is-without-arrow":s,"is-alternate":a})},z,{ref:re},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(Q,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:V,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return K.ref&&(oe=Object(o.createElement)(P,{name:R},oe)),O||v?oe:Object(o.createElement)("span",{ref:W},oe)});M.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(R,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=M,I=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(s.isString)(e)&&(r=e),Object(s.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const D=Object(o.createElement)("div",{className:"event-catcher"}),z=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:r}),","),e),H=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),W=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var V=function({children:e,position:t,text:r,shortcut:n}){const[c,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{W(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},b=t=>{W(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},m=e=>"mouseUp"===e?b:"mouseDown"===e?p:void 0,f=m("mouseUp"),g=(t,r)=>n=>{if(W(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&c)return;d.cancel();const o=Object(s.includes)(["focus","mouseenter"],n.type);o!==a&&(r?d(o):l(o))},h=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>h,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:m("mouseDown")},O=o.Children.only(e),{children:w,disabled:j}=O.props;return(j?z:H)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(I,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:a,position:t,text:r,shortcut:n})})},Y=r(41),U=r(42);const q=["onMouseDown","onClick"];var Q=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:c,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:b,disabled:m,icon:f,iconPosition:g="left",iconSize:h,showTooltip:E,tooltipPosition:O,shortcut:w,label:j,children:v,text:y,variant:_,__experimentalIsFocusable:x,describedBy:k,...S}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:c,...i}){let s=c;var a,u,d,p,b;return t&&(null!==(a=s)&&void 0!==a||(s="primary")),n&&(null!==(u=s)&&void 0!==u||(s="tertiary")),r&&(null!==(d=s)&&void 0!==d||(s="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=s)&&void 0!==p||(s="secondary")),o&&(null!==(b=s)&&void 0!==b||(s="link")),{...i,variant:s}}(e),C=i()("components-button",b,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":a,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!v,"has-icon":!!f}),P=m&&!x,R=void 0===r||P?"button":"a",N="a"===R?{href:r,target:c}:{type:"button",disabled:P,"aria-pressed":u};if(m&&x){N["aria-disabled"]=!0;for(const e of q)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const T=!P&&(E&&j||w||!!j&&(!v||Object(s.isArray)(v)&&!v.length)&&!1!==E),L=k?Object(s.uniqueId)():null,B=S["aria-describedby"]||L,A=Object(o.createElement)(R,Object(n.a)({},N,S,{className:C,"aria-label":S["aria-label"]||j,"aria-describedby":B,ref:t}),f&&"left"===g&&Object(o.createElement)(Y.a,{icon:f,size:h}),y&&Object(o.createElement)(o.Fragment,null,y),f&&"right"===g&&Object(o.createElement)(Y.a,{icon:f,size:h}),v);return T?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(V,{text:k||j,shortcut:w,position:O},A),k&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:L},k))):Object(o.createElement)(o.Fragment,null,A,k&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:L},k)))}))},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),c=()=>Object(n.useContext)(o),i=e=>{let{children:t}=e;const[r,c]=Object(n.useState)(!1),i={setIsSuppressed:c,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:i},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r(7),c=r(0),i=r(30),s=r(72);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(c.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),b=Object(i.a)(a),m=Object(s.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,p,b],i=o.getCollectionError(...c);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(i)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,b,p,u]);return null!==f&&(d.current=f),d.current}},function(e,t){var r,n,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===c||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:c}catch(e){r=c}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&b())}function b(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d<t;)a&&a[d].run();d=-1,t=l.length}a=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||u||s(b)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return a}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!n)return;c||(c=document.body);const s=new n(e,{bubbles:r,cancelable:o,detail:i});c.dispatchEvent(s)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},function(e,t){e.exports=window.wp.blockEditor},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0);r(106);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];i(e),null==e||e.focus()}else i(e)})(e,r):i(e))})(r.current,e)}})))}},,,,,function(e,t){},,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(14);const c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},function(e,t,r){"use strict";var n=r(0),o=r(6),c=r(4),i=r.n(c),s=r(1),a=r(20),l=r(93),u=r(50);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:c=r,onRemove:p=o.noop,isDismissible:b=!0,actions:m=[],politeness:f=d(t),__unstableHTML:g,onDismiss:h=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(a.speak)(r,t)},[r,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":b});return g&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:c=!1,onClick:s,url:a},l)=>{let d=o;return"primary"===o||c||(d=a?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:s,className:i()("components-notice__action",e)},t)}))),b&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(s.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),h(),p()},showTooltip:!1}))}},,,,,,,,function(e,t){e.exports=window.wp.blocks},,function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},,function(e,t){},,function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o),i=r(22),s=r(13);r(122),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:r,label:o="",onChange:s,options:a,screenReaderLabel:l,value:u}=e;const d="wc-block-components-sort-select__select-"+r;return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},a&&a.map(e=>Object(n.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,,,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(45),o=(r(16),r(2));const c=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),i=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),c=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(c[r]="")}),c}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),o=r.n(n),c=r(0),i=r(4),s=r.n(i),a=r(94),l=r(7),u=(r(78),r(57));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:i}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:b}=Object(l.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(n);if(!m.length)return null;const f=s()(t,"wc-block-components-notices");return i?null:Object(c.createElement)("div",{className:f},m.map(e=>Object(c.createElement)(a.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&b(e.id,r)}}),e.content)))}},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(17),o=r(0),c=r(44);r.p=c.k,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(62)]).then(r.bind(null,399)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>r.e(61).then(r.bind(null,443)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>r.e(69).then(r.bind(null,444)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>r.e(63).then(r.bind(null,400)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>r.e(59).then(r.bind(null,401)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>r.e(67).then(r.bind(null,402)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>r.e(64).then(r.bind(null,312)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>r.e(65).then(r.bind(null,403)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>r.e(60).then(r.bind(null,404)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>r.e(68).then(r.bind(null,405)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>r.e(66).then(r.bind(null,406)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(74),r.e(58)]).then(r.bind(null,426)))});const i=e=>Object(n.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(235)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(57),c=r(48),i=r(3),s=r(1),a=r(6),l=r(4),u=r.n(l),d=r(22);r(210);var p=e=>{let{currentPage:t,displayFirstAndLastPages:r=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:c=3,onPageChange:i,totalPages:a}=e,{minIndex:l,maxIndex:p}=((e,t,r)=>{if(r<=2)return{minIndex:null,maxIndex:null};const n=e-1,o=Math.max(Math.floor(t-n/2),2),c=Math.min(Math.ceil(t+(n-(t-o))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(c-t))),2),maxIndex:c}})(c,t,a);const b=r&&Boolean(1!==l),m=r&&Boolean(p!==a),f=r&&Boolean(l&&l>3),g=r&&Boolean(p&&p<a-2);b&&3===l&&(l-=1),m&&p===a-2&&(p+=1);const h=[];if(l&&p)for(let e=l;e<=p;e++)h.push(e);return Object(n.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(n.createElement)(d.a,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t-1),title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(d.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(n.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>i(1),disabled:1===t},Object(n.createElement)(d.a,{label:"1",screenReaderLabel:Object(s.sprintf)(
4
  /* translators: %d is the page number (1, 2, 3...). */
5
  Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),h.map(e=>Object(n.createElement)("button",{key:e,className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>i(e),disabled:t===e},Object(n.createElement)(d.a,{label:e.toString(),screenReaderLabel:Object(s.sprintf)(
6
  /* translators: %d is the page number (1, 2, 3...). */
7
  Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),m&&Object(n.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:()=>i(a),disabled:t===a},Object(n.createElement)(d.a,{label:a.toString(),screenReaderLabel:Object(s.sprintf)(
8
  /* translators: %d is the page number (1, 2, 3...). */
9
- Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t+1),title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(n.createElement)(d.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))},b=r(58),m=r(35),f=r(62),g=r(5),h=r(7),E=r(30);var O=r(40),w=r(73),j=r(43),v=r(20),y=r(104),_=r(14),x=Object(n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(n.createElement)(_.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})),k=()=>{const{parentClassName:e}=Object(j.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(y.a,{className:e+"__no-products-image",icon:x,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(s.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},S=Object(n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(_.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),C=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:r}=Object(j.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:r+"__no-products"},Object(n.createElement)(y.a,{className:r+"__no-products-image",icon:S,size:100}),Object(n.createElement)("strong",{className:r+"__no-products-title"},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:r+"__no-products-description"},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},P=r(108);r(209);var R=e=>{let{onChange:t,value:r}=e;return Object(n.createElement)(P.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:r})},N=r(13),T=r(11),L=r.n(T),B=r(133);const A=(e,t,r,o)=>{if(!r)return;const c=Object(B.a)(e);return r.map((r,i)=>{let[s,a={}]=r,l=[];a.children&&a.children.length>0&&(l=A(e,t,a.children,o));const u=c[s];if(!u)return null;const d=t.id||0,p=["layout",s,i,o,d];return Object(n.createElement)(n.Suspense,{key:p.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(u,L()({},a,{children:l,product:t})))})};var M=Object(N.withInstanceId)(e=>{let{product:t={},attributes:r,instanceId:o}=e;const{layoutConfig:c}=r,{parentClassName:i,parentName:s}=Object(j.useInnerBlockLayoutContext)(),a=0===Object.keys(t).length,l=u()(i+"__product","wc-block-layout",{"is-loading":a});return Object(n.createElement)("li",{className:l,"aria-hidden":a},A(s,t,c,o))});r(208);const F=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},I=function(e){let{totalQuery:t,totalProducts:r}=e,{totalQuery:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(a.isEqual)(t,n)&&Number.isFinite(r)};var D=Object(w.a)(e=>{let{attributes:t,currentPage:r,onPageChange:o,onSortChange:c,sortValue:i,scrollToTop:l}=e;const[d,w]=Object(m.b)("attributes",[]),[y,_]=Object(m.b)("stock_status",[]),[x,S]=Object(m.b)("min_price"),[P,N]=Object(m.b)("max_price"),[T]=Object(m.c)((e=>{let{sortValue:t,currentPage:r,attributes:n}=e;const{columns:o,rows:c}=n;return{...F(t),catalog_visibility:"catalog",per_page:o*c,page:r}})({attributes:t,sortValue:i,currentPage:r})),{products:L,totalProducts:B,productsLoading:A}=(e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:r,isLoading:n}=Object(f.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:r,resourceName:n,resourceValues:o=[],query:c={}}=t;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(E.a)(c),s=Object(E.a)(o),{value:a,isLoading:l=!0}=Object(h.useSelect)(e=>{const t=e(g.COLLECTIONS_STORE_KEY),o=["x-wp-total",r,n,i,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",r,n,s,i]);return{value:a,isLoading:l}})(0,{...t,query:e});return{products:r,totalProducts:parseInt(o,10),productsLoading:n}})(T),{parentClassName:D,parentName:z}=Object(j.useInnerBlockLayoutContext)(),H=(e=>{const{order:t,orderby:r,page:n,per_page:o,...c}=e;return c||{}})(T),{dispatchStoreEvent:W}=Object(O.a)(),V=Object(b.a)({totalQuery:H,totalProducts:B},I);Object(n.useEffect)(()=>{W("product-list-render",{products:L,listName:z})},[L,z,W]),Object(n.useEffect)(()=>{Object(a.isEqual)(H,null==V?void 0:V.totalQuery)||(o(1),null!=V&&V.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(v.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(v.speak)(Object(s.sprintf)(
10
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
11
- Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(B))},[null==V?void 0:V.totalQuery,B,o,H]);const{contentVisibility:Y}=t,U=t.columns*t.rows,q=!Number.isFinite(B)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(a.isEqual)(H,null==V?void 0:V.totalQuery)?Math.ceil(((null==V?void 0:V.totalProducts)||0)/U):Math.ceil(B/U),Q=L.length?L:Array.from({length:U}),G=0!==L.length||A,K=d.length>0||y.length>0||Number.isFinite(x)||Number.isFinite(P);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:r,alignButtons:n,align:o}=t,c=void 0!==o?"align"+o:"";return u()(D,c,"has-"+e+"-columns",{"has-multiple-rows":r>1,"has-aligned-buttons":n})})()},(null==Y?void 0:Y.orderBy)&&G&&Object(n.createElement)(R,{onChange:c,value:i}),!G&&K&&Object(n.createElement)(C,{resetCallback:()=>{w([]),_([]),S(null),N(null)}}),!G&&!K&&Object(n.createElement)(k,null),G&&Object(n.createElement)("ul",{className:D+"__products"},Q.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(M,{key:e.id||r,attributes:t,product:e})}))),q>1&&Object(n.createElement)(p,{currentPage:r,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:q}))}),z=e=>{let{attributes:t}=e;const[r,o]=Object(n.useState)(1),[c,i]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(n.createElement)(D,{attributes:t,currentPage:r,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const r=null==e||null===(t=e.target)||void 0===t?void 0:t.value;i(r),o(1)},sortValue:c})};const H=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var W=r(123);class V extends i.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?H:Object(n.createElement)(j.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(o.a,null,Object(n.createElement)(W.a,{context:"wc/all-products"})),Object(n.createElement)(z,{attributes:e,urlParameterSuffix:t}))}}var Y=V;Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:e=>Object(n.createElement)(o.a,{context:"wc/all-products"},Object(n.createElement)(Y,e)),getProps:e=>({attributes:JSON.parse(e.dataset.attributes)})})}]);
1
+ !function(e){function t(t){for(var r,o,c=t[0],i=t[1],s=0,l=[];s<c.length;s++)o=c[s],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&l.push(n[o][0]),n[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(a&&a(t);l.length;)l.shift()()}var r={},n={9:0,73:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var c=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=c);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+""+({0:"vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66",1:"vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6",58:"product-add-to-cart",59:"product-button",60:"product-category-list",61:"product-image",62:"product-price",63:"product-rating",64:"product-sale-badge",65:"product-sku",66:"product-stock-indicator",67:"product-summary",68:"product-tag-list",69:"product-title",74:"vendors--product-add-to-cart"}[e]||e)+"-frontend.js?ver="+{0:"071743a9ca2cfdafd79f",1:"e2dda84269ff5f357820",58:"a1f5c37ffde9d75afc47",59:"31d91954dd894b010db7",60:"bdcd55f6a78f3780a8c9",61:"1ec1ff9f0e063d3f63ae",62:"36221c05f2759b8bd8fd",63:"09acab57fd9a8594caac",64:"c6ec41b82cb1fe4af0c7",65:"f04dd44c9314944f232b",66:"1e1f4698349331747d15",67:"d613d9c8a37c5b8d3b1a",68:"d655fde20ee518912eb5",69:"9275c1cccdfd844d56f7",74:"d4bf9e962fb49977699e"}[e]}(e);var a=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",a.name="ChunkLoadError",a.type=o,a.request=c,r[1](a)}n[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:s})}),12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var a=i;o(o.s=207)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},,,function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";var n=r(19),o=r.n(n),c=r(0),i=r(3),s=r(1),a=r(44),l=e=>{let{imageUrl:t=a.l+"/block-error.svg",header:r=Object(s.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(s.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:i=Object(s.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(33);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:i,renderError:s,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof s?s({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.a11y},,function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:i,wrapperProps:s={}}=e;const a=null!=r,l=null!=o;return!a&&l?(t=i||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,o)):(t=i||n.Fragment,a&&l&&r!==o?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,s,r))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},function(e,t,r){"use strict";(function(e){var n=r(0);r(38);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(63))},function(e,t){e.exports=window.wp.apiFetch},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(n.useContext)(o)},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(12),c=r.n(o);function i(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(6),o=r(0),c=r(5),i=r(7),s=r(18),a=r(118),l=r(27),u=r(68);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},f={...m,email:""},g={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(s.decodeEntities)(r)]})),E={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:m,shippingRates:c.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),s=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();b();const p=Object(i.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return E;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:m,extensions:c.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),b=o.isCustomerDataUpdating(),{receiveCart:g}=n(c.CART_STORE_KEY),O=h(i.billingAddress),w=i.needsShipping?h(i.shippingAddress):O,j=i.fees.length>0?i.fees.map(e=>h(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:j,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingAddress:Object(a.a)(O),shippingAddress:Object(a.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,isLoadingRates:b,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:g}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.deprecated},function(e,t){},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(5),o=r(7),c=r(0),i=r(12),s=r.n(i),a=r(30),l=r(58),u=r(23);const d=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,r)=>{const i=Object(u.a)();r=r||i;const s=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:a}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[s,Object(c.useCallback)(t=>{a(r,e,t)},[r,e,a])]},b=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=d(t),i=Object(a.a)(n),p=Object(a.a)(e),b=Object(l.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{s()(b,p)||(o(Object.assign({},i,p)),m.current=!0)},[i,p,b,o]),m.current?[n,o]:[e,o]}},,function(e,t){e.exports=window.wc.priceFormat},function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(39),o=r(0),c=r(31);const i=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";var n=r(8),o=r(0),c=r(15),i=function({icon:e,className:t,...r}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:c},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(i,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===c.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(c.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return s})),r.d(t,"m",(function(){return a})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return E}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",s=c.pluginUrl+"build/",a=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),c=r(69),i=r(52);const s=Object(n.getSetting)("countryLocale",{}),a=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(c.a)(e.priority)&&(t.index=e.priority),Object(i.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(s).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,a(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(11),o=r.n(n),c=r(0),i=r(16);const s=[".wp-block-woocommerce-cart"],a=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:s=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const a=n(e,r),l=s(e,r),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:s={},errorBoundaryProps:a={}}=e;Object(c.render)(Object(c.createElement)(i.a,a,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},s,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(s.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},,function(e,t,r){"use strict";var n=r(8),o=r(0),c=r(4),i=r.n(c),s=r(6),a=r(32),l=r.n(a),u=r(13),d=r(51),p=r(93),b=r(1);function m(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const c=o.getBoundingClientRect();return new n.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function g(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=f)}let h=0;function E(){return Object(o.useEffect)(()=>(0===h&&g(!0),++h,()=>{1===h&&g(!1),--h}),[]),null}var O=r(24);function w(e){const t=Object(o.useContext)(O.a),r=t.slots[e]||{},n=t.fills[e],c=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var j=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:r,unregisterFill:n}){const c=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(j),[n,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),r(()=>{c(t(e))})),[e]),n})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,i.current),()=>n(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(n(i.current.name,i.current),i.current.name=e,r(e,i.current))},[e]),c&&c.node?(Object(s.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var y=e=>Object(o.createElement)(j.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(v,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,c=Object(s.map)(n(t,this),e=>{const t=Object(s.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(s.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(s.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(s.isFunction)(e)?e(c):c)}}var x=e=>Object(o.createElement)(j.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:c})=>Object(o.createElement)(_,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:c})));function k(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function S({name:e,children:t}){const r=w(e),n=Object(o.useRef)({rerender:k()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...c},i){const s=Object(o.useContext)(O.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(s.registerSlot(e,a,t),()=>{s.unregisterSlot(e,a)}),[s.registerSlot,s.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([i,a])},c))}));function P(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,e),Object(o.createElement)(S,e))}r(12),o.Component;const R=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(C,Object(n.a)({},t,{ref:r})):Object(o.createElement)(x,t));function N(e){return"appear"===e?"top":"left"}function T(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const s=r?parseInt(r,10):0,a=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-u,height:e.height-s-a,left:e.left+l,right:e.right-u,top:e.top+s,bottom:e.bottom-a}}function L(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function B(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function A(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const M=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:c,noArrow:s=!0,isAlternate:a,position:f="bottom right",range:g,focusOnMount:h="firstElement",anchorRef:O,shouldAnchorIncludePadding:j,anchorRect:v,getAnchorRect:y,expandOnMobile:_,animate:x=!0,onClickOutside:k,onFocusOutside:S,__unstableStickyBoundaryElement:C,__unstableSlotName:R="Popover",__unstableObserveElement:M,__unstableBoundaryParent:F,__unstableForcePosition:I,__unstableForceXAlignment:D,...z},H)=>{const W=Object(o.useRef)(null),V=Object(o.useRef)(null),Y=Object(o.useRef)(),U=Object(u.useViewportMatch)("medium","<"),[q,G]=Object(o.useState)(),K=w(R),X=_&&U,[J,Z]=Object(u.useResizeObserver)();s=X||s,Object(o.useLayoutEffect)(()=>{if(X)return A(Y.current,"is-without-arrow",s),A(Y.current,"is-alternate",a),L(Y.current,"data-x-axis"),L(Y.current,"data-y-axis"),B(Y.current,"top"),B(Y.current,"left"),B(V.current,"maxHeight"),void B(V.current,"maxWidth");const e=()=>{if(!Y.current||!V.current)return;let e=function(e,t,r,n=!1,o,c){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return m(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,c);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=m(n.getBoundingClientRect(),n.ownerDocument,c);return o?e:T(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=m(new window.DOMRect(r.left,r.top,r.width,i.bottom-r.top),e.ownerDocument,c);return o?s:T(s,n)}if(!e.current)return;const{parentNode:i}=e.current,s=i.getBoundingClientRect();return o?s:T(s,i)}(W,v,y,O,j,Y.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=Y.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var c;F&&(n=null===(c=Y.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=Z.height?Z:V.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:g,contentHeight:h,contentWidth:E}=function(e,t,r="top",n,o,c,i,s,a){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,c,i,s){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a};let b,m=r,f=null;if(!o&&!s)if("middle"===r&&u.contentHeight===a)m="middle";else if("top"===r&&d.contentHeight===a)m="top";else if("bottom"===r&&p.contentHeight===a)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;f=e!==a?e:null}return b="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:b,contentHeight:f}}(e,t,l,d,n,0,c,s);return{...function(e,t,r,n,o,c,i,s,a){const{width:l}=t;"left"===r&&Object(b.isRTL)()?r="right":"right"===r&&Object(b.isRTL)()&&(r="left"),"left"===n&&Object(b.isRTL)()?n="right":"right"===n&&Object(b.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===c||a||(p=u);let m=e.right;"left"===n?m=e.left:"middle"===c||a||(m=u);const f={popoverLeft:p,contentWidth:p-l>0?l:p},g={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let h,E=r,O=null;if(!o&&!s)if("center"===r&&d.contentWidth===l)E="center";else if("left"===r&&f.contentWidth===l)E="left";else if("right"===r&&g.contentWidth===l)E="right";else{E=f.contentWidth>g.contentWidth?"left":"right";const e="left"===E?f.contentWidth:g.contentWidth;l>window.innerWidth&&(O=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(h="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:g.popoverLeft,i){const e=i.getBoundingClientRect();h=Math.min(h,e.right-l),Object(b.isRTL)()||(h=Math.max(h,0))}return{xAxis:E,popoverLeft:h,contentWidth:O}}(e,t,u,d,n,p.yAxis,i,s,a),...p}}(e,i,f,C,Y.current,o,n,I,D);"number"==typeof l&&"number"==typeof u&&(B(Y.current,"top",l+"px"),B(Y.current,"left",u+"px")),A(Y.current,"is-without-arrow",s||"center"===p&&"middle"===g),A(Y.current,"is-alternate",a),L(Y.current,"data-x-axis",p),L(Y.current,"data-y-axis",g),B(V.current,"maxHeight","number"==typeof h?h+"px":""),B(V.current,"maxWidth","number"==typeof E?E+"px":""),G(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=Y.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const c=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",c),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),M&&(l=new r.MutationObserver(e),l.observe(M,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",c),r.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,v,y,O,j,f,Z,C,M,F]);const $=(e,r)=>{if("focus-outside"===e&&S)S(r);else if("focus-outside"===e&&k){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),k(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:h,__unstableOnClose:$,onClose:$}),re=Object(u.useMergeRefs)([Y,ee,H]),ne=Boolean(x&&q)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:r=N(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(n.a)({className:i()("components-popover",c,ne,{"is-expanded":X,"is-without-arrow":s,"is-alternate":a})},z,{ref:re},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(Q,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:V,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return K.ref&&(oe=Object(o.createElement)(P,{name:R},oe)),O||v?oe:Object(o.createElement)("span",{ref:W},oe)});M.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(R,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=M,I=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(s.isString)(e)&&(r=e),Object(s.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const D=Object(o.createElement)("div",{className:"event-catcher"}),z=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:r}),","),e),H=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),W=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var V=function({children:e,position:t,text:r,shortcut:n}){const[c,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{W(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},b=t=>{W(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},m=e=>"mouseUp"===e?b:"mouseDown"===e?p:void 0,f=m("mouseUp"),g=(t,r)=>n=>{if(W(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&c)return;d.cancel();const o=Object(s.includes)(["focus","mouseenter"],n.type);o!==a&&(r?d(o):l(o))},h=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>h,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:m("mouseDown")},O=o.Children.only(e),{children:w,disabled:j}=O.props;return(j?z:H)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(I,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:a,position:t,text:r,shortcut:n})})},Y=r(41),U=r(42);const q=["onMouseDown","onClick"];var Q=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:c,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:b,disabled:m,icon:f,iconPosition:g="left",iconSize:h,showTooltip:E,tooltipPosition:O,shortcut:w,label:j,children:v,text:y,variant:_,__experimentalIsFocusable:x,describedBy:k,...S}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:c,...i}){let s=c;var a,u,d,p,b;return t&&(null!==(a=s)&&void 0!==a||(s="primary")),n&&(null!==(u=s)&&void 0!==u||(s="tertiary")),r&&(null!==(d=s)&&void 0!==d||(s="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=s)&&void 0!==p||(s="secondary")),o&&(null!==(b=s)&&void 0!==b||(s="link")),{...i,variant:s}}(e),C=i()("components-button",b,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":a,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!v,"has-icon":!!f}),P=m&&!x,R=void 0===r||P?"button":"a",N="a"===R?{href:r,target:c}:{type:"button",disabled:P,"aria-pressed":u};if(m&&x){N["aria-disabled"]=!0;for(const e of q)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const T=!P&&(E&&j||w||!!j&&(!v||Object(s.isArray)(v)&&!v.length)&&!1!==E),L=k?Object(s.uniqueId)():null,B=S["aria-describedby"]||L,A=Object(o.createElement)(R,Object(n.a)({},N,S,{className:C,"aria-label":S["aria-label"]||j,"aria-describedby":B,ref:t}),f&&"left"===g&&Object(o.createElement)(Y.a,{icon:f,size:h}),y&&Object(o.createElement)(o.Fragment,null,y),f&&"right"===g&&Object(o.createElement)(Y.a,{icon:f,size:h}),v);return T?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(V,{text:k||j,shortcut:w,position:O},A),k&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:L},k))):Object(o.createElement)(o.Fragment,null,A,k&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:L},k)))}))},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),c=()=>Object(n.useContext)(o),i=e=>{let{children:t}=e;const[r,c]=Object(n.useState)(!1),i={setIsSuppressed:c,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:i},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r(7),c=r(0),i=r(30),s=r(72);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(c.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),b=Object(i.a)(a),m=Object(s.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,p,b],i=o.getCollectionError(...c);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(i)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,b,p,u]);return null!==f&&(d.current=f),d.current}},function(e,t){var r,n,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===c||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:c}catch(e){r=c}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&b())}function b(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d<t;)a&&a[d].run();d=-1,t=l.length}a=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||u||s(b)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return a}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!n)return;c||(c=document.body);const s=new n(e,{bubbles:r,cancelable:o,detail:i});c.dispatchEvent(s)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},function(e,t){e.exports=window.wp.blockEditor},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0);r(107);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];i(e),null==e||e.focus()}else i(e)})(e,r):i(e))})(r.current,e)}})))}},,,,,function(e,t){},,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(15);const c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},function(e,t,r){"use strict";var n=r(0),o=r(6),c=r(4),i=r.n(c),s=r(1),a=r(20),l=r(93),u=r(50);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:c=r,onRemove:p=o.noop,isDismissible:b=!0,actions:m=[],politeness:f=d(t),__unstableHTML:g,onDismiss:h=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(a.speak)(r,t)},[r,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":b});return g&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:c=!1,onClick:s,url:a},l)=>{let d=o;return"primary"===o||c||(d=a?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:s,className:i()("components-notice__action",e)},t)}))),b&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(s.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),h(),p()},showTooltip:!1}))}},,,,,,,,,function(e,t){e.exports=window.wp.blocks},,function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},,function(e,t){},,function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o),i=r(22),s=r(13);r(123),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:r,label:o="",onChange:s,options:a,screenReaderLabel:l,value:u}=e;const d="wc-block-components-sort-select__select-"+r;return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},a&&a.map(e=>Object(n.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},,function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(45),o=(r(14),r(2));const c=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),i=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),c=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(c[r]="")}),c}},,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),o=r.n(n),c=r(0),i=r(4),s=r.n(i),a=r(94),l=r(7),u=(r(78),r(57));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:i}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:b}=Object(l.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(n);if(!m.length)return null;const f=s()(t,"wc-block-components-notices");return i?null:Object(c.createElement)("div",{className:f},m.map(e=>Object(c.createElement)(a.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&b(e.id,r)}}),e.content)))}},,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(17),o=r(0),c=r(44);r.p=c.k,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(62)]).then(r.bind(null,399)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>r.e(61).then(r.bind(null,443)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>r.e(69).then(r.bind(null,444)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>r.e(63).then(r.bind(null,400)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>r.e(59).then(r.bind(null,401)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>r.e(67).then(r.bind(null,402)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>r.e(64).then(r.bind(null,312)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>r.e(65).then(r.bind(null,403)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>r.e(60).then(r.bind(null,404)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>r.e(68).then(r.bind(null,405)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>r.e(66).then(r.bind(null,406)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(74),r.e(58)]).then(r.bind(null,426)))});const i=e=>Object(n.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(235)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(57),c=r(48),i=r(3),s=r(1),a=r(6),l=r(4),u=r.n(l),d=r(22);r(210);var p=e=>{let{currentPage:t,displayFirstAndLastPages:r=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:c=3,onPageChange:i,totalPages:a}=e,{minIndex:l,maxIndex:p}=((e,t,r)=>{if(r<=2)return{minIndex:null,maxIndex:null};const n=e-1,o=Math.max(Math.floor(t-n/2),2),c=Math.min(Math.ceil(t+(n-(t-o))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(c-t))),2),maxIndex:c}})(c,t,a);const b=r&&Boolean(1!==l),m=r&&Boolean(p!==a),f=r&&Boolean(l&&l>3),g=r&&Boolean(p&&p<a-2);b&&3===l&&(l-=1),m&&p===a-2&&(p+=1);const h=[];if(l&&p)for(let e=l;e<=p;e++)h.push(e);return Object(n.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(n.createElement)(d.a,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t-1),title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(d.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(n.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>i(1),disabled:1===t},Object(n.createElement)(d.a,{label:"1",screenReaderLabel:Object(s.sprintf)(
4
  /* translators: %d is the page number (1, 2, 3...). */
5
  Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),h.map(e=>Object(n.createElement)("button",{key:e,className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>i(e),disabled:t===e},Object(n.createElement)(d.a,{label:e.toString(),screenReaderLabel:Object(s.sprintf)(
6
  /* translators: %d is the page number (1, 2, 3...). */
7
  Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),m&&Object(n.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:()=>i(a),disabled:t===a},Object(n.createElement)(d.a,{label:a.toString(),screenReaderLabel:Object(s.sprintf)(
8
  /* translators: %d is the page number (1, 2, 3...). */
9
+ Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t+1),title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(n.createElement)(d.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))},b=r(58),m=r(35),f=r(62),g=r(5),h=r(7),E=r(30);var O=r(40),w=r(73),j=r(43),v=r(20),y=r(105),_=r(15),x=Object(n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(n.createElement)(_.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})),k=()=>{const{parentClassName:e}=Object(j.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(y.a,{className:e+"__no-products-image",icon:x,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(s.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},S=Object(n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(_.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),C=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:r}=Object(j.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:r+"__no-products"},Object(n.createElement)(y.a,{className:r+"__no-products-image",icon:S,size:100}),Object(n.createElement)("strong",{className:r+"__no-products-title"},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:r+"__no-products-description"},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},P=r(109);r(209);var R=e=>{let{onChange:t,value:r}=e;return Object(n.createElement)(P.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:r})},N=r(13),T=r(11),L=r.n(T),B=r(133);const A=(e,t,r,o)=>{if(!r)return;const c=Object(B.a)(e);return r.map((r,i)=>{let[s,a={}]=r,l=[];a.children&&a.children.length>0&&(l=A(e,t,a.children,o));const u=c[s];if(!u)return null;const d=t.id||0,p=["layout",s,i,o,d];return Object(n.createElement)(n.Suspense,{key:p.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(u,L()({},a,{children:l,product:t})))})};var M=Object(N.withInstanceId)(e=>{let{product:t={},attributes:r,instanceId:o}=e;const{layoutConfig:c}=r,{parentClassName:i,parentName:s}=Object(j.useInnerBlockLayoutContext)(),a=0===Object.keys(t).length,l=u()(i+"__product","wc-block-layout",{"is-loading":a});return Object(n.createElement)("li",{className:l,"aria-hidden":a},A(s,t,c,o))});r(208);const F=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},I=function(e){let{totalQuery:t,totalProducts:r}=e,{totalQuery:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(a.isEqual)(t,n)&&Number.isFinite(r)};var D=Object(w.a)(e=>{let{attributes:t,currentPage:r,onPageChange:o,onSortChange:c,sortValue:i,scrollToTop:l}=e;const[d,w]=Object(m.b)("attributes",[]),[y,_]=Object(m.b)("stock_status",[]),[x,S]=Object(m.b)("min_price"),[P,N]=Object(m.b)("max_price"),[T]=Object(m.c)((e=>{let{sortValue:t,currentPage:r,attributes:n}=e;const{columns:o,rows:c}=n;return{...F(t),catalog_visibility:"catalog",per_page:o*c,page:r}})({attributes:t,sortValue:i,currentPage:r})),{products:L,totalProducts:B,productsLoading:A}=(e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:r,isLoading:n}=Object(f.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:r,resourceName:n,resourceValues:o=[],query:c={}}=t;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(E.a)(c),s=Object(E.a)(o),{value:a,isLoading:l=!0}=Object(h.useSelect)(e=>{const t=e(g.COLLECTIONS_STORE_KEY),o=["x-wp-total",r,n,i,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",r,n,s,i]);return{value:a,isLoading:l}})(0,{...t,query:e});return{products:r,totalProducts:parseInt(o,10),productsLoading:n}})(T),{parentClassName:D,parentName:z}=Object(j.useInnerBlockLayoutContext)(),H=(e=>{const{order:t,orderby:r,page:n,per_page:o,...c}=e;return c||{}})(T),{dispatchStoreEvent:W}=Object(O.a)(),V=Object(b.a)({totalQuery:H,totalProducts:B},I);Object(n.useEffect)(()=>{W("product-list-render",{products:L,listName:z})},[L,z,W]),Object(n.useEffect)(()=>{Object(a.isEqual)(H,null==V?void 0:V.totalQuery)||(o(1),null!=V&&V.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(v.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(v.speak)(Object(s.sprintf)(
10
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
11
+ Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(B))},[null==V?void 0:V.totalQuery,B,o,H]);const{contentVisibility:Y}=t,U=t.columns*t.rows,q=!Number.isFinite(B)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(a.isEqual)(H,null==V?void 0:V.totalQuery)?Math.ceil(((null==V?void 0:V.totalProducts)||0)/U):Math.ceil(B/U),Q=L.length?L:Array.from({length:U}),G=0!==L.length||A,K=d.length>0||y.length>0||Number.isFinite(x)||Number.isFinite(P);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:r,alignButtons:n,align:o}=t,c=void 0!==o?"align"+o:"";return u()(D,c,"has-"+e+"-columns",{"has-multiple-rows":r>1,"has-aligned-buttons":n})})()},(null==Y?void 0:Y.orderBy)&&G&&Object(n.createElement)(R,{onChange:c,value:i}),!G&&K&&Object(n.createElement)(C,{resetCallback:()=>{w([]),_([]),S(null),N(null)}}),!G&&!K&&Object(n.createElement)(k,null),G&&Object(n.createElement)("ul",{className:D+"__products"},Q.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(M,{key:e.id||r,attributes:t,product:e})}))),q>1&&Object(n.createElement)(p,{currentPage:r,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:q}))}),z=e=>{let{attributes:t}=e;const[r,o]=Object(n.useState)(1),[c,i]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(n.createElement)(D,{attributes:t,currentPage:r,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const r=null==e||null===(t=e.target)||void 0===t?void 0:t.value;i(r),o(1)},sortValue:c})};const H=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var W=r(124);class V extends i.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?H:Object(n.createElement)(j.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(o.a,null,Object(n.createElement)(W.a,{context:"wc/all-products"})),Object(n.createElement)(z,{attributes:e,urlParameterSuffix:t}))}}var Y=V;Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:e=>Object(n.createElement)(o.a,{context:"wc/all-products"},Object(n.createElement)(Y,e)),getProps:e=>({attributes:JSON.parse(e.dataset.attributes)})})}]);
build/all-products.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'ba4bea9ab7c2dfbdd3cec9941fc5b3f7');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '531ad072461c0fcad9505ba4b299846a');
build/all-products.js CHANGED
@@ -1,36 +1,36 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var r,a,s=t[0],l=t[1],i=t[2],d=0,b=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);b.length;)b.shift()();return n.push.apply(n,i||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],r=!0,s=1;s<c.length;s++){var l=c[s];0!==o[l]&&(r=!1)}r&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var r={},o={7:0,1:0,2:0,3:0,4:0,5:0,21:0,24:0,28:0,29:0,31:0,32:0,33:0,35:0},n=[];function a(t){if(r[t])return r[t].exports;var c=r[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var t=[],c=o[e];if(0!==c)if(c)t.push(c[2]);else{var r=new Promise((function(t,r){c=o[e]=[t,r]}));t.push(c[2]=r);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00",2:"product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01",3:"product-add-to-cart--product-button--product-image--product-title",4:"product-add-to-cart--product-button",5:"product-sale-badge",19:"product-add-to-cart",21:"product-button",24:"product-category-list",25:"product-image",28:"product-price",29:"product-rating",31:"product-sku",32:"product-stock-indicator",33:"product-summary",35:"product-tag-list",36:"product-title"}[e]||e)+".js?ver="+{1:"2837fcb9558fb3317d12",2:"b5c69bff59e1e79e32bb",3:"6f2f12b17cabc66c096f",4:"43a0c25bd2d95296d325",5:"fef4d0b5d14382de1c31",19:"7809c4a02c5b716da256",21:"40fd4ee699d766fc6d80",24:"5ac949e4d1024d11f614",25:"a8df35bfa5332b6503b7",28:"bf4b78c8873af576f599",29:"274e9c35030f4fa08fe9",31:"319c5dc9f7d839bafa04",32:"eef432ad29dfa92a9c41",33:"6916c7417a1f4045bacd",35:"2227d1ee23d385ca46c9",36:"c78a220fa1e7fec7d290"}[e]}(e);var l=new Error;n=function(t){s.onerror=s.onload=null,clearTimeout(i);var c=o[e];if(0!==c){if(c){var r=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+n+")",l.name="ChunkLoadError",l.type=r,l.request=n,c[1](l)}o[e]=void 0}};var i=setTimeout((function(){n({type:"timeout",target:s})}),12e4);s.onerror=s.onload=n,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=r,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(c,r,function(t){return e[t]}.bind(null,r));return c},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var u=l;return n.push([387,0]),c()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.wp.blockEditor},,function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.compose},,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.apiFetch},,function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wc.wcBlocksData},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return i})),c.d(t,"b",(function(){return u}));var r=c(0),o=c(7),n=c(1);const a={clear:Object(n.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(n.__)("No items found.","woo-gutenberg-products-block"),
2
  /* Translators: %s search term */
3
  noResults:Object(n.__)("No results for %s","woo-gutenberg-products-block"),search:Object(n.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(n.sprintf)(
4
  /* translators: Number of items selected from list. */
5
- Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(o.groupBy)(e,"parent"),r=Object(o.keyBy)(t,"id"),n=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return n.push(""+e.id),{...e,breadcrumbs:a(r[e.parent]),children:t&&t.length?s(t):[]}}),l=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;n.includes(t)||l.push(...s(c||[]))}),l},l=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(o,e):o},i=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(r.createElement)(r.Fragment,{key:c},Object(r.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},,,function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return _}));var r,o=c(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,O=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),j=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),_=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var r=c(17),o=c(15),n=c.n(o),a=c(7),s=c(2),l=c(24);const i=e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...a,...o})];return n&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:o});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:c}=e;const o=(e=>{let{selected:t=[],search:c}=e;const o=Object(s.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:c})];return o&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),O=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var r=c(1),o=c(14);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o);t.a=e=>{let t,{label:c,screenReaderLabel:o,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=o;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,o)):(t=a||r.Fragment,l&&i&&c!==o?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,s,c))}},,function(e,t){e.exports=window.wp.escapeHtml},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(32);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),o=c.n(r),n=c(0),a=c(21);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:d,search:b="",...p}=e;const m=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,j=p.name||"search-list-item-"+s,h=`${j}-${l.id}`;return Object(n.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",o()({type:"checkbox",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,b))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return i})),c.d(t,"d",(function(){return d}));var r=c(57);let o,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const a=(e,t)=>Object(r.a)(e)&&"type"in e&&e.type===t,s=e=>a(e,o.SUCCESS),l=e=>a(e,o.ERROR),i=e=>a(e,o.FAIL),u=e=>!Object(r.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:n,shouldRetry:u,isSuccessResponse:s,isErrorResponse:l,isFailResponse:i})},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(124),s=c(4),l=c.n(s);c(127);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:u="text",...d}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**r.minorUnit;if(!Number.isFinite(p))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...i(r),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,o()({className:m,displayType:u},g,{value:p,onValueChange:O}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var r=c(7),o=c(0),n=c(18),a=c(9),s=c(14),l=c(222),i=c(50),u=c(221);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},O={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),h={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:n.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(i.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();p();const b=Object(a.useSelect)((e,c)=>{let{dispatch:r}=c;if(!u)return h;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(n.CART_STORE_KEY),a=o.getCartData(),i=o.getCartErrors(),d=o.getCartTotals(),b=!o.hasFinishedResolution("getCartData"),p=o.isCustomerDataUpdating(),{receiveCart:O}=r(n.CART_STORE_KEY),_=j(a.billingAddress),E=a.needsShipping?j(a.shippingAddress):_,w=a.fees.length>0?a.fees.map(e=>j(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:w,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:b,cartErrors:i,billingAddress:Object(l.a)(_),shippingAddress:Object(l.a)(E),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:O}},[u]);return d.current&&Object(r.isEqual)(d.current,b)||(d.current=b),d.current}},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,function(e,t,c){"use strict";c.d(t,"c",(function(){return i})),c.d(t,"d",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"a",(function(){return b}));var r=c(5),o=c(71),n=c(119),a=c(57),s=c(91);const l=e=>Object(n.a)(e)?JSON.parse(e)||{}:Object(a.a)(e)?e:{},i=e=>{if(!Object(o.b)()||!Object(s.a)())return{style:{}};const t=Object(a.a)(e)?e:{},c=l(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},u=e=>{const t=Object(a.a)(e)?e:{},c=l(t.style),r=Object(a.a)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:t.fontFamily}}},d=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},c=l(t.style);return Object(r.__experimentalUseColorProps)({...t,style:c})},b=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},c=l(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:c})}},function(e,t){e.exports=window.wp.a11y},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(25),n=c.n(o);function a(e){const t=Object(r.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const o=Object(r.createContext)("page"),n=()=>Object(r.useContext)(o);o.Provider},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(0),o=c(9);const n=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(r.useContext)(n),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const l=Object(o.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(r.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:i};return Object(r.createElement)(n.Provider,{value:u},t)}},function(e,t){e.exports=window.wp.hooks},,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.autop},,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(7),a=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:d=1,maxRows:b=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(n.clamp)(e,d,b);s({rows:Number.isNaN(t)?"":t})},min:d,max:b}),Object(r.createElement)(a.ToggleControl,{label:Object(o.__)("Align Last Block","woo-gutenberg-products-block"),help:l?Object(o.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(o.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:l,onChange:()=>s({alignButtons:!l})}))}},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(51),o=c(0),n=c(39);const a=()=>{const e=Object(n.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(134),s=c(4),l=c.n(s),i=c(90);c(148),t.a=e=>{let{className:t,showSpinner:c=!1,children:r,variant:s="contained",...u}=e;const d=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,o()({className:d},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},r))}},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"d",(function(){return a})),c.d(t,"a",(function(){return s})),c.d(t,"b",(function(){return l}));var r=c(13),o=c(24);const n=(e,t)=>{if(o.n>2)return Object(r.registerBlockType)(e,t)},a=(e,t)=>{if(o.n>1)return Object(r.registerBlockType)(e,t)},s=()=>o.n>2,l=()=>o.n>1},,,function(e,t){e.exports=window.wp.dom},,function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b})),c.d(t,"c",(function(){return p}));var r=c(18),o=c(9),n=c(0),a=c(25),s=c.n(a),l=c(48),i=c(106),u=c(49);const d=e=>{const t=Object(u.a)();e=e||t;const c=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},b=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},p=(e,t)=>{const c=Object(u.a)();t=t||c;const[r,o]=d(t),a=Object(l.a)(r),b=Object(l.a)(e),p=Object(i.a)(b),m=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(p,b)||(o(Object.assign({},a,b)),m.current=!0)},[a,b,p,o]),m.current?[r,o]:[e,o]}},,,,,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(34),s=c(3),l=c(4),i=c.n(l);t.a=e=>{let{className:t,item:c,isSelected:r,isLoading:l,onSelect:u,disabled:d,...b}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.a,o()({},b,{key:c.id,className:t,isSelected:r,item:c,onSelect:u,isSingle:!0,disabled:d})),r&&l&&Object(n.createElement)("div",{key:"loading",className:i()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},,,function(e,t){e.exports=window.wp.wordcount},,function(e,t,c){"use strict";var r=c(2),o=c(1),n=c(155),a=c(119);const s=Object(r.getSetting)("countryLocale",{}),l=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
6
  /* translators: %s Field label. */
7
  Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},i=Object.entries(s).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,l(c)]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{})]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=c&&void 0!==i[c]?i[c]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var r=c(0);c(149),t.a=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(5);const o=()=>"function"==typeof r.__experimentalGetSpacingClassesAndStyles},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(36),a=c(4),s=c.n(a),l=c(27);c(147);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)(
8
  /* translators: %1$s min price, %2$s max price */
9
- Object(o.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:d}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:o,format:a="<price/>",maxPrice:l,minPrice:d,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}=e;const h=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));const _=g&&b!==g;let E=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",p)});return _?E=Object(r.createElement)(u,{currency:o,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}):void 0!==d&&void 0!==l?E=Object(r.createElement)(i,{currency:o,maxPrice:l,minPrice:d,priceClassName:p,priceStyle:m}):b&&(E=Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",p),currency:o,value:b,style:m})),Object(r.createElement)("span",{className:h},Object(r.createInterpolateElement)(a,{price:E}))}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(7),l=c(34),i=c(96),u=c(10),d=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Object(n.createElement)(e,o()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=c(174),p=c(23),m=c.n(p),g=c(25),O=c.n(g),j=c(26),h=c(28),_=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||c[r])return;const o=e.find(e=>e.id===r);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(j.g)(r).then(e=>{const t=e.map(e=>({...e,parent:r}));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:r}=this.props;r&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){const{products:t}=this.props;return t.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0].id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem)),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:c}=this.props,{error:r,loading:a,variations:s}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:r||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),E=c(33),w=c(4),f=c.n(w),k=c(84);c(129);const y={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},v=e=>{let{expandedProduct:t,error:c,instanceId:r,isCompact:u,isLoading:d,onChange:b,onSearch:p,products:m,renderItem:g,selected:O,showVariations:j,variations:h,variationsLoading:_}=e;if(c)return Object(n.createElement)(E.a,{error:c});const w=[...m,...h&&h[t]?h[t]:[]];return Object(n.createElement)(i.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:d,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return O.includes(t)}),onChange:b,renderItem:g||(j?e=>{const{item:t,search:c,depth:i=0,isSelected:u,onSelect:b}=e,p=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=f()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+i,"has-count",{"is-searching":c.length>0,"is-skip-level":0===i&&0!==t.parent,"is-variable":p>0});if(!t.breadcrumbs.length)return Object(n.createElement)(k.a,o()({},e,{className:f()(m,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{b(t)()},isLoading:d||_,countLabel:t.variations.length>0?Object(a.sprintf)(
10
  /* translators: %1$d is the number of variations of a product product. */
11
  Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+r,"aria-label":Object(a.sprintf)(
12
  /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
13
- Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,o()({},g,{className:m,name:"variations-"+r}))}:null),onSearch:p,messages:y,isHierarchical:!0})};v.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(_(Object(u.withInstanceId)(v))))},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var r=c(7);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(r.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:r,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return l.set(r,{priority:s,callback:n}),{...e,[c]:l};case o.REMOVE_EVENT_CALLBACK:return l.delete(r),{...e,[c]:l}}}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(3),l=c(110),i=c(514),u=c(4),d=c.n(u),b=c(10),p=c(21),m=c(34),g=c(513),O=c(14);const j=e=>{let{id:t,label:c,popoverContents:r,remove:o,screenReaderLabel:i,className:u=""}=e;const[p,m]=Object(n.useState)(!1),h=Object(b.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const _=d()("woocommerce-tag",u,{"has-remove":!!o}),E="woocommerce-tag__label-"+h,w=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:_},r?Object(n.createElement)(s.Button,{className:"woocommerce-tag__text",id:E,onClick:()=>m(!0)},w):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:E},w),r&&p&&Object(n.createElement)(s.Popover,{onClose:()=>m(!1)},r),o&&Object(n.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(a.sprintf)(// Translators: %s label.
14
- Object(a.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":E},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const _=e=>Object(n.createElement)(m.b,e),E=e=>{const{list:t,selected:c,renderItem:r,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,r({item:t,isSelected:d,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(E,o()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:c,selected:r,messages:o,onChange:l,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":o.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,r.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},f=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:o,...s}=e;const{messages:u,renderItem:d,selected:b,isSingle:p}=s,m=d||_;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(E,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:o,isSingle:p,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:a,isSingle:l,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,_]=Object(n.useState)(""),E=Object(b.useInstanceId)(k),y=Object(n.useMemo)(()=>({...p.a,...u}),[u]),v=Object(n.useMemo)(()=>Object(p.c)(i,h,r),[i,h,r]);Object(n.useEffect)(()=>{j&&j(y.updated)},[j,y]),Object(n.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(n.useCallback)(e=>()=>{l&&m([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});m([...O.slice(0,t),...O.slice(t+1)])},[l,O,m]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?m(l?[e]:[...O,e]):S(e.id)()},[l,S,m,O]);return Object(n.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(w,o()({},e,{onRemove:S,messages:y})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:y.search,type:"search",value:h,onChange:e=>_(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(f,o()({},e,{search:h,filteredList:v,messages:y,onSelect:C,instanceId:E})))};Object(s.withSpokenMessages)(k)},,function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";var r=c(0),o=c(7),n=c(1),a=c(3),s=c(12);function l(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(r.createElement)(s.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:c[t]})):null}class i extends r.Component{createLevelControl(e,t,c){const o=e===t;return{icon:Object(r.createElement)(l,{level:e}),title:Object(n.sprintf)(
15
  /* translators: %s: heading level e.g: "2", "3", "4" */
16
- Object(n.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:o,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:n,onChange:s}=this.props;return Object(r.createElement)(a.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(l,{level:n}),controls:Object(o.range)(t,c).map(e=>this.createLevelControl(e,n,s))})}}t.a=i},,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(110),a=c(220),s=c(2),l=c(5),i=c(29);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(r.createElement)(l.InspectorControls,null,Object(r.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(r.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details","woo-gutenberg-products-block"),Object(r.createElement)(n.a,{icon:a.a,size:16}))),Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(8);function o(e,t){const c=Object(r.useRef)();return Object(r.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(14),s=c(4),l=c.n(s);c(146),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:i,rel:u,style:d,onClick:b,...p}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",o()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)}}))}return Object(n.createElement)("a",o()({className:m,href:s,target:i},p,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)},style:d}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(9);const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(r.select)("core/notices").getNotices(),{removeNotice:o}=Object(r.dispatch)("core/notices"),n=c.filter(t=>t.status===e);n.forEach(e=>o(e.id,t))}},function(e,t,c){"use strict";var r=c(0),o=c(87),n=c(59);const a=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const r=s(e),o=r.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(o,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const o=s(e),a=o.slice(0,t);if(c)return Object(n.autop)(l(a,r));const i=a.match(/([\s]+)/g),u=i?i.length:0,d=o.slice(0,t+u);return Object(n.autop)(l(d,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:d={}}=e;const b=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(n.autop)(e),s=Object(o.count)(r,c);if(s<=t)return r;const l=a(r),d=Object(o.count)(l,c);return d<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:d,className:l},b)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var r=c(0),o=c(7),n=c(25),a=c.n(n);const s=Object(r.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),l=()=>Object(r.useContext)(s),i=e=>{let{children:t}=e;const[c,n]=Object(r.useState)({}),l=Object(r.useCallback)(e=>c[e],[c]),i=Object(r.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(r.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:c,...r}=t;return r})},[]),d=Object(r.useCallback)(()=>{n({})},[]),b=Object(r.useCallback)(e=>{e&&n(t=>(e=Object(o.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&a()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),p=Object(r.useCallback)((e,t)=>{n(c=>{if(!c.hasOwnProperty(e))return c;const r={...c[e],...t};return a()(c[e],r)?c:{...c,[e]:r}})},[]),m={getValidationError:l,setValidationErrors:b,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(r.useCallback)(e=>{p(e,{hidden:!0})},[p]),showValidationError:Object(r.useCallback)(e=>{p(e,{hidden:!1})},[p]),showAllValidationErrors:Object(r.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:i};return Object(r.createElement)(s.Provider,{value:m},t)}},,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(30),s=c(10);c(152),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:o="",onChange:s,options:l,screenReaderLabel:i,value:u}=e;const d="wc-block-components-sort-select__select-"+c;return Object(r.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(a.a,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(18),o=c(9),n=c(0),a=c(48),s=c(121);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(n.useRef)({results:[],isLoading:!0}),b=Object(a.a)(i),p=Object(a.a)(l),m=Object(s.a)(),g=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),n=[t,c,b,p],a=o.getCollectionError(...n);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(a)}return{results:o.getCollection(...n),isLoading:!o.hasFinishedResolution("getCollection",n)}},[t,c,p,b,u]);return null!==g&&(d.current=g),d.current}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(3),s=c(4),l=c.n(s);c(175),t.a=function(e){let{className:t="",...c}=e;const r=l()("wc-block-text-toolbar-button",t);return Object(n.createElement)(a.Button,o()({className:r},c))}},,,,function(e,t){},,function(e,t){},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return a}));var r=c(0);const o=Object(r.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),n=()=>Object(r.useContext)(o),a=e=>{let{children:t}=e;const[c,n]=Object(r.useState)(!1),a={setIsSuppressed:n,isSuppressed:c};return Object(r.createElement)(o.Provider,{value:a},t)}},,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,,,,,,,,,,,function(e,t){},,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(24),s=c(26),l=c(109),i=c(28);t.a=e=>t=>{let{selected:c,...r}=t;const[u,d]=Object(n.useState)(!0),[b,p]=Object(n.useState)(null),[m,g]=Object(n.useState)([]),O=a.o.productCount>100,j=async e=>{const t=await Object(i.a)(e);p(t),d(!1)},h=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:h.current}).then(e=>{g(e),d(!1)}).catch(j)},[h]);const _=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),d(!1)}).catch(j)},400),E=Object(n.useCallback)(e=>{d(!0),_(e)},[d,_]);return Object(n.createElement)(e,o()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:O?E:null}))}},function(e,t){},,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(30),l=c(29),i=c(56),u=(c(338),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:i}=Object(l.useProductDataContext)(),d=Object(u.a)(e),b=Object(u.b)(e),p=Object(u.d)(e),m=Object(u.c)(e);if(!i.id||!i.on_sale)return null;const g="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(r.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,g,{[n+"__product-onsale"]:n},b.className,d.className),style:{...b.style,...d.style,...p.style,...m.style}},Object(r.createElement)(s.a,{label:Object(o.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Product on sale","woo-gutenberg-products-block")}))})},function(e,t,c){"use strict";var r=c(0),o=c(12);const n=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=n},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0),o=c(115);c(171);const n=e=>{let{errorMessage:t="",propertyName:c="",elementId:n=""}=e;const{getValidationError:a,getValidationErrorId:s}=Object(o.b)();if(!t||"string"!=typeof t){const e=a(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:s(n)},t))}},,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return b}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(261),i=c(9),u=(c(181),c(141));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},b=e=>{let{className:t,context:c="default",additionalNotices:r=[]}=e;const{isSuppressed:a}=Object(u.b)(),{notices:b}=Object(i.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:p}=Object(i.useDispatch)("core/notices"),m=b.filter(e=>"snackbar"!==e.type).concat(r);if(!m.length)return null;const g=s()(t,"wc-block-components-notices");return a?null:Object(n.createElement)("div",{className:g},m.map(e=>Object(n.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&p(e.id,c)}}),e.content)))}},,,,function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:c=!1,cancelable:o=!1,element:n,detail:a={}}=t;if(!r)return;n||(n=document.body);const s=new r(e,{bubbles:c,cancelable:o,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{o(t,{bubbles:c,cancelable:r})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return a}));var r=c(89),o=(c(17),c(2));const n=(e,t)=>Object.keys(o.defaultAddressFields).every(c=>e[c]===t[c]),a=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:r=!1}=t;r&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(94);const o=(e,t)=>function(c){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=r.a.addEventCallback(e,c,o);return t(n),()=>{t(r.a.removeEventCallback(e,n.id))}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));const r=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=c(35);const n=async(e,t,c)=>{const o=r(e,t),n=[];for(const e of o)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},a=async(e,t,c)=>{const n=[],a=r(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,c){"use strict";var r=c(71);let o={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(r.b)()&&(o={...o,align:{type:"string"}}),t.a=o},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(29),s=c(71),l=c(56),i=c(112),u=c(65),d=(c(337),c(43));const b=e=>{let{children:t,headingLevel:c,elementType:o="h"+c,...n}=e;return Object(r.createElement)(o,n,t)};t.a=Object(l.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:o=!0,linkTarget:l,align:p}=e,{parentClassName:m}=Object(a.useInnerBlockLayoutContext)(),{product:g}=Object(a.useProductDataContext)(),{dispatchStoreEvent:O}=Object(u.a)(),j=Object(d.b)(e),h=Object(d.c)(e),_=Object(d.d)(e);return g.id?Object(r.createElement)(b,{headingLevel:c,className:n()(t,j.className,"wc-block-components-product-title",{[m+"__product-title"]:m,["wc-block-components-product-title--align-"+p]:p&&Object(s.b)()}),style:Object(s.b)()?{...h.style,..._.style,...j.style}:{}},Object(r.createElement)(i.a,{disabled:!o,name:g.name,permalink:g.permalink,target:l,onClick:()=>{O("product-view-link",{product:g})}})):Object(r.createElement)(b,{headingLevel:c,className:n()(t,j.className,"wc-block-components-product-title",{[m+"__product-title"]:m,["wc-block-components-product-title--align-"+p]:p&&Object(s.b)()}),style:Object(s.b)()?{...h.style,..._.style,...j.style}:{}})})},function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(4),l=c.n(s),i=c(2),u=c(29),d=c(56),b=c(65),p=c(206),m=(c(339),c(43));const g=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),O=e=>{let{image:t,onLoad:c,loaded:r,showFullSize:a,fallbackAlt:s}=e;const{thumbnail:l,src:i,srcset:u,sizes:d,alt:b}=t||{},p={alt:b||s,onLoad:c,hidden:!r,src:l,...a&&{src:i,srcSet:u,sizes:d}};return Object(n.createElement)(n.Fragment,null,p.src&&Object(n.createElement)("img",o()({"data-testid":"product-image"},p)),!r&&Object(n.createElement)(g,null))};t.a=Object(d.withProductDataContext)(e=>{const{className:t,imageSizing:c="full-size",showProductLink:r=!0,showSaleBadge:o,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:d}=Object(u.useProductDataContext)(),[j,h]=Object(n.useState)(!1),{dispatchStoreEvent:_}=Object(b.a)(),E=Object(m.d)(e),w=Object(m.a)(e),f=Object(m.c)(e);if(!d.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},w.className),style:{...E.style,...w.style,...f.style}},Object(n.createElement)(g,null));const k=!!d.images.length,y=k?d.images[0]:null,v=r?"a":n.Fragment,S=Object(a.sprintf)(
17
  /* translators: %s is referring to the product name */
18
- Object(a.__)("Link to %s","woo-gutenberg-products-block"),d.name),C={href:d.permalink,...!k&&{"aria-label":S},onClick:()=>{_("product-view-link",{product:d})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},w.className),style:{...E.style,...w.style,...f.style}},Object(n.createElement)(v,r&&C,!!o&&Object(n.createElement)(p.default,{align:s,product:d}),Object(n.createElement)(O,{fallbackAlt:d.name,image:y,onLoad:()=>h(!0),loaded:j,showFullSize:"cropped"!==c})))})},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(1),s=c(48),l=c(506),i=c(9);const u={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},d={status:u.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:p,SET_IDLE:m,SET_DISABLED:g,SET_PROCESSING:O,SET_BEFORE_PROCESSING:j,SET_AFTER_PROCESSING:h,SET_PROCESSING_RESPONSE:_,SET_HAS_ERROR:E,SET_NO_ERROR:w,SET_QUANTITY:f,SET_REQUEST_PARAMS:k}=b,y=()=>({type:m}),v=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?E:w;return{type:t}},{SET_PRISTINE:S,SET_IDLE:C,SET_DISABLED:x,SET_PROCESSING:N,SET_BEFORE_PROCESSING:P,SET_AFTER_PROCESSING:T,SET_PROCESSING_RESPONSE:R,SET_HAS_ERROR:I,SET_NO_ERROR:A,SET_QUANTITY:B,SET_REQUEST_PARAMS:L}=b,{PRISTINE:D,IDLE:V,DISABLED:F,PROCESSING:M,BEFORE_PROCESSING:z,AFTER_PROCESSING:H}=u,q=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,{quantity:c,type:r,data:o}=arguments.length>1?arguments[1]:void 0;switch(r){case S:e=d;break;case C:e=t.status!==V?{...t,status:V}:t;break;case x:e=t.status!==F?{...t,status:F}:t;break;case B:e=c!==t.quantity?{...t,quantity:c}:t;break;case L:e={...t,requestParams:{...t.requestParams,...o}};break;case R:e={...t,processingResponse:o};break;case N:e=t.status!==M?{...t,status:M,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case P:e=t.status!==z?{...t,status:z,hasError:!1}:t;break;case T:e=t.status!==H?{...t,status:H}:t;break;case I:e=t.hasError?t:{...t,hasError:!0},e=t.status===M||t.status===z?{...e,status:V}:e;break;case A:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&r!==S&&e.status===D&&(e.status=V),e};var G=c(94),Q=c(223);const Y=e=>({onAddToCartAfterProcessingWithSuccess:Object(Q.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Q.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Q.a)("add_to_cart_before_processing",e)});var U=c(224),W=c(115),$=c(35),K=c(113);const J=Object(r.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),X=()=>Object(r.useContext)(J),Z=e=>{var t,c,o,n;let{children:b,product:m,showFormElements:E}=e;const[w,S]=Object(r.useReducer)(q,d),[C,x]=Object(r.useReducer)(G.b,{}),N=Object(s.a)(C),{createErrorNotice:P}=Object(i.useDispatch)("core/notices"),{setValidationErrors:T}=Object(W.b)(),{isSuccessResponse:R,isErrorResponse:I,isFailResponse:A}=Object($.d)(),B=Object(r.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:Y(x).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Y(x).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Y(x).onAddToCartBeforeProcessing}),[x]),L=Object(r.useMemo)(()=>({resetForm:()=>{S({type:p})},submitForm:()=>{S({type:j})},setQuantity:e=>{S((e=>({type:f,quantity:e}))(e))},setHasError:e=>{S(v(e))},setRequestParams:e=>{S((e=>({type:k,data:e}))(e))},setAfterProcessing:e=>{S({type:_,data:e}),S({type:h})}}),[]);Object(r.useEffect)(()=>{const e=w.status,t=!m.id||!Object(l.a)(m);e!==u.DISABLED||t?e!==u.DISABLED&&t&&S({type:g}):S(y())},[w.status,m,S]),Object(r.useEffect)(()=>{w.status===u.BEFORE_PROCESSING&&(Object(K.a)("error","wc/add-to-cart"),Object(U.a)(N,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&P(t,{context:"wc/add-to-cart"}),c&&T(c)}),S(y())):S({type:O})}))},[w.status,T,P,S,N,null==m?void 0:m.id]),Object(r.useEffect)(()=>{if(w.status===u.AFTER_PROCESSING){const e={processingResponse:w.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:r}=e;(I(e)||A(e))&&c&&(t=!0,P(c,r?{context:r}:void 0))}),t};if(w.hasError)return void Object(U.b)(N,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var r;const t=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");P(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==m?void 0:m.id)||0)})}S(y())});Object(U.b)(N,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?S(v(!0)):S(y())})}},[w.status,w.hasError,w.processingResponse,L,P,I,A,R,N,null==m?void 0:m.id]);const D=Object(l.b)(m),V={product:m,productType:m.type||"simple",productIsPurchasable:Object(l.a)(m),productHasOptions:m.has_options||!1,supportsFormElements:D,showFormElements:E&&D,quantity:w.quantity||(null==m||null===(t=m.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==m||null===(c=m.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==m||null===(o=m.add_to_cart)||void 0===o?void 0:o.maximum)||99,multipleOf:(null==m||null===(n=m.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:w.requestParams,isIdle:w.status===u.IDLE,isDisabled:w.status===u.DISABLED,isProcessing:w.status===u.PROCESSING,isBeforeProcessing:w.status===u.BEFORE_PROCESSING,isAfterProcessing:w.status===u.AFTER_PROCESSING,hasError:w.hasError,eventRegistration:B,dispatchActions:L};return Object(r.createElement)(J.Provider,{value:V},b)};var ee=c(15),te=c.n(ee),ce=c(14),re=c(221),oe=c(39),ne=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:o,hasError:n,isProcessing:s,requestParams:l}=X(),{hasValidationErrors:u,showAllValidationErrors:d}=Object(W.b)(),{createErrorNotice:b,removeNotice:p}=Object(i.useDispatch)("core/notices"),{receiveCart:m}=Object(oe.a)(),[g,O]=Object(r.useState)(!1),j=!n&&s,h=Object(r.useCallback)(()=>!u||(d(),{type:"error"}),[u,d]);Object(r.useEffect)(()=>{const e=o.onAddToCartBeforeProcessing(h,0);return()=>{e()}},[o,h]);const _=Object(r.useCallback)(()=>{O(!0),p("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const r={id:t.id||0,quantity:c,...l};te()({path:"/wc/store/v1/cart/add-item",method:"POST",data:r,cache:"no-store",parse:!1}).then(c=>{te.a.setNonce(c.headers),c.json().then((function(r){c.ok?m(r):(r.body&&r.body.message?b(Object(ce.decodeEntities)(r.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):b(Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(re.b)({preserveCartData:!0}),e.setAfterProcessing(r),O(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&m(t.data.cart),e.setHasError(),e.setAfterProcessing(t),O(!1)}))})},[t,b,p,m,e,c,l]);return Object(r.useEffect)(()=>{j&&!g&&_()},[j,_,g]),null};const ae=e=>{let{children:t,product:c,showFormElements:o}=e;return Object(r.createElement)(W.a,null,Object(r.createElement)(Z,{product:c,showFormElements:o},t,Object(r.createElement)(ne,null)))};var se=c(29),le=c(7),ie=c(56),ue=(c(263),c(70)),de=c(110),be=c(533),pe=c(65),me=c(390);const ge=e=>{let{className:t,href:c,text:o,onClick:n}=e;return Object(r.createElement)(ue.a,{className:t,href:c,onClick:n,rel:"nofollow"},o)},Oe=e=>{let{className:t,quantityInCart:c,isProcessing:o,isDisabled:n,isDone:s,onClick:l}=e;return Object(r.createElement)(ue.a,{className:t,disabled:n,showSpinner:o,onClick:l},s&&c>0?Object(a.sprintf)(
19
  /* translators: %s number of products in cart. */
20
- Object(a._n)("%d in cart","%d in cart",c,"woo-gutenberg-products-block"),c):Object(a.__)("Add to cart","woo-gutenberg-products-block"),!!s&&Object(r.createElement)(de.a,{icon:be.a}))};var je=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:o,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:d}=X(),{parentName:b}=Object(se.useInnerBlockLayoutContext)(),{dispatchStoreEvent:p}=Object(pe.a)(),{cartQuantity:m}=Object(me.a)(o.id||0),[g,O]=Object(r.useState)(!1),j=o.add_to_cart||{url:"",text:""};return Object(r.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(r.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==o?void 0:o.id)||0)),p("cart-add-item",{product:o,listName:b})}}):Object(r.createElement)(ge,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(a.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{p("product-view-link",{product:o,listName:b})}})},he=c(109),_e=e=>{let{disabled:t,min:c,max:o,step:n=1,value:a,onChange:s}=e;const l=void 0!==o,i=Object(he.a)(e=>{let t=e;l&&(t=Math.min(t,Math.floor(o/n)*n)),t=Math.max(t,Math.ceil(c/n)*n),t=Math.floor(t/n)*n,t!==e&&s(t)},300);return Object(r.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:c,max:o,step:n,hidden:1===o,disabled:t,onChange:e=>{s(e.target.value),i(e.target.value)}})},Ee=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},we=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=X();return e.id&&!e.is_purchasable?Object(r.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(r.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_e,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(je,null))},fe=(c(347),c(549)),ke=c(8),ye=c(208);const ve={value:"",label:Object(a.__)("Select an option","woo-gutenberg-products-block")};var Se=e=>{let{attributeName:t,options:c=[],value:o="",onChange:s=(()=>{}),errorMessage:l=Object(a.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:i,setValidationErrors:u,clearValidationError:d}=Object(W.b)(),b=t,p=i(b)||{};return Object(ke.useEffect)(()=>{o?d(b):u({[b]:{message:l,hidden:!0}})},[o,b,l,d,u]),Object(ke.useEffect)(()=>()=>{d(b)},[b,d]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(r.createElement)(fe.a,{label:Object(ce.decodeEntities)(t),value:o||"",options:[ve,...c],onChange:s,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":p.message&&!p.hidden})}),Object(r.createElement)(ye.a,{propertyName:b,elementId:b}))},Ce=c(57);const xe=(e,t,c)=>{const r=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(c).every(e=>""===e))return r;const o=Object.keys(e);return r.filter(e=>o.every(r=>{const o=c[r]||"",n=t["id:"+e].attributes[r];return""===o||null===n||n===o}))};var Ne=e=>{let{attributes:t,variationAttributes:c,setRequestParams:o}=e;const n=Object(s.a)(t),a=Object(s.a)(c),[l,i]=Object(r.useState)(0),[u,d]=Object(r.useState)({}),[b,p]=Object(r.useState)(!1),m=Object(r.useMemo)(()=>((e,t,c)=>{const r={},o=Object.keys(e),n=Object.values(c).filter(Boolean).length>0;return o.forEach(o=>{const a=e[o],s={...c,[o]:null},l=n?xe(e,t,s):null,i=null!==l?l.map(e=>t["id:"+e].attributes[o]):null;r[o]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:c,slug:r}=e;return null===t||t.includes(null)||t.includes(r)?{value:r,label:Object(ce.decodeEntities)(c)}:null}).filter(Boolean)}(a.terms,i)}),r})(n,a,u),[u,n,a]);return Object(r.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Ce.a)(e))return{};const t=Object.keys(e),c={};return 0===t.length||t.forEach(t=>{const r=e[t],o=r.terms.filter(e=>e.default);var n;o.length>0&&(c[r.name]=null===(n=o[0])||void 0===n?void 0:n.slug)}),c}(t);e&&d({...e}),p(!0)}},[u,t,b]),Object(r.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?i(((e,t,c)=>xe(e,t,c)[0]||0)(n,a,u)):l>0&&i(0)},[u,l,n,a]),Object(r.useEffect)(()=>{o({id:l,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[o,l,u]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(r.createElement)(Se,{key:e,attributeName:e,options:m[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},Pe=e=>{let{product:t,dispatchers:c}=e;const o=(e=>e?Object(le.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:c,attributes:r}=e;t["id:"+c]={id:c,attributes:r.reduce((e,t)=>{let{name:c,value:r}=t;return e[c]=r,e},{})}}),t})(t.variations);return 0===Object.keys(o).length||0===n.length?null:Object(r.createElement)(Ne,{attributes:o,variationAttributes:n,setRequestParams:c.setRequestParams})},Te=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=X();return e.id&&!e.is_purchasable?Object(r.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(r.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Pe,{product:e,dispatchers:s}),Object(r.createElement)(_e,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(je,null))},Re=()=>Object(r.createElement)(je,null),Ie=c(535),Ae=()=>Object(r.createElement)(Ie.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Be=()=>Object(r.createElement)(Ae,null);const Le=()=>{const{showFormElements:e,productType:t}=X();return e?"variable"===t?Object(r.createElement)(Te,null):"grouped"===t?Object(r.createElement)(Be,null):"external"===t?Object(r.createElement)(Re,null):"simple"===t||"variation"===t?Object(r.createElement)(we,null):null:Object(r.createElement)(je,null)};t.a=Object(ie.withProductDataContext)(e=>{let{className:t,showFormElements:c}=e;const{product:o}=Object(se.useProductDataContext)(),a=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(le.isEmpty)(o)});return Object(r.createElement)(ae,{product:o,showFormElements:c},Object(r.createElement)("div",{className:a},Object(r.createElement)(Le,null)))})},,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(92),s=c(27),l=c(29),i=c(56),u=c(43);t.default=Object(i.withProductDataContext)(e=>{var t,c;const{className:o,textAlign:i}=e,{parentClassName:d}=Object(l.useInnerBlockLayoutContext)(),{product:b}=Object(l.useProductDataContext)(),p=Object(u.b)(e),m=Object(u.d)(e),g=n()("wc-block-components-product-price",o,p.className,{[d+"__product-price"]:d}),O={...m.style,...p.style};if(!b.id)return Object(r.createElement)(a.a,{align:i,className:g});const j=b.prices,h=Object(s.getCurrencyFromPriceResponse)(j),_=j.price!==j.regular_price,E=n()({[d+"__product-price__value"]:d,[d+"__product-price__value--on-sale"]:_});return Object(r.createElement)(a.a,{align:i,className:g,priceStyle:O,regularPriceStyle:O,priceClassName:E,currency:h,price:j.price,minPrice:null==j||null===(t=j.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==j||null===(c=j.price_range)||void 0===c?void 0:c.max_amount,regularPrice:j.regular_price,regularPriceClassName:n()({[d+"__product-price__regular"]:d})})})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(56),i=(c(340),c(43));t.default=Object(l.withProductDataContext)(e=>{const{parentClassName:t}=Object(s.useInnerBlockLayoutContext)(),{product:c}=Object(s.useProductDataContext)(),n=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(c),l=Object(i.b)(e),u=Object(i.d)(e),d=Object(i.c)(e);if(!n)return null;const b={width:n/5*100+"%"},p=Object(o.sprintf)(
21
  /* translators: %f is referring to the average rating value */
22
  Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),n),m=(e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(c),g={__html:Object(o.sprintf)(
23
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
24
- Object(o._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",m,"woo-gutenberg-products-block"),Object(o.sprintf)('<strong class="rating">%f</strong>',n),Object(o.sprintf)('<span class="rating">%d</span>',m))};return Object(r.createElement)("div",{className:a()(l.className,"wc-block-components-product-rating",{[t+"__product-rating"]:t}),style:{...l.style,...u.style,...d.style}},Object(r.createElement)("div",{className:a()("wc-block-components-product-rating__stars",t+"__product-rating__stars"),role:"img","aria-label":p},Object(r.createElement)("span",{style:b,dangerouslySetInnerHTML:g})))})},function(e,t,c){"use strict";c.r(t);var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(1),i=c(65),u=c(390),d=c(14),b=c(24),p=c(2),m=c(29),g=c(56),O=(c(341),c(43));const j=e=>{let{product:t,colorStyles:c,borderStyles:r,typographyStyles:a,spacingStyles:m}=e;const{id:g,permalink:O,add_to_cart:j,has_options:h,is_purchasable:_,is_in_stock:E}=t,{dispatchStoreEvent:w}=Object(i.a)(),{cartQuantity:f,addingToCart:k,addToCart:y}=Object(u.a)(g,"woocommerce/single-product/"+(g||0)),v=Number.isFinite(f)&&f>0,S=!h&&_&&E,C=Object(d.decodeEntities)((null==j?void 0:j.description)||""),x=v?Object(l.sprintf)(
25
  /* translators: %s number of products in cart. */
26
- Object(l._n)("%d in cart","%d in cart",f,"woo-gutenberg-products-block"),f):Object(d.decodeEntities)((null==j?void 0:j.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),N=S?"button":"a",P={};return S?P.onClick=()=>{y(),w("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(p.getSetting)("productsSettings");e&&(window.location.href=b.d)}:(P.href=O,P.rel="nofollow",P.onClick=()=>{w("product-view-link",{product:t})}),Object(n.createElement)(N,o()({"aria-label":C,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,r.className,{loading:k,added:v}),style:{...c.style,...r.style,...a.style,...m.style},disabled:k},P),x)},h=e=>{let{colorStyles:t,borderStyles:c,typographyStyles:r,spacingStyles:o}=e;return Object(n.createElement)("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",t.className,c.className),style:{...t.style,...c.style,...r.style,...o.style},disabled:!0})};t.default=Object(g.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(m.useInnerBlockLayoutContext)(),{product:r}=Object(m.useProductDataContext)(),o=Object(O.b)(e),a=Object(O.a)(e),l=Object(O.d)(e),i=Object(O.c)(e);return Object(n.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},r.id?Object(n.createElement)(j,{product:r,colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}):Object(n.createElement)(h,{colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(114),s=c(24),l=c(29),i=c(56),u=(c(342),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:o}=Object(l.useProductDataContext)(),i=Object(u.b)(e),d=Object(u.d)(e);if(!o)return Object(r.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const b=o.short_description?o.short_description:o.description;return b?Object(r.createElement)(a.a,{className:n()(t,i.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:b,maxLength:150,countType:s.o.wordCountType||"words",style:{...i.style,...d.style}}):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(56);c(343),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(o.__)("SKU:","woo-gutenberg-products-block")," ",Object(r.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(7),i=c(56),u=(c(344),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),i=Object(u.b)(e),d=Object(u.d)(e);return Object(l.isEmpty)(n.categories)?null:Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",i.className,{[c+"__product-category-list"]:c}),style:{...i.style,...d.style}},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",Object(r.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"category-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(7),i=c(56),u=(c(345),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),i=Object(u.b)(e),d=Object(u.d)(e);return Object(l.isEmpty)(n.tags)?null:Object(r.createElement)("div",{className:a()(t,i.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...i.style,...d.style}},Object(o.__)("Tags:","woo-gutenberg-products-block")," ",Object(r.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"tag-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(56),i=(c(346),c(43));t.default=Object(l.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=Object(i.b)(e),u=Object(i.d)(e);if(!n.id||!n.is_purchasable)return null;const d=!!n.is_in_stock,b=n.low_stock_remaining,p=n.is_on_backorder;return Object(r.createElement)("div",{className:a()(t,l.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":d,"wc-block-components-product-stock-indicator--out-of-stock":!d,"wc-block-components-product-stock-indicator--low-stock":!!b,"wc-block-components-product-stock-indicator--available-on-backorder":!!p}),style:{...l.style,...u.style}},b?(e=>Object(o.sprintf)(
27
  /* translators: %d stock amount (number of items in stock for product) */
28
- Object(o.__)("%d left in stock","woo-gutenberg-products-block"),e))(b):((e,t)=>t?Object(o.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(o.__)("In Stock","woo-gutenberg-products-block"):Object(o.__)("Out of Stock","woo-gutenberg-products-block"))(d,p))})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(1),o=c(24);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(r.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:o.m+"previews/pennant.jpg",thumbnail:o.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(r.__)("Add to cart","woo-gutenberg-products-block"),description:Object(r.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,,,,,,,,function(e,t,c){e.exports=c(470)},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(0),o=c(9),n=c(18),a=c(14),s=c(39);const l=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},i=e=>{const{addItemToCart:t}=Object(o.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:i}=Object(s.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[b,p]=Object(r.useState)(!1),m=Object(r.useRef)(l(c,e));return Object(r.useEffect)(()=>{const t=l(c,e);t!==m.current&&(m.current=t)},[c,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:i,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{u(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"blockSettings",(function(){return Kt}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(5),l=c(13),i=c(110),u=c(525),d=c(71),b=c(4),p=c.n(b),m={category:"woocommerce-product-elements",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(n.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},supports:{html:!1},parent:Object(d.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",{className:p()("is-loading",t.className)})},deprecated:[{attributes:{},save:()=>null}]},g=c(264),O=c(3),j=c(10),h=c(99),_=c(265),E=c(93),w=c(123),f=c(29);c(388);var k=e=>t=>c=>{const r=Object(f.useProductDataContext)(),{attributes:o,setAttributes:l}=c,{productId:i}=o,[u,d]=Object(n.useState)(!i);return r.hasContext?Object(n.createElement)(t,c):Object(n.createElement)(n.Fragment,null,u?Object(n.createElement)(O.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(n.createElement)("div",null,e.description),Object(n.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(n.createElement)(E.a,{selected:i||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l({productId:e[0]?e[0].id:0})}}),Object(n.createElement)(O.Button,{isSecondary:!0,disabled:!i,onClick:()=>{d(!1)}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(O.ToolbarGroup,null,Object(n.createElement)(w.a,{onClick:()=>d(!0)},Object(a.__)("Switch product…","woo-gutenberg-products-block")))),Object(n.createElement)(t,c)))},y=c(526);const v=Object(a.__)("Product Title","woo-gutenberg-products-block"),S=Object(n.createElement)(i.a,{icon:y.a,className:"wc-block-editor-components-block-icon"}),C=Object(a.__)("Display the title of a product.","woo-gutenberg-products-block");c(389);const x=e=>{let{attributes:t,setAttributes:c}=e;const r=Object(s.useBlockProps)(),{headingLevel:o,showProductLink:l,align:i,linkTarget:u}=t;return Object(n.createElement)("div",r,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(h.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:o,onChange:e=>c({headingLevel:e})}),Object(d.b)()&&Object(n.createElement)(s.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Link settings","woo-gutenberg-products-block")},Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Make title a link","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showProductLink:!l})}),l&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Open in new tab","woo-gutenberg-products-block"),onChange:e=>c({linkTarget:e?"_blank":"_self"}),checked:"_blank"===u})))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(_.a,t)))};var N=Object(d.b)()?Object(j.compose)([k({icon:S,label:v,description:Object(a.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(x):x;const P=e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))};var T=c(91);const R={...m,apiVersion:2,title:v,description:C,icon:{src:S},attributes:g.a,edit:N,save:P,supports:{...m.supports,...Object(d.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(l.registerBlockType)("woocommerce/product-title",R);var I=c(274),A=c(527);const B=Object(a.__)("Product Price","woo-gutenberg-products-block"),L=Object(n.createElement)(i.a,{icon:A.a,className:"wc-block-editor-components-block-icon"}),D=Object(a.__)("Display the price of a product.","woo-gutenberg-products-block");var V=k({icon:L,label:B,description:Object(a.__)("Choose a product to display its price.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const r=Object(s.useBlockProps)();return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.BlockControls,null,Object(d.b)()&&Object(n.createElement)(s.AlignmentToolbar,{value:t.textAlign,onChange:e=>{c({textAlign:e})}})),Object(n.createElement)("div",r,Object(n.createElement)(I.default,t)))});let F={productId:{type:"number",default:0}};Object(d.b)()&&(F={...F,textAlign:{type:"string"}});var M=F;const z={...m,apiVersion:2,title:B,description:D,icon:{src:L},attributes:M,edit:V,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},supports:{...m.supports,...Object(d.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-price"}}};Object(l.registerBlockType)("woocommerce/product-price",z);var H=c(266);const q={...Object(d.b)()&&{__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-image"}};var G=c(2),Q=c(267),Y=c(528);const U=Object(a.__)("Product Image","woo-gutenberg-products-block"),W=Object(n.createElement)(i.a,{icon:Y.a,className:"wc-block-editor-components-block-icon"}),$=Object(a.__)("Display the main product image","woo-gutenberg-products-block");var K=k({icon:W,label:U,description:Object(a.__)("Choose a product to display its image.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{showProductLink:r,imageSizing:o,showSaleBadge:l,saleBadgeAlign:i}=t,u=Object(s.useBlockProps)();return Object(n.createElement)("div",u,Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(a.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:r,onChange:()=>c({showProductLink:!r})}),Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(a.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:l,onChange:()=>c({showSaleBadge:!l})}),l&&Object(n.createElement)(O.__experimentalToggleGroupControl,{label:Object(a.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:i,onChange:e=>c({saleBadgeAlign:e})},Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"left",label:Object(a.__)("Left","woo-gutenberg-products-block")}),Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"center",label:Object(a.__)("Center","woo-gutenberg-products-block")}),Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"right",label:Object(a.__)("Right","woo-gutenberg-products-block")})),Object(n.createElement)(O.__experimentalToggleGroupControl,{label:Object(a.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(n.createInterpolateElement)(Object(a.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(G.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:o,onChange:e=>c({imageSizing:e})},Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"full-size",label:Object(a.__)("Full Size","woo-gutenberg-products-block")}),Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"cropped",label:Object(a.__)("Cropped","woo-gutenberg-products-block")})))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Q.a,t)))});const J={apiVersion:2,title:U,description:$,icon:{src:W},attributes:H.a,edit:K,supports:q,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-image",{...m,...J});var X=c(275),Z=c(521);const ee=Object(a.__)("Product Rating","woo-gutenberg-products-block"),te=Object(n.createElement)(i.a,{icon:Z.a,className:"wc-block-editor-components-block-icon"}),ce=Object(a.__)("Display the average rating of a product.","woo-gutenberg-products-block");var re=k({icon:te,label:ee,description:Object(a.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)({className:"wp-block-woocommerce-product-rating"});return Object(n.createElement)("div",c,Object(n.createElement)(X.default,t))});const oe={apiVersion:2,title:ee,description:ce,icon:{src:te},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-rating"}},edit:re,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-rating",{...m,...oe});var ne=c(276),ae=c(529);const se=Object(a.__)("Add to Cart Button","woo-gutenberg-products-block"),le=Object(n.createElement)(i.a,{icon:ae.a,className:"wc-block-editor-components-block-icon"}),ie=Object(a.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block");var ue=k({icon:le,label:se,description:Object(a.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(O.Disabled,null,Object(n.createElement)(ne.default,t)))});const de={apiVersion:2,title:se,description:ie,icon:{src:le},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button"}},edit:ue,save:P};Object(l.registerBlockType)("woocommerce/product-button",{...m,...de});var be=c(277),pe=c(530);const me=Object(a.__)("Product Summary","woo-gutenberg-products-block"),ge=Object(n.createElement)(i.a,{icon:pe.a,className:"wc-block-editor-components-block-icon"}),Oe=Object(a.__)("Display a short description about a product.","woo-gutenberg-products-block");c(391);var je=k({icon:ge,label:me,description:Object(a.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(be.default,t))});const he={apiVersion:2,title:me,description:Oe,icon:{src:ge},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:je,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-summary",{...m,...he});var _e=c(206),Ee=c(519);const we=Object(a.__)("On-Sale Badge","woo-gutenberg-products-block"),fe=Object(n.createElement)(i.a,{icon:Ee.a,className:"wc-block-editor-components-block-icon"}),ke=Object(a.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block");var ye=k({icon:fe,label:we,description:Object(a.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(_e.default,t))});const ve={title:we,description:ke,icon:{src:fe},apiVersion:2,supports:{html:!1,...Object(d.b)()&&{color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-sale-badge"}},attributes:{productId:{type:"number",default:0}},edit:ye,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-sale-badge",{...m,...ve});var Se=c(101),Ce=c(278),xe=c(12),Ne=Object(n.createElement)(xe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const Pe=Object(a.__)("Product SKU","woo-gutenberg-products-block"),Te=Object(n.createElement)(i.a,{icon:Ne,className:"wc-block-editor-components-block-icon"}),Re={title:Pe,description:Object(a.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Te},attributes:{productId:{type:"number",default:0}},edit:k({icon:Te,label:Pe,description:Object(a.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Se.a,null),Object(n.createElement)(Ce.default,t))})};Object(d.c)("woocommerce/product-sku",{...m,...Re});var Ie=c(279),Ae=c(531);const Be=Object(a.__)("Product Category List","woo-gutenberg-products-block"),Le=Object(n.createElement)(i.a,{icon:Ae.a,className:"wc-block-editor-components-block-icon"}),De=Object(a.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block");var Ve=k({icon:Le,label:Be,description:Object(a.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Se.a,null),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Ie.default,t)))});const Fe={...m,apiVersion:2,title:Be,description:De,icon:{src:Le},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,link:!0,background:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-category-list"}},save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},edit:Ve};Object(d.c)("woocommerce/product-category-list",Fe);var Me=c(280),ze=c(524);const He=Object(a.__)("Product Tag List","woo-gutenberg-products-block"),qe=Object(n.createElement)(i.a,{icon:ze.a,className:"wc-block-editor-components-block-icon"}),Ge=Object(a.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block");var Qe=k({icon:qe,label:He,description:Object(a.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Se.a,null),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Me.default,t)))});const Ye={apiVersion:2,title:He,description:Ge,icon:{src:qe},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!0},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-tag-list"}},edit:Qe,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(d.c)("woocommerce/product-tag-list",{...m,...Ye});var Ue=c(281),We=c(532);const $e=Object(a.__)("Product Stock Indicator","woo-gutenberg-products-block"),Ke=Object(n.createElement)(i.a,{icon:We.a,className:"wc-block-editor-components-block-icon"}),Je=Object(a.__)("Display product stock status.","woo-gutenberg-products-block");var Xe=k({icon:Ke,label:$e,description:Object(a.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Se.a,null),Object(n.createElement)(Ue.default,t))});const Ze={apiVersion:2,title:$e,description:Je,icon:{src:Ke},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:Xe,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(d.c)("woocommerce/product-stock-indicator",{...m,...Ze});var et=c(506),tt=(c(263),c(269)),ct=c(207);const rt=Object(a.__)("Add to Cart","woo-gutenberg-products-block"),ot=Object(n.createElement)(i.a,{icon:ct.a,className:"wc-block-editor-components-block-icon"}),nt={title:rt,description:Object(a.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:ot},edit:k({icon:ot,label:rt,description:Object(a.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:r}=Object(f.useProductDataContext)(),{className:o,showFormElements:l}=t;return Object(n.createElement)("div",{className:p()(o,"wc-block-components-product-add-to-cart")},Object(n.createElement)(Se.a,{productId:r.id}),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Layout","woo-gutenberg-products-block")},Object(et.b)(r)?Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Display form elements","woo-gutenberg-products-block"),help:Object(a.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showFormElements:!l})}):Object(n.createElement)(O.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(a.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(tt.a,t)))}),attributes:c(268).a};Object(d.c)("woocommerce/product-add-to-cart",{...m,...nt});var at=c(23),st=c.n(at),lt=c(9),it=c(61),ut=c(498),dt=c(375),bt=c(24);const pt=(e,t)=>{const{className:c,contentVisibility:r}=t;return p()(e,c,{"has-image":r&&r.image,"has-title":r&&r.title,"has-rating":r&&r.rating,"has-price":r&&r.price,"has-button":r&&r.button})};var mt=c(220);const gt=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Ot=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?Ot(e.innerBlocks):[]}]):[];var jt=c(8),ht=c(7),_t=c(30);c(397);var Et=e=>{let{currentPage:t,displayFirstAndLastPages:c=!0,displayNextAndPreviousArrows:r=!0,pagesToDisplay:o=3,onPageChange:s,totalPages:l}=e,{minIndex:i,maxIndex:u}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),n=Math.min(Math.ceil(t+(r-(t-o))),c-1);return{minIndex:Math.max(Math.floor(t-(r-(n-t))),2),maxIndex:n}})(o,t,l);const d=c&&Boolean(1!==i),b=c&&Boolean(u!==l),m=c&&Boolean(i&&i>3),g=c&&Boolean(u&&u<l-2);d&&3===i&&(i-=1),b&&u===l-2&&(u+=1);const O=[];if(i&&u)for(let e=i;e<=u;e++)O.push(e);return Object(n.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(n.createElement)(_t.a,{screenReaderLabel:Object(a.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t-1),title:Object(a.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(_t.a,{label:"←",screenReaderLabel:Object(a.__)("Previous page","woo-gutenberg-products-block")})),d&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>s(1),disabled:1===t},Object(n.createElement)(_t.a,{label:"1",screenReaderLabel:Object(a.sprintf)(
29
  /* translators: %d is the page number (1, 2, 3...). */
30
  Object(a.__)("Page %d","woo-gutenberg-products-block"),1)})),m&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),O.map(e=>Object(n.createElement)("button",{key:e,className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>s(e),disabled:t===e},Object(n.createElement)(_t.a,{label:e.toString(),screenReaderLabel:Object(a.sprintf)(
31
  /* translators: %d is the page number (1, 2, 3...). */
32
  Object(a.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),b&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===l,"wc-block-components-pagination__page--active":t===l}),onClick:()=>s(l),disabled:t===l},Object(n.createElement)(_t.a,{label:l.toString(),screenReaderLabel:Object(a.sprintf)(
33
  /* translators: %d is the page number (1, 2, 3...). */
34
- Object(a.__)("Page %d","woo-gutenberg-products-block"),l)})),r&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t+1),title:Object(a.__)("Next page","woo-gutenberg-products-block"),disabled:t>=l},Object(n.createElement)(_t.a,{label:"→",screenReaderLabel:Object(a.__)("Next page","woo-gutenberg-products-block")})))},wt=c(106),ft=c(76),kt=c(122),yt=c(18),vt=c(48);var St=c(65);c(398);const Ct=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var xt=c(44),Nt=c(170),Pt=()=>{const{parentClassName:e}=Object(f.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(i.a,{className:e+"__no-products-image",icon:Nt.a,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(a.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(a.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Tt=c(523),Rt=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:c}=Object(f.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:c+"__no-products"},Object(n.createElement)(i.a,{className:c+"__no-products-image",icon:Tt.a,size:100}),Object(n.createElement)("strong",{className:c+"__no-products-title"},Object(a.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:c+"__no-products-description"},Object(a.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(a.__)("Reset Search","woo-gutenberg-products-block")))},It=c(117);c(396);var At=e=>{let{onChange:t,value:c}=e;return Object(n.createElement)(It.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(a.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(a.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(a.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(a.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(a.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(a.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(a.__)("Order products by","woo-gutenberg-products-block"),value:c})};const Bt=(e,t,c,r)=>{if(!c)return;const a=Object(ut.a)(e);return c.map((c,s)=>{let[l,i={}]=c,u=[];i.children&&i.children.length>0&&(u=Bt(e,t,i.children,r));const d=a[l];if(!d)return null;const b=t.id||0,p=["layout",l,s,r,b];return Object(n.createElement)(n.Suspense,{key:p.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(d,o()({},i,{children:u,product:t})))})};var Lt=Object(j.withInstanceId)(e=>{let{product:t={},attributes:c,instanceId:r}=e;const{layoutConfig:o}=c,{parentClassName:a,parentName:s}=Object(f.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,i=p()(a+"__product","wc-block-layout",{"is-loading":l});return Object(n.createElement)("li",{className:i,"aria-hidden":l},Bt(s,t,o,r))});c(395);const Dt=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},Vt=function(e){let{totalQuery:t,totalProducts:c}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(ht.isEqual)(t,r)&&Number.isFinite(c)};var Ft,Mt=(Ft=e=>{let{attributes:t,currentPage:c,onPageChange:r,onSortChange:o,sortValue:s,scrollToTop:l}=e;const[i,u]=Object(ft.b)("attributes",[]),[d,b]=Object(ft.b)("stock_status",[]),[m,g]=Object(ft.b)("min_price"),[O,j]=Object(ft.b)("max_price"),[h]=Object(ft.c)((e=>{let{sortValue:t,currentPage:c,attributes:r}=e;const{columns:o,rows:n}=r;return{...Dt(t),catalog_visibility:"catalog",per_page:o*n,page:c}})({attributes:t,sortValue:s,currentPage:c})),{products:_,totalProducts:E,productsLoading:w}=(e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:c,isLoading:r}=Object(kt.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:c,resourceName:r,resourceValues:o=[],query:n={}}=t;if(!c||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const a=Object(vt.a)(n),s=Object(vt.a)(o),{value:l,isLoading:i=!0}=Object(lt.useSelect)(e=>{const t=e(yt.COLLECTIONS_STORE_KEY),o=["x-wp-total",c,r,a,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",c,r,s,a]);return{value:l,isLoading:i}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(o,10),productsLoading:r}})(h),{parentClassName:k,parentName:y}=Object(f.useInnerBlockLayoutContext)(),v=(e=>{const{order:t,orderby:c,page:r,per_page:o,...n}=e;return n||{}})(h),{dispatchStoreEvent:S}=Object(St.a)(),C=Object(wt.a)({totalQuery:v,totalProducts:E},Vt);Object(n.useEffect)(()=>{S("product-list-render",{products:_,listName:y})},[_,y,S]),Object(n.useEffect)(()=>{Object(ht.isEqual)(v,null==C?void 0:C.totalQuery)||(r(1),null!=C&&C.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(xt.speak)(Object(a.__)("No products found","woo-gutenberg-products-block")):Object(xt.speak)(Object(a.sprintf)(
35
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
36
- Object(a._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(E))},[null==C?void 0:C.totalQuery,E,r,v]);const{contentVisibility:x}=t,N=t.columns*t.rows,P=!Number.isFinite(E)&&Number.isFinite(null==C?void 0:C.totalProducts)&&Object(ht.isEqual)(v,null==C?void 0:C.totalQuery)?Math.ceil(((null==C?void 0:C.totalProducts)||0)/N):Math.ceil(E/N),T=_.length?_:Array.from({length:N}),R=0!==_.length||w,I=i.length>0||d.length>0||Number.isFinite(m)||Number.isFinite(O);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:r,align:o}=t,n=void 0!==o?"align"+o:"";return p()(k,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":r})})()},(null==x?void 0:x.orderBy)&&R&&Object(n.createElement)(At,{onChange:o,value:s}),!R&&I&&Object(n.createElement)(Rt,{resetCallback:()=>{u([]),b([]),g(null),j(null)}}),!R&&!I&&Object(n.createElement)(Pt,null),R&&Object(n.createElement)("ul",{className:k+"__products"},T.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(Lt,{key:e.id||c,attributes:t,product:e})}))),P>1&&Object(n.createElement)(Et,{currentPage:c,onPageChange:e=>{l({focusableSelector:"a, button"}),r(e)},totalPages:P}))},e=>{const t=Object(n.useRef)(null);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(n.createElement)(Ft,o()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const r=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(r.length){const e=r[0];Ct(e),null==e||e.focus()}else Ct(e)})(e,c):Ct(e))})(t.current,e)}})))}),zt=e=>{let{attributes:t}=e;const[c,r]=Object(n.useState)(1),[o,a]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(n.createElement)(Mt,{attributes:t,currentPage:c,onPageChange:e=>{r(e)},onSortChange:e=>{var t;const c=null==e||null===(t=e.target)||void 0===t?void 0:t.value;a(c),r(1)},sortValue:o})},Ht=c(137),qt=c(141),Gt=c(217);class Qt extends jt.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Ht.a:Object(n.createElement)(f.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(qt.a,null,Object(n.createElement)(Gt.a,{context:"wc/all-products"})),Object(n.createElement)(zt,{attributes:e,urlParameterSuffix:t}))}}var Yt=Qt;c(394);class Ut extends n.Component{constructor(){super(...arguments),st()(this,"state",{isEditing:!1,innerBlocks:[]}),st()(this,"blockMap",Object(ut.a)("woocommerce/all-products")),st()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),st()(this,"getTitle",()=>Object(a.__)("All Products","woo-gutenberg-products-block")),st()(this,"getIcon",()=>Object(n.createElement)(i.a,{icon:u.a})),st()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(a.__)("Showing All Products block preview.","woo-gutenberg-products-block"))}),st()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:r,alignButtons:o}=e;return Object(n.createElement)(s.InspectorControls,{key:"inspector"},Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(n.createElement)(it.a,{columns:c,rows:r,alignButtons:o,setAttributes:t,minColumns:Object(G.getSetting)("min_columns",1),maxColumns:Object(G.getSetting)("max_columns",6),minRows:Object(G.getSetting)("min_rows",1),maxRows:Object(G.getSetting)("max_rows",6)})),Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content Settings","woo-gutenberg-products-block")},((e,t)=>{const{contentVisibility:c}=e;return Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(n.createElement)(O.SelectControl,{label:Object(a.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(a.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(a.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(a.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(a.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(a.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(a.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),st()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(O.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit inner product layout","woo-gutenberg-products-block"),onClick:()=>this.togglePreview(),isActive:e}]}))}),st()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(n.createElement)(O.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(a.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(n.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(n.createElement)(O.Tip,null,Object(a.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(n.createElement)(f.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(n.createElement)("ul",{className:"wc-block-grid__products"},Object(n.createElement)("li",{className:"wc-block-grid__product"},Object(n.createElement)(f.ProductDataContextProvider,{product:dt.a[0]},Object(n.createElement)(s.InnerBlocks,e)))))),Object(n.createElement)("div",{className:"wc-block-all-products__actions"},Object(n.createElement)(O.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:Ot(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(a.__)("Done","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(a.__)("Cancel","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-all-products__reset-button",icon:Object(n.createElement)(i.a,{icon:u.a}),label:Object(a.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];gt.map(e=>{let[t,r]=e;return c.push(Object(l.createBlock)(t,r)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(a.__)("Reset Layout","woo-gutenberg-products-block")))))}),st()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,r=this.getTitle(),o=this.getIcon();return c?Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Yt,{attributes:e})):((e,t)=>Object(n.createElement)(O.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(a.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")))(r,o)}),st()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),r=this.getIcon();return 0===bt.o.productCount?((e,t)=>Object(n.createElement)(O.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(n.createElement)("p",null,Object(a.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:G.ADMIN_URL+"post-new.php?post_type=product"},Object(a.__)("Add new product","woo-gutenberg-products-block")+" ",Object(n.createElement)(i.a,{icon:mt.a})),Object(n.createElement)(O.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(a.__)("Learn more","woo-gutenberg-products-block"))))(c,r):Object(n.createElement)("div",{className:pt("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Wt=Object(j.compose)(O.withSpokenMessages,Object(lt.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:r}=e("core/block-editor");return{block:r(c)}}),Object(lt.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(Ut);const $t={columns:Object(G.getSetting)("default_columns",3),rows:Object(G.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:gt,isPreview:!1},Kt={title:Object(a.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(n.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:$t,edit:e=>Object(n.createElement)(Wt,e),save(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const r={"data-attributes":JSON.stringify(c)};return Object(n.createElement)("div",o()({className:pt("wc-block-all-products",t)},r),Object(n.createElement)(s.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",{...Kt,deprecated:[{attributes:Object.assign({},Kt.attributes,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(n.createElement)("div",o()({className:pt("wc-block-all-products",t)},c),Object(n.createElement)(s.InnerBlocks.Content,null))}}]})},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(40),o=c(0),n=c(24);c.p=n.l,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(28)]).then(c.bind(null,274)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(5),c.e(25)]).then(c.bind(null,552)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(36)]).then(c.bind(null,553)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(29)]).then(c.bind(null,275)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(21)]).then(c.bind(null,276)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(33)]).then(c.bind(null,277)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(5)]).then(c.bind(null,206)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>c.e(31).then(c.bind(null,278)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(24)]).then(c.bind(null,279)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(35)]).then(c.bind(null,280)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(32)]).then(c.bind(null,281)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(3),c.e(4),c.e(19)]).then(c.bind(null,554)))});const a=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>e.is_purchasable||!1,o=e=>["simple","variable"].includes(e.type||"simple")}]);
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var r,a,s=t[0],l=t[1],i=t[2],d=0,b=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);b.length;)b.shift()();return n.push.apply(n,i||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],r=!0,s=1;s<c.length;s++){var l=c[s];0!==o[l]&&(r=!1)}r&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var r={},o={7:0,1:0,2:0,3:0,4:0,5:0,21:0,24:0,28:0,29:0,31:0,32:0,33:0,35:0},n=[];function a(t){if(r[t])return r[t].exports;var c=r[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var t=[],c=o[e];if(0!==c)if(c)t.push(c[2]);else{var r=new Promise((function(t,r){c=o[e]=[t,r]}));t.push(c[2]=r);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00",2:"product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01",3:"product-add-to-cart--product-button--product-image--product-title",4:"product-add-to-cart--product-button",5:"product-sale-badge",19:"product-add-to-cart",21:"product-button",24:"product-category-list",25:"product-image",28:"product-price",29:"product-rating",31:"product-sku",32:"product-stock-indicator",33:"product-summary",35:"product-tag-list",36:"product-title"}[e]||e)+".js?ver="+{1:"2837fcb9558fb3317d12",2:"5c46e723f6b1af211655",3:"65efc68406f6e335dd0d",4:"3ccafa4ab75c542fa5be",5:"9726012b41a10ceca226",19:"c323f153037df7986742",21:"aa2f03fa510296d28f48",24:"ef8368bf2961e7d53366",25:"98f24ed9529803083813",28:"c461a7bd5f5001bb5dfc",29:"08b578330de1213349ad",31:"56ecab66b9a11500a473",32:"2d84e4ca5fd2b485316b",33:"10b5493963e8b1c5f9fa",35:"2efc79713f2bfdda8bcd",36:"3925dfa1febde8eb7f78"}[e]}(e);var l=new Error;n=function(t){s.onerror=s.onload=null,clearTimeout(i);var c=o[e];if(0!==c){if(c){var r=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+n+")",l.name="ChunkLoadError",l.type=r,l.request=n,c[1](l)}o[e]=void 0}};var i=setTimeout((function(){n({type:"timeout",target:s})}),12e4);s.onerror=s.onload=n,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=r,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(c,r,function(t){return e[t]}.bind(null,r));return c},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var u=l;return n.push([390,0]),c()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.wp.blockEditor},,function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.primitives},,function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wc.wcBlocksData},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return i})),c.d(t,"b",(function(){return u}));var r=c(0),o=c(7),n=c(1);const a={clear:Object(n.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(n.__)("No items found.","woo-gutenberg-products-block"),
2
  /* Translators: %s search term */
3
  noResults:Object(n.__)("No results for %s","woo-gutenberg-products-block"),search:Object(n.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(n.sprintf)(
4
  /* translators: Number of items selected from list. */
5
+ Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(o.groupBy)(e,"parent"),r=Object(o.keyBy)(t,"id"),n=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return n.push(""+e.id),{...e,breadcrumbs:a(r[e.parent]),children:t&&t.length?s(t):[]}}),l=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;n.includes(t)||l.push(...s(c||[]))}),l},l=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(o,e):o},i=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(r.createElement)(r.Fragment,{key:c},Object(r.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},,,function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return _}));var r,o=c(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,O=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),j=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),_=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var r=c(16),o=c(15),n=c.n(o),a=c(7),s=c(2),l=c(24);const i=e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...a,...o})];return n&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:o});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:c}=e;const o=(e=>{let{selected:t=[],search:c}=e;const o=Object(s.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:c})];return o&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),O=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var r=c(1),o=c(14);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o);t.a=e=>{let t,{label:c,screenReaderLabel:o,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=o;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,o)):(t=a||r.Fragment,l&&i&&c!==o?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,s,c))}},,function(e,t){e.exports=window.wp.escapeHtml},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(32);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),o=c.n(r),n=c(0),a=c(21);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:d,search:b="",...p}=e;const m=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,j=p.name||"search-list-item-"+s,h=`${j}-${l.id}`;return Object(n.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",o()({type:"checkbox",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,b))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return i})),c.d(t,"d",(function(){return d}));var r=c(57);let o,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const a=(e,t)=>Object(r.a)(e)&&"type"in e&&e.type===t,s=e=>a(e,o.SUCCESS),l=e=>a(e,o.ERROR),i=e=>a(e,o.FAIL),u=e=>!Object(r.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:n,shouldRetry:u,isSuccessResponse:s,isErrorResponse:l,isFailResponse:i})},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(124),s=c(4),l=c.n(s);c(127);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:u="text",...d}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**r.minorUnit;if(!Number.isFinite(p))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...i(r),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,o()({className:m,displayType:u},g,{value:p,onValueChange:O}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var r=c(7),o=c(0),n=c(18),a=c(9),s=c(14),l=c(225),i=c(50),u=c(224);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},O={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),h={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:n.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(i.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();p();const b=Object(a.useSelect)((e,c)=>{let{dispatch:r}=c;if(!u)return h;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(n.CART_STORE_KEY),a=o.getCartData(),i=o.getCartErrors(),d=o.getCartTotals(),b=!o.hasFinishedResolution("getCartData"),p=o.isCustomerDataUpdating(),{receiveCart:O}=r(n.CART_STORE_KEY),_=j(a.billingAddress),E=a.needsShipping?j(a.shippingAddress):_,w=a.fees.length>0?a.fees.map(e=>j(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:w,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:b,cartErrors:i,billingAddress:Object(l.a)(_),shippingAddress:Object(l.a)(E),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:O}},[u]);return d.current&&Object(r.isEqual)(d.current,b)||(d.current=b),d.current}},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,function(e,t,c){"use strict";c.d(t,"c",(function(){return i})),c.d(t,"d",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"a",(function(){return b}));var r=c(5),o=c(71),n=c(119),a=c(57),s=c(91);const l=e=>Object(n.a)(e)?JSON.parse(e)||{}:Object(a.a)(e)?e:{},i=e=>{if(!Object(o.b)()||!Object(s.a)())return{style:{}};const t=Object(a.a)(e)?e:{},c=l(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},u=e=>{const t=Object(a.a)(e)?e:{},c=l(t.style),r=Object(a.a)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:t.fontFamily}}},d=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},c=l(t.style);return Object(r.__experimentalUseColorProps)({...t,style:c})},b=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},c=l(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:c})}},function(e,t){e.exports=window.wp.a11y},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(25),n=c.n(o);function a(e){const t=Object(r.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const o=Object(r.createContext)("page"),n=()=>Object(r.useContext)(o);o.Provider},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(0),o=c(9);const n=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(r.useContext)(n),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const l=Object(o.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(r.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:i};return Object(r.createElement)(n.Provider,{value:u},t)}},function(e,t){e.exports=window.wp.hooks},,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.autop},,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(7),a=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:d=1,maxRows:b=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(n.clamp)(e,d,b);s({rows:Number.isNaN(t)?"":t})},min:d,max:b}),Object(r.createElement)(a.ToggleControl,{label:Object(o.__)("Align Last Block","woo-gutenberg-products-block"),help:l?Object(o.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(o.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:l,onChange:()=>s({alignButtons:!l})}))}},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(51),o=c(0),n=c(39);const a=()=>{const e=Object(n.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(134),s=c(4),l=c.n(s),i=c(90);c(148),t.a=e=>{let{className:t,showSpinner:c=!1,children:r,variant:s="contained",...u}=e;const d=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,o()({className:d},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},r))}},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"d",(function(){return a})),c.d(t,"a",(function(){return s})),c.d(t,"b",(function(){return l}));var r=c(13),o=c(24);const n=(e,t)=>{if(o.n>2)return Object(r.registerBlockType)(e,t)},a=(e,t)=>{if(o.n>1)return Object(r.registerBlockType)(e,t)},s=()=>o.n>2,l=()=>o.n>1},,,function(e,t){e.exports=window.wp.dom},,function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b})),c.d(t,"c",(function(){return p}));var r=c(18),o=c(9),n=c(0),a=c(25),s=c.n(a),l=c(48),i=c(106),u=c(49);const d=e=>{const t=Object(u.a)();e=e||t;const c=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},b=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},p=(e,t)=>{const c=Object(u.a)();t=t||c;const[r,o]=d(t),a=Object(l.a)(r),b=Object(l.a)(e),p=Object(i.a)(b),m=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(p,b)||(o(Object.assign({},a,b)),m.current=!0)},[a,b,p,o]),m.current?[r,o]:[e,o]}},,,,,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(34),s=c(3),l=c(4),i=c.n(l);t.a=e=>{let{className:t,item:c,isSelected:r,isLoading:l,onSelect:u,disabled:d,...b}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.a,o()({},b,{key:c.id,className:t,isSelected:r,item:c,onSelect:u,isSingle:!0,disabled:d})),r&&l&&Object(n.createElement)("div",{key:"loading",className:i()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},,,function(e,t){e.exports=window.wp.wordcount},,function(e,t,c){"use strict";var r=c(2),o=c(1),n=c(155),a=c(119);const s=Object(r.getSetting)("countryLocale",{}),l=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
6
  /* translators: %s Field label. */
7
  Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},i=Object.entries(s).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,l(c)]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{})]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=c&&void 0!==i[c]?i[c]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var r=c(0);c(149),t.a=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(5);const o=()=>"function"==typeof r.__experimentalGetSpacingClassesAndStyles},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(36),a=c(4),s=c.n(a),l=c(27);c(147);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)(
8
  /* translators: %1$s min price, %2$s max price */
9
+ Object(o.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:d}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:o,format:a="<price/>",maxPrice:l,minPrice:d,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}=e;const h=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));const _=g&&b!==g;let E=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",p)});return _?E=Object(r.createElement)(u,{currency:o,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}):void 0!==d&&void 0!==l?E=Object(r.createElement)(i,{currency:o,maxPrice:l,minPrice:d,priceClassName:p,priceStyle:m}):b&&(E=Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",p),currency:o,value:b,style:m})),Object(r.createElement)("span",{className:h},Object(r.createInterpolateElement)(a,{price:E}))}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(7),l=c(34),i=c(96),u=c(10),d=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Object(n.createElement)(e,o()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=c(175),p=c(23),m=c.n(p),g=c(25),O=c.n(g),j=c(26),h=c(28),_=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||c[r])return;const o=e.find(e=>e.id===r);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(j.g)(r).then(e=>{const t=e.map(e=>({...e,parent:r}));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:r}=this.props;r&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){const{products:t}=this.props;return t.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0].id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem)),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:c}=this.props,{error:r,loading:a,variations:s}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:r||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),E=c(33),w=c(4),f=c.n(w),k=c(84);c(129);const y={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},v=e=>{let{expandedProduct:t,error:c,instanceId:r,isCompact:u,isLoading:d,onChange:b,onSearch:p,products:m,renderItem:g,selected:O,showVariations:j,variations:h,variationsLoading:_}=e;if(c)return Object(n.createElement)(E.a,{error:c});const w=[...m,...h&&h[t]?h[t]:[]];return Object(n.createElement)(i.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:d,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return O.includes(t)}),onChange:b,renderItem:g||(j?e=>{const{item:t,search:c,depth:i=0,isSelected:u,onSelect:b}=e,p=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=f()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+i,"has-count",{"is-searching":c.length>0,"is-skip-level":0===i&&0!==t.parent,"is-variable":p>0});if(!t.breadcrumbs.length)return Object(n.createElement)(k.a,o()({},e,{className:f()(m,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{b(t)()},isLoading:d||_,countLabel:t.variations.length>0?Object(a.sprintf)(
10
  /* translators: %1$d is the number of variations of a product product. */
11
  Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+r,"aria-label":Object(a.sprintf)(
12
  /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
13
+ Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,o()({},g,{className:m,name:"variations-"+r}))}:null),onSearch:p,messages:y,isHierarchical:!0})};v.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(_(Object(u.withInstanceId)(v))))},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var r=c(7);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(r.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:r,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return l.set(r,{priority:s,callback:n}),{...e,[c]:l};case o.REMOVE_EVENT_CALLBACK:return l.delete(r),{...e,[c]:l}}}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(3),l=c(110),i=c(518),u=c(4),d=c.n(u),b=c(10),p=c(21),m=c(34),g=c(517),O=c(14);const j=e=>{let{id:t,label:c,popoverContents:r,remove:o,screenReaderLabel:i,className:u=""}=e;const[p,m]=Object(n.useState)(!1),h=Object(b.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const _=d()("woocommerce-tag",u,{"has-remove":!!o}),E="woocommerce-tag__label-"+h,w=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:_},r?Object(n.createElement)(s.Button,{className:"woocommerce-tag__text",id:E,onClick:()=>m(!0)},w):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:E},w),r&&p&&Object(n.createElement)(s.Popover,{onClose:()=>m(!1)},r),o&&Object(n.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(a.sprintf)(// Translators: %s label.
14
+ Object(a.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":E},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const _=e=>Object(n.createElement)(m.b,e),E=e=>{const{list:t,selected:c,renderItem:r,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,r({item:t,isSelected:d,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(E,o()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:c,selected:r,messages:o,onChange:l,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":o.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,r.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},f=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:o,...s}=e;const{messages:u,renderItem:d,selected:b,isSingle:p}=s,m=d||_;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(E,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:o,isSingle:p,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:a,isSingle:l,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,_]=Object(n.useState)(""),E=Object(b.useInstanceId)(k),y=Object(n.useMemo)(()=>({...p.a,...u}),[u]),v=Object(n.useMemo)(()=>Object(p.c)(i,h,r),[i,h,r]);Object(n.useEffect)(()=>{j&&j(y.updated)},[j,y]),Object(n.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(n.useCallback)(e=>()=>{l&&m([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});m([...O.slice(0,t),...O.slice(t+1)])},[l,O,m]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?m(l?[e]:[...O,e]):S(e.id)()},[l,S,m,O]);return Object(n.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(w,o()({},e,{onRemove:S,messages:y})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:y.search,type:"search",value:h,onChange:e=>_(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(f,o()({},e,{search:h,filteredList:v,messages:y,onSelect:C,instanceId:E})))};Object(s.withSpokenMessages)(k)},,function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";var r=c(0),o=c(7),n=c(1),a=c(3),s=c(11);function l(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(r.createElement)(s.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:c[t]})):null}class i extends r.Component{createLevelControl(e,t,c){const o=e===t;return{icon:Object(r.createElement)(l,{level:e}),title:Object(n.sprintf)(
15
  /* translators: %s: heading level e.g: "2", "3", "4" */
16
+ Object(n.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:o,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:n,onChange:s}=this.props;return Object(r.createElement)(a.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(l,{level:n}),controls:Object(o.range)(t,c).map(e=>this.createLevelControl(e,n,s))})}}t.a=i},,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(110),a=c(223),s=c(2),l=c(5),i=c(29);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(r.createElement)(l.InspectorControls,null,Object(r.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(r.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details","woo-gutenberg-products-block"),Object(r.createElement)(n.a,{icon:a.a,size:16}))),Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(8);function o(e,t){const c=Object(r.useRef)();return Object(r.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(14),s=c(4),l=c.n(s);c(146),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:i,rel:u,style:d,onClick:b,...p}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",o()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)}}))}return Object(n.createElement)("a",o()({className:m,href:s,target:i},p,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)},style:d}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(9);const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(r.select)("core/notices").getNotices(),{removeNotice:o}=Object(r.dispatch)("core/notices"),n=c.filter(t=>t.status===e);n.forEach(e=>o(e.id,t))}},function(e,t,c){"use strict";var r=c(0),o=c(87),n=c(59);const a=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const r=s(e),o=r.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(o,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const o=s(e),a=o.slice(0,t);if(c)return Object(n.autop)(l(a,r));const i=a.match(/([\s]+)/g),u=i?i.length:0,d=o.slice(0,t+u);return Object(n.autop)(l(d,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:d={}}=e;const b=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(n.autop)(e),s=Object(o.count)(r,c);if(s<=t)return r;const l=a(r),d=Object(o.count)(l,c);return d<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:d,className:l},b)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var r=c(0),o=c(7),n=c(25),a=c.n(n);const s=Object(r.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),l=()=>Object(r.useContext)(s),i=e=>{let{children:t}=e;const[c,n]=Object(r.useState)({}),l=Object(r.useCallback)(e=>c[e],[c]),i=Object(r.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(r.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:c,...r}=t;return r})},[]),d=Object(r.useCallback)(()=>{n({})},[]),b=Object(r.useCallback)(e=>{e&&n(t=>(e=Object(o.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&a()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),p=Object(r.useCallback)((e,t)=>{n(c=>{if(!c.hasOwnProperty(e))return c;const r={...c[e],...t};return a()(c[e],r)?c:{...c,[e]:r}})},[]),m={getValidationError:l,setValidationErrors:b,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(r.useCallback)(e=>{p(e,{hidden:!0})},[p]),showValidationError:Object(r.useCallback)(e=>{p(e,{hidden:!1})},[p]),showAllValidationErrors:Object(r.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:i};return Object(r.createElement)(s.Provider,{value:m},t)}},,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(30),s=c(10);c(152),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:o="",onChange:s,options:l,screenReaderLabel:i,value:u}=e;const d="wc-block-components-sort-select__select-"+c;return Object(r.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(a.a,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(18),o=c(9),n=c(0),a=c(48),s=c(121);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(n.useRef)({results:[],isLoading:!0}),b=Object(a.a)(i),p=Object(a.a)(l),m=Object(s.a)(),g=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),n=[t,c,b,p],a=o.getCollectionError(...n);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(a)}return{results:o.getCollection(...n),isLoading:!o.hasFinishedResolution("getCollection",n)}},[t,c,p,b,u]);return null!==g&&(d.current=g),d.current}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(3),s=c(4),l=c.n(s);c(176),t.a=function(e){let{className:t="",...c}=e;const r=l()("wc-block-text-toolbar-button",t);return Object(n.createElement)(a.Button,o()({className:r},c))}},,,,function(e,t){},,function(e,t){},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return a}));var r=c(0);const o=Object(r.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),n=()=>Object(r.useContext)(o),a=e=>{let{children:t}=e;const[c,n]=Object(r.useState)(!1),a={setIsSuppressed:n,isSuppressed:c};return Object(r.createElement)(o.Provider,{value:a},t)}},,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,,,,,,,,,,,,function(e,t){},,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(24),s=c(26),l=c(109),i=c(28);t.a=e=>t=>{let{selected:c,...r}=t;const[u,d]=Object(n.useState)(!0),[b,p]=Object(n.useState)(null),[m,g]=Object(n.useState)([]),O=a.o.productCount>100,j=async e=>{const t=await Object(i.a)(e);p(t),d(!1)},h=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:h.current}).then(e=>{g(e),d(!1)}).catch(j)},[h]);const _=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),d(!1)}).catch(j)},400),E=Object(n.useCallback)(e=>{d(!0),_(e)},[d,_]);return Object(n.createElement)(e,o()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:O?E:null}))}},function(e,t){},,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(30),l=c(29),i=c(56),u=(c(340),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:i}=Object(l.useProductDataContext)(),d=Object(u.a)(e),b=Object(u.b)(e),p=Object(u.d)(e),m=Object(u.c)(e);if(!i.id||!i.on_sale)return null;const g="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(r.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,g,{[n+"__product-onsale"]:n},b.className,d.className),style:{...b.style,...d.style,...p.style,...m.style}},Object(r.createElement)(s.a,{label:Object(o.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Product on sale","woo-gutenberg-products-block")}))})},function(e,t,c){"use strict";var r=c(0),o=c(11);const n=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=n},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0),o=c(115);c(172);const n=e=>{let{errorMessage:t="",propertyName:c="",elementId:n=""}=e;const{getValidationError:a,getValidationErrorId:s}=Object(o.b)();if(!t||"string"!=typeof t){const e=a(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:s(n)},t))}},,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return b}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(264),i=c(9),u=(c(182),c(141));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},b=e=>{let{className:t,context:c="default",additionalNotices:r=[]}=e;const{isSuppressed:a}=Object(u.b)(),{notices:b}=Object(i.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:p}=Object(i.useDispatch)("core/notices"),m=b.filter(e=>"snackbar"!==e.type).concat(r);if(!m.length)return null;const g=s()(t,"wc-block-components-notices");return a?null:Object(n.createElement)("div",{className:g},m.map(e=>Object(n.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&p(e.id,c)}}),e.content)))}},,,,,,function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:c=!1,cancelable:o=!1,element:n,detail:a={}}=t;if(!r)return;n||(n=document.body);const s=new r(e,{bubbles:c,cancelable:o,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{o(t,{bubbles:c,cancelable:r})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return a}));var r=c(89),o=(c(16),c(2));const n=(e,t)=>Object.keys(o.defaultAddressFields).every(c=>e[c]===t[c]),a=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:r=!1}=t;r&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(94);const o=(e,t)=>function(c){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=r.a.addEventCallback(e,c,o);return t(n),()=>{t(r.a.removeEventCallback(e,n.id))}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));const r=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=c(35);const n=async(e,t,c)=>{const o=r(e,t),n=[];for(const e of o)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},a=async(e,t,c)=>{const n=[],a=r(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,c){"use strict";var r=c(71);let o={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(r.b)()&&(o={...o,align:{type:"string"}}),t.a=o},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(29),s=c(71),l=c(56),i=c(112),u=c(65),d=(c(339),c(43));const b=e=>{let{children:t,headingLevel:c,elementType:o="h"+c,...n}=e;return Object(r.createElement)(o,n,t)};t.a=Object(l.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:o=!0,linkTarget:l,align:p}=e,{parentClassName:m}=Object(a.useInnerBlockLayoutContext)(),{product:g}=Object(a.useProductDataContext)(),{dispatchStoreEvent:O}=Object(u.a)(),j=Object(d.b)(e),h=Object(d.c)(e),_=Object(d.d)(e);return g.id?Object(r.createElement)(b,{headingLevel:c,className:n()(t,j.className,"wc-block-components-product-title",{[m+"__product-title"]:m,["wc-block-components-product-title--align-"+p]:p&&Object(s.b)()}),style:Object(s.b)()?{...h.style,..._.style,...j.style}:{}},Object(r.createElement)(i.a,{disabled:!o,name:g.name,permalink:g.permalink,target:l,onClick:()=>{O("product-view-link",{product:g})}})):Object(r.createElement)(b,{headingLevel:c,className:n()(t,j.className,"wc-block-components-product-title",{[m+"__product-title"]:m,["wc-block-components-product-title--align-"+p]:p&&Object(s.b)()}),style:Object(s.b)()?{...h.style,..._.style,...j.style}:{}})})},function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(4),l=c.n(s),i=c(2),u=c(29),d=c(56),b=c(65),p=c(207),m=(c(341),c(43));const g=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),O=e=>{let{image:t,onLoad:c,loaded:r,showFullSize:a,fallbackAlt:s}=e;const{thumbnail:l,src:i,srcset:u,sizes:d,alt:b}=t||{},p={alt:b||s,onLoad:c,hidden:!r,src:l,...a&&{src:i,srcSet:u,sizes:d}};return Object(n.createElement)(n.Fragment,null,p.src&&Object(n.createElement)("img",o()({"data-testid":"product-image"},p)),!r&&Object(n.createElement)(g,null))};t.a=Object(d.withProductDataContext)(e=>{const{className:t,imageSizing:c="full-size",showProductLink:r=!0,showSaleBadge:o,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:d}=Object(u.useProductDataContext)(),[j,h]=Object(n.useState)(!1),{dispatchStoreEvent:_}=Object(b.a)(),E=Object(m.d)(e),w=Object(m.a)(e),f=Object(m.c)(e);if(!d.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},w.className),style:{...E.style,...w.style,...f.style}},Object(n.createElement)(g,null));const k=!!d.images.length,y=k?d.images[0]:null,v=r?"a":n.Fragment,S=Object(a.sprintf)(
17
  /* translators: %s is referring to the product name */
18
+ Object(a.__)("Link to %s","woo-gutenberg-products-block"),d.name),C={href:d.permalink,...!k&&{"aria-label":S},onClick:()=>{_("product-view-link",{product:d})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},w.className),style:{...E.style,...w.style,...f.style}},Object(n.createElement)(v,r&&C,!!o&&Object(n.createElement)(p.default,{align:s,product:d}),Object(n.createElement)(O,{fallbackAlt:d.name,image:y,onLoad:()=>h(!0),loaded:j,showFullSize:"cropped"!==c})))})},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(1),s=c(48),l=c(510),i=c(9);const u={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},d={status:u.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:p,SET_IDLE:m,SET_DISABLED:g,SET_PROCESSING:O,SET_BEFORE_PROCESSING:j,SET_AFTER_PROCESSING:h,SET_PROCESSING_RESPONSE:_,SET_HAS_ERROR:E,SET_NO_ERROR:w,SET_QUANTITY:f,SET_REQUEST_PARAMS:k}=b,y=()=>({type:m}),v=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?E:w;return{type:t}},{SET_PRISTINE:S,SET_IDLE:C,SET_DISABLED:x,SET_PROCESSING:N,SET_BEFORE_PROCESSING:P,SET_AFTER_PROCESSING:T,SET_PROCESSING_RESPONSE:R,SET_HAS_ERROR:I,SET_NO_ERROR:A,SET_QUANTITY:B,SET_REQUEST_PARAMS:L}=b,{PRISTINE:D,IDLE:V,DISABLED:F,PROCESSING:M,BEFORE_PROCESSING:z,AFTER_PROCESSING:H}=u,q=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,{quantity:c,type:r,data:o}=arguments.length>1?arguments[1]:void 0;switch(r){case S:e=d;break;case C:e=t.status!==V?{...t,status:V}:t;break;case x:e=t.status!==F?{...t,status:F}:t;break;case B:e=c!==t.quantity?{...t,quantity:c}:t;break;case L:e={...t,requestParams:{...t.requestParams,...o}};break;case R:e={...t,processingResponse:o};break;case N:e=t.status!==M?{...t,status:M,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case P:e=t.status!==z?{...t,status:z,hasError:!1}:t;break;case T:e=t.status!==H?{...t,status:H}:t;break;case I:e=t.hasError?t:{...t,hasError:!0},e=t.status===M||t.status===z?{...e,status:V}:e;break;case A:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&r!==S&&e.status===D&&(e.status=V),e};var G=c(94),Q=c(226);const Y=e=>({onAddToCartAfterProcessingWithSuccess:Object(Q.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Q.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Q.a)("add_to_cart_before_processing",e)});var U=c(227),W=c(115),$=c(35),K=c(113);const J=Object(r.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),X=()=>Object(r.useContext)(J),Z=e=>{var t,c,o,n;let{children:b,product:m,showFormElements:E}=e;const[w,S]=Object(r.useReducer)(q,d),[C,x]=Object(r.useReducer)(G.b,{}),N=Object(s.a)(C),{createErrorNotice:P}=Object(i.useDispatch)("core/notices"),{setValidationErrors:T}=Object(W.b)(),{isSuccessResponse:R,isErrorResponse:I,isFailResponse:A}=Object($.d)(),B=Object(r.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:Y(x).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Y(x).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Y(x).onAddToCartBeforeProcessing}),[x]),L=Object(r.useMemo)(()=>({resetForm:()=>{S({type:p})},submitForm:()=>{S({type:j})},setQuantity:e=>{S((e=>({type:f,quantity:e}))(e))},setHasError:e=>{S(v(e))},setRequestParams:e=>{S((e=>({type:k,data:e}))(e))},setAfterProcessing:e=>{S({type:_,data:e}),S({type:h})}}),[]);Object(r.useEffect)(()=>{const e=w.status,t=!m.id||!Object(l.a)(m);e!==u.DISABLED||t?e!==u.DISABLED&&t&&S({type:g}):S(y())},[w.status,m,S]),Object(r.useEffect)(()=>{w.status===u.BEFORE_PROCESSING&&(Object(K.a)("error","wc/add-to-cart"),Object(U.a)(N,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&P(t,{context:"wc/add-to-cart"}),c&&T(c)}),S(y())):S({type:O})}))},[w.status,T,P,S,N,null==m?void 0:m.id]),Object(r.useEffect)(()=>{if(w.status===u.AFTER_PROCESSING){const e={processingResponse:w.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:r}=e;(I(e)||A(e))&&c&&(t=!0,P(c,r?{context:r}:void 0))}),t};if(w.hasError)return void Object(U.b)(N,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var r;const t=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");P(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==m?void 0:m.id)||0)})}S(y())});Object(U.b)(N,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?S(v(!0)):S(y())})}},[w.status,w.hasError,w.processingResponse,L,P,I,A,R,N,null==m?void 0:m.id]);const D=Object(l.b)(m),V={product:m,productType:m.type||"simple",productIsPurchasable:Object(l.a)(m),productHasOptions:m.has_options||!1,supportsFormElements:D,showFormElements:E&&D,quantity:w.quantity||(null==m||null===(t=m.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==m||null===(c=m.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==m||null===(o=m.add_to_cart)||void 0===o?void 0:o.maximum)||99,multipleOf:(null==m||null===(n=m.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:w.requestParams,isIdle:w.status===u.IDLE,isDisabled:w.status===u.DISABLED,isProcessing:w.status===u.PROCESSING,isBeforeProcessing:w.status===u.BEFORE_PROCESSING,isAfterProcessing:w.status===u.AFTER_PROCESSING,hasError:w.hasError,eventRegistration:B,dispatchActions:L};return Object(r.createElement)(J.Provider,{value:V},b)};var ee=c(15),te=c.n(ee),ce=c(14),re=c(224),oe=c(39),ne=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:o,hasError:n,isProcessing:s,requestParams:l}=X(),{hasValidationErrors:u,showAllValidationErrors:d}=Object(W.b)(),{createErrorNotice:b,removeNotice:p}=Object(i.useDispatch)("core/notices"),{receiveCart:m}=Object(oe.a)(),[g,O]=Object(r.useState)(!1),j=!n&&s,h=Object(r.useCallback)(()=>!u||(d(),{type:"error"}),[u,d]);Object(r.useEffect)(()=>{const e=o.onAddToCartBeforeProcessing(h,0);return()=>{e()}},[o,h]);const _=Object(r.useCallback)(()=>{O(!0),p("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const r={id:t.id||0,quantity:c,...l};te()({path:"/wc/store/v1/cart/add-item",method:"POST",data:r,cache:"no-store",parse:!1}).then(c=>{te.a.setNonce(c.headers),c.json().then((function(r){c.ok?m(r):(r.body&&r.body.message?b(Object(ce.decodeEntities)(r.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):b(Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(re.b)({preserveCartData:!0}),e.setAfterProcessing(r),O(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&m(t.data.cart),e.setHasError(),e.setAfterProcessing(t),O(!1)}))})},[t,b,p,m,e,c,l]);return Object(r.useEffect)(()=>{j&&!g&&_()},[j,_,g]),null};const ae=e=>{let{children:t,product:c,showFormElements:o}=e;return Object(r.createElement)(W.a,null,Object(r.createElement)(Z,{product:c,showFormElements:o},t,Object(r.createElement)(ne,null)))};var se=c(29),le=c(7),ie=c(56),ue=(c(266),c(70)),de=c(110),be=c(538),pe=c(65),me=c(393);const ge=e=>{let{className:t,href:c,text:o,onClick:n}=e;return Object(r.createElement)(ue.a,{className:t,href:c,onClick:n,rel:"nofollow"},o)},Oe=e=>{let{className:t,quantityInCart:c,isProcessing:o,isDisabled:n,isDone:s,onClick:l}=e;return Object(r.createElement)(ue.a,{className:t,disabled:n,showSpinner:o,onClick:l},s&&c>0?Object(a.sprintf)(
19
  /* translators: %s number of products in cart. */
20
+ Object(a._n)("%d in cart","%d in cart",c,"woo-gutenberg-products-block"),c):Object(a.__)("Add to cart","woo-gutenberg-products-block"),!!s&&Object(r.createElement)(de.a,{icon:be.a}))};var je=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:o,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:d}=X(),{parentName:b}=Object(se.useInnerBlockLayoutContext)(),{dispatchStoreEvent:p}=Object(pe.a)(),{cartQuantity:m}=Object(me.a)(o.id||0),[g,O]=Object(r.useState)(!1),j=o.add_to_cart||{url:"",text:""};return Object(r.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(r.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==o?void 0:o.id)||0)),p("cart-add-item",{product:o,listName:b})}}):Object(r.createElement)(ge,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(a.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{p("product-view-link",{product:o,listName:b})}})},he=c(109),_e=e=>{let{disabled:t,min:c,max:o,step:n=1,value:a,onChange:s}=e;const l=void 0!==o,i=Object(he.a)(e=>{let t=e;l&&(t=Math.min(t,Math.floor(o/n)*n)),t=Math.max(t,Math.ceil(c/n)*n),t=Math.floor(t/n)*n,t!==e&&s(t)},300);return Object(r.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:c,max:o,step:n,hidden:1===o,disabled:t,onChange:e=>{s(e.target.value),i(e.target.value)}})},Ee=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},we=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=X();return e.id&&!e.is_purchasable?Object(r.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(r.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_e,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(je,null))},fe=(c(349),c(554)),ke=c(8),ye=c(209);const ve={value:"",label:Object(a.__)("Select an option","woo-gutenberg-products-block")};var Se=e=>{let{attributeName:t,options:c=[],value:o="",onChange:s=(()=>{}),errorMessage:l=Object(a.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:i,setValidationErrors:u,clearValidationError:d}=Object(W.b)(),b=t,p=i(b)||{};return Object(ke.useEffect)(()=>{o?d(b):u({[b]:{message:l,hidden:!0}})},[o,b,l,d,u]),Object(ke.useEffect)(()=>()=>{d(b)},[b,d]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(r.createElement)(fe.a,{label:Object(ce.decodeEntities)(t),value:o||"",options:[ve,...c],onChange:s,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":p.message&&!p.hidden})}),Object(r.createElement)(ye.a,{propertyName:b,elementId:b}))},Ce=c(57);const xe=(e,t,c)=>{const r=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(c).every(e=>""===e))return r;const o=Object.keys(e);return r.filter(e=>o.every(r=>{const o=c[r]||"",n=t["id:"+e].attributes[r];return""===o||null===n||n===o}))};var Ne=e=>{let{attributes:t,variationAttributes:c,setRequestParams:o}=e;const n=Object(s.a)(t),a=Object(s.a)(c),[l,i]=Object(r.useState)(0),[u,d]=Object(r.useState)({}),[b,p]=Object(r.useState)(!1),m=Object(r.useMemo)(()=>((e,t,c)=>{const r={},o=Object.keys(e),n=Object.values(c).filter(Boolean).length>0;return o.forEach(o=>{const a=e[o],s={...c,[o]:null},l=n?xe(e,t,s):null,i=null!==l?l.map(e=>t["id:"+e].attributes[o]):null;r[o]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:c,slug:r}=e;return null===t||t.includes(null)||t.includes(r)?{value:r,label:Object(ce.decodeEntities)(c)}:null}).filter(Boolean)}(a.terms,i)}),r})(n,a,u),[u,n,a]);return Object(r.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Ce.a)(e))return{};const t=Object.keys(e),c={};return 0===t.length||t.forEach(t=>{const r=e[t],o=r.terms.filter(e=>e.default);var n;o.length>0&&(c[r.name]=null===(n=o[0])||void 0===n?void 0:n.slug)}),c}(t);e&&d({...e}),p(!0)}},[u,t,b]),Object(r.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?i(((e,t,c)=>xe(e,t,c)[0]||0)(n,a,u)):l>0&&i(0)},[u,l,n,a]),Object(r.useEffect)(()=>{o({id:l,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[o,l,u]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(r.createElement)(Se,{key:e,attributeName:e,options:m[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},Pe=e=>{let{product:t,dispatchers:c}=e;const o=(e=>e?Object(le.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:c,attributes:r}=e;t["id:"+c]={id:c,attributes:r.reduce((e,t)=>{let{name:c,value:r}=t;return e[c]=r,e},{})}}),t})(t.variations);return 0===Object.keys(o).length||0===n.length?null:Object(r.createElement)(Ne,{attributes:o,variationAttributes:n,setRequestParams:c.setRequestParams})},Te=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=X();return e.id&&!e.is_purchasable?Object(r.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(r.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Pe,{product:e,dispatchers:s}),Object(r.createElement)(_e,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(je,null))},Re=()=>Object(r.createElement)(je,null),Ie=c(540),Ae=()=>Object(r.createElement)(Ie.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Be=()=>Object(r.createElement)(Ae,null);const Le=()=>{const{showFormElements:e,productType:t}=X();return e?"variable"===t?Object(r.createElement)(Te,null):"grouped"===t?Object(r.createElement)(Be,null):"external"===t?Object(r.createElement)(Re,null):"simple"===t||"variation"===t?Object(r.createElement)(we,null):null:Object(r.createElement)(je,null)};t.a=Object(ie.withProductDataContext)(e=>{let{className:t,showFormElements:c}=e;const{product:o}=Object(se.useProductDataContext)(),a=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(le.isEmpty)(o)});return Object(r.createElement)(ae,{product:o,showFormElements:c},Object(r.createElement)("div",{className:a},Object(r.createElement)(Le,null)))})},,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(92),s=c(27),l=c(29),i=c(56),u=c(43);t.default=Object(i.withProductDataContext)(e=>{var t,c;const{className:o,textAlign:i}=e,{parentClassName:d}=Object(l.useInnerBlockLayoutContext)(),{product:b}=Object(l.useProductDataContext)(),p=Object(u.b)(e),m=Object(u.d)(e),g=n()("wc-block-components-product-price",o,p.className,{[d+"__product-price"]:d}),O={...m.style,...p.style};if(!b.id)return Object(r.createElement)(a.a,{align:i,className:g});const j=b.prices,h=Object(s.getCurrencyFromPriceResponse)(j),_=j.price!==j.regular_price,E=n()({[d+"__product-price__value"]:d,[d+"__product-price__value--on-sale"]:_});return Object(r.createElement)(a.a,{align:i,className:g,priceStyle:O,regularPriceStyle:O,priceClassName:E,currency:h,price:j.price,minPrice:null==j||null===(t=j.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==j||null===(c=j.price_range)||void 0===c?void 0:c.max_amount,regularPrice:j.regular_price,regularPriceClassName:n()({[d+"__product-price__regular"]:d})})})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(56),i=(c(342),c(43));t.default=Object(l.withProductDataContext)(e=>{const{parentClassName:t}=Object(s.useInnerBlockLayoutContext)(),{product:c}=Object(s.useProductDataContext)(),n=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(c),l=Object(i.b)(e),u=Object(i.d)(e),d=Object(i.c)(e);if(!n)return null;const b={width:n/5*100+"%"},p=Object(o.sprintf)(
21
  /* translators: %f is referring to the average rating value */
22
  Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),n),m=(e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(c),g={__html:Object(o.sprintf)(
23
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
24
+ Object(o._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",m,"woo-gutenberg-products-block"),Object(o.sprintf)('<strong class="rating">%f</strong>',n),Object(o.sprintf)('<span class="rating">%d</span>',m))};return Object(r.createElement)("div",{className:a()(l.className,"wc-block-components-product-rating",{[t+"__product-rating"]:t}),style:{...l.style,...u.style,...d.style}},Object(r.createElement)("div",{className:a()("wc-block-components-product-rating__stars",t+"__product-rating__stars"),role:"img","aria-label":p},Object(r.createElement)("span",{style:b,dangerouslySetInnerHTML:g})))})},function(e,t,c){"use strict";c.r(t);var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(1),i=c(65),u=c(393),d=c(14),b=c(24),p=c(2),m=c(29),g=c(56),O=(c(343),c(43));const j=e=>{let{product:t,colorStyles:c,borderStyles:r,typographyStyles:a,spacingStyles:m}=e;const{id:g,permalink:O,add_to_cart:j,has_options:h,is_purchasable:_,is_in_stock:E}=t,{dispatchStoreEvent:w}=Object(i.a)(),{cartQuantity:f,addingToCart:k,addToCart:y}=Object(u.a)(g,"woocommerce/single-product/"+(g||0)),v=Number.isFinite(f)&&f>0,S=!h&&_&&E,C=Object(d.decodeEntities)((null==j?void 0:j.description)||""),x=v?Object(l.sprintf)(
25
  /* translators: %s number of products in cart. */
26
+ Object(l._n)("%d in cart","%d in cart",f,"woo-gutenberg-products-block"),f):Object(d.decodeEntities)((null==j?void 0:j.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),N=S?"button":"a",P={};return S?P.onClick=()=>{y(),w("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(p.getSetting)("productsSettings");e&&(window.location.href=b.d)}:(P.href=O,P.rel="nofollow",P.onClick=()=>{w("product-view-link",{product:t})}),Object(n.createElement)(N,o()({"aria-label":C,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,r.className,{loading:k,added:v}),style:{...c.style,...r.style,...a.style,...m.style},disabled:k},P),x)},h=e=>{let{colorStyles:t,borderStyles:c,typographyStyles:r,spacingStyles:o}=e;return Object(n.createElement)("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",t.className,c.className),style:{...t.style,...c.style,...r.style,...o.style},disabled:!0})};t.default=Object(g.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(m.useInnerBlockLayoutContext)(),{product:r}=Object(m.useProductDataContext)(),o=Object(O.b)(e),a=Object(O.a)(e),l=Object(O.d)(e),i=Object(O.c)(e);return Object(n.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},r.id?Object(n.createElement)(j,{product:r,colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}):Object(n.createElement)(h,{colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(114),s=c(24),l=c(29),i=c(56),u=(c(344),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:o}=Object(l.useProductDataContext)(),i=Object(u.b)(e),d=Object(u.d)(e);if(!o)return Object(r.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const b=o.short_description?o.short_description:o.description;return b?Object(r.createElement)(a.a,{className:n()(t,i.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:b,maxLength:150,countType:s.o.wordCountType||"words",style:{...i.style,...d.style}}):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(56);c(345),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(o.__)("SKU:","woo-gutenberg-products-block")," ",Object(r.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(7),i=c(56),u=(c(346),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),i=Object(u.b)(e),d=Object(u.d)(e);return Object(l.isEmpty)(n.categories)?null:Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",i.className,{[c+"__product-category-list"]:c}),style:{...i.style,...d.style}},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",Object(r.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"category-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(7),i=c(56),u=(c(347),c(43));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),i=Object(u.b)(e),d=Object(u.d)(e);return Object(l.isEmpty)(n.tags)?null:Object(r.createElement)("div",{className:a()(t,i.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...i.style,...d.style}},Object(o.__)("Tags:","woo-gutenberg-products-block")," ",Object(r.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"tag-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(56),i=(c(348),c(43));t.default=Object(l.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=Object(i.b)(e),u=Object(i.d)(e);if(!n.id||!n.is_purchasable)return null;const d=!!n.is_in_stock,b=n.low_stock_remaining,p=n.is_on_backorder;return Object(r.createElement)("div",{className:a()(t,l.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":d,"wc-block-components-product-stock-indicator--out-of-stock":!d,"wc-block-components-product-stock-indicator--low-stock":!!b,"wc-block-components-product-stock-indicator--available-on-backorder":!!p}),style:{...l.style,...u.style}},b?(e=>Object(o.sprintf)(
27
  /* translators: %d stock amount (number of items in stock for product) */
28
+ Object(o.__)("%d left in stock","woo-gutenberg-products-block"),e))(b):((e,t)=>t?Object(o.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(o.__)("In Stock","woo-gutenberg-products-block"):Object(o.__)("Out of Stock","woo-gutenberg-products-block"))(d,p))})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(1),o=c(24);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(r.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:o.m+"previews/pennant.jpg",thumbnail:o.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(r.__)("Add to cart","woo-gutenberg-products-block"),description:Object(r.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,,,,,,,,,function(e,t,c){e.exports=c(474)},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(0),o=c(9),n=c(18),a=c(14),s=c(39);const l=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},i=e=>{const{addItemToCart:t}=Object(o.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:i}=Object(s.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[b,p]=Object(r.useState)(!1),m=Object(r.useRef)(l(c,e));return Object(r.useEffect)(()=>{const t=l(c,e);t!==m.current&&(m.current=t)},[c,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:i,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{u(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"blockSettings",(function(){return Kt}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(5),l=c(13),i=c(110),u=c(530),d=c(71),b=c(4),p=c.n(b),m={category:"woocommerce-product-elements",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(n.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},supports:{html:!1},parent:Object(d.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",{className:p()("is-loading",t.className)})},deprecated:[{attributes:{},save:()=>null}]},g=c(267),O=c(3),j=c(10),h=c(99),_=c(268),E=c(93),w=c(123),f=c(29);c(391);var k=e=>t=>c=>{const r=Object(f.useProductDataContext)(),{attributes:o,setAttributes:l}=c,{productId:i}=o,[u,d]=Object(n.useState)(!i);return r.hasContext?Object(n.createElement)(t,c):Object(n.createElement)(n.Fragment,null,u?Object(n.createElement)(O.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(n.createElement)("div",null,e.description),Object(n.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(n.createElement)(E.a,{selected:i||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l({productId:e[0]?e[0].id:0})}}),Object(n.createElement)(O.Button,{isSecondary:!0,disabled:!i,onClick:()=>{d(!1)}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(O.ToolbarGroup,null,Object(n.createElement)(w.a,{onClick:()=>d(!0)},Object(a.__)("Switch product…","woo-gutenberg-products-block")))),Object(n.createElement)(t,c)))},y=c(531);const v=Object(a.__)("Product Title","woo-gutenberg-products-block"),S=Object(n.createElement)(i.a,{icon:y.a,className:"wc-block-editor-components-block-icon"}),C=Object(a.__)("Display the title of a product.","woo-gutenberg-products-block");c(392);const x=e=>{let{attributes:t,setAttributes:c}=e;const r=Object(s.useBlockProps)(),{headingLevel:o,showProductLink:l,align:i,linkTarget:u}=t;return Object(n.createElement)("div",r,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(h.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:o,onChange:e=>c({headingLevel:e})}),Object(d.b)()&&Object(n.createElement)(s.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Link settings","woo-gutenberg-products-block")},Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Make title a link","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showProductLink:!l})}),l&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Open in new tab","woo-gutenberg-products-block"),onChange:e=>c({linkTarget:e?"_blank":"_self"}),checked:"_blank"===u})))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(_.a,t)))};var N=Object(d.b)()?Object(j.compose)([k({icon:S,label:v,description:Object(a.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(x):x;const P=e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))};var T=c(91);const R={...m,apiVersion:2,title:v,description:C,icon:{src:S},attributes:g.a,edit:N,save:P,supports:{...m.supports,...Object(d.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(l.registerBlockType)("woocommerce/product-title",R);var I=c(277),A=c(532);const B=Object(a.__)("Product Price","woo-gutenberg-products-block"),L=Object(n.createElement)(i.a,{icon:A.a,className:"wc-block-editor-components-block-icon"}),D=Object(a.__)("Display the price of a product.","woo-gutenberg-products-block");var V=k({icon:L,label:B,description:Object(a.__)("Choose a product to display its price.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const r=Object(s.useBlockProps)();return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.BlockControls,null,Object(d.b)()&&Object(n.createElement)(s.AlignmentToolbar,{value:t.textAlign,onChange:e=>{c({textAlign:e})}})),Object(n.createElement)("div",r,Object(n.createElement)(I.default,t)))});let F={productId:{type:"number",default:0}};Object(d.b)()&&(F={...F,textAlign:{type:"string"}});var M=F;const z={...m,apiVersion:2,title:B,description:D,icon:{src:L},attributes:M,edit:V,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},supports:{...m.supports,...Object(d.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-price"}}};Object(l.registerBlockType)("woocommerce/product-price",z);var H=c(269);const q={...Object(d.b)()&&{__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-image"}};var G=c(2),Q=c(270),Y=c(533);const U=Object(a.__)("Product Image","woo-gutenberg-products-block"),W=Object(n.createElement)(i.a,{icon:Y.a,className:"wc-block-editor-components-block-icon"}),$=Object(a.__)("Display the main product image","woo-gutenberg-products-block");var K=k({icon:W,label:U,description:Object(a.__)("Choose a product to display its image.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{showProductLink:r,imageSizing:o,showSaleBadge:l,saleBadgeAlign:i}=t,u=Object(s.useBlockProps)();return Object(n.createElement)("div",u,Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(a.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:r,onChange:()=>c({showProductLink:!r})}),Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(a.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:l,onChange:()=>c({showSaleBadge:!l})}),l&&Object(n.createElement)(O.__experimentalToggleGroupControl,{label:Object(a.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:i,onChange:e=>c({saleBadgeAlign:e})},Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"left",label:Object(a.__)("Left","woo-gutenberg-products-block")}),Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"center",label:Object(a.__)("Center","woo-gutenberg-products-block")}),Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"right",label:Object(a.__)("Right","woo-gutenberg-products-block")})),Object(n.createElement)(O.__experimentalToggleGroupControl,{label:Object(a.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(n.createInterpolateElement)(Object(a.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(G.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:o,onChange:e=>c({imageSizing:e})},Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"full-size",label:Object(a.__)("Full Size","woo-gutenberg-products-block")}),Object(n.createElement)(O.__experimentalToggleGroupControlOption,{value:"cropped",label:Object(a.__)("Cropped","woo-gutenberg-products-block")})))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Q.a,t)))});const J={apiVersion:2,title:U,description:$,icon:{src:W},attributes:H.a,edit:K,supports:q,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-image",{...m,...J});var X=c(278),Z=c(525);const ee=Object(a.__)("Product Rating","woo-gutenberg-products-block"),te=Object(n.createElement)(i.a,{icon:Z.a,className:"wc-block-editor-components-block-icon"}),ce=Object(a.__)("Display the average rating of a product.","woo-gutenberg-products-block");var re=k({icon:te,label:ee,description:Object(a.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)({className:"wp-block-woocommerce-product-rating"});return Object(n.createElement)("div",c,Object(n.createElement)(X.default,t))});const oe={apiVersion:2,title:ee,description:ce,icon:{src:te},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-rating"}},edit:re,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-rating",{...m,...oe});var ne=c(279),ae=c(534);const se=Object(a.__)("Add to Cart Button","woo-gutenberg-products-block"),le=Object(n.createElement)(i.a,{icon:ae.a,className:"wc-block-editor-components-block-icon"}),ie=Object(a.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block");var ue=k({icon:le,label:se,description:Object(a.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(O.Disabled,null,Object(n.createElement)(ne.default,t)))});const de={apiVersion:2,title:se,description:ie,icon:{src:le},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button"}},edit:ue,save:P};Object(l.registerBlockType)("woocommerce/product-button",{...m,...de});var be=c(280),pe=c(535);const me=Object(a.__)("Product Summary","woo-gutenberg-products-block"),ge=Object(n.createElement)(i.a,{icon:pe.a,className:"wc-block-editor-components-block-icon"}),Oe=Object(a.__)("Display a short description about a product.","woo-gutenberg-products-block");c(394);var je=k({icon:ge,label:me,description:Object(a.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(be.default,t))});const he={apiVersion:2,title:me,description:Oe,icon:{src:ge},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:je,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-summary",{...m,...he});var _e=c(207),Ee=c(523);const we=Object(a.__)("On-Sale Badge","woo-gutenberg-products-block"),fe=Object(n.createElement)(i.a,{icon:Ee.a,className:"wc-block-editor-components-block-icon"}),ke=Object(a.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block");var ye=k({icon:fe,label:we,description:Object(a.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(_e.default,t))});const ve={title:we,description:ke,icon:{src:fe},apiVersion:2,supports:{html:!1,...Object(d.b)()&&{color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-sale-badge"}},attributes:{productId:{type:"number",default:0}},edit:ye,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-sale-badge",{...m,...ve});var Se=c(101),Ce=c(281),xe=c(11),Ne=Object(n.createElement)(xe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const Pe=Object(a.__)("Product SKU","woo-gutenberg-products-block"),Te=Object(n.createElement)(i.a,{icon:Ne,className:"wc-block-editor-components-block-icon"}),Re={title:Pe,description:Object(a.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Te},attributes:{productId:{type:"number",default:0}},edit:k({icon:Te,label:Pe,description:Object(a.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Se.a,null),Object(n.createElement)(Ce.default,t))})};Object(d.c)("woocommerce/product-sku",{...m,...Re});var Ie=c(282),Ae=c(536);const Be=Object(a.__)("Product Category List","woo-gutenberg-products-block"),Le=Object(n.createElement)(i.a,{icon:Ae.a,className:"wc-block-editor-components-block-icon"}),De=Object(a.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block");var Ve=k({icon:Le,label:Be,description:Object(a.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Se.a,null),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Ie.default,t)))});const Fe={...m,apiVersion:2,title:Be,description:De,icon:{src:Le},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,link:!0,background:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-category-list"}},save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},edit:Ve};Object(d.c)("woocommerce/product-category-list",Fe);var Me=c(283),ze=c(529);const He=Object(a.__)("Product Tag List","woo-gutenberg-products-block"),qe=Object(n.createElement)(i.a,{icon:ze.a,className:"wc-block-editor-components-block-icon"}),Ge=Object(a.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block");var Qe=k({icon:qe,label:He,description:Object(a.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Se.a,null),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Me.default,t)))});const Ye={apiVersion:2,title:He,description:Ge,icon:{src:qe},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!0},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-tag-list"}},edit:Qe,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(d.c)("woocommerce/product-tag-list",{...m,...Ye});var Ue=c(284),We=c(537);const $e=Object(a.__)("Product Stock Indicator","woo-gutenberg-products-block"),Ke=Object(n.createElement)(i.a,{icon:We.a,className:"wc-block-editor-components-block-icon"}),Je=Object(a.__)("Display product stock status.","woo-gutenberg-products-block");var Xe=k({icon:Ke,label:$e,description:Object(a.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Se.a,null),Object(n.createElement)(Ue.default,t))});const Ze={apiVersion:2,title:$e,description:Je,icon:{src:Ke},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:Xe,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(d.c)("woocommerce/product-stock-indicator",{...m,...Ze});var et=c(510),tt=(c(266),c(272)),ct=c(208);const rt=Object(a.__)("Add to Cart","woo-gutenberg-products-block"),ot=Object(n.createElement)(i.a,{icon:ct.a,className:"wc-block-editor-components-block-icon"}),nt={title:rt,description:Object(a.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:ot},edit:k({icon:ot,label:rt,description:Object(a.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:r}=Object(f.useProductDataContext)(),{className:o,showFormElements:l}=t;return Object(n.createElement)("div",{className:p()(o,"wc-block-components-product-add-to-cart")},Object(n.createElement)(Se.a,{productId:r.id}),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Layout","woo-gutenberg-products-block")},Object(et.b)(r)?Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Display form elements","woo-gutenberg-products-block"),help:Object(a.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showFormElements:!l})}):Object(n.createElement)(O.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(a.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(tt.a,t)))}),attributes:c(271).a};Object(d.c)("woocommerce/product-add-to-cart",{...m,...nt});var at=c(23),st=c.n(at),lt=c(9),it=c(61),ut=c(502),dt=c(377),bt=c(24);const pt=(e,t)=>{const{className:c,contentVisibility:r}=t;return p()(e,c,{"has-image":r&&r.image,"has-title":r&&r.title,"has-rating":r&&r.rating,"has-price":r&&r.price,"has-button":r&&r.button})};var mt=c(223);const gt=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Ot=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?Ot(e.innerBlocks):[]}]):[];var jt=c(8),ht=c(7),_t=c(30);c(400);var Et=e=>{let{currentPage:t,displayFirstAndLastPages:c=!0,displayNextAndPreviousArrows:r=!0,pagesToDisplay:o=3,onPageChange:s,totalPages:l}=e,{minIndex:i,maxIndex:u}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),n=Math.min(Math.ceil(t+(r-(t-o))),c-1);return{minIndex:Math.max(Math.floor(t-(r-(n-t))),2),maxIndex:n}})(o,t,l);const d=c&&Boolean(1!==i),b=c&&Boolean(u!==l),m=c&&Boolean(i&&i>3),g=c&&Boolean(u&&u<l-2);d&&3===i&&(i-=1),b&&u===l-2&&(u+=1);const O=[];if(i&&u)for(let e=i;e<=u;e++)O.push(e);return Object(n.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(n.createElement)(_t.a,{screenReaderLabel:Object(a.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t-1),title:Object(a.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(_t.a,{label:"←",screenReaderLabel:Object(a.__)("Previous page","woo-gutenberg-products-block")})),d&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>s(1),disabled:1===t},Object(n.createElement)(_t.a,{label:"1",screenReaderLabel:Object(a.sprintf)(
29
  /* translators: %d is the page number (1, 2, 3...). */
30
  Object(a.__)("Page %d","woo-gutenberg-products-block"),1)})),m&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),O.map(e=>Object(n.createElement)("button",{key:e,className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>s(e),disabled:t===e},Object(n.createElement)(_t.a,{label:e.toString(),screenReaderLabel:Object(a.sprintf)(
31
  /* translators: %d is the page number (1, 2, 3...). */
32
  Object(a.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),b&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===l,"wc-block-components-pagination__page--active":t===l}),onClick:()=>s(l),disabled:t===l},Object(n.createElement)(_t.a,{label:l.toString(),screenReaderLabel:Object(a.sprintf)(
33
  /* translators: %d is the page number (1, 2, 3...). */
34
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),l)})),r&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t+1),title:Object(a.__)("Next page","woo-gutenberg-products-block"),disabled:t>=l},Object(n.createElement)(_t.a,{label:"→",screenReaderLabel:Object(a.__)("Next page","woo-gutenberg-products-block")})))},wt=c(106),ft=c(76),kt=c(122),yt=c(18),vt=c(48);var St=c(65);c(401);const Ct=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var xt=c(44),Nt=c(171),Pt=()=>{const{parentClassName:e}=Object(f.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(i.a,{className:e+"__no-products-image",icon:Nt.a,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(a.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(a.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Tt=c(528),Rt=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:c}=Object(f.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:c+"__no-products"},Object(n.createElement)(i.a,{className:c+"__no-products-image",icon:Tt.a,size:100}),Object(n.createElement)("strong",{className:c+"__no-products-title"},Object(a.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:c+"__no-products-description"},Object(a.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(a.__)("Reset Search","woo-gutenberg-products-block")))},It=c(117);c(399);var At=e=>{let{onChange:t,value:c}=e;return Object(n.createElement)(It.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(a.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(a.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(a.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(a.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(a.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(a.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(a.__)("Order products by","woo-gutenberg-products-block"),value:c})};const Bt=(e,t,c,r)=>{if(!c)return;const a=Object(ut.a)(e);return c.map((c,s)=>{let[l,i={}]=c,u=[];i.children&&i.children.length>0&&(u=Bt(e,t,i.children,r));const d=a[l];if(!d)return null;const b=t.id||0,p=["layout",l,s,r,b];return Object(n.createElement)(n.Suspense,{key:p.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(d,o()({},i,{children:u,product:t})))})};var Lt=Object(j.withInstanceId)(e=>{let{product:t={},attributes:c,instanceId:r}=e;const{layoutConfig:o}=c,{parentClassName:a,parentName:s}=Object(f.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,i=p()(a+"__product","wc-block-layout",{"is-loading":l});return Object(n.createElement)("li",{className:i,"aria-hidden":l},Bt(s,t,o,r))});c(398);const Dt=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},Vt=function(e){let{totalQuery:t,totalProducts:c}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(ht.isEqual)(t,r)&&Number.isFinite(c)};var Ft,Mt=(Ft=e=>{let{attributes:t,currentPage:c,onPageChange:r,onSortChange:o,sortValue:s,scrollToTop:l}=e;const[i,u]=Object(ft.b)("attributes",[]),[d,b]=Object(ft.b)("stock_status",[]),[m,g]=Object(ft.b)("min_price"),[O,j]=Object(ft.b)("max_price"),[h]=Object(ft.c)((e=>{let{sortValue:t,currentPage:c,attributes:r}=e;const{columns:o,rows:n}=r;return{...Dt(t),catalog_visibility:"catalog",per_page:o*n,page:c}})({attributes:t,sortValue:s,currentPage:c})),{products:_,totalProducts:E,productsLoading:w}=(e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:c,isLoading:r}=Object(kt.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:c,resourceName:r,resourceValues:o=[],query:n={}}=t;if(!c||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const a=Object(vt.a)(n),s=Object(vt.a)(o),{value:l,isLoading:i=!0}=Object(lt.useSelect)(e=>{const t=e(yt.COLLECTIONS_STORE_KEY),o=["x-wp-total",c,r,a,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",c,r,s,a]);return{value:l,isLoading:i}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(o,10),productsLoading:r}})(h),{parentClassName:k,parentName:y}=Object(f.useInnerBlockLayoutContext)(),v=(e=>{const{order:t,orderby:c,page:r,per_page:o,...n}=e;return n||{}})(h),{dispatchStoreEvent:S}=Object(St.a)(),C=Object(wt.a)({totalQuery:v,totalProducts:E},Vt);Object(n.useEffect)(()=>{S("product-list-render",{products:_,listName:y})},[_,y,S]),Object(n.useEffect)(()=>{Object(ht.isEqual)(v,null==C?void 0:C.totalQuery)||(r(1),null!=C&&C.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(xt.speak)(Object(a.__)("No products found","woo-gutenberg-products-block")):Object(xt.speak)(Object(a.sprintf)(
35
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
36
+ Object(a._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(E))},[null==C?void 0:C.totalQuery,E,r,v]);const{contentVisibility:x}=t,N=t.columns*t.rows,P=!Number.isFinite(E)&&Number.isFinite(null==C?void 0:C.totalProducts)&&Object(ht.isEqual)(v,null==C?void 0:C.totalQuery)?Math.ceil(((null==C?void 0:C.totalProducts)||0)/N):Math.ceil(E/N),T=_.length?_:Array.from({length:N}),R=0!==_.length||w,I=i.length>0||d.length>0||Number.isFinite(m)||Number.isFinite(O);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:r,align:o}=t,n=void 0!==o?"align"+o:"";return p()(k,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":r})})()},(null==x?void 0:x.orderBy)&&R&&Object(n.createElement)(At,{onChange:o,value:s}),!R&&I&&Object(n.createElement)(Rt,{resetCallback:()=>{u([]),b([]),g(null),j(null)}}),!R&&!I&&Object(n.createElement)(Pt,null),R&&Object(n.createElement)("ul",{className:k+"__products"},T.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(Lt,{key:e.id||c,attributes:t,product:e})}))),P>1&&Object(n.createElement)(Et,{currentPage:c,onPageChange:e=>{l({focusableSelector:"a, button"}),r(e)},totalPages:P}))},e=>{const t=Object(n.useRef)(null);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(n.createElement)(Ft,o()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const r=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(r.length){const e=r[0];Ct(e),null==e||e.focus()}else Ct(e)})(e,c):Ct(e))})(t.current,e)}})))}),zt=e=>{let{attributes:t}=e;const[c,r]=Object(n.useState)(1),[o,a]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(n.createElement)(Mt,{attributes:t,currentPage:c,onPageChange:e=>{r(e)},onSortChange:e=>{var t;const c=null==e||null===(t=e.target)||void 0===t?void 0:t.value;a(c),r(1)},sortValue:o})},Ht=c(137),qt=c(141),Gt=c(218);class Qt extends jt.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Ht.a:Object(n.createElement)(f.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(qt.a,null,Object(n.createElement)(Gt.a,{context:"wc/all-products"})),Object(n.createElement)(zt,{attributes:e,urlParameterSuffix:t}))}}var Yt=Qt;c(397);class Ut extends n.Component{constructor(){super(...arguments),st()(this,"state",{isEditing:!1,innerBlocks:[]}),st()(this,"blockMap",Object(ut.a)("woocommerce/all-products")),st()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),st()(this,"getTitle",()=>Object(a.__)("All Products","woo-gutenberg-products-block")),st()(this,"getIcon",()=>Object(n.createElement)(i.a,{icon:u.a})),st()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(a.__)("Showing All Products block preview.","woo-gutenberg-products-block"))}),st()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:r,alignButtons:o}=e;return Object(n.createElement)(s.InspectorControls,{key:"inspector"},Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(n.createElement)(it.a,{columns:c,rows:r,alignButtons:o,setAttributes:t,minColumns:Object(G.getSetting)("min_columns",1),maxColumns:Object(G.getSetting)("max_columns",6),minRows:Object(G.getSetting)("min_rows",1),maxRows:Object(G.getSetting)("max_rows",6)})),Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content Settings","woo-gutenberg-products-block")},((e,t)=>{const{contentVisibility:c}=e;return Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(n.createElement)(O.SelectControl,{label:Object(a.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(a.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(a.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(a.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(a.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(a.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(a.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),st()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(O.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit inner product layout","woo-gutenberg-products-block"),onClick:()=>this.togglePreview(),isActive:e}]}))}),st()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(n.createElement)(O.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(a.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(n.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(n.createElement)(O.Tip,null,Object(a.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(n.createElement)(f.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(n.createElement)("ul",{className:"wc-block-grid__products"},Object(n.createElement)("li",{className:"wc-block-grid__product"},Object(n.createElement)(f.ProductDataContextProvider,{product:dt.a[0]},Object(n.createElement)(s.InnerBlocks,e)))))),Object(n.createElement)("div",{className:"wc-block-all-products__actions"},Object(n.createElement)(O.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:Ot(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(a.__)("Done","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(a.__)("Cancel","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-all-products__reset-button",icon:Object(n.createElement)(i.a,{icon:u.a}),label:Object(a.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];gt.map(e=>{let[t,r]=e;return c.push(Object(l.createBlock)(t,r)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(a.__)("Reset Layout","woo-gutenberg-products-block")))))}),st()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,r=this.getTitle(),o=this.getIcon();return c?Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Yt,{attributes:e})):((e,t)=>Object(n.createElement)(O.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(a.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")))(r,o)}),st()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),r=this.getIcon();return 0===bt.o.productCount?((e,t)=>Object(n.createElement)(O.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(n.createElement)("p",null,Object(a.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:G.ADMIN_URL+"post-new.php?post_type=product"},Object(a.__)("Add new product","woo-gutenberg-products-block")+" ",Object(n.createElement)(i.a,{icon:mt.a})),Object(n.createElement)(O.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(a.__)("Learn more","woo-gutenberg-products-block"))))(c,r):Object(n.createElement)("div",{className:pt("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Wt=Object(j.compose)(O.withSpokenMessages,Object(lt.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:r}=e("core/block-editor");return{block:r(c)}}),Object(lt.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(Ut);const $t={columns:Object(G.getSetting)("default_columns",3),rows:Object(G.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:gt,isPreview:!1},Kt={title:Object(a.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(n.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:$t,edit:e=>Object(n.createElement)(Wt,e),save(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const r={"data-attributes":JSON.stringify(c)};return Object(n.createElement)("div",o()({className:pt("wc-block-all-products",t)},r),Object(n.createElement)(s.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",{...Kt,deprecated:[{attributes:Object.assign({},Kt.attributes,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(n.createElement)("div",o()({className:pt("wc-block-all-products",t)},c),Object(n.createElement)(s.InnerBlocks.Content,null))}}]})},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(40),o=c(0),n=c(24);c.p=n.l,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(28)]).then(c.bind(null,277)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(5),c.e(25)]).then(c.bind(null,557)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(36)]).then(c.bind(null,558)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(29)]).then(c.bind(null,278)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(21)]).then(c.bind(null,279)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(33)]).then(c.bind(null,280)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(5)]).then(c.bind(null,207)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>c.e(31).then(c.bind(null,281)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(24)]).then(c.bind(null,282)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(35)]).then(c.bind(null,283)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(32)]).then(c.bind(null,284)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(3),c.e(4),c.e(19)]).then(c.bind(null,559)))});const a=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>e.is_purchasable||!1,o=e=>["simple","variable"].includes(e.type||"simple")}]);
build/all-reviews.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '0f393e732e73923c55802db8cd83fb5f');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '46ba8ce5c4bc97efd8e0c2c0839e549e');
build/all-reviews.js CHANGED
@@ -1,9 +1,9 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,i=t[0],s=t[1],l=t[2],u=0,b=[];u<i.length;u++)a=i[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,i=1;i<r.length;i++){var s=r[i];0!==n[s]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={8:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=o,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var d=s;return c.push([377,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},103:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var o=r(0),n=r(1),c=r(5),a=r(2),i=r(3);const s=(e,t,r)=>Object(o.createElement)(c.BlockControls,null,Object(o.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),c=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woo-gutenberg-products-block")}),Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woo-gutenberg-products-block")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(i.SelectControl,{label:Object(n.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},111:function(e,t){},117:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),a=r(30),i=r(10);r(152),t.a=Object(i.withInstanceId)(e=>{let{className:t,instanceId:r,label:n="",onChange:i,options:s,screenReaderLabel:l,value:d}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,value:d},s&&s.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},12:function(e,t){e.exports=window.wp.primitives},120:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(24);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
2
  /* translators: An example person name used for the block previews. */
3
  reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
4
  /* translators: An example person name used for the block previews. */
5
- reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.blocks},138:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},139:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),a=r(5),i=(r(151),r(54));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},14:function(e,t){e.exports=window.wp.htmlEntities},143:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(7),a=r(3),i=r(5),s=r(8),l=r(2),d=r(69),u=r(30);r(179);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:c=Object(n.__)("Load more","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},w=r(117);r(176);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(w.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:c})},m=r(4),g=r.n(m),h=r(23),v=r.n(h),_=r(163),O=r.n(_);const j=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=O()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),k=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,n-o.length,o)},y={className:"read-more-content",ellipsis:"&hellip;",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class R extends s.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(s.createRef)(),this.reviewSummary=Object(s.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:k(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}v()(R,"defaultProps",y);var E=R;r(178);var S=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:a,showReviewerName:i,showReviewImage:s,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,w=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":s}),"aria-hidden":w},(u||a||i||s||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},s&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,c,w),(u||i||p||a)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)(
6
  /* translators: %f is referring to the average rating value */
7
  Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),a={__html:Object(n.sprintf)(
8
  /* translators: %s is referring to the average rating value */
9
- Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),i&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(177);var C=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s={...t,showReviewImage:a,showReviewRating:i};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(S,{attributes:s}):r.map((e,t)=>Object(o.createElement)(S,{key:e.id||t,attributes:s,review:e})))},T=r(6),P=r.n(T),N=r(25),L=r.n(N),x=r(54),A=r(28);class M extends s.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:i,totalReviews:s}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===i.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(C,{attributes:e,reviews:i}),e.showLoadMore&&s>i.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))}}var I=(e=>{class t extends s.Component{constructor(){super(...arguments),v()(this,"isPreview",!!this.props.attributes.previewReviews),v()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),v()(this,"isMounted",!1),v()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),v()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!L()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};return t&&t.length&&(a.category_id=Array.isArray(t)?t.join(","):t),n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}v()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(M);t.a=e=>{let{attributes:t,icon:r,name:s,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:p,showReviewerName:m,showReviewContent:g,showReviewImage:h,showReviewRating:v}=t,{order:_,orderby:O}=Object(x.d)(t.orderby),j=!(g||v||p||m||h||w),f=Object(i.useBlockProps)({className:Object(x.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:s},Object(n.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(I,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:O,order:_,productId:u,reviewsToDisplay:b}))}},15:function(e,t){e.exports=window.wp.apiFetch},151:function(e,t){},152:function(e,t){},176:function(e,t){},177:function(e,t){},178:function(e,t){},179:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},24:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return h})),r.d(t,"i",(function(){return v})),r.d(t,"b",(function(){return _}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),h=Object(n.getSetting)("allowedCountries",{}),v=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var o=r(1),n=r(14);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},30:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:i={}}=e;const s=null!=r,l=null!=n;return!s&&l?(t=a||"span",i={...i,className:c()(i.className,"screen-reader-text")},Object(o.createElement)(t,i,n)):(t=a||o.Fragment,s&&l&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))}},32:function(e,t){e.exports=window.wp.escapeHtml},33:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(32);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},377:function(e,t,r){e.exports=r(487)},487:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(13),a=r(110),i=r(522),s=(r(151),r(5)),l=r(3),d=r(143),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woo-gutenberg-products-block")},Object(n.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block")),b=r(103),w=r(138),p=r(139),m=r(120);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(a.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...m.a,attributes:{...m.a.attributes,showProductName:!0}},attributes:{...w.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(b.b)(t,r)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woo-gutenberg-products-block")},Object(b.c)(t,r))),Object(o.createElement)(d.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:u}))},save:p.a})},5:function(e,t){e.exports=window.wp.blockEditor},54:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(15),n=r.n(o),c=r(4),a=r.n(c),i=r(2);const s=e=>{if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:i,showProductName:s,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":i,"has-product-name":s})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:i,showOrderby:s}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":i,"data-show-orderby":s};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},69:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(110),a=r(170),i=r(4),s=r.n(i),l=r(3),d=r(33);r(111),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,i?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woo-gutenberg-products-block"))))}},7:function(e,t){e.exports=window.lodash},8:function(e,t){e.exports=window.React}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,i=t[0],s=t[1],l=t[2],u=0,b=[];u<i.length;u++)a=i[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,i=1;i<r.length;i++){var s=r[i];0!==n[s]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={8:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=o,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var d=s;return c.push([379,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},103:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var o=r(0),n=r(1),c=r(5),a=r(2),i=r(3);const s=(e,t,r)=>Object(o.createElement)(c.BlockControls,null,Object(o.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),c=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woo-gutenberg-products-block")}),Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woo-gutenberg-products-block")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(i.SelectControl,{label:Object(n.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},11:function(e,t){e.exports=window.wp.primitives},111:function(e,t){},117:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),a=r(30),i=r(10);r(152),t.a=Object(i.withInstanceId)(e=>{let{className:t,instanceId:r,label:n="",onChange:i,options:s,screenReaderLabel:l,value:d}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,value:d},s&&s.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},120:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(24);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
2
  /* translators: An example person name used for the block previews. */
3
  reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
4
  /* translators: An example person name used for the block previews. */
5
+ reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.blocks},138:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},139:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),a=r(5),i=(r(151),r(54));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},14:function(e,t){e.exports=window.wp.htmlEntities},143:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(7),a=r(3),i=r(5),s=r(8),l=r(2),d=r(69),u=r(30);r(180);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:c=Object(n.__)("Load more","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},w=r(117);r(177);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(w.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:c})},m=r(4),g=r.n(m),v=r(23),h=r.n(v),_=r(164),O=r.n(_);const j=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=O()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),k=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,n-o.length,o)},y={className:"read-more-content",ellipsis:"&hellip;",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class R extends s.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(s.createRef)(),this.reviewSummary=Object(s.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:k(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}h()(R,"defaultProps",y);var E=R;r(179);var S=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:a,showReviewerName:i,showReviewImage:s,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,w=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":s}),"aria-hidden":w},(u||a||i||s||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},s&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,c,w),(u||i||p||a)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)(
6
  /* translators: %f is referring to the average rating value */
7
  Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),a={__html:Object(n.sprintf)(
8
  /* translators: %s is referring to the average rating value */
9
+ Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),i&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(178);var C=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s={...t,showReviewImage:a,showReviewRating:i};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(S,{attributes:s}):r.map((e,t)=>Object(o.createElement)(S,{key:e.id||t,attributes:s,review:e})))},T=r(6),P=r.n(T),N=r(25),L=r.n(N),x=r(54),A=r(28);class M extends s.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:i,totalReviews:s}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===i.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(C,{attributes:e,reviews:i}),e.showLoadMore&&s>i.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))}}var I=(e=>{class t extends s.Component{constructor(){super(...arguments),h()(this,"isPreview",!!this.props.attributes.previewReviews),h()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),h()(this,"isMounted",!1),h()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),h()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!L()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};if(t){const e=Array.isArray(t)?t:JSON.parse(t);a.category_id=Array.isArray(e)?e.join(","):e}return n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}h()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(M);t.a=e=>{let{attributes:t,icon:r,name:s,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:p,showReviewerName:m,showReviewContent:g,showReviewImage:v,showReviewRating:h}=t,{order:_,orderby:O}=Object(x.d)(t.orderby),j=!(g||h||p||m||v||w),f=Object(i.useBlockProps)({className:Object(x.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:s},Object(n.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(I,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:O,order:_,productId:u,reviewsToDisplay:b}))}},15:function(e,t){e.exports=window.wp.apiFetch},151:function(e,t){},152:function(e,t){},177:function(e,t){},178:function(e,t){},179:function(e,t){},180:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},24:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return v})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return _}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),v=Object(n.getSetting)("allowedCountries",{}),h=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var o=r(1),n=r(14);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},30:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:i={}}=e;const s=null!=r,l=null!=n;return!s&&l?(t=a||"span",i={...i,className:c()(i.className,"screen-reader-text")},Object(o.createElement)(t,i,n)):(t=a||o.Fragment,s&&l&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))}},32:function(e,t){e.exports=window.wp.escapeHtml},33:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(32);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},379:function(e,t,r){e.exports=r(491)},491:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(13),a=r(110),i=r(527),s=(r(151),r(5)),l=r(3),d=r(143),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woo-gutenberg-products-block")},Object(n.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block")),b=r(103),w=r(138),p=r(139),m=r(120);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(a.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...m.a,attributes:{...m.a.attributes,showProductName:!0}},attributes:{...w.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(b.b)(t,r)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woo-gutenberg-products-block")},Object(b.c)(t,r))),Object(o.createElement)(d.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:u}))},save:p.a})},5:function(e,t){e.exports=window.wp.blockEditor},54:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(15),n=r.n(o),c=r(4),a=r.n(c),i=r(2);const s=e=>{if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:i,showProductName:s,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":i,"has-product-name":s})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:i,showOrderby:s}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":i,"data-show-orderby":s};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},69:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(110),a=r(171),i=r(4),s=r.n(i),l=r(3),d=r(33);r(111),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,i?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woo-gutenberg-products-block"))))}},7:function(e,t){e.exports=window.lodash},8:function(e,t){e.exports=window.React}});
build/attribute-filter-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'c528a283b6ec7613267363c92dc9ec27');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '373cf24bb18040be14b03c48edd6b710');
build/attribute-filter-frontend.js CHANGED
@@ -1,12 +1,12 @@
1
- !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=214)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(218)()},,function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},,function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(19),o=n.n(r),i=n(0),c=n(3),a=n(1),s=n(44),u=e=>{let{imageUrl:t=s.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:c=Object(a.__)("Error:","woo-gutenberg-products-block"),button:u,showErrorBlock:l=!0}=e;return l?Object(i.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(i.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(i.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(i.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(i.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(i.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},c?c+" ":"",o),u&&Object(i.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u))):null};n(33);class l extends c.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(i.createElement)(i.Fragment,null,Object(i.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:c,renderError:a,button:s}=this.props,{errorMessage:l,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:l}):Object(i.createElement)(u,{showErrorBlock:r,errorMessage:n?l:null,header:e,imageUrl:t,text:o,errorMessagePrefix:c,button:s}):this.props.children}}t.a=l},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.a11y},,function(e,t,n){"use strict";var r=n(0),o=n(4),i=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:c,wrapperProps:a={}}=e;const s=null!=n,u=null!=o;return!s&&u?(t=c||"span",a={...a,className:i()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=c||r.Fragment,s&&u&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);const o=Object(r.createContext)("page"),i=()=>Object(r.useContext)(o);o.Provider},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=n(12),i=n.n(o);function c(e){const t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(5),o=n(7),i=n(0),c=n(12),a=n.n(c),s=n(30),u=n(58),l=n(23);const d=e=>{const t=Object(l.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:c}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(i.useCallback)(t=>{c(e,t)},[e,c])]},p=(e,t,n)=>{const c=Object(l.a)();n=n||c;const a=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(i.useCallback)(t=>{s(n,e,t)},[n,e,s])]},f=(e,t)=>{const n=Object(l.a)();t=t||n;const[r,o]=d(t),c=Object(s.a)(r),p=Object(s.a)(e),f=Object(u.a)(p),b=Object(i.useRef)(!1);return Object(i.useEffect)(()=>{a()(f,p)||(o(Object.assign({},c,p)),b.current=!0)},[c,p,f,o]),b.current?[r,o]:[e,o]}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return c})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return v}));var r,o=n(2);const i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=i.pluginUrl+"images/",a=i.pluginUrl+"build/",s=i.buildPhase,u=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){var o=this,i=Object(r.useRef)(null),c=Object(r.useRef)(0),a=Object(r.useRef)(null),s=Object(r.useRef)([]),u=Object(r.useRef)(),l=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,g="maxWait"in n,h=g?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=s.current,n=u.current;return s.current=u.current=null,c.current=e,l.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(a.current),a.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-i.current,r=e-c.current;return!i.current||n>=t||n<0||g&&r>=h},v=function(t){return a.current=null,m&&s.current?e(t):(s.current=u.current=null,l.current)},y=function(){var e=Date.now();if(r(e))return v(e);if(p.current){var o=e-i.current,a=e-c.current,s=t-o,u=g?Math.min(s,h-a):s;n(y,u)}},O=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var m=Date.now(),h=r(m);if(s.current=d,u.current=o,i.current=m,h){if(!a.current&&p.current)return c.current=i.current,n(y,t),b?e(i.current):l.current;if(g)return n(y,t),e(i.current)}return a.current||n(y,t),l.current};return O.cancel=function(){a.current&&(f?cancelAnimationFrame(a.current):clearTimeout(a.current)),c.current=0,s.current=i.current=u.current=a.current=null},O.isPending=function(){return!!a.current},O.flush=function(){return a.current?v(Date.now()):l.current},O}),[b,g,t,h,m,f])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(11),o=n.n(r),i=n(0),c=n(15);const a=[".wp-block-woocommerce-cart"],s=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const s=r(e,n),u=a(e,n),l={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:s={}}=e;Object(i.render)(Object(i.createElement)(c.a,s,Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(i.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:l,errorBoundaryProps:u})})},u=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:i}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:i}=e;const c=document.body.querySelectorAll(o);i&&i.length>0&&Array.prototype.filter.call(c,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,i)),s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:i,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:i}=e;const c=i.querySelectorAll(o);s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(22);n(125),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,Number.isFinite(n)&&Object(r.createElement)(i.a,{label:n.toString(),screenReaderLabel:Object(o.sprintf)(
2
  /* translators: %s number of products. */
3
- Object(o._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5),o=n(7),i=n(0),c=n(30),a=n(72);const s=e=>{const{namespace:t,resourceName:n,resourceValues:s=[],query:u={},shouldSelect:l=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(i.useRef)({results:[],isLoading:!0}),p=Object(c.a)(u),f=Object(c.a)(s),b=Object(a.a)(),m=Object(o.useSelect)(e=>{if(!l)return null;const o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,p,f],c=o.getCollectionError(...i);if(c){if(!(c instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(c)}return{results:o.getCollection(...i),isLoading:!o.hasFinishedResolution("getCollection",i)}},[t,n,f,p,l]);return null!==m&&(d.current=m),d.current}},,,,,,,,function(e,t){e.exports=window.wp.blockEditor},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),c=n.n(i),a=n(22);n(107),t.a=e=>{let{className:t,disabled:n,label:
4
  /* translators: Submit button text for filters. */
5
- i=Object(o.__)("Go","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:u=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:c()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:s},Object(r.createElement)(a.a,{label:i,screenReaderLabel:u}))}},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(47);function i(e,t){return e===t}function c(e){return"function"==typeof e?function(){return e}:e}function a(e,t,n){var a=n&&n.equalityFn||i,s=function(e){var t=Object(r.useState)(c(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(c(e))}),[])]}(e),u=s[0],l=s[1],d=Object(o.a)(Object(r.useCallback)((function(e){return l(e)}),[l]),t,n),p=Object(r.useRef)(e);return a(p.current,e)||(d(e),p.current=e),[u,d]}},function(e,t){e.exports=window.wp.components},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(6);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const i=e.filter(e=>e.attribute===n.taxonomy),c=i.length?i[0]:null;if(!(c&&c.slug&&Array.isArray(c.slug)&&c.slug.includes(o)))return;const a=c.slug.filter(e=>e!==o),s=e.filter(e=>e.attribute!==n.taxonomy);a.length>0&&(c.slug=a.sort(),s.push(c)),t(Object(r.sortBy)(s,"attribute"))},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const c=e.filter(e=>e.attribute!==n.taxonomy);return 0===o.length?t(c):(c.push({attribute:n.taxonomy,operator:i,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(c,"attribute"))),c}},,function(e,t){e.exports=window.wp.blocks},,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return c}));var r=n(16);const o="query_type_",i="filter_";function c(e){return window?Object(r.getQueryArg)(window.location.href,e):null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return n.id&&e.push(n),e},[]),i=e=>{if(e)return o.find(t=>t.id===e)},c=e=>{if(e)return o.find(t=>t.taxonomy===e)}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),c=n.n(i);n(126),t.a=e=>{let{className:t,onChange:n=(()=>{}),options:i=[],checked:a=[],isLoading:s=!1,isDisabled:u=!1,limit:l=10}=e;const[d,p]=Object(r.useState)(!1),f=Object(r.useMemo)(()=>[...Array(5)].map((e,t)=>Object(r.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),b=Object(r.useMemo)(()=>{const e=i.length-l;return!d&&Object(r.createElement)("li",{key:"show-more",className:"show-more"},Object(r.createElement)("button",{onClick:()=>{p(!0)},"aria-expanded":!1,"aria-label":Object(o.sprintf)(
6
  /* translators: %s is referring the remaining count of options */
7
  Object(o._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(o.sprintf)(
8
  /* translators: %s number of options to reveal. */
9
- Object(o._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[i,l,d]),m=Object(r.useMemo)(()=>d&&Object(r.createElement)("li",{key:"show-less",className:"show-less"},Object(r.createElement)("button",{onClick:()=>{p(!1)},"aria-expanded":!0,"aria-label":Object(o.__)("Show less options","woo-gutenberg-products-block")},Object(o.__)("Show less","woo-gutenberg-products-block"))),[d]),g=Object(r.useMemo)(()=>{const e=i.length>l+5;return Object(r.createElement)(r.Fragment,null,i.map((t,o)=>Object(r.createElement)(r.Fragment,{key:t.value},Object(r.createElement)("li",e&&!d&&o>=l&&{hidden:!0},Object(r.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{n(e.target.value)},checked:a.includes(t.value),disabled:u}),Object(r.createElement)("label",{htmlFor:t.value},t.label)),e&&o===l-1&&b)),e&&m)},[i,n,a,d,l,m,b,u]),h=c()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":s},t);return Object(r.createElement)("ul",{className:h},s?f:g)}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(102);var r=n(44);const o=()=>r.m>1},,,,,,function(e,t){},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},function(e,t){},function(e,t){},,,,,,,,function(e,t,n){"use strict";e.exports=n(217)},,function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d}));var r=n(70),o=n(114),i=n(52),c=n(61);const a=e=>Object(i.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{},s=e=>{if(!Object(o.a)()||"function"!=typeof r.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(c.a)(e)?e:{},n=a(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:n})},u=e=>{const t=Object(c.a)(e)?e:{},n=a(t.style),r=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:t.fontFamily}}},l=e=>{if(!Object(o.a)())return{className:"",style:{}};const t=Object(c.a)(e)?e:{},n=a(t.style);return Object(r.__experimentalUseColorProps)({...t,style:n})},d=e=>{if(!Object(o.a)())return{className:"",style:{}};const t=Object(c.a)(e)?e:{},n=a(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),o=n(98),i=n(6),c=n(30),a=n(35),s=n(62),u=n(23);const l=e=>{let{queryAttribute:t,queryPrices:n,queryStock:l,queryState:d}=e,p=Object(u.a)();p+="-collection-data";const[f]=Object(a.a)(p),[b,m]=Object(a.b)("calculate_attribute_counts",[],p),[g,h]=Object(a.b)("calculate_price_range",null,p),[v,y]=Object(a.b)("calculate_stock_status_counts",null,p),O=Object(c.a)(t||{}),w=Object(c.a)(n),j=Object(c.a)(l);Object(r.useEffect)(()=>{"object"==typeof O&&Object.keys(O).length&&(b.find(e=>e.taxonomy===O.taxonomy)||m([...b,O]))},[O,b,m]),Object(r.useEffect)(()=>{g!==w&&void 0!==w&&h(w)},[w,h,g]),Object(r.useEffect)(()=>{v!==j&&void 0!==j&&y(j)},[j,y,v]);const[E,I]=Object(r.useState)(!1),[_]=Object(o.a)(E,200);E||I(!0);const S=Object(r.useMemo)(()=>(e=>{const t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(i.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(f),[f]);return Object(s.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...d,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...S},shouldSelect:_})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(14);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=i},,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),i=n(0),c=n(4),a=n.n(c),s=n(1),u=n(104),l=n(196);n(120);var d=e=>{let{text:t,screenReaderText:n="",element:r="li",className:c="",radius:s="small",children:u=null,...l}=e;const d=r,p=a()(c,"wc-block-components-chip","wc-block-components-chip--radius-"+s),f=Boolean(n&&n!==t);return Object(i.createElement)(d,o()({className:p},l),Object(i.createElement)("span",{"aria-hidden":f,className:"wc-block-components-chip__text"},t),f&&Object(i.createElement)("span",{className:"screen-reader-text"},n),u)};t.a=e=>{let{ariaLabel:t="",className:n="",disabled:r=!1,onRemove:c=(()=>{}),removeOnAnyClick:p=!1,text:f,screenReaderText:b="",...m}=e;const g=p?"span":"button";if(!t){const e=b&&"string"==typeof b?b:f;t="string"!=typeof e?
10
  /* translators: Remove chip. */
11
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
12
  /* translators: %s text of the chip to remove. */
@@ -14,16 +14,16 @@ Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const h={"aria-lab
14
  /* translators: %s is referring to the filter option being removed. */
15
  Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)}))},oe=n(200),ie=e=>{let{onRemoveItem:t,option:n}=e;return Object(o.createElement)(oe.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:()=>{t(n.value)},ariaLabel:Object(i.sprintf)(
16
  /* translators: %s is referring to the filter option being removed. */
17
- Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n.name),text:n.label,radius:"large"})},ce=n(104),ae=n(196),se=e=>{let{onClick:t,onRemoveItem:n,option:r}=e;const c=Object(o.useRef)(null);return Object(o.useEffect)(()=>{c.current.focus()},[c]),Object(o.createElement)("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},Object(o.createElement)("button",{ref:c,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:e=>{e.stopPropagation(),t(r.value)},"aria-label":Object(i.sprintf)(
18
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
19
  Object(i.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)},r.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:()=>{n(r.value)},onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(i.sprintf)(
20
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
21
  Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},Object(o.createElement)(ce.a,{icon:ae.a,size:16})))};n(216);var ue=e=>{let{attributeLabel:t="",className:n,style:r={},checked:c=[],inputLabel:a="",isDisabled:s=!1,isLoading:u=!1,multiple:l=!1,onChange:d=(()=>{}),options:p=[],isCaseSensitive:f=!1}=e;const m=Object(o.useRef)(null),g=b()(n,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":s,"is-loading":u}),h=Object(o.useCallback)((e,t)=>{switch(t.type){case Z.stateChangeTypes.keyDownEnter:case Z.stateChangeTypes.clickItem:return{...t,highlightedIndex:e.highlightedIndex,isOpen:l,inputValue:""};case Z.stateChangeTypes.blurInput:case Z.stateChangeTypes.mouseUp:return{...t,inputValue:e.inputValue};default:return t}},[l]);return Object(o.createElement)(Z,{onChange:d,selectedItem:null,stateReducer:h},e=>{let{getInputProps:n,getItemProps:u,getLabelProps:h,getMenuProps:v,highlightedIndex:y,inputValue:O,isOpen:w,openMenu:j}=e;return Object(o.createElement)("div",{className:b()(g,{"is-multiple":l,"is-single":!l,"has-checked":c.length>0,"is-open":w}),style:r},Object(o.createElement)("label",h({className:"screen-reader-text"}),a),Object(o.createElement)(ne,{isOpen:w,onClick:()=>m.current.focus()},c.map(e=>{const t=p.find(t=>t.value===e);if(!t)return null;const n=e=>{d(e),m.current.focus()};return l?Object(o.createElement)(ie,{key:e,onRemoveItem:n,option:t}):Object(o.createElement)(se,{key:e,onClick:()=>m.current.focus(),onRemoveItem:n,option:t})}),Object(o.createElement)(te,{checked:c,getInputProps:n,inputRef:m,isDisabled:s,onFocus:j,onRemoveItem:e=>{d(e),m.current.focus()},placeholder:c.length>0&&l?null:Object(i.sprintf)(
22
  /* translators: %s attribute name. */
23
- Object(i.__)("Any %s","woo-gutenberg-products-block"),t),tabIndex:!l&&c.length>0?"-1":"0",value:O})),w&&!s&&Object(o.createElement)(re,{checked:c,getItemProps:u,getMenuProps:v,highlightedIndex:y,options:p.filter(e=>{let t=e.name,n=null==O?void 0:O.trim();var r;return f||(t=t.toLowerCase(),n=null===(r=n)||void 0===r?void 0:r.toLowerCase()),!n||t.includes(n)})}))})},le=n(49),de=n(74),pe=n(12),fe=n.n(pe),be=n(18),me=n(99),ge=n(2),he=n(16),ve=n(124),ye=n(52),Oe=n(109),we=n(110),je=n(100);const Ee=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(le.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(le.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(le.a,{name:"Red",count:2})}],Ie={id:0,name:"preview",taxonomy:"preview",label:"Preview"};var _e=n(136);n(215);const Se=e=>e.replace("pa_",""),ke=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:o}=e,i=Se(t),c=r.join(","),a=`${Oe.b}${i}`,s="in"===o?"or":"and";n[`${Oe.a}${i}`]=c,n[a]=s});const r=Object(he.removeQueryArgs)(e,...Object.keys(n));return Object(he.addQueryArgs)(r,n)},xe=(e,t)=>{if(e&&t){const e=Object(Oe.c)("filter_"+t.name);return"string"==typeof e?e.split(","):[]}return[]},Ce=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,o]=n;return e[r]===o&&t},!0)};Object(r.a)({selector:".wp-block-woocommerce-attribute-filter",Block:e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(ge.getSettingWithCoercion)("is_rendering_php_template",!1,ve.a),f=Object(ge.getSettingWithCoercion)("page_url",window.location.href,ye.a),[m,g]=Object(o.useState)(!1),h=t.isPreview&&!t.attributeId?Ie:Object(we.a)(t.attributeId),[v,y]=Object(o.useState)(xe(r,h)),[O,w]=Object(o.useState)(t.isPreview&&!t.attributeId?Ee:[]),j=Object(_e.a)(t),[E]=Object(u.a)(),[I,_]=Object(u.b)("attributes",[]),{results:S,isLoading:k}=Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==h?void 0:h.id)||0],shouldSelect:t.attributeId>0}),x="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:C,isLoading:P}=Object(d.a)({queryAttribute:{taxonomy:null==h?void 0:h.taxonomy,queryType:t.queryType},queryState:{...E,attributes:x?E.attributes:null}}),R=Object(o.useCallback)(e=>C.attribute_counts?C.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[C]);Object(o.useEffect)(()=>{if(k||P)return;const e=S.map(e=>{const n=R(e.id);if(!(n||v.includes(e.slug)||(r=e.slug,null!=E&&E.attributes&&E.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===h.taxonomy&&n.includes(r)}))))return null;var r;const i=n?n.count:0;return{value:e.slug,name:Object(be.decodeEntities)(e.name),label:Object(o.createElement)(le.a,{name:Object(be.decodeEntities)(e.name),count:t.showCounts?i:null})}}).filter(Boolean);w(e)},[null==h?void 0:h.taxonomy,S,k,t.showCounts,P,R,v,E.attributes]);const T=Object(o.useCallback)(e=>S.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]),[S]),A=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){const t=Object.keys(Object(he.getQueryArgs)(window.location.href)),n=Se(null==h?void 0:h.taxonomy),r=t.reduce((e,t)=>t.includes(Oe.b+n)||t.includes(Oe.a+n)?Object(he.removeQueryArgs)(e,t):e,window.location.href),o=ke(r,e);window.location.href=o}else{const t=ke(f,e),n=Object(he.getQueryArgs)(window.location.href),r=Object(he.getQueryArgs)(t);Ce(n,r)||(window.location.href=t)}}),[f,null==h?void 0:h.taxonomy]),M=Object(o.useCallback)(e=>{if(n)return;const o=Object(je.b)(I,_,h,T(e),"or"===t.queryType?"in":"and");r&&m&&A(o,0===e.length)},[m,r,A,n,I,_,h,T,t.queryType]),D=Object(o.useMemo)(()=>I.filter(e=>{let{attribute:t}=e;return t===(null==h?void 0:h.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}),[I,null==h?void 0:h.taxonomy]),N=Object(a.a)(D),H=Object(s.a)(N);Object(o.useEffect)(()=>{fe()(H,N)||fe()(v,N)||(y(N),t.showFilterButton||M(N))},[v,N,H,M,t.showFilterButton]);const B="dropdown"!==t.displayStyle||"or"===t.queryType,L=Object(o.useCallback)(e=>{const n=e=>{const{name:t}=O.find(t=>t.value===e);return t},r=e=>{let{filterAdded:t,filterRemoved:r}=e;const o=t?n(t):null,a=r?n(r):null;o&&a?Object(c.speak)(Object(i.sprintf)(
24
  /* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
25
  Object(i.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o,a)):o?Object(c.speak)(Object(i.sprintf)(
26
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
27
  Object(i.__)("%s filter added.","woo-gutenberg-products-block"),o)):a&&Object(c.speak)(Object(i.sprintf)(
28
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
29
- Object(i.__)("%s filter removed.","woo-gutenberg-products-block"),a))},o=v.includes(e);let a;B?(a=v.filter(t=>t!==e),o?r({filterRemoved:e}):(a.push(e),a.sort(),r({filterAdded:e}))):(a=o?[]:[e],r({filterAdded:o?null:e,filterRemoved:1===v.length?v[0]:null})),y(a),t.showFilterButton||M(a)},[v,O,B,M,t.showFilterButton]);if(Object(o.useEffect)(()=>{r&&h&&((e=>{let{currentCheckedFilters:t,hasSetPhpFilterDefaults:n}=e;return n&&0===t.length})({currentCheckedFilters:v,hasSetPhpFilterDefaults:m})&&(t.showFilterButton||(y([]),A(I,!0))),t.showFilterButton||(y(v),A(I,!1)))},[m,A,r,I,h,v,t.showFilterButton]),Object(o.useEffect)(()=>{if(r){const e=xe(r,h);e.length>0&&!m&&!k&&(g(!0),Object(je.b)(I,_,h,T(e),"or"===t.queryType?"in":"and"))}},[I,_,h,t.queryType,T,r,m,k]),!h)return n?Object(o.createElement)(me.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(i.__)("Please select an attribute to use this filter!","woo-gutenberg-products-block"))):null;if(0===O.length&&!k)return n?Object(o.createElement)(me.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(i.__)("The selected attribute does not have any term assigned to products.","woo-gutenberg-products-block"))):null;const F="h"+t.headingLevel,V=!t.isPreview&&k,K=!t.isPreview&&P;return Object(o.createElement)(o.Fragment,null,!n&&t.heading&&O.length>0&&Object(o.createElement)(F,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-"+t.displayStyle},"dropdown"===t.displayStyle?Object(o.createElement)(ue,{attributeLabel:h.label,checked:v,className:b()("wc-block-attribute-filter-dropdown",j.className),style:{...j.style,borderStyle:"none"},inputLabel:t.heading,isLoading:V,multiple:B,onChange:L,options:O}):Object(o.createElement)(p.a,{className:"wc-block-attribute-filter-list",options:O,checked:v,onChange:L,isLoading:V,isDisabled:K}),t.showFilterButton&&Object(o.createElement)(de.a,{className:"wc-block-attribute-filter__button",disabled:V||K,onClick:()=>M(v)})))},getProps:e=>({isEditor:!1,attributes:{attributeId:parseInt(e.dataset.attributeId||0,10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,displayStyle:e.dataset.displayStyle,showFilterButton:"true"===e.dataset.showFilterButton}})})}]);
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=214)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(218)()},,function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},,function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(19),o=n.n(r),i=n(0),c=n(3),a=n(1),s=n(44),u=e=>{let{imageUrl:t=s.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:c=Object(a.__)("Error:","woo-gutenberg-products-block"),button:u,showErrorBlock:l=!0}=e;return l?Object(i.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(i.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(i.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(i.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(i.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(i.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},c?c+" ":"",o),u&&Object(i.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u))):null};n(33);class l extends c.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(i.createElement)(i.Fragment,null,Object(i.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:c,renderError:a,button:s}=this.props,{errorMessage:l,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:l}):Object(i.createElement)(u,{showErrorBlock:r,errorMessage:n?l:null,header:e,imageUrl:t,text:o,errorMessagePrefix:c,button:s}):this.props.children}}t.a=l},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.a11y},,function(e,t,n){"use strict";var r=n(0),o=n(4),i=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:c,wrapperProps:a={}}=e;const s=null!=n,u=null!=o;return!s&&u?(t=c||"span",a={...a,className:i()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=c||r.Fragment,s&&u&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);const o=Object(r.createContext)("page"),i=()=>Object(r.useContext)(o);o.Provider},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=n(12),i=n.n(o);function c(e){const t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(5),o=n(7),i=n(0),c=n(12),a=n.n(c),s=n(30),u=n(58),l=n(23);const d=e=>{const t=Object(l.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:c}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(i.useCallback)(t=>{c(e,t)},[e,c])]},p=(e,t,n)=>{const c=Object(l.a)();n=n||c;const a=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(i.useCallback)(t=>{s(n,e,t)},[n,e,s])]},f=(e,t)=>{const n=Object(l.a)();t=t||n;const[r,o]=d(t),c=Object(s.a)(r),p=Object(s.a)(e),f=Object(u.a)(p),b=Object(i.useRef)(!1);return Object(i.useEffect)(()=>{a()(f,p)||(o(Object.assign({},c,p)),b.current=!0)},[c,p,f,o]),b.current?[r,o]:[e,o]}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return c})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return v}));var r,o=n(2);const i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=i.pluginUrl+"images/",a=i.pluginUrl+"build/",s=i.buildPhase,u=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){var o=this,i=Object(r.useRef)(null),c=Object(r.useRef)(0),a=Object(r.useRef)(null),s=Object(r.useRef)([]),u=Object(r.useRef)(),l=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,g="maxWait"in n,h=g?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=s.current,n=u.current;return s.current=u.current=null,c.current=e,l.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(a.current),a.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-i.current,r=e-c.current;return!i.current||n>=t||n<0||g&&r>=h},v=function(t){return a.current=null,m&&s.current?e(t):(s.current=u.current=null,l.current)},y=function(){var e=Date.now();if(r(e))return v(e);if(p.current){var o=e-i.current,a=e-c.current,s=t-o,u=g?Math.min(s,h-a):s;n(y,u)}},O=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var m=Date.now(),h=r(m);if(s.current=d,u.current=o,i.current=m,h){if(!a.current&&p.current)return c.current=i.current,n(y,t),b?e(i.current):l.current;if(g)return n(y,t),e(i.current)}return a.current||n(y,t),l.current};return O.cancel=function(){a.current&&(f?cancelAnimationFrame(a.current):clearTimeout(a.current)),c.current=0,s.current=i.current=u.current=a.current=null},O.isPending=function(){return!!a.current},O.flush=function(){return a.current?v(Date.now()):l.current},O}),[b,g,t,h,m,f])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(11),o=n.n(r),i=n(0),c=n(16);const a=[".wp-block-woocommerce-cart"],s=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const s=r(e,n),u=a(e,n),l={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:s={}}=e;Object(i.render)(Object(i.createElement)(c.a,s,Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(i.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:l,errorBoundaryProps:u})})},u=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:i}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:i}=e;const c=document.body.querySelectorAll(o);i&&i.length>0&&Array.prototype.filter.call(c,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,i)),s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:i,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:i}=e;const c=i.querySelectorAll(o);s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(22);n(125),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,Number.isFinite(n)&&Object(r.createElement)(i.a,{label:n.toString(),screenReaderLabel:Object(o.sprintf)(
2
  /* translators: %s number of products. */
3
+ Object(o._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5),o=n(7),i=n(0),c=n(30),a=n(72);const s=e=>{const{namespace:t,resourceName:n,resourceValues:s=[],query:u={},shouldSelect:l=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(i.useRef)({results:[],isLoading:!0}),p=Object(c.a)(u),f=Object(c.a)(s),b=Object(a.a)(),m=Object(o.useSelect)(e=>{if(!l)return null;const o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,p,f],c=o.getCollectionError(...i);if(c){if(!(c instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(c)}return{results:o.getCollection(...i),isLoading:!o.hasFinishedResolution("getCollection",i)}},[t,n,f,p,l]);return null!==m&&(d.current=m),d.current}},,,,,,,,function(e,t){e.exports=window.wp.blockEditor},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),c=n.n(i),a=n(22);n(108),t.a=e=>{let{className:t,disabled:n,label:
4
  /* translators: Submit button text for filters. */
5
+ i=Object(o.__)("Go","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:u=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:c()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:s},Object(r.createElement)(a.a,{label:i,screenReaderLabel:u}))}},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return c}));var r=n(14);const o="query_type_",i="filter_";function c(e){return window?Object(r.getQueryArg)(window.location.href,e):null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(47);function i(e,t){return e===t}function c(e){return"function"==typeof e?function(){return e}:e}function a(e,t,n){var a=n&&n.equalityFn||i,s=function(e){var t=Object(r.useState)(c(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(c(e))}),[])]}(e),u=s[0],l=s[1],d=Object(o.a)(Object(r.useCallback)((function(e){return l(e)}),[l]),t,n),p=Object(r.useRef)(e);return a(p.current,e)||(d(e),p.current=e),[u,d]}},function(e,t){e.exports=window.wp.components},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(6);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const i=e.filter(e=>e.attribute===n.taxonomy),c=i.length?i[0]:null;if(!(c&&c.slug&&Array.isArray(c.slug)&&c.slug.includes(o)))return;const a=c.slug.filter(e=>e!==o),s=e.filter(e=>e.attribute!==n.taxonomy);a.length>0&&(c.slug=a.sort(),s.push(c)),t(Object(r.sortBy)(s,"attribute"))},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const c=e.filter(e=>e.attribute!==n.taxonomy);return 0===o.length?t(c):(c.push({attribute:n.taxonomy,operator:i,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(c,"attribute"))),c}},,function(e,t){e.exports=window.wp.blocks},,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return n.id&&e.push(n),e},[]),i=e=>{if(e)return o.find(t=>t.id===e)},c=e=>{if(e)return o.find(t=>t.taxonomy===e)}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),c=n.n(i);n(126),t.a=e=>{let{className:t,onChange:n=(()=>{}),options:i=[],checked:a=[],isLoading:s=!1,isDisabled:u=!1,limit:l=10}=e;const[d,p]=Object(r.useState)(!1),f=Object(r.useMemo)(()=>[...Array(5)].map((e,t)=>Object(r.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),b=Object(r.useMemo)(()=>{const e=i.length-l;return!d&&Object(r.createElement)("li",{key:"show-more",className:"show-more"},Object(r.createElement)("button",{onClick:()=>{p(!0)},"aria-expanded":!1,"aria-label":Object(o.sprintf)(
6
  /* translators: %s is referring the remaining count of options */
7
  Object(o._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(o.sprintf)(
8
  /* translators: %s number of options to reveal. */
9
+ Object(o._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[i,l,d]),m=Object(r.useMemo)(()=>d&&Object(r.createElement)("li",{key:"show-less",className:"show-less"},Object(r.createElement)("button",{onClick:()=>{p(!1)},"aria-expanded":!0,"aria-label":Object(o.__)("Show less options","woo-gutenberg-products-block")},Object(o.__)("Show less","woo-gutenberg-products-block"))),[d]),g=Object(r.useMemo)(()=>{const e=i.length>l+5;return Object(r.createElement)(r.Fragment,null,i.map((t,o)=>Object(r.createElement)(r.Fragment,{key:t.value},Object(r.createElement)("li",e&&!d&&o>=l&&{hidden:!0},Object(r.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{n(e.target.value)},checked:a.includes(t.value),disabled:u}),Object(r.createElement)("label",{htmlFor:t.value},t.label)),e&&o===l-1&&b)),e&&m)},[i,n,a,d,l,m,b,u]),h=c()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":s},t);return Object(r.createElement)("ul",{className:h},s?f:g)}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(103);var r=n(44);const o=()=>r.m>1},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},,,function(e,t){},,,function(e,t){},function(e,t){},,,,,,,,function(e,t,n){"use strict";e.exports=n(217)},,function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d}));var r=n(70),o=n(114),i=n(52),c=n(61);const a=e=>Object(i.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{},s=e=>{if(!Object(o.a)()||"function"!=typeof r.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(c.a)(e)?e:{},n=a(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:n})},u=e=>{const t=Object(c.a)(e)?e:{},n=a(t.style),r=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:t.fontFamily}}},l=e=>{if(!Object(o.a)())return{className:"",style:{}};const t=Object(c.a)(e)?e:{},n=a(t.style);return Object(r.__experimentalUseColorProps)({...t,style:n})},d=e=>{if(!Object(o.a)())return{className:"",style:{}};const t=Object(c.a)(e)?e:{},n=a(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),o=n(99),i=n(6),c=n(30),a=n(35),s=n(62),u=n(23);const l=e=>{let{queryAttribute:t,queryPrices:n,queryStock:l,queryState:d}=e,p=Object(u.a)();p+="-collection-data";const[f]=Object(a.a)(p),[b,m]=Object(a.b)("calculate_attribute_counts",[],p),[g,h]=Object(a.b)("calculate_price_range",null,p),[v,y]=Object(a.b)("calculate_stock_status_counts",null,p),O=Object(c.a)(t||{}),w=Object(c.a)(n),j=Object(c.a)(l);Object(r.useEffect)(()=>{"object"==typeof O&&Object.keys(O).length&&(b.find(e=>e.taxonomy===O.taxonomy)||m([...b,O]))},[O,b,m]),Object(r.useEffect)(()=>{g!==w&&void 0!==w&&h(w)},[w,h,g]),Object(r.useEffect)(()=>{v!==j&&void 0!==j&&y(j)},[j,y,v]);const[E,I]=Object(r.useState)(!1),[_]=Object(o.a)(E,200);E||I(!0);const S=Object(r.useMemo)(()=>(e=>{const t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(i.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(f),[f]);return Object(s.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...d,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...S},shouldSelect:_})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(15);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=i},,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r),i=n(0),c=n(4),a=n.n(c),s=n(1),u=n(105),l=n(196);n(122);var d=e=>{let{text:t,screenReaderText:n="",element:r="li",className:c="",radius:s="small",children:u=null,...l}=e;const d=r,p=a()(c,"wc-block-components-chip","wc-block-components-chip--radius-"+s),f=Boolean(n&&n!==t);return Object(i.createElement)(d,o()({className:p},l),Object(i.createElement)("span",{"aria-hidden":f,className:"wc-block-components-chip__text"},t),f&&Object(i.createElement)("span",{className:"screen-reader-text"},n),u)};t.a=e=>{let{ariaLabel:t="",className:n="",disabled:r=!1,onRemove:c=(()=>{}),removeOnAnyClick:p=!1,text:f,screenReaderText:b="",...m}=e;const g=p?"span":"button";if(!t){const e=b&&"string"==typeof b?b:f;t="string"!=typeof e?
10
  /* translators: Remove chip. */
11
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
12
  /* translators: %s text of the chip to remove. */
14
  /* translators: %s is referring to the filter option being removed. */
15
  Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)}))},oe=n(200),ie=e=>{let{onRemoveItem:t,option:n}=e;return Object(o.createElement)(oe.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:()=>{t(n.value)},ariaLabel:Object(i.sprintf)(
16
  /* translators: %s is referring to the filter option being removed. */
17
+ Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n.name),text:n.label,radius:"large"})},ce=n(105),ae=n(196),se=e=>{let{onClick:t,onRemoveItem:n,option:r}=e;const c=Object(o.useRef)(null);return Object(o.useEffect)(()=>{c.current.focus()},[c]),Object(o.createElement)("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},Object(o.createElement)("button",{ref:c,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:e=>{e.stopPropagation(),t(r.value)},"aria-label":Object(i.sprintf)(
18
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
19
  Object(i.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)},r.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:()=>{n(r.value)},onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(i.sprintf)(
20
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
21
  Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},Object(o.createElement)(ce.a,{icon:ae.a,size:16})))};n(216);var ue=e=>{let{attributeLabel:t="",className:n,style:r={},checked:c=[],inputLabel:a="",isDisabled:s=!1,isLoading:u=!1,multiple:l=!1,onChange:d=(()=>{}),options:p=[],isCaseSensitive:f=!1}=e;const m=Object(o.useRef)(null),g=b()(n,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":s,"is-loading":u}),h=Object(o.useCallback)((e,t)=>{switch(t.type){case Z.stateChangeTypes.keyDownEnter:case Z.stateChangeTypes.clickItem:return{...t,highlightedIndex:e.highlightedIndex,isOpen:l,inputValue:""};case Z.stateChangeTypes.blurInput:case Z.stateChangeTypes.mouseUp:return{...t,inputValue:e.inputValue};default:return t}},[l]);return Object(o.createElement)(Z,{onChange:d,selectedItem:null,stateReducer:h},e=>{let{getInputProps:n,getItemProps:u,getLabelProps:h,getMenuProps:v,highlightedIndex:y,inputValue:O,isOpen:w,openMenu:j}=e;return Object(o.createElement)("div",{className:b()(g,{"is-multiple":l,"is-single":!l,"has-checked":c.length>0,"is-open":w}),style:r},Object(o.createElement)("label",h({className:"screen-reader-text"}),a),Object(o.createElement)(ne,{isOpen:w,onClick:()=>m.current.focus()},c.map(e=>{const t=p.find(t=>t.value===e);if(!t)return null;const n=e=>{d(e),m.current.focus()};return l?Object(o.createElement)(ie,{key:e,onRemoveItem:n,option:t}):Object(o.createElement)(se,{key:e,onClick:()=>m.current.focus(),onRemoveItem:n,option:t})}),Object(o.createElement)(te,{checked:c,getInputProps:n,inputRef:m,isDisabled:s,onFocus:j,onRemoveItem:e=>{d(e),m.current.focus()},placeholder:c.length>0&&l?null:Object(i.sprintf)(
22
  /* translators: %s attribute name. */
23
+ Object(i.__)("Any %s","woo-gutenberg-products-block"),t),tabIndex:!l&&c.length>0?"-1":"0",value:O})),w&&!s&&Object(o.createElement)(re,{checked:c,getItemProps:u,getMenuProps:v,highlightedIndex:y,options:p.filter(e=>{let t=e.name,n=null==O?void 0:O.trim();var r;return f||(t=t.toLowerCase(),n=null===(r=n)||void 0===r?void 0:r.toLowerCase()),!n||t.includes(n)})}))})},le=n(49),de=n(74),pe=n(12),fe=n.n(pe),be=n(18),me=n(100),ge=n(2),he=n(14),ve=n(119),ye=n(52),Oe=n(98),we=n(110),je=n(101);const Ee=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(le.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(le.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(le.a,{name:"Red",count:2})}],Ie={id:0,name:"preview",taxonomy:"preview",label:"Preview"};var _e=n(136);n(215);const Se=e=>e.replace("pa_",""),ke=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:o}=e,i=Se(t),c=r.join(","),a=`${Oe.b}${i}`,s="in"===o?"or":"and";n[`${Oe.a}${i}`]=c,n[a]=s});const r=Object(he.removeQueryArgs)(e,...Object.keys(n));return Object(he.addQueryArgs)(r,n)},xe=(e,t)=>{if(e&&t){const e=Object(Oe.c)("filter_"+t.name);return"string"==typeof e?e.split(","):[]}return[]},Ce=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,o]=n;return e[r]===o&&t},!0)};Object(r.a)({selector:".wp-block-woocommerce-attribute-filter",Block:e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(ge.getSettingWithCoercion)("has_filterable_products",!1,ve.a),f=Object(ge.getSettingWithCoercion)("is_rendering_php_template",!1,ve.a),m=Object(ge.getSettingWithCoercion)("page_url",window.location.href,ye.a),[g,h]=Object(o.useState)(!1),v=t.isPreview&&!t.attributeId?Ie:Object(we.a)(t.attributeId),[y,O]=Object(o.useState)(xe(f,v)),[w,j]=Object(o.useState)(t.isPreview&&!t.attributeId?Ee:[]),E=Object(_e.a)(t),[I]=Object(u.a)(),[_,S]=Object(u.b)("attributes",[]),{results:k,isLoading:x}=Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==v?void 0:v.id)||0],shouldSelect:t.attributeId>0}),C="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:P,isLoading:R}=Object(d.a)({queryAttribute:{taxonomy:null==v?void 0:v.taxonomy,queryType:t.queryType},queryState:{...I,attributes:C?I.attributes:null}}),T=Object(o.useCallback)(e=>P.attribute_counts?P.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[P]);Object(o.useEffect)(()=>{if(x||R)return;const e=k.map(e=>{const n=T(e.id);if(!(n||y.includes(e.slug)||(r=e.slug,null!=I&&I.attributes&&I.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===v.taxonomy&&n.includes(r)}))))return null;var r;const i=n?n.count:0;return{value:e.slug,name:Object(be.decodeEntities)(e.name),label:Object(o.createElement)(le.a,{name:Object(be.decodeEntities)(e.name),count:t.showCounts?i:null})}}).filter(Boolean);j(e)},[null==v?void 0:v.taxonomy,k,x,t.showCounts,R,T,y,I.attributes]);const A=Object(o.useCallback)(e=>k.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]),[k]),M=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){const t=Object.keys(Object(he.getQueryArgs)(window.location.href)),n=Se(null==v?void 0:v.taxonomy),r=t.reduce((e,t)=>t.includes(Oe.b+n)||t.includes(Oe.a+n)?Object(he.removeQueryArgs)(e,t):e,window.location.href),o=ke(r,e);window.location.href=o}else{const t=ke(m,e),n=Object(he.getQueryArgs)(window.location.href),r=Object(he.getQueryArgs)(t);Ce(n,r)||(window.location.href=t)}}),[m,null==v?void 0:v.taxonomy]),D=Object(o.useCallback)(e=>{n||(O(e),t.showFilterButton||Object(je.b)(_,S,v,A(e),"or"===t.queryType?"in":"and"))},[n,O,_,S,v,A,t.queryType,t.showFilterButton]),N=Object(o.useMemo)(()=>_.filter(e=>{let{attribute:t}=e;return t===(null==v?void 0:v.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}),[_,null==v?void 0:v.taxonomy]),H=Object(a.a)(N),B=Object(s.a)(H);Object(o.useEffect)(()=>{fe()(B,H)||fe()(y,H)||D(H)},[y,H,B,D]);const L="dropdown"!==t.displayStyle||"or"===t.queryType,F=Object(o.useCallback)(e=>{const t=e=>{const{name:t}=w.find(t=>t.value===e);return t},n=e=>{let{filterAdded:n,filterRemoved:r}=e;const o=n?t(n):null,a=r?t(r):null;o&&a?Object(c.speak)(Object(i.sprintf)(
24
  /* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
25
  Object(i.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o,a)):o?Object(c.speak)(Object(i.sprintf)(
26
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
27
  Object(i.__)("%s filter added.","woo-gutenberg-products-block"),o)):a&&Object(c.speak)(Object(i.sprintf)(
28
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
29
+ Object(i.__)("%s filter removed.","woo-gutenberg-products-block"),a))},r=y.includes(e);let o;L?(o=y.filter(t=>t!==e),r?n({filterRemoved:e}):(o.push(e),o.sort(),n({filterAdded:e}))):(o=r?[]:[e],n({filterAdded:r?null:e,filterRemoved:1===y.length?y[0]:null})),D(o)},[y,w,L,D]);if(Object(o.useEffect)(()=>{f&&v&&((e=>{let{currentCheckedFilters:t,hasSetPhpFilterDefaults:n}=e;return n&&0===t.length})({currentCheckedFilters:y,hasSetPhpFilterDefaults:g})&&(t.showFilterButton||(O([]),M(_,!0))),t.showFilterButton||(O(y),M(_,!1)))},[g,M,f,_,v,y,t.showFilterButton]),Object(o.useEffect)(()=>{if(f){const e=xe(f,v);e.length>0&&!g&&!x&&(h(!0),D(e))}},[v,f,g,x,D]),!r)return null;if(!v)return n?Object(o.createElement)(me.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(i.__)("Please select an attribute to use this filter!","woo-gutenberg-products-block"))):null;if(0===w.length&&!x)return n?Object(o.createElement)(me.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(i.__)("The selected attribute does not have any term assigned to products.","woo-gutenberg-products-block"))):null;const V="h"+t.headingLevel,K=!t.isPreview&&x,q=!t.isPreview&&R;return Object(o.createElement)(o.Fragment,null,!n&&t.heading&&w.length>0&&Object(o.createElement)(V,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-"+t.displayStyle},"dropdown"===t.displayStyle?Object(o.createElement)(ue,{attributeLabel:v.label,checked:y,className:b()("wc-block-attribute-filter-dropdown",E.className),style:{...E.style,borderStyle:"none"},inputLabel:t.heading,isLoading:K,multiple:L,onChange:F,options:w}):Object(o.createElement)(p.a,{className:"wc-block-attribute-filter-list",options:w,checked:y,onChange:F,isLoading:K,isDisabled:q}),t.showFilterButton&&Object(o.createElement)(de.a,{className:"wc-block-attribute-filter__button",disabled:K||q,onClick:()=>(e=>{const n=Object(je.b)(_,S,v,A(e),"or"===t.queryType?"in":"and");f&&M(n,0===e.length)})(y)})))},getProps:e=>({isEditor:!1,attributes:{attributeId:parseInt(e.dataset.attributeId||0,10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,displayStyle:e.dataset.displayStyle,showFilterButton:"true"===e.dataset.showFilterButton}})})}]);
build/attribute-filter.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '4ca2e2bf527ce84f75a28ef3400c7a2b');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f58a90c77c1469fc40cc85f266e400a9');
build/attribute-filter.js CHANGED
@@ -1,12 +1,12 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var n,l,a=t[0],s=t[1],i=t[2],b=0,d=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&d.push(r[l][0]),r[l]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,i||[]),c()}function c(){for(var e,t=0;t<o.length;t++){for(var c=o[t],n=!0,a=1;a<c.length;a++){var s=c[a];0!==r[s]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=c[0]))}return e}var n={},r={9:0,1:0,2:0},o=[];function l(t){if(n[t])return n[t].exports;var c=n[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=e,l.c=n,l.d=function(e,t,c){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(l.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(c,n,function(t){return e[t]}.bind(null,n));return c},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([403,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},104:function(e,t,c){"use strict";var n=c(0),r=c(1),o=c(30);c(233),t.a=e=>{let{name:t,count:c}=e;return Object(n.createElement)(n.Fragment,null,t,Number.isFinite(c)&&Object(n.createElement)(o.a,{label:c.toString(),screenReaderLabel:Object(r.sprintf)(
2
  /* translators: %s number of products. */
3
- Object(r._n)("%s product","%s products",c,"woo-gutenberg-products-block"),c),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},106:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(8);function r(e,t){const c=Object(n.useRef)();return Object(n.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},118:function(e,t,c){"use strict";var n=c(0),r=c(5),o=c(10),l=c(1);c(153),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:c,onChange:o,heading:a,instanceId:s}=e;const i="h"+c;return Object(n.createElement)(i,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(r.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},119:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},12:function(e,t){e.exports=window.wp.primitives},121:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(0);const r=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},122:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(18),r=c(9),o=c(0),l=c(48),a=c(121);const s=e=>{const{namespace:t,resourceName:c,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),d=Object(l.a)(i),m=Object(l.a)(s),p=Object(a.a)(),g=Object(r.useSelect)(e=>{if(!u)return null;const r=e(n.COLLECTIONS_STORE_KEY),o=[t,c,d,m],l=r.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(l)}return{results:r.getCollection(...o),isLoading:!r.hasFinishedResolution("getCollection",o)}},[t,c,m,d,u]);return null!==g&&(b.current=g),b.current}},13:function(e,t){e.exports=window.wp.blocks},14:function(e,t){e.exports=window.wp.htmlEntities},142:function(e,t,c){"use strict";var n=c(0),r=c(1),o=c(4),l=c.n(o),a=c(30);c(182),t.a=e=>{let{className:t,disabled:c,label:
4
  /* translators: Submit button text for filters. */
5
- o=Object(r.__)("Go","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:i=Object(r.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(n.createElement)("button",{type:"submit",className:l()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:c,onClick:s},Object(n.createElement)(a.a,{label:o,screenReaderLabel:i}))}},153:function(e,t){},154:function(e,t){},166:function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));var n=c(7);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===c.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(r)))return;const a=l.slug.filter(e=>e!==r),s=e.filter(e=>e.attribute!==c.taxonomy);a.length>0&&(l.slug=a.sort(),s.push(l)),t(Object(n.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const l=e.filter(e=>e.attribute!==c.taxonomy);return 0===r.length?t(l):(l.push({attribute:c.taxonomy,operator:o,slug:r.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(l,"attribute"))),l}},17:function(e,t){e.exports=window.wp.url},18:function(e,t){e.exports=window.wc.wcBlocksData},182:function(e,t){},191:function(e,t,c){"use strict";c.d(t,"b",(function(){return r})),c.d(t,"a",(function(){return o})),c.d(t,"c",(function(){return l}));var n=c(17);const r="query_type_",o="filter_";function l(e){return window?Object(n.getQueryArg)(window.location.href,e):null}},192:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var n=c(2);const r=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const c=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return c.id&&e.push(c),e},[]),o=e=>{if(e)return r.find(t=>t.id===e)},l=e=>{if(e)return r.find(t=>t.taxonomy===e)}},193:function(e,t,c){"use strict";var n=c(0),r=c(1),o=c(4),l=c.n(o);c(234),t.a=e=>{let{className:t,onChange:c=(()=>{}),options:o=[],checked:a=[],isLoading:s=!1,isDisabled:i=!1,limit:u=10}=e;const[b,d]=Object(n.useState)(!1),m=Object(n.useMemo)(()=>[...Array(5)].map((e,t)=>Object(n.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),p=Object(n.useMemo)(()=>{const e=o.length-u;return!b&&Object(n.createElement)("li",{key:"show-more",className:"show-more"},Object(n.createElement)("button",{onClick:()=>{d(!0)},"aria-expanded":!1,"aria-label":Object(r.sprintf)(
6
  /* translators: %s is referring the remaining count of options */
7
  Object(r._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(r.sprintf)(
8
  /* translators: %s number of options to reveal. */
9
- Object(r._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[o,u,b]),g=Object(n.useMemo)(()=>b&&Object(n.createElement)("li",{key:"show-less",className:"show-less"},Object(n.createElement)("button",{onClick:()=>{d(!1)},"aria-expanded":!0,"aria-label":Object(r.__)("Show less options","woo-gutenberg-products-block")},Object(r.__)("Show less","woo-gutenberg-products-block"))),[b]),O=Object(n.useMemo)(()=>{const e=o.length>u+5;return Object(n.createElement)(n.Fragment,null,o.map((t,r)=>Object(n.createElement)(n.Fragment,{key:t.value},Object(n.createElement)("li",e&&!b&&r>=u&&{hidden:!0},Object(n.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{c(e.target.value)},checked:a.includes(t.value),disabled:i}),Object(n.createElement)("label",{htmlFor:t.value},t.label)),e&&r===u-1&&p)),e&&g)},[o,c,a,b,u,g,p,i]),j=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":s},t);return Object(n.createElement)("ul",{className:j},s?m:O)}},2:function(e,t){e.exports=window.wc.wcSettings},202:function(e,t,c){"use strict";var n=c(6),r=c.n(n),o=c(0),l=c(4),a=c.n(l),s=c(1),i=c(110),u=c(536);c(154);var b=e=>{let{text:t,screenReaderText:c="",element:n="li",className:l="",radius:s="small",children:i=null,...u}=e;const b=n,d=a()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+s),m=Boolean(c&&c!==t);return Object(o.createElement)(b,r()({className:d},u),Object(o.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(o.createElement)("span",{className:"screen-reader-text"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:n=!1,onRemove:l=(()=>{}),removeOnAnyClick:d=!1,text:m,screenReaderText:p="",...g}=e;const O=d?"span":"button";if(!t){const e=p&&"string"==typeof p?p:m;t="string"!=typeof e?
10
  /* translators: Remove chip. */
11
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
12
  /* translators: %s text of the chip to remove. */
@@ -14,27 +14,27 @@ Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const j={"aria-lab
14
  /* Translators: %s search term */
15
  noResults:Object(o.__)("No results for %s","woo-gutenberg-products-block"),search:Object(o.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(o.sprintf)(
16
  /* translators: Number of items selected from list. */
17
- Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(r.groupBy)(e,"parent"),n=Object(r.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(n[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(n[e.parent]),children:t&&t.length?a(t):[]}}),s=a(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||s.push(...a(c||[]))}),s},s=(e,t,c)=>{if(!t)return c?a(e):e;const n=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map(e=>!!n.test(e.name)&&e).filter(Boolean);return c?a(r,e):r},i=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(n.createElement)(n.Fragment,{key:c},Object(n.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},233:function(e,t){},234:function(e,t){},24:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return a})),c.d(t,"n",(function(){return s})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return m})),c.d(t,"c",(function(){return p})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return f}));var n,r=c(2);const o=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",s=o.buildPhase,i=null===(n=r.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=r.STORE_PAGES.checkout.id,b=r.STORE_PAGES.checkout.permalink,d=r.STORE_PAGES.privacy.permalink,m=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),p=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),g=r.STORE_PAGES.cart.permalink,O=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("shippingCountries",{})),j=Object(r.getSetting)("allowedCountries",{}),h=Object(r.getSetting)("shippingStates",{}),f=Object(r.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},282:function(e,t,c){"use strict";c.d(t,"a",(function(){return u}));var n=c(0),r=c(262),o=c(7),l=c(48),a=c(76),s=c(122),i=c(49);const u=e=>{let{queryAttribute:t,queryPrices:c,queryStock:u,queryState:b}=e,d=Object(i.a)();d+="-collection-data";const[m]=Object(a.a)(d),[p,g]=Object(a.b)("calculate_attribute_counts",[],d),[O,j]=Object(a.b)("calculate_price_range",null,d),[h,f]=Object(a.b)("calculate_stock_status_counts",null,d),w=Object(l.a)(t||{}),_=Object(l.a)(c),v=Object(l.a)(u);Object(n.useEffect)(()=>{"object"==typeof w&&Object.keys(w).length&&(p.find(e=>e.taxonomy===w.taxonomy)||g([...p,w]))},[w,p,g]),Object(n.useEffect)(()=>{O!==_&&void 0!==_&&j(_)},[_,j,O]),Object(n.useEffect)(()=>{h!==v&&void 0!==v&&f(v)},[v,f,h]);const[y,k]=Object(n.useState)(!1),[E]=Object(r.a)(y,200);y||k(!0);const S=Object(n.useMemo)(()=>(e=>{const t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:c}=e;return{taxonomy:t,query_type:c}}),["taxonomy","query_type"])),t})(m),[m]);return Object(s.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...b,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...S},shouldSelect:E})}},283:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},3:function(e,t){e.exports=window.wp.components},30:function(e,t,c){"use strict";var n=c(0),r=c(4),o=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=c,i=null!=r;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,r)):(t=l||n.Fragment,s&&i&&c!==r?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},r)):Object(n.createElement)(t,a,c))}},34:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var n=c(6),r=c.n(n),o=c(0),l=c(21);const a=e=>{let{countLabel:t,className:c,depth:n=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...m}=e;const p=null!=t&&void 0!==s.count&&null!==s.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+n),u&&g.push("is-radio-button"),p&&g.push("has-count");const O=s.breadcrumbs&&s.breadcrumbs.length,j=m.name||"search-list-item-"+a,h=`${j}-${s.id}`;return Object(o.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(o.createElement)("input",r()({type:"radio",id:h,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",r()({type:"checkbox",id:h,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!p&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},403:function(e,t,c){e.exports=c(473)},404:function(e,t){},405:function(e,t){},406:function(e,t){},43:function(e,t,c){"use strict";c.d(t,"c",(function(){return i})),c.d(t,"d",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"a",(function(){return d}));var n=c(5),r=c(71),o=c(119),l=c(57),a=c(91);const s=e=>Object(o.a)(e)?JSON.parse(e)||{}:Object(l.a)(e)?e:{},i=e=>{if(!Object(r.b)()||!Object(a.a)())return{style:{}};const t=Object(l.a)(e)?e:{},c=s(t.style);return Object(n.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},u=e=>{const t=Object(l.a)(e)?e:{},c=s(t.style),n=Object(l.a)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:n.fontSize,lineHeight:n.lineHeight,fontWeight:n.fontWeight,textTransform:n.textTransform,fontFamily:t.fontFamily}}},b=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(l.a)(e)?e:{},c=s(t.style);return Object(n.__experimentalUseColorProps)({...t,style:c})},d=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(l.a)(e)?e:{},c=s(t.style);return Object(n.__experimentalUseBorderProps)({...t,style:c})}},44:function(e,t){e.exports=window.wp.a11y},473:function(e,t,c){"use strict";c.r(t);var n=c(6),r=c.n(n),o=c(0),l=c(1),a=c(13),s=c(5),i=c(71),u=c(110),b=c(520),d=c(4),m=c.n(d),p=c(220),g=c(96),O=c(7),j=c(2),h=c(99),f=c(118),w=c(3),_=c(44),v=c(48),y=c(106),k=c(76),E=c(122),S=c(282),C=c(193),x=c(169),N=e=>{let{checked:t,getInputProps:c,inputRef:n,isDisabled:r,onFocus:l,onRemoveItem:a,placeholder:s,tabIndex:i,value:u}=e;return Object(o.createElement)("input",c({ref:n,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:r,onFocus:l,onKeyDown(e){"Backspace"===e.key&&!u&&t.length>0&&a(t[t.length-1])},placeholder:s,tabIndex:i}))},P=e=>{let{children:t,onClick:c}=e;return Object(o.createElement)("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:c},t)},T=e=>{let{checked:t,getItemProps:c,getMenuProps:n,highlightedIndex:r,options:a}=e;return Object(o.createElement)("ul",n({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),a.map((e,n)=>{const a=t.includes(e.value);return Object(o.createElement)("li",c({key:e.value,className:m()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":a,"is-highlighted":r===n}),index:n,item:e.value,"aria-label":a?Object(l.sprintf)(
18
  /* translators: %s is referring to the filter option being removed. */
19
  Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)}))},R=c(202),I=e=>{let{onRemoveItem:t,option:c}=e;return Object(o.createElement)(R.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:()=>{t(c.value)},ariaLabel:Object(l.sprintf)(
20
  /* translators: %s is referring to the filter option being removed. */
21
- Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),c.name),text:c.label,radius:"large"})},A=c(536),L=e=>{let{onClick:t,onRemoveItem:c,option:n}=e;const r=Object(o.useRef)(null);return Object(o.useEffect)(()=>{r.current.focus()},[r]),Object(o.createElement)("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},Object(o.createElement)("button",{ref:r,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:e=>{e.stopPropagation(),t(n.value)},"aria-label":Object(l.sprintf)(
22
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
23
  Object(l.__)("Replace current %s filter","woo-gutenberg-products-block"),n.name)},n.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:()=>{c(n.value)},onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||c(n.value)},"aria-label":Object(l.sprintf)(
24
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
25
- Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),n.name)},Object(o.createElement)(u.a,{icon:A.a,size:16})))};c(406);var B=e=>{let{attributeLabel:t="",className:c,style:n={},checked:r=[],inputLabel:a="",isDisabled:s=!1,isLoading:i=!1,multiple:u=!1,onChange:b=(()=>{}),options:d=[],isCaseSensitive:p=!1}=e;const g=Object(o.useRef)(null),O=m()(c,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":s,"is-loading":i}),j=Object(o.useCallback)((e,t)=>{switch(t.type){case x.a.stateChangeTypes.keyDownEnter:case x.a.stateChangeTypes.clickItem:return{...t,highlightedIndex:e.highlightedIndex,isOpen:u,inputValue:""};case x.a.stateChangeTypes.blurInput:case x.a.stateChangeTypes.mouseUp:return{...t,inputValue:e.inputValue};default:return t}},[u]);return Object(o.createElement)(x.a,{onChange:b,selectedItem:null,stateReducer:j},e=>{let{getInputProps:c,getItemProps:i,getLabelProps:j,getMenuProps:h,highlightedIndex:f,inputValue:w,isOpen:_,openMenu:v}=e;return Object(o.createElement)("div",{className:m()(O,{"is-multiple":u,"is-single":!u,"has-checked":r.length>0,"is-open":_}),style:n},Object(o.createElement)("label",j({className:"screen-reader-text"}),a),Object(o.createElement)(P,{isOpen:_,onClick:()=>g.current.focus()},r.map(e=>{const t=d.find(t=>t.value===e);if(!t)return null;const c=e=>{b(e),g.current.focus()};return u?Object(o.createElement)(I,{key:e,onRemoveItem:c,option:t}):Object(o.createElement)(L,{key:e,onClick:()=>g.current.focus(),onRemoveItem:c,option:t})}),Object(o.createElement)(N,{checked:r,getInputProps:c,inputRef:g,isDisabled:s,onFocus:v,onRemoveItem:e=>{b(e),g.current.focus()},placeholder:r.length>0&&u?null:Object(l.sprintf)(
26
  /* translators: %s attribute name. */
27
- Object(l.__)("Any %s","woo-gutenberg-products-block"),t),tabIndex:!u&&r.length>0?"-1":"0",value:w})),_&&!s&&Object(o.createElement)(T,{checked:r,getItemProps:i,getMenuProps:h,highlightedIndex:f,options:d.filter(e=>{let t=e.name,c=null==w?void 0:w.trim();var n;return p||(t=t.toLowerCase(),c=null===(n=c)||void 0===n?void 0:n.toLowerCase()),!c||t.includes(c)})}))})},F=c(104),M=c(142),V=c(25),q=c.n(V),H=c(14),D=c(17),G=c(283),z=c(119),Q=c(191),$=c(192),U=c(166);const Y=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(F.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(F.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(F.a,{name:"Red",count:2})}],K={id:0,name:"preview",taxonomy:"preview",label:"Preview"};var W=c(43);c(405);const J=e=>e.replace("pa_",""),X=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const c={};t.forEach(e=>{const{attribute:t,slug:n,operator:r}=e,o=J(t),l=n.join(","),a=`${Q.b}${o}`,s="in"===r?"or":"and";c[`${Q.a}${o}`]=l,c[a]=s});const n=Object(D.removeQueryArgs)(e,...Object.keys(c));return Object(D.addQueryArgs)(n,c)},Z=(e,t)=>{if(e&&t){const e=Object(Q.c)("filter_"+t.name);return"string"==typeof e?e.split(","):[]}return[]},ee=(e,t)=>{const c=Object.entries(t).reduce((e,t)=>{let[c,n]=t;return c.includes("query_type")?e:{...e,[c]:n}},{});return Object.entries(c).reduce((t,c)=>{let[n,r]=c;return e[n]===r&&t},!0)};var te=e=>{let{attributes:t,isEditor:c=!1}=e;const n=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,G.a),r=Object(j.getSettingWithCoercion)("page_url",window.location.href,z.a),[a,s]=Object(o.useState)(!1),i=t.isPreview&&!t.attributeId?K:Object($.a)(t.attributeId),[u,b]=Object(o.useState)(Z(n,i)),[d,p]=Object(o.useState)(t.isPreview&&!t.attributeId?Y:[]),g=Object(W.a)(t),[O]=Object(k.a)(),[h,f]=Object(k.b)("attributes",[]),{results:x,isLoading:N}=Object(E.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==i?void 0:i.id)||0],shouldSelect:t.attributeId>0}),P="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:T,isLoading:R}=Object(S.a)({queryAttribute:{taxonomy:null==i?void 0:i.taxonomy,queryType:t.queryType},queryState:{...O,attributes:P?O.attributes:null}}),I=Object(o.useCallback)(e=>T.attribute_counts?T.attribute_counts.find(t=>{let{term:c}=t;return c===e}):null,[T]);Object(o.useEffect)(()=>{if(N||R)return;const e=x.map(e=>{const c=I(e.id);if(!(c||u.includes(e.slug)||(n=e.slug,null!=O&&O.attributes&&O.attributes.some(e=>{let{attribute:t,slug:c=[]}=e;return t===i.taxonomy&&c.includes(n)}))))return null;var n;const r=c?c.count:0;return{value:e.slug,name:Object(H.decodeEntities)(e.name),label:Object(o.createElement)(F.a,{name:Object(H.decodeEntities)(e.name),count:t.showCounts?r:null})}}).filter(Boolean);p(e)},[null==i?void 0:i.taxonomy,x,N,t.showCounts,R,I,u,O.attributes]);const A=Object(o.useCallback)(e=>x.reduce((t,c)=>(e.includes(c.slug)&&t.push(c),t),[]),[x]),L=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){const t=Object.keys(Object(D.getQueryArgs)(window.location.href)),c=J(null==i?void 0:i.taxonomy),n=t.reduce((e,t)=>t.includes(Q.b+c)||t.includes(Q.a+c)?Object(D.removeQueryArgs)(e,t):e,window.location.href),r=X(n,e);window.location.href=r}else{const t=X(r,e),c=Object(D.getQueryArgs)(window.location.href),n=Object(D.getQueryArgs)(t);ee(c,n)||(window.location.href=t)}}),[r,null==i?void 0:i.taxonomy]),V=Object(o.useCallback)(e=>{if(c)return;const r=Object(U.b)(h,f,i,A(e),"or"===t.queryType?"in":"and");n&&a&&L(r,0===e.length)},[a,n,L,c,h,f,i,A,t.queryType]),te=Object(o.useMemo)(()=>h.filter(e=>{let{attribute:t}=e;return t===(null==i?void 0:i.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}),[h,null==i?void 0:i.taxonomy]),ce=Object(v.a)(te),ne=Object(y.a)(ce);Object(o.useEffect)(()=>{q()(ne,ce)||q()(u,ce)||(b(ce),t.showFilterButton||V(ce))},[u,ce,ne,V,t.showFilterButton]);const re="dropdown"!==t.displayStyle||"or"===t.queryType,oe=Object(o.useCallback)(e=>{const c=e=>{const{name:t}=d.find(t=>t.value===e);return t},n=e=>{let{filterAdded:t,filterRemoved:n}=e;const r=t?c(t):null,o=n?c(n):null;r&&o?Object(_.speak)(Object(l.sprintf)(
28
  /* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
29
  Object(l.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),r,o)):r?Object(_.speak)(Object(l.sprintf)(
30
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
31
  Object(l.__)("%s filter added.","woo-gutenberg-products-block"),r)):o&&Object(_.speak)(Object(l.sprintf)(
32
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
33
- Object(l.__)("%s filter removed.","woo-gutenberg-products-block"),o))},r=u.includes(e);let o;re?(o=u.filter(t=>t!==e),r?n({filterRemoved:e}):(o.push(e),o.sort(),n({filterAdded:e}))):(o=r?[]:[e],n({filterAdded:r?null:e,filterRemoved:1===u.length?u[0]:null})),b(o),t.showFilterButton||V(o)},[u,d,re,V,t.showFilterButton]);if(Object(o.useEffect)(()=>{n&&i&&((e=>{let{currentCheckedFilters:t,hasSetPhpFilterDefaults:c}=e;return c&&0===t.length})({currentCheckedFilters:u,hasSetPhpFilterDefaults:a})&&(t.showFilterButton||(b([]),L(h,!0))),t.showFilterButton||(b(u),L(h,!1)))},[a,L,n,h,i,u,t.showFilterButton]),Object(o.useEffect)(()=>{if(n){const e=Z(n,i);e.length>0&&!a&&!N&&(s(!0),Object(U.b)(h,f,i,A(e),"or"===t.queryType?"in":"and"))}},[h,f,i,t.queryType,A,n,a,N]),!i)return c?Object(o.createElement)(w.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("Please select an attribute to use this filter!","woo-gutenberg-products-block"))):null;if(0===d.length&&!N)return c?Object(o.createElement)(w.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("The selected attribute does not have any term assigned to products.","woo-gutenberg-products-block"))):null;const le="h"+t.headingLevel,ae=!t.isPreview&&N,se=!t.isPreview&&R;return Object(o.createElement)(o.Fragment,null,!c&&t.heading&&d.length>0&&Object(o.createElement)(le,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-"+t.displayStyle},"dropdown"===t.displayStyle?Object(o.createElement)(B,{attributeLabel:i.label,checked:u,className:m()("wc-block-attribute-filter-dropdown",g.className),style:{...g.style,borderStyle:"none"},inputLabel:t.heading,isLoading:ae,multiple:re,onChange:oe,options:d}):Object(o.createElement)(C.a,{className:"wc-block-attribute-filter-list",options:d,checked:u,onChange:oe,isLoading:ae,isDisabled:se}),t.showFilterButton&&Object(o.createElement)(M.a,{className:"wc-block-attribute-filter__button",disabled:ae||se,onClick:()=>V(u)})))};c(404);const ce=Object(j.getSetting)("attributes",[]);var ne=Object(w.withSpokenMessages)(e=>{let{attributes:t,setAttributes:c,debouncedSpeak:n}=e;const{attributeId:r,className:a,displayStyle:i,heading:d,headingLevel:_,isPreview:v,queryType:y,showCounts:k,showFilterButton:E}=t,[S,C]=Object(o.useState)(!r&&!v),x=Object(s.useBlockProps)(),N=e=>{if(!e||!e.length)return;const t=e[0].id,n=ce.find(e=>e.attribute_id===t.toString());if(!n||r===t)return;const o=n.attribute_label;c({attributeId:t,heading:Object(l.sprintf)(
34
  /* translators: %s attribute name. */
35
  Object(l.__)("Filter by %s","woo-gutenberg-products-block"),o)})},P=e=>{let{isCompact:t}=e;const c={clear:Object(l.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(l.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)(
36
  /* translators: %d is the number of attributes selected. */
37
- Object(l._n)("%d attribute selected","%d attributes selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Product attribute search results updated.","woo-gutenberg-products-block")},n=Object(O.sortBy)(Object(O.toArray)(Object(O.mapValues)(ce,e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label}))),"name");return Object(o.createElement)(g.a,{className:"woocommerce-product-attributes",list:n,selected:n.filter(e=>{let{id:t}=e;return t===r}),onChange:N,messages:c,isSingle:!0,isCompact:t})};return 0===Object.keys(ce).length?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(l.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("p",null,Object(l.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woo-gutenberg-products-block")),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(j.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(l.__)("Add new attribute","woo-gutenberg-products-block")+" ",Object(o.createElement)(u.a,{icon:p.a})),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(l.__)("Learn more","woo-gutenberg-products-block"))):Object(o.createElement)("div",x,Object(o.createElement)(s.BlockControls,null,Object(o.createElement)(w.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit","woo-gutenberg-products-block"),onClick:()=>C(!S),isActive:S}]})),Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Product count","woo-gutenberg-products-block"),help:k?Object(l.__)("Product count is visible.","woo-gutenberg-products-block"):Object(l.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:k,onChange:()=>c({showCounts:!k})}),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(h.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:_,onChange:e=>c({headingLevel:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Query Type","woo-gutenberg-products-block"),help:"and"===y?Object(l.__)("Products that have all of the selected attributes will be shown.","woo-gutenberg-products-block"):Object(l.__)("Products that have any of the selected attributes will be shown.","woo-gutenberg-products-block"),value:y,onChange:e=>c({queryType:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"and",label:Object(l.__)("And","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"or",label:Object(l.__)("Or","woo-gutenberg-products-block")})),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:i,onChange:e=>c({displayStyle:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(l.__)("Dropdown","woo-gutenberg-products-block")})),Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Filter button","woo-gutenberg-products-block"),help:E?Object(l.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(l.__)("Products will update as options are selected.","woo-gutenberg-products-block"),checked:E,onChange:e=>c({showFilterButton:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),initialOpen:!1},P({isCompact:!0}))),S?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(l.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},P({isCompact:!1}),Object(o.createElement)(w.Button,{isPrimary:!0,onClick:()=>{C(!1),n(Object(l.__)("Showing Filter Products by Attribute block preview.","woo-gutenberg-products-block"))}},Object(l.__)("Done","woo-gutenberg-products-block")))):Object(o.createElement)("div",{className:m()(a,"wc-block-attribute-filter")},Object(o.createElement)(f.a,{className:"wc-block-attribute-filter__title",headingLevel:_,heading:d,onChange:e=>c({heading:e})}),Object(o.createElement)(w.Disabled,null,Object(o.createElement)(te,{attributes:t,isEditor:!0}))))});Object(a.registerBlockType)("woocommerce/attribute-filter",{apiVersion:2,title:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:b.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(l.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(l.__)("Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.","woo-gutenberg-products-block"),supports:{html:!1,color:{text:!0,background:!1},...Object(i.b)()&&{__experimentalBorder:{radius:!0,color:!0,width:!1}}},example:{attributes:{isPreview:!0}},attributes:{attributeId:{type:"number",default:0},showCounts:{type:"boolean",default:!0},queryType:{type:"string",default:"or"},heading:{type:"string",default:Object(l.__)("Filter by attribute","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3},displayStyle:{type:"string",default:"list"},showFilterButton:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:ne,save(e){let{attributes:t}=e;const{className:c,showCounts:n,queryType:l,attributeId:a,heading:i,headingLevel:u,displayStyle:b,showFilterButton:d}=t,p={"data-attribute-id":a,"data-show-counts":n,"data-query-type":l,"data-heading":i,"data-heading-level":u};return"list"!==b&&(p["data-display-style"]=b),d&&(p["data-show-filter-button"]=d),Object(o.createElement)("div",r()({},s.useBlockProps.save({className:m()("is-loading",c)}),p),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},48:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var n=c(0),r=c(25),o=c.n(r);function l(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},49:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(0);const r=Object(n.createContext)("page"),o=()=>Object(n.useContext)(r);r.Provider},5:function(e,t){e.exports=window.wp.blockEditor},57:function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return r}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function r(e,t){return n(e)&&t in e}},7:function(e,t){e.exports=window.lodash},71:function(e,t,c){"use strict";c.d(t,"c",(function(){return o})),c.d(t,"d",(function(){return l})),c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return s}));var n=c(13),r=c(24);const o=(e,t)=>{if(r.n>2)return Object(n.registerBlockType)(e,t)},l=(e,t)=>{if(r.n>1)return Object(n.registerBlockType)(e,t)},a=()=>r.n>2,s=()=>r.n>1},76:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return d})),c.d(t,"c",(function(){return m}));var n=c(18),r=c(9),o=c(0),l=c(25),a=c.n(l),s=c(48),i=c(106),u=c(49);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},d=(e,t,c)=>{const l=Object(u.a)();c=c||l;const a=Object(r.useSelect)(r=>r(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:s}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(c,e,t)},[c,e,s])]},m=(e,t)=>{const c=Object(u.a)();t=t||c;const[n,r]=b(t),l=Object(s.a)(n),d=Object(s.a)(e),m=Object(i.a)(d),p=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(m,d)||(r(Object.assign({},l,d)),p.current=!0)},[l,d,m,r]),p.current?[n,r]:[e,r]}},8:function(e,t){e.exports=window.React},9:function(e,t){e.exports=window.wp.data},91:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(5);const r=()=>"function"==typeof n.__experimentalGetSpacingClassesAndStyles},96:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var n=c(6),r=c.n(n),o=c(0),l=c(1),a=c(3),s=c(110),i=c(514),u=c(4),b=c.n(u),d=c(10),m=c(21),p=c(34),g=c(513),O=c(14);const j=e=>{let{id:t,label:c,popoverContents:n,remove:r,screenReaderLabel:i,className:u=""}=e;const[m,p]=Object(o.useState)(!1),h=Object(d.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const f=b()("woocommerce-tag",u,{"has-remove":!!r}),w="woocommerce-tag__label-"+h,_=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:f},n?Object(o.createElement)(a.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>p(!0)},_):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},_),n&&m&&Object(o.createElement)(a.Popover,{onClose:()=>p(!1)},n),r&&Object(o.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:r(t),label:Object(l.sprintf)(// Translators: %s label.
38
- Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const f=e=>Object(o.createElement)(p.b,e),w=e=>{const{list:t,selected:c,renderItem:n,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,n({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(o.createElement)(w,r()({},e,{list:t.children,depth:l+1})))})):null},_=e=>{let{isLoading:t,isSingle:c,selected:n,messages:r,onChange:s,onRemove:i}=e;if(t||c||!n)return null;const u=n.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,r.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":r.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,n.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},v=e=>{let{filteredList:t,search:c,onSelect:n,instanceId:r,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=a,p=b||f;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:p,onSelect:n,instanceId:r,isSingle:m,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:n,isLoading:l,isSingle:s,list:i,messages:u=m.a,onChange:p,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,f]=Object(o.useState)(""),w=Object(d.useInstanceId)(y),k=Object(o.useMemo)(()=>({...m.a,...u}),[u]),E=Object(o.useMemo)(()=>Object(m.c)(i,h,n),[i,h,n]);Object(o.useEffect)(()=>{j&&j(k.updated)},[j,k]),Object(o.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(o.useCallback)(e=>()=>{s&&p([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});p([...O.slice(0,t),...O.slice(t+1)])},[s,O,p]),C=Object(o.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?p(s?[e]:[...O,e]):S(e.id)()},[s,S,p,O]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(_,r()({},e,{onRemove:S,messages:k})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:k.search,type:"search",value:h,onChange:e=>f(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(v,r()({},e,{search:h,filteredList:E,messages:k,onSelect:C,instanceId:w})))};Object(a.withSpokenMessages)(y)},99:function(e,t,c){"use strict";var n=c(0),r=c(7),o=c(1),l=c(3),a=c(12);function s(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(n.createElement)(a.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(a.Path,{d:c[t]})):null}class i extends n.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(n.createElement)(s,{level:e}),title:Object(o.sprintf)(
39
  /* translators: %s: heading level e.g: "2", "3", "4" */
40
  Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:o,onChange:a}=this.props;return Object(n.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(s,{level:o}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,o,a))})}}t.a=i}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var n,l,a=t[0],s=t[1],i=t[2],b=0,d=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&d.push(r[l][0]),r[l]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,i||[]),c()}function c(){for(var e,t=0;t<o.length;t++){for(var c=o[t],n=!0,a=1;a<c.length;a++){var s=c[a];0!==r[s]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=c[0]))}return e}var n={},r={9:0,1:0,2:0},o=[];function l(t){if(n[t])return n[t].exports;var c=n[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=e,l.c=n,l.d=function(e,t,c){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(l.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(c,n,function(t){return e[t]}.bind(null,n));return c},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([406,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},104:function(e,t,c){"use strict";var n=c(0),r=c(1),o=c(30);c(236),t.a=e=>{let{name:t,count:c}=e;return Object(n.createElement)(n.Fragment,null,t,Number.isFinite(c)&&Object(n.createElement)(o.a,{label:c.toString(),screenReaderLabel:Object(r.sprintf)(
2
  /* translators: %s number of products. */
3
+ Object(r._n)("%s product","%s products",c,"woo-gutenberg-products-block"),c),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},106:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(8);function r(e,t){const c=Object(n.useRef)();return Object(n.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},11:function(e,t){e.exports=window.wp.primitives},118:function(e,t,c){"use strict";var n=c(0),r=c(5),o=c(10),l=c(1);c(153),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:c,onChange:o,heading:a,instanceId:s}=e;const i="h"+c;return Object(n.createElement)(i,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(r.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},119:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},121:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(0);const r=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},122:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(18),r=c(9),o=c(0),l=c(48),a=c(121);const s=e=>{const{namespace:t,resourceName:c,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),d=Object(l.a)(i),m=Object(l.a)(s),p=Object(a.a)(),g=Object(r.useSelect)(e=>{if(!u)return null;const r=e(n.COLLECTIONS_STORE_KEY),o=[t,c,d,m],l=r.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(l)}return{results:r.getCollection(...o),isLoading:!r.hasFinishedResolution("getCollection",o)}},[t,c,m,d,u]);return null!==g&&(b.current=g),b.current}},13:function(e,t){e.exports=window.wp.blocks},14:function(e,t){e.exports=window.wp.htmlEntities},142:function(e,t,c){"use strict";var n=c(0),r=c(1),o=c(4),l=c.n(o),a=c(30);c(183),t.a=e=>{let{className:t,disabled:c,label:
4
  /* translators: Submit button text for filters. */
5
+ o=Object(r.__)("Go","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:i=Object(r.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(n.createElement)("button",{type:"submit",className:l()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:c,onClick:s},Object(n.createElement)(a.a,{label:o,screenReaderLabel:i}))}},153:function(e,t){},154:function(e,t){},16:function(e,t){e.exports=window.wp.url},163:function(e,t,c){"use strict";c.d(t,"b",(function(){return r})),c.d(t,"a",(function(){return o})),c.d(t,"c",(function(){return l}));var n=c(16);const r="query_type_",o="filter_";function l(e){return window?Object(n.getQueryArg)(window.location.href,e):null}},167:function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));var n=c(7);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===c.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(r)))return;const a=l.slug.filter(e=>e!==r),s=e.filter(e=>e.attribute!==c.taxonomy);a.length>0&&(l.slug=a.sort(),s.push(l)),t(Object(n.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const l=e.filter(e=>e.attribute!==c.taxonomy);return 0===r.length?t(l):(l.push({attribute:c.taxonomy,operator:o,slug:r.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(l,"attribute"))),l}},18:function(e,t){e.exports=window.wc.wcBlocksData},183:function(e,t){},192:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var n=c(2);const r=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const c=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return c.id&&e.push(c),e},[]),o=e=>{if(e)return r.find(t=>t.id===e)},l=e=>{if(e)return r.find(t=>t.taxonomy===e)}},193:function(e,t,c){"use strict";var n=c(0),r=c(1),o=c(4),l=c.n(o);c(237),t.a=e=>{let{className:t,onChange:c=(()=>{}),options:o=[],checked:a=[],isLoading:s=!1,isDisabled:i=!1,limit:u=10}=e;const[b,d]=Object(n.useState)(!1),m=Object(n.useMemo)(()=>[...Array(5)].map((e,t)=>Object(n.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),p=Object(n.useMemo)(()=>{const e=o.length-u;return!b&&Object(n.createElement)("li",{key:"show-more",className:"show-more"},Object(n.createElement)("button",{onClick:()=>{d(!0)},"aria-expanded":!1,"aria-label":Object(r.sprintf)(
6
  /* translators: %s is referring the remaining count of options */
7
  Object(r._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(r.sprintf)(
8
  /* translators: %s number of options to reveal. */
9
+ Object(r._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[o,u,b]),g=Object(n.useMemo)(()=>b&&Object(n.createElement)("li",{key:"show-less",className:"show-less"},Object(n.createElement)("button",{onClick:()=>{d(!1)},"aria-expanded":!0,"aria-label":Object(r.__)("Show less options","woo-gutenberg-products-block")},Object(r.__)("Show less","woo-gutenberg-products-block"))),[b]),O=Object(n.useMemo)(()=>{const e=o.length>u+5;return Object(n.createElement)(n.Fragment,null,o.map((t,r)=>Object(n.createElement)(n.Fragment,{key:t.value},Object(n.createElement)("li",e&&!b&&r>=u&&{hidden:!0},Object(n.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{c(e.target.value)},checked:a.includes(t.value),disabled:i}),Object(n.createElement)("label",{htmlFor:t.value},t.label)),e&&r===u-1&&p)),e&&g)},[o,c,a,b,u,g,p,i]),j=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":s},t);return Object(n.createElement)("ul",{className:j},s?m:O)}},2:function(e,t){e.exports=window.wc.wcSettings},202:function(e,t,c){"use strict";var n=c(6),r=c.n(n),o=c(0),l=c(4),a=c.n(l),s=c(1),i=c(110),u=c(541);c(154);var b=e=>{let{text:t,screenReaderText:c="",element:n="li",className:l="",radius:s="small",children:i=null,...u}=e;const b=n,d=a()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+s),m=Boolean(c&&c!==t);return Object(o.createElement)(b,r()({className:d},u),Object(o.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(o.createElement)("span",{className:"screen-reader-text"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:n=!1,onRemove:l=(()=>{}),removeOnAnyClick:d=!1,text:m,screenReaderText:p="",...g}=e;const O=d?"span":"button";if(!t){const e=p&&"string"==typeof p?p:m;t="string"!=typeof e?
10
  /* translators: Remove chip. */
11
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
12
  /* translators: %s text of the chip to remove. */
14
  /* Translators: %s search term */
15
  noResults:Object(o.__)("No results for %s","woo-gutenberg-products-block"),search:Object(o.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(o.sprintf)(
16
  /* translators: Number of items selected from list. */
17
+ Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(r.groupBy)(e,"parent"),n=Object(r.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(n[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(n[e.parent]),children:t&&t.length?a(t):[]}}),s=a(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||s.push(...a(c||[]))}),s},s=(e,t,c)=>{if(!t)return c?a(e):e;const n=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map(e=>!!n.test(e.name)&&e).filter(Boolean);return c?a(r,e):r},i=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(n.createElement)(n.Fragment,{key:c},Object(n.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},235:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},236:function(e,t){},237:function(e,t){},24:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return a})),c.d(t,"n",(function(){return s})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return m})),c.d(t,"c",(function(){return p})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return f}));var n,r=c(2);const o=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",s=o.buildPhase,i=null===(n=r.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=r.STORE_PAGES.checkout.id,b=r.STORE_PAGES.checkout.permalink,d=r.STORE_PAGES.privacy.permalink,m=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),p=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),g=r.STORE_PAGES.cart.permalink,O=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("shippingCountries",{})),j=Object(r.getSetting)("allowedCountries",{}),h=Object(r.getSetting)("shippingStates",{}),f=Object(r.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},285:function(e,t,c){"use strict";c.d(t,"a",(function(){return u}));var n=c(0),r=c(265),o=c(7),l=c(48),a=c(76),s=c(122),i=c(49);const u=e=>{let{queryAttribute:t,queryPrices:c,queryStock:u,queryState:b}=e,d=Object(i.a)();d+="-collection-data";const[m]=Object(a.a)(d),[p,g]=Object(a.b)("calculate_attribute_counts",[],d),[O,j]=Object(a.b)("calculate_price_range",null,d),[h,f]=Object(a.b)("calculate_stock_status_counts",null,d),w=Object(l.a)(t||{}),_=Object(l.a)(c),v=Object(l.a)(u);Object(n.useEffect)(()=>{"object"==typeof w&&Object.keys(w).length&&(p.find(e=>e.taxonomy===w.taxonomy)||g([...p,w]))},[w,p,g]),Object(n.useEffect)(()=>{O!==_&&void 0!==_&&j(_)},[_,j,O]),Object(n.useEffect)(()=>{h!==v&&void 0!==v&&f(v)},[v,f,h]);const[y,k]=Object(n.useState)(!1),[E]=Object(r.a)(y,200);y||k(!0);const S=Object(n.useMemo)(()=>(e=>{const t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:c}=e;return{taxonomy:t,query_type:c}}),["taxonomy","query_type"])),t})(m),[m]);return Object(s.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...b,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...S},shouldSelect:E})}},3:function(e,t){e.exports=window.wp.components},30:function(e,t,c){"use strict";var n=c(0),r=c(4),o=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=c,i=null!=r;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,r)):(t=l||n.Fragment,s&&i&&c!==r?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},r)):Object(n.createElement)(t,a,c))}},34:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var n=c(6),r=c.n(n),o=c(0),l=c(21);const a=e=>{let{countLabel:t,className:c,depth:n=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...m}=e;const p=null!=t&&void 0!==s.count&&null!==s.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+n),u&&g.push("is-radio-button"),p&&g.push("has-count");const O=s.breadcrumbs&&s.breadcrumbs.length,j=m.name||"search-list-item-"+a,h=`${j}-${s.id}`;return Object(o.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(o.createElement)("input",r()({type:"radio",id:h,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",r()({type:"checkbox",id:h,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!p&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},406:function(e,t,c){e.exports=c(477)},407:function(e,t){},408:function(e,t){},409:function(e,t){},43:function(e,t,c){"use strict";c.d(t,"c",(function(){return i})),c.d(t,"d",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"a",(function(){return d}));var n=c(5),r=c(71),o=c(119),l=c(57),a=c(91);const s=e=>Object(o.a)(e)?JSON.parse(e)||{}:Object(l.a)(e)?e:{},i=e=>{if(!Object(r.b)()||!Object(a.a)())return{style:{}};const t=Object(l.a)(e)?e:{},c=s(t.style);return Object(n.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},u=e=>{const t=Object(l.a)(e)?e:{},c=s(t.style),n=Object(l.a)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:n.fontSize,lineHeight:n.lineHeight,fontWeight:n.fontWeight,textTransform:n.textTransform,fontFamily:t.fontFamily}}},b=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(l.a)(e)?e:{},c=s(t.style);return Object(n.__experimentalUseColorProps)({...t,style:c})},d=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(l.a)(e)?e:{},c=s(t.style);return Object(n.__experimentalUseBorderProps)({...t,style:c})}},44:function(e,t){e.exports=window.wp.a11y},477:function(e,t,c){"use strict";c.r(t);var n=c(6),r=c.n(n),o=c(0),l=c(1),a=c(13),s=c(5),i=c(71),u=c(110),b=c(524),d=c(4),m=c.n(d),p=c(223),g=c(96),O=c(7),j=c(2),h=c(99),f=c(118),w=c(3),_=c(44),v=c(48),y=c(106),k=c(76),E=c(122),S=c(285),C=c(193),x=c(170),N=e=>{let{checked:t,getInputProps:c,inputRef:n,isDisabled:r,onFocus:l,onRemoveItem:a,placeholder:s,tabIndex:i,value:u}=e;return Object(o.createElement)("input",c({ref:n,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:r,onFocus:l,onKeyDown(e){"Backspace"===e.key&&!u&&t.length>0&&a(t[t.length-1])},placeholder:s,tabIndex:i}))},P=e=>{let{children:t,onClick:c}=e;return Object(o.createElement)("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:c},t)},T=e=>{let{checked:t,getItemProps:c,getMenuProps:n,highlightedIndex:r,options:a}=e;return Object(o.createElement)("ul",n({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),a.map((e,n)=>{const a=t.includes(e.value);return Object(o.createElement)("li",c({key:e.value,className:m()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":a,"is-highlighted":r===n}),index:n,item:e.value,"aria-label":a?Object(l.sprintf)(
18
  /* translators: %s is referring to the filter option being removed. */
19
  Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)}))},R=c(202),I=e=>{let{onRemoveItem:t,option:c}=e;return Object(o.createElement)(R.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:()=>{t(c.value)},ariaLabel:Object(l.sprintf)(
20
  /* translators: %s is referring to the filter option being removed. */
21
+ Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),c.name),text:c.label,radius:"large"})},A=c(541),L=e=>{let{onClick:t,onRemoveItem:c,option:n}=e;const r=Object(o.useRef)(null);return Object(o.useEffect)(()=>{r.current.focus()},[r]),Object(o.createElement)("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},Object(o.createElement)("button",{ref:r,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:e=>{e.stopPropagation(),t(n.value)},"aria-label":Object(l.sprintf)(
22
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
23
  Object(l.__)("Replace current %s filter","woo-gutenberg-products-block"),n.name)},n.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:()=>{c(n.value)},onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||c(n.value)},"aria-label":Object(l.sprintf)(
24
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
25
+ Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),n.name)},Object(o.createElement)(u.a,{icon:A.a,size:16})))};c(409);var B=e=>{let{attributeLabel:t="",className:c,style:n={},checked:r=[],inputLabel:a="",isDisabled:s=!1,isLoading:i=!1,multiple:u=!1,onChange:b=(()=>{}),options:d=[],isCaseSensitive:p=!1}=e;const g=Object(o.useRef)(null),O=m()(c,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":s,"is-loading":i}),j=Object(o.useCallback)((e,t)=>{switch(t.type){case x.a.stateChangeTypes.keyDownEnter:case x.a.stateChangeTypes.clickItem:return{...t,highlightedIndex:e.highlightedIndex,isOpen:u,inputValue:""};case x.a.stateChangeTypes.blurInput:case x.a.stateChangeTypes.mouseUp:return{...t,inputValue:e.inputValue};default:return t}},[u]);return Object(o.createElement)(x.a,{onChange:b,selectedItem:null,stateReducer:j},e=>{let{getInputProps:c,getItemProps:i,getLabelProps:j,getMenuProps:h,highlightedIndex:f,inputValue:w,isOpen:_,openMenu:v}=e;return Object(o.createElement)("div",{className:m()(O,{"is-multiple":u,"is-single":!u,"has-checked":r.length>0,"is-open":_}),style:n},Object(o.createElement)("label",j({className:"screen-reader-text"}),a),Object(o.createElement)(P,{isOpen:_,onClick:()=>g.current.focus()},r.map(e=>{const t=d.find(t=>t.value===e);if(!t)return null;const c=e=>{b(e),g.current.focus()};return u?Object(o.createElement)(I,{key:e,onRemoveItem:c,option:t}):Object(o.createElement)(L,{key:e,onClick:()=>g.current.focus(),onRemoveItem:c,option:t})}),Object(o.createElement)(N,{checked:r,getInputProps:c,inputRef:g,isDisabled:s,onFocus:v,onRemoveItem:e=>{b(e),g.current.focus()},placeholder:r.length>0&&u?null:Object(l.sprintf)(
26
  /* translators: %s attribute name. */
27
+ Object(l.__)("Any %s","woo-gutenberg-products-block"),t),tabIndex:!u&&r.length>0?"-1":"0",value:w})),_&&!s&&Object(o.createElement)(T,{checked:r,getItemProps:i,getMenuProps:h,highlightedIndex:f,options:d.filter(e=>{let t=e.name,c=null==w?void 0:w.trim();var n;return p||(t=t.toLowerCase(),c=null===(n=c)||void 0===n?void 0:n.toLowerCase()),!c||t.includes(c)})}))})},F=c(104),M=c(142),V=c(25),q=c.n(V),H=c(14),D=c(16),G=c(235),z=c(119),Q=c(163),$=c(192),U=c(167);const Y=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(F.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(F.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(F.a,{name:"Red",count:2})}],K={id:0,name:"preview",taxonomy:"preview",label:"Preview"};var W=c(43);c(408);const J=e=>e.replace("pa_",""),X=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const c={};t.forEach(e=>{const{attribute:t,slug:n,operator:r}=e,o=J(t),l=n.join(","),a=`${Q.b}${o}`,s="in"===r?"or":"and";c[`${Q.a}${o}`]=l,c[a]=s});const n=Object(D.removeQueryArgs)(e,...Object.keys(c));return Object(D.addQueryArgs)(n,c)},Z=(e,t)=>{if(e&&t){const e=Object(Q.c)("filter_"+t.name);return"string"==typeof e?e.split(","):[]}return[]},ee=(e,t)=>{const c=Object.entries(t).reduce((e,t)=>{let[c,n]=t;return c.includes("query_type")?e:{...e,[c]:n}},{});return Object.entries(c).reduce((t,c)=>{let[n,r]=c;return e[n]===r&&t},!0)};var te=e=>{let{attributes:t,isEditor:c=!1}=e;const n=Object(j.getSettingWithCoercion)("has_filterable_products",!1,G.a),r=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,G.a),a=Object(j.getSettingWithCoercion)("page_url",window.location.href,z.a),[s,i]=Object(o.useState)(!1),u=t.isPreview&&!t.attributeId?K:Object($.a)(t.attributeId),[b,d]=Object(o.useState)(Z(r,u)),[p,g]=Object(o.useState)(t.isPreview&&!t.attributeId?Y:[]),O=Object(W.a)(t),[h]=Object(k.a)(),[f,x]=Object(k.b)("attributes",[]),{results:N,isLoading:P}=Object(E.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==u?void 0:u.id)||0],shouldSelect:t.attributeId>0}),T="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:R,isLoading:I}=Object(S.a)({queryAttribute:{taxonomy:null==u?void 0:u.taxonomy,queryType:t.queryType},queryState:{...h,attributes:T?h.attributes:null}}),A=Object(o.useCallback)(e=>R.attribute_counts?R.attribute_counts.find(t=>{let{term:c}=t;return c===e}):null,[R]);Object(o.useEffect)(()=>{if(P||I)return;const e=N.map(e=>{const c=A(e.id);if(!(c||b.includes(e.slug)||(n=e.slug,null!=h&&h.attributes&&h.attributes.some(e=>{let{attribute:t,slug:c=[]}=e;return t===u.taxonomy&&c.includes(n)}))))return null;var n;const r=c?c.count:0;return{value:e.slug,name:Object(H.decodeEntities)(e.name),label:Object(o.createElement)(F.a,{name:Object(H.decodeEntities)(e.name),count:t.showCounts?r:null})}}).filter(Boolean);g(e)},[null==u?void 0:u.taxonomy,N,P,t.showCounts,I,A,b,h.attributes]);const L=Object(o.useCallback)(e=>N.reduce((t,c)=>(e.includes(c.slug)&&t.push(c),t),[]),[N]),V=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){const t=Object.keys(Object(D.getQueryArgs)(window.location.href)),c=J(null==u?void 0:u.taxonomy),n=t.reduce((e,t)=>t.includes(Q.b+c)||t.includes(Q.a+c)?Object(D.removeQueryArgs)(e,t):e,window.location.href),r=X(n,e);window.location.href=r}else{const t=X(a,e),c=Object(D.getQueryArgs)(window.location.href),n=Object(D.getQueryArgs)(t);ee(c,n)||(window.location.href=t)}}),[a,null==u?void 0:u.taxonomy]),te=Object(o.useCallback)(e=>{c||(d(e),t.showFilterButton||Object(U.b)(f,x,u,L(e),"or"===t.queryType?"in":"and"))},[c,d,f,x,u,L,t.queryType,t.showFilterButton]),ce=Object(o.useMemo)(()=>f.filter(e=>{let{attribute:t}=e;return t===(null==u?void 0:u.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}),[f,null==u?void 0:u.taxonomy]),ne=Object(v.a)(ce),re=Object(y.a)(ne);Object(o.useEffect)(()=>{q()(re,ne)||q()(b,ne)||te(ne)},[b,ne,re,te]);const oe="dropdown"!==t.displayStyle||"or"===t.queryType,le=Object(o.useCallback)(e=>{const t=e=>{const{name:t}=p.find(t=>t.value===e);return t},c=e=>{let{filterAdded:c,filterRemoved:n}=e;const r=c?t(c):null,o=n?t(n):null;r&&o?Object(_.speak)(Object(l.sprintf)(
28
  /* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
29
  Object(l.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),r,o)):r?Object(_.speak)(Object(l.sprintf)(
30
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
31
  Object(l.__)("%s filter added.","woo-gutenberg-products-block"),r)):o&&Object(_.speak)(Object(l.sprintf)(
32
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
33
+ Object(l.__)("%s filter removed.","woo-gutenberg-products-block"),o))},n=b.includes(e);let r;oe?(r=b.filter(t=>t!==e),n?c({filterRemoved:e}):(r.push(e),r.sort(),c({filterAdded:e}))):(r=n?[]:[e],c({filterAdded:n?null:e,filterRemoved:1===b.length?b[0]:null})),te(r)},[b,p,oe,te]);if(Object(o.useEffect)(()=>{r&&u&&((e=>{let{currentCheckedFilters:t,hasSetPhpFilterDefaults:c}=e;return c&&0===t.length})({currentCheckedFilters:b,hasSetPhpFilterDefaults:s})&&(t.showFilterButton||(d([]),V(f,!0))),t.showFilterButton||(d(b),V(f,!1)))},[s,V,r,f,u,b,t.showFilterButton]),Object(o.useEffect)(()=>{if(r){const e=Z(r,u);e.length>0&&!s&&!P&&(i(!0),te(e))}},[u,r,s,P,te]),!n)return null;if(!u)return c?Object(o.createElement)(w.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("Please select an attribute to use this filter!","woo-gutenberg-products-block"))):null;if(0===p.length&&!P)return c?Object(o.createElement)(w.Notice,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("The selected attribute does not have any term assigned to products.","woo-gutenberg-products-block"))):null;const ae="h"+t.headingLevel,se=!t.isPreview&&P,ie=!t.isPreview&&I;return Object(o.createElement)(o.Fragment,null,!c&&t.heading&&p.length>0&&Object(o.createElement)(ae,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-"+t.displayStyle},"dropdown"===t.displayStyle?Object(o.createElement)(B,{attributeLabel:u.label,checked:b,className:m()("wc-block-attribute-filter-dropdown",O.className),style:{...O.style,borderStyle:"none"},inputLabel:t.heading,isLoading:se,multiple:oe,onChange:le,options:p}):Object(o.createElement)(C.a,{className:"wc-block-attribute-filter-list",options:p,checked:b,onChange:le,isLoading:se,isDisabled:ie}),t.showFilterButton&&Object(o.createElement)(M.a,{className:"wc-block-attribute-filter__button",disabled:se||ie,onClick:()=>(e=>{const c=Object(U.b)(f,x,u,L(e),"or"===t.queryType?"in":"and");r&&V(c,0===e.length)})(b)})))};c(407);const ce=Object(j.getSetting)("attributes",[]);var ne=Object(w.withSpokenMessages)(e=>{let{attributes:t,setAttributes:c,debouncedSpeak:n}=e;const{attributeId:r,className:a,displayStyle:i,heading:d,headingLevel:_,isPreview:v,queryType:y,showCounts:k,showFilterButton:E}=t,[S,C]=Object(o.useState)(!r&&!v),x=Object(s.useBlockProps)(),N=e=>{if(!e||!e.length)return;const t=e[0].id,n=ce.find(e=>e.attribute_id===t.toString());if(!n||r===t)return;const o=n.attribute_label;c({attributeId:t,heading:Object(l.sprintf)(
34
  /* translators: %s attribute name. */
35
  Object(l.__)("Filter by %s","woo-gutenberg-products-block"),o)})},P=e=>{let{isCompact:t}=e;const c={clear:Object(l.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(l.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)(
36
  /* translators: %d is the number of attributes selected. */
37
+ Object(l._n)("%d attribute selected","%d attributes selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Product attribute search results updated.","woo-gutenberg-products-block")},n=Object(O.sortBy)(Object(O.toArray)(Object(O.mapValues)(ce,e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label}))),"name");return Object(o.createElement)(g.a,{className:"woocommerce-product-attributes",list:n,selected:n.filter(e=>{let{id:t}=e;return t===r}),onChange:N,messages:c,isSingle:!0,isCompact:t})};return 0===Object.keys(ce).length?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(l.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("p",null,Object(l.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woo-gutenberg-products-block")),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(j.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(l.__)("Add new attribute","woo-gutenberg-products-block")+" ",Object(o.createElement)(u.a,{icon:p.a})),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(l.__)("Learn more","woo-gutenberg-products-block"))):Object(o.createElement)("div",x,Object(o.createElement)(s.BlockControls,null,Object(o.createElement)(w.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit","woo-gutenberg-products-block"),onClick:()=>C(!S),isActive:S}]})),Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Product count","woo-gutenberg-products-block"),help:k?Object(l.__)("Product count is visible.","woo-gutenberg-products-block"):Object(l.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:k,onChange:()=>c({showCounts:!k})}),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(h.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:_,onChange:e=>c({headingLevel:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Query Type","woo-gutenberg-products-block"),help:"and"===y?Object(l.__)("Products that have all of the selected attributes will be shown.","woo-gutenberg-products-block"):Object(l.__)("Products that have any of the selected attributes will be shown.","woo-gutenberg-products-block"),value:y,onChange:e=>c({queryType:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"and",label:Object(l.__)("And","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"or",label:Object(l.__)("Or","woo-gutenberg-products-block")})),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:i,onChange:e=>c({displayStyle:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(l.__)("Dropdown","woo-gutenberg-products-block")})),Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Filter button","woo-gutenberg-products-block"),help:E?Object(l.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(l.__)("Products will update as options are selected.","woo-gutenberg-products-block"),checked:E,onChange:e=>c({showFilterButton:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),initialOpen:!1},P({isCompact:!0}))),S?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(l.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},P({isCompact:!1}),Object(o.createElement)(w.Button,{isPrimary:!0,onClick:()=>{C(!1),n(Object(l.__)("Showing Filter Products by Attribute block preview.","woo-gutenberg-products-block"))}},Object(l.__)("Done","woo-gutenberg-products-block")))):Object(o.createElement)("div",{className:m()(a,"wc-block-attribute-filter")},Object(o.createElement)(f.a,{className:"wc-block-attribute-filter__title",headingLevel:_,heading:d,onChange:e=>c({heading:e})}),Object(o.createElement)(w.Disabled,null,Object(o.createElement)(te,{attributes:t,isEditor:!0}))))});Object(a.registerBlockType)("woocommerce/attribute-filter",{apiVersion:2,title:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:b.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(l.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(l.__)("Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.","woo-gutenberg-products-block"),supports:{html:!1,color:{text:!0,background:!1},...Object(i.b)()&&{__experimentalBorder:{radius:!0,color:!0,width:!1}}},example:{attributes:{isPreview:!0}},attributes:{attributeId:{type:"number",default:0},showCounts:{type:"boolean",default:!0},queryType:{type:"string",default:"or"},heading:{type:"string",default:Object(l.__)("Filter by attribute","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3},displayStyle:{type:"string",default:"list"},showFilterButton:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:c}=e;return"woocommerce_layered_nav"===t&&!(null==c||!c.raw)},transform:e=>{var t,c,n;let{instance:r}=e;return Object(a.createBlock)("woocommerce/attribute-filter",{attributeId:0,showCounts:!0,queryType:(null==r||null===(t=r.raw)||void 0===t?void 0:t.query_type)||"or",heading:(null==r||null===(c=r.raw)||void 0===c?void 0:c.title)||Object(l.__)("Filter by attribute","woo-gutenberg-products-block"),headingLevel:3,displayStyle:(null==r||null===(n=r.raw)||void 0===n?void 0:n.display_type)||"list",showFilterButton:!1,isPreview:!1})}}]},edit:ne,save(e){let{attributes:t}=e;const{className:c,showCounts:n,queryType:l,attributeId:a,heading:i,headingLevel:u,displayStyle:b,showFilterButton:d}=t,p={"data-attribute-id":a,"data-show-counts":n,"data-query-type":l,"data-heading":i,"data-heading-level":u};return"list"!==b&&(p["data-display-style"]=b),d&&(p["data-show-filter-button"]=d),Object(o.createElement)("div",r()({},s.useBlockProps.save({className:m()("is-loading",c)}),p),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},48:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var n=c(0),r=c(25),o=c.n(r);function l(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},49:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(0);const r=Object(n.createContext)("page"),o=()=>Object(n.useContext)(r);r.Provider},5:function(e,t){e.exports=window.wp.blockEditor},57:function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return r}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function r(e,t){return n(e)&&t in e}},7:function(e,t){e.exports=window.lodash},71:function(e,t,c){"use strict";c.d(t,"c",(function(){return o})),c.d(t,"d",(function(){return l})),c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return s}));var n=c(13),r=c(24);const o=(e,t)=>{if(r.n>2)return Object(n.registerBlockType)(e,t)},l=(e,t)=>{if(r.n>1)return Object(n.registerBlockType)(e,t)},a=()=>r.n>2,s=()=>r.n>1},76:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return d})),c.d(t,"c",(function(){return m}));var n=c(18),r=c(9),o=c(0),l=c(25),a=c.n(l),s=c(48),i=c(106),u=c(49);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},d=(e,t,c)=>{const l=Object(u.a)();c=c||l;const a=Object(r.useSelect)(r=>r(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:s}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(c,e,t)},[c,e,s])]},m=(e,t)=>{const c=Object(u.a)();t=t||c;const[n,r]=b(t),l=Object(s.a)(n),d=Object(s.a)(e),m=Object(i.a)(d),p=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(m,d)||(r(Object.assign({},l,d)),p.current=!0)},[l,d,m,r]),p.current?[n,r]:[e,r]}},8:function(e,t){e.exports=window.React},9:function(e,t){e.exports=window.wp.data},91:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(5);const r=()=>"function"==typeof n.__experimentalGetSpacingClassesAndStyles},96:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var n=c(6),r=c.n(n),o=c(0),l=c(1),a=c(3),s=c(110),i=c(518),u=c(4),b=c.n(u),d=c(10),m=c(21),p=c(34),g=c(517),O=c(14);const j=e=>{let{id:t,label:c,popoverContents:n,remove:r,screenReaderLabel:i,className:u=""}=e;const[m,p]=Object(o.useState)(!1),h=Object(d.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const f=b()("woocommerce-tag",u,{"has-remove":!!r}),w="woocommerce-tag__label-"+h,_=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:f},n?Object(o.createElement)(a.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>p(!0)},_):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},_),n&&m&&Object(o.createElement)(a.Popover,{onClose:()=>p(!1)},n),r&&Object(o.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:r(t),label:Object(l.sprintf)(// Translators: %s label.
38
+ Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const f=e=>Object(o.createElement)(p.b,e),w=e=>{const{list:t,selected:c,renderItem:n,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,n({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(o.createElement)(w,r()({},e,{list:t.children,depth:l+1})))})):null},_=e=>{let{isLoading:t,isSingle:c,selected:n,messages:r,onChange:s,onRemove:i}=e;if(t||c||!n)return null;const u=n.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,r.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":r.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,n.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},v=e=>{let{filteredList:t,search:c,onSelect:n,instanceId:r,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=a,p=b||f;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:p,onSelect:n,instanceId:r,isSingle:m,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:n,isLoading:l,isSingle:s,list:i,messages:u=m.a,onChange:p,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,f]=Object(o.useState)(""),w=Object(d.useInstanceId)(y),k=Object(o.useMemo)(()=>({...m.a,...u}),[u]),E=Object(o.useMemo)(()=>Object(m.c)(i,h,n),[i,h,n]);Object(o.useEffect)(()=>{j&&j(k.updated)},[j,k]),Object(o.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(o.useCallback)(e=>()=>{s&&p([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});p([...O.slice(0,t),...O.slice(t+1)])},[s,O,p]),C=Object(o.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?p(s?[e]:[...O,e]):S(e.id)()},[s,S,p,O]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(_,r()({},e,{onRemove:S,messages:k})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:k.search,type:"search",value:h,onChange:e=>f(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(v,r()({},e,{search:h,filteredList:E,messages:k,onSelect:C,instanceId:w})))};Object(a.withSpokenMessages)(y)},99:function(e,t,c){"use strict";var n=c(0),r=c(7),o=c(1),l=c(3),a=c(11);function s(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(n.createElement)(a.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(a.Path,{d:c[t]})):null}class i extends n.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(n.createElement)(s,{level:e}),title:Object(o.sprintf)(
39
  /* translators: %s: heading level e.g: "2", "3", "4" */
40
  Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:o,onChange:a}=this.props;return Object(n.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(s,{level:o}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,o,a))})}}t.a=i}});
build/blocks-checkout.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-warning'), 'version' => '6271720a10efed858db982752304594e');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-warning'), 'version' => '6cc4f730f651342b16916c50a292828e');
build/cart-blocks/cart-express-payment-frontend.js CHANGED
@@ -1,5 +1,5 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{104:function(e,t,n){"use strict";var s=n(0);t.a=function(e){let{icon:t,size:n=24,...c}=e;return Object(s.cloneElement)(t,{width:n,height:n,...c})}},256:function(e,t){},265:function(e,t){},267:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var s=n(1),c=n(7),o=n(5),r=n(18),a=n(31),i=n(0),l=n(245);const p=()=>{const{notices:e,createSnackbarNotice:t,removeSnackbarNotice:n,setIsSuppressed:s}=Object(l.b)(),c=Object(i.useRef)(e);Object(i.useEffect)(()=>{c.current=e},[e]);const o=Object(i.useMemo)(()=>({removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;c.current.forEach(t=>{null!==e&&t.status!==e||n(t.id)})},removeSnackbarNotice:n}),[n]),r=Object(i.useMemo)(()=>({addSnackbarNotice:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(e,n)}}),[t]);return{notices:e,...o,...r,setIsSuppressed:s}};var u=n(194);const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(a.a)(),{createErrorNotice:i}=Object(c.useDispatch)("core/notices"),{addSnackbarNotice:l}=p(),{setValidationErrors:d}=Object(u.b)(),m=Object(c.useSelect)((t,n)=>{let{dispatch:c}=n;const a=t(o.CART_STORE_KEY),p=a.isApplyingCoupon(),u=a.isRemovingCoupon(),{applyCoupon:m,removeCoupon:b,receiveApplyingCoupon:h}=c(o.CART_STORE_KEY);return{applyCoupon:e=>{m(e).then(t=>{!0===t&&l(Object(s.sprintf)(
2
  /* translators: %s coupon code. */
3
  Object(s.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),e),{id:"coupon-form"})}).catch(e=>{d({coupon:{message:Object(r.decodeEntities)(e.message),hidden:!1}}),h("")})},removeCoupon:t=>{b(t).then(e=>{!0===e&&l(Object(s.sprintf)(
4
  /* translators: %s coupon code. */
5
- Object(s.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form"})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),h("")})},isApplyingCoupon:p,isRemovingCoupon:u}},[i,l]);return{appliedCoupons:t,isLoading:n,...m}}},268:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var s=n(0),c=n(194);n(256);const o=e=>{let{errorMessage:t="",propertyName:n="",elementId:o=""}=e;const{getValidationError:r,getValidationErrorId:a}=Object(c.b)();if(!t||"string"!=typeof t){const e=r(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:a(o)},t))}},269:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var s=n(30),c=n(201);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:o,expressPaymentMethodsInitialized:r}=Object(c.b)(),a=Object(s.a)(t),i=Object(s.a)(n);return{paymentMethods:e?i:a,isInitialized:e?r:o}},r=()=>o(!1),a=()=>o(!0)},272:function(e,t,n){"use strict";var s=n(11),c=n.n(s),o=n(0),r=n(4),a=n.n(r);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:n=null,alt:s=""}=e;return n?Object(o.createElement)("img",{className:i(t),src:n,alt:s}):null},p=n(44);const u=[{id:"alipay",alt:"Alipay",src:p.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:p.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:p.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:p.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:p.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:p.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:p.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:p.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:p.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:p.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:p.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:p.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:p.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:p.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:p.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:p.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:p.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:p.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:p.l+"payment-methods/wechat.svg"}];var d=n(52);n(265),t.a=e=>{let{icons:t=[],align:n="center",className:s}=e;const r=(e=>{const t={};return e.forEach(e=>{let n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"==typeof e&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(d.a)(n.id)&&!t[n.id]&&(t[n.id]=n)}),Object.values(t)})(t);if(0===r.length)return null;const i=a()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===n,"wc-block-components-payment-method-icons--align-right":"right"===n},s);return Object(o.createElement)("div",{className:i},r.map(e=>{const t={...e,...(n=e.id,u.find(e=>e.id===n)||{})};var n;return Object(o.createElement)(l,c()({key:"payment-method-icon-"+e.id},t))}))}},282:function(e,t){},283:function(e,t,n){"use strict";var s=n(19),c=n.n(s),o=n(0),r=n(1),a=n(3),i=n(2),l=n(123),p=n(29);class u extends a.Component{constructor(){super(...arguments),c()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:n}=this.props;if(e){let e=Object(r.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(n||i.CURRENT_USER_IS_ADMIN)&&(e=t||Object(r.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const s=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(o.createElement)(l.a,{additionalNotices:s,context:p.c.PAYMENTS})}return this.props.children}}u.defaultProps={isEditor:!1},t.a=u},302:function(e,t){},303:function(e,t,n){"use strict";var s=n(0),c=n(1),o=n(335),r=n(269),a=n(26),i=n(201),l=n(32),p=n.n(l),u=n(283);t.a=()=>{const{isEditor:e}=Object(a.a)(),{setActivePaymentMethod:t,setExpressPaymentError:n,activePaymentMethod:l,paymentMethodData:d,setPaymentStatus:m}=Object(i.b)(),b=Object(o.a)(),{paymentMethods:h}=Object(r.a)(),g=Object(s.useRef)(l),v=Object(s.useRef)(d),j=Object(s.useCallback)(e=>()=>{g.current=l,v.current=d,m().started(),t(e)},[l,d,t,m]),y=Object(s.useCallback)(()=>{m().pristine(),t(g.current,v.current)},[t,m]),O=Object(s.useCallback)(e=>{m().error(e),n(e),t(g.current,v.current)},[t,m,n]),E=Object(s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";p()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?O(e):n("")}),[n,O]),f=Object.entries(h),k=f.length>0?f.map(t=>{let[n,c]=t;const o=e?c.edit:c.content;return Object(s.isValidElement)(o)?Object(s.createElement)("li",{key:n,id:"express-payment-method-"+n},Object(s.cloneElement)(o,{...b,onClick:j(n),onClose:y,onError:O,setExpressPaymentError:E})):null}):Object(s.createElement)("li",{key:"noneRegistered"},Object(c.__)("No registered Payment Methods","woo-gutenberg-products-block"));return Object(s.createElement)(u.a,{isEditor:e},Object(s.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},k))}},330:function(e,t,n){"use strict";var s=n(0),c=n(14);const o=Object(s.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(c.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}));t.a=o},335:function(e,t,n){"use strict";n.d(t,"a",(function(){return N}));var s=n(1),c=n(37),o=n(0),r=n(4),a=n.n(r),i=n(14),l=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),p=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"})),u=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})),d=n(330),m=n(104),b=n(52),h=n(61);n(282);const g={bank:p,bill:u,card:d.a,checkPayment:l};var v=e=>{let{icon:t="",text:n=""}=e;const s=!!t,c=Object(o.useCallback)(e=>s&&Object(b.a)(e)&&Object(h.b)(g,e),[s]),r=a()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":s});return Object(o.createElement)("span",{className:r},c(t)?Object(o.createElement)(m.a,{icon:g[t]}):t,n)},j=n(272),y=n(2),O=n(32),E=n.n(O),f=n(137),k=n(268),w=n(31),S=n(267),P=n(29),_=n(34),C=n(201),x=n(66),R=n(46);const M=(e,t)=>{const n=[],c=(t,n)=>{const s=n+"_tax",c=Object(h.b)(e,n)&&Object(b.a)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:c,valueWithTax:c+(Object(h.b)(e,s)&&Object(b.a)(e[s])?parseInt(e[s],10):0)}};return n.push(c(Object(s.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),n.push(c(Object(s.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),n.push(c(Object(s.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),n.push({key:"total_tax",label:Object(s.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(c(Object(s.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),n};var I=n(64);const N=()=>{const{isCalculating:e,isComplete:t,isIdle:n,isProcessing:r,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:i,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onSubmit:u,customerId:d}=Object(_.b)(),{currentStatus:m,activePaymentMethod:b,onPaymentProcessing:h,setExpressPaymentError:g,shouldSavePayment:O}=Object(C.b)(),{shippingErrorStatus:N,shippingErrorTypes:z,onShippingRateSuccess:T,onShippingRateFail:A,onShippingRateSelectSuccess:V,onShippingRateSelectFail:D}=Object(x.b)(),{shippingRates:B,isLoadingRates:L,selectedRates:F,isSelectingRate:H,selectShippingRate:W,needsShipping:G}=Object(I.a)(),{billingData:Y,shippingAddress:J,setShippingAddress:U}=Object(R.b)(),{cartItems:K,cartFees:X,cartTotals:q,extensions:Q}=Object(w.a)(),{appliedCoupons:Z}=Object(S.a)(),{noticeContexts:$,responseTypes:ee}=Object(P.d)(),te=Object(o.useRef)(M(q,G)),ne=Object(o.useRef)({label:Object(s.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)});Object(o.useEffect)(()=>{te.current=M(q,G),ne.current={label:Object(s.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)}},[q,G]);const se=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";E()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),g(e)}),[g]);return{activePaymentMethod:b,billing:{appliedCoupons:Z,billingData:Y,cartTotal:ne.current,cartTotalItems:te.current,currency:Object(c.getCurrencyFromPriceResponse)(q),customerId:d,displayPricesIncludingTax:Object(y.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:K,cartFees:X,extensions:Q},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:n,isProcessing:r},components:{LoadingMask:f.a,PaymentMethodIcons:j.a,PaymentMethodLabel:v,ValidationInputError:k.a},emitResponse:{noticeContexts:$,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:p,onCheckoutAfterProcessingWithSuccess:l,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:i,onPaymentProcessing:h,onShippingRateFail:A,onShippingRateSelectFail:D,onShippingRateSelectSuccess:V,onShippingRateSuccess:T},onSubmit:u,paymentStatus:m,setExpressPaymentError:se,shippingData:{isSelectingRate:H,needsShipping:G,selectedRates:F,setSelectedRates:W,setShippingAddress:U,shippingAddress:J,shippingRates:B,shippingRatesLoading:L},shippingStatus:{shippingErrorStatus:N,shippingErrorTypes:z},shouldSavePayment:O}}},435:function(e,t,n){"use strict";n.r(t);var s=n(0),c=n(31),o=n(4),r=n.n(o),a=n(1),i=n(269),l=n(29),p=n(34),u=n(201),d=n(123),m=n(137),b=n(303);n(302);var h=()=>{const{paymentMethods:e,isInitialized:t}=Object(i.a)(),{noticeContexts:n}=Object(l.d)(),{isCalculating:c,isProcessing:o,isAfterProcessing:r,isBeforeProcessing:h,isComplete:g,hasError:v}=Object(p.b)(),{currentStatus:j}=Object(u.b)();if(!t||t&&0===Object.keys(e).length)return null;const y=o||r||h||g&&!v;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(m.a,{isLoading:c||y||j.isDoingExpressPayment},Object(s.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(s.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(s.createElement)(d.a,{context:n.EXPRESS_PAYMENTS}),Object(s.createElement)(b.a,null)))),Object(s.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(a.__)("Or","woo-gutenberg-products-block")))};t.default=e=>{let{className:t}=e;const{cartNeedsPayment:n}=Object(c.a)();return n?Object(s.createElement)("div",{className:r()("wc-block-cart__payment-options",t)},Object(s.createElement)(h,null)):null}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{105:function(e,t,n){"use strict";var s=n(0);t.a=function(e){let{icon:t,size:n=24,...c}=e;return Object(s.cloneElement)(t,{width:n,height:n,...c})}},256:function(e,t){},265:function(e,t){},267:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var s=n(1),c=n(7),o=n(5),r=n(18),a=n(31),i=n(0),l=n(245);const p=()=>{const{notices:e,createSnackbarNotice:t,removeSnackbarNotice:n,setIsSuppressed:s}=Object(l.b)(),c=Object(i.useRef)(e);Object(i.useEffect)(()=>{c.current=e},[e]);const o=Object(i.useMemo)(()=>({removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;c.current.forEach(t=>{null!==e&&t.status!==e||n(t.id)})},removeSnackbarNotice:n}),[n]),r=Object(i.useMemo)(()=>({addSnackbarNotice:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(e,n)}}),[t]);return{notices:e,...o,...r,setIsSuppressed:s}};var u=n(194);const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(a.a)(),{createErrorNotice:i}=Object(c.useDispatch)("core/notices"),{addSnackbarNotice:l}=p(),{setValidationErrors:d}=Object(u.b)(),m=Object(c.useSelect)((t,n)=>{let{dispatch:c}=n;const a=t(o.CART_STORE_KEY),p=a.isApplyingCoupon(),u=a.isRemovingCoupon(),{applyCoupon:m,removeCoupon:b,receiveApplyingCoupon:h}=c(o.CART_STORE_KEY);return{applyCoupon:e=>{m(e).then(t=>{!0===t&&l(Object(s.sprintf)(
2
  /* translators: %s coupon code. */
3
  Object(s.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),e),{id:"coupon-form"})}).catch(e=>{d({coupon:{message:Object(r.decodeEntities)(e.message),hidden:!1}}),h("")})},removeCoupon:t=>{b(t).then(e=>{!0===e&&l(Object(s.sprintf)(
4
  /* translators: %s coupon code. */
5
+ Object(s.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form"})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),h("")})},isApplyingCoupon:p,isRemovingCoupon:u}},[i,l]);return{appliedCoupons:t,isLoading:n,...m}}},268:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var s=n(0),c=n(194);n(256);const o=e=>{let{errorMessage:t="",propertyName:n="",elementId:o=""}=e;const{getValidationError:r,getValidationErrorId:a}=Object(c.b)();if(!t||"string"!=typeof t){const e=r(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:a(o)},t))}},269:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var s=n(30),c=n(201);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:o,expressPaymentMethodsInitialized:r}=Object(c.b)(),a=Object(s.a)(t),i=Object(s.a)(n);return{paymentMethods:e?i:a,isInitialized:e?r:o}},r=()=>o(!1),a=()=>o(!0)},272:function(e,t,n){"use strict";var s=n(11),c=n.n(s),o=n(0),r=n(4),a=n.n(r);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:n=null,alt:s=""}=e;return n?Object(o.createElement)("img",{className:i(t),src:n,alt:s}):null},p=n(44);const u=[{id:"alipay",alt:"Alipay",src:p.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:p.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:p.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:p.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:p.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:p.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:p.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:p.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:p.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:p.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:p.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:p.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:p.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:p.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:p.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:p.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:p.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:p.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:p.l+"payment-methods/wechat.svg"}];var d=n(52);n(265),t.a=e=>{let{icons:t=[],align:n="center",className:s}=e;const r=(e=>{const t={};return e.forEach(e=>{let n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"==typeof e&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(d.a)(n.id)&&!t[n.id]&&(t[n.id]=n)}),Object.values(t)})(t);if(0===r.length)return null;const i=a()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===n,"wc-block-components-payment-method-icons--align-right":"right"===n},s);return Object(o.createElement)("div",{className:i},r.map(e=>{const t={...e,...(n=e.id,u.find(e=>e.id===n)||{})};var n;return Object(o.createElement)(l,c()({key:"payment-method-icon-"+e.id},t))}))}},282:function(e,t){},283:function(e,t,n){"use strict";var s=n(19),c=n.n(s),o=n(0),r=n(1),a=n(3),i=n(2),l=n(124),p=n(29);class u extends a.Component{constructor(){super(...arguments),c()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:n}=this.props;if(e){let e=Object(r.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(n||i.CURRENT_USER_IS_ADMIN)&&(e=t||Object(r.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const s=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(o.createElement)(l.a,{additionalNotices:s,context:p.c.PAYMENTS})}return this.props.children}}u.defaultProps={isEditor:!1},t.a=u},302:function(e,t){},303:function(e,t,n){"use strict";var s=n(0),c=n(1),o=n(335),r=n(269),a=n(27),i=n(201),l=n(32),p=n.n(l),u=n(283);t.a=()=>{const{isEditor:e}=Object(a.a)(),{setActivePaymentMethod:t,setExpressPaymentError:n,activePaymentMethod:l,paymentMethodData:d,setPaymentStatus:m}=Object(i.b)(),b=Object(o.a)(),{paymentMethods:h}=Object(r.a)(),g=Object(s.useRef)(l),v=Object(s.useRef)(d),j=Object(s.useCallback)(e=>()=>{g.current=l,v.current=d,m().started(),t(e)},[l,d,t,m]),y=Object(s.useCallback)(()=>{m().pristine(),t(g.current,v.current)},[t,m]),O=Object(s.useCallback)(e=>{m().error(e),n(e),t(g.current,v.current)},[t,m,n]),E=Object(s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";p()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?O(e):n("")}),[n,O]),f=Object.entries(h),k=f.length>0?f.map(t=>{let[n,c]=t;const o=e?c.edit:c.content;return Object(s.isValidElement)(o)?Object(s.createElement)("li",{key:n,id:"express-payment-method-"+n},Object(s.cloneElement)(o,{...b,onClick:j(n),onClose:y,onError:O,setExpressPaymentError:E})):null}):Object(s.createElement)("li",{key:"noneRegistered"},Object(c.__)("No registered Payment Methods","woo-gutenberg-products-block"));return Object(s.createElement)(u.a,{isEditor:e},Object(s.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},k))}},330:function(e,t,n){"use strict";var s=n(0),c=n(15);const o=Object(s.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(c.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}));t.a=o},335:function(e,t,n){"use strict";n.d(t,"a",(function(){return N}));var s=n(1),c=n(37),o=n(0),r=n(4),a=n.n(r),i=n(15),l=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),p=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"})),u=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})),d=n(330),m=n(105),b=n(52),h=n(61);n(282);const g={bank:p,bill:u,card:d.a,checkPayment:l};var v=e=>{let{icon:t="",text:n=""}=e;const s=!!t,c=Object(o.useCallback)(e=>s&&Object(b.a)(e)&&Object(h.b)(g,e),[s]),r=a()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":s});return Object(o.createElement)("span",{className:r},c(t)?Object(o.createElement)(m.a,{icon:g[t]}):t,n)},j=n(272),y=n(2),O=n(32),E=n.n(O),f=n(137),k=n(268),w=n(31),S=n(267),P=n(29),_=n(34),C=n(201),x=n(66),R=n(46);const M=(e,t)=>{const n=[],c=(t,n)=>{const s=n+"_tax",c=Object(h.b)(e,n)&&Object(b.a)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:c,valueWithTax:c+(Object(h.b)(e,s)&&Object(b.a)(e[s])?parseInt(e[s],10):0)}};return n.push(c(Object(s.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),n.push(c(Object(s.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),n.push(c(Object(s.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),n.push({key:"total_tax",label:Object(s.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(c(Object(s.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),n};var I=n(64);const N=()=>{const{isCalculating:e,isComplete:t,isIdle:n,isProcessing:r,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:i,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onSubmit:u,customerId:d}=Object(_.b)(),{currentStatus:m,activePaymentMethod:b,onPaymentProcessing:h,setExpressPaymentError:g,shouldSavePayment:O}=Object(C.b)(),{shippingErrorStatus:N,shippingErrorTypes:z,onShippingRateSuccess:T,onShippingRateFail:A,onShippingRateSelectSuccess:V,onShippingRateSelectFail:D}=Object(x.b)(),{shippingRates:B,isLoadingRates:L,selectedRates:F,isSelectingRate:H,selectShippingRate:W,needsShipping:G}=Object(I.a)(),{billingData:Y,shippingAddress:J,setShippingAddress:U}=Object(R.b)(),{cartItems:K,cartFees:X,cartTotals:q,extensions:Q}=Object(w.a)(),{appliedCoupons:Z}=Object(S.a)(),{noticeContexts:$,responseTypes:ee}=Object(P.d)(),te=Object(o.useRef)(M(q,G)),ne=Object(o.useRef)({label:Object(s.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)});Object(o.useEffect)(()=>{te.current=M(q,G),ne.current={label:Object(s.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)}},[q,G]);const se=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";E()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),g(e)}),[g]);return{activePaymentMethod:b,billing:{appliedCoupons:Z,billingData:Y,cartTotal:ne.current,cartTotalItems:te.current,currency:Object(c.getCurrencyFromPriceResponse)(q),customerId:d,displayPricesIncludingTax:Object(y.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:K,cartFees:X,extensions:Q},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:n,isProcessing:r},components:{LoadingMask:f.a,PaymentMethodIcons:j.a,PaymentMethodLabel:v,ValidationInputError:k.a},emitResponse:{noticeContexts:$,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:p,onCheckoutAfterProcessingWithSuccess:l,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:i,onPaymentProcessing:h,onShippingRateFail:A,onShippingRateSelectFail:D,onShippingRateSelectSuccess:V,onShippingRateSuccess:T},onSubmit:u,paymentStatus:m,setExpressPaymentError:se,shippingData:{isSelectingRate:H,needsShipping:G,selectedRates:F,setSelectedRates:W,setShippingAddress:U,shippingAddress:J,shippingRates:B,shippingRatesLoading:L},shippingStatus:{shippingErrorStatus:N,shippingErrorTypes:z},shouldSavePayment:O}}},435:function(e,t,n){"use strict";n.r(t);var s=n(0),c=n(31),o=n(4),r=n.n(o),a=n(1),i=n(269),l=n(29),p=n(34),u=n(201),d=n(124),m=n(137),b=n(303);n(302);var h=()=>{const{paymentMethods:e,isInitialized:t}=Object(i.a)(),{noticeContexts:n}=Object(l.d)(),{isCalculating:c,isProcessing:o,isAfterProcessing:r,isBeforeProcessing:h,isComplete:g,hasError:v}=Object(p.b)(),{currentStatus:j}=Object(u.b)();if(!t||t&&0===Object.keys(e).length)return null;const y=o||r||h||g&&!v;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(m.a,{isLoading:c||y||j.isDoingExpressPayment},Object(s.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(s.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(s.createElement)(d.a,{context:n.EXPRESS_PAYMENTS}),Object(s.createElement)(b.a,null)))),Object(s.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(a.__)("Or","woo-gutenberg-products-block")))};t.default=e=>{let{className:t}=e;const{cartNeedsPayment:n}=Object(c.a)();return n?Object(s.createElement)("div",{className:r()("wc-block-cart__payment-options",t)},Object(s.createElement)(h,null)):null}}}]);
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js CHANGED
@@ -1,4 +1,4 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{101:function(e,t,c){"use strict";var a=c(11),r=c.n(a),n=c(0),l=c(139),o=c(4),i=c.n(o);c(192);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:a,onValueChange:o,displayType:u="text",...m}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**a.minorUnit;if(!Number.isFinite(p))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),O={...m,...s(a),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const t=+e.value*10**a.minorUnit;o(t)}:()=>{};return Object(n.createElement)(l.a,r()({className:d,displayType:u},O,{value:p,onValueChange:j}))}},192:function(e,t){},275:function(e,t,c){"use strict";var a=c(0),r=c(4),n=c.n(r);c(299),t.a=e=>{let{children:t,className:c}=e;return Object(a.createElement)("div",{className:n()("wc-block-components-product-badge",c)},t)}},277:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(101),l=c(4),o=c.n(l),i=c(37);c(278);const s=e=>{let{currency:t,maxPrice:c,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
  Object(r.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(c))),Object(a.createElement)("span",{"aria-hidden":!0},Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:t,value:l,style:u})," — ",Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Previous price:","woo-gutenberg-products-block")),Object(a.createElement)(n.a,{currency:t,renderText:e=>Object(a.createElement)("del",{className:o()("wc-block-components-product-price__regular",c),style:l},e),value:i}),Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:","woo-gutenberg-products-block")),Object(a.createElement)(n.a,{currency:t,renderText:e=>Object(a.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};t.a=e=>{let{align:t,className:c,currency:r,format:l="<price/>",maxPrice:i,minPrice:m,price:b,priceClassName:p,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:_}=e;const y=o()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));const g=O&&b!==O;let f=Object(a.createElement)("span",{className:o()("wc-block-components-product-price__value",p)});return g?f=Object(a.createElement)(u,{currency:r,price:b,priceClassName:p,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:_}):void 0!==m&&void 0!==i?f=Object(a.createElement)(s,{currency:r,maxPrice:i,minPrice:m,priceClassName:p,priceStyle:d}):b&&(f=Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",p),currency:r,value:b,style:d})),Object(a.createElement)("span",{className:y},Object(a.createInterpolateElement)(l,{price:f}))}},278:function(e,t){},279:function(e,t,c){"use strict";var a=c(11),r=c.n(a),n=c(0),l=c(18),o=c(4),i=c.n(o);c(280),t.a=e=>{let{className:t="",disabled:c=!1,name:a,permalink:o="",target:s,rel:u,style:m,onClick:b,...p}=e;const d=i()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",r()({className:d},e,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(a)}}))}return Object(n.createElement)("a",r()({className:d,href:o,target:s},p,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(a)},style:m}))}},280:function(e,t){},286:function(e,t,c){"use strict";var a=c(0),r=c(115),n=c(116);const l=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},o=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),i=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,s=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const a=o(e),r=a.split(" ").splice(0,t).join(" ");return Object(n.autop)(i(r,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const r=o(e),l=r.slice(0,t);if(c)return Object(n.autop)(i(l,a));const s=l.match(/([\s]+)/g),u=s?s.length:0,m=r.slice(0,t+u);return Object(n.autop)(i(m,a))};t.a=e=>{let{source:t,maxLength:c=15,countType:o="words",className:i="",style:m={}}=e;const b=Object(a.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const a=Object(n.autop)(e),o=Object(r.count)(a,c);if(o<=t)return a;const i=l(a),m=Object(r.count)(i,c);return m<=t?i:"words"===c?s(i,t):u(i,t,"characters_including_spaces"===c)}(t,c,o),[t,c,o]);return Object(a.createElement)(a.RawHTML,{style:m,className:i},b)}},298:function(e,t){},299:function(e,t){},300:function(e,t){},301:function(e,t){},327:function(e,t,c){"use strict";var a=c(11),r=c.n(a),n=c(0),l=c(18),o=c(2);c(298),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const a=t.thumbnail?{src:t.thumbnail,alt:Object(l.decodeEntities)(t.alt)||c||"Product Image"}:{src:o.PLACEHOLDER_IMG_SRC,alt:""};return Object(n.createElement)("img",r()({className:"wc-block-components-product-image"},a,{alt:a.alt}))}},328:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(275);t.a=()=>Object(a.createElement)(n.a,{className:"wc-block-components-product-backorder-badge"},Object(r.__)("Available on backorder","woo-gutenberg-products-block"))},329:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(275);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(a.createElement)(n.a,{className:"wc-block-components-product-low-stock-badge"},Object(r.sprintf)(
4
  /* translators: %d stock amount (number of items in stock for product) */
@@ -8,7 +8,7 @@ Object(l.__)("Quantity of %s in your cart.","woo-gutenberg-products-block"),p)})
8
  /* translators: %s refers to the item name in the cart. */
9
  Object(l.__)("Quantity reduced to %s.","woo-gutenberg-products-block"),e)),g(e)}},"-"),Object(a.createElement)("button",{"aria-label":Object(l.__)("Increase quantity","woo-gutenberg-products-block"),disabled:d||!y,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=c+b;m(e),Object(o.speak)(Object(l.sprintf)(
10
  /* translators: %s refers to the item name in the cart. */
11
- Object(l.__)("Quantity increased to %s.","woo-gutenberg-products-block"),e)),g(e)}},"+"))},m=c(277),b=c(279),p=c(7),d=c(5),O=c(98),j=c(58),_=c(68),y=c(61),g=c(52),f=c(69),k=c(31),E=c(34);var w=c(40),v=c(327),N=c(328),h=c(329),C=c(101),x=c(275),P=e=>{let{currency:t,saleAmount:c,format:r="<price/>"}=e;if(!c||c<=0)return null;r.includes("<price/>")||(r="<price/>",console.error("Price formats need to include the `<price/>` tag."));const n=Object(l.sprintf)(
12
  /* translators: %s will be replaced by the discount amount */
13
  Object(l.__)("Save %s","woo-gutenberg-products-block"),r);return Object(a.createElement)(x.a,{className:"wc-block-components-sale-badge"},Object(a.createInterpolateElement)(n,{price:Object(a.createElement)(C.a,{currency:t,value:c})}))},I=c(339),S=c(37),q=c(10),D=c(326),A=c(2);const R=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),T=e=>Object(q.mustContain)(e,"<price/>");var F=Object(a.forwardRef)((e,t)=>{let{lineItem:c,onRemove:r=(()=>{}),tabIndex:i=null}=e;const{name:s="",catalog_visibility:C="visible",short_description:x="",description:F="",low_stock_remaining:M=null,show_backorder_badge:L=!1,quantity_limits:U={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:Q=!1,permalink:V="",images:$=[],variation:H=[],item_data:B=[],prices:K={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:W={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:J}=c,{quantity:Y,setItemQuantity:z,removeItem:G,isPendingDelete:X}=(e=>{const t={key:"",quantity:1};(e=>Object(y.a)(e)&&Object(y.b)(e,"key")&&Object(y.b)(e,"quantity")&&Object(g.a)(e.key)&&Object(f.a)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:c="",quantity:r=1}=t,{cartErrors:n}=Object(k.a)(),{dispatchActions:l}=Object(E.b)(),[o,i]=Object(a.useState)(r),[s]=Object(O.a)(o,400),u=Object(j.a)(s),{removeItemFromCart:m,changeCartItemQuantity:b}=Object(p.useDispatch)(d.CART_STORE_KEY);Object(a.useEffect)(()=>i(r),[r]);const w=Object(p.useSelect)(e=>{if(!c)return{quantity:!1,delete:!1};const t=e(d.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(c),delete:t.isItemPendingDelete(c)}},[c]),v=Object(a.useCallback)(()=>c?m(c).then(()=>(Object(_.d)(),!0)):Promise.resolve(!1),[c,m]);return Object(a.useEffect)(()=>{c&&Object(f.a)(u)&&Number.isFinite(u)&&u!==s&&b(c,s)},[c,b,s,u]),Object(a.useEffect)(()=>(w.delete?l.incrementCalculating():l.decrementCalculating(),()=>{w.delete&&l.decrementCalculating()}),[l,w.delete]),Object(a.useEffect)(()=>(w.quantity||s!==o?l.incrementCalculating():l.decrementCalculating(),()=>{(w.quantity||s!==o)&&l.decrementCalculating()}),[l,w.quantity,s,o]),{isPendingDelete:w.delete,quantity:o,setItemQuantity:i,removeItem:v,cartItemQuantityErrors:n}})(c),{dispatchStoreEvent:Z}=Object(w.a)(),{receiveCart:ee,...te}=Object(k.a)(),ce=Object(a.useMemo)(()=>({context:"cart",cartItem:c,cart:te}),[c,te]),ae=Object(S.getCurrencyFromPriceResponse)(K),re=Object(q.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:s,extensions:J,arg:ce}),ne=Object(D.a)({amount:parseInt(K.raw_prices.regular_price,10),precision:K.raw_prices.precision}),le=Object(D.a)({amount:parseInt(K.raw_prices.price,10),precision:K.raw_prices.precision}),oe=ne.subtract(le),ie=oe.multiply(Y),se=Object(S.getCurrencyFromPriceResponse)(W);let ue=parseInt(W.line_subtotal,10);Object(A.getSetting)("displayCartPricesIncludingTax",!1)&&(ue+=parseInt(W.line_subtotal_tax,10));const me=Object(D.a)({amount:ue,precision:se.minorUnit}),be=$.length?$[0]:{},pe="hidden"===C||"search"===C,de=Object(q.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:J,arg:ce}),Oe=Object(q.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:J,arg:ce,validation:T}),je=Object(q.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:J,arg:ce,validation:T}),_e=Object(q.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:J,arg:ce,validation:T});return Object(a.createElement)("tr",{className:n()("wc-block-cart-items__row",de,{"is-disabled":X}),ref:t,tabIndex:i},Object(a.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(y.b)(be,"alt")||!be.alt},pe?Object(a.createElement)(v.a,{image:be,fallbackAlt:re}):Object(a.createElement)("a",{href:V,tabIndex:-1},Object(a.createElement)(v.a,{image:be,fallbackAlt:re}))),Object(a.createElement)("td",{className:"wc-block-cart-item__product"},Object(a.createElement)("div",{className:"wc-block-cart-item__wrap"},Object(a.createElement)(b.a,{disabled:X||pe,name:re,permalink:V}),L?Object(a.createElement)(N.a,null):!!M&&Object(a.createElement)(h.a,{lowStockRemaining:M}),Object(a.createElement)("div",{className:"wc-block-cart-item__prices"},Object(a.createElement)(m.a,{currency:ae,regularPrice:R(ne,ae),price:R(le,ae),format:je})),Object(a.createElement)(P,{currency:ae,saleAmount:R(oe,ae),format:_e}),Object(a.createElement)(I.a,{shortDescription:x,fullDescription:F,itemData:B,variation:H}),Object(a.createElement)("div",{className:"wc-block-cart-item__quantity"},!Q&&!!U.editable&&Object(a.createElement)(u,{disabled:X,quantity:Y,minimum:U.minimum,maximum:U.maximum,step:U.multiple_of,onChange:e=>{z(e),Z("cart-set-item-quantity",{product:c,quantity:e})},itemName:re}),Object(a.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:()=>{r(),G(),Z("cart-remove-item",{product:c,quantity:Y}),Object(o.speak)(Object(l.sprintf)(
14
  /* translators: %s refers to the item name in the cart. */
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{102:function(e,t,c){"use strict";var a=c(11),r=c.n(a),n=c(0),l=c(139),o=c(4),i=c.n(o);c(192);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:a,onValueChange:o,displayType:u="text",...m}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**a.minorUnit;if(!Number.isFinite(p))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),O={...m,...s(a),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const t=+e.value*10**a.minorUnit;o(t)}:()=>{};return Object(n.createElement)(l.a,r()({className:d,displayType:u},O,{value:p,onValueChange:j}))}},192:function(e,t){},275:function(e,t,c){"use strict";var a=c(0),r=c(4),n=c.n(r);c(299),t.a=e=>{let{children:t,className:c}=e;return Object(a.createElement)("div",{className:n()("wc-block-components-product-badge",c)},t)}},277:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(102),l=c(4),o=c.n(l),i=c(37);c(278);const s=e=>{let{currency:t,maxPrice:c,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
  Object(r.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(c))),Object(a.createElement)("span",{"aria-hidden":!0},Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:t,value:l,style:u})," — ",Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Previous price:","woo-gutenberg-products-block")),Object(a.createElement)(n.a,{currency:t,renderText:e=>Object(a.createElement)("del",{className:o()("wc-block-components-product-price__regular",c),style:l},e),value:i}),Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:","woo-gutenberg-products-block")),Object(a.createElement)(n.a,{currency:t,renderText:e=>Object(a.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};t.a=e=>{let{align:t,className:c,currency:r,format:l="<price/>",maxPrice:i,minPrice:m,price:b,priceClassName:p,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:_}=e;const y=o()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));const g=O&&b!==O;let f=Object(a.createElement)("span",{className:o()("wc-block-components-product-price__value",p)});return g?f=Object(a.createElement)(u,{currency:r,price:b,priceClassName:p,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:_}):void 0!==m&&void 0!==i?f=Object(a.createElement)(s,{currency:r,maxPrice:i,minPrice:m,priceClassName:p,priceStyle:d}):b&&(f=Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",p),currency:r,value:b,style:d})),Object(a.createElement)("span",{className:y},Object(a.createInterpolateElement)(l,{price:f}))}},278:function(e,t){},279:function(e,t,c){"use strict";var a=c(11),r=c.n(a),n=c(0),l=c(18),o=c(4),i=c.n(o);c(280),t.a=e=>{let{className:t="",disabled:c=!1,name:a,permalink:o="",target:s,rel:u,style:m,onClick:b,...p}=e;const d=i()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",r()({className:d},e,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(a)}}))}return Object(n.createElement)("a",r()({className:d,href:o,target:s},p,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(a)},style:m}))}},280:function(e,t){},286:function(e,t,c){"use strict";var a=c(0),r=c(115),n=c(116);const l=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},o=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),i=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,s=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const a=o(e),r=a.split(" ").splice(0,t).join(" ");return Object(n.autop)(i(r,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const r=o(e),l=r.slice(0,t);if(c)return Object(n.autop)(i(l,a));const s=l.match(/([\s]+)/g),u=s?s.length:0,m=r.slice(0,t+u);return Object(n.autop)(i(m,a))};t.a=e=>{let{source:t,maxLength:c=15,countType:o="words",className:i="",style:m={}}=e;const b=Object(a.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const a=Object(n.autop)(e),o=Object(r.count)(a,c);if(o<=t)return a;const i=l(a),m=Object(r.count)(i,c);return m<=t?i:"words"===c?s(i,t):u(i,t,"characters_including_spaces"===c)}(t,c,o),[t,c,o]);return Object(a.createElement)(a.RawHTML,{style:m,className:i},b)}},298:function(e,t){},299:function(e,t){},300:function(e,t){},301:function(e,t){},327:function(e,t,c){"use strict";var a=c(11),r=c.n(a),n=c(0),l=c(18),o=c(2);c(298),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const a=t.thumbnail?{src:t.thumbnail,alt:Object(l.decodeEntities)(t.alt)||c||"Product Image"}:{src:o.PLACEHOLDER_IMG_SRC,alt:""};return Object(n.createElement)("img",r()({className:"wc-block-components-product-image"},a,{alt:a.alt}))}},328:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(275);t.a=()=>Object(a.createElement)(n.a,{className:"wc-block-components-product-backorder-badge"},Object(r.__)("Available on backorder","woo-gutenberg-products-block"))},329:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(275);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(a.createElement)(n.a,{className:"wc-block-components-product-low-stock-badge"},Object(r.sprintf)(
4
  /* translators: %d stock amount (number of items in stock for product) */
8
  /* translators: %s refers to the item name in the cart. */
9
  Object(l.__)("Quantity reduced to %s.","woo-gutenberg-products-block"),e)),g(e)}},"-"),Object(a.createElement)("button",{"aria-label":Object(l.__)("Increase quantity","woo-gutenberg-products-block"),disabled:d||!y,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=c+b;m(e),Object(o.speak)(Object(l.sprintf)(
10
  /* translators: %s refers to the item name in the cart. */
11
+ Object(l.__)("Quantity increased to %s.","woo-gutenberg-products-block"),e)),g(e)}},"+"))},m=c(277),b=c(279),p=c(7),d=c(5),O=c(99),j=c(58),_=c(68),y=c(61),g=c(52),f=c(69),k=c(31),E=c(34);var w=c(40),v=c(327),N=c(328),h=c(329),C=c(102),x=c(275),P=e=>{let{currency:t,saleAmount:c,format:r="<price/>"}=e;if(!c||c<=0)return null;r.includes("<price/>")||(r="<price/>",console.error("Price formats need to include the `<price/>` tag."));const n=Object(l.sprintf)(
12
  /* translators: %s will be replaced by the discount amount */
13
  Object(l.__)("Save %s","woo-gutenberg-products-block"),r);return Object(a.createElement)(x.a,{className:"wc-block-components-sale-badge"},Object(a.createInterpolateElement)(n,{price:Object(a.createElement)(C.a,{currency:t,value:c})}))},I=c(339),S=c(37),q=c(10),D=c(326),A=c(2);const R=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),T=e=>Object(q.mustContain)(e,"<price/>");var F=Object(a.forwardRef)((e,t)=>{let{lineItem:c,onRemove:r=(()=>{}),tabIndex:i=null}=e;const{name:s="",catalog_visibility:C="visible",short_description:x="",description:F="",low_stock_remaining:M=null,show_backorder_badge:L=!1,quantity_limits:U={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:Q=!1,permalink:V="",images:$=[],variation:H=[],item_data:B=[],prices:K={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:W={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:J}=c,{quantity:Y,setItemQuantity:z,removeItem:G,isPendingDelete:X}=(e=>{const t={key:"",quantity:1};(e=>Object(y.a)(e)&&Object(y.b)(e,"key")&&Object(y.b)(e,"quantity")&&Object(g.a)(e.key)&&Object(f.a)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:c="",quantity:r=1}=t,{cartErrors:n}=Object(k.a)(),{dispatchActions:l}=Object(E.b)(),[o,i]=Object(a.useState)(r),[s]=Object(O.a)(o,400),u=Object(j.a)(s),{removeItemFromCart:m,changeCartItemQuantity:b}=Object(p.useDispatch)(d.CART_STORE_KEY);Object(a.useEffect)(()=>i(r),[r]);const w=Object(p.useSelect)(e=>{if(!c)return{quantity:!1,delete:!1};const t=e(d.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(c),delete:t.isItemPendingDelete(c)}},[c]),v=Object(a.useCallback)(()=>c?m(c).then(()=>(Object(_.d)(),!0)):Promise.resolve(!1),[c,m]);return Object(a.useEffect)(()=>{c&&Object(f.a)(u)&&Number.isFinite(u)&&u!==s&&b(c,s)},[c,b,s,u]),Object(a.useEffect)(()=>(w.delete?l.incrementCalculating():l.decrementCalculating(),()=>{w.delete&&l.decrementCalculating()}),[l,w.delete]),Object(a.useEffect)(()=>(w.quantity||s!==o?l.incrementCalculating():l.decrementCalculating(),()=>{(w.quantity||s!==o)&&l.decrementCalculating()}),[l,w.quantity,s,o]),{isPendingDelete:w.delete,quantity:o,setItemQuantity:i,removeItem:v,cartItemQuantityErrors:n}})(c),{dispatchStoreEvent:Z}=Object(w.a)(),{receiveCart:ee,...te}=Object(k.a)(),ce=Object(a.useMemo)(()=>({context:"cart",cartItem:c,cart:te}),[c,te]),ae=Object(S.getCurrencyFromPriceResponse)(K),re=Object(q.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:s,extensions:J,arg:ce}),ne=Object(D.a)({amount:parseInt(K.raw_prices.regular_price,10),precision:K.raw_prices.precision}),le=Object(D.a)({amount:parseInt(K.raw_prices.price,10),precision:K.raw_prices.precision}),oe=ne.subtract(le),ie=oe.multiply(Y),se=Object(S.getCurrencyFromPriceResponse)(W);let ue=parseInt(W.line_subtotal,10);Object(A.getSetting)("displayCartPricesIncludingTax",!1)&&(ue+=parseInt(W.line_subtotal_tax,10));const me=Object(D.a)({amount:ue,precision:se.minorUnit}),be=$.length?$[0]:{},pe="hidden"===C||"search"===C,de=Object(q.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:J,arg:ce}),Oe=Object(q.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:J,arg:ce,validation:T}),je=Object(q.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:J,arg:ce,validation:T}),_e=Object(q.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:J,arg:ce,validation:T});return Object(a.createElement)("tr",{className:n()("wc-block-cart-items__row",de,{"is-disabled":X}),ref:t,tabIndex:i},Object(a.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(y.b)(be,"alt")||!be.alt},pe?Object(a.createElement)(v.a,{image:be,fallbackAlt:re}):Object(a.createElement)("a",{href:V,tabIndex:-1},Object(a.createElement)(v.a,{image:be,fallbackAlt:re}))),Object(a.createElement)("td",{className:"wc-block-cart-item__product"},Object(a.createElement)("div",{className:"wc-block-cart-item__wrap"},Object(a.createElement)(b.a,{disabled:X||pe,name:re,permalink:V}),L?Object(a.createElement)(N.a,null):!!M&&Object(a.createElement)(h.a,{lowStockRemaining:M}),Object(a.createElement)("div",{className:"wc-block-cart-item__prices"},Object(a.createElement)(m.a,{currency:ae,regularPrice:R(ne,ae),price:R(le,ae),format:je})),Object(a.createElement)(P,{currency:ae,saleAmount:R(oe,ae),format:_e}),Object(a.createElement)(I.a,{shortDescription:x,fullDescription:F,itemData:B,variation:H}),Object(a.createElement)("div",{className:"wc-block-cart-item__quantity"},!Q&&!!U.editable&&Object(a.createElement)(u,{disabled:X,quantity:Y,minimum:U.minimum,maximum:U.maximum,step:U.multiple_of,onChange:e=>{z(e),Z("cart-set-item-quantity",{product:c,quantity:e})},itemName:re}),Object(a.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:()=>{r(),G(),Z("cart-remove-item",{product:c,quantity:Y}),Object(o.speak)(Object(l.sprintf)(
14
  /* translators: %s refers to the item name in the cart. */
build/cart-blocks/cart-line-items-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{446:function(t,n,e){"use strict";e.r(n);var c=e(0),r=e(31),u=e(336);n.default=t=>{let{className:n}=t;const{cartItems:e,cartIsLoading:a}=Object(r.a)();return Object(c.createElement)(u.a,{className:n,lineItems:e,isLoading:a})}},98:function(t,n,e){"use strict";e.d(n,"a",(function(){return s}));var c=e(3),r=e(47);function u(t,n){return t===n}function a(t){return"function"==typeof t?function(){return t}:t}function s(t,n,e){var s=e&&e.equalityFn||u,o=function(t){var n=Object(c.useState)(a(t)),e=n[0],r=n[1];return[e,Object(c.useCallback)((function(t){return r(a(t))}),[])]}(t),i=o[0],f=o[1],l=Object(r.a)(Object(c.useCallback)((function(t){return f(t)}),[f]),n,e),b=Object(c.useRef)(t);return s(b.current,t)||(l(t),b.current=t),[i,l]}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{446:function(t,n,e){"use strict";e.r(n);var c=e(0),r=e(31),u=e(336);n.default=t=>{let{className:n}=t;const{cartItems:e,cartIsLoading:a}=Object(r.a)();return Object(c.createElement)(u.a,{className:n,lineItems:e,isLoading:a})}},99:function(t,n,e){"use strict";e.d(n,"a",(function(){return s}));var c=e(3),r=e(47);function u(t,n){return t===n}function a(t){return"function"==typeof t?function(){return t}:t}function s(t,n,e){var s=e&&e.equalityFn||u,o=function(t){var n=Object(c.useState)(a(t)),e=n[0],r=n[1];return[e,Object(c.useCallback)((function(t){return r(a(t))}),[])]}(t),i=o[0],f=o[1],l=Object(r.a)(Object(c.useCallback)((function(t){return f(t)}),[f]),n,e),b=Object(c.useRef)(t);return s(b.current,t)||(l(t),b.current=t),[i,l]}}}]);
build/cart-blocks/cart-order-summary-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{101:function(e,t,a){"use strict";var c=a(11),n=a.n(c),r=a(0),o=a(139),l=a(4),s=a.n(l);a(192);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:a,currency:c,onValueChange:l,displayType:u="text",...m}=e;const p="string"==typeof a?parseInt(a,10):a;if(!Number.isFinite(p))return null;const b=p/10**c.minorUnit;if(!Number.isFinite(b))return null;const d=s()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),f={...m,...i(c),value:void 0,currency:void 0,onValueChange:void 0},x=l?e=>{const t=+e.value*10**c.minorUnit;l(t)}:()=>{};return Object(r.createElement)(o.a,n()({className:d,displayType:u},f,{value:b,onValueChange:x}))}},192:function(e,t){},304:function(e,t){},373:function(e,t,a){"use strict";var c=a(0),n=a(1),r=a(4),o=a.n(r),l=a(101),s=a(10),i=a(31),u=a(2);a(304),t.a=e=>{let{currency:t,values:a,className:r}=e;const m=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:p,total_tax:b}=a,{receiveCart:d,...f}=Object(i.a)(),x=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(n.__)("Total","woo-gutenberg-products-block"),extensions:f.extensions,arg:{cart:f}}),O=parseInt(b,10);return Object(c.createElement)(s.TotalsItem,{className:o()("wc-block-components-totals-footer-item",r),currency:t,label:x,value:parseInt(p,10),description:m&&0!==O&&Object(c.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(c.createInterpolateElement)(Object(n.__)("Including <TaxAmount/> in taxes","woo-gutenberg-products-block"),{TaxAmount:Object(c.createElement)(l.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:O})}))})}},449:function(e,t,a){"use strict";a.r(t);var c=a(0),n=a(373),r=a(37),o=a(31),l=a(10);const s=()=>{const{extensions:e,receiveCart:t,...a}=Object(o.a)(),n={extensions:e,cart:a,context:"woocommerce/cart"};return Object(c.createElement)(l.ExperimentalOrderMeta.Slot,n)};t.default=e=>{let{children:t,className:a=""}=e;const{cartTotals:l}=Object(o.a)(),i=Object(r.getCurrencyFromPriceResponse)(l);return Object(c.createElement)("div",{className:a},t,Object(c.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(c.createElement)(n.a,{currency:i,values:l})),Object(c.createElement)(s,null))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{102:function(e,t,a){"use strict";var c=a(11),n=a.n(c),r=a(0),o=a(139),l=a(4),s=a.n(l);a(192);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:a,currency:c,onValueChange:l,displayType:u="text",...m}=e;const p="string"==typeof a?parseInt(a,10):a;if(!Number.isFinite(p))return null;const b=p/10**c.minorUnit;if(!Number.isFinite(b))return null;const d=s()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),f={...m,...i(c),value:void 0,currency:void 0,onValueChange:void 0},x=l?e=>{const t=+e.value*10**c.minorUnit;l(t)}:()=>{};return Object(r.createElement)(o.a,n()({className:d,displayType:u},f,{value:b,onValueChange:x}))}},192:function(e,t){},304:function(e,t){},373:function(e,t,a){"use strict";var c=a(0),n=a(1),r=a(4),o=a.n(r),l=a(102),s=a(10),i=a(31),u=a(2);a(304),t.a=e=>{let{currency:t,values:a,className:r}=e;const m=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:p,total_tax:b}=a,{receiveCart:d,...f}=Object(i.a)(),x=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(n.__)("Total","woo-gutenberg-products-block"),extensions:f.extensions,arg:{cart:f}}),O=parseInt(b,10);return Object(c.createElement)(s.TotalsItem,{className:o()("wc-block-components-totals-footer-item",r),currency:t,label:x,value:parseInt(p,10),description:m&&0!==O&&Object(c.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(c.createInterpolateElement)(Object(n.__)("Including <TaxAmount/> in taxes","woo-gutenberg-products-block"),{TaxAmount:Object(c.createElement)(l.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:O})}))})}},449:function(e,t,a){"use strict";a.r(t);var c=a(0),n=a(373),r=a(37),o=a(31),l=a(10);const s=()=>{const{extensions:e,receiveCart:t,...a}=Object(o.a)(),n={extensions:e,cart:a,context:"woocommerce/cart"};return Object(c.createElement)(l.ExperimentalOrderMeta.Slot,n)};t.default=e=>{let{children:t,className:a=""}=e;const{cartTotals:l}=Object(o.a)(),i=Object(r.getCurrencyFromPriceResponse)(l);return Object(c.createElement)("div",{className:a},t,Object(c.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(c.createElement)(n.a,{currency:i,values:l})),Object(c.createElement)(s,null))}}}]);
build/cart-blocks/order-summary-discount-frontend.js CHANGED
@@ -1,4 +1,4 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[21],{104:function(e,t,o){"use strict";var c=o(0);t.a=function(e){let{icon:t,size:o=24,...n}=e;return Object(c.cloneElement)(t,{width:o,height:o,...n})}},120:function(e,t){},196:function(e,t,o){"use strict";var c=o(0),n=o(14);const s=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=s},200:function(e,t,o){"use strict";var c=o(11),n=o.n(c),s=o(0),r=o(4),a=o.n(r),l=o(1),i=o(104),u=o(196);o(120);var p=e=>{let{text:t,screenReaderText:o="",element:c="li",className:r="",radius:l="small",children:i=null,...u}=e;const p=c,b=a()(r,"wc-block-components-chip","wc-block-components-chip--radius-"+l),m=Boolean(o&&o!==t);return Object(s.createElement)(p,n()({className:b},u),Object(s.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(s.createElement)("span",{className:"screen-reader-text"},o),i)};t.a=e=>{let{ariaLabel:t="",className:o="",disabled:c=!1,onRemove:r=(()=>{}),removeOnAnyClick:b=!1,text:m,screenReaderText:d="",...O}=e;const g=b?"span":"button";if(!t){const e=d&&"string"==typeof d?d:m;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)(
4
  /* translators: %s text of the chip to remove. */
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[21],{105:function(e,t,o){"use strict";var c=o(0);t.a=function(e){let{icon:t,size:o=24,...n}=e;return Object(c.cloneElement)(t,{width:o,height:o,...n})}},122:function(e,t){},196:function(e,t,o){"use strict";var c=o(0),n=o(15);const s=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=s},200:function(e,t,o){"use strict";var c=o(11),n=o.n(c),s=o(0),r=o(4),a=o.n(r),l=o(1),i=o(105),u=o(196);o(122);var p=e=>{let{text:t,screenReaderText:o="",element:c="li",className:r="",radius:l="small",children:i=null,...u}=e;const p=c,b=a()(r,"wc-block-components-chip","wc-block-components-chip--radius-"+l),m=Boolean(o&&o!==t);return Object(s.createElement)(p,n()({className:b},u),Object(s.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(s.createElement)("span",{className:"screen-reader-text"},o),i)};t.a=e=>{let{ariaLabel:t="",className:o="",disabled:c=!1,onRemove:r=(()=>{}),removeOnAnyClick:b=!1,text:m,screenReaderText:d="",...O}=e;const g=b?"span":"button";if(!t){const e=d&&"string"==typeof d?d:m;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)(
4
  /* translators: %s text of the chip to remove. */
build/cart-blocks/order-summary-heading-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[23],{260:function(e,t,c){"use strict";var n=c(11),o=c.n(n),a=c(0),l=c(4),s=c.n(l);c(261),t.a=e=>{let{children:t,className:c,headingLevel:n,...l}=e;const r=s()("wc-block-components-title",c),i="h"+n;return Object(a.createElement)(i,o()({className:r},l),t)}},261:function(e,t){},436:function(e,t,c){"use strict";c.r(t);var n=c(118),o=c(0),a=c(260),l=c(4),s=c.n(l),r=c(1),i={content:{type:"string",default:Object(r.__)("Cart totals","woo-gutenberg-products-block")},lock:{type:"object",default:{remove:!1,move:!1}}};t.default=Object(n.withFilteredAttributes)(i)(e=>{let{className:t,content:c=""}=e;return Object(o.createElement)(a.a,{headingLevel:"2",className:s()(t,"wc-block-cart__totals-title")},c)})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[23],{260:function(e,t,c){"use strict";var n=c(11),o=c.n(n),a=c(0),l=c(4),s=c.n(l);c(261),t.a=e=>{let{children:t,className:c,headingLevel:n,...l}=e;const r=s()("wc-block-components-title",c),i="h"+n;return Object(a.createElement)(i,o()({className:r},l),t)}},261:function(e,t){},436:function(e,t,c){"use strict";c.r(t);var n=c(120),o=c(0),a=c(260),l=c(4),s=c.n(l),r=c(1),i={content:{type:"string",default:Object(r.__)("Cart totals","woo-gutenberg-products-block")},lock:{type:"object",default:{remove:!1,move:!1}}};t.default=Object(n.withFilteredAttributes)(i)(e=>{let{className:t,content:c=""}=e;return Object(o.createElement)(a.a,{headingLevel:"2",className:s()(t,"wc-block-cart__totals-title")},c)})}}]);
build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js CHANGED
@@ -1,4 +1,4 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5],{101:function(e,t,n){"use strict";var a=n(11),c=n.n(a),o=n(0),s=n(139),r=n(4),l=n.n(r);n(192);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:n,currency:a,onValueChange:r,displayType:p="text",...u}=e;const d="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(d))return null;const b=d/10**a.minorUnit;if(!Number.isFinite(b))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...u,...i(a),value:void 0,currency:void 0,onValueChange:void 0},O=r?e=>{const t=+e.value*10**a.minorUnit;r(t)}:()=>{};return Object(o.createElement)(s.a,c()({className:m,displayType:p},g,{value:b,onValueChange:O}))}},192:function(e,t){},22:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:s,wrapperProps:r={}}=e;const l=null!=n,i=null!=c;return!l&&i?(t=s||"span",r={...r,className:o()(r.className,"screen-reader-text")},Object(a.createElement)(t,r,c)):(t=s||a.Fragment,l&&i&&n!==c?Object(a.createElement)(t,r,Object(a.createElement)("span",{"aria-hidden":"true"},n),Object(a.createElement)("span",{className:"screen-reader-text"},c)):Object(a.createElement)(t,r,n))}},256:function(e,t){},257:function(e,t){},258:function(e,t,n){"use strict";var a=n(11),c=n.n(a),o=n(0),s=n(50),r=n(4),l=n.n(r),i=n(135);n(259),t.a=e=>{let{className:t,showSpinner:n=!1,children:a,variant:r="contained",...p}=e;const u=l()("wc-block-components-button",t,r,{"wc-block-components-button--loading":n});return Object(o.createElement)(s.a,c()({className:u},p),n&&Object(o.createElement)(i.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},a))}},259:function(e,t){},262:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c),s=n(263);t.a=e=>{let{checked:t,name:n,onChange:c,option:r}=e;const{value:l,label:i,description:p,secondaryLabel:u,secondaryDescription:d}=r;return Object(a.createElement)("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${n}-${l}`},Object(a.createElement)("input",{id:`${n}-${l}`,className:"wc-block-components-radio-control__input",type:"radio",name:n,value:l,onChange:e=>c(e.target.value),checked:t,"aria-describedby":o()({[`${n}-${l}__label`]:i,[`${n}-${l}__secondary-label`]:u,[`${n}-${l}__description`]:p,[`${n}-${l}__secondary-description`]:d})}),Object(a.createElement)(s.a,{id:`${n}-${l}`,label:i,secondaryLabel:u,description:p,secondaryDescription:d}))}},263:function(e,t,n){"use strict";var a=n(0);t.a=e=>{let{label:t,secondaryLabel:n,description:c,secondaryDescription:o,id:s}=e;return Object(a.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(a.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(a.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),n&&Object(a.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},n)),Object(a.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(a.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},c),o&&Object(a.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},o)))}},268:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(0),c=n(194);n(256);const o=e=>{let{errorMessage:t="",propertyName:n="",elementId:o=""}=e;const{getValidationError:s,getValidationErrorId:r}=Object(c.b)();if(!t||"string"!=typeof t){const e=s(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(a.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(a.createElement)("p",{id:r(o)},t))}},284:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c),s=n(13),r=n(262);n(285);const l=e=>{let{className:t="",id:n,selected:c,onChange:i=(()=>{}),options:p=[]}=e;const u=Object(s.useInstanceId)(l),d=n||u;return p.length?Object(a.createElement)("div",{className:o()("wc-block-components-radio-control",t)},p.map(e=>Object(a.createElement)(r.a,{key:`${d}-${e.value}`,name:"radio-control-"+d,checked:e.value===c,option:e,onChange:t=>{i(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=l},285:function(e,t){},292:function(e,t,n){"use strict";var a=n(11),c=n.n(a),o=n(0),s=n(1),r=n(3),l=n(4),i=n.n(l),p=n(194),u=n(268),d=n(13),b=n(52),m=n(22);n(257);var g=Object(r.forwardRef)((e,t)=>{let{className:n,id:a,type:s="text",ariaLabel:r,ariaDescribedBy:l,label:p,screenReaderLabel:u,disabled:d,help:b,autoCapitalize:g="off",autoComplete:O="off",value:h="",onChange:j,required:f=!1,onBlur:E=(()=>{}),feedback:k,..._}=e;const[v,y]=Object(o.useState)(!1);return Object(o.createElement)("div",{className:i()("wc-block-components-text-input",n,{"is-active":v||h})},Object(o.createElement)("input",c()({type:s,id:a,value:h,ref:t,autoCapitalize:g,autoComplete:O,onChange:e=>{j(e.target.value)},onFocus:()=>y(!0),onBlur:e=>{E(e.target.value),y(!1)},"aria-label":r||p,disabled:d,"aria-describedby":b&&!l?a+"__help":l,required:f},_)),Object(o.createElement)(m.a,{label:p,screenReaderLabel:u||p,wrapperElement:"label",wrapperProps:{htmlFor:a},htmlFor:a}),!!b&&Object(o.createElement)("p",{id:a+"__help",className:"wc-block-components-text-input__help"},b),k)});t.a=Object(d.withInstanceId)(e=>{let{className:t,instanceId:n,id:a,ariaDescribedBy:l,errorId:d,focusOnMount:m=!1,onChange:O,showError:h=!0,errorMessage:j="",value:f="",...E}=e;const[k,_]=Object(r.useState)(!0),v=Object(r.useRef)(null),{getValidationError:y,hideValidationError:w,setValidationErrors:C,clearValidationError:N,getValidationErrorId:S}=Object(p.b)(),I=void 0!==a?a:"textinput-"+n,R=void 0!==d?d:I,x=Object(r.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=v.current||null;if(!t)return;t.value=t.value.trim();const n=t.checkValidity();n?N(R):C({[R]:{message:t.validationMessage||Object(s.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[N,R,C]);Object(r.useEffect)(()=>{var e;k&&m&&(null===(e=v.current)||void 0===e||e.focus()),_(!1)},[m,k,_]),Object(r.useEffect)(()=>{var e,t;(null===(e=v.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==v.current&&x(!0)},[f,x]),Object(r.useEffect)(()=>()=>{N(R)},[N,R]);const L=y(R)||{};Object(b.a)(j)&&""!==j&&(L.message=j);const M=L.message&&!L.hidden,$=h&&M&&S(R)?S(R):l;return Object(o.createElement)(g,c()({className:i()(t,{"has-error":M}),"aria-invalid":!0===M,id:I,onBlur:()=>{x(!1)},feedback:h&&Object(o.createElement)(u.a,{errorMessage:j,propertyName:R}),ref:v,onChange:e=>{w(R),O(e)},ariaDescribedBy:$,value:f},E))})},307:function(e,t){},308:function(e,t){},309:function(e,t){},310:function(e,t){},331:function(e,t){},337:function(e,t,n){"use strict";var a=n(0),c=n(1),o=n(20),s=n(137),r=n(10),l=n(380),i=n(31),p=n(26),u=n(4),d=n.n(u),b=n(18),m=n(22),g=n(67),O=n(284),h=n(263),j=n(37),f=n(101),E=n(2);const k=e=>{const t=Object(E.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(b.decodeEntities)(e.name),value:e.rate_id,description:Object(a.createElement)(a.Fragment,null,Number.isFinite(t)&&Object(a.createElement)(f.a,{currency:Object(j.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(b.decodeEntities)(e.delivery_time))}};var _=e=>{let{className:t="",noResultsMessage:n,onSelectRate:c,rates:o,renderOption:s=k,selectedRate:r}=e;const l=(null==r?void 0:r.rate_id)||"",[i,p]=Object(a.useState)(l);if(Object(a.useEffect)(()=>{l&&p(l)},[l]),0===o.length)return n;if(o.length>1)return Object(a.createElement)(O.a,{className:t,onChange:e=>{p(e),c(e)},selected:i,options:o.map(s)});const{label:u,secondaryLabel:d,description:b,secondaryDescription:m}=s(o[0]);return Object(a.createElement)(h.a,{label:u,secondaryLabel:d,description:b,secondaryDescription:m})};n(310);var v=e=>{let{packageId:t,className:n="",noResultsMessage:o,renderOption:s,packageData:l,collapsible:i=!1,collapse:p=!1,showItems:u=!1}=e;const{selectShippingRate:O}=Object(g.a)(),h=Object(a.createElement)(a.Fragment,null,(u||i)&&Object(a.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},l.name),u&&Object(a.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(l.items).map(e=>{const t=Object(b.decodeEntities)(e.name),n=e.quantity;return Object(a.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(a.createElement)(m.a,{label:n>1?`${t} × ${n}`:""+t,screenReaderLabel:Object(c.sprintf)(
2
  /* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
3
  Object(c._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,"woo-gutenberg-products-block"),t,n)}))}))),j=Object(a.createElement)(_,{className:n,noResultsMessage:o,rates:l.shipping_rates,onSelectRate:e=>O(e,t),selectedRate:l.shipping_rates.find(e=>e.selected),renderOption:s});return i?Object(a.createElement)(r.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!p,title:h},j):Object(a.createElement)("div",{className:d()("wc-block-components-shipping-rates-control__package",n)},h,j)};const y=e=>{let{packages:t,collapse:n,showItems:c,collapsible:o,noResultsMessage:s,renderOption:r}=e;return t.length?Object(a.createElement)(a.Fragment,null,t.map(e=>{let{package_id:t,...l}=e;return Object(a.createElement)(v,{key:t,packageId:t,packageData:l,collapsible:o,collapse:n,showItems:c,noResultsMessage:s,renderOption:r})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:n,className:u,collapsible:d=!1,noResultsMessage:b,renderOption:m,context:g}=e;Object(a.useEffect)(()=>{if(n)return;const e=Object(l.a)(t),a=Object(l.b)(t);1===e?Object(o.speak)(Object(c.sprintf)(
4
  /* translators: %d number of shipping options found. */
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5],{102:function(e,t,n){"use strict";var a=n(11),c=n.n(a),o=n(0),s=n(139),r=n(4),l=n.n(r);n(192);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:n,currency:a,onValueChange:r,displayType:p="text",...u}=e;const d="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(d))return null;const b=d/10**a.minorUnit;if(!Number.isFinite(b))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...u,...i(a),value:void 0,currency:void 0,onValueChange:void 0},O=r?e=>{const t=+e.value*10**a.minorUnit;r(t)}:()=>{};return Object(o.createElement)(s.a,c()({className:m,displayType:p},g,{value:b,onValueChange:O}))}},192:function(e,t){},22:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:s,wrapperProps:r={}}=e;const l=null!=n,i=null!=c;return!l&&i?(t=s||"span",r={...r,className:o()(r.className,"screen-reader-text")},Object(a.createElement)(t,r,c)):(t=s||a.Fragment,l&&i&&n!==c?Object(a.createElement)(t,r,Object(a.createElement)("span",{"aria-hidden":"true"},n),Object(a.createElement)("span",{className:"screen-reader-text"},c)):Object(a.createElement)(t,r,n))}},256:function(e,t){},257:function(e,t){},258:function(e,t,n){"use strict";var a=n(11),c=n.n(a),o=n(0),s=n(50),r=n(4),l=n.n(r),i=n(135);n(259),t.a=e=>{let{className:t,showSpinner:n=!1,children:a,variant:r="contained",...p}=e;const u=l()("wc-block-components-button",t,r,{"wc-block-components-button--loading":n});return Object(o.createElement)(s.a,c()({className:u},p),n&&Object(o.createElement)(i.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},a))}},259:function(e,t){},262:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c),s=n(263);t.a=e=>{let{checked:t,name:n,onChange:c,option:r}=e;const{value:l,label:i,description:p,secondaryLabel:u,secondaryDescription:d}=r;return Object(a.createElement)("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${n}-${l}`},Object(a.createElement)("input",{id:`${n}-${l}`,className:"wc-block-components-radio-control__input",type:"radio",name:n,value:l,onChange:e=>c(e.target.value),checked:t,"aria-describedby":o()({[`${n}-${l}__label`]:i,[`${n}-${l}__secondary-label`]:u,[`${n}-${l}__description`]:p,[`${n}-${l}__secondary-description`]:d})}),Object(a.createElement)(s.a,{id:`${n}-${l}`,label:i,secondaryLabel:u,description:p,secondaryDescription:d}))}},263:function(e,t,n){"use strict";var a=n(0);t.a=e=>{let{label:t,secondaryLabel:n,description:c,secondaryDescription:o,id:s}=e;return Object(a.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(a.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(a.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),n&&Object(a.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},n)),Object(a.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(a.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},c),o&&Object(a.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},o)))}},268:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(0),c=n(194);n(256);const o=e=>{let{errorMessage:t="",propertyName:n="",elementId:o=""}=e;const{getValidationError:s,getValidationErrorId:r}=Object(c.b)();if(!t||"string"!=typeof t){const e=s(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(a.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(a.createElement)("p",{id:r(o)},t))}},284:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c),s=n(13),r=n(262);n(285);const l=e=>{let{className:t="",id:n,selected:c,onChange:i=(()=>{}),options:p=[]}=e;const u=Object(s.useInstanceId)(l),d=n||u;return p.length?Object(a.createElement)("div",{className:o()("wc-block-components-radio-control",t)},p.map(e=>Object(a.createElement)(r.a,{key:`${d}-${e.value}`,name:"radio-control-"+d,checked:e.value===c,option:e,onChange:t=>{i(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=l},285:function(e,t){},292:function(e,t,n){"use strict";var a=n(11),c=n.n(a),o=n(0),s=n(1),r=n(3),l=n(4),i=n.n(l),p=n(194),u=n(268),d=n(13),b=n(52),m=n(22);n(257);var g=Object(r.forwardRef)((e,t)=>{let{className:n,id:a,type:s="text",ariaLabel:r,ariaDescribedBy:l,label:p,screenReaderLabel:u,disabled:d,help:b,autoCapitalize:g="off",autoComplete:O="off",value:h="",onChange:j,required:f=!1,onBlur:E=(()=>{}),feedback:k,..._}=e;const[v,y]=Object(o.useState)(!1);return Object(o.createElement)("div",{className:i()("wc-block-components-text-input",n,{"is-active":v||h})},Object(o.createElement)("input",c()({type:s,id:a,value:h,ref:t,autoCapitalize:g,autoComplete:O,onChange:e=>{j(e.target.value)},onFocus:()=>y(!0),onBlur:e=>{E(e.target.value),y(!1)},"aria-label":r||p,disabled:d,"aria-describedby":b&&!l?a+"__help":l,required:f},_)),Object(o.createElement)(m.a,{label:p,screenReaderLabel:u||p,wrapperElement:"label",wrapperProps:{htmlFor:a},htmlFor:a}),!!b&&Object(o.createElement)("p",{id:a+"__help",className:"wc-block-components-text-input__help"},b),k)});t.a=Object(d.withInstanceId)(e=>{let{className:t,instanceId:n,id:a,ariaDescribedBy:l,errorId:d,focusOnMount:m=!1,onChange:O,showError:h=!0,errorMessage:j="",value:f="",...E}=e;const[k,_]=Object(r.useState)(!0),v=Object(r.useRef)(null),{getValidationError:y,hideValidationError:w,setValidationErrors:C,clearValidationError:N,getValidationErrorId:S}=Object(p.b)(),I=void 0!==a?a:"textinput-"+n,R=void 0!==d?d:I,x=Object(r.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=v.current||null;if(!t)return;t.value=t.value.trim();const n=t.checkValidity();n?N(R):C({[R]:{message:t.validationMessage||Object(s.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[N,R,C]);Object(r.useEffect)(()=>{var e;k&&m&&(null===(e=v.current)||void 0===e||e.focus()),_(!1)},[m,k,_]),Object(r.useEffect)(()=>{var e,t;(null===(e=v.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==v.current&&x(!0)},[f,x]),Object(r.useEffect)(()=>()=>{N(R)},[N,R]);const L=y(R)||{};Object(b.a)(j)&&""!==j&&(L.message=j);const M=L.message&&!L.hidden,$=h&&M&&S(R)?S(R):l;return Object(o.createElement)(g,c()({className:i()(t,{"has-error":M}),"aria-invalid":!0===M,id:I,onBlur:()=>{x(!1)},feedback:h&&Object(o.createElement)(u.a,{errorMessage:j,propertyName:R}),ref:v,onChange:e=>{w(R),O(e)},ariaDescribedBy:$,value:f},E))})},307:function(e,t){},308:function(e,t){},309:function(e,t){},310:function(e,t){},331:function(e,t){},337:function(e,t,n){"use strict";var a=n(0),c=n(1),o=n(20),s=n(137),r=n(10),l=n(380),i=n(31),p=n(27),u=n(4),d=n.n(u),b=n(18),m=n(22),g=n(67),O=n(284),h=n(263),j=n(37),f=n(102),E=n(2);const k=e=>{const t=Object(E.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(b.decodeEntities)(e.name),value:e.rate_id,description:Object(a.createElement)(a.Fragment,null,Number.isFinite(t)&&Object(a.createElement)(f.a,{currency:Object(j.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(b.decodeEntities)(e.delivery_time))}};var _=e=>{let{className:t="",noResultsMessage:n,onSelectRate:c,rates:o,renderOption:s=k,selectedRate:r}=e;const l=(null==r?void 0:r.rate_id)||"",[i,p]=Object(a.useState)(l);if(Object(a.useEffect)(()=>{l&&p(l)},[l]),0===o.length)return n;if(o.length>1)return Object(a.createElement)(O.a,{className:t,onChange:e=>{p(e),c(e)},selected:i,options:o.map(s)});const{label:u,secondaryLabel:d,description:b,secondaryDescription:m}=s(o[0]);return Object(a.createElement)(h.a,{label:u,secondaryLabel:d,description:b,secondaryDescription:m})};n(310);var v=e=>{let{packageId:t,className:n="",noResultsMessage:o,renderOption:s,packageData:l,collapsible:i=!1,collapse:p=!1,showItems:u=!1}=e;const{selectShippingRate:O}=Object(g.a)(),h=Object(a.createElement)(a.Fragment,null,(u||i)&&Object(a.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},l.name),u&&Object(a.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(l.items).map(e=>{const t=Object(b.decodeEntities)(e.name),n=e.quantity;return Object(a.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(a.createElement)(m.a,{label:n>1?`${t} × ${n}`:""+t,screenReaderLabel:Object(c.sprintf)(
2
  /* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
3
  Object(c._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,"woo-gutenberg-products-block"),t,n)}))}))),j=Object(a.createElement)(_,{className:n,noResultsMessage:o,rates:l.shipping_rates,onSelectRate:e=>O(e,t),selectedRate:l.shipping_rates.find(e=>e.selected),renderOption:s});return i?Object(a.createElement)(r.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!p,title:h},j):Object(a.createElement)("div",{className:d()("wc-block-components-shipping-rates-control__package",n)},h,j)};const y=e=>{let{packages:t,collapse:n,showItems:c,collapsible:o,noResultsMessage:s,renderOption:r}=e;return t.length?Object(a.createElement)(a.Fragment,null,t.map(e=>{let{package_id:t,...l}=e;return Object(a.createElement)(v,{key:t,packageId:t,packageData:l,collapsible:o,collapse:n,showItems:c,noResultsMessage:s,renderOption:r})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:n,className:u,collapsible:d=!1,noResultsMessage:b,renderOption:m,context:g}=e;Object(a.useEffect)(()=>{if(n)return;const e=Object(l.a)(t),a=Object(l.b)(t);1===e?Object(o.speak)(Object(c.sprintf)(
4
  /* translators: %d number of shipping options found. */
build/cart-blocks/order-summary-shipping-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[24],{437:function(e,t,a){"use strict";a.r(t);var c=a(118),l=a(0),r=a(429),o=a(37),n=a(31),s=a(10),i=a(2),p={isShippingCalculatorEnabled:{type:"boolean",default:Object(i.getSetting)("isShippingCalculatorEnabled",!0)},lock:{type:"object",default:{move:!1,remove:!0}}};t.default=Object(c.withFilteredAttributes)(p)(e=>{let{className:t,isShippingCalculatorEnabled:a}=e;const{cartTotals:c,cartNeedsShipping:i}=Object(n.a)();if(!i)return null;const p=Object(o.getCurrencyFromPriceResponse)(c);return Object(l.createElement)(s.TotalsWrapper,{className:t},Object(l.createElement)(r.a,{showCalculator:a,showRateSelector:!0,values:c,currency:p}))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[24],{437:function(e,t,a){"use strict";a.r(t);var c=a(120),l=a(0),r=a(429),o=a(37),n=a(31),s=a(10),i=a(2),p={isShippingCalculatorEnabled:{type:"boolean",default:Object(i.getSetting)("isShippingCalculatorEnabled",!0)},lock:{type:"object",default:{move:!1,remove:!0}}};t.default=Object(c.withFilteredAttributes)(p)(e=>{let{className:t,isShippingCalculatorEnabled:a}=e;const{cartTotals:c,cartNeedsShipping:i}=Object(n.a)();if(!i)return null;const p=Object(o.getCurrencyFromPriceResponse)(c);return Object(l.createElement)(s.TotalsWrapper,{className:t},Object(l.createElement)(r.a,{showCalculator:a,showRateSelector:!0,values:c,currency:p}))})}}]);
build/cart-blocks/order-summary-taxes-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[26],{438:function(e,t,a){"use strict";a.r(t);var c=a(118),r=a(0),s=a(10),l=a(37),n=a(31),o=a(2),i={showRateAfterTaxName:{type:"boolean",default:Object(o.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};t.default=Object(c.withFilteredAttributes)(i)(e=>{let{className:t,showRateAfterTaxName:a}=e;const{cartTotals:c}=Object(n.a)();if(Object(o.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(c.total_tax,10)<=0)return null;const i=Object(l.getCurrencyFromPriceResponse)(c);return Object(r.createElement)(s.TotalsWrapper,{className:t},Object(r.createElement)(s.TotalsTaxes,{showRateAfterTaxName:a,currency:i,values:c}))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[26],{438:function(e,t,a){"use strict";a.r(t);var c=a(120),r=a(0),s=a(10),l=a(37),n=a(31),o=a(2),i={showRateAfterTaxName:{type:"boolean",default:Object(o.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};t.default=Object(c.withFilteredAttributes)(i)(e=>{let{className:t,showRateAfterTaxName:a}=e;const{cartTotals:c}=Object(n.a)();if(Object(o.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(c.total_tax,10)<=0)return null;const i=Object(l.getCurrencyFromPriceResponse)(c);return Object(r.createElement)(s.TotalsWrapper,{className:t},Object(r.createElement)(s.TotalsTaxes,{showRateAfterTaxName:a,currency:i,values:c}))})}}]);
build/cart-blocks/proceed-to-checkout-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[27],{258:function(e,t,c){"use strict";var n=c(11),o=c.n(n),s=c(0),r=c(50),a=c(4),i=c.n(a),u=c(135);c(259),t.a=e=>{let{className:t,showSpinner:c=!1,children:n,variant:a="contained",...b}=e;const l=i()("wc-block-components-button",t,a,{"wc-block-components-button--loading":c});return Object(s.createElement)(r.a,o()({className:l},b),c&&Object(s.createElement)(u.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},n))}},259:function(e,t){},369:function(e,t,c){"use strict";(function(e){var n=c(0),o=c(1),s=c(4),r=c.n(s),a=c(258),i=c(44),u=c(34),b=c(416),l=c(2);c(371),t.a=t=>{let{checkoutPageId:c,className:s}=t;const d=Object(l.getSetting)("page-"+c,!1),{isCalculating:m}=Object(u.b)(),[f,w]=Object(b.a)(),[p,v]=Object(n.useState)(!1);Object(n.useEffect)(()=>{if("function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)return;const t=()=>{v(!1)};return e.addEventListener("pageshow",t),()=>{e.removeEventListener("pageshow",t)}},[]);const j=Object(n.createElement)(a.a,{className:"wc-block-cart__submit-button",href:d||i.d,disabled:m,onClick:()=>v(!0),showSpinner:p},Object(o.__)("Proceed to Checkout","woo-gutenberg-products-block"));return Object(n.createElement)("div",{className:r()("wc-block-cart__submit",s)},f,Object(n.createElement)("div",{className:"wc-block-cart__submit-container"},j),"below"===w&&Object(n.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},j))}}).call(this,c(370))},370:function(e,t){var c;c=function(){return this}();try{c=c||new Function("return this")()}catch(e){"object"==typeof window&&(c=window)}e.exports=c},371:function(e,t){},416:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(0);const o={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},s=()=>{const[e,t]=Object(n.useState)(""),c=Object(n.useRef)(null),s=Object(n.useRef)(new IntersectionObserver(e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")},{threshold:1}));return Object(n.useLayoutEffect)(()=>{const e=c.current,t=s.current;return e&&t.observe(e),()=>{t.unobserve(e)}},[]),[Object(n.createElement)("div",{"aria-hidden":!0,ref:c,style:o}),e]}},447:function(e,t,c){"use strict";c.r(t);var n=c(118),o=c(369);t.default=Object(n.withFilteredAttributes)({checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}})(o.a)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[27],{258:function(e,t,c){"use strict";var n=c(11),o=c.n(n),s=c(0),r=c(50),a=c(4),i=c.n(a),u=c(135);c(259),t.a=e=>{let{className:t,showSpinner:c=!1,children:n,variant:a="contained",...b}=e;const l=i()("wc-block-components-button",t,a,{"wc-block-components-button--loading":c});return Object(s.createElement)(r.a,o()({className:l},b),c&&Object(s.createElement)(u.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},n))}},259:function(e,t){},369:function(e,t,c){"use strict";(function(e){var n=c(0),o=c(1),s=c(4),r=c.n(s),a=c(258),i=c(44),u=c(34),b=c(416),l=c(2);c(371),t.a=t=>{let{checkoutPageId:c,className:s}=t;const d=Object(l.getSetting)("page-"+c,!1),{isCalculating:m}=Object(u.b)(),[f,w]=Object(b.a)(),[p,v]=Object(n.useState)(!1);Object(n.useEffect)(()=>{if("function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)return;const t=()=>{v(!1)};return e.addEventListener("pageshow",t),()=>{e.removeEventListener("pageshow",t)}},[]);const j=Object(n.createElement)(a.a,{className:"wc-block-cart__submit-button",href:d||i.d,disabled:m,onClick:()=>v(!0),showSpinner:p},Object(o.__)("Proceed to Checkout","woo-gutenberg-products-block"));return Object(n.createElement)("div",{className:r()("wc-block-cart__submit",s)},f,Object(n.createElement)("div",{className:"wc-block-cart__submit-container"},j),"below"===w&&Object(n.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},j))}}).call(this,c(370))},370:function(e,t){var c;c=function(){return this}();try{c=c||new Function("return this")()}catch(e){"object"==typeof window&&(c=window)}e.exports=c},371:function(e,t){},416:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(0);const o={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},s=()=>{const[e,t]=Object(n.useState)(""),c=Object(n.useRef)(null),s=Object(n.useRef)(new IntersectionObserver(e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")},{threshold:1}));return Object(n.useLayoutEffect)(()=>{const e=c.current,t=s.current;return e&&t.observe(e),()=>{t.unobserve(e)}},[]),[Object(n.createElement)("div",{"aria-hidden":!0,ref:c,style:o}),e]}},447:function(e,t,c){"use strict";c.r(t);var n=c(120),o=c(369);t.default=Object(n.withFilteredAttributes)({checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}})(o.a)}}]);
build/cart-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '8007654503ff04c61ff19cc57a0ec45c');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '0190177fc679791bd041ef49fb023375');
build/cart-frontend.js CHANGED
@@ -1,6 +1,6 @@
1
- !function(e){function t(t){for(var r,o,a=t[0],s=t[1],i=0,l=[];i<a.length;i++)o=a[i],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&l.push(n[o][0]),n[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(c&&c(t);l.length;)l.shift()()}var r={},n={11:0,7:0,73:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var a=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=a);var s,i=document.createElement("script");i.charset="utf-8",i.timeout=120,o.nc&&i.setAttribute("nonce",o.nc),i.src=function(e){return o.p+""+({0:"vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66",1:"vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6",2:"vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b",3:"vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542",4:"cart-blocks/cart-line-items--mini-cart-contents-block/products-table",5:"cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping",12:"cart-blocks/cart-accepted-payment-methods",13:"cart-blocks/cart-express-payment",14:"cart-blocks/cart-items",15:"cart-blocks/cart-line-items",16:"cart-blocks/cart-order-summary",17:"cart-blocks/cart-totals",18:"cart-blocks/empty-cart",19:"cart-blocks/filled-cart",20:"cart-blocks/order-summary-coupon-form",21:"cart-blocks/order-summary-discount",22:"cart-blocks/order-summary-fee",23:"cart-blocks/order-summary-heading",24:"cart-blocks/order-summary-shipping",25:"cart-blocks/order-summary-subtotal",26:"cart-blocks/order-summary-taxes",27:"cart-blocks/proceed-to-checkout"}[e]||e)+"-frontend.js?ver="+{0:"071743a9ca2cfdafd79f",1:"d7438a60524d4125b57c",2:"2b36f4751fec269ea9a2",3:"deab3ee0c5c13d3addc8",4:"d557b3d2bc0c3be7b7eb",5:"a059f208c9196a839a04",12:"869688d4565c5670b471",13:"99109969d405c2956ba7",14:"497cd8ab48255af9b50d",15:"7563101891d56d8cf45c",16:"56baa7a3744bfa19771a",17:"beabb36f9afc88b4feb3",18:"f6628e966e355c915de9",19:"fd0392dda43dda02525c",20:"9e8cead69de9d577c49e",21:"e4ca811d00bb2836d74c",22:"7f685f8beac3d104e331",23:"787a01b25060df3928ef",24:"a723fa1fbc56398907fa",25:"a348afa0fb9493cb1f39",26:"b1c76f186d98f0d90924",27:"93d8531bbcf0f50935d6"}[e]}(e);var c=new Error;s=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",c.name="ChunkLoadError",c.type=o,c.request=a,r[1](c)}n[e]=void 0}};var l=setTimeout((function(){s({type:"timeout",target:i})}),12e4);i.onerror=i.onload=s,document.head.appendChild(i)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var c=s;o(o.s=224)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},,function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";var n=r(19),o=r.n(n),a=r(0),s=r(3),i=r(1),c=r(44),l=e=>{let{imageUrl:t=c.l+"/block-error.svg",header:r=Object(i.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(i.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(i.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(a.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(a.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(a.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(a.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(a.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(a.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),l&&Object(a.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(33);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:s,renderError:i,button:c}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof i?i({errorMessage:u}):Object(a.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:c}):this.props.children}}t.a=u},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.a11y},,,,function(e,t,r){"use strict";(function(e){var n=r(0);r(38);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(63))},function(e,t){e.exports=window.wp.apiFetch},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(n.useContext)(o)},,,function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var n=r(61);let o,a;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(a||(a={}));const s=(e,t)=>Object(n.a)(e)&&"type"in e&&e.type===t,i=e=>s(e,o.SUCCESS),c=e=>s(e,o.ERROR),l=e=>s(e,o.FAIL),u=e=>!Object(n.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:a,shouldRetry:u,isSuccessResponse:i,isErrorResponse:c,isFailResponse:l})},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(12),a=r.n(o);function s(e){const t=Object(n.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(6),o=r(0),a=r(5),s=r(7),i=r(18),c=r(117),l=r(26),u=r(68);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(s.dispatch)(a.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},f=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h={...m,email:""},b={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:a.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(i.decodeEntities)(r)]})),E={cartCoupons:a.EMPTY_CART_COUPONS,cartItems:a.EMPTY_CART_ITEMS,cartFees:a.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:a.EMPTY_CART_ITEM_ERRORS,cartTotals:b,cartIsLoading:!0,cartErrors:a.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:m,shippingRates:a.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:a.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:a.EMPTY_EXTENSIONS},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),i=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();f();const p=Object(s.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return E;if(t)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:a.EMPTY_CART_ITEM_ERRORS,cartTotals:i.totals,cartIsLoading:!1,cartErrors:a.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:m,extensions:a.EMPTY_EXTENSIONS,shippingRates:i.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:()=>{}};const o=e(a.CART_STORE_KEY),s=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),f=o.isCustomerDataUpdating(),{receiveCart:b}=n(a.CART_STORE_KEY),y=g(s.billingAddress),v=s.needsShipping?g(s.shippingAddress):y,O=s.fees.length>0?s.fees.map(e=>g(e)):a.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map(e=>({...e,label:e.code})):a.EMPTY_CART_COUPONS,cartItems:s.items,cartFees:O,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingAddress:Object(c.a)(y),shippingAddress:Object(c.a)(v),extensions:s.extensions,shippingRates:s.shippingRates,isLoadingRates:f,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:b}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.deprecated},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return x})),r.d(t,"a",(function(){return P}));var n=r(0),o=r(1),a=r(58),s=r(32),i=r.n(s),c=r(52),l=r(61),u=r(7);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const p=()=>({type:d.SET_IDLE}),f=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},h=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var b=r(2),g=r(117);let E;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(E||(E={}));const y={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(b.getSetting)("checkoutData",{})||{}},v={redirectUrl:"",status:E.PRISTINE,hasError:!1,calculatingCount:0,orderId:y.order_id,orderNotes:"",customerId:y.customer_id,useShippingAsBilling:Object(g.b)(y.billing_address,y.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,{redirectUrl:t,type:r,customerId:n,orderId:o,orderNotes:a,extensionData:s,useShippingAsBilling:i,shouldCreateAccount:c,data:l}=arguments.length>1?arguments[1]:void 0,u=e;switch(r){case d.SET_PRISTINE:u=v;break;case d.SET_IDLE:u=e.status!==E.IDLE?{...e,status:E.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:l};break;case d.SET_COMPLETE:u=e.status!==E.COMPLETE?{...e,status:E.COMPLETE,redirectUrl:"string"==typeof(null==l?void 0:l.redirectUrl)?l.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==E.PROCESSING?{...e,status:E.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==E.BEFORE_PROCESSING?{...e,status:E.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==E.AFTER_PROCESSING?{...e,status:E.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===E.PROCESSING||e.status===E.BEFORE_PROCESSING?{...u,status:E.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==n?{...e,customerId:n}:e;break;case d.SET_ORDER_ID:u=void 0!==o?{...e,orderId:o}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==i&&i!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:i});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==c&&c!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:c});break;case d.SET_ORDER_NOTES:void 0!==a&&e.orderNotes!==a&&(u={...e,orderNotes:a});break;case d.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(u={...e,extensionData:s})}return u!==e&&r!==d.SET_PRISTINE&&u.status===E.PRISTINE&&(u.status=E.IDLE),u};var S=r(18),_=r(91),k=r(197);var w=r(199),j=r(194),R=r(40),C=r(29),T=r(77);const A=Object(n.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),x=()=>Object(n.useContext)(A),P=e=>{let{children:t,redirectUrl:r,isCart:s=!1}=e;v.redirectUrl=r;const[b,g]=Object(n.useReducer)(O,v),{setValidationErrors:y}=Object(j.b)(),{createErrorNotice:x}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:P}=Object(R.a)(),M=b.calculatingCount>0,{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D,shouldRetry:L}=Object(C.d)(),{checkoutNotices:F,paymentNotices:V,expressPaymentNotices:B}=(()=>{const{noticeContexts:e}=Object(C.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[U,H]=Object(n.useReducer)(_.b,{}),G=Object(n.useRef)(U),{onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:z,onCheckoutValidationBeforeProcessing:q}=(e=>Object(n.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(k.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(k.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(k.a)("checkout_validation_before_processing",e)}),[e]))(H);Object(n.useEffect)(()=>{G.current=U},[U]);const W=Object(n.useMemo)(()=>function(){return i()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),q(...arguments)},[q]),X=Object(n.useMemo)(()=>({resetCheckout:()=>{g({type:d.SET_PRISTINE})},setRedirectUrl:e=>{g(f(e))},setHasError:e=>{g(h(e))},incrementCalculating:()=>{g({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{g({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;g((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{g((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{g((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{g((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:r,value:n}=e;t.paymentDetails[r]=Object(S.decodeEntities)(n)})),"message"in e&&(t.message=Object(S.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var r;g(f((null==t?void 0:t.redirectUrl)||"")),g((r=t,{type:d.SET_PROCESSING_RESPONSE,data:r})),g({type:d.SET_AFTER_PROCESSING})}}),[]);Object(n.useEffect)(()=>{b.status===E.BEFORE_PROCESSING&&(Object(T.b)("error"),Object(w.a)(G.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;x(t,{context:"wc/checkout"}),y(r)}),g(p()),g(h())):g({type:d.SET_PROCESSING})}))},[b.status,y,x,g]);const K=Object(a.a)(b.status),$=Object(a.a)(b.hasError);Object(n.useEffect)(()=>{if((b.status!==K||b.hasError!==$)&&b.status===E.AFTER_PROCESSING){const e={redirectUrl:b.redirectUrl,orderId:b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,processingResponse:b.processingResponse};b.hasError?Object(w.b)(G.current,"checkout_after_processing_with_error",e).then(t=>{const r=(e=>{let t=null;return e.forEach(e=>{if((I(e)||D(e))&&e.message&&Object(c.a)(e.message)){const r=e.messageContext&&Object(c.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,x(e.message,r)}}),t})(t);if(null!==r)L(r)?g(p()):g(m(r));else{if(!(F.some(e=>"error"===e.status)||B.some(e=>"error"===e.status)||V.some(e=>"error"===e.status))){var n;const t=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");x(t,{id:"checkout",context:"wc/checkout"})}g(p())}}):Object(w.b)(G.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,r=null;if(e.forEach(e=>{N(e)&&(t=e),(I(e)||D(e))&&(r=e)}),t&&!r)g(m(t));else if(Object(l.a)(r)){if(r.message&&Object(c.a)(r.message)){const e=r.messageContext&&Object(c.a)(r.messageContext)?{context:r.messageContext}:void 0;x(r.message,e)}L(r)?g(h(!0)):g(m(r))}else g(m())})}},[b.status,b.hasError,b.redirectUrl,b.orderId,b.customerId,b.orderNotes,b.processingResponse,K,$,X,x,I,D,N,L,F,B,V]);const J={onSubmit:Object(n.useCallback)(()=>{P("submit"),g({type:d.SET_BEFORE_PROCESSING})},[P]),isComplete:b.status===E.COMPLETE,isIdle:b.status===E.IDLE,isCalculating:M,isProcessing:b.status===E.PROCESSING,isBeforeProcessing:b.status===E.BEFORE_PROCESSING,isAfterProcessing:b.status===E.AFTER_PROCESSING,hasError:b.hasError,redirectUrl:b.redirectUrl,onCheckoutBeforeProcessing:W,onCheckoutValidationBeforeProcessing:q,onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:z,dispatchActions:X,isCart:s,orderId:b.orderId,hasOrder:!!b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,useShippingAsBilling:b.useShippingAsBilling,setUseShippingAsBilling:e=>{return g((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:b.shouldCreateAccount,setShouldCreateAccount:e=>{return g((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:b.extensionData};return Object(n.createElement)(A.Provider,{value:J},t)}},,,function(e,t){e.exports=window.wc.priceFormat},function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(39),o=r(0),a=r(31);const s=()=>{const e=Object(a.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";var n=r(8),o=r(0),a=r(14),s=function({icon:e,className:t,...r}){const a=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:a},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(s,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&s===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===a.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(a.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},function(e,t,r){"use strict";var n=r(4),o=r.n(n),a=r(0);t.a=Object(a.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(a.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},,function(e,t,r){"use strict";r.d(t,"n",(function(){return a})),r.d(t,"l",(function(){return s})),r.d(t,"k",(function(){return i})),r.d(t,"m",(function(){return c})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return f})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return E}));var n,o=r(2);const a=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=a.pluginUrl+"images/",i=a.pluginUrl+"build/",c=a.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),a=r(69),s=r(52);const i=Object(n.getSetting)("countryLocale",{}),c=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(a.a)(e.priority)&&(t.index=e.priority),Object(s.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(i).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,c(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return i}));var n=r(0),o=r(65);const a=Object(n.createContext)({isInitialized:!1,billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:()=>{},setShippingAddress:()=>{}}),s=()=>Object(n.useContext)(a),i=e=>{let{children:t}=e;const r=Object(o.a)();return Object(n.createElement)(a.Provider,{value:r},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){var o=this,a=Object(n.useRef)(null),s=Object(n.useRef)(0),i=Object(n.useRef)(null),c=Object(n.useRef)([]),l=Object(n.useRef)(),u=Object(n.useRef)(),d=Object(n.useRef)(e),p=Object(n.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var m=!!(r=r||{}).leading,h=!("trailing"in r)||!!r.trailing,b="maxWait"in r,g=b?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=c.current,r=l.current;return c.current=l.current=null,s.current=e,u.current=d.current.apply(r,t)},r=function(e,t){f&&cancelAnimationFrame(i.current),i.current=f?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!p.current)return!1;var r=e-a.current,n=e-s.current;return!a.current||r>=t||r<0||b&&n>=g},E=function(t){return i.current=null,h&&c.current?e(t):(c.current=l.current=null,u.current)},y=function(){var e=Date.now();if(n(e))return E(e);if(p.current){var o=e-a.current,i=e-s.current,c=t-o,l=b?Math.min(c,g-i):c;r(y,l)}},v=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var h=Date.now(),g=n(h);if(c.current=d,l.current=o,a.current=h,g){if(!i.current&&p.current)return s.current=a.current,r(y,t),m?e(a.current):u.current;if(b)return r(y,t),e(a.current)}return i.current||r(y,t),u.current};return v.cancel=function(){i.current&&(f?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,c.current=a.current=l.current=i.current=null},v.isPending=function(){return!!i.current},v.flush=function(){return i.current?E(Date.now()):u.current},v}),[m,b,t,g,h,f])}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(11),o=r.n(n),a=r(0),s=r(15);const i=[".wp-block-woocommerce-cart"],c=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:i=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const c=n(e,r),l=i(e,r),u={...e.dataset,...c.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:i={},errorBoundaryProps:c={}}=e;Object(a.render)(Object(a.createElement)(s.a,c,Object(a.createElement)(a.Suspense,{fallback:Object(a.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(a.createElement)(t,o()({},i,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:c,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(i.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:a}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:a}=e;const s=document.body.querySelectorAll(o);a&&a.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,a)),c({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:a,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:a}=e;const s=a.querySelectorAll(o);c({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},,function(e,t,r){"use strict";var n=r(8),o=r(0),a=r(4),s=r.n(a),i=r(6),c=r(32),l=r.n(c),u=r(13),d=r(51),p=r(93),f=r(1);function m(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const a=o.getBoundingClientRect();return new n.DOMRect(e.left+a.left,e.top+a.top,e.width,e.height)}let h=0;function b(e){const t=document.scrollingElement||document.body;e&&(h=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=h)}let g=0;function E(){return Object(o.useEffect)(()=>(0===g&&b(!0),++g,()=>{1===g&&b(!1),--g}),[]),null}var y=r(24);function v(e){const t=Object(o.useContext)(y.a),r=t.slots[e]||{},n=t.fills[e],a=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:a,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var O=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function S({name:e,children:t,registerFill:r,unregisterFill:n}){const a=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(O),[n,a]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(a(t(e)),r(()=>{a(t(e))})),[e]),n})(e),s=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,s.current),()=>n(e,s.current)),[]),Object(o.useLayoutEffect)(()=>{s.current.children=t,a&&a.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==s.current.name&&(n(s.current.name,s.current),s.current.name=e,r(e,s.current))},[e]),a&&a.node?(Object(i.isFunction)(t)&&(t=t(a.props.fillProps)),Object(o.createPortal)(t,a.node)):null}var _=e=>Object(o.createElement)(O.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(S,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class k extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,a=Object(i.map)(n(t,this),e=>{const t=Object(i.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(i.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(i.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(i.isFunction)(e)?e(a):a)}}var w=e=>Object(o.createElement)(O.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:a})=>Object(o.createElement)(k,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:a})));function j(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function R({name:e,children:t}){const r=v(e),n=Object(o.useRef)({rerender:j()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...a},s){const i=Object(o.useContext)(y.a),c=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(i.registerSlot(e,c,t),()=>{i.unregisterSlot(e,c)}),[i.registerSlot,i.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{i.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([s,c])},a))}));function T(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_,e),Object(o.createElement)(R,e))}r(12),o.Component;const A=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(C,Object(n.a)({},t,{ref:r})):Object(o.createElement)(w,t));function x(e){return"appear"===e?"top":"left"}function P(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:a}=(s=t).ownerDocument.defaultView.getComputedStyle(s);var s;const i=r?parseInt(r,10):0,c=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+i,width:e.width-l-u,height:e.height-i-c,left:e.left+l,right:e.right-u,top:e.top+i,bottom:e.bottom-c}}function M(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function N(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function I(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const D=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:a,noArrow:i=!0,isAlternate:c,position:h="bottom right",range:b,focusOnMount:g="firstElement",anchorRef:y,shouldAnchorIncludePadding:O,anchorRect:S,getAnchorRect:_,expandOnMobile:k,animate:w=!0,onClickOutside:j,onFocusOutside:R,__unstableStickyBoundaryElement:C,__unstableSlotName:A="Popover",__unstableObserveElement:D,__unstableBoundaryParent:L,__unstableForcePosition:F,__unstableForceXAlignment:V,...B},U)=>{const H=Object(o.useRef)(null),G=Object(o.useRef)(null),Y=Object(o.useRef)(),z=Object(u.useViewportMatch)("medium","<"),[q,X]=Object(o.useState)(),K=v(A),$=k&&z,[J,Q]=Object(u.useResizeObserver)();i=$||i,Object(o.useLayoutEffect)(()=>{if($)return I(Y.current,"is-without-arrow",i),I(Y.current,"is-alternate",c),M(Y.current,"data-x-axis"),M(Y.current,"data-y-axis"),N(Y.current,"top"),N(Y.current,"left"),N(G.current,"maxHeight"),void N(G.current,"maxWidth");const e=()=>{if(!Y.current||!G.current)return;let e=function(e,t,r,n=!1,o,a){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,a)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return m(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,a);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=m(n.getBoundingClientRect(),n.ownerDocument,a);return o?e:P(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),s=t.getBoundingClientRect(),i=m(new window.DOMRect(r.left,r.top,r.width,s.bottom-r.top),e.ownerDocument,a);return o?i:P(i,n)}if(!e.current)return;const{parentNode:s}=e.current,i=s.getBoundingClientRect();return o?i:P(i,s)}(H,S,_,y,O,Y.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=Y.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var a;L&&(n=null===(a=Y.current.closest(".popover-slot"))||void 0===a?void 0:a.parentNode);const s=Q.height?Q:G.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:b,contentHeight:g,contentWidth:E}=function(e,t,r="top",n,o,a,s,i,c){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,a,s,i){const{height:c}=t;if(o){const t=o.getBoundingClientRect().top+c-s;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-c/2>0?c/2:l)+(l+c/2>window.innerHeight?window.innerHeight-l:c/2)},d={popoverTop:e.top,contentHeight:e.top-10-c>0?c:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+c>window.innerHeight?window.innerHeight-10-e.bottom:c};let f,m=r,h=null;if(!o&&!i)if("middle"===r&&u.contentHeight===c)m="middle";else if("top"===r&&d.contentHeight===c)m="top";else if("bottom"===r&&p.contentHeight===c)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;h=e!==c?e:null}return f="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:f,contentHeight:h}}(e,t,l,d,n,0,a,i);return{...function(e,t,r,n,o,a,s,i,c){const{width:l}=t;"left"===r&&Object(f.isRTL)()?r="right":"right"===r&&Object(f.isRTL)()&&(r="left"),"left"===n&&Object(f.isRTL)()?n="right":"right"===n&&Object(f.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===a||c||(p=u);let m=e.right;"left"===n?m=e.left:"middle"===a||c||(m=u);const h={popoverLeft:p,contentWidth:p-l>0?l:p},b={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let g,E=r,y=null;if(!o&&!i)if("center"===r&&d.contentWidth===l)E="center";else if("left"===r&&h.contentWidth===l)E="left";else if("right"===r&&b.contentWidth===l)E="right";else{E=h.contentWidth>b.contentWidth?"left":"right";const e="left"===E?h.contentWidth:b.contentWidth;l>window.innerWidth&&(y=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===E?d.popoverLeft:"left"===E?h.popoverLeft:b.popoverLeft,s){const e=s.getBoundingClientRect();g=Math.min(g,e.right-l),Object(f.isRTL)()||(g=Math.max(g,0))}return{xAxis:E,popoverLeft:g,contentWidth:y}}(e,t,u,d,n,p.yAxis,s,i,c),...p}}(e,s,h,C,Y.current,o,n,F,V);"number"==typeof l&&"number"==typeof u&&(N(Y.current,"top",l+"px"),N(Y.current,"left",u+"px")),I(Y.current,"is-without-arrow",i||"center"===p&&"middle"===b),I(Y.current,"is-alternate",c),M(Y.current,"data-x-axis",p),M(Y.current,"data-y-axis",b),N(G.current,"maxHeight","number"==typeof g?g+"px":""),N(G.current,"maxWidth","number"==typeof E?E+"px":""),X(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))};e();const{ownerDocument:t}=Y.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const a=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",a),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const s=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(y);let l;return s&&s!==t&&(s.defaultView.addEventListener("resize",e),s.defaultView.addEventListener("scroll",e,!0)),D&&(l=new r.MutationObserver(e),l.observe(D,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",a),r.cancelAnimationFrame(o),s&&s!==t&&(s.defaultView.removeEventListener("resize",e),s.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[$,S,_,y,O,h,Q,C,D,L]);const Z=(e,r)=>{if("focus-outside"===e&&R)R(r);else if("focus-outside"===e&&j){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),j(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),re=Object(u.useMergeRefs)([Y,ee,U]),ne=Boolean(w&&q)&&function(e){if("loading"===e.type)return s()("components-animate__loading");const{type:t,origin:r=x(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return s()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?s()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(n.a)({className:s()("components-popover",a,ne,{"is-expanded":$,"is-without-arrow":i,"is-alternate":c})},B,{ref:re},te,{tabIndex:"-1"}),$&&Object(o.createElement)(E,null),$&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(W,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:G,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return K.ref&&(oe=Object(o.createElement)(T,{name:A},oe)),y||S?oe:Object(o.createElement)("span",{ref:H},oe)});D.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(A,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var L=D,F=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(i.isString)(e)&&(r=e),Object(i.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const V=Object(o.createElement)("div",{className:"event-catcher"}),B=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(V,e),Object(o.cloneElement)(t,{children:r}),","),e),U=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),H=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var G=function({children:e,position:t,text:r,shortcut:n}){const[a,s]=Object(o.useState)(!1),[c,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",h),s(!0)},f=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",h),s(!1)},m=e=>"mouseUp"===e?f:"mouseDown"===e?p:void 0,h=m("mouseUp"),b=(t,r)=>n=>{if(H(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&a)return;d.cancel();const o=Object(i.includes)(["focus","mouseenter"],n.type);o!==c&&(r?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",h)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:b("onMouseEnter",!0),onMouseLeave:b("onMouseLeave"),onClick:b("onClick"),onFocus:b("onFocus"),onBlur:b("onBlur"),onMouseDown:m("mouseDown")},y=o.Children.only(e),{children:v,disabled:O}=y.props;return(O?B:U)({child:y,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:a})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(L,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(F,{className:"components-tooltip__shortcut",shortcut:a}))))({grandchildren:v,isOver:c,position:t,text:r,shortcut:n})})},Y=r(41),z=r(42);const q=["onMouseDown","onClick"];var W=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:a,isSmall:c,isPressed:u,isBusy:d,isDestructive:p,className:f,disabled:m,icon:h,iconPosition:b="left",iconSize:g,showTooltip:E,tooltipPosition:y,shortcut:v,label:O,children:S,text:_,variant:k,__experimentalIsFocusable:w,describedBy:j,...R}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:a,...s}){let i=a;var c,u,d,p,f;return t&&(null!==(c=i)&&void 0!==c||(i="primary")),n&&(null!==(u=i)&&void 0!==u||(i="tertiary")),r&&(null!==(d=i)&&void 0!==d||(i="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=i)&&void 0!==p||(i="secondary")),o&&(null!==(f=i)&&void 0!==f||(i="link")),{...s,variant:i}}(e),C=s()("components-button",f,{"is-secondary":"secondary"===k,"is-primary":"primary"===k,"is-small":c,"is-tertiary":"tertiary"===k,"is-pressed":u,"is-busy":d,"is-link":"link"===k,"is-destructive":p,"has-text":!!h&&!!S,"has-icon":!!h}),T=m&&!w,A=void 0===r||T?"button":"a",x="a"===A?{href:r,target:a}:{type:"button",disabled:T,"aria-pressed":u};if(m&&w){x["aria-disabled"]=!0;for(const e of q)R[e]=e=>{e.stopPropagation(),e.preventDefault()}}const P=!T&&(E&&O||v||!!O&&(!S||Object(i.isArray)(S)&&!S.length)&&!1!==E),M=j?Object(i.uniqueId)():null,N=R["aria-describedby"]||M,I=Object(o.createElement)(A,Object(n.a)({},x,R,{className:C,"aria-label":R["aria-label"]||O,"aria-describedby":N,ref:t}),h&&"left"===b&&Object(o.createElement)(Y.a,{icon:h,size:g}),_&&Object(o.createElement)(o.Fragment,null,_),h&&"right"===b&&Object(o.createElement)(Y.a,{icon:h,size:g}),S);return P?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(G,{text:j||O,shortcut:v,position:y},I),j&&Object(o.createElement)(z.a,null,Object(o.createElement)("span",{id:M},j))):Object(o.createElement)(o.Fragment,null,I,j&&Object(o.createElement)(z.a,null,Object(o.createElement)("span",{id:M},j)))}))},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,function(e,t,r){var n=r(80),o=r(55),a=o.setStyleProp,s=n.html,i=n.svg,c=n.isCustomAttribute,l=Object.prototype.hasOwnProperty;e.exports=function(e){var t,r,n,u;e=e||{};var d={};for(t in e)n=e[t],c(t)?d[t]=n:(r=t.toLowerCase(),l.call(s,r)?d[(u=s[r]).propertyName]=!!(u.hasBooleanValue||u.hasOverloadedBooleanValue&&!n)||n:l.call(i,t)?d[(u=i[t]).propertyName]=n:o.PRESERVE_CUSTOM_ATTRIBUTES&&(d[t]=n));return a(e.style,d),d}},function(e,t,r){var n=r(3),o=r(84).default,a={reactCompat:!0},s=n.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:s,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,a={},s={};for(r in e)n=e[r],o&&(a=t(r,n))&&2===a.length?s[a[0]]=a[1]:"string"==typeof n&&(s[n]=r);return s},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,a))}}},function(e,t,r){for(var n,o=r(90).CASE_SENSITIVE_TAG_NAMES,a={},s=0,i=o.length;s<i;s++)n=o[s],a[n.toLowerCase()]=n;function c(e){for(var t,r={},n=0,o=e.length;n<o;n++)r[(t=e[n]).name]=t.value;return r}function l(e){return function(e){return a[e]}(e=e.toLowerCase())||e}e.exports={formatAttributes:c,formatDOM:function e(t,r,n){r=r||null;for(var o,a,s,i=[],u=0,d=t.length;u<d;u++){switch(o=t[u],s={next:null,prev:i[u-1]||null,parent:r},(a=i[u-1])&&(a.next=s),"#"!==o.nodeName[0]&&(s.name=l(o.nodeName),s.attribs={},o.attributes&&o.attributes.length&&(s.attribs=c(o.attributes))),o.nodeType){case 1:"script"===s.name||"style"===s.name?s.type=s.name:s.type="tag",s.children=e(o.childNodes,s);break;case 3:s.type="text",s.data=o.nodeValue;break;case 8:s.type="comment",s.data=o.nodeValue}i.push(s)}return n&&(i.unshift({name:n.substring(0,n.indexOf(" ")).toLowerCase(),data:n,type:"directive",next:i[0]?i[0]:null,prev:null,parent:r}),i[1]&&(i[1].prev=i[0])),i},isIE:function(e){return e?document.documentMode===e:/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),a=()=>Object(n.useContext)(o),s=e=>{let{children:t}=e;const[r,a]=Object(n.useState)(!1),s={setIsSuppressed:a,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:s},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},function(e,t,r){var n=r(79),o=r(54),a=r(88),s={decodeEntities:!0,lowerCaseAttributeNames:!1};function i(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:n(a(e,(t=t||{}).htmlparser2||s),t)}i.domToReact=n,i.htmlToDOM=a,i.attributesToProps=o,e.exports=i,e.exports.default=i},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},,function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,l=[],u=!1,d=-1;function p(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=i(p);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||u||i(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),o=r(7),a=r(0),s=r(12),i=r.n(s),c=r(61),l=r(67);const u=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:s}=Object(o.useSelect)(e=>{const t=e(n.CART_STORE_KEY);return{shippingRates:t.getShippingRates(),needsShipping:t.getNeedsShipping(),hasCalculatedShipping:t.getHasCalculatedShipping(),isLoadingRates:t.isCustomerDataUpdating()}}),{isSelectingRate:u,selectShippingRate:d}=Object(l.a)(),p=Object(a.useRef)({});return Object(a.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:r,shipping_rates:n}=e;return[r,null===(t=n.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(c.a)(t)&&!i()(p.current,t)&&(p.current=t)},[e]),{isSelectingRate:u,selectedRates:p.current,selectShippingRate:d,shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:s}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(7),o=r(5);const a=()=>{const{customerData:e,isInitialized:t}=Object(n.useSelect)(e=>{const t=e(o.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:r,setBillingData:a}=Object(n.useDispatch)(o.CART_STORE_KEY);return{isInitialized:t,billingData:e.billingData,shippingAddress:e.shippingAddress,setBillingData:a,setShippingAddress:r}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return O}));var n=r(0);const o={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},a={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},s={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:()=>null,shippingErrorTypes:o,shippingRates:[],isLoadingRates:!1,selectedRates:[],setSelectedRates:()=>null,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:()=>null,onShippingRateSuccess:()=>null,onShippingRateFail:()=>null,onShippingRateSelectSuccess:()=>null,onShippingRateSelectFail:()=>null,needsShipping:!1},i=(e,t)=>{let{type:r}=t;return Object.values(o).includes(r)?r:e};var c=r(91),l=r(197);const u=e=>({onSuccess:Object(l.a)("shipping_rates_success",e),onFail:Object(l.a)("shipping_rates_fail",e),onSelectSuccess:Object(l.a)("shipping_rate_select_success",e),onSelectFail:Object(l.a)("shipping_rate_select_fail",e)});var d=r(199),p=r(34),f=r(31),m=r(67),h=r(64);const{NONE:b,INVALID_ADDRESS:g,UNKNOWN:E}=o,y=Object(n.createContext)(s),v=()=>Object(n.useContext)(y),O=e=>{let{children:t}=e;const{dispatchActions:r}=Object(p.b)(),{shippingRates:s,isLoadingRates:l,cartErrors:v}=Object(f.a)(),{isSelectingRate:O}=Object(m.a)(),{selectedRates:S}=Object(h.a)(),[_,k]=Object(n.useReducer)(i,b),[w,j]=Object(n.useReducer)(c.b,{}),R=Object(n.useRef)(w),C=Object(n.useMemo)(()=>({onShippingRateSuccess:u(j).onSuccess,onShippingRateFail:u(j).onFail,onShippingRateSelectSuccess:u(j).onSelectSuccess,onShippingRateSelectFail:u(j).onSelectFail}),[j]);Object(n.useEffect)(()=>{R.current=w},[w]),Object(n.useEffect)(()=>{l?r.incrementCalculating():r.decrementCalculating()},[l,r]),Object(n.useEffect)(()=>{O?r.incrementCalculating():r.decrementCalculating()},[O,r]),Object(n.useEffect)(()=>{v.length>0&&v.some(e=>!(!e.code||!Object.values(a).includes(e.code)))?k({type:g}):k({type:b})},[v]);const T=Object(n.useMemo)(()=>({isPristine:_===b,isValid:_===b,hasInvalidAddress:_===g,hasError:_===E||_===g}),[_]);Object(n.useEffect)(()=>{l||0!==s.length&&!T.hasError||Object(d.a)(R.current,"shipping_rates_fail",{hasInvalidAddress:T.hasInvalidAddress,hasError:T.hasError})},[s,l,T.hasError,T.hasInvalidAddress]),Object(n.useEffect)(()=>{!l&&s.length>0&&!T.hasError&&Object(d.a)(R.current,"shipping_rates_success",s)},[s,l,T.hasError]),Object(n.useEffect)(()=>{O||(T.hasError?Object(d.a)(R.current,"shipping_rate_select_fail",{hasError:T.hasError,hasInvalidAddress:T.hasInvalidAddress}):Object(d.a)(R.current,"shipping_rate_select_success",S.current))},[S,O,T.hasError,T.hasInvalidAddress]);const A={shippingErrorStatus:T,dispatchErrorStatus:k,shippingErrorTypes:o,...C};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(y.Provider,{value:A},t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7),o=r(0),a=r(5),s=r(72),i=r(40);const c=()=>{const e=Object(s.a)(),{dispatchCheckoutEvent:t}=Object(i.a)(),{selectShippingRate:r}=Object(n.useDispatch)(a.CART_STORE_KEY);return{selectShippingRate:Object(o.useCallback)((n,o)=>{r(n,o).then(()=>{t("set-selected-shipping-rate",{shippingRateId:n})}).catch(t=>{e(t)})},[r,t,e]),isSelectingRate:Object(n.useSelect)(e=>e(a.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return c}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:a,detail:s={}}=t;if(!n)return;a||(a=document.body);const i=new n(e,{bubbles:r,cancelable:o,detail:s});a.dispatchEvent(i)};let a;const s=()=>{a&&clearTimeout(a),a=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},i=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},c=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const a=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,a),()=>jQuery(document).off(e,a)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(11),o=r.n(n),a=r(0);r(106);const s=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(a.useRef)(null);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(a.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];s(e),null==e||e.focus()}else s(e)})(e,r):s(e))})(r.current,e)}})))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(7);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(n.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(n.select)("core/notices").getNotices(),{removeNotice:o}=Object(n.dispatch)("core/notices"),a=r.filter(t=>t.status===e);a.forEach(e=>o(e.id,t))}},function(e,t){},function(e,t,r){var n=r(3),o=r(54),a=r(55),s=a.setStyleProp;function i(e){return a.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&a.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var a,c,l,u,d=(r=r||{}).library||n,p=d.cloneElement,f=d.createElement,m=d.isValidElement,h=[],b="function"==typeof r.replace,g=r.trim,E=0,y=t.length;E<y;E++)if(a=t[E],b&&m(c=r.replace(a)))y>1&&(c=p(c,{key:c.key||E})),h.push(c);else if("text"!==a.type){switch(l=a.attribs,i(a)?s(l.style,l):l&&(l=o(l)),u=null,a.type){case"script":case"style":a.children[0]&&(l.dangerouslySetInnerHTML={__html:a.children[0].data});break;case"tag":"textarea"===a.name&&a.children[0]?l.defaultValue=a.children[0].data:a.children&&a.children.length&&(u=e(a.children,r));break;default:continue}y>1&&(l.key=E),h.push(f(a.name,l,u))}else g?a.data.trim()&&h.push(a.data):h.push(a.data);return 1===h.length?h[0]:h}},function(e,t,r){var n=r(81),o=r(82),a=r(83),s=a.MUST_USE_PROPERTY,i=a.HAS_BOOLEAN_VALUE,c=a.HAS_NUMERIC_VALUE,l=a.HAS_POSITIVE_NUMERIC_VALUE,u=a.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function p(e,t,r){var n,o,a,p=e.Properties,f=e.DOMAttributeNames;for(o in p)n=f[o]||(r?o:o.toLowerCase()),a=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:d(a,s),hasBooleanValue:d(a,i),hasNumericValue:d(a,c),hasPositiveNumericValue:d(a,l),hasOverloadedBooleanValue:d(a,u)}}var f={};p(n,f);var m={};p(o,m,!0);var h={};p(n,h),p(o,h,!0),e.exports={html:f,svg:m,properties:h,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(85)),a=r(87);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[a.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(86);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var a,s,i=n(e),c="function"==typeof t,l=0,u=i.length;l<u;l++)a=(r=i[l]).property,s=r.value,c?t(a,s,r):s&&(o||(o={}),o[a]=s);return o}},function(e,t){var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var l=1,d=1;function p(e){var t=e.match(n);t&&(l+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:l,column:d};return function(t){return t.position=new m(e),E(),t}}function m(e){this.start=e,this.end={line:l,column:d},this.source=t.source}m.prototype.content=e;var h=[];function b(r){var n=new Error(t.source+":"+l+":"+d+": "+r);if(n.reason=r,n.filename=t.source,n.line=l,n.column=d,n.source=e,!t.silent)throw n;h.push(n)}function g(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function E(){g(o)}function y(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return b("End of comment missing");var n=e.slice(2,r-2);return d+=2,p(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}function O(){var e=f(),t=g(a);if(t){if(v(),!g(s))return b("property missing ':'");var n=g(i),o=e({type:"declaration",property:u(t[0].replace(r,"")),value:n?u(n[0].replace(r,"")):""});return g(c),o}}return E(),function(){var e,t=[];for(y(t);e=O();)!1!==e&&(t.push(e),y(t));return t}()}},function(e,t,r){"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,o=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,i=function(e,t){return t.toUpperCase()},c=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||a.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(s,c)),e.replace(o,i))}},function(e,t,r){var n=r(89),o=r(56),a=o.formatDOM,s=o.isIE(9),i=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(i);return r&&r[1]&&(t=r[1],s&&(e=e.replace(r[0],""))),a(n(e),null,t)}},function(e,t,r){var n=r(56),o=/<([a-zA-Z]+[0-9]?)/,a=/<head.*>/i,s=/<body.*>/i,i=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,c=n.isIE(9),l=c||n.isIE(),u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},d=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,f=c?"text/xml":"text/html";u=d=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),c&&(e=e.replace(i,"<$1$2$3/>")),p.parseFromString(e,f)}}if(document.implementation){var m=document.implementation.createHTMLDocument(l?"html-dom-parser":void 0);u=function(e,t){if(t)return m.documentElement.getElementsByTagName(t)[0].innerHTML=e,m;try{return m.documentElement.innerHTML=e,m}catch(t){if(d)return d(e)}}}var h,b=document.createElement("template");b.content&&(h=function(e){return b.innerHTML=e,b.content.childNodes}),e.exports=function(e){var t,r,n,i,c=e.match(o);switch(c&&c[1]&&(t=c[1].toLowerCase()),t){case"html":return r=d(e),a.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),s.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return i=u(e).getElementsByTagName(t),s.test(e)&&a.test(e)?i[0].parentNode.childNodes:i;default:return h?h(e):u(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(6);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const a={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(n.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},s={},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,eventType:r,id:n,callback:a,priority:i}=arguments.length>1?arguments[1]:void 0;const c=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return c.set(n,{priority:i,callback:a}),{...e,[r]:c};case o.REMOVE_EVENT_CALLBACK:return c.delete(n),{...e,[r]:c}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));var n=r(1),o=r(18);const a=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},s=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,r){"use strict";var n=r(0),o=r(14);const a=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=a},function(e,t,r){"use strict";var n=r(0),o=r(6),a=r(4),s=r.n(a),i=r(1),c=r(20),l=r(93),u=r(50);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:a=r,onRemove:p=o.noop,isDismissible:f=!0,actions:m=[],politeness:h=d(t),__unstableHTML:b,onDismiss:g=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(c.speak)(r,t)},[r,t])}(a,h);const E=s()(e,"components-notice","is-"+t,{"is-dismissible":f});return b&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:a=!1,onClick:i,url:c},l)=>{let d=o;return"primary"===o||a||(d=c?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:c,variant:d,onClick:c?void 0:i,className:s()("components-notice__action",e)},t)}))),f&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(i.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(11)),a=n(r(128)),s=r(3),i=n(s),c=n(r(129)),l=n(r(131)),u={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(u.str(e)||u.num(e))return e===t;if(u.obj(e)&&u.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!u.und(r)||e===t}};function d(){var e=s.useState(!1)[1];return s.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return u.und(e)||u.nul(e)?t:e}function f(e){return u.und(e)?[]:u.arr(e)?e:[e]}function m(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return u.fun(e)?e.apply(void 0,r):e}function h(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,a(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(u.und(t))return o({to:t},e);var r=Object.keys(e).reduce((function(r,n){var a;return u.und(t[n])?o({},r,((a={})[n]=e[n],a)):r}),{});return o({to:t},r)}var b,g,E=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof E&&e.addChild(l(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof E&&e.removeChild(l(t))}))},t}return c(t,e),t}(E),v=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof E&&e.addChild(l(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof E&&e.removeChild(l(t))}))},t}c(t,e);var r=t.prototype;return r.getValue=function(e){void 0===e&&(e=!1);var t={};for(var r in this.payload){var n=this.payload[r];(!e||n instanceof E)&&(t[r]=n instanceof E?n[e?"getAnimatedValue":"getValue"]():n)}return t},r.getAnimatedValue=function(){return this.getValue(!0)},t}(E);function O(e,t){b={fn:e,transform:t}}function S(e){g=e}var _,k=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},w=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function j(e){_=e}var R,C=function(){return Date.now()};function T(e){R=e}var A,x,P=function(e){return e.current};function M(e){A=e}var N=Object.freeze({get applyAnimatedValues(){return b},injectApplyAnimatedValues:O,get colorNames(){return g},injectColorNames:S,get requestFrame(){return k},get cancelFrame(){return w},injectFrame:function(e,t){k=e,w=t},get interpolation(){return _},injectStringInterpolator:j,get now(){return C},injectNow:function(e){C=e},get defaultElement(){return R},injectDefaultElement:T,get animatedApi(){return P},injectAnimatedApi:function(e){P=e},get createAnimatedStyle(){return A},injectCreateAnimatedStyle:M,get manualFrameloop(){return x},injectManualFrameloop:function(e){x=e}}),I=function(e){function t(t,r){var n;return(n=e.call(this)||this).update=void 0,n.payload=t.style?o({},t,{style:A(t.style)}):t,n.update=r,n.attach(),n}return c(t,e),t}(v),D=!1,L=new Set,F=function e(){if(!D)return!1;var t=C(),r=L,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}for(var s=a,i=!1,c=0;c<s.configs.length;c++){for(var l=s.configs[c],u=void 0,d=void 0,p=0;p<l.animatedValues.length;p++){var f=l.animatedValues[p];if(!f.done){var m=l.fromValues[p],h=l.toValues[p],b=f.lastPosition,g=h instanceof E,y=Array.isArray(l.initialVelocity)?l.initialVelocity[p]:l.initialVelocity;if(g&&(h=h.getValue()),l.immediate)f.setValue(h),f.done=!0;else if("string"!=typeof m&&"string"!=typeof h){if(void 0!==l.duration)b=m+l.easing((t-f.startTime)/l.duration)*(h-m),u=t>=f.startTime+l.duration;else if(l.decay)b=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-f.startTime))),(u=Math.abs(f.lastPosition-b)<.1)&&(h=b);else{d=void 0!==f.lastTime?f.lastTime:t,y=void 0!==f.lastVelocity?f.lastVelocity:l.initialVelocity,t>d+64&&(d=t);for(var v=Math.floor(t-d),O=0;O<v;++O)b+=1*(y+=(-l.tension*(b-h)+-l.friction*y)/l.mass*1/1e3)/1e3;var S=!(!l.clamp||0===l.tension)&&(m<h?b>h:b<h),_=Math.abs(y)<=l.precision,w=0===l.tension||Math.abs(h-b)<=l.precision;u=S||_&&w,f.lastVelocity=y,f.lastTime=t}g&&!l.toValues[p].done&&(u=!1),u?(f.value!==h&&(b=h),f.done=!0):i=!0,f.setValue(b),f.lastPosition=b}else f.setValue(h),f.done=!0}}s.props.onFrame&&(s.values[l.name]=l.interpolation.getValue())}s.props.onFrame&&s.props.onFrame(s.values),i||(L.delete(s),s.stop(!0))}return L.size?x?x():k(e):D=!1,D};function V(e,t,r){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:r});if(_&&"string"==typeof e.output[0])return _(e);var n=e,o=n.output,a=n.range||[0,1],s=n.extrapolateLeft||n.extrapolate||"extend",i=n.extrapolateRight||n.extrapolate||"extend",c=n.easing||function(e){return e};return function(e){var t=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(e,a);return function(e,t,r,n,o,a,s,i,c){var l=c?c(e):e;if(l<t){if("identity"===s)return l;"clamp"===s&&(l=t)}if(l>r){if("identity"===i)return l;"clamp"===i&&(l=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?l=-l:r===1/0?l-=t:l=(l-t)/(r-t),l=a(l),n===-1/0?l=-l:o===1/0?l+=n:l=l*(o-n)+n,l)}(e,a[t],a[t+1],o[t],o[t+1],c,s,i,n.map)}}var B=function(e){function t(r,n,o,a){var s;return(s=e.call(this)||this).calc=void 0,s.payload=r instanceof y&&!(r instanceof t)?r.getPayload():Array.isArray(r)?r:[r],s.calc=V(n,o,a),s}c(t,e);var r=t.prototype;return r.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},r.updateConfig=function(e,t,r){this.calc=V(e,t,r)},r.interpolate=function(e,r,n){return new t(this,e,r,n)},t}(y),U=function(e){function t(t){var r;return(r=e.call(this)||this).animatedStyles=new Set,r.value=void 0,r.startPosition=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.startTime=void 0,r.lastTime=void 0,r.done=!1,r.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},r.value=t,r.startPosition=t,r.lastPosition=t,r}c(t,e);var r=t.prototype;return r.flush=function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},r.clearStyles=function(){this.animatedStyles.clear()},r.getValue=function(){return this.value},r.interpolate=function(e,t,r){return new B(this,e,t,r)},t}(E),H=function(e){function t(t){var r;return(r=e.call(this)||this).payload=t.map((function(e){return new U(e)})),r}c(t,e);var r=t.prototype;return r.setValue=function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))},r.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},r.interpolate=function(e,t){return new B(this,e,t)},t}(y),G=0,Y=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=G++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=h(e),r=t.delay,n=void 0===r?0:r,s=t.to,i=a(t,["delay","to"]);if(u.arr(s)||u.fun(s))this.queue.push(o({},i,{delay:n,to:s}));else if(s){var c={};Object.entries(s).forEach((function(e){var t,r=e[0],a=e[1],s=o({to:(t={},t[r]=a,t),delay:m(n,r)},i),l=c[s.delay]&&c[s.delay].to;c[s.delay]=o({},c[s.delay],s,{to:o({},l,s.to)})})),this.queue=Object.values(c)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(i),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var r=e.from,n=void 0===r?{}:r,a=e.to,s=void 0===a?{}:a;u.obj(n)&&(t.merged=o({},n,t.merged)),u.obj(s)&&(t.merged=o({},t.merged,s))}));var r=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach((function(o,s){var i=o.delay,c=a(o,["delay"]),l=function(o){s===n.length-1&&r===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},d=u.arr(c.to)||u.fun(c.to);i?setTimeout((function(){r===t.guid&&(d?t.runAsync(c,l):t.diff(c).start(l))}),i):d?t.runAsync(c,l):t.diff(c).start(l)}))}else u.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,L.has(this)||L.add(this),D||(D=!0,k(x||F));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,L.has(this)&&L.delete(this)),this},t.runAsync=function(e,t){var r=this,n=(e.delay,a(e,["delay"])),s=this.local,i=Promise.resolve(void 0);if(u.arr(n.to))for(var c=function(e){var t=e,a=o({},n,h(n.to[t]));u.arr(a.config)&&(a.config=a.config[t]),i=i.then((function(){if(s===r.guid)return new Promise((function(e){return r.diff(a).start(e)}))}))},l=0;l<n.to.length;l++)c(l);else if(u.fun(n.to)){var d,p=0;i=i.then((function(){return n.to((function(e){var t=o({},n,h(e));if(u.arr(t.config)&&(t.config=t.config[p]),p++,s===r.guid)return d=new Promise((function(e){return r.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),r.stop(e)})).then((function(){return d}))}))}i.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var r=this.props,n=r.from,a=void 0===n?{}:n,s=r.to,i=void 0===s?{}:s,c=r.config,l=void 0===c?{}:c,d=r.reverse,h=r.attach,b=r.reset,E=r.immediate;if(d){var y=[i,a];a=y[0],i=y[1]}this.merged=o({},a,this.merged,i),this.hasChanged=!1;var v=h&&h(this);if(this.animations=Object.entries(this.merged).reduce((function(e,r){var n=r[0],s=r[1],i=e[n]||{},c=u.num(s),d=u.str(s)&&!s.startsWith("#")&&!/\d/.test(s)&&!g[s],h=u.arr(s),y=!c&&!h&&!d,O=u.und(a[n])?s:a[n],S=c||h||d?s:1,k=m(l,n);v&&(S=v.animations[n].parent);var w,j=i.parent,R=i.interpolation,T=f(v?S.getPayload():S),A=s;y&&(A=_({range:[0,1],output:[s,s]})(1));var x,P=R&&R.getValue(),M=!u.und(j)&&i.animatedValues.some((function(e){return!e.done})),N=!u.equ(A,P),I=!u.equ(A,i.previous),D=!u.equ(k,i.config);if(b||I&&N||D){var L;if(c||d)j=R=i.parent||new U(O);else if(h)j=R=i.parent||new H(O);else if(y){var F=i.interpolation&&i.interpolation.calc(i.parent.value);F=void 0===F||b?O:F,i.parent?(j=i.parent).setValue(0,!1):j=new U(0);var V={output:[F,s]};i.interpolation?(R=i.interpolation,i.interpolation.updateConfig(V)):R=j.interpolate(V)}return T=f(v?S.getPayload():S),w=f(j.getPayload()),b&&!y&&j.setValue(O,!1),t.hasChanged=!0,w.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=M?e.lastVelocity:void 0,e.lastTime=M?e.lastTime:void 0,e.startTime=C(),e.done=!1,e.animatedStyles.clear()})),m(E,n)&&j.setValue(y?S:s,!1),o({},e,((L={})[n]=o({},i,{name:n,parent:j,interpolation:R,animatedValues:w,toValues:T,previous:A,config:k,fromValues:f(j.getValue()),immediate:m(E,n),initialVelocity:p(k.velocity,0),clamp:p(k.clamp,!1),precision:p(k.precision,.01),tension:p(k.tension,170),friction:p(k.friction,26),mass:p(k.mass,1),duration:k.duration,easing:p(k.easing,(function(e){return e})),decay:k.decay}),L))}return N?e:(y&&(j.setValue(1,!1),R.updateConfig({output:[A,A]})),j.done=!0,t.hasChanged=!0,o({},e,((x={})[n]=o({},e[n],{previous:A}),x)))}),this.animations),this.hasChanged)for(var O in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[O]=this.animations[O].interpolation,this.values[O]=this.animations[O].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),z=function(e,t){var r=s.useRef(!1),n=s.useRef(),o=u.fun(t),a=s.useMemo((function(){var r;return n.current&&(n.current.map((function(e){return e.destroy()})),n.current=void 0),[new Array(e).fill().map((function(e,n){var a=new Y,s=o?m(t,n,a):t[n];return 0===n&&(r=s.ref),a.update(s),r||a.start(),a})),r]}),[e]),i=a[0],c=a[1];n.current=i,s.useImperativeHandle(c,(function(){return{start:function(){return Promise.all(n.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return n.current.forEach((function(t){return t.stop(e)}))},get controllers(){return n.current}}}));var l=s.useMemo((function(){return function(e){return n.current.map((function(t,r){t.update(o?m(e,r,t):e[r]),c||t.start()}))}}),[e]);s.useEffect((function(){r.current?o||l(t):c||n.current.forEach((function(e){return e.start()}))})),s.useEffect((function(){return r.current=!0,function(){return n.current.forEach((function(e){return e.destroy()}))}}),[]);var d=n.current.map((function(e){return e.getValues()}));return o?[d,l,function(e){return n.current.forEach((function(t){return t.pause(e)}))}]:d},q=0,W=function(e,t){return("function"==typeof t?e.map(t):f(t)).map(String)},X=function(e){var t=e.items,r=e.keys,n=void 0===r?function(e){return e}:r,s=a(e,["items","keys"]);return t=f(void 0!==t?t:null),o({items:t,keys:W(t,n)},s)};function K(e,t){var r=function(){if(o){if(a>=n.length)return"break";s=n[a++]}else{if((a=n.next()).done)return"break";s=a.value}var r=s.key,i=function(e){return e.key!==r};(u.und(t)||t===r)&&(e.current.instances.delete(r),e.current.transitions=e.current.transitions.filter(i),e.current.deleted=e.current.deleted.filter(i))},n=e.current.deleted,o=Array.isArray(n),a=0;for(n=o?n:n[Symbol.iterator]();;){var s;if("break"===r())break}e.current.forceUpdate()}var $=function(e){function t(t){var r;return void 0===t&&(t={}),r=e.call(this)||this,!t.transform||t.transform instanceof E||(t=b.transform(t)),r.payload=t,r}return c(t,e),t}(v),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Q="[-+]?\\d*\\.?\\d+";function Z(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+Z(Q,Q,Q)),te=new RegExp("rgba"+Z(Q,Q,Q,Q)),re=new RegExp("hsl"+Z(Q,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),ne=new RegExp("hsla"+Z(Q,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Q)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,se=/^#([0-9a-fA-F]{6})$/,ie=/^#([0-9a-fA-F]{8})$/;function ce(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function le(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,a=ce(o,n,e+1/3),s=ce(o,n,e),i=ce(o,n,e-1/3);return Math.round(255*a)<<24|Math.round(255*s)<<16|Math.round(255*i)<<8}function ue(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function de(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function fe(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function me(e){var t,r,n="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(r=se.exec(t))?parseInt(r[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(r=ee.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|255)>>>0:(r=te.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|pe(r[4]))>>>0:(r=oe.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+"ff",16)>>>0:(r=ie.exec(t))?parseInt(r[1],16)>>>0:(r=ae.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=re.exec(t))?(255|le(de(r[1]),fe(r[2]),fe(r[3])))>>>0:(r=ne.exec(t))?(le(de(r[1]),fe(r[2]),fe(r[3]))|pe(r[4]))>>>0:null;return null===n?e:"rgba("+((4278190080&(n=n||0))>>>24)+", "+((16711680&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var he=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys(J).join("|")+")","g"),Ee={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function ve(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||Ee.hasOwnProperty(e)&&Ee[e]?(""+t).trim():t+"px"}Ee=Object.keys(Ee).reduce((function(e,t){return ye.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),Ee);var Oe={};M((function(e){return new $(e)})),T("div"),j((function(e){var t=e.output.map((function(e){return e.replace(be,me)})).map((function(e){return e.replace(ge,me)})),r=t[0].match(he).map((function(){return[]}));t.forEach((function(e){e.match(he).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(he).map((function(t,n){return V(o({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(he,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,o){return"rgba("+Math.round(t)+", "+Math.round(r)+", "+Math.round(n)+", "+o+")"}))}})),S(J),O((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,o=t.scrollTop,s=t.scrollLeft,i=a(t,["style","children","scrollTop","scrollLeft"]),c="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var l in void 0!==o&&(e.scrollTop=o),void 0!==s&&(e.scrollLeft=s),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(l)){var u=0===l.indexOf("--"),d=ve(l,r[l],u);"float"===l&&(l="cssFloat"),u?e.style.setProperty(l,d):e.style[l]=d}for(var p in i){var f=c?p:Oe[p]||(Oe[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(f)&&e.setAttribute(f,i[p])}}),(function(e){return e}));var Se,_e,ke=(Se=function(e){return s.forwardRef((function(t,r){var n=d(),c=s.useRef(!0),l=s.useRef(null),p=s.useRef(null),f=s.useCallback((function(e){var t=l.current;l.current=new I(e,(function(){var e=!1;p.current&&(e=b.fn(p.current,l.current.getAnimatedValue())),p.current&&!1!==e||n()})),t&&t.detach()}),[]);s.useEffect((function(){return function(){c.current=!1,l.current&&l.current.detach()}}),[]),s.useImperativeHandle(r,(function(){return P(p,c,n)})),f(t);var m,h=l.current.getValue(),g=(h.scrollTop,h.scrollLeft,a(h,["scrollTop","scrollLeft"])),E=(m=e,!u.fun(m)||m.prototype instanceof i.Component?function(e){return p.current=function(e,t){return t&&(u.fun(t)?t(e):u.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return i.createElement(e,o({},g,{ref:E}))}))},void 0===(_e=!1)&&(_e=!0),function(e){return(u.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=_e?t[0].toLowerCase()+t.substring(1):t;return e[r]=Se(r),e}),Se)}),we=ke(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=ke,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=F,t.animated=we,t.a=we,t.interpolate=function(e,t,r){return e&&new B(e,t,r)},t.Globals=N,t.useSpring=function(e){var t=u.fun(e),r=z(1,t?e:[e]),n=r[0],o=r[1],a=r[2];return t?[n[0],o,a]:n},t.useTrail=function(e,t){var r=s.useRef(!1),n=u.fun(t),a=m(t),i=s.useRef(),c=z(e,(function(e,t){return 0===e&&(i.current=[]),i.current.push(t),o({},a,{config:m(a.config,e),attach:e>0&&function(){return i.current[e-1]}})})),l=c[0],d=c[1],p=c[2],f=s.useMemo((function(){return function(e){return d((function(t,r){e.reverse;var n=e.reverse?t+1:t-1,s=i.current[n];return o({},e,{config:m(e.config||a.config,t),attach:s&&function(){return s}})}))}}),[e,a.reverse]);return s.useEffect((function(){r.current&&!n&&f(t)})),s.useEffect((function(){r.current=!0}),[]),n?[l,f,p]:l},t.useTransition=function(e,t,r){var n=o({items:e,keys:t||function(e){return e}},r),i=X(n),c=i.lazy,l=void 0!==c&&c,u=(i.unique,i.reset),p=void 0!==u&&u,f=(i.enter,i.leave,i.update,i.onDestroyed),h=(i.keys,i.items,i.onFrame),b=i.onRest,g=i.onStart,E=i.ref,y=a(i,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),v=d(),O=s.useRef(!1),S=s.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!n.ref,instances:!O.current&&new Map,forceUpdate:v});return s.useImperativeHandle(n.ref,(function(){return{start:function(){return Promise.all(Array.from(S.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(S.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(S.current.instances).map((function(e){return e[1]}))}}})),S.current=function(e,t){for(var r=e.first,n=e.prevProps,s=a(e,["first","prevProps"]),i=X(t),c=i.items,l=i.keys,u=i.initial,d=i.from,p=i.enter,f=i.leave,h=i.update,b=i.trail,g=void 0===b?0:b,E=i.unique,y=i.config,v=i.order,O=void 0===v?["enter","leave","update"]:v,S=X(n),_=S.keys,k=S.items,w=o({},s.current),j=[].concat(s.deleted),R=Object.keys(w),C=new Set(R),T=new Set(l),A=l.filter((function(e){return!C.has(e)})),x=s.transitions.filter((function(e){return!e.destroyed&&!T.has(e.originalKey)})).map((function(e){return e.originalKey})),P=l.filter((function(e){return C.has(e)})),M=-g;O.length;)switch(O.shift()){case"enter":A.forEach((function(e,t){E&&j.find((function(t){return t.originalKey===e}))&&(j=j.filter((function(t){return t.originalKey!==e})));var n=l.indexOf(e),o=c[n],a=r&&void 0!==u?"initial":"enter";w[e]={slot:a,originalKey:e,key:E?String(e):q++,item:o,trail:M+=g,config:m(y,o,a),from:m(r&&void 0!==u?u||{}:d,o),to:m(p,o)}}));break;case"leave":x.forEach((function(e){var t=_.indexOf(e),r=k[t];j.unshift(o({},w[e],{slot:"leave",destroyed:!0,left:_[Math.max(0,t-1)],right:_[Math.min(_.length,t+1)],trail:M+=g,config:m(y,r,"leave"),to:m(f,r)})),delete w[e]}));break;case"update":P.forEach((function(e){var t=l.indexOf(e),r=c[t];w[e]=o({},w[e],{item:r,slot:"update",trail:M+=g,config:m(y,r,"update"),to:m(h,r)})}))}var N=l.map((function(e){return w[e]}));return j.forEach((function(e){var t,r=e.left,n=(e.right,a(e,["left","right"]));-1!==(t=N.findIndex((function(e){return e.originalKey===r})))&&(t+=1),t=Math.max(0,t),N=[].concat(N.slice(0,t),[n],N.slice(t))})),o({},s,{changed:A.length||x.length||P.length,first:r&&0===A.length,transitions:N,current:w,deleted:j,prevProps:t})}(S.current,n),S.current.changed&&S.current.transitions.forEach((function(e){var t=e.slot,r=e.from,n=e.to,a=e.config,s=e.trail,i=e.key,c=e.item;S.current.instances.has(i)||S.current.instances.set(i,new Y);var u=S.current.instances.get(i),d=o({},y,{to:n,from:r,config:a,ref:E,onRest:function(r){S.current.mounted&&(e.destroyed&&(E||l||K(S,i),f&&f(c)),!Array.from(S.current.instances).some((function(e){return!e[1].idle}))&&(E||l)&&S.current.deleted.length>0&&K(S),b&&b(c,t,r))},onStart:g&&function(){return g(c,t)},onFrame:h&&function(e){return h(c,t,e)},delay:s,reset:p&&"enter"===t});u.update(d),S.current.paused||u.start()})),s.useEffect((function(){return S.current.mounted=O.current=!0,function(){S.current.mounted=O.current=!1,Array.from(S.current.instances).map((function(e){return e[1].destroy()})),S.current.instances.clear()}}),[]),S.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:S.current.instances.get(n).getValues()}}))},t.useChain=function(e,t,r){void 0===r&&(r=1e3);var n=s.useRef();s.useEffect((function(){u.equ(e,n.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,n){var a=e.current;if(a){var s=a.controllers;if(s.length){var i=r*t[n];s.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+i})})),e.start()}))}}})):e.reduce((function(e,t,r){var n=t.current;return e.then((function(){return n.start()}))}),Promise.resolve()),n.current=e}))},t.useSprings=z},,,,,,,,,,,function(e,t){},,,,,,function(e,t,r){"use strict";(function(e){var n=r(0),o=r(6),a=r(4),s=r.n(a),i=r(20),c=r(1),l=(r(38),r(50));t.a=Object(n.forwardRef)((function({className:t,children:r,spokenMessage:a=r,politeness:u="polite",actions:d=[],onRemove:p=o.noop,icon:f=null,explicitDismiss:m=!1,onDismiss:h=o.noop},b){function g(e){e&&e.preventDefault&&e.preventDefault(),h(),p()}h=h||o.noop,function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(i.speak)(r,t)},[r,t])}(a,u),Object(n.useEffect)(()=>{const e=setTimeout(()=>{m||(h(),p())},1e4);return()=>clearTimeout(e)},[h,p]);const E=s()(t,"components-snackbar",{"components-snackbar-explicit-dismiss":!!m});d&&d.length>1&&(void 0!==e&&e.env,d=[d[0]]);const y=s()("components-snackbar__content",{"components-snackbar__content-with-icon":!!f});return Object(n.createElement)("div",{ref:b,className:E,onClick:m?o.noop:g,tabIndex:"0",role:m?"":"button",onKeyPress:m?o.noop:g,"aria-label":m?"":Object(c.__)("Dismiss this notice")},Object(n.createElement)("div",{className:y},f&&Object(n.createElement)("div",{className:"components-snackbar__icon"},f),r,d.map(({label:e,onClick:t,url:r},o)=>Object(n.createElement)(l.a,{key:o,href:r,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),p(),t&&t(e)}(e,t),className:"components-snackbar__action"},e)),m&&Object(n.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:"0",className:"components-snackbar__dismiss-button",onClick:g,onKeyPress:g},"✕")))}))}).call(this,r(63))},function(e,t){e.exports=window.wp.plugins},,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(45),o=(r(16),r(2));const a=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),s=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),a=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(a[r]="")}),a}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),o=r.n(n),a=r(0),s=r(4),i=r.n(s),c=r(94),l=r(7),u=(r(78),r(57));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:s}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:f}=Object(l.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(n);if(!m.length)return null;const h=i()(t,"wc-block-components-notices");return s?null:Object(a.createElement)("div",{className:h},m.map(e=>Object(a.createElement)(c.a,o()({key:"store-notice-"+e.id},e,{className:i()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&f(e.id,r)}}),e.content)))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),o=r(48),a=r(2),s=r(59),i=r.n(s),c=r(10),l=r(15);const u=(e,t)=>e&&t[e]?t[e]:null,d=e=>{let{block:t,blockMap:r,blockWrapper:o,children:s,depth:p=1}=e;return s&&0!==s.length?Array.from(s).map((e,s)=>{const{blockName:f="",...m}={key:`${t}_${p}_${s}`,...e instanceof HTMLElement?e.dataset:{},className:e instanceof Element?null==e?void 0:e.className:""},h=u(f,r);if(!h){const a=i()(e instanceof Element&&(null==e?void 0:e.outerHTML)||(null==e?void 0:e.textContent)||"");if("string"==typeof a&&a)return a;if(!Object(n.isValidElement)(a))return null;const s=e.childNodes.length?d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}):void 0;return s?Object(n.cloneElement)(a,m,s):Object(n.cloneElement)(a,m)}const b=o||n.Fragment;return Object(n.createElement)(n.Suspense,{key:`${t}_${p}_${s}_suspense`,fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(l.a,{text:"Unexpected error in: "+f,showErrorBlock:a.CURRENT_USER_IS_ADMIN},Object(n.createElement)(b,null,Object(n.createElement)(h,m,d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}),((e,t,r,o)=>{if(!Object(c.hasInnerBlocks)(e))return null;const s=r?Array.from(r).map(e=>e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null).filter(Boolean):[],i=Object(c.getRegisteredBlocks)(e).filter(e=>{let{blockName:t,force:r}=e;return!0===r&&!s.includes(t)}),d=o||n.Fragment;return Object(n.createElement)(n.Fragment,null,i.map((e,r)=>{let{blockName:o,component:s}=e;const i=s||u(o,t);return i?Object(n.createElement)(l.a,{text:"Unexpected error in: "+o,showErrorBlock:a.CURRENT_USER_IS_ADMIN},Object(n.createElement)(d,null,Object(n.createElement)(i,{key:`${o}_forced_${r}`}))):null}))})(f,r,e.childNodes,o)))))}):null},p=e=>{let{Block:t,selector:r,blockName:n,getProps:a=(()=>({})),blockMap:s,blockWrapper:i}=e;Object(o.a)({Block:t,selector:r,getProps:(e,t)=>{const r=d({block:n,blockMap:s,children:e.children||[],blockWrapper:i});return{...a(e,t),children:r}}})}},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(130);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));var n=r(0),o=r(113),a=r(2),s=r(15),i=r(201),c=r(66),l=r(46),u=r(34),d=r(1),p=r(25),f=r.n(p),m=r(117),h=r(92),b=r(7);const g=(e,t,r)=>{const n=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),o=`wc-${r}-new-payment-method`;return n.push({key:o,value:t}),n},E=(e,t)=>{f.a.setNonce&&"function"==typeof f.a.setNonce&&f.a.setNonce(e),null!=e&&e.get("User-ID")&&t.setCustomerId(parseInt(e.get("User-ID")||"0",10))};var y=r(194),v=r(31),O=r(57),S=()=>{const{hasError:e,onCheckoutValidationBeforeProcessing:t,dispatchActions:r,redirectUrl:o,isProcessing:a,isBeforeProcessing:s,isComplete:p,orderNotes:S,shouldCreateAccount:_,extensionData:k}=Object(u.b)(),{hasValidationErrors:w}=Object(y.b)(),{shippingErrorStatus:j}=Object(c.b)(),{billingData:R,shippingAddress:C}=Object(l.b)(),{cartNeedsPayment:T,cartNeedsShipping:A,receiveCart:x}=Object(v.a)(),{activePaymentMethod:P,isExpressPaymentMethodActive:M,currentStatus:N,paymentMethodData:I,expressPaymentMethods:D,paymentMethods:L,shouldSavePayment:F}=Object(i.b)(),{setIsSuppressed:V}=Object(O.b)(),{createErrorNotice:B,removeNotice:U}=Object(b.useDispatch)("core/notices"),H=Object(n.useRef)(R),G=Object(n.useRef)(C),Y=Object(n.useRef)(o),[z,q]=Object(n.useState)(!1),W=Object(n.useMemo)(()=>{var e;const t={...D,...L};return null==t||null===(e=t[P])||void 0===e?void 0:e.paymentMethodId},[P,D,L]),X=w&&!M||N.hasError||j.hasError,K=!e&&!X&&(N.isSuccessful||!T)&&a;Object(n.useEffect)(()=>{V(M)},[M,V]),Object(n.useEffect)(()=>{X===e||!a&&!s||M||r.setHasError(X)},[X,e,a,s,M,r]),Object(n.useEffect)(()=>{H.current=R,G.current=C,Y.current=o},[R,C,o]);const $=Object(n.useCallback)(()=>!w&&(N.hasError?{errorMessage:Object(d.__)("There was a problem with your payment option.","woo-gutenberg-products-block")}:!j.hasError||{errorMessage:Object(d.__)("There was a problem with your shipping option.","woo-gutenberg-products-block")}),[w,N.hasError,j.hasError]);Object(n.useEffect)(()=>{let e;return M||(e=t($,0)),()=>{M||e()}},[t,$,M]),Object(n.useEffect)(()=>{Y.current&&(window.location.href=Y.current)},[p]);const J=Object(n.useCallback)(async()=>{if(z)return;q(!0),U("checkout");const e=T?{payment_method:W,payment_data:g(I,F,P)}:{},t={billing_address:Object(m.a)(H.current),customer_note:S,create_account:_,...e,extensions:{...k}};A&&(t.shipping_address=Object(m.a)(G.current)),f()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(E(e.headers,r),!e.ok)throw new Error(e);return e.json()}).then(e=>{r.setAfterProcessing(e),q(!1)}).catch(e=>{try{null!=e&&e.headers&&E(e.headers,r),e.json().then(e=>{var t,n,o;null!==(t=e.data)&&void 0!==t&&t.cart&&x(e.data.cart),B(Object(h.b)(e),{id:"checkout",context:"wc/checkout"}),null==e||null===(n=e.additional_errors)||void 0===n||null===(o=n.forEach)||void 0===o||o.call(n,e=>{B(e.message,{id:e.error_code,context:"wc/checkout"})}),r.setAfterProcessing(e)})}catch{var t;B(Object(d.sprintf)(// Translators: %s Error text.
4
- Object(d.__)("%s Please try placing your order again.","woo-gutenberg-products-block"),null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(d.__)("Something went wrong.","woo-gutenberg-products-block")),{id:"checkout",context:"wc/checkout"})}r.setHasError(!0),q(!1)})},[z,U,T,W,I,F,P,S,_,k,A,r,B,x]);return Object(n.useEffect)(()=>{K&&!z&&J()},[J,K,z]),null};const _=e=>{let{children:t,isCart:r=!1,redirectUrl:d}=e;return Object(n.createElement)(u.a,{redirectUrl:d,isCart:r},Object(n.createElement)(l.a,null,Object(n.createElement)(c.a,null,Object(n.createElement)(i.a,null,t,Object(n.createElement)(s.a,{renderError:a.CURRENT_USER_IS_ADMIN?null:()=>null},Object(n.createElement)(o.PluginArea,{scope:"woocommerce-checkout"})),Object(n.createElement)(S,null)))))}},,,function(e,t,r){"use strict";var n=r(0);r(191),t.a=()=>Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},,function(e,t,r){"use strict";var n=r(0),o=r(1),a=r(4),s=r.n(a),i=(r(193),r(135));t.a=e=>{let{children:t,className:r,screenReaderLabel:a,showSpinner:c=!1,isLoading:l=!0}=e;return Object(n.createElement)("div",{className:s()(r,{"wc-block-components-loading-mask":l})},l&&c&&Object(n.createElement)(i.a,null),Object(n.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(n.createElement)("span",{className:"screen-reader-text"},a||Object(o.__)("Loading…","woo-gutenberg-products-block")))}},,,,,function(e,t){e.exports=window.wp.keycodes},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=(e,t)=>{const r=[];return Object.keys(e).forEach(n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default}),r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(0);const o=Object(n.createContext)({hasDarkControls:!1}),a=()=>Object(n.useContext)(o)},,,function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-cart-block","version":"1.0.0","title":"Filled Cart","description":"Contains blocks that are displayed when the cart contains products.","category":"woocommerce","supports":{"align":["wide"],"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-cart-block","version":"1.0.0","title":"Empty Cart","description":"Contains blocks that are displayed when the cart is empty.","category":"woocommerce","supports":{"align":["wide"],"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-items-block","version":"1.0.0","title":"Cart Items block","description":"Column containing cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-line-items-block","version":"1.0.0","title":"Cart Line Items","description":"Block containing current line items in Cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-items-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-totals-block","version":"1.0.0","title":"Cart Totals","description":"Column containing the cart totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/proceed-to-checkout-block","version":"1.0.0","title":"Proceed to checkout","description":"Allow customers proceed to Checkout.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-accepted-payment-methods-block","version":"1.0.0","title":"Accepted Payment Methods","description":"Display accepted payment methods.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":true},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-subtotal-block","version":"1.0.0","title":"Subtotal","description":"Shows the cart subtotal row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-fee-block","version":"1.0.0","title":"Fees","description":"Shows the cart fee row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-discount-block","version":"1.0.0","title":"Discount","description":"Shows the cart discount row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-shipping-block","version":"1.0.0","title":"Shipping","description":"Shows the cart shipping row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-coupon-form-block","version":"1.0.0","title":"Coupon Form","description":"Shows the apply coupon form.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-taxes-block","version":"1.0.0","title":"Taxes","description":"Shows the cart taxes row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-heading-block","version":"1.0.0","title":"Heading","description":"Shows the heading row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"content":{"type":"string","default":"Cart totals"},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return l}));var n=r(0),o=r(6),a=r(12),s=r.n(a);const i=Object(n.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),c=()=>Object(n.useContext)(i),l=e=>{let{children:t}=e;const[r,a]=Object(n.useState)({}),c=Object(n.useCallback)(e=>r[e],[r]),l=Object(n.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(n.useCallback)(e=>{a(t=>{if(!t[e])return t;const{[e]:r,...n}=t;return n})},[]),d=Object(n.useCallback)(()=>{a({})},[]),p=Object(n.useCallback)(e=>{e&&a(t=>(e=Object(o.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&s()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),f=Object(n.useCallback)((e,t)=>{a(r=>{if(!r.hasOwnProperty(e))return r;const n={...r[e],...t};return s()(r[e],n)?r:{...r,[e]:n}})},[]),m={getValidationError:c,setValidationErrors:p,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(n.useCallback)(e=>{f(e,{hidden:!0})},[f]),showValidationError:Object(n.useCallback)(e=>{f(e,{hidden:!1})},[f]),showAllValidationErrors:Object(n.useCallback)(()=>{a(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(n.createElement)(i.Provider,{value:m},t)}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(91);const o=(e,t)=>function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const a=n.a.addEventCallback(e,r,o);return t(a),()=>{t(n.a.removeEventCallback(e,a.id))}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));const n=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=r(29);const a=async(e,t,r)=>{const o=n(e,t),a=[];for(const e of o)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&a.push(t)}catch(e){console.error(e)}return!a.length||a},s=async(e,t,r)=>{const a=[],s=n(e,t);for(const e of s)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return a.push(t),a;a.push(t)}catch(e){return console.error(e),a.push({type:"error"}),a}return a}},,function(e,t,r){"use strict";r.d(t,"b",(function(){return L})),r.d(t,"a",(function(){return F}));var n=r(0),o=r(61),a=r(7);let s,i;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(s||(s={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(i||(i={}));const c={currentStatus:s.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},l={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:s,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,{type:t,paymentMethodData:r,shouldSavePaymentMethod:n=!1,errorMessage:o="",paymentMethods:a={},paymentMethod:l=""}=arguments.length>1?arguments[1]:void 0;switch(t){case s.PRISTINE:return{...c,...e,errorMessage:"",currentStatus:s.PRISTINE};case s.STARTED:return{...e,currentStatus:s.STARTED};case s.ERROR:return e.currentStatus!==s.ERROR?{...e,currentStatus:s.ERROR,errorMessage:o||e.errorMessage}:e;case s.FAILED:return e.currentStatus!==s.FAILED?{...e,currentStatus:s.FAILED,paymentMethodData:r||e.paymentMethodData,errorMessage:o||e.errorMessage}:e;case s.SUCCESS:return e.currentStatus!==s.SUCCESS?{...e,currentStatus:s.SUCCESS,paymentMethodData:r||e.paymentMethodData}:e;case s.PROCESSING:return e.currentStatus!==s.PROCESSING?{...e,currentStatus:s.PROCESSING,errorMessage:""}:e;case s.COMPLETE:return e.currentStatus!==s.COMPLETE?{...e,currentStatus:s.COMPLETE}:e;case i.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:a};case i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:a};case i.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:n};case i.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:l,paymentMethodData:r||e.paymentMethodData}}},d=r(1),p=r(17),f=r(30),m=r(2),h=r(47),b=r(26),g=r(46),E=r(31),y=r(29),v=r(64);const O=(e,t,r,o)=>{const[s,i]=Object(n.useState)(!1),{isEditor:c}=Object(b.a)(),{selectedRates:l}=Object(v.a)(),{billingData:u,shippingAddress:p}=Object(g.b)(),y=Object(f.a)(l),O=Object(f.a)(r),S=Object(E.a)(),{cartTotals:_,cartIsLoading:k,cartNeedsShipping:w,paymentRequirements:j}=S,R=Object(n.useRef)({cart:S,cartTotals:_,cartNeedsShipping:w,billingData:u,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:j}),{createErrorNotice:C}=Object(a.useDispatch)("core/notices");Object(n.useEffect)(()=>{R.current={cart:S,cartTotals:_,cartNeedsShipping:w,billingData:u,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:j}},[S,_,w,u,p,y,j]);const T=Object(n.useCallback)(async()=>{let r={};const n=e=>{r={...r,[e.name]:e}};for(let e=0;e<O.length;e++){const r=O[e],a=t[r];if(a)try{const e=!!c||await Promise.resolve(a.canMakePayment(R.current));if(e){if("object"==typeof e&&null!==e&&e.error)throw new Error(e.error.message);n(a)}}catch(e){if(m.CURRENT_USER_IS_ADMIN||c){const t=Object(d.sprintf)(
5
  /* translators: %s the id of the payment method being registered (bank transfer, cheque...) */
6
- Object(d.__)("There was an error registering the payment method with id '%s': ","woo-gutenberg-products-block"),a.paymentMethodId);C(`${t} ${e}`,{context:o,id:`wc-${a.paymentMethodId}-registration-error`})}}}e(r),i(!0)},[C,e,c,o,O,t]),A=Object(h.a)(T,500,{leading:!0});return Object(n.useEffect)(()=>{k||A()},[A,S,y,u,k]),s},S=e=>({type:e}),_=e=>({type:s.ERROR,errorMessage:e}),k=e=>{let{errorMessage:t,paymentMethodData:r}=e;return{type:s.FAILED,errorMessage:t,paymentMethodData:r}},w=e=>{let{paymentMethodData:t}=e;return{type:s.SUCCESS,paymentMethodData:t}},j=e=>({type:i.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),R=e=>({type:i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),C=e=>({type:i.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),T=(e,t)=>({type:i.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var A=r(65),x=r(34),P=r(91),M=r(197);var N=r(199),I=r(194);const D=Object(n.createContext)(l),L=()=>Object(n.useContext)(D),F=e=>{let{children:t}=e;const{isProcessing:r,isIdle:i,isCalculating:l,hasError:d}=Object(x.b)(),{isEditor:f,getPreviewData:h}=Object(b.a)(),{setValidationErrors:g}=Object(I.b)(),{createErrorNotice:E,removeNotice:v}=Object(a.useDispatch)("core/notices"),{isSuccessResponse:L,isErrorResponse:F,isFailResponse:V,noticeContexts:B}=Object(y.d)(),[U,H]=Object(n.useReducer)(P.b,{}),{onPaymentProcessing:G}=(e=>Object(n.useMemo)(()=>({onPaymentProcessing:Object(M.a)("payment_processing",e)}),[e]))(H),Y=Object(n.useRef)(U);Object(n.useEffect)(()=>{Y.current=U},[U]);const[z,q]=Object(n.useReducer)(u,c),{dispatchActions:W,setPaymentStatus:X}=(e=>{const{setBillingData:t,setShippingAddress:r}=Object(A.a)();return{dispatchActions:Object(n.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(j(t))},setRegisteredExpressPaymentMethods:t=>{e(R(t))},setShouldSavePayment:t=>{e(C(t))},setActivePaymentMethod:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(T(t,r))}}),[e]),setPaymentStatus:Object(n.useCallback)(()=>({pristine:()=>e(S(s.PRISTINE)),started:()=>e(S(s.STARTED)),processing:()=>e(S(s.PROCESSING)),completed:()=>e(S(s.COMPLETE)),error:t=>e(_(t)),failed:function(r,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o&&t(o),e(k({errorMessage:r||"",paymentMethodData:n||{}}))},success:function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o&&t(o),void 0!==typeof a&&null!=a&&a.address&&r(a.address),e(w({paymentMethodData:n}))}}),[e,t,r])}})(q),K=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:r}=Object(y.d)(),n=new Set([...Object(m.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return O(e,t,Array.from(n),r.PAYMENTS)})(W.setRegisteredPaymentMethods),$=(e=>{const t=Object(p.getExpress
1
+ !function(e){function t(t){for(var r,o,a=t[0],s=t[1],i=0,l=[];i<a.length;i++)o=a[i],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&l.push(n[o][0]),n[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(c&&c(t);l.length;)l.shift()()}var r={},n={11:0,7:0,73:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var a=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=a);var s,i=document.createElement("script");i.charset="utf-8",i.timeout=120,o.nc&&i.setAttribute("nonce",o.nc),i.src=function(e){return o.p+""+({0:"vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66",1:"vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6",2:"vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b",3:"vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542",4:"cart-blocks/cart-line-items--mini-cart-contents-block/products-table",5:"cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping",12:"cart-blocks/cart-accepted-payment-methods",13:"cart-blocks/cart-express-payment",14:"cart-blocks/cart-items",15:"cart-blocks/cart-line-items",16:"cart-blocks/cart-order-summary",17:"cart-blocks/cart-totals",18:"cart-blocks/empty-cart",19:"cart-blocks/filled-cart",20:"cart-blocks/order-summary-coupon-form",21:"cart-blocks/order-summary-discount",22:"cart-blocks/order-summary-fee",23:"cart-blocks/order-summary-heading",24:"cart-blocks/order-summary-shipping",25:"cart-blocks/order-summary-subtotal",26:"cart-blocks/order-summary-taxes",27:"cart-blocks/proceed-to-checkout"}[e]||e)+"-frontend.js?ver="+{0:"071743a9ca2cfdafd79f",1:"e2dda84269ff5f357820",2:"bb568a01ffa114ca1394",3:"deab3ee0c5c13d3addc8",4:"89f09ba23bc79f34d574",5:"4633d7aaf0d614913380",12:"7346fa68956c1d3ee462",13:"5d5d2d138986a6bdc2ee",14:"497cd8ab48255af9b50d",15:"c50926eca8955679669f",16:"5acf6f9df18d8fe0570e",17:"beabb36f9afc88b4feb3",18:"f6628e966e355c915de9",19:"fd0392dda43dda02525c",20:"a0f83c5f3f9e75cd858f",21:"2fbcc787732cb9b65f30",22:"7f685f8beac3d104e331",23:"14f6290bb0565b065a38",24:"3e736b89e04324e8d78a",25:"a348afa0fb9493cb1f39",26:"7034e6f77b9b5139aafa",27:"357d370510f29a97ef5b"}[e]}(e);var c=new Error;s=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",c.name="ChunkLoadError",c.type=o,c.request=a,r[1](c)}n[e]=void 0}};var l=setTimeout((function(){s({type:"timeout",target:i})}),12e4);i.onerror=i.onload=s,document.head.appendChild(i)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var c=s;o(o.s=224)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},,function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";var n=r(19),o=r.n(n),a=r(0),s=r(3),i=r(1),c=r(44),l=e=>{let{imageUrl:t=c.l+"/block-error.svg",header:r=Object(i.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(i.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(i.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(a.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(a.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(a.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(a.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(a.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(a.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),l&&Object(a.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(33);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:s,renderError:i,button:c}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof i?i({errorMessage:u}):Object(a.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:c}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.a11y},,,,function(e,t,r){"use strict";(function(e){var n=r(0);r(38);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(63))},function(e,t){e.exports=window.wp.apiFetch},,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(n.useContext)(o)},,function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var n=r(61);let o,a;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(a||(a={}));const s=(e,t)=>Object(n.a)(e)&&"type"in e&&e.type===t,i=e=>s(e,o.SUCCESS),c=e=>s(e,o.ERROR),l=e=>s(e,o.FAIL),u=e=>!Object(n.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:a,shouldRetry:u,isSuccessResponse:i,isErrorResponse:c,isFailResponse:l})},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(12),a=r.n(o);function s(e){const t=Object(n.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(6),o=r(0),a=r(5),s=r(7),i=r(18),c=r(118),l=r(27),u=r(68);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(s.dispatch)(a.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},f=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h={...m,email:""},b={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:a.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(i.decodeEntities)(r)]})),E={cartCoupons:a.EMPTY_CART_COUPONS,cartItems:a.EMPTY_CART_ITEMS,cartFees:a.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:a.EMPTY_CART_ITEM_ERRORS,cartTotals:b,cartIsLoading:!0,cartErrors:a.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:m,shippingRates:a.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:a.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:a.EMPTY_EXTENSIONS},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),i=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();f();const p=Object(s.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return E;if(t)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:a.EMPTY_CART_ITEM_ERRORS,cartTotals:i.totals,cartIsLoading:!1,cartErrors:a.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:m,extensions:a.EMPTY_EXTENSIONS,shippingRates:i.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:()=>{}};const o=e(a.CART_STORE_KEY),s=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),f=o.isCustomerDataUpdating(),{receiveCart:b}=n(a.CART_STORE_KEY),y=g(s.billingAddress),v=s.needsShipping?g(s.shippingAddress):y,O=s.fees.length>0?s.fees.map(e=>g(e)):a.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map(e=>({...e,label:e.code})):a.EMPTY_CART_COUPONS,cartItems:s.items,cartFees:O,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingAddress:Object(c.a)(y),shippingAddress:Object(c.a)(v),extensions:s.extensions,shippingRates:s.shippingRates,isLoadingRates:f,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:b}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.deprecated},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return x})),r.d(t,"a",(function(){return P}));var n=r(0),o=r(1),a=r(58),s=r(32),i=r.n(s),c=r(52),l=r(61),u=r(7);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const p=()=>({type:d.SET_IDLE}),f=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},h=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var b=r(2),g=r(118);let E;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(E||(E={}));const y={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(b.getSetting)("checkoutData",{})||{}},v={redirectUrl:"",status:E.PRISTINE,hasError:!1,calculatingCount:0,orderId:y.order_id,orderNotes:"",customerId:y.customer_id,useShippingAsBilling:Object(g.b)(y.billing_address,y.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,{redirectUrl:t,type:r,customerId:n,orderId:o,orderNotes:a,extensionData:s,useShippingAsBilling:i,shouldCreateAccount:c,data:l}=arguments.length>1?arguments[1]:void 0,u=e;switch(r){case d.SET_PRISTINE:u=v;break;case d.SET_IDLE:u=e.status!==E.IDLE?{...e,status:E.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:l};break;case d.SET_COMPLETE:u=e.status!==E.COMPLETE?{...e,status:E.COMPLETE,redirectUrl:"string"==typeof(null==l?void 0:l.redirectUrl)?l.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==E.PROCESSING?{...e,status:E.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==E.BEFORE_PROCESSING?{...e,status:E.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==E.AFTER_PROCESSING?{...e,status:E.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===E.PROCESSING||e.status===E.BEFORE_PROCESSING?{...u,status:E.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==n?{...e,customerId:n}:e;break;case d.SET_ORDER_ID:u=void 0!==o?{...e,orderId:o}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==i&&i!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:i});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==c&&c!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:c});break;case d.SET_ORDER_NOTES:void 0!==a&&e.orderNotes!==a&&(u={...e,orderNotes:a});break;case d.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(u={...e,extensionData:s})}return u!==e&&r!==d.SET_PRISTINE&&u.status===E.PRISTINE&&(u.status=E.IDLE),u};var S=r(18),_=r(91),k=r(197);var w=r(199),j=r(194),R=r(40),C=r(29),T=r(77);const A=Object(n.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),x=()=>Object(n.useContext)(A),P=e=>{let{children:t,redirectUrl:r,isCart:s=!1}=e;v.redirectUrl=r;const[b,g]=Object(n.useReducer)(O,v),{setValidationErrors:y}=Object(j.b)(),{createErrorNotice:x}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:P}=Object(R.a)(),M=b.calculatingCount>0,{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D,shouldRetry:L}=Object(C.d)(),{checkoutNotices:F,paymentNotices:V,expressPaymentNotices:B}=(()=>{const{noticeContexts:e}=Object(C.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[U,H]=Object(n.useReducer)(_.b,{}),G=Object(n.useRef)(U),{onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:z,onCheckoutValidationBeforeProcessing:q}=(e=>Object(n.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(k.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(k.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(k.a)("checkout_validation_before_processing",e)}),[e]))(H);Object(n.useEffect)(()=>{G.current=U},[U]);const W=Object(n.useMemo)(()=>function(){return i()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),q(...arguments)},[q]),X=Object(n.useMemo)(()=>({resetCheckout:()=>{g({type:d.SET_PRISTINE})},setRedirectUrl:e=>{g(f(e))},setHasError:e=>{g(h(e))},incrementCalculating:()=>{g({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{g({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;g((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{g((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{g((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{g((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:r,value:n}=e;t.paymentDetails[r]=Object(S.decodeEntities)(n)})),"message"in e&&(t.message=Object(S.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var r;g(f((null==t?void 0:t.redirectUrl)||"")),g((r=t,{type:d.SET_PROCESSING_RESPONSE,data:r})),g({type:d.SET_AFTER_PROCESSING})}}),[]);Object(n.useEffect)(()=>{b.status===E.BEFORE_PROCESSING&&(Object(T.b)("error"),Object(w.a)(G.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;x(t,{context:"wc/checkout"}),y(r)}),g(p()),g(h())):g({type:d.SET_PROCESSING})}))},[b.status,y,x,g]);const K=Object(a.a)(b.status),$=Object(a.a)(b.hasError);Object(n.useEffect)(()=>{if((b.status!==K||b.hasError!==$)&&b.status===E.AFTER_PROCESSING){const e={redirectUrl:b.redirectUrl,orderId:b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,processingResponse:b.processingResponse};b.hasError?Object(w.b)(G.current,"checkout_after_processing_with_error",e).then(t=>{const r=(e=>{let t=null;return e.forEach(e=>{if((I(e)||D(e))&&e.message&&Object(c.a)(e.message)){const r=e.messageContext&&Object(c.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,x(e.message,r)}}),t})(t);if(null!==r)L(r)?g(p()):g(m(r));else{if(!(F.some(e=>"error"===e.status)||B.some(e=>"error"===e.status)||V.some(e=>"error"===e.status))){var n;const t=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");x(t,{id:"checkout",context:"wc/checkout"})}g(p())}}):Object(w.b)(G.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,r=null;if(e.forEach(e=>{N(e)&&(t=e),(I(e)||D(e))&&(r=e)}),t&&!r)g(m(t));else if(Object(l.a)(r)){if(r.message&&Object(c.a)(r.message)){const e=r.messageContext&&Object(c.a)(r.messageContext)?{context:r.messageContext}:void 0;x(r.message,e)}L(r)?g(h(!0)):g(m(r))}else g(m())})}},[b.status,b.hasError,b.redirectUrl,b.orderId,b.customerId,b.orderNotes,b.processingResponse,K,$,X,x,I,D,N,L,F,B,V]);const J={onSubmit:Object(n.useCallback)(()=>{P("submit"),g({type:d.SET_BEFORE_PROCESSING})},[P]),isComplete:b.status===E.COMPLETE,isIdle:b.status===E.IDLE,isCalculating:M,isProcessing:b.status===E.PROCESSING,isBeforeProcessing:b.status===E.BEFORE_PROCESSING,isAfterProcessing:b.status===E.AFTER_PROCESSING,hasError:b.hasError,redirectUrl:b.redirectUrl,onCheckoutBeforeProcessing:W,onCheckoutValidationBeforeProcessing:q,onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:z,dispatchActions:X,isCart:s,orderId:b.orderId,hasOrder:!!b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,useShippingAsBilling:b.useShippingAsBilling,setUseShippingAsBilling:e=>{return g((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:b.shouldCreateAccount,setShouldCreateAccount:e=>{return g((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:b.extensionData};return Object(n.createElement)(A.Provider,{value:J},t)}},,,function(e,t){e.exports=window.wc.priceFormat},function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(39),o=r(0),a=r(31);const s=()=>{const e=Object(a.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";var n=r(8),o=r(0),a=r(15),s=function({icon:e,className:t,...r}){const a=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:a},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(s,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&s===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===a.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(a.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},function(e,t,r){"use strict";var n=r(4),o=r.n(n),a=r(0);t.a=Object(a.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(a.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},,function(e,t,r){"use strict";r.d(t,"n",(function(){return a})),r.d(t,"l",(function(){return s})),r.d(t,"k",(function(){return i})),r.d(t,"m",(function(){return c})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return f})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return E}));var n,o=r(2);const a=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=a.pluginUrl+"images/",i=a.pluginUrl+"build/",c=a.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),a=r(69),s=r(52);const i=Object(n.getSetting)("countryLocale",{}),c=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(a.a)(e.priority)&&(t.index=e.priority),Object(s.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(i).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,c(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return i}));var n=r(0),o=r(65);const a=Object(n.createContext)({isInitialized:!1,billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:()=>{},setShippingAddress:()=>{}}),s=()=>Object(n.useContext)(a),i=e=>{let{children:t}=e;const r=Object(o.a)();return Object(n.createElement)(a.Provider,{value:r},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){var o=this,a=Object(n.useRef)(null),s=Object(n.useRef)(0),i=Object(n.useRef)(null),c=Object(n.useRef)([]),l=Object(n.useRef)(),u=Object(n.useRef)(),d=Object(n.useRef)(e),p=Object(n.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var m=!!(r=r||{}).leading,h=!("trailing"in r)||!!r.trailing,b="maxWait"in r,g=b?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=c.current,r=l.current;return c.current=l.current=null,s.current=e,u.current=d.current.apply(r,t)},r=function(e,t){f&&cancelAnimationFrame(i.current),i.current=f?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!p.current)return!1;var r=e-a.current,n=e-s.current;return!a.current||r>=t||r<0||b&&n>=g},E=function(t){return i.current=null,h&&c.current?e(t):(c.current=l.current=null,u.current)},y=function(){var e=Date.now();if(n(e))return E(e);if(p.current){var o=e-a.current,i=e-s.current,c=t-o,l=b?Math.min(c,g-i):c;r(y,l)}},v=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var h=Date.now(),g=n(h);if(c.current=d,l.current=o,a.current=h,g){if(!i.current&&p.current)return s.current=a.current,r(y,t),m?e(a.current):u.current;if(b)return r(y,t),e(a.current)}return i.current||r(y,t),u.current};return v.cancel=function(){i.current&&(f?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,c.current=a.current=l.current=i.current=null},v.isPending=function(){return!!i.current},v.flush=function(){return i.current?E(Date.now()):u.current},v}),[m,b,t,g,h,f])}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(11),o=r.n(n),a=r(0),s=r(16);const i=[".wp-block-woocommerce-cart"],c=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:i=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const c=n(e,r),l=i(e,r),u={...e.dataset,...c.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:i={},errorBoundaryProps:c={}}=e;Object(a.render)(Object(a.createElement)(s.a,c,Object(a.createElement)(a.Suspense,{fallback:Object(a.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(a.createElement)(t,o()({},i,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:c,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(i.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:a}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:a}=e;const s=document.body.querySelectorAll(o);a&&a.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,a)),c({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:a,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:a}=e;const s=a.querySelectorAll(o);c({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},,function(e,t,r){"use strict";var n=r(8),o=r(0),a=r(4),s=r.n(a),i=r(6),c=r(32),l=r.n(c),u=r(13),d=r(51),p=r(93),f=r(1);function m(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const a=o.getBoundingClientRect();return new n.DOMRect(e.left+a.left,e.top+a.top,e.width,e.height)}let h=0;function b(e){const t=document.scrollingElement||document.body;e&&(h=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=h)}let g=0;function E(){return Object(o.useEffect)(()=>(0===g&&b(!0),++g,()=>{1===g&&b(!1),--g}),[]),null}var y=r(24);function v(e){const t=Object(o.useContext)(y.a),r=t.slots[e]||{},n=t.fills[e],a=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:a,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var O=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function S({name:e,children:t,registerFill:r,unregisterFill:n}){const a=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(O),[n,a]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(a(t(e)),r(()=>{a(t(e))})),[e]),n})(e),s=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,s.current),()=>n(e,s.current)),[]),Object(o.useLayoutEffect)(()=>{s.current.children=t,a&&a.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==s.current.name&&(n(s.current.name,s.current),s.current.name=e,r(e,s.current))},[e]),a&&a.node?(Object(i.isFunction)(t)&&(t=t(a.props.fillProps)),Object(o.createPortal)(t,a.node)):null}var _=e=>Object(o.createElement)(O.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(S,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class k extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,a=Object(i.map)(n(t,this),e=>{const t=Object(i.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(i.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(i.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(i.isFunction)(e)?e(a):a)}}var w=e=>Object(o.createElement)(O.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:a})=>Object(o.createElement)(k,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:a})));function j(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function R({name:e,children:t}){const r=v(e),n=Object(o.useRef)({rerender:j()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...a},s){const i=Object(o.useContext)(y.a),c=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(i.registerSlot(e,c,t),()=>{i.unregisterSlot(e,c)}),[i.registerSlot,i.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{i.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([s,c])},a))}));function T(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_,e),Object(o.createElement)(R,e))}r(12),o.Component;const A=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(C,Object(n.a)({},t,{ref:r})):Object(o.createElement)(w,t));function x(e){return"appear"===e?"top":"left"}function P(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:a}=(s=t).ownerDocument.defaultView.getComputedStyle(s);var s;const i=r?parseInt(r,10):0,c=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+i,width:e.width-l-u,height:e.height-i-c,left:e.left+l,right:e.right-u,top:e.top+i,bottom:e.bottom-c}}function M(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function N(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function I(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const D=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:a,noArrow:i=!0,isAlternate:c,position:h="bottom right",range:b,focusOnMount:g="firstElement",anchorRef:y,shouldAnchorIncludePadding:O,anchorRect:S,getAnchorRect:_,expandOnMobile:k,animate:w=!0,onClickOutside:j,onFocusOutside:R,__unstableStickyBoundaryElement:C,__unstableSlotName:A="Popover",__unstableObserveElement:D,__unstableBoundaryParent:L,__unstableForcePosition:F,__unstableForceXAlignment:V,...B},U)=>{const H=Object(o.useRef)(null),G=Object(o.useRef)(null),Y=Object(o.useRef)(),z=Object(u.useViewportMatch)("medium","<"),[q,X]=Object(o.useState)(),K=v(A),$=k&&z,[J,Q]=Object(u.useResizeObserver)();i=$||i,Object(o.useLayoutEffect)(()=>{if($)return I(Y.current,"is-without-arrow",i),I(Y.current,"is-alternate",c),M(Y.current,"data-x-axis"),M(Y.current,"data-y-axis"),N(Y.current,"top"),N(Y.current,"left"),N(G.current,"maxHeight"),void N(G.current,"maxWidth");const e=()=>{if(!Y.current||!G.current)return;let e=function(e,t,r,n=!1,o,a){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,a)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return m(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,a);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=m(n.getBoundingClientRect(),n.ownerDocument,a);return o?e:P(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),s=t.getBoundingClientRect(),i=m(new window.DOMRect(r.left,r.top,r.width,s.bottom-r.top),e.ownerDocument,a);return o?i:P(i,n)}if(!e.current)return;const{parentNode:s}=e.current,i=s.getBoundingClientRect();return o?i:P(i,s)}(H,S,_,y,O,Y.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=Y.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var a;L&&(n=null===(a=Y.current.closest(".popover-slot"))||void 0===a?void 0:a.parentNode);const s=Q.height?Q:G.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:b,contentHeight:g,contentWidth:E}=function(e,t,r="top",n,o,a,s,i,c){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,a,s,i){const{height:c}=t;if(o){const t=o.getBoundingClientRect().top+c-s;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-c/2>0?c/2:l)+(l+c/2>window.innerHeight?window.innerHeight-l:c/2)},d={popoverTop:e.top,contentHeight:e.top-10-c>0?c:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+c>window.innerHeight?window.innerHeight-10-e.bottom:c};let f,m=r,h=null;if(!o&&!i)if("middle"===r&&u.contentHeight===c)m="middle";else if("top"===r&&d.contentHeight===c)m="top";else if("bottom"===r&&p.contentHeight===c)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;h=e!==c?e:null}return f="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:f,contentHeight:h}}(e,t,l,d,n,0,a,i);return{...function(e,t,r,n,o,a,s,i,c){const{width:l}=t;"left"===r&&Object(f.isRTL)()?r="right":"right"===r&&Object(f.isRTL)()&&(r="left"),"left"===n&&Object(f.isRTL)()?n="right":"right"===n&&Object(f.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===a||c||(p=u);let m=e.right;"left"===n?m=e.left:"middle"===a||c||(m=u);const h={popoverLeft:p,contentWidth:p-l>0?l:p},b={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let g,E=r,y=null;if(!o&&!i)if("center"===r&&d.contentWidth===l)E="center";else if("left"===r&&h.contentWidth===l)E="left";else if("right"===r&&b.contentWidth===l)E="right";else{E=h.contentWidth>b.contentWidth?"left":"right";const e="left"===E?h.contentWidth:b.contentWidth;l>window.innerWidth&&(y=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===E?d.popoverLeft:"left"===E?h.popoverLeft:b.popoverLeft,s){const e=s.getBoundingClientRect();g=Math.min(g,e.right-l),Object(f.isRTL)()||(g=Math.max(g,0))}return{xAxis:E,popoverLeft:g,contentWidth:y}}(e,t,u,d,n,p.yAxis,s,i,c),...p}}(e,s,h,C,Y.current,o,n,F,V);"number"==typeof l&&"number"==typeof u&&(N(Y.current,"top",l+"px"),N(Y.current,"left",u+"px")),I(Y.current,"is-without-arrow",i||"center"===p&&"middle"===b),I(Y.current,"is-alternate",c),M(Y.current,"data-x-axis",p),M(Y.current,"data-y-axis",b),N(G.current,"maxHeight","number"==typeof g?g+"px":""),N(G.current,"maxWidth","number"==typeof E?E+"px":""),X(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))};e();const{ownerDocument:t}=Y.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const a=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",a),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const s=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(y);let l;return s&&s!==t&&(s.defaultView.addEventListener("resize",e),s.defaultView.addEventListener("scroll",e,!0)),D&&(l=new r.MutationObserver(e),l.observe(D,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",a),r.cancelAnimationFrame(o),s&&s!==t&&(s.defaultView.removeEventListener("resize",e),s.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[$,S,_,y,O,h,Q,C,D,L]);const Z=(e,r)=>{if("focus-outside"===e&&R)R(r);else if("focus-outside"===e&&j){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),j(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),re=Object(u.useMergeRefs)([Y,ee,U]),ne=Boolean(w&&q)&&function(e){if("loading"===e.type)return s()("components-animate__loading");const{type:t,origin:r=x(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return s()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?s()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(n.a)({className:s()("components-popover",a,ne,{"is-expanded":$,"is-without-arrow":i,"is-alternate":c})},B,{ref:re},te,{tabIndex:"-1"}),$&&Object(o.createElement)(E,null),$&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(W,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:G,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return K.ref&&(oe=Object(o.createElement)(T,{name:A},oe)),y||S?oe:Object(o.createElement)("span",{ref:H},oe)});D.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(A,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var L=D,F=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(i.isString)(e)&&(r=e),Object(i.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const V=Object(o.createElement)("div",{className:"event-catcher"}),B=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(V,e),Object(o.cloneElement)(t,{children:r}),","),e),U=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),H=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var G=function({children:e,position:t,text:r,shortcut:n}){const[a,s]=Object(o.useState)(!1),[c,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",h),s(!0)},f=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",h),s(!1)},m=e=>"mouseUp"===e?f:"mouseDown"===e?p:void 0,h=m("mouseUp"),b=(t,r)=>n=>{if(H(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&a)return;d.cancel();const o=Object(i.includes)(["focus","mouseenter"],n.type);o!==c&&(r?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",h)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:b("onMouseEnter",!0),onMouseLeave:b("onMouseLeave"),onClick:b("onClick"),onFocus:b("onFocus"),onBlur:b("onBlur"),onMouseDown:m("mouseDown")},y=o.Children.only(e),{children:v,disabled:O}=y.props;return(O?B:U)({child:y,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:a})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(L,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(F,{className:"components-tooltip__shortcut",shortcut:a}))))({grandchildren:v,isOver:c,position:t,text:r,shortcut:n})})},Y=r(41),z=r(42);const q=["onMouseDown","onClick"];var W=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:a,isSmall:c,isPressed:u,isBusy:d,isDestructive:p,className:f,disabled:m,icon:h,iconPosition:b="left",iconSize:g,showTooltip:E,tooltipPosition:y,shortcut:v,label:O,children:S,text:_,variant:k,__experimentalIsFocusable:w,describedBy:j,...R}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:a,...s}){let i=a;var c,u,d,p,f;return t&&(null!==(c=i)&&void 0!==c||(i="primary")),n&&(null!==(u=i)&&void 0!==u||(i="tertiary")),r&&(null!==(d=i)&&void 0!==d||(i="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=i)&&void 0!==p||(i="secondary")),o&&(null!==(f=i)&&void 0!==f||(i="link")),{...s,variant:i}}(e),C=s()("components-button",f,{"is-secondary":"secondary"===k,"is-primary":"primary"===k,"is-small":c,"is-tertiary":"tertiary"===k,"is-pressed":u,"is-busy":d,"is-link":"link"===k,"is-destructive":p,"has-text":!!h&&!!S,"has-icon":!!h}),T=m&&!w,A=void 0===r||T?"button":"a",x="a"===A?{href:r,target:a}:{type:"button",disabled:T,"aria-pressed":u};if(m&&w){x["aria-disabled"]=!0;for(const e of q)R[e]=e=>{e.stopPropagation(),e.preventDefault()}}const P=!T&&(E&&O||v||!!O&&(!S||Object(i.isArray)(S)&&!S.length)&&!1!==E),M=j?Object(i.uniqueId)():null,N=R["aria-describedby"]||M,I=Object(o.createElement)(A,Object(n.a)({},x,R,{className:C,"aria-label":R["aria-label"]||O,"aria-describedby":N,ref:t}),h&&"left"===b&&Object(o.createElement)(Y.a,{icon:h,size:g}),_&&Object(o.createElement)(o.Fragment,null,_),h&&"right"===b&&Object(o.createElement)(Y.a,{icon:h,size:g}),S);return P?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(G,{text:j||O,shortcut:v,position:y},I),j&&Object(o.createElement)(z.a,null,Object(o.createElement)("span",{id:M},j))):Object(o.createElement)(o.Fragment,null,I,j&&Object(o.createElement)(z.a,null,Object(o.createElement)("span",{id:M},j)))}))},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,function(e,t,r){var n=r(80),o=r(55),a=o.setStyleProp,s=n.html,i=n.svg,c=n.isCustomAttribute,l=Object.prototype.hasOwnProperty;e.exports=function(e){var t,r,n,u;e=e||{};var d={};for(t in e)n=e[t],c(t)?d[t]=n:(r=t.toLowerCase(),l.call(s,r)?d[(u=s[r]).propertyName]=!!(u.hasBooleanValue||u.hasOverloadedBooleanValue&&!n)||n:l.call(i,t)?d[(u=i[t]).propertyName]=n:o.PRESERVE_CUSTOM_ATTRIBUTES&&(d[t]=n));return a(e.style,d),d}},function(e,t,r){var n=r(3),o=r(84).default,a={reactCompat:!0},s=n.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:s,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,a={},s={};for(r in e)n=e[r],o&&(a=t(r,n))&&2===a.length?s[a[0]]=a[1]:"string"==typeof n&&(s[n]=r);return s},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,a))}}},function(e,t,r){for(var n,o=r(90).CASE_SENSITIVE_TAG_NAMES,a={},s=0,i=o.length;s<i;s++)n=o[s],a[n.toLowerCase()]=n;function c(e){for(var t,r={},n=0,o=e.length;n<o;n++)r[(t=e[n]).name]=t.value;return r}function l(e){return function(e){return a[e]}(e=e.toLowerCase())||e}e.exports={formatAttributes:c,formatDOM:function e(t,r,n){r=r||null;for(var o,a,s,i=[],u=0,d=t.length;u<d;u++){switch(o=t[u],s={next:null,prev:i[u-1]||null,parent:r},(a=i[u-1])&&(a.next=s),"#"!==o.nodeName[0]&&(s.name=l(o.nodeName),s.attribs={},o.attributes&&o.attributes.length&&(s.attribs=c(o.attributes))),o.nodeType){case 1:"script"===s.name||"style"===s.name?s.type=s.name:s.type="tag",s.children=e(o.childNodes,s);break;case 3:s.type="text",s.data=o.nodeValue;break;case 8:s.type="comment",s.data=o.nodeValue}i.push(s)}return n&&(i.unshift({name:n.substring(0,n.indexOf(" ")).toLowerCase(),data:n,type:"directive",next:i[0]?i[0]:null,prev:null,parent:r}),i[1]&&(i[1].prev=i[0])),i},isIE:function(e){return e?document.documentMode===e:/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),a=()=>Object(n.useContext)(o),s=e=>{let{children:t}=e;const[r,a]=Object(n.useState)(!1),s={setIsSuppressed:a,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:s},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},function(e,t,r){var n=r(79),o=r(54),a=r(88),s={decodeEntities:!0,lowerCaseAttributeNames:!1};function i(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:n(a(e,(t=t||{}).htmlparser2||s),t)}i.domToReact=n,i.htmlToDOM=a,i.attributesToProps=o,e.exports=i,e.exports.default=i},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},,function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,l=[],u=!1,d=-1;function p(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=i(p);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||u||i(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),o=r(7),a=r(0),s=r(12),i=r.n(s),c=r(61),l=r(67);const u=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:s}=Object(o.useSelect)(e=>{const t=e(n.CART_STORE_KEY);return{shippingRates:t.getShippingRates(),needsShipping:t.getNeedsShipping(),hasCalculatedShipping:t.getHasCalculatedShipping(),isLoadingRates:t.isCustomerDataUpdating()}}),{isSelectingRate:u,selectShippingRate:d}=Object(l.a)(),p=Object(a.useRef)({});return Object(a.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:r,shipping_rates:n}=e;return[r,null===(t=n.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(c.a)(t)&&!i()(p.current,t)&&(p.current=t)},[e]),{isSelectingRate:u,selectedRates:p.current,selectShippingRate:d,shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:s}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(7),o=r(5);const a=()=>{const{customerData:e,isInitialized:t}=Object(n.useSelect)(e=>{const t=e(o.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:r,setBillingData:a}=Object(n.useDispatch)(o.CART_STORE_KEY);return{isInitialized:t,billingData:e.billingData,shippingAddress:e.shippingAddress,setBillingData:a,setShippingAddress:r}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return O}));var n=r(0);const o={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},a={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},s={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:()=>null,shippingErrorTypes:o,shippingRates:[],isLoadingRates:!1,selectedRates:[],setSelectedRates:()=>null,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:()=>null,onShippingRateSuccess:()=>null,onShippingRateFail:()=>null,onShippingRateSelectSuccess:()=>null,onShippingRateSelectFail:()=>null,needsShipping:!1},i=(e,t)=>{let{type:r}=t;return Object.values(o).includes(r)?r:e};var c=r(91),l=r(197);const u=e=>({onSuccess:Object(l.a)("shipping_rates_success",e),onFail:Object(l.a)("shipping_rates_fail",e),onSelectSuccess:Object(l.a)("shipping_rate_select_success",e),onSelectFail:Object(l.a)("shipping_rate_select_fail",e)});var d=r(199),p=r(34),f=r(31),m=r(67),h=r(64);const{NONE:b,INVALID_ADDRESS:g,UNKNOWN:E}=o,y=Object(n.createContext)(s),v=()=>Object(n.useContext)(y),O=e=>{let{children:t}=e;const{dispatchActions:r}=Object(p.b)(),{shippingRates:s,isLoadingRates:l,cartErrors:v}=Object(f.a)(),{isSelectingRate:O}=Object(m.a)(),{selectedRates:S}=Object(h.a)(),[_,k]=Object(n.useReducer)(i,b),[w,j]=Object(n.useReducer)(c.b,{}),R=Object(n.useRef)(w),C=Object(n.useMemo)(()=>({onShippingRateSuccess:u(j).onSuccess,onShippingRateFail:u(j).onFail,onShippingRateSelectSuccess:u(j).onSelectSuccess,onShippingRateSelectFail:u(j).onSelectFail}),[j]);Object(n.useEffect)(()=>{R.current=w},[w]),Object(n.useEffect)(()=>{l?r.incrementCalculating():r.decrementCalculating()},[l,r]),Object(n.useEffect)(()=>{O?r.incrementCalculating():r.decrementCalculating()},[O,r]),Object(n.useEffect)(()=>{v.length>0&&v.some(e=>!(!e.code||!Object.values(a).includes(e.code)))?k({type:g}):k({type:b})},[v]);const T=Object(n.useMemo)(()=>({isPristine:_===b,isValid:_===b,hasInvalidAddress:_===g,hasError:_===E||_===g}),[_]);Object(n.useEffect)(()=>{l||0!==s.length&&!T.hasError||Object(d.a)(R.current,"shipping_rates_fail",{hasInvalidAddress:T.hasInvalidAddress,hasError:T.hasError})},[s,l,T.hasError,T.hasInvalidAddress]),Object(n.useEffect)(()=>{!l&&s.length>0&&!T.hasError&&Object(d.a)(R.current,"shipping_rates_success",s)},[s,l,T.hasError]),Object(n.useEffect)(()=>{O||(T.hasError?Object(d.a)(R.current,"shipping_rate_select_fail",{hasError:T.hasError,hasInvalidAddress:T.hasInvalidAddress}):Object(d.a)(R.current,"shipping_rate_select_success",S.current))},[S,O,T.hasError,T.hasInvalidAddress]);const A={shippingErrorStatus:T,dispatchErrorStatus:k,shippingErrorTypes:o,...C};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(y.Provider,{value:A},t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7),o=r(0),a=r(5),s=r(72),i=r(40);const c=()=>{const e=Object(s.a)(),{dispatchCheckoutEvent:t}=Object(i.a)(),{selectShippingRate:r}=Object(n.useDispatch)(a.CART_STORE_KEY);return{selectShippingRate:Object(o.useCallback)((n,o)=>{r(n,o).then(()=>{t("set-selected-shipping-rate",{shippingRateId:n})}).catch(t=>{e(t)})},[r,t,e]),isSelectingRate:Object(n.useSelect)(e=>e(a.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return c}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:a,detail:s={}}=t;if(!n)return;a||(a=document.body);const i=new n(e,{bubbles:r,cancelable:o,detail:s});a.dispatchEvent(i)};let a;const s=()=>{a&&clearTimeout(a),a=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},i=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},c=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const a=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,a),()=>jQuery(document).off(e,a)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(11),o=r.n(n),a=r(0);r(107);const s=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(a.useRef)(null);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(a.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];s(e),null==e||e.focus()}else s(e)})(e,r):s(e))})(r.current,e)}})))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(7);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(n.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(n.select)("core/notices").getNotices(),{removeNotice:o}=Object(n.dispatch)("core/notices"),a=r.filter(t=>t.status===e);a.forEach(e=>o(e.id,t))}},function(e,t){},function(e,t,r){var n=r(3),o=r(54),a=r(55),s=a.setStyleProp;function i(e){return a.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&a.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var a,c,l,u,d=(r=r||{}).library||n,p=d.cloneElement,f=d.createElement,m=d.isValidElement,h=[],b="function"==typeof r.replace,g=r.trim,E=0,y=t.length;E<y;E++)if(a=t[E],b&&m(c=r.replace(a)))y>1&&(c=p(c,{key:c.key||E})),h.push(c);else if("text"!==a.type){switch(l=a.attribs,i(a)?s(l.style,l):l&&(l=o(l)),u=null,a.type){case"script":case"style":a.children[0]&&(l.dangerouslySetInnerHTML={__html:a.children[0].data});break;case"tag":"textarea"===a.name&&a.children[0]?l.defaultValue=a.children[0].data:a.children&&a.children.length&&(u=e(a.children,r));break;default:continue}y>1&&(l.key=E),h.push(f(a.name,l,u))}else g?a.data.trim()&&h.push(a.data):h.push(a.data);return 1===h.length?h[0]:h}},function(e,t,r){var n=r(81),o=r(82),a=r(83),s=a.MUST_USE_PROPERTY,i=a.HAS_BOOLEAN_VALUE,c=a.HAS_NUMERIC_VALUE,l=a.HAS_POSITIVE_NUMERIC_VALUE,u=a.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function p(e,t,r){var n,o,a,p=e.Properties,f=e.DOMAttributeNames;for(o in p)n=f[o]||(r?o:o.toLowerCase()),a=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:d(a,s),hasBooleanValue:d(a,i),hasNumericValue:d(a,c),hasPositiveNumericValue:d(a,l),hasOverloadedBooleanValue:d(a,u)}}var f={};p(n,f);var m={};p(o,m,!0);var h={};p(n,h),p(o,h,!0),e.exports={html:f,svg:m,properties:h,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(85)),a=r(87);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[a.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(86);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var a,s,i=n(e),c="function"==typeof t,l=0,u=i.length;l<u;l++)a=(r=i[l]).property,s=r.value,c?t(a,s,r):s&&(o||(o={}),o[a]=s);return o}},function(e,t){var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var l=1,d=1;function p(e){var t=e.match(n);t&&(l+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:l,column:d};return function(t){return t.position=new m(e),E(),t}}function m(e){this.start=e,this.end={line:l,column:d},this.source=t.source}m.prototype.content=e;var h=[];function b(r){var n=new Error(t.source+":"+l+":"+d+": "+r);if(n.reason=r,n.filename=t.source,n.line=l,n.column=d,n.source=e,!t.silent)throw n;h.push(n)}function g(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function E(){g(o)}function y(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return b("End of comment missing");var n=e.slice(2,r-2);return d+=2,p(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}function O(){var e=f(),t=g(a);if(t){if(v(),!g(s))return b("property missing ':'");var n=g(i),o=e({type:"declaration",property:u(t[0].replace(r,"")),value:n?u(n[0].replace(r,"")):""});return g(c),o}}return E(),function(){var e,t=[];for(y(t);e=O();)!1!==e&&(t.push(e),y(t));return t}()}},function(e,t,r){"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,o=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,i=function(e,t){return t.toUpperCase()},c=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||a.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(s,c)),e.replace(o,i))}},function(e,t,r){var n=r(89),o=r(56),a=o.formatDOM,s=o.isIE(9),i=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(i);return r&&r[1]&&(t=r[1],s&&(e=e.replace(r[0],""))),a(n(e),null,t)}},function(e,t,r){var n=r(56),o=/<([a-zA-Z]+[0-9]?)/,a=/<head.*>/i,s=/<body.*>/i,i=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,c=n.isIE(9),l=c||n.isIE(),u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},d=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,f=c?"text/xml":"text/html";u=d=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),c&&(e=e.replace(i,"<$1$2$3/>")),p.parseFromString(e,f)}}if(document.implementation){var m=document.implementation.createHTMLDocument(l?"html-dom-parser":void 0);u=function(e,t){if(t)return m.documentElement.getElementsByTagName(t)[0].innerHTML=e,m;try{return m.documentElement.innerHTML=e,m}catch(t){if(d)return d(e)}}}var h,b=document.createElement("template");b.content&&(h=function(e){return b.innerHTML=e,b.content.childNodes}),e.exports=function(e){var t,r,n,i,c=e.match(o);switch(c&&c[1]&&(t=c[1].toLowerCase()),t){case"html":return r=d(e),a.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),s.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return i=u(e).getElementsByTagName(t),s.test(e)&&a.test(e)?i[0].parentNode.childNodes:i;default:return h?h(e):u(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(6);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const a={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(n.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},s={},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,eventType:r,id:n,callback:a,priority:i}=arguments.length>1?arguments[1]:void 0;const c=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return c.set(n,{priority:i,callback:a}),{...e,[r]:c};case o.REMOVE_EVENT_CALLBACK:return c.delete(n),{...e,[r]:c}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));var n=r(1),o=r(18);const a=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},s=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,r){"use strict";var n=r(0),o=r(15);const a=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=a},function(e,t,r){"use strict";var n=r(0),o=r(6),a=r(4),s=r.n(a),i=r(1),c=r(20),l=r(93),u=r(50);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:a=r,onRemove:p=o.noop,isDismissible:f=!0,actions:m=[],politeness:h=d(t),__unstableHTML:b,onDismiss:g=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(c.speak)(r,t)},[r,t])}(a,h);const E=s()(e,"components-notice","is-"+t,{"is-dismissible":f});return b&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:a=!1,onClick:i,url:c},l)=>{let d=o;return"primary"===o||a||(d=c?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:c,variant:d,onClick:c?void 0:i,className:s()("components-notice__action",e)},t)}))),f&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(i.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(11)),a=n(r(128)),s=r(3),i=n(s),c=n(r(129)),l=n(r(131)),u={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(u.str(e)||u.num(e))return e===t;if(u.obj(e)&&u.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!u.und(r)||e===t}};function d(){var e=s.useState(!1)[1];return s.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return u.und(e)||u.nul(e)?t:e}function f(e){return u.und(e)?[]:u.arr(e)?e:[e]}function m(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return u.fun(e)?e.apply(void 0,r):e}function h(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,a(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(u.und(t))return o({to:t},e);var r=Object.keys(e).reduce((function(r,n){var a;return u.und(t[n])?o({},r,((a={})[n]=e[n],a)):r}),{});return o({to:t},r)}var b,g,E=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof E&&e.addChild(l(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof E&&e.removeChild(l(t))}))},t}return c(t,e),t}(E),v=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof E&&e.addChild(l(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof E&&e.removeChild(l(t))}))},t}c(t,e);var r=t.prototype;return r.getValue=function(e){void 0===e&&(e=!1);var t={};for(var r in this.payload){var n=this.payload[r];(!e||n instanceof E)&&(t[r]=n instanceof E?n[e?"getAnimatedValue":"getValue"]():n)}return t},r.getAnimatedValue=function(){return this.getValue(!0)},t}(E);function O(e,t){b={fn:e,transform:t}}function S(e){g=e}var _,k=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},w=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function j(e){_=e}var R,C=function(){return Date.now()};function T(e){R=e}var A,x,P=function(e){return e.current};function M(e){A=e}var N=Object.freeze({get applyAnimatedValues(){return b},injectApplyAnimatedValues:O,get colorNames(){return g},injectColorNames:S,get requestFrame(){return k},get cancelFrame(){return w},injectFrame:function(e,t){k=e,w=t},get interpolation(){return _},injectStringInterpolator:j,get now(){return C},injectNow:function(e){C=e},get defaultElement(){return R},injectDefaultElement:T,get animatedApi(){return P},injectAnimatedApi:function(e){P=e},get createAnimatedStyle(){return A},injectCreateAnimatedStyle:M,get manualFrameloop(){return x},injectManualFrameloop:function(e){x=e}}),I=function(e){function t(t,r){var n;return(n=e.call(this)||this).update=void 0,n.payload=t.style?o({},t,{style:A(t.style)}):t,n.update=r,n.attach(),n}return c(t,e),t}(v),D=!1,L=new Set,F=function e(){if(!D)return!1;var t=C(),r=L,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}for(var s=a,i=!1,c=0;c<s.configs.length;c++){for(var l=s.configs[c],u=void 0,d=void 0,p=0;p<l.animatedValues.length;p++){var f=l.animatedValues[p];if(!f.done){var m=l.fromValues[p],h=l.toValues[p],b=f.lastPosition,g=h instanceof E,y=Array.isArray(l.initialVelocity)?l.initialVelocity[p]:l.initialVelocity;if(g&&(h=h.getValue()),l.immediate)f.setValue(h),f.done=!0;else if("string"!=typeof m&&"string"!=typeof h){if(void 0!==l.duration)b=m+l.easing((t-f.startTime)/l.duration)*(h-m),u=t>=f.startTime+l.duration;else if(l.decay)b=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-f.startTime))),(u=Math.abs(f.lastPosition-b)<.1)&&(h=b);else{d=void 0!==f.lastTime?f.lastTime:t,y=void 0!==f.lastVelocity?f.lastVelocity:l.initialVelocity,t>d+64&&(d=t);for(var v=Math.floor(t-d),O=0;O<v;++O)b+=1*(y+=(-l.tension*(b-h)+-l.friction*y)/l.mass*1/1e3)/1e3;var S=!(!l.clamp||0===l.tension)&&(m<h?b>h:b<h),_=Math.abs(y)<=l.precision,w=0===l.tension||Math.abs(h-b)<=l.precision;u=S||_&&w,f.lastVelocity=y,f.lastTime=t}g&&!l.toValues[p].done&&(u=!1),u?(f.value!==h&&(b=h),f.done=!0):i=!0,f.setValue(b),f.lastPosition=b}else f.setValue(h),f.done=!0}}s.props.onFrame&&(s.values[l.name]=l.interpolation.getValue())}s.props.onFrame&&s.props.onFrame(s.values),i||(L.delete(s),s.stop(!0))}return L.size?x?x():k(e):D=!1,D};function V(e,t,r){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:r});if(_&&"string"==typeof e.output[0])return _(e);var n=e,o=n.output,a=n.range||[0,1],s=n.extrapolateLeft||n.extrapolate||"extend",i=n.extrapolateRight||n.extrapolate||"extend",c=n.easing||function(e){return e};return function(e){var t=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(e,a);return function(e,t,r,n,o,a,s,i,c){var l=c?c(e):e;if(l<t){if("identity"===s)return l;"clamp"===s&&(l=t)}if(l>r){if("identity"===i)return l;"clamp"===i&&(l=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?l=-l:r===1/0?l-=t:l=(l-t)/(r-t),l=a(l),n===-1/0?l=-l:o===1/0?l+=n:l=l*(o-n)+n,l)}(e,a[t],a[t+1],o[t],o[t+1],c,s,i,n.map)}}var B=function(e){function t(r,n,o,a){var s;return(s=e.call(this)||this).calc=void 0,s.payload=r instanceof y&&!(r instanceof t)?r.getPayload():Array.isArray(r)?r:[r],s.calc=V(n,o,a),s}c(t,e);var r=t.prototype;return r.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},r.updateConfig=function(e,t,r){this.calc=V(e,t,r)},r.interpolate=function(e,r,n){return new t(this,e,r,n)},t}(y),U=function(e){function t(t){var r;return(r=e.call(this)||this).animatedStyles=new Set,r.value=void 0,r.startPosition=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.startTime=void 0,r.lastTime=void 0,r.done=!1,r.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},r.value=t,r.startPosition=t,r.lastPosition=t,r}c(t,e);var r=t.prototype;return r.flush=function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},r.clearStyles=function(){this.animatedStyles.clear()},r.getValue=function(){return this.value},r.interpolate=function(e,t,r){return new B(this,e,t,r)},t}(E),H=function(e){function t(t){var r;return(r=e.call(this)||this).payload=t.map((function(e){return new U(e)})),r}c(t,e);var r=t.prototype;return r.setValue=function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))},r.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},r.interpolate=function(e,t){return new B(this,e,t)},t}(y),G=0,Y=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=G++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=h(e),r=t.delay,n=void 0===r?0:r,s=t.to,i=a(t,["delay","to"]);if(u.arr(s)||u.fun(s))this.queue.push(o({},i,{delay:n,to:s}));else if(s){var c={};Object.entries(s).forEach((function(e){var t,r=e[0],a=e[1],s=o({to:(t={},t[r]=a,t),delay:m(n,r)},i),l=c[s.delay]&&c[s.delay].to;c[s.delay]=o({},c[s.delay],s,{to:o({},l,s.to)})})),this.queue=Object.values(c)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(i),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var r=e.from,n=void 0===r?{}:r,a=e.to,s=void 0===a?{}:a;u.obj(n)&&(t.merged=o({},n,t.merged)),u.obj(s)&&(t.merged=o({},t.merged,s))}));var r=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach((function(o,s){var i=o.delay,c=a(o,["delay"]),l=function(o){s===n.length-1&&r===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},d=u.arr(c.to)||u.fun(c.to);i?setTimeout((function(){r===t.guid&&(d?t.runAsync(c,l):t.diff(c).start(l))}),i):d?t.runAsync(c,l):t.diff(c).start(l)}))}else u.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,L.has(this)||L.add(this),D||(D=!0,k(x||F));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,L.has(this)&&L.delete(this)),this},t.runAsync=function(e,t){var r=this,n=(e.delay,a(e,["delay"])),s=this.local,i=Promise.resolve(void 0);if(u.arr(n.to))for(var c=function(e){var t=e,a=o({},n,h(n.to[t]));u.arr(a.config)&&(a.config=a.config[t]),i=i.then((function(){if(s===r.guid)return new Promise((function(e){return r.diff(a).start(e)}))}))},l=0;l<n.to.length;l++)c(l);else if(u.fun(n.to)){var d,p=0;i=i.then((function(){return n.to((function(e){var t=o({},n,h(e));if(u.arr(t.config)&&(t.config=t.config[p]),p++,s===r.guid)return d=new Promise((function(e){return r.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),r.stop(e)})).then((function(){return d}))}))}i.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var r=this.props,n=r.from,a=void 0===n?{}:n,s=r.to,i=void 0===s?{}:s,c=r.config,l=void 0===c?{}:c,d=r.reverse,h=r.attach,b=r.reset,E=r.immediate;if(d){var y=[i,a];a=y[0],i=y[1]}this.merged=o({},a,this.merged,i),this.hasChanged=!1;var v=h&&h(this);if(this.animations=Object.entries(this.merged).reduce((function(e,r){var n=r[0],s=r[1],i=e[n]||{},c=u.num(s),d=u.str(s)&&!s.startsWith("#")&&!/\d/.test(s)&&!g[s],h=u.arr(s),y=!c&&!h&&!d,O=u.und(a[n])?s:a[n],S=c||h||d?s:1,k=m(l,n);v&&(S=v.animations[n].parent);var w,j=i.parent,R=i.interpolation,T=f(v?S.getPayload():S),A=s;y&&(A=_({range:[0,1],output:[s,s]})(1));var x,P=R&&R.getValue(),M=!u.und(j)&&i.animatedValues.some((function(e){return!e.done})),N=!u.equ(A,P),I=!u.equ(A,i.previous),D=!u.equ(k,i.config);if(b||I&&N||D){var L;if(c||d)j=R=i.parent||new U(O);else if(h)j=R=i.parent||new H(O);else if(y){var F=i.interpolation&&i.interpolation.calc(i.parent.value);F=void 0===F||b?O:F,i.parent?(j=i.parent).setValue(0,!1):j=new U(0);var V={output:[F,s]};i.interpolation?(R=i.interpolation,i.interpolation.updateConfig(V)):R=j.interpolate(V)}return T=f(v?S.getPayload():S),w=f(j.getPayload()),b&&!y&&j.setValue(O,!1),t.hasChanged=!0,w.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=M?e.lastVelocity:void 0,e.lastTime=M?e.lastTime:void 0,e.startTime=C(),e.done=!1,e.animatedStyles.clear()})),m(E,n)&&j.setValue(y?S:s,!1),o({},e,((L={})[n]=o({},i,{name:n,parent:j,interpolation:R,animatedValues:w,toValues:T,previous:A,config:k,fromValues:f(j.getValue()),immediate:m(E,n),initialVelocity:p(k.velocity,0),clamp:p(k.clamp,!1),precision:p(k.precision,.01),tension:p(k.tension,170),friction:p(k.friction,26),mass:p(k.mass,1),duration:k.duration,easing:p(k.easing,(function(e){return e})),decay:k.decay}),L))}return N?e:(y&&(j.setValue(1,!1),R.updateConfig({output:[A,A]})),j.done=!0,t.hasChanged=!0,o({},e,((x={})[n]=o({},e[n],{previous:A}),x)))}),this.animations),this.hasChanged)for(var O in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[O]=this.animations[O].interpolation,this.values[O]=this.animations[O].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),z=function(e,t){var r=s.useRef(!1),n=s.useRef(),o=u.fun(t),a=s.useMemo((function(){var r;return n.current&&(n.current.map((function(e){return e.destroy()})),n.current=void 0),[new Array(e).fill().map((function(e,n){var a=new Y,s=o?m(t,n,a):t[n];return 0===n&&(r=s.ref),a.update(s),r||a.start(),a})),r]}),[e]),i=a[0],c=a[1];n.current=i,s.useImperativeHandle(c,(function(){return{start:function(){return Promise.all(n.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return n.current.forEach((function(t){return t.stop(e)}))},get controllers(){return n.current}}}));var l=s.useMemo((function(){return function(e){return n.current.map((function(t,r){t.update(o?m(e,r,t):e[r]),c||t.start()}))}}),[e]);s.useEffect((function(){r.current?o||l(t):c||n.current.forEach((function(e){return e.start()}))})),s.useEffect((function(){return r.current=!0,function(){return n.current.forEach((function(e){return e.destroy()}))}}),[]);var d=n.current.map((function(e){return e.getValues()}));return o?[d,l,function(e){return n.current.forEach((function(t){return t.pause(e)}))}]:d},q=0,W=function(e,t){return("function"==typeof t?e.map(t):f(t)).map(String)},X=function(e){var t=e.items,r=e.keys,n=void 0===r?function(e){return e}:r,s=a(e,["items","keys"]);return t=f(void 0!==t?t:null),o({items:t,keys:W(t,n)},s)};function K(e,t){var r=function(){if(o){if(a>=n.length)return"break";s=n[a++]}else{if((a=n.next()).done)return"break";s=a.value}var r=s.key,i=function(e){return e.key!==r};(u.und(t)||t===r)&&(e.current.instances.delete(r),e.current.transitions=e.current.transitions.filter(i),e.current.deleted=e.current.deleted.filter(i))},n=e.current.deleted,o=Array.isArray(n),a=0;for(n=o?n:n[Symbol.iterator]();;){var s;if("break"===r())break}e.current.forceUpdate()}var $=function(e){function t(t){var r;return void 0===t&&(t={}),r=e.call(this)||this,!t.transform||t.transform instanceof E||(t=b.transform(t)),r.payload=t,r}return c(t,e),t}(v),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Q="[-+]?\\d*\\.?\\d+";function Z(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+Z(Q,Q,Q)),te=new RegExp("rgba"+Z(Q,Q,Q,Q)),re=new RegExp("hsl"+Z(Q,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),ne=new RegExp("hsla"+Z(Q,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Q)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,se=/^#([0-9a-fA-F]{6})$/,ie=/^#([0-9a-fA-F]{8})$/;function ce(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function le(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,a=ce(o,n,e+1/3),s=ce(o,n,e),i=ce(o,n,e-1/3);return Math.round(255*a)<<24|Math.round(255*s)<<16|Math.round(255*i)<<8}function ue(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function de(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function fe(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function me(e){var t,r,n="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(r=se.exec(t))?parseInt(r[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(r=ee.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|255)>>>0:(r=te.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|pe(r[4]))>>>0:(r=oe.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+"ff",16)>>>0:(r=ie.exec(t))?parseInt(r[1],16)>>>0:(r=ae.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=re.exec(t))?(255|le(de(r[1]),fe(r[2]),fe(r[3])))>>>0:(r=ne.exec(t))?(le(de(r[1]),fe(r[2]),fe(r[3]))|pe(r[4]))>>>0:null;return null===n?e:"rgba("+((4278190080&(n=n||0))>>>24)+", "+((16711680&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var he=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys(J).join("|")+")","g"),Ee={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function ve(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||Ee.hasOwnProperty(e)&&Ee[e]?(""+t).trim():t+"px"}Ee=Object.keys(Ee).reduce((function(e,t){return ye.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),Ee);var Oe={};M((function(e){return new $(e)})),T("div"),j((function(e){var t=e.output.map((function(e){return e.replace(be,me)})).map((function(e){return e.replace(ge,me)})),r=t[0].match(he).map((function(){return[]}));t.forEach((function(e){e.match(he).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(he).map((function(t,n){return V(o({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(he,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,o){return"rgba("+Math.round(t)+", "+Math.round(r)+", "+Math.round(n)+", "+o+")"}))}})),S(J),O((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,o=t.scrollTop,s=t.scrollLeft,i=a(t,["style","children","scrollTop","scrollLeft"]),c="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var l in void 0!==o&&(e.scrollTop=o),void 0!==s&&(e.scrollLeft=s),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(l)){var u=0===l.indexOf("--"),d=ve(l,r[l],u);"float"===l&&(l="cssFloat"),u?e.style.setProperty(l,d):e.style[l]=d}for(var p in i){var f=c?p:Oe[p]||(Oe[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(f)&&e.setAttribute(f,i[p])}}),(function(e){return e}));var Se,_e,ke=(Se=function(e){return s.forwardRef((function(t,r){var n=d(),c=s.useRef(!0),l=s.useRef(null),p=s.useRef(null),f=s.useCallback((function(e){var t=l.current;l.current=new I(e,(function(){var e=!1;p.current&&(e=b.fn(p.current,l.current.getAnimatedValue())),p.current&&!1!==e||n()})),t&&t.detach()}),[]);s.useEffect((function(){return function(){c.current=!1,l.current&&l.current.detach()}}),[]),s.useImperativeHandle(r,(function(){return P(p,c,n)})),f(t);var m,h=l.current.getValue(),g=(h.scrollTop,h.scrollLeft,a(h,["scrollTop","scrollLeft"])),E=(m=e,!u.fun(m)||m.prototype instanceof i.Component?function(e){return p.current=function(e,t){return t&&(u.fun(t)?t(e):u.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return i.createElement(e,o({},g,{ref:E}))}))},void 0===(_e=!1)&&(_e=!0),function(e){return(u.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=_e?t[0].toLowerCase()+t.substring(1):t;return e[r]=Se(r),e}),Se)}),we=ke(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=ke,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=F,t.animated=we,t.a=we,t.interpolate=function(e,t,r){return e&&new B(e,t,r)},t.Globals=N,t.useSpring=function(e){var t=u.fun(e),r=z(1,t?e:[e]),n=r[0],o=r[1],a=r[2];return t?[n[0],o,a]:n},t.useTrail=function(e,t){var r=s.useRef(!1),n=u.fun(t),a=m(t),i=s.useRef(),c=z(e,(function(e,t){return 0===e&&(i.current=[]),i.current.push(t),o({},a,{config:m(a.config,e),attach:e>0&&function(){return i.current[e-1]}})})),l=c[0],d=c[1],p=c[2],f=s.useMemo((function(){return function(e){return d((function(t,r){e.reverse;var n=e.reverse?t+1:t-1,s=i.current[n];return o({},e,{config:m(e.config||a.config,t),attach:s&&function(){return s}})}))}}),[e,a.reverse]);return s.useEffect((function(){r.current&&!n&&f(t)})),s.useEffect((function(){r.current=!0}),[]),n?[l,f,p]:l},t.useTransition=function(e,t,r){var n=o({items:e,keys:t||function(e){return e}},r),i=X(n),c=i.lazy,l=void 0!==c&&c,u=(i.unique,i.reset),p=void 0!==u&&u,f=(i.enter,i.leave,i.update,i.onDestroyed),h=(i.keys,i.items,i.onFrame),b=i.onRest,g=i.onStart,E=i.ref,y=a(i,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),v=d(),O=s.useRef(!1),S=s.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!n.ref,instances:!O.current&&new Map,forceUpdate:v});return s.useImperativeHandle(n.ref,(function(){return{start:function(){return Promise.all(Array.from(S.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(S.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(S.current.instances).map((function(e){return e[1]}))}}})),S.current=function(e,t){for(var r=e.first,n=e.prevProps,s=a(e,["first","prevProps"]),i=X(t),c=i.items,l=i.keys,u=i.initial,d=i.from,p=i.enter,f=i.leave,h=i.update,b=i.trail,g=void 0===b?0:b,E=i.unique,y=i.config,v=i.order,O=void 0===v?["enter","leave","update"]:v,S=X(n),_=S.keys,k=S.items,w=o({},s.current),j=[].concat(s.deleted),R=Object.keys(w),C=new Set(R),T=new Set(l),A=l.filter((function(e){return!C.has(e)})),x=s.transitions.filter((function(e){return!e.destroyed&&!T.has(e.originalKey)})).map((function(e){return e.originalKey})),P=l.filter((function(e){return C.has(e)})),M=-g;O.length;)switch(O.shift()){case"enter":A.forEach((function(e,t){E&&j.find((function(t){return t.originalKey===e}))&&(j=j.filter((function(t){return t.originalKey!==e})));var n=l.indexOf(e),o=c[n],a=r&&void 0!==u?"initial":"enter";w[e]={slot:a,originalKey:e,key:E?String(e):q++,item:o,trail:M+=g,config:m(y,o,a),from:m(r&&void 0!==u?u||{}:d,o),to:m(p,o)}}));break;case"leave":x.forEach((function(e){var t=_.indexOf(e),r=k[t];j.unshift(o({},w[e],{slot:"leave",destroyed:!0,left:_[Math.max(0,t-1)],right:_[Math.min(_.length,t+1)],trail:M+=g,config:m(y,r,"leave"),to:m(f,r)})),delete w[e]}));break;case"update":P.forEach((function(e){var t=l.indexOf(e),r=c[t];w[e]=o({},w[e],{item:r,slot:"update",trail:M+=g,config:m(y,r,"update"),to:m(h,r)})}))}var N=l.map((function(e){return w[e]}));return j.forEach((function(e){var t,r=e.left,n=(e.right,a(e,["left","right"]));-1!==(t=N.findIndex((function(e){return e.originalKey===r})))&&(t+=1),t=Math.max(0,t),N=[].concat(N.slice(0,t),[n],N.slice(t))})),o({},s,{changed:A.length||x.length||P.length,first:r&&0===A.length,transitions:N,current:w,deleted:j,prevProps:t})}(S.current,n),S.current.changed&&S.current.transitions.forEach((function(e){var t=e.slot,r=e.from,n=e.to,a=e.config,s=e.trail,i=e.key,c=e.item;S.current.instances.has(i)||S.current.instances.set(i,new Y);var u=S.current.instances.get(i),d=o({},y,{to:n,from:r,config:a,ref:E,onRest:function(r){S.current.mounted&&(e.destroyed&&(E||l||K(S,i),f&&f(c)),!Array.from(S.current.instances).some((function(e){return!e[1].idle}))&&(E||l)&&S.current.deleted.length>0&&K(S),b&&b(c,t,r))},onStart:g&&function(){return g(c,t)},onFrame:h&&function(e){return h(c,t,e)},delay:s,reset:p&&"enter"===t});u.update(d),S.current.paused||u.start()})),s.useEffect((function(){return S.current.mounted=O.current=!0,function(){S.current.mounted=O.current=!1,Array.from(S.current.instances).map((function(e){return e[1].destroy()})),S.current.instances.clear()}}),[]),S.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:S.current.instances.get(n).getValues()}}))},t.useChain=function(e,t,r){void 0===r&&(r=1e3);var n=s.useRef();s.useEffect((function(){u.equ(e,n.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,n){var a=e.current;if(a){var s=a.controllers;if(s.length){var i=r*t[n];s.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+i})})),e.start()}))}}})):e.reduce((function(e,t,r){var n=t.current;return e.then((function(){return n.start()}))}),Promise.resolve()),n.current=e}))},t.useSprings=z},,,,,,,,,,,,function(e,t){},,,,,function(e,t,r){"use strict";(function(e){var n=r(0),o=r(6),a=r(4),s=r.n(a),i=r(20),c=r(1),l=(r(38),r(50));t.a=Object(n.forwardRef)((function({className:t,children:r,spokenMessage:a=r,politeness:u="polite",actions:d=[],onRemove:p=o.noop,icon:f=null,explicitDismiss:m=!1,onDismiss:h=o.noop},b){function g(e){e&&e.preventDefault&&e.preventDefault(),h(),p()}h=h||o.noop,function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(i.speak)(r,t)},[r,t])}(a,u),Object(n.useEffect)(()=>{const e=setTimeout(()=>{m||(h(),p())},1e4);return()=>clearTimeout(e)},[h,p]);const E=s()(t,"components-snackbar",{"components-snackbar-explicit-dismiss":!!m});d&&d.length>1&&(void 0!==e&&e.env,d=[d[0]]);const y=s()("components-snackbar__content",{"components-snackbar__content-with-icon":!!f});return Object(n.createElement)("div",{ref:b,className:E,onClick:m?o.noop:g,tabIndex:"0",role:m?"":"button",onKeyPress:m?o.noop:g,"aria-label":m?"":Object(c.__)("Dismiss this notice")},Object(n.createElement)("div",{className:y},f&&Object(n.createElement)("div",{className:"components-snackbar__icon"},f),r,d.map(({label:e,onClick:t,url:r},o)=>Object(n.createElement)(l.a,{key:o,href:r,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),p(),t&&t(e)}(e,t),className:"components-snackbar__action"},e)),m&&Object(n.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:"0",className:"components-snackbar__dismiss-button",onClick:g,onKeyPress:g},"✕")))}))}).call(this,r(63))},function(e,t){e.exports=window.wp.plugins},,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},,function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(45),o=(r(14),r(2));const a=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),s=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),a=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(a[r]="")}),a}},,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),o=r.n(n),a=r(0),s=r(4),i=r.n(s),c=r(94),l=r(7),u=(r(78),r(57));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:s}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:f}=Object(l.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(n);if(!m.length)return null;const h=i()(t,"wc-block-components-notices");return s?null:Object(a.createElement)("div",{className:h},m.map(e=>Object(a.createElement)(c.a,o()({key:"store-notice-"+e.id},e,{className:i()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&f(e.id,r)}}),e.content)))}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),o=r(48),a=r(2),s=r(59),i=r.n(s),c=r(10),l=r(16);const u=(e,t)=>e&&t[e]?t[e]:null,d=e=>{let{block:t,blockMap:r,blockWrapper:o,children:s,depth:p=1}=e;return s&&0!==s.length?Array.from(s).map((e,s)=>{const{blockName:f="",...m}={key:`${t}_${p}_${s}`,...e instanceof HTMLElement?e.dataset:{},className:e instanceof Element?null==e?void 0:e.className:""},h=u(f,r);if(!h){const a=i()(e instanceof Element&&(null==e?void 0:e.outerHTML)||(null==e?void 0:e.textContent)||"");if("string"==typeof a&&a)return a;if(!Object(n.isValidElement)(a))return null;const s=e.childNodes.length?d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}):void 0;return s?Object(n.cloneElement)(a,m,s):Object(n.cloneElement)(a,m)}const b=o||n.Fragment;return Object(n.createElement)(n.Suspense,{key:`${t}_${p}_${s}_suspense`,fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(l.a,{text:"Unexpected error in: "+f,showErrorBlock:a.CURRENT_USER_IS_ADMIN},Object(n.createElement)(b,null,Object(n.createElement)(h,m,d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}),((e,t,r,o)=>{if(!Object(c.hasInnerBlocks)(e))return null;const s=r?Array.from(r).map(e=>e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null).filter(Boolean):[],i=Object(c.getRegisteredBlocks)(e).filter(e=>{let{blockName:t,force:r}=e;return!0===r&&!s.includes(t)}),d=o||n.Fragment;return Object(n.createElement)(n.Fragment,null,i.map((e,r)=>{let{blockName:o,component:s}=e;const i=s||u(o,t);return i?Object(n.createElement)(l.a,{text:"Unexpected error in: "+o,showErrorBlock:a.CURRENT_USER_IS_ADMIN},Object(n.createElement)(d,null,Object(n.createElement)(i,{key:`${o}_forced_${r}`}))):null}))})(f,r,e.childNodes,o)))))}):null},p=e=>{let{Block:t,selector:r,blockName:n,getProps:a=(()=>({})),blockMap:s,blockWrapper:i}=e;Object(o.a)({Block:t,selector:r,getProps:(e,t)=>{const r=d({block:n,blockMap:s,children:e.children||[],blockWrapper:i});return{...a(e,t),children:r}}})}},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(130);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));var n=r(0),o=r(113),a=r(2),s=r(16),i=r(201),c=r(66),l=r(46),u=r(34),d=r(1),p=r(25),f=r.n(p),m=r(118),h=r(92),b=r(7);const g=(e,t,r)=>{const n=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),o=`wc-${r}-new-payment-method`;return n.push({key:o,value:t}),n},E=(e,t)=>{f.a.setNonce&&"function"==typeof f.a.setNonce&&f.a.setNonce(e),null!=e&&e.get("User-ID")&&t.setCustomerId(parseInt(e.get("User-ID")||"0",10))};var y=r(194),v=r(31),O=r(57),S=()=>{const{hasError:e,onCheckoutValidationBeforeProcessing:t,dispatchActions:r,redirectUrl:o,isProcessing:a,isBeforeProcessing:s,isComplete:p,orderNotes:S,shouldCreateAccount:_,extensionData:k}=Object(u.b)(),{hasValidationErrors:w}=Object(y.b)(),{shippingErrorStatus:j}=Object(c.b)(),{billingData:R,shippingAddress:C}=Object(l.b)(),{cartNeedsPayment:T,cartNeedsShipping:A,receiveCart:x}=Object(v.a)(),{activePaymentMethod:P,isExpressPaymentMethodActive:M,currentStatus:N,paymentMethodData:I,expressPaymentMethods:D,paymentMethods:L,shouldSavePayment:F}=Object(i.b)(),{setIsSuppressed:V}=Object(O.b)(),{createErrorNotice:B,removeNotice:U}=Object(b.useDispatch)("core/notices"),H=Object(n.useRef)(R),G=Object(n.useRef)(C),Y=Object(n.useRef)(o),[z,q]=Object(n.useState)(!1),W=Object(n.useMemo)(()=>{var e;const t={...D,...L};return null==t||null===(e=t[P])||void 0===e?void 0:e.paymentMethodId},[P,D,L]),X=w&&!M||N.hasError||j.hasError,K=!e&&!X&&(N.isSuccessful||!T)&&a;Object(n.useEffect)(()=>{V(M)},[M,V]),Object(n.useEffect)(()=>{X===e||!a&&!s||M||r.setHasError(X)},[X,e,a,s,M,r]),Object(n.useEffect)(()=>{H.current=R,G.current=C,Y.current=o},[R,C,o]);const $=Object(n.useCallback)(()=>!w&&(N.hasError?{errorMessage:Object(d.__)("There was a problem with your payment option.","woo-gutenberg-products-block")}:!j.hasError||{errorMessage:Object(d.__)("There was a problem with your shipping option.","woo-gutenberg-products-block")}),[w,N.hasError,j.hasError]);Object(n.useEffect)(()=>{let e;return M||(e=t($,0)),()=>{M||e()}},[t,$,M]),Object(n.useEffect)(()=>{Y.current&&(window.location.href=Y.current)},[p]);const J=Object(n.useCallback)(async()=>{if(z)return;q(!0),U("checkout");const e=T?{payment_method:W,payment_data:g(I,F,P)}:{},t={billing_address:Object(m.a)(H.current),customer_note:S,create_account:_,...e,extensions:{...k}};A&&(t.shipping_address=Object(m.a)(G.current)),f()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(E(e.headers,r),!e.ok)throw new Error(e);return e.json()}).then(e=>{r.setAfterProcessing(e),q(!1)}).catch(e=>{try{null!=e&&e.headers&&E(e.headers,r),e.json().then(e=>{var t,n,o;null!==(t=e.data)&&void 0!==t&&t.cart&&x(e.data.cart),B(Object(h.b)(e),{id:"checkout",context:"wc/checkout"}),null==e||null===(n=e.additional_errors)||void 0===n||null===(o=n.forEach)||void 0===o||o.call(n,e=>{B(e.message,{id:e.error_code,context:"wc/checkout"})}),r.setAfterProcessing(e)})}catch{var t;B(Object(d.sprintf)(// Translators: %s Error text.
4
+ Object(d.__)("%s Please try placing your order again.","woo-gutenberg-products-block"),null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(d.__)("Something went wrong.","woo-gutenberg-products-block")),{id:"checkout",context:"wc/checkout"})}r.setHasError(!0),q(!1)})},[z,U,T,W,I,F,P,S,_,k,A,r,B,x]);return Object(n.useEffect)(()=>{K&&!z&&J()},[J,K,z]),null};const _=e=>{let{children:t,isCart:r=!1,redirectUrl:d}=e;return Object(n.createElement)(u.a,{redirectUrl:d,isCart:r},Object(n.createElement)(l.a,null,Object(n.createElement)(c.a,null,Object(n.createElement)(i.a,null,t,Object(n.createElement)(s.a,{renderError:a.CURRENT_USER_IS_ADMIN?null:()=>null},Object(n.createElement)(o.PluginArea,{scope:"woocommerce-checkout"})),Object(n.createElement)(S,null)))))}},,,function(e,t,r){"use strict";var n=r(0);r(191),t.a=()=>Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},,function(e,t,r){"use strict";var n=r(0),o=r(1),a=r(4),s=r.n(a),i=(r(193),r(135));t.a=e=>{let{children:t,className:r,screenReaderLabel:a,showSpinner:c=!1,isLoading:l=!0}=e;return Object(n.createElement)("div",{className:s()(r,{"wc-block-components-loading-mask":l})},l&&c&&Object(n.createElement)(i.a,null),Object(n.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(n.createElement)("span",{className:"screen-reader-text"},a||Object(o.__)("Loading…","woo-gutenberg-products-block")))}},,,,,function(e,t){e.exports=window.wp.keycodes},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=(e,t)=>{const r=[];return Object.keys(e).forEach(n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default}),r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(0);const o=Object(n.createContext)({hasDarkControls:!1}),a=()=>Object(n.useContext)(o)},,,function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-cart-block","version":"1.0.0","title":"Filled Cart","description":"Contains blocks that are displayed when the cart contains products.","category":"woocommerce","supports":{"align":["wide"],"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-cart-block","version":"1.0.0","title":"Empty Cart","description":"Contains blocks that are displayed when the cart is empty.","category":"woocommerce","supports":{"align":["wide"],"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-items-block","version":"1.0.0","title":"Cart Items block","description":"Column containing cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-line-items-block","version":"1.0.0","title":"Cart Line Items","description":"Block containing current line items in Cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-items-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-totals-block","version":"1.0.0","title":"Cart Totals","description":"Column containing the cart totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/proceed-to-checkout-block","version":"1.0.0","title":"Proceed to checkout","description":"Allow customers proceed to Checkout.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-accepted-payment-methods-block","version":"1.0.0","title":"Accepted Payment Methods","description":"Display accepted payment methods.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":true},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-subtotal-block","version":"1.0.0","title":"Subtotal","description":"Shows the cart subtotal row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-fee-block","version":"1.0.0","title":"Fees","description":"Shows the cart fee row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-discount-block","version":"1.0.0","title":"Discount","description":"Shows the cart discount row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-shipping-block","version":"1.0.0","title":"Shipping","description":"Shows the cart shipping row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-coupon-form-block","version":"1.0.0","title":"Coupon Form","description":"Shows the apply coupon form.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-taxes-block","version":"1.0.0","title":"Taxes","description":"Shows the cart taxes row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-heading-block","version":"1.0.0","title":"Heading","description":"Shows the heading row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"content":{"type":"string","default":"Cart totals"},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return l}));var n=r(0),o=r(6),a=r(12),s=r.n(a);const i=Object(n.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),c=()=>Object(n.useContext)(i),l=e=>{let{children:t}=e;const[r,a]=Object(n.useState)({}),c=Object(n.useCallback)(e=>r[e],[r]),l=Object(n.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(n.useCallback)(e=>{a(t=>{if(!t[e])return t;const{[e]:r,...n}=t;return n})},[]),d=Object(n.useCallback)(()=>{a({})},[]),p=Object(n.useCallback)(e=>{e&&a(t=>(e=Object(o.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&s()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),f=Object(n.useCallback)((e,t)=>{a(r=>{if(!r.hasOwnProperty(e))return r;const n={...r[e],...t};return s()(r[e],n)?r:{...r,[e]:n}})},[]),m={getValidationError:c,setValidationErrors:p,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(n.useCallback)(e=>{f(e,{hidden:!0})},[f]),showValidationError:Object(n.useCallback)(e=>{f(e,{hidden:!1})},[f]),showAllValidationErrors:Object(n.useCallback)(()=>{a(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(n.createElement)(i.Provider,{value:m},t)}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(91);const o=(e,t)=>function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const a=n.a.addEventCallback(e,r,o);return t(a),()=>{t(n.a.removeEventCallback(e,a.id))}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));const n=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=r(29);const a=async(e,t,r)=>{const o=n(e,t),a=[];for(const e of o)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&a.push(t)}catch(e){console.error(e)}return!a.length||a},s=async(e,t,r)=>{const a=[],s=n(e,t);for(const e of s)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return a.push(t),a;a.push(t)}catch(e){return console.error(e),a.push({type:"error"}),a}return a}},,function(e,t,r){"use strict";r.d(t,"b",(function(){return L})),r.d(t,"a",(function(){return F}));var n=r(0),o=r(61),a=r(7);let s,i;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(s||(s={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(i||(i={}));const c={currentStatus:s.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},l={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:s,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,{type:t,paymentMethodData:r,shouldSavePaymentMethod:n=!1,errorMessage:o="",paymentMethods:a={},paymentMethod:l=""}=arguments.length>1?arguments[1]:void 0;switch(t){case s.PRISTINE:return{...c,...e,errorMessage:"",currentStatus:s.PRISTINE};case s.STARTED:return{...e,currentStatus:s.STARTED};case s.ERROR:return e.currentStatus!==s.ERROR?{...e,currentStatus:s.ERROR,errorMessage:o||e.errorMessage}:e;case s.FAILED:return e.currentStatus!==s.FAILED?{...e,currentStatus:s.FAILED,paymentMethodData:r||e.paymentMethodData,errorMessage:o||e.errorMessage}:e;case s.SUCCESS:return e.currentStatus!==s.SUCCESS?{...e,currentStatus:s.SUCCESS,paymentMethodData:r||e.paymentMethodData}:e;case s.PROCESSING:return e.currentStatus!==s.PROCESSING?{...e,currentStatus:s.PROCESSING,errorMessage:""}:e;case s.COMPLETE:return e.currentStatus!==s.COMPLETE?{...e,currentStatus:s.COMPLETE}:e;case i.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:a};case i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:a};case i.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:n};case i.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:l,paymentMethodData:r||e.paymentMethodData}}},d=r(1),p=r(17),f=r(30),m=r(2),h=r(47),b=r(27),g=r(46),E=r(31),y=r(29),v=r(64);const O=(e,t,r,o)=>{const[s,i]=Object(n.useState)(!1),{isEditor:c}=Object(b.a)(),{selectedRates:l}=Object(v.a)(),{billingData:u,shippingAddress:p}=Object(g.b)(),y=Object(f.a)(l),O=Object(f.a)(r),S=Object(E.a)(),{cartTotals:_,cartIsLoading:k,cartNeedsShipping:w,paymentRequirements:j}=S,R=Object(n.useRef)({cart:S,cartTotals:_,cartNeedsShipping:w,billingData:u,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:j}),{createErrorNotice:C}=Object(a.useDispatch)("core/notices");Object(n.useEffect)(()=>{R.current={cart:S,cartTotals:_,cartNeedsShipping:w,billingData:u,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:j}},[S,_,w,u,p,y,j]);const T=Object(n.useCallback)(async()=>{let r={};const n=e=>{r={...r,[e.name]:e}};for(let e=0;e<O.length;e++){const r=O[e],a=t[r];if(a)try{const e=!!c||await Promise.resolve(a.canMakePayment(R.current));if(e){if("object"==typeof e&&null!==e&&e.error)throw new Error(e.error.message);n(a)}}catch(e){if(m.CURRENT_USER_IS_ADMIN||c){const t=Object(d.sprintf)(
5
  /* translators: %s the id of the payment method being registered (bank transfer, cheque...) */