WooCommerce Gutenberg Products Block - Version 6.1.0

Version Description

  • 2021-10-12 =

Bug Fixes

  • Fix the dropdown list in Product Category List Block for nested categories (4920)
  • Fixed string translations within the All Products Block. (4897)
  • Filter By Price: Update aria values to be more representative of the actual values presented. (4839)
  • Fixed: Filter button from Filter Products by Attribute block is not aligned with the input field. (4814)
  • Remove IntersectionObserver shim in favor of dropping IE11 support. (4808)
Download this release

Release Info

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

Code changes from version 6.0.2 to 6.1.0

Files changed (44) hide show
  1. assets/css/abstracts/_breakpoints.scss +4 -4
  2. assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-picker.js +15 -0
  3. assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/index.js +0 -1
  4. assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/test/index.js +84 -0
  5. assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/utils.js +32 -0
  6. assets/js/atomic/blocks/product-elements/shared/{config.js → config.tsx} +10 -3
  7. assets/js/base/components/cart-checkout/order-summary/style.scss +1 -1
  8. assets/js/base/components/pagination/style.scss +2 -2
  9. assets/js/base/components/price-slider/index.js +5 -0
  10. assets/js/base/components/product-list/style.scss +2 -2
  11. assets/js/base/components/radio-control/style.scss +1 -1
  12. assets/js/base/context/providers/store-snackbar-notices/components/style.scss +2 -2
  13. assets/js/base/hooks/use-position-relative-to-viewport.js +1 -2
  14. assets/js/base/utils/get-intersection-observer.js +0 -26
  15. assets/js/base/utils/index.js +0 -1
  16. assets/js/blocks/attribute-filter/block.js +3 -1
  17. assets/js/blocks/attribute-filter/style.scss +14 -2
  18. assets/js/blocks/cart-checkout/cart-i2/checkout-button/style.scss +2 -2
  19. assets/js/blocks/cart-checkout/cart/checkout-button/style.scss +2 -2
  20. assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/style.scss +1 -1
  21. assets/js/blocks/cart-checkout/mini-cart/block.tsx +29 -1
  22. assets/js/blocks/cart-checkout/payment-methods/style.scss +1 -1
  23. assets/js/types/type-guards/index.ts +5 -1
  24. assets/js/types/type-guards/test/index.ts +17 -0
  25. build/active-filters-frontend.asset.php +1 -1
  26. build/active-filters-frontend.js +2 -2
  27. build/all-products-frontend.asset.php +1 -1
  28. build/all-products-frontend.js +2 -2
  29. build/all-products.asset.php +1 -1
  30. build/all-products.js +13 -13
  31. build/all-reviews.asset.php +1 -1
  32. build/all-reviews.js +2 -2
  33. build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js +2 -2
  34. build/atomic-block-components/add-to-cart-frontend.js +2 -2
  35. build/atomic-block-components/add-to-cart.js +2 -2
  36. build/atomic-block-components/price-frontend.js +2 -2
  37. build/atomic-block-components/summary.js +1 -1
  38. build/attribute-filter-frontend.asset.php +1 -1
  39. build/attribute-filter-frontend.js +2 -2
  40. build/attribute-filter.asset.php +1 -1
  41. build/attribute-filter.js +3 -3
  42. build/blocks-checkout.asset.php +1 -1
  43. build/blocks-checkout.js +3 -3
  44. build/cart-blocks/checkout-button-frontend.js +1 -1
assets/css/abstracts/_breakpoints.scss CHANGED
@@ -10,9 +10,9 @@ $breakpoints: 480px, 600px, 782px, 960px, 1280px, 1440px;
10
 
11
  // @todo refactor breakpoints so they use the mixins from Gutenberg
12
  // https://github.com/WordPress/gutenberg/blob/master/packages/base-styles/_mixins.scss
13
- @mixin breakpoint( $sizes... ) {
14
  @each $size in $sizes {
15
- @if type-of( $size ) == string {
16
  $approved-value: 0;
17
  @each $breakpoint in $breakpoints {
18
  $and-larger: ">" + $breakpoint;
@@ -49,7 +49,7 @@ $breakpoints: 480px, 600px, 782px, 960px, 1280px, 1440px;
49
  @each $breakpoint in $breakpoints {
50
  $sizes: $sizes + " " + $breakpoint;
51
  }
52
- @warn "ERROR in breakpoint( #{ $size } ) : You can only use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]";
53
  }
54
  }
55
  @else {
@@ -57,7 +57,7 @@ $breakpoints: 480px, 600px, 782px, 960px, 1280px, 1440px;
57
  @each $breakpoint in $breakpoints {
58
  $sizes: $sizes + " " + $breakpoint;
59
  }
60
- @error "ERROR in breakpoint( #{ $size } ) : Please wrap the breakpoint $size in parenthesis. You can use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]";
61
  }
62
  }
63
  }
10
 
11
  // @todo refactor breakpoints so they use the mixins from Gutenberg
12
  // https://github.com/WordPress/gutenberg/blob/master/packages/base-styles/_mixins.scss
13
+ @mixin breakpoint($sizes...) {
14
  @each $size in $sizes {
15
+ @if type-of($size) == string {
16
  $approved-value: 0;
17
  @each $breakpoint in $breakpoints {
18
  $and-larger: ">" + $breakpoint;
49
  @each $breakpoint in $breakpoints {
50
  $sizes: $sizes + " " + $breakpoint;
51
  }
52
+ @warn "ERROR in breakpoint(#{ $size }) : You can only use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth($breakpoints, 1) } >#{ nth($breakpoints, 1) } #{ nth($breakpoints, 1) }-#{ nth($breakpoints, 2) } ]";
53
  }
54
  }
55
  @else {
57
  @each $breakpoint in $breakpoints {
58
  $sizes: $sizes + " " + $breakpoint;
59
  }
60
+ @error "ERROR in breakpoint(#{ $size }) : Please wrap the breakpoint $size in parenthesis. You can use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth($breakpoints, 1) } >#{ nth($breakpoints, 1) } #{ nth($breakpoints, 1) }-#{ nth($breakpoints, 2) } ]";
61
  }
62
  }
63
  }
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-picker.js CHANGED
@@ -11,6 +11,7 @@ import AttributeSelectControl from './attribute-select-control';
11
  import {
12
  getVariationMatchingSelectedAttributes,
13
  getActiveSelectControlOptions,
 
14
  } from './utils';
15
 
16
  /**
@@ -27,6 +28,7 @@ const AttributePicker = ( {
27
  const currentVariationAttributes = useShallowEqual( variationAttributes );
28
  const [ variationId, setVariationId ] = useState( 0 );
29
  const [ selectedAttributes, setSelectedAttributes ] = useState( {} );
 
30
 
31
  // Get options for each attribute picker.
32
  const filteredAttributeOptions = useMemo( () => {
@@ -37,6 +39,19 @@ const AttributePicker = ( {
37
  );
38
  }, [ selectedAttributes, currentAttributes, currentVariationAttributes ] );
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  // Select variations when selections are change.
41
  useEffect( () => {
42
  const hasSelectedAllAttributes =
11
  import {
12
  getVariationMatchingSelectedAttributes,
13
  getActiveSelectControlOptions,
14
+ getDefaultAttributes,
15
  } from './utils';
16
 
17
  /**
28
  const currentVariationAttributes = useShallowEqual( variationAttributes );
29
  const [ variationId, setVariationId ] = useState( 0 );
30
  const [ selectedAttributes, setSelectedAttributes ] = useState( {} );
31
+ const [ hasSetDefaults, setHasSetDefaults ] = useState( false );
32
 
33
  // Get options for each attribute picker.
34
  const filteredAttributeOptions = useMemo( () => {
39
  );
40
  }, [ selectedAttributes, currentAttributes, currentVariationAttributes ] );
41
 
42
+ // Set default attributes as selected.
43
+ useEffect( () => {
44
+ if ( ! hasSetDefaults ) {
45
+ const defaultAttributes = getDefaultAttributes( attributes );
46
+ if ( defaultAttributes ) {
47
+ setSelectedAttributes( {
48
+ ...defaultAttributes,
49
+ } );
50
+ }
51
+ setHasSetDefaults( true );
52
+ }
53
+ }, [ selectedAttributes, attributes, hasSetDefaults ] );
54
+
55
  // Select variations when selections are change.
56
  useEffect( () => {
57
  const hasSelectedAllAttributes =
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/index.js CHANGED
@@ -15,7 +15,6 @@ import { getAttributes, getVariationAttributes } from './utils';
15
  const VariationAttributes = ( { product, dispatchers } ) => {
16
  const attributes = getAttributes( product.attributes );
17
  const variationAttributes = getVariationAttributes( product.variations );
18
-
19
  if (
20
  Object.keys( attributes ).length === 0 ||
21
  variationAttributes.length === 0
15
  const VariationAttributes = ( { product, dispatchers } ) => {
16
  const attributes = getAttributes( product.attributes );
17
  const variationAttributes = getVariationAttributes( product.variations );
 
18
  if (
19
  Object.keys( attributes ).length === 0 ||
20
  variationAttributes.length === 0
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/test/index.js CHANGED
@@ -7,6 +7,7 @@ import {
7
  getVariationsMatchingSelectedAttributes,
8
  getVariationMatchingSelectedAttributes,
9
  getActiveSelectControlOptions,
 
10
  } from '../utils';
11
 
12
  const rawAttributeData = [
@@ -20,16 +21,19 @@ const rawAttributeData = [
20
  id: 22,
21
  name: 'Blue',
22
  slug: 'blue',
 
23
  },
24
  {
25
  id: 23,
26
  name: 'Green',
27
  slug: 'green',
 
28
  },
29
  {
30
  id: 24,
31
  name: 'Red',
32
  slug: 'red',
 
33
  },
34
  ],
35
  },
@@ -43,11 +47,13 @@ const rawAttributeData = [
43
  id: 0,
44
  name: 'Yes',
45
  slug: 'Yes',
 
46
  },
47
  {
48
  id: 0,
49
  name: 'No',
50
  slug: 'No',
 
51
  },
52
  ],
53
  },
@@ -61,11 +67,13 @@ const rawAttributeData = [
61
  id: 0,
62
  name: 'Test',
63
  slug: 'Test',
 
64
  },
65
  {
66
  id: 0,
67
  name: 'Test 2',
68
  slug: 'Test 2',
 
69
  },
70
  ],
71
  },
@@ -126,6 +134,61 @@ const rawVariations = [
126
  },
127
  ];
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  describe( 'Testing utils', () => {
130
  describe( 'Testing getAttributes()', () => {
131
  it( 'returns empty object if there are no attributes', () => {
@@ -145,16 +208,19 @@ describe( 'Testing utils', () => {
145
  id: 22,
146
  name: 'Blue',
147
  slug: 'blue',
 
148
  },
149
  {
150
  id: 23,
151
  name: 'Green',
152
  slug: 'green',
 
153
  },
154
  {
155
  id: 24,
156
  name: 'Red',
157
  slug: 'red',
 
158
  },
159
  ],
160
  },
@@ -168,11 +234,13 @@ describe( 'Testing utils', () => {
168
  id: 0,
169
  name: 'Yes',
170
  slug: 'Yes',
 
171
  },
172
  {
173
  id: 0,
174
  name: 'No',
175
  slug: 'No',
 
176
  },
177
  ],
178
  },
@@ -392,4 +460,20 @@ describe( 'Testing utils', () => {
392
  } );
393
  } );
394
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  } );
7
  getVariationsMatchingSelectedAttributes,
8
  getVariationMatchingSelectedAttributes,
9
  getActiveSelectControlOptions,
10
+ getDefaultAttributes,
11
  } from '../utils';
12
 
13
  const rawAttributeData = [
21
  id: 22,
22
  name: 'Blue',
23
  slug: 'blue',
24
+ default: true,
25
  },
26
  {
27
  id: 23,
28
  name: 'Green',
29
  slug: 'green',
30
+ default: false,
31
  },
32
  {
33
  id: 24,
34
  name: 'Red',
35
  slug: 'red',
36
+ default: false,
37
  },
38
  ],
39
  },
47
  id: 0,
48
  name: 'Yes',
49
  slug: 'Yes',
50
+ default: true,
51
  },
52
  {
53
  id: 0,
54
  name: 'No',
55
  slug: 'No',
56
+ default: false,
57
  },
58
  ],
59
  },
67
  id: 0,
68
  name: 'Test',
69
  slug: 'Test',
70
+ default: false,
71
  },
72
  {
73
  id: 0,
74
  name: 'Test 2',
75
  slug: 'Test 2',
76
+ default: false,
77
  },
78
  ],
79
  },
134
  },
135
  ];
136
 
137
+ const formattedAttributes = {
138
+ Color: {
139
+ id: 1,
140
+ name: 'Color',
141
+ taxonomy: 'pa_color',
142
+ has_variations: true,
143
+ terms: [
144
+ {
145
+ id: 22,
146
+ name: 'Blue',
147
+ slug: 'blue',
148
+ default: true,
149
+ },
150
+ {
151
+ id: 23,
152
+ name: 'Green',
153
+ slug: 'green',
154
+ default: false,
155
+ },
156
+ {
157
+ id: 24,
158
+ name: 'Red',
159
+ slug: 'red',
160
+ default: false,
161
+ },
162
+ ],
163
+ },
164
+ Size: {
165
+ id: 2,
166
+ name: 'Size',
167
+ taxonomy: 'pa_size',
168
+ has_variations: true,
169
+ terms: [
170
+ {
171
+ id: 25,
172
+ name: 'Large',
173
+ slug: 'large',
174
+ default: false,
175
+ },
176
+ {
177
+ id: 26,
178
+ name: 'Medium',
179
+ slug: 'medium',
180
+ default: true,
181
+ },
182
+ {
183
+ id: 27,
184
+ name: 'Small',
185
+ slug: 'small',
186
+ default: false,
187
+ },
188
+ ],
189
+ },
190
+ };
191
+
192
  describe( 'Testing utils', () => {
193
  describe( 'Testing getAttributes()', () => {
194
  it( 'returns empty object if there are no attributes', () => {
208
  id: 22,
209
  name: 'Blue',
210
  slug: 'blue',
211
+ default: true,
212
  },
213
  {
214
  id: 23,
215
  name: 'Green',
216
  slug: 'green',
217
+ default: false,
218
  },
219
  {
220
  id: 24,
221
  name: 'Red',
222
  slug: 'red',
223
+ default: false,
224
  },
225
  ],
226
  },
234
  id: 0,
235
  name: 'Yes',
236
  slug: 'Yes',
237
+ default: true,
238
  },
239
  {
240
  id: 0,
241
  name: 'No',
242
  slug: 'No',
243
+ default: false,
244
  },
245
  ],
246
  },
460
  } );
461
  } );
462
  } );
463
+ describe( 'Testing getDefaultAttributes()', () => {
464
+ const defaultAttributes = getDefaultAttributes( formattedAttributes );
465
+
466
+ it( 'should return default attributes in the format that is ready for setting state', () => {
467
+ expect( defaultAttributes ).toStrictEqual( {
468
+ Color: 'blue',
469
+ Size: 'medium',
470
+ } );
471
+ } );
472
+
473
+ it( 'should return an empty object if given unexpected values', () => {
474
+ expect( getDefaultAttributes( [] ) ).toStrictEqual( {} );
475
+ expect( getDefaultAttributes( null ) ).toStrictEqual( {} );
476
+ expect( getDefaultAttributes( undefined ) ).toStrictEqual( {} );
477
+ } );
478
+ } );
479
  } );
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/utils.js CHANGED
@@ -3,6 +3,7 @@
3
  */
4
  import { keyBy } from 'lodash';
5
  import { decodeEntities } from '@wordpress/html-entities';
 
6
 
7
  /**
8
  * Key an array of attributes by name,
@@ -206,3 +207,34 @@ export const getActiveSelectControlOptions = (
206
 
207
  return options;
208
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  */
4
  import { keyBy } from 'lodash';
5
  import { decodeEntities } from '@wordpress/html-entities';
6
+ import { isObject } from '@woocommerce/types';
7
 
8
  /**
9
  * Key an array of attributes by name,
207
 
208
  return options;
209
  };
210
+
211
+ /**
212
+ * Return the default values of the given attributes in a format ready to be set in state.
213
+ *
214
+ * @param {Object} attributes List of attribute names and terms.
215
+ * @return {Object} Default attributes.
216
+ */
217
+ export const getDefaultAttributes = ( attributes = {} ) => {
218
+ if ( ! isObject( attributes ) ) {
219
+ return {};
220
+ }
221
+
222
+ const attributeNames = Object.keys( attributes );
223
+ const defaultsToSet = {};
224
+
225
+ if ( attributeNames.length === 0 ) {
226
+ return defaultsToSet;
227
+ }
228
+
229
+ attributeNames.forEach( ( attributeName ) => {
230
+ const currentAttribute = attributes[ attributeName ];
231
+ const defaultValue = currentAttribute.terms.filter(
232
+ ( term ) => term.default
233
+ );
234
+ if ( defaultValue.length > 0 ) {
235
+ defaultsToSet[ currentAttribute.name ] = defaultValue[ 0 ]?.slug;
236
+ }
237
+ } );
238
+
239
+ return defaultsToSet;
240
+ };
assets/js/atomic/blocks/product-elements/shared/{config.js → config.tsx} RENAMED
@@ -4,6 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { Icon, grid } from '@woocommerce/icons';
6
  import { isExperimentalBuild } from '@woocommerce/block-settings';
 
7
  /**
8
  * Internal dependencies
9
  */
@@ -11,8 +12,9 @@ import save from '../save';
11
 
12
  /**
13
  * Holds default config for this collection of blocks.
 
14
  */
15
- export default {
16
  category: 'woocommerce-product-elements',
17
  keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
18
  icon: {
@@ -23,12 +25,17 @@ export default {
23
  html: false,
24
  },
25
  parent: isExperimentalBuild()
26
- ? null
27
  : [ '@woocommerce/all-products', '@woocommerce/single-product' ],
28
  save,
29
  deprecated: [
30
  {
31
- save() {},
 
 
 
32
  },
33
  ],
34
  };
 
 
4
  import { __ } from '@wordpress/i18n';
5
  import { Icon, grid } from '@woocommerce/icons';
6
  import { isExperimentalBuild } from '@woocommerce/block-settings';
7
+ import type { BlockConfiguration } from '@wordpress/blocks';
8
  /**
9
  * Internal dependencies
10
  */
12
 
13
  /**
14
  * Holds default config for this collection of blocks.
15
+ * attributes and title are omitted here as these are added on an individual block level.
16
  */
17
+ const sharedConfig: Omit< BlockConfiguration, 'attributes' | 'title' > = {
18
  category: 'woocommerce-product-elements',
19
  keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
20
  icon: {
25
  html: false,
26
  },
27
  parent: isExperimentalBuild()
28
+ ? undefined
29
  : [ '@woocommerce/all-products', '@woocommerce/single-product' ],
30
  save,
31
  deprecated: [
32
  {
33
+ attributes: {},
34
+ save(): null {
35
+ return null;
36
+ },
37
  },
38
  ],
39
  };
40
+
41
+ export default sharedConfig;
assets/js/base/components/cart-checkout/order-summary/style.scss CHANGED
@@ -88,7 +88,7 @@
88
  p,
89
  .wc-block-components-product-metadata {
90
  line-height: 1.375;
91
- margin-top: #{ ( $gap-large - $gap ) * 0.5 };
92
  }
93
  }
94
 
88
  p,
89
  .wc-block-components-product-metadata {
90
  line-height: 1.375;
91
+ margin-top: #{ ($gap-large - $gap) * 0.5 };
92
  }
93
  }
94
 
assets/js/base/components/pagination/style.scss CHANGED
@@ -15,7 +15,7 @@
15
  padding: 0.3em 0.6em;
16
  min-width: 2.2em;
17
 
18
- @include breakpoint( "<782px" ) {
19
  padding: 0.1em 0.2em;
20
  min-width: 1.6em;
21
  }
@@ -32,7 +32,7 @@
32
  .wc-block-components-pagination__ellipsis {
33
  padding: 0.3em;
34
 
35
- @include breakpoint( "<782px" ) {
36
  padding: 0.1em;
37
  }
38
  }
15
  padding: 0.3em 0.6em;
16
  min-width: 2.2em;
17
 
18
+ @include breakpoint("<782px") {
19
  padding: 0.1em 0.2em;
20
  min-width: 1.6em;
21
  }
32
  .wc-block-components-pagination__ellipsis {
33
  padding: 0.3em;
34
 
35
+ @include breakpoint("<782px") {
36
  padding: 0.1em;
37
  }
38
  }
assets/js/base/components/price-slider/index.js CHANGED
@@ -250,6 +250,9 @@ const PriceSlider = ( {
250
  const maxRangeStep =
251
  activeElement && activeElement === maxRange.current ? stepValue : 1;
252
 
 
 
 
253
  return (
254
  <div className={ classes }>
255
  <div
@@ -270,6 +273,7 @@ const PriceSlider = ( {
270
  'Filter products by minimum price',
271
  'woo-gutenberg-products-block'
272
  ) }
 
273
  value={
274
  Number.isFinite( minPrice )
275
  ? minPrice
@@ -290,6 +294,7 @@ const PriceSlider = ( {
290
  'Filter products by maximum price',
291
  'woo-gutenberg-products-block'
292
  ) }
 
293
  value={
294
  Number.isFinite( maxPrice )
295
  ? maxPrice
250
  const maxRangeStep =
251
  activeElement && activeElement === maxRange.current ? stepValue : 1;
252
 
253
+ const ariaReadableMinPrice = minPriceInput / 10 ** currency.minorUnit;
254
+ const ariaReadableMaxPrice = maxPriceInput / 10 ** currency.minorUnit;
255
+
256
  return (
257
  <div className={ classes }>
258
  <div
273
  'Filter products by minimum price',
274
  'woo-gutenberg-products-block'
275
  ) }
276
+ aria-valuetext={ ariaReadableMinPrice }
277
  value={
278
  Number.isFinite( minPrice )
279
  ? minPrice
294
  'Filter products by maximum price',
295
  'woo-gutenberg-products-block'
296
  ) }
297
+ aria-valuetext={ ariaReadableMaxPrice }
298
  value={
299
  Number.isFinite( maxPrice )
300
  ? maxPrice
assets/js/base/components/product-list/style.scss CHANGED
@@ -100,7 +100,7 @@
100
  }
101
  }
102
 
103
- @include breakpoint( "<480px" ) {
104
  .wc-block-grid {
105
  @for $i from 2 to 9 {
106
  &.has-#{$i}-columns {
@@ -119,7 +119,7 @@
119
  }
120
  }
121
 
122
- @include breakpoint( "480px-600px" ) {
123
  .wc-block-grid {
124
  @for $i from 2 to 9 {
125
  &.has-#{$i}-columns {
100
  }
101
  }
102
 
103
+ @include breakpoint("<480px") {
104
  .wc-block-grid {
105
  @for $i from 2 to 9 {
106
  &.has-#{$i}-columns {
119
  }
120
  }
121
 
122
+ @include breakpoint("480px-600px") {
123
  .wc-block-grid {
124
  @for $i from 2 to 9 {
125
  &.has-#{$i}-columns {
assets/js/base/components/radio-control/style.scss CHANGED
@@ -49,7 +49,7 @@
49
 
50
  .wc-block-components-radio-control__description,
51
  .wc-block-components-radio-control__secondary-description {
52
- @include font-size( small );
53
  line-height: 20px;
54
  }
55
 
49
 
50
  .wc-block-components-radio-control__description,
51
  .wc-block-components-radio-control__secondary-description {
52
+ @include font-size(small);
53
  line-height: 20px;
54
  }
55
 
assets/js/base/context/providers/store-snackbar-notices/components/style.scss CHANGED
@@ -4,7 +4,7 @@
4
  left: 16px;
5
  width: auto;
6
 
7
- @include breakpoint( "<782px" ) {
8
  position: fixed;
9
  top: 10px;
10
  left: 0;
@@ -12,7 +12,7 @@
12
  }
13
 
14
  .components-snackbar-list__notice-container {
15
- @include breakpoint( "<782px" ) {
16
  margin-left: 10px;
17
  margin-right: 10px;
18
  }
4
  left: 16px;
5
  width: auto;
6
 
7
+ @include breakpoint("<782px") {
8
  position: fixed;
9
  top: 10px;
10
  left: 0;
12
  }
13
 
14
  .components-snackbar-list__notice-container {
15
+ @include breakpoint("<782px") {
16
  margin-left: 10px;
17
  margin-right: 10px;
18
  }
assets/js/base/hooks/use-position-relative-to-viewport.js CHANGED
@@ -2,7 +2,6 @@
2
  * External dependencies
3
  */
4
  import { useRef, useLayoutEffect, useState } from '@wordpress/element';
5
- import { getIntersectionObserver } from '@woocommerce/base-utils';
6
 
7
  /** @typedef {import('react')} React */
8
 
@@ -50,7 +49,7 @@ export const usePositionRelativeToViewport = () => {
50
  ] = useState( '' );
51
  const referenceElementRef = useRef( null );
52
  const intersectionObserver = useRef(
53
- getIntersectionObserver(
54
  ( entries ) => {
55
  if ( entries[ 0 ].isIntersecting ) {
56
  setPositionRelativeToViewport( 'visible' );
2
  * External dependencies
3
  */
4
  import { useRef, useLayoutEffect, useState } from '@wordpress/element';
 
5
 
6
  /** @typedef {import('react')} React */
7
 
49
  ] = useState( '' );
50
  const referenceElementRef = useRef( null );
51
  const intersectionObserver = useRef(
52
+ new IntersectionObserver(
53
  ( entries ) => {
54
  if ( entries[ 0 ].isIntersecting ) {
55
  setPositionRelativeToViewport( 'visible' );
assets/js/base/utils/get-intersection-observer.js DELETED
@@ -1,26 +0,0 @@
1
- /** @typedef {import('window').IntersectionObserverCallback} IntersectionObserverCallback */
2
-
3
- /**
4
- * Util that returns an IntersectionObserver if supported by the browser. If
5
- * it's not supported, it returns a shim object with the methods to prevent JS
6
- * errors. Notice it's a shim, not a polyfill. If the browser doesn't support
7
- * IntersectionObserver, the methods returned by this function will do nothing.
8
- *
9
- * @param {IntersectionObserverCallback} callback Callback function for the
10
- * Intersection Observer.
11
- * @param {Object} options Intersection Observer options.
12
- * @return {Object|IntersectionObserver} Intersection Observer if available,
13
- * otherwise a shim object.
14
- *
15
- * @todo Remove IntersectionObserver shim when we drop IE11 support.
16
- */
17
- export const getIntersectionObserver = ( callback, options ) => {
18
- if ( typeof IntersectionObserver !== 'function' ) {
19
- return {
20
- observe: () => void null,
21
- unobserve: () => void null,
22
- };
23
- }
24
-
25
- return new IntersectionObserver( callback, options );
26
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/utils/index.js CHANGED
@@ -3,7 +3,6 @@ export * from './address';
3
  export * from './shipping-rates';
4
  export * from './legacy-events';
5
  export * from './render-frontend';
6
- export * from './get-intersection-observer';
7
  export * from './get-valid-block-attributes';
8
  export * from './product-data';
9
  export * from './derive-selected-shipping-rates';
3
  export * from './shipping-rates';
4
  export * from './legacy-events';
5
  export * from './render-frontend';
 
6
  export * from './get-valid-block-attributes';
7
  export * from './product-data';
8
  export * from './derive-selected-shipping-rates';
assets/js/blocks/attribute-filter/block.js CHANGED
@@ -342,7 +342,9 @@ const AttributeFilterBlock = ( {
342
  { blockAttributes.heading }
343
  </TagName>
344
  ) }
345
- <div className="wc-block-attribute-filter">
 
 
346
  { blockAttributes.displayStyle === 'dropdown' ? (
347
  <DropdownSelector
348
  attributeLabel={ attributeObject.label }
342
  { blockAttributes.heading }
343
  </TagName>
344
  ) }
345
+ <div
346
+ className={ `wc-block-attribute-filter style-${ blockAttributes.displayStyle }` }
347
+ >
348
  { blockAttributes.displayStyle === 'dropdown' ? (
349
  <DropdownSelector
350
  attributeLabel={ attributeObject.label }
assets/js/blocks/attribute-filter/style.scss CHANGED
@@ -1,8 +1,14 @@
1
  .wc-block-attribute-filter {
2
  margin-bottom: $gap-large;
3
 
 
 
 
 
 
4
  .wc-block-attribute-filter-list {
5
  margin: 0;
 
6
 
7
  li {
8
  text-decoration: underline;
@@ -18,12 +24,18 @@
18
  }
19
  }
20
 
 
 
 
 
 
 
21
  .is-single .wc-block-attribute-filter-list-count,
22
  .wc-block-dropdown-selector .wc-block-dropdown-selector__list .wc-block-attribute-filter-list-count {
23
  opacity: 0.6;
24
  }
25
 
26
- .wc-block-attribute-filter__button {
27
- margin-top: $gap-smaller;
28
  }
29
  }
1
  .wc-block-attribute-filter {
2
  margin-bottom: $gap-large;
3
 
4
+ &.style-dropdown {
5
+ display: flex;
6
+ gap: $gap;
7
+ }
8
+
9
  .wc-block-attribute-filter-list {
10
  margin: 0;
11
+ width: 100%;
12
 
13
  li {
14
  text-decoration: underline;
24
  }
25
  }
26
 
27
+ .wc-block-attribute-filter-dropdown {
28
+ flex-grow: 1;
29
+ max-width: unset;
30
+ width: 0;
31
+ }
32
+
33
  .is-single .wc-block-attribute-filter-list-count,
34
  .wc-block-dropdown-selector .wc-block-dropdown-selector__list .wc-block-attribute-filter-list-count {
35
  opacity: 0.6;
36
  }
37
 
38
+ .wc-block-components-dropdown-selector__input-wrapper {
39
+ height: 100%;
40
  }
41
  }
assets/js/blocks/cart-checkout/cart-i2/checkout-button/style.scss CHANGED
@@ -25,13 +25,13 @@
25
  }
26
  }
27
 
28
- @include breakpoint( ">782px" ) {
29
  .wc-block-cart__submit-container--sticky {
30
  display: none;
31
  }
32
  }
33
 
34
- @include breakpoint( "<782px" ) {
35
  .wc-block-cart__submit-container--sticky {
36
  background: $white;
37
  bottom: 0;
25
  }
26
  }
27
 
28
+ @include breakpoint(">782px") {
29
  .wc-block-cart__submit-container--sticky {
30
  display: none;
31
  }
32
  }
33
 
34
+ @include breakpoint("<782px") {
35
  .wc-block-cart__submit-container--sticky {
36
  background: $white;
37
  bottom: 0;
assets/js/blocks/cart-checkout/cart/checkout-button/style.scss CHANGED
@@ -25,13 +25,13 @@
25
  }
26
  }
27
 
28
- @include breakpoint( ">782px" ) {
29
  .wc-block-cart__submit-container--sticky {
30
  display: none;
31
  }
32
  }
33
 
34
- @include breakpoint( "<782px" ) {
35
  .wc-block-cart__submit-container--sticky {
36
  background: $white;
37
  bottom: 0;
25
  }
26
  }
27
 
28
+ @include breakpoint(">782px") {
29
  .wc-block-cart__submit-container--sticky {
30
  display: none;
31
  }
32
  }
33
 
34
+ @include breakpoint("<782px") {
35
  .wc-block-cart__submit-container--sticky {
36
  background: $white;
37
  bottom: 0;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/style.scss CHANGED
@@ -1,6 +1,6 @@
1
  .wc-block-checkout__shipping-option {
2
  .wc-block-components-radio-control__option {
3
- @include with-translucent-border( 0 0 1px );
4
  margin: 0;
5
  padding: em($gap-small) 0 em($gap-small) em($gap-largest);
6
  }
1
  .wc-block-checkout__shipping-option {
2
  .wc-block-components-radio-control__option {
3
+ @include with-translucent-border(0 0 1px);
4
  margin: 0;
5
  padding: em($gap-small) 0 em($gap-small) em($gap-largest);
6
  }
assets/js/blocks/cart-checkout/mini-cart/block.tsx CHANGED
@@ -9,6 +9,11 @@ import { translateJQueryEventToNative } from '@woocommerce/base-utils';
9
  import { useStoreCart } from '@woocommerce/base-context/hooks';
10
  import Drawer from '@woocommerce/base-components/drawer';
11
  import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
 
 
 
 
 
12
 
13
  /**
14
  * Internal dependencies
@@ -23,7 +28,12 @@ interface MiniCartBlockProps {
23
  const MiniCartBlock = ( {
24
  isPlaceholderOpen = false,
25
  }: MiniCartBlockProps ): JSX.Element => {
26
- const { cartItems, cartItemsCount, cartIsLoading } = useStoreCart();
 
 
 
 
 
27
  const [ isOpen, setIsOpen ] = useState< boolean >( isPlaceholderOpen );
28
  const emptyCartRef = useRef< HTMLDivElement | null >( null );
29
  // We already rendered the HTML drawer placeholder, so we want to skip the
@@ -73,6 +83,23 @@ const MiniCartBlock = ( {
73
  }
74
  }, [ isOpen, cartIsLoading, cartItems.length, emptyCartRef ] );
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  const contents =
77
  ! cartIsLoading && cartItems.length === 0 ? (
78
  <div
@@ -99,6 +126,7 @@ const MiniCartBlock = ( {
99
  setSkipSlideIn( false );
100
  }
101
  } }
 
102
  >
103
  { sprintf(
104
  /* translators: %d is the count of items in the cart. */
9
  import { useStoreCart } from '@woocommerce/base-context/hooks';
10
  import Drawer from '@woocommerce/base-components/drawer';
11
  import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
12
+ import {
13
+ formatPrice,
14
+ getCurrencyFromPriceResponse,
15
+ } from '@woocommerce/price-format';
16
+ import { getSetting } from '@woocommerce/settings';
17
 
18
  /**
19
  * Internal dependencies
28
  const MiniCartBlock = ( {
29
  isPlaceholderOpen = false,
30
  }: MiniCartBlockProps ): JSX.Element => {
31
+ const {
32
+ cartItems,
33
+ cartItemsCount,
34
+ cartIsLoading,
35
+ cartTotals,
36
+ } = useStoreCart();
37
  const [ isOpen, setIsOpen ] = useState< boolean >( isPlaceholderOpen );
38
  const emptyCartRef = useRef< HTMLDivElement | null >( null );
39
  // We already rendered the HTML drawer placeholder, so we want to skip the
83
  }
84
  }, [ isOpen, cartIsLoading, cartItems.length, emptyCartRef ] );
85
 
86
+ const subTotal = getSetting( 'displayCartPricesIncludingTax', false )
87
+ ? parseInt( cartTotals.total_items, 10 ) +
88
+ parseInt( cartTotals.total_items_tax, 10 )
89
+ : cartTotals.total_items;
90
+
91
+ const ariaLabel = sprintf(
92
+ /* translators: %1$d is the number of products in the cart. %2$s is the cart total */
93
+ _n(
94
+ '%1$d item in cart, total price of %2$s',
95
+ '%1$d items in cart, total price of %2$s',
96
+ cartItemsCount,
97
+ 'woo-gutenberg-products-block'
98
+ ),
99
+ cartItemsCount,
100
+ formatPrice( subTotal, getCurrencyFromPriceResponse( cartTotals ) )
101
+ );
102
+
103
  const contents =
104
  ! cartIsLoading && cartItems.length === 0 ? (
105
  <div
126
  setSkipSlideIn( false );
127
  }
128
  } }
129
+ aria-label={ ariaLabel }
130
  >
131
  { sprintf(
132
  /* translators: %d is the count of items in the cart. */
assets/js/blocks/cart-checkout/payment-methods/style.scss CHANGED
@@ -31,7 +31,7 @@
31
  // Notice the min width ems value is smaller than flex-basis. That's because
32
  // by default we want it to have the same width as `expiry-element`, but
33
  // if available space is scarce, `cvc-element` should get smaller faster.
34
- min-width: unquote("min( 5em, calc(16% - #{$gap-small}))");
35
  }
36
 
37
  .wc-block-gateway-input {
31
  // Notice the min width ems value is smaller than flex-basis. That's because
32
  // by default we want it to have the same width as `expiry-element`, but
33
  // if available space is scarce, `cvc-element` should get smaller faster.
34
+ min-width: unquote("min(5em, calc(16% - #{$gap-small}))");
35
  }
36
 
37
  .wc-block-gateway-input {
assets/js/types/type-guards/index.ts CHANGED
@@ -13,7 +13,11 @@ export const isString = < U >( term: string | U ): term is string => {
13
  export const isObject = < T extends Record< string, unknown >, U >(
14
  term: T | U
15
  ): term is NonNullable< T > => {
16
- return ! isNull( term ) && typeof term === 'object';
 
 
 
 
17
  };
18
 
19
  export function objectHasProp< P extends PropertyKey >(
13
  export const isObject = < T extends Record< string, unknown >, U >(
14
  term: T | U
15
  ): term is NonNullable< T > => {
16
+ return (
17
+ ! isNull( term ) &&
18
+ term instanceof Object &&
19
+ term.constructor === Object
20
+ );
21
  };
22
 
23
  export function objectHasProp< P extends PropertyKey >(
assets/js/types/type-guards/test/index.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { isObject } from '@woocommerce/types';
5
+
6
+ describe( 'type-guards', () => {
7
+ describe( 'Testing isObject()', () => {
8
+ it( 'Correctly identifies an object', () => {
9
+ expect( isObject( {} ) ).toBe( true );
10
+ expect( isObject( { test: 'object' } ) ).toBe( true );
11
+ } );
12
+ it( 'Correctly rejects object-like things', () => {
13
+ expect( isObject( [] ) ).toBe( false );
14
+ expect( isObject( null ) ).toBe( false );
15
+ } );
16
+ } );
17
+ } );
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'), 'version' => '30388734b99f75d9bb3536481cc8c2cc');
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'), 'version' => 'b80f837f2fae749d09b712be28033e08');
build/active-filters-frontend.js CHANGED
@@ -2,7 +2,7 @@
2
  /* translators: Remove chip. */
3
  Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
- Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),j)}var E={"aria-label":r,disabled:f,onClick:y,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||y()}},R=v?E:{},S=v?{"aria-hidden":!0}:E;return React.createElement(b,o()({},w,R,{className:s()(c,"is-removable"),element:v?"button":w.element,screenReaderText:h,text:O}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},2:function(e,t){e.exports=window.wc.wcSettings},20:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},216:function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(23),a=r.n(c),i=r(34),s=["className","size"],u=function(e){var t=e.className,r=e.size,n=a()(e,s);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(u,null);t.a=l},23:function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29: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.default=e.exports,e.exports.__esModule=!0},296:function(e,t,r){e.exports=r(320)},297:function(e,t){},3:function(e,t){e.exports=window.React},30:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},320:function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(107),c=r(5),a=r.n(c),i=r(1),s=r(90),u=r(2),l=r(0),p=r(6),f=r.n(p),b=(r(10),r(51)),d=(r(297),r(169)),m=r(62),y=r(194),g=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
  Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(m.formatPrice)(e),Object(m.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(
8
  /* translators: %s min price */
@@ -10,4 +10,4 @@ Object(i.__)("From %s","woo-gutenberg-products-block"),Object(m.formatPrice)(e))
10
  /* translators: %s max price */
11
  Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(m.formatPrice)(t))},v=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,s=void 0===a||a,u=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
- Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},s&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?React.createElement(y.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(b.a,{screenReaderLabel:p}))))},O=r(120),_=r(28),h=r(170),w=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,u=void 0===c?"in":c,l=e.displayStyle,p=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(s.b)("attributes",[]),m=a()(d,2),y=m[0],g=m[1];if(b)return null;var w=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},w,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===u&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),v({type:w,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(h.a)(y,g,r,e)},showLabel:!1,displayStyle:l})}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)((function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(s.b)("attributes",[]),c=a()(o,2),p=c[0],m=c[1],y=Object(s.b)("stock_status",[]),O=a()(y,2),_=O[0],h=O[1],x=Object(s.b)("min_price"),j=a()(x,2),E=j[0],R=j[1],S=Object(s.b)("max_price"),k=a()(S,2),P=k[0],T=k[1],M=Object(u.getSetting)("stockStatusOptions",[]),N=Object(l.useMemo)((function(){if(_.length>0)return _.map((function(e){return v({type:Object(i.__)("Stock Status","woo-gutenberg-products-block"),name:M[e],removeCallback:function(){var t=_.filter((function(t){return t!==e}));h(t)},displayStyle:t.displayStyle})}))}),[M,_,h,t.displayStyle]),A=Object(l.useMemo)((function(){return Number.isFinite(E)||Number.isFinite(P)?v({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:g(E,P),removeCallback:function(){R(void 0),T(void 0)},displayStyle:t.displayStyle}):null}),[E,P,t.displayStyle,R,T]),C=Object(l.useMemo)((function(){return p.map((function(e){var r=Object(d.b)(e.attribute);return React.createElement(w,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[p,t.displayStyle]);if(!(p.length>0||_.length>0||Number.isFinite(E)||Number.isFinite(P)||n))return null;var L="h".concat(t.headingLevel),B=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(L,{className:"wc-block-active-filters__title"},t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:B},n?React.createElement(React.Fragment,null,v({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),v({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,A,N,C)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){R(void 0),T(void 0),m([]),h([])}},React.createElement(b.a,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))})),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},34:function(e,t){e.exports=window.wp.primitives},4: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.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,r){var n=r(20).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),a=r.n(c),i=r(29),s=r.n(i),u=r(42),l=r.n(u),p=r(43),f=r.n(p),b=r(30),d=r.n(b),m=r(4),y=r.n(m),g=(r(10),r(3)),v=r(1),O=r(83),_=function(e){var t=e.imageUrl,r=void 0===t?"".concat(O.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(v.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:","woo-gutenberg-products-block"):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var h=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=d()(t);if(r){var o=d()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),y()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(_,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(g.Component);h.defaultProps={showErrorMessage:!0},t.a=h},5:function(e,t,r){var n=r(84),o=r(85),c=r(67),a=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(25),c=r.n(o);function a(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},6: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 a=o.apply(null,n);a&&e.push(a)}}else if("object"===c)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)}()},62:function(e,t){e.exports=window.wc.priceFormat},64:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},67:function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},83:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return a})),r.d(t,"k",(function(){return i})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return d})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return y})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return v}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(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),d=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),y=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return m}));var n=r(5),o=r.n(n),c=r(8),a=r(11),i=r(0),s=r(25),u=r.n(s),l=r(53),p=r(99),f=r(64),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],s=c[1],d=Object(l.a)(a),m=Object(l.a)(e),y=Object(p.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(y,m)||(s(Object.assign({},d,m)),g.current=!0)}),[d,m,y,s]),g.current?[a,s]:[e,s]}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}}});
2
  /* translators: Remove chip. */
3
  Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
+ Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),j)}var E={"aria-label":r,disabled:f,onClick:y,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||y()}},R=v?E:{},S=v?{"aria-hidden":!0}:E;return React.createElement(b,o()({},w,R,{className:s()(c,"is-removable"),element:v?"button":w.element,screenReaderText:h,text:O}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},216:function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(23),a=r.n(c),i=r(34),s=["className","size"],u=function(e){var t=e.className,r=e.size,n=a()(e,s);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(u,null);t.a=l},23:function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29: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.default=e.exports,e.exports.__esModule=!0},296:function(e,t,r){e.exports=r(321)},297:function(e,t){},3:function(e,t){e.exports=window.React},30:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},321:function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(107),c=r(5),a=r.n(c),i=r(1),s=r(90),u=r(2),l=r(0),p=r(6),f=r.n(p),b=(r(10),r(51)),d=(r(297),r(169)),m=r(58),y=r(194),g=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
  Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(m.formatPrice)(e),Object(m.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(
8
  /* translators: %s min price */
10
  /* translators: %s max price */
11
  Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(m.formatPrice)(t))},v=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,s=void 0===a||a,u=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
+ Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},s&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?React.createElement(y.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(b.a,{screenReaderLabel:p}))))},O=r(120),_=r(28),h=r(170),w=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,u=void 0===c?"in":c,l=e.displayStyle,p=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(s.b)("attributes",[]),m=a()(d,2),y=m[0],g=m[1];if(b)return null;var w=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},w,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===u&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),v({type:w,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(h.a)(y,g,r,e)},showLabel:!1,displayStyle:l})}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)((function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(s.b)("attributes",[]),c=a()(o,2),p=c[0],m=c[1],y=Object(s.b)("stock_status",[]),O=a()(y,2),_=O[0],h=O[1],x=Object(s.b)("min_price"),j=a()(x,2),E=j[0],R=j[1],S=Object(s.b)("max_price"),k=a()(S,2),P=k[0],T=k[1],M=Object(u.getSetting)("stockStatusOptions",[]),N=Object(l.useMemo)((function(){if(_.length>0)return _.map((function(e){return v({type:Object(i.__)("Stock Status","woo-gutenberg-products-block"),name:M[e],removeCallback:function(){var t=_.filter((function(t){return t!==e}));h(t)},displayStyle:t.displayStyle})}))}),[M,_,h,t.displayStyle]),A=Object(l.useMemo)((function(){return Number.isFinite(E)||Number.isFinite(P)?v({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:g(E,P),removeCallback:function(){R(void 0),T(void 0)},displayStyle:t.displayStyle}):null}),[E,P,t.displayStyle,R,T]),C=Object(l.useMemo)((function(){return p.map((function(e){var r=Object(d.b)(e.attribute);return React.createElement(w,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[p,t.displayStyle]);if(!(p.length>0||_.length>0||Number.isFinite(E)||Number.isFinite(P)||n))return null;var L="h".concat(t.headingLevel),B=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(L,{className:"wc-block-active-filters__title"},t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:B},n?React.createElement(React.Fragment,null,v({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),v({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,A,N,C)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){R(void 0),T(void 0),m([]),h([])}},React.createElement(b.a,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))})),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},34:function(e,t){e.exports=window.wp.primitives},4: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.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),a=r.n(c),i=r(29),s=r.n(i),u=r(42),l=r.n(u),p=r(43),f=r.n(p),b=r(30),d=r.n(b),m=r(4),y=r.n(m),g=(r(10),r(3)),v=r(1),O=r(83),_=function(e){var t=e.imageUrl,r=void 0===t?"".concat(O.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(v.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:","woo-gutenberg-products-block"):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var h=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=d()(t);if(r){var o=d()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),y()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(_,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(g.Component);h.defaultProps={showErrorMessage:!0},t.a=h},5:function(e,t,r){var n=r(84),o=r(85),c=r(67),a=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(25),c=r.n(o);function a(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},58:function(e,t){e.exports=window.wc.priceFormat},6: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 a=o.apply(null,n);a&&e.push(a)}}else if("object"===c)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)}()},64:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},67:function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},83:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return a})),r.d(t,"k",(function(){return i})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return d})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return y})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return v}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(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),d=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),y=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return m}));var n=r(5),o=r.n(n),c=r(8),a=r(11),i=r(0),s=r(25),u=r.n(s),l=r(53),p=r(99),f=r(64),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],s=c[1],d=Object(l.a)(a),m=Object(l.a)(e),y=Object(p.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(y,m)||(s(Object.assign({},d,m)),g.current=!0)}),[d,m,y,s]),g.current?[a,s]:[e,s]}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}}});
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-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'aac86aeec6b56567933ee06429825fa9');
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-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '76bb8df518c6beffbbaf42fd2494d3aa');
build/all-products-frontend.js CHANGED
@@ -1,6 +1,6 @@
1
- !function(e){function t(t){for(var r,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&s.push(n[o][0]),n[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);s.length;)s.shift()()}var r={},n={7: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,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sale-badge",15:"atomic-block-components/sku",16:"atomic-block-components/stock-indicator",17:"atomic-block-components/summary",18:"atomic-block-components/tag-list",19:"atomic-block-components/title",50:"vendors--atomic-block-components/add-to-cart"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);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;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,r[1](u)}n[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}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 a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=284)}([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){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.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(84),o=r(85),c=r(67),i=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},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 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)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){e.exports=r(79)()},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,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(n.a)(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(20),o=r.n(n),c=r(13);function i(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(c.a)(e):t}},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,"a",(function(){return n}))},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},,function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},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.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(58),o=r(65);function c(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(4),i=r.n(c),a=r(7),u=r(0),s=r(8),l=r(11),p=r(28),f=r(92),d=r(93),b=r(36);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},O=h(h({},g),{},{email:""}),v={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:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},y=function(e){return Object(f.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(p.decodeEntities)(n)]})))},w={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:v,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),r=t.isEditor,n=t.previewData,o=null==n?void 0:n.previewCart,c=e.shouldSelect,i=Object(u.useRef)(),p=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!c)return w;if(r)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,extensions:s.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),p=!i.hasFinishedResolution("getCartData"),f=i.isCustomerDataUpdating(),b=n(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),v=a.needsShipping?y(a.shippingAddress):m,j=a.fees.length>0?a.fees.map((function(e){return y(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return h(h({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:p,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(v),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:f,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,p)||(i.current=p),i.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=(r(11),Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(n.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(20).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),i=r.n(c),a=r(29),u=r.n(a),s=r(42),l=r.n(s),p=r(43),f=r.n(p),d=r(30),b=r.n(d),m=r(4),h=r.n(m),g=(r(10),r(3)),O=r(1),v=r(83),y=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(O.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(O.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(O.__)("Error:","woo-gutenberg-products-block"):u,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var w=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=b()(t);if(r){var o=b()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e=n.call.apply(n,[this].concat(r)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=e.button,u=this.state,s=u.errorMessage;return u.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(y,{errorMessage:n?s:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(g.Component);w.defaultProps={showErrorMessage:!0},t.a=w},function(e,t){e.exports=window.wp.deprecated},,function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(74),Object(n.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,r(102))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return u}));var n=r(20),o=r.n(n),c=function(e){return"number"==typeof e},i=function(e){return"string"==typeof e},a=function(e){return!function(e){return null===e}(e)&&"object"===o()(e)};function u(e,t){return a(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),i=r(6),a=r.n(i);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,u,r))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),o=r.n(n),c=r(75),i=r(0),a=r(32);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(i.useRef)(e);return Object(i.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),s(s({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(25),c=r.n(o);function i(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},,,,,function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},,function(e,t){e.exports=window.wp.apiFetch},,function(e,t){e.exports=window.wc.priceFormat},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(58);function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},,function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";var n=r(12),o=r(19),c=r(0),i=r(6),a=r.n(i),u=r(7),s=r(45),l=r.n(s),p=r(15),f=r(16),d=r(17),b=r(18),m=r(9),h=r(22),g=r(37),O=r(50),v=r(24),y=r(116),w=r(21);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r,n,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===r&&u?r="right":"right"===r&&u&&(r="left"),"left"===n&&u?n="right":"right"===n&&u&&(n="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},p=e.left;"right"===n?p=e.right:"middle"!==c&&(p=s);var f=e.right;"left"===n?f=e.left:"middle"!==c&&(f=s);var d,b={popoverLeft:p,contentWidth:p-a>0?a:p},m={popoverLeft:f,contentWidth:f+a>window.innerWidth?window.innerWidth-f:a},h=r,g=null;if(!o)if("center"===r&&l.contentWidth===a)h="center";else if("left"===r&&b.contentWidth===a)h="left";else if("right"===r&&m.contentWidth===a)h="right";else{var O="left"==(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;g=O!==a?O:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var v=i.getBoundingClientRect();d=Math.min(d,v.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:g}}function x(e,t,r,n,o,c,i){var a=t.height;if(o){var u=(Object(g.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:r,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===n?s=e.bottom:"top"===n&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},p={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},f={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=r,b=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&p.contentHeight===a)d="top";else if("bottom"===r&&f.contentHeight===a)d="bottom";else{var m="top"==(d=p.contentHeight>f.contentHeight?"top":"bottom")?p.contentHeight:f.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?p.popoverTop:f.popoverTop,contentHeight:b}}var R=r(31),k=r(13);var P=Object(c.createContext)({focusHistory:[]}),S=P.Provider,C=P.Consumer;S.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",c.Component;var T=Object(v.createHigherOrderComponent)((function e(t){if((n=t)instanceof c.Component||"function"==typeof n){var r=t;return e({})(r)}var n,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var r,n,o=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function a(){var e;return Object(p.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(f.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,r=this.ownFocusedElements;if(t&&!1!==i())for(var n,o=[].concat(Object(R.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(R.a)(r)))),[e]);n=o.pop();)if(document.body.contains(n))return void n.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),a}(c.Component);return function(e){return Object(c.createElement)(C,null,(function(r){return Object(c.createElement)(t,{childProps:e,focus:r})}))}}}),"withFocusReturn");var N=Object(v.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(i,t);var r,n,o=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function i(){var e;return Object(p.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(k.a)(e)),e}return Object(f.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===O.TAB){var t=g.focus.tabbable.find(this.focusContainRef.current);if(t.length){var r=t[0],n=t[t.length-1];e.shiftKey&&e.target===r?(e.preventDefault(),n.focus()):(e.shiftKey||e.target!==n)&&t.includes(e.target)||(e.preventDefault(),r.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),i}(c.Component)}),"withConstrainedTabbing"),D=r(89);var M=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){return Object(p.a)(this,o),n.apply(this,arguments)}return Object(f.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(c.Component),A=Object(D.a)(M);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Object(b.a)(this,r)}}var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,r=void 0===t?document:t,n=e.className,o=void 0===n?"lockscroll":n,i=0,a=0;function u(e){var t=r.scrollingElement||r.body;e&&(a=t.scrollTop);var n=e?"add":"remove";t.classList[n](o),r.documentElement.classList[n](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){Object(d.a)(r,e);var t=F(r);function r(){return Object(p.a)(this,r),t.apply(this,arguments)}return Object(f.a)(r,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(c.Component)}();function B(e){e.stopPropagation()}var L=Object(c.forwardRef)((function(e,t){var r=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(n.a)({},i,{ref:t,onMouseDown:B}),r)})),z=r(47);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function W(e){var t=Object(c.useContext)(z.a),r=t.slots[e]||{},n=t.fills[e],o=Object(c.useMemo)((function(){return n||[]}),[n]),i=Object(c.useCallback)((function(r){t.updateSlot(e,r)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(r){t.unregisterSlot(e,r)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(r){t.registerFill(e,r)}),[e,t.registerFill]),s=Object(c.useCallback)((function(r){t.unregisterFill(e,r)}),[e,t.unregisterFill]);return U(U({},r),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Y(e,t,r){return(Y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}r(25);var q=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),V=(q.Provider,q.Consumer);c.Component;var G=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(k.a)(e)),e}return Object(f.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.name,n=t.unregisterSlot,o=t.registerSlot;e.name!==r&&(n(e.name),o(r,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Y(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.getFills,a=Object(u.map)(i(r,this),(function(e){var t=e.occurrence,r=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(r,(function(e,r){if(!e||Object(u.isString)(e))return e;var n="".concat(t,"---").concat(e.key||r);return Object(c.cloneElement)(e,{key:n})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),o}(c.Component),K=function(e){return Object(c.createElement)(V,null,(function(t){var r=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(G,Object(n.a)({},e,{registerSlot:r,unregisterSlot:o,getFills:i}))}))},Q=0;function J(e){var t=e.name,r=e.children,n=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(q),r=t.getSlot,n=t.subscribe,o=Object(c.useState)(r(e)),i=Object(h.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(r(e)),n((function(){u(r(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:r});return a.current.occurrence||(a.current.occurrence=++Q),Object(c.useLayoutEffect)((function(){return n(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=r,i&&i.forceUpdate()}),[r]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,n(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(r)&&(r=r(i.props.fillProps)),Object(c.createPortal)(r,i.node)):null}var X=function(e){return Object(c.createElement)(V,null,(function(t){var r=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(J,Object(n.a)({},e,{registerFill:r,unregisterFill:o}))}))};function $(e){var t=e.name,r=e.fillProps,i=void 0===r?{}:r,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(z.a),p=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,p,i),function(){l.unregisterSlot(t,p)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(n.a)({ref:p},s))}function Z(e){var t,r,n=e.name,o=e.children,i=W(n),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),r=Object(h.a)(t,2)[1],function(){return r({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ee(e){var t=e.bubblesVirtually,r=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)($,r):Object(c.createElement)(K,r)}function te(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(X,e),Object(c.createElement)(Z,e))}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e){var t=e.type,r=e.origin,n=void 0===r?function(e){return"appear"===e?"top":"left"}(t):r;if("appear"===t){var o,c=n.split(" "),i=Object(h.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(w.a)(o,"is-from-"+l,"center"!==l),Object(w.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):"loading"===t?a()("components-animate__loading"):void 0}function ce(e){var t=e.type,r=e.options,n=void 0===r?{}:r;return(0,e.children)({className:oe(ne({type:t},n))})}var ie=N(T((function(e){return e.children})));function ae(e,t){var r,n=(r=t).ownerDocument.defaultView.getComputedStyle(r),o=n.paddingTop,c=n.paddingBottom,i=n.paddingLeft,a=n.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,p=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-p,height:e.height-u-s,left:e.left+l,right:e.right-p,top:e.top+u,bottom:e.bottom-s}}function ue(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==r&&(e.style[t]=r)}function le(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var pe=function(e){var t=e.headerTitle,r=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,p=e.noArrow,f=void 0===p||p,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,w=(e.range,e.focusOnMount),j=void 0===w?"firstElement":w,R=e.anchorRef,k=e.shouldAnchorIncludePadding,P=e.anchorRect,S=e.getAnchorRect,C=e.expandOnMobile,T=e.animate,N=void 0===T||T,D=e.onClickOutside,M=e.onFocusOutside,F=e.__unstableSticky,B=e.__unstableSlotName,z=void 0===B?"Popover":B,H=e.__unstableObserveElement,U=e.__unstableBoundaryParent,Y=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),V=Object(c.useRef)(null),G=Object(c.useRef)(),K=Object(v.useViewportMatch)("medium","<"),Q=Object(c.useState)(),J=Object(h.a)(Q,2),X=J[0],$=J[1],Z=W(z),ee=C&&K,re=Object(v.useResizeObserver)(),ne=Object(h.a)(re,2),oe=ne[0],pe=ne[1];f=ee||f,Object(c.useLayoutEffect)((function(){if(ee)return le(G.current,"is-without-arrow",f),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis"),ue(G.current,"data-y-axis"),se(G.current,"top"),se(G.current,"left"),se(V.current,"maxHeight"),void se(V.current,"maxWidth");var e=function(){if(G.current&&V.current){var e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(r){if(!e.current)return;return r(e.current)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if(n instanceof window.Range)return Object(g.getRectangleFromRange)(n);if(n instanceof window.Element){var c=n.getBoundingClientRect();return o?c:ae(c,n)}var i=n.top,a=n.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ae(l,n)}if(e.current){var p=e.current.parentNode,f=p.getBoundingClientRect();return o?f:ae(f,p)}}(q,P,S,R,k);if(e){var t,r,n=G.current,o=n.offsetParent,c=n.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}U&&(t=null===(r=G.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);var u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=r.split(" "),u=Object(h.a)(a,3),s=u[0],l=u[1],p=void 0===l?"center":l,f=u[2],d=x(e,t,s,f,n,o,c),b=_(e,t,p,f,n,d.yAxis,i);return E(E({},b),d)}(e,pe.height?pe:V.current.getBoundingClientRect(),m,F,G.current,i,t),s=u.popoverTop,l=u.popoverLeft,p=u.xAxis,b=u.yAxis,O=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(se(G.current,"top",s+"px"),se(G.current,"left",l+"px")),le(G.current,"is-without-arrow",f||"center"===p&&"middle"===b),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis",p),ue(G.current,"data-y-axis",b),se(V.current,"maxHeight","number"==typeof O?O+"px":""),se(V.current,"maxWidth","number"==typeof v?v+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,r,n=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),H&&(r=new window.MutationObserver(e)).observe(H,{attributes:!0}),function(){window.clearInterval(n),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),r&&r.disconnect()}}),[ee,P,S,R,k,m,pe,F,H,U]),function(e,t){Object(c.useEffect)((function(){var r=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var r=g.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,V);var fe=function(e){e.keyCode===O.ESCAPE&&r&&(e.stopPropagation(),r()),i&&i(e)},de=Object(c.createElement)(A,{onFocusOutside:function(e){if(M)M(e);else if(D){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),D(t)}else r&&r()}},Object(c.createElement)(ce,{type:N&&X?"appear":null,options:{origin:X}},(function(e){var o=e.className;return Object(c.createElement)(L,Object(n.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":f,"is-alternate":d})},Y,{onKeyDown:fe,ref:G}),ee&&Object(c.createElement)(I,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Oe,{className:"components-popover__close",icon:y.a,onClick:r})),Object(c.createElement)("div",{ref:V,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},oe,u)))})));return j&&(de=Object(c.createElement)(ie,null,de)),Z.ref&&(de=Object(c.createElement)(te,{name:z},de)),R||P?de:Object(c.createElement)("span",{ref:q},de)};pe.Slot=function(e){var t=e.name,r=void 0===t?"Popover":t;return Object(c.createElement)(ee,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var fe=pe,de=function(e){var t,r,n=e.shortcut,o=e.className;return n?(Object(u.isString)(n)&&(t=n),Object(u.isObject)(n)&&(t=n.display,r=n.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":r},t)):null};var be=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=n.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(f.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var r=this.props.children;if(1===c.Children.count(r)){var n=c.Children.only(r);"function"==typeof n.props[e]&&n.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var r=this;return function(n){if(r.emitToChild(e,n),!(n.currentTarget.disabled||"focus"===n.type&&r.isInMouseDown)){r.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],n.type);o!==r.state.isOver&&(t?r.delayedSetIsOver(o):r.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(r){t.emitToChild(e?"onMouseDown":"onMouseUp",r),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.position,n=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(fe,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(c.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(c.Component),me=r(91);function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ge=["onMouseDown","onClick"],Oe=t.a=Object(c.forwardRef)((function(e,t){var r=e.href,i=e.target,s=e.isPrimary,p=e.isSmall,f=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,g=e.isLink,O=e.isDestructive,v=e.className,y=e.disabled,w=e.icon,j=e.iconSize,E=e.showTooltip,_=e.tooltipPosition,x=e.shortcut,R=e.label,k=e.children,P=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",v,{"is-secondary":m||h,"is-primary":s,"is-small":p,"is-tertiary":f,"is-pressed":d,"is-busy":b,"is-link":g,"is-destructive":O,"has-text":!!w&&!!k,"has-icon":!!w}),T=y&&!P,N=void 0===r||T?"button":"a",D="a"===N?{href:r,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(y&&P){D["aria-disabled"]=!0;var M,A=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return he(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?he(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw c}}}}(ge);try{for(A.s();!(M=A.n()).done;)S[M.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){A.e(e)}finally{A.f()}}var F=!T&&(E&&R||x||!!R&&(!k||Object(u.isArray)(k)&&!k.length)&&!1!==E),I=Object(c.createElement)(N,Object(n.a)({},D,S,{className:C,"aria-label":S["aria-label"]||R,ref:t}),w&&Object(c.createElement)(me.a,{icon:w,size:j}),k);return F?Object(c.createElement)(be,{text:R,shortcut:x,position:_},I):I}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},,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 a})),r.d(t,"m",(function(){return u})),r.d(t,"i",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return b})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return h})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return O}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(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),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=r(2),u=r(1),s=r(49);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),d=function(e){var 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(u.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},b=Object.entries(f).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},o=n[e]||{},c=t[e]||{};return p(p(p({key:e},r),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(12),o=r(15),c=r(16),i=r(13),a=r(17),u=r(18),s=r(9),l=r(0),p=r(7),f=r(24);var d=["button","submit"];t.a=Object(f.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,f,b=(r=m,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(s.a)(r);if(f){var n=Object(s.a)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Object(u.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=b.apply(this,arguments)).bindNode=e.bindNode.bind(Object(i.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(i.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(i.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(i.a)(e)),e}return Object(c.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,r=e.target;Object(p.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(p.includes)(d,e.type)}return!1}(r)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(n.a)({ref:this.bindNode},this.props)))}}]),m}(l.Component)}),"withFocusOutside")},function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return m}));var n=r(5),o=r.n(n),c=r(8),i=r(11),a=r(0),u=r(25),s=r.n(u),l=r(53),p=r(99),f=r(64),d=function(e){var t=Object(f.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(a.useCallback)((function(t){n(e,t)}),[e,n])]},b=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},m=function(e,t){var r=Object(f.a)(),n=d(t=t||r),c=o()(n,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(p.a)(m),g=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),g.current=!0)}),[b,m,h,u]),g.current?[i,u]:[e,u]}},function(e,t,r){"use strict";var n=r(21),o=r(12),c=r(19),i=r(0),a=r(34),u=function(e){var t=e.icon,r=e.className,n=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,r].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},n))};function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.icon,r=void 0===t?null:t,n=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof r)return Object(i.createElement)(u,Object(o.a)({icon:r},s));if(r&&u===r.type)return Object(i.cloneElement)(r,l({},s));var p=n||24;if("function"==typeof r)return r.prototype instanceof i.Component?Object(i.createElement)(r,l({size:p},s)):r(l({size:p},s));if(r&&("svg"===r.type||r.type===a.SVG)){var f=l(l({width:p,height:p},r.props),s);return Object(i.createElement)(a.SVG,f)}return Object(i.isValidElement)(r)?Object(i.cloneElement)(r,l({size:p},s)):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r.n(n),c=function(e){return e.reduce((function(e,t){var r=o()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return u}));var n=r(2),o=r(87),c=r(72),i=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,o=void 0===n?"":n,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:r.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(c.isEmail)(r)?r.trim():""},u=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(o.a)(t,{},e.country),c=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(n,e)&&(c[n]="")})),c}},,,,function(e,t){e.exports=window.wp.autop},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){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 i}));var n=r(5),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},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 a(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 u,s=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?s=u.concat(s):p=-1,s.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=s.length;t;){for(u=s,s=[];++p<t;)u&&u[p].run();p=-1,t=s.length}u=null,l=!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 b(e,t){this.fun=e,this.array=t}function m(){}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];s.push(new b(e,t)),1!==s.length||l||a(d)},b.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=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,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,"b",(function(){return w})),r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=(r(10),r(0)),u=r(11),s=r(52),l=r(36),p=r(14),f=r.n(p),d=r(6),b=r.n(d),m=r(153),h=(r(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,o=r.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,f()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice",h(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=Object(a.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(a.useContext)(y)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,o=e.createNoticeContainer,c=void 0===o||o,p=e.context,f=void 0===p?"wc/core":p,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),O=i()(h,2),w=O[0],j=O[1],E=Object(s.a)().dispatchStoreEvent,_=Object(l.a)().isEditor,x=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,v(v({},r),{},{context:r.context||f})),E("store-notice-create",{status:e,content:t,options:r})}),[b,E,f]),R=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;m(e,t)}),[m,f]),k={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(f)}}),[f]).notices,createNotice:x,removeNotice:R,context:f,setIsSuppressed:j},P=w?null:React.createElement(g,{className:n,notices:k.notices,removeNotice:k.removeNotice,isEditor:_});return React.createElement(y.Provider,{value:k},c&&P,t)}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),c=r(4),i=r.n(c),a=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){return{}}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=s(e,r),p=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},d=function(e){var t,r,n,o,c,i,a,u=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:u}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,i=t.wrappers,a=document.body.querySelectorAll(c),i.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),f({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(u,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,i,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,i=r.selector,a=r.wrapper.querySelectorAll(i),f({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(0),i=(r(142),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(c.useRef)(null);return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),React.createElement(e,o()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var o=n[0];i(o),null==o||o.focus()}else i(e)}(t,n):i(t)))}})))}}},,function(e,t,r){"use strict";var n=r(0),o=r(34),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";r.d(t,"a",(function(){return u}));var n=r(8),o=r(11),c=r(0),i=r(53),a=r(100),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,d=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(p),h=Object(i.a)(s),g=Object(a.a)(),O=Object(o.useSelect)((function(e){if(!d)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,h],i=o.getCollectionError.apply(o,c);return i&&g(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,h,m,d]);return null!==O&&(b.current=O),b.current}},,,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(8),c=r(11),i=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(i.n.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,i=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,,,,,,,,,function(e,t){},,,,,,,,,,function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(23),i=r.n(c),a=r(0),u=["srcElement","size"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},function(e,t,r){"use strict";var n=r(0),o=r(7),c=r(6),i=r.n(c),a=r(1),u=r(33),s=r(116),l=r(76);t.a=function(e){var t=e.className,r=e.status,c=void 0===r?"info":r,p=e.children,f=e.spokenMessage,d=void 0===f?p:f,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,g=void 0===h||h,O=e.actions,v=void 0===O?[]:O,y=e.politeness,w=void 0===y?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):y,j=e.__unstableHTML;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(u.speak)(r,t)}),[r,t])}(d,w);var E=i()(t,"components-notice","is-"+c,{"is-dismissible":g});return j&&(p=Object(n.createElement)(n.RawHTML,null,p)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},p,v.map((function(e,t){var r=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,p=e.url;return Object(n.createElement)(l.a,{key:t,href:p,isPrimary:c,isSecondary:!u&&!p,isLink:!u&&!!p,onClick:p?void 0:s,className:i()("components-notice__action",r)},o)}))),g&&Object(n.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,function(e,t,r){"use strict";r(10);var n=r(6),o=r.n(n),c=r(51),i=r(24);r(196),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.label,i=e.onChange,a=e.options,u=e.screenReaderLabel,s=e.readOnly,l=e.value,p="wc-block-components-sort-select__select-".concat(r);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.a,{label:n,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:s,value:l},a.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(38),o=r(0),c=r(83);r.p=c.k,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([r.e(1),r.e(12)]).then(r.bind(null,387))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return r.e(11).then(r.bind(null,416))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return r.e(19).then(r.bind(null,409))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return r.e(13).then(r.bind(null,388))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return r.e(9).then(r.bind(null,389))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return r.e(17).then(r.bind(null,390))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return r.e(14).then(r.bind(null,354))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return r.e(15).then(r.bind(null,391))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return r.e(10).then(r.bind(null,392))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return r.e(18).then(r.bind(null,393))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return r.e(16).then(r.bind(null,394))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return Promise.all([r.e(0),r.e(50),r.e(8)]).then(r.bind(null,403))}))});var i=function(e){return Object(n.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,,,,function(e,t,r){e.exports=r(312)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(103),c=r(107),i=r(40),a=r.n(i),u=r(41),s=r.n(u),l=r(42),p=r.n(l),f=r(43),d=r.n(f),b=r(30),m=r.n(b),h=r(3),g=(r(10),r(5)),O=r.n(g),v=r(0),y=r(23),w=r.n(y),j=r(4),E=r.n(j),_=r(1),x=r(7),R=r(6),k=r.n(R),P=r(51),S=(r(287),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var 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}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=r&&Boolean(1!==u),p=r&&Boolean(s!==i),f=r&&Boolean(u>3),d=r&&Boolean(s<i-2);l&&3===u&&(u-=1),p&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(P.a,{screenReaderLabel:Object(_.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return c(t-1)},title:Object(_.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(P.a,{label:"←",screenReaderLabel:Object(_.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:k()("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:function(){return c(1)},disabled:1===t},React.createElement(P.a,{label:1,screenReaderLabel:Object(_.sprintf)(
4
  /* translators: %d is the page number (1, 2, 3...). */
5
  Object(_.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(_.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:k()("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?null:function(){return c(e)},disabled:t===e},React.createElement(P.a,{label:e,screenReaderLabel:Object(_.sprintf)(
6
  /* translators: %d is the page number (1, 2, 3...). */
1
+ !function(e){function t(t){for(var r,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&s.push(n[o][0]),n[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);s.length;)s.shift()()}var r={},n={7: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,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sale-badge",15:"atomic-block-components/sku",16:"atomic-block-components/stock-indicator",17:"atomic-block-components/summary",18:"atomic-block-components/tag-list",19:"atomic-block-components/title",50:"vendors--atomic-block-components/add-to-cart"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);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;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,r[1](u)}n[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}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 a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=284)}([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){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.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(84),o=r(85),c=r(67),i=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},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 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)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){e.exports=r(79)()},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,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(n.a)(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(21),o=r.n(n),c=r(13);function i(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(c.a)(e):t}},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},,function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},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.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(59),o=r(65);function c(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(4),i=r.n(c),a=r(7),u=r(0),s=r(8),l=r(11),p=r(28),f=r(92),d=r(93),b=r(36);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},O=h(h({},g),{},{email:""}),v={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:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},y=function(e){return Object(f.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(p.decodeEntities)(n)]})))},w={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:v,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),r=t.isEditor,n=t.previewData,o=null==n?void 0:n.previewCart,c=e.shouldSelect,i=Object(u.useRef)(),p=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!c)return w;if(r)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,extensions:s.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),p=!i.hasFinishedResolution("getCartData"),f=i.isCustomerDataUpdating(),b=n(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),v=a.needsShipping?y(a.shippingAddress):m,j=a.fees.length>0?a.fees.map((function(e){return y(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return h(h({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:p,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(v),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:f,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,p)||(i.current=p),i.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=(r(11),Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(n.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),i=r.n(c),a=r(29),u=r.n(a),s=r(42),l=r.n(s),p=r(43),f=r.n(p),d=r(30),b=r.n(d),m=r(4),h=r.n(m),g=(r(10),r(3)),O=r(1),v=r(83),y=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(O.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(O.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(O.__)("Error:","woo-gutenberg-products-block"):u,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var w=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=b()(t);if(r){var o=b()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e=n.call.apply(n,[this].concat(r)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=e.button,u=this.state,s=u.errorMessage;return u.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(y,{errorMessage:n?s:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(g.Component);w.defaultProps={showErrorMessage:!0},t.a=w},function(e,t){e.exports=window.wp.deprecated},,function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(74),Object(n.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,r(102))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return c})),r.d(t,"d",(function(){return i}));var n=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},c=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,t){return c(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),i=r(6),a=r.n(i);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,u,r))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),o=r.n(n),c=r(75),i=r(0),a=r(32);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(i.useRef)(e);return Object(i.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),s(s({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(25),c=r.n(o);function i(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},,,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},,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),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(59);function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},,function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";var n=r(12),o=r(19),c=r(0),i=r(6),a=r.n(i),u=r(7),s=r(45),l=r.n(s),p=r(15),f=r(16),d=r(17),b=r(18),m=r(9),h=r(22),g=r(37),O=r(50),v=r(24),y=r(116),w=r(20);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r,n,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===r&&u?r="right":"right"===r&&u&&(r="left"),"left"===n&&u?n="right":"right"===n&&u&&(n="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},p=e.left;"right"===n?p=e.right:"middle"!==c&&(p=s);var f=e.right;"left"===n?f=e.left:"middle"!==c&&(f=s);var d,b={popoverLeft:p,contentWidth:p-a>0?a:p},m={popoverLeft:f,contentWidth:f+a>window.innerWidth?window.innerWidth-f:a},h=r,g=null;if(!o)if("center"===r&&l.contentWidth===a)h="center";else if("left"===r&&b.contentWidth===a)h="left";else if("right"===r&&m.contentWidth===a)h="right";else{var O="left"==(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;g=O!==a?O:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var v=i.getBoundingClientRect();d=Math.min(d,v.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:g}}function x(e,t,r,n,o,c,i){var a=t.height;if(o){var u=(Object(g.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:r,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===n?s=e.bottom:"top"===n&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},p={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},f={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=r,b=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&p.contentHeight===a)d="top";else if("bottom"===r&&f.contentHeight===a)d="bottom";else{var m="top"==(d=p.contentHeight>f.contentHeight?"top":"bottom")?p.contentHeight:f.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?p.popoverTop:f.popoverTop,contentHeight:b}}var R=r(31),k=r(13);var P=Object(c.createContext)({focusHistory:[]}),S=P.Provider,C=P.Consumer;S.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",c.Component;var T=Object(v.createHigherOrderComponent)((function e(t){if((n=t)instanceof c.Component||"function"==typeof n){var r=t;return e({})(r)}var n,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var r,n,o=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function a(){var e;return Object(p.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(f.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,r=this.ownFocusedElements;if(t&&!1!==i())for(var n,o=[].concat(Object(R.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(R.a)(r)))),[e]);n=o.pop();)if(document.body.contains(n))return void n.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),a}(c.Component);return function(e){return Object(c.createElement)(C,null,(function(r){return Object(c.createElement)(t,{childProps:e,focus:r})}))}}}),"withFocusReturn");var N=Object(v.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(i,t);var r,n,o=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function i(){var e;return Object(p.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(k.a)(e)),e}return Object(f.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===O.TAB){var t=g.focus.tabbable.find(this.focusContainRef.current);if(t.length){var r=t[0],n=t[t.length-1];e.shiftKey&&e.target===r?(e.preventDefault(),n.focus()):(e.shiftKey||e.target!==n)&&t.includes(e.target)||(e.preventDefault(),r.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),i}(c.Component)}),"withConstrainedTabbing"),D=r(89);var M=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){return Object(p.a)(this,o),n.apply(this,arguments)}return Object(f.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(c.Component),A=Object(D.a)(M);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Object(b.a)(this,r)}}var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,r=void 0===t?document:t,n=e.className,o=void 0===n?"lockscroll":n,i=0,a=0;function u(e){var t=r.scrollingElement||r.body;e&&(a=t.scrollTop);var n=e?"add":"remove";t.classList[n](o),r.documentElement.classList[n](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){Object(d.a)(r,e);var t=F(r);function r(){return Object(p.a)(this,r),t.apply(this,arguments)}return Object(f.a)(r,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(c.Component)}();function B(e){e.stopPropagation()}var L=Object(c.forwardRef)((function(e,t){var r=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(n.a)({},i,{ref:t,onMouseDown:B}),r)})),z=r(47);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function W(e){var t=Object(c.useContext)(z.a),r=t.slots[e]||{},n=t.fills[e],o=Object(c.useMemo)((function(){return n||[]}),[n]),i=Object(c.useCallback)((function(r){t.updateSlot(e,r)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(r){t.unregisterSlot(e,r)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(r){t.registerFill(e,r)}),[e,t.registerFill]),s=Object(c.useCallback)((function(r){t.unregisterFill(e,r)}),[e,t.unregisterFill]);return U(U({},r),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Y(e,t,r){return(Y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}r(25);var q=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),V=(q.Provider,q.Consumer);c.Component;var G=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(k.a)(e)),e}return Object(f.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.name,n=t.unregisterSlot,o=t.registerSlot;e.name!==r&&(n(e.name),o(r,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Y(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.getFills,a=Object(u.map)(i(r,this),(function(e){var t=e.occurrence,r=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(r,(function(e,r){if(!e||Object(u.isString)(e))return e;var n="".concat(t,"---").concat(e.key||r);return Object(c.cloneElement)(e,{key:n})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),o}(c.Component),K=function(e){return Object(c.createElement)(V,null,(function(t){var r=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(G,Object(n.a)({},e,{registerSlot:r,unregisterSlot:o,getFills:i}))}))},Q=0;function J(e){var t=e.name,r=e.children,n=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(q),r=t.getSlot,n=t.subscribe,o=Object(c.useState)(r(e)),i=Object(h.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(r(e)),n((function(){u(r(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:r});return a.current.occurrence||(a.current.occurrence=++Q),Object(c.useLayoutEffect)((function(){return n(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=r,i&&i.forceUpdate()}),[r]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,n(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(r)&&(r=r(i.props.fillProps)),Object(c.createPortal)(r,i.node)):null}var X=function(e){return Object(c.createElement)(V,null,(function(t){var r=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(J,Object(n.a)({},e,{registerFill:r,unregisterFill:o}))}))};function $(e){var t=e.name,r=e.fillProps,i=void 0===r?{}:r,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(z.a),p=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,p,i),function(){l.unregisterSlot(t,p)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(n.a)({ref:p},s))}function Z(e){var t,r,n=e.name,o=e.children,i=W(n),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),r=Object(h.a)(t,2)[1],function(){return r({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ee(e){var t=e.bubblesVirtually,r=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)($,r):Object(c.createElement)(K,r)}function te(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(X,e),Object(c.createElement)(Z,e))}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e){var t=e.type,r=e.origin,n=void 0===r?function(e){return"appear"===e?"top":"left"}(t):r;if("appear"===t){var o,c=n.split(" "),i=Object(h.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(w.a)(o,"is-from-"+l,"center"!==l),Object(w.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):"loading"===t?a()("components-animate__loading"):void 0}function ce(e){var t=e.type,r=e.options,n=void 0===r?{}:r;return(0,e.children)({className:oe(ne({type:t},n))})}var ie=N(T((function(e){return e.children})));function ae(e,t){var r,n=(r=t).ownerDocument.defaultView.getComputedStyle(r),o=n.paddingTop,c=n.paddingBottom,i=n.paddingLeft,a=n.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,p=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-p,height:e.height-u-s,left:e.left+l,right:e.right-p,top:e.top+u,bottom:e.bottom-s}}function ue(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==r&&(e.style[t]=r)}function le(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var pe=function(e){var t=e.headerTitle,r=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,p=e.noArrow,f=void 0===p||p,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,w=(e.range,e.focusOnMount),j=void 0===w?"firstElement":w,R=e.anchorRef,k=e.shouldAnchorIncludePadding,P=e.anchorRect,S=e.getAnchorRect,C=e.expandOnMobile,T=e.animate,N=void 0===T||T,D=e.onClickOutside,M=e.onFocusOutside,F=e.__unstableSticky,B=e.__unstableSlotName,z=void 0===B?"Popover":B,H=e.__unstableObserveElement,U=e.__unstableBoundaryParent,Y=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),V=Object(c.useRef)(null),G=Object(c.useRef)(),K=Object(v.useViewportMatch)("medium","<"),Q=Object(c.useState)(),J=Object(h.a)(Q,2),X=J[0],$=J[1],Z=W(z),ee=C&&K,re=Object(v.useResizeObserver)(),ne=Object(h.a)(re,2),oe=ne[0],pe=ne[1];f=ee||f,Object(c.useLayoutEffect)((function(){if(ee)return le(G.current,"is-without-arrow",f),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis"),ue(G.current,"data-y-axis"),se(G.current,"top"),se(G.current,"left"),se(V.current,"maxHeight"),void se(V.current,"maxWidth");var e=function(){if(G.current&&V.current){var e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(r){if(!e.current)return;return r(e.current)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if(n instanceof window.Range)return Object(g.getRectangleFromRange)(n);if(n instanceof window.Element){var c=n.getBoundingClientRect();return o?c:ae(c,n)}var i=n.top,a=n.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ae(l,n)}if(e.current){var p=e.current.parentNode,f=p.getBoundingClientRect();return o?f:ae(f,p)}}(q,P,S,R,k);if(e){var t,r,n=G.current,o=n.offsetParent,c=n.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}U&&(t=null===(r=G.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);var u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=r.split(" "),u=Object(h.a)(a,3),s=u[0],l=u[1],p=void 0===l?"center":l,f=u[2],d=x(e,t,s,f,n,o,c),b=_(e,t,p,f,n,d.yAxis,i);return E(E({},b),d)}(e,pe.height?pe:V.current.getBoundingClientRect(),m,F,G.current,i,t),s=u.popoverTop,l=u.popoverLeft,p=u.xAxis,b=u.yAxis,O=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(se(G.current,"top",s+"px"),se(G.current,"left",l+"px")),le(G.current,"is-without-arrow",f||"center"===p&&"middle"===b),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis",p),ue(G.current,"data-y-axis",b),se(V.current,"maxHeight","number"==typeof O?O+"px":""),se(V.current,"maxWidth","number"==typeof v?v+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,r,n=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),H&&(r=new window.MutationObserver(e)).observe(H,{attributes:!0}),function(){window.clearInterval(n),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),r&&r.disconnect()}}),[ee,P,S,R,k,m,pe,F,H,U]),function(e,t){Object(c.useEffect)((function(){var r=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var r=g.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,V);var fe=function(e){e.keyCode===O.ESCAPE&&r&&(e.stopPropagation(),r()),i&&i(e)},de=Object(c.createElement)(A,{onFocusOutside:function(e){if(M)M(e);else if(D){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),D(t)}else r&&r()}},Object(c.createElement)(ce,{type:N&&X?"appear":null,options:{origin:X}},(function(e){var o=e.className;return Object(c.createElement)(L,Object(n.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":f,"is-alternate":d})},Y,{onKeyDown:fe,ref:G}),ee&&Object(c.createElement)(I,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Oe,{className:"components-popover__close",icon:y.a,onClick:r})),Object(c.createElement)("div",{ref:V,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},oe,u)))})));return j&&(de=Object(c.createElement)(ie,null,de)),Z.ref&&(de=Object(c.createElement)(te,{name:z},de)),R||P?de:Object(c.createElement)("span",{ref:q},de)};pe.Slot=function(e){var t=e.name,r=void 0===t?"Popover":t;return Object(c.createElement)(ee,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var fe=pe,de=function(e){var t,r,n=e.shortcut,o=e.className;return n?(Object(u.isString)(n)&&(t=n),Object(u.isObject)(n)&&(t=n.display,r=n.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":r},t)):null};var be=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=n.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(f.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var r=this.props.children;if(1===c.Children.count(r)){var n=c.Children.only(r);"function"==typeof n.props[e]&&n.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var r=this;return function(n){if(r.emitToChild(e,n),!(n.currentTarget.disabled||"focus"===n.type&&r.isInMouseDown)){r.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],n.type);o!==r.state.isOver&&(t?r.delayedSetIsOver(o):r.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(r){t.emitToChild(e?"onMouseDown":"onMouseUp",r),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.position,n=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(fe,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(c.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(c.Component),me=r(91);function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ge=["onMouseDown","onClick"],Oe=t.a=Object(c.forwardRef)((function(e,t){var r=e.href,i=e.target,s=e.isPrimary,p=e.isSmall,f=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,g=e.isLink,O=e.isDestructive,v=e.className,y=e.disabled,w=e.icon,j=e.iconSize,E=e.showTooltip,_=e.tooltipPosition,x=e.shortcut,R=e.label,k=e.children,P=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",v,{"is-secondary":m||h,"is-primary":s,"is-small":p,"is-tertiary":f,"is-pressed":d,"is-busy":b,"is-link":g,"is-destructive":O,"has-text":!!w&&!!k,"has-icon":!!w}),T=y&&!P,N=void 0===r||T?"button":"a",D="a"===N?{href:r,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(y&&P){D["aria-disabled"]=!0;var M,A=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return he(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?he(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw c}}}}(ge);try{for(A.s();!(M=A.n()).done;)S[M.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){A.e(e)}finally{A.f()}}var F=!T&&(E&&R||x||!!R&&(!k||Object(u.isArray)(k)&&!k.length)&&!1!==E),I=Object(c.createElement)(N,Object(n.a)({},D,S,{className:C,"aria-label":S["aria-label"]||R,ref:t}),w&&Object(c.createElement)(me.a,{icon:w,size:j}),k);return F?Object(c.createElement)(be,{text:R,shortcut:x,position:_},I):I}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},,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 a})),r.d(t,"m",(function(){return u})),r.d(t,"i",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return b})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return h})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return O}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(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),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=r(2),u=r(1),s=r(49);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),d=function(e){var 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(u.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},b=Object.entries(f).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},o=n[e]||{},c=t[e]||{};return p(p(p({key:e},r),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(12),o=r(15),c=r(16),i=r(13),a=r(17),u=r(18),s=r(9),l=r(0),p=r(7),f=r(24);var d=["button","submit"];t.a=Object(f.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,f,b=(r=m,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(s.a)(r);if(f){var n=Object(s.a)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Object(u.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=b.apply(this,arguments)).bindNode=e.bindNode.bind(Object(i.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(i.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(i.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(i.a)(e)),e}return Object(c.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,r=e.target;Object(p.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(p.includes)(d,e.type)}return!1}(r)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(n.a)({ref:this.bindNode},this.props)))}}]),m}(l.Component)}),"withFocusOutside")},function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return m}));var n=r(5),o=r.n(n),c=r(8),i=r(11),a=r(0),u=r(25),s=r.n(u),l=r(53),p=r(99),f=r(64),d=function(e){var t=Object(f.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(a.useCallback)((function(t){n(e,t)}),[e,n])]},b=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},m=function(e,t){var r=Object(f.a)(),n=d(t=t||r),c=o()(n,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(p.a)(m),g=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),g.current=!0)}),[b,m,h,u]),g.current?[i,u]:[e,u]}},function(e,t,r){"use strict";var n=r(20),o=r(12),c=r(19),i=r(0),a=r(34),u=function(e){var t=e.icon,r=e.className,n=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,r].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},n))};function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.icon,r=void 0===t?null:t,n=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof r)return Object(i.createElement)(u,Object(o.a)({icon:r},s));if(r&&u===r.type)return Object(i.cloneElement)(r,l({},s));var p=n||24;if("function"==typeof r)return r.prototype instanceof i.Component?Object(i.createElement)(r,l({size:p},s)):r(l({size:p},s));if(r&&("svg"===r.type||r.type===a.SVG)){var f=l(l({width:p,height:p},r.props),s);return Object(i.createElement)(a.SVG,f)}return Object(i.isValidElement)(r)?Object(i.cloneElement)(r,l({size:p},s)):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r.n(n),c=function(e){return e.reduce((function(e,t){var r=o()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return u}));var n=r(2),o=r(87),c=r(72),i=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,o=void 0===n?"":n,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:r.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(c.isEmail)(r)?r.trim():""},u=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(o.a)(t,{},e.country),c=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(n,e)&&(c[n]="")})),c}},,,,function(e,t){e.exports=window.wp.autop},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){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 i}));var n=r(5),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},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 a(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 u,s=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?s=u.concat(s):p=-1,s.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=s.length;t;){for(u=s,s=[];++p<t;)u&&u[p].run();p=-1,t=s.length}u=null,l=!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 b(e,t){this.fun=e,this.array=t}function m(){}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];s.push(new b(e,t)),1!==s.length||l||a(d)},b.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=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,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,"b",(function(){return w})),r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=(r(10),r(0)),u=r(11),s=r(52),l=r(36),p=r(14),f=r.n(p),d=r(6),b=r.n(d),m=r(153),h=(r(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,o=r.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,f()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice",h(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=Object(a.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(a.useContext)(y)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,o=e.createNoticeContainer,c=void 0===o||o,p=e.context,f=void 0===p?"wc/core":p,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),O=i()(h,2),w=O[0],j=O[1],E=Object(s.a)().dispatchStoreEvent,_=Object(l.a)().isEditor,x=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,v(v({},r),{},{context:r.context||f})),E("store-notice-create",{status:e,content:t,options:r})}),[b,E,f]),R=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;m(e,t)}),[m,f]),k={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(f)}}),[f]).notices,createNotice:x,removeNotice:R,context:f,setIsSuppressed:j},P=w?null:React.createElement(g,{className:n,notices:k.notices,removeNotice:k.removeNotice,isEditor:_});return React.createElement(y.Provider,{value:k},c&&P,t)}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),c=r(4),i=r.n(c),a=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){return{}}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=s(e,r),p=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},d=function(e){var t,r,n,o,c,i,a,u=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:u}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,i=t.wrappers,a=document.body.querySelectorAll(c),i.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),f({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(u,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,i,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,i=r.selector,a=r.wrapper.querySelectorAll(i),f({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(0),i=(r(142),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(c.useRef)(null);return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),React.createElement(e,o()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var o=n[0];i(o),null==o||o.focus()}else i(e)}(t,n):i(t)))}})))}}},,function(e,t,r){"use strict";var n=r(0),o=r(34),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";r.d(t,"a",(function(){return u}));var n=r(8),o=r(11),c=r(0),i=r(53),a=r(100),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,d=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(p),h=Object(i.a)(s),g=Object(a.a)(),O=Object(o.useSelect)((function(e){if(!d)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,h],i=o.getCollectionError.apply(o,c);return i&&g(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,h,m,d]);return null!==O&&(b.current=O),b.current}},,,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(8),c=r(11),i=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(i.n.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,i=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,,,,,,,,,function(e,t){},,,,,,,,,,function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(23),i=r.n(c),a=r(0),u=["srcElement","size"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},function(e,t,r){"use strict";var n=r(0),o=r(7),c=r(6),i=r.n(c),a=r(1),u=r(33),s=r(116),l=r(76);t.a=function(e){var t=e.className,r=e.status,c=void 0===r?"info":r,p=e.children,f=e.spokenMessage,d=void 0===f?p:f,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,g=void 0===h||h,O=e.actions,v=void 0===O?[]:O,y=e.politeness,w=void 0===y?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):y,j=e.__unstableHTML;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(u.speak)(r,t)}),[r,t])}(d,w);var E=i()(t,"components-notice","is-"+c,{"is-dismissible":g});return j&&(p=Object(n.createElement)(n.RawHTML,null,p)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},p,v.map((function(e,t){var r=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,p=e.url;return Object(n.createElement)(l.a,{key:t,href:p,isPrimary:c,isSecondary:!u&&!p,isLink:!u&&!!p,onClick:p?void 0:s,className:i()("components-notice__action",r)},o)}))),g&&Object(n.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,function(e,t,r){"use strict";r(10);var n=r(6),o=r.n(n),c=r(51),i=r(24);r(196),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.label,i=e.onChange,a=e.options,u=e.screenReaderLabel,s=e.readOnly,l=e.value,p="wc-block-components-sort-select__select-".concat(r);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.a,{label:n,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:s,value:l},a.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(38),o=r(0),c=r(83);r.p=c.k,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([r.e(1),r.e(12)]).then(r.bind(null,387))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return r.e(11).then(r.bind(null,416))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return r.e(19).then(r.bind(null,409))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return r.e(13).then(r.bind(null,388))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return r.e(9).then(r.bind(null,389))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return r.e(17).then(r.bind(null,390))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return r.e(14).then(r.bind(null,354))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return r.e(15).then(r.bind(null,391))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return r.e(10).then(r.bind(null,392))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return r.e(18).then(r.bind(null,393))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return r.e(16).then(r.bind(null,394))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return Promise.all([r.e(0),r.e(50),r.e(8)]).then(r.bind(null,403))}))});var i=function(e){return Object(n.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,,,,function(e,t,r){e.exports=r(313)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(103),c=r(107),i=r(40),a=r.n(i),u=r(41),s=r.n(u),l=r(42),p=r.n(l),f=r(43),d=r.n(f),b=r(30),m=r.n(b),h=r(3),g=(r(10),r(5)),O=r.n(g),v=r(0),y=r(23),w=r.n(y),j=r(4),E=r.n(j),_=r(1),x=r(7),R=r(6),k=r.n(R),P=r(51),S=(r(287),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var 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}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=r&&Boolean(1!==u),p=r&&Boolean(s!==i),f=r&&Boolean(u>3),d=r&&Boolean(s<i-2);l&&3===u&&(u-=1),p&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(P.a,{screenReaderLabel:Object(_.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return c(t-1)},title:Object(_.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(P.a,{label:"←",screenReaderLabel:Object(_.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:k()("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:function(){return c(1)},disabled:1===t},React.createElement(P.a,{label:1,screenReaderLabel:Object(_.sprintf)(
4
  /* translators: %d is the page number (1, 2, 3...). */
5
  Object(_.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(_.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:k()("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?null:function(){return c(e)},disabled:t===e},React.createElement(P.a,{label:e,screenReaderLabel:Object(_.sprintf)(
6
  /* translators: %d is the page number (1, 2, 3...). */
build/all-products.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', '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-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '066e2c5e4885fee718bab60e9348fd12');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', '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-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '90c2a1e8d28242947d631286b5835b1e');
build/all-products.js CHANGED
@@ -1,29 +1,29 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=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,l||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var l=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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="",a.oe=function(e){throw console.error(e),e};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 u=s;return o.push([785,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(8),c=r.n(n),o=r(24),a=r(14),i=r(0),s=r(34),l=r.n(s),u=r(62),b=r(136),p=r(78),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(u.a)(a),m=Object(u.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){l()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},11:function(e,t){e.exports=window.React},113:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(3),s=r(1),l=r(72);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(i.getSetting)("countryLocale",{}),d=function(e){var 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(s.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(l.a)(e.priority)&&(t.index=e.priority),Object(l.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},f=Object.entries(p).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return b(b(b({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},123:function(e,t){},124:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(53),s=r(6),l=r.n(s),u=(r(2),r(47)),b=(r(206),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,s=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
4
  /* translators: %1$s min price, %2$s max price */
5
- Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(u.formatPrice)(n),Object(u.formatPrice)(r))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(i.a,{className:l()("wc-block-components-product-price__value",c),currency:t,value:n,style:s})," — ",Object(o.createElement)(i.a,{className:l()("wc-block-components-product-price__value",c),currency:t,value:r,style:s})))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,u=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:l()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:l()("wc-block-components-product-price__value","is-discounted",s),style:u},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,u=e.maxPrice,d=void 0===u?null:u,f=e.minPrice,m=void 0===f?null:f,O=e.price,g=void 0===O?null:O,j=e.priceClassName,h=e.priceStyle,v=e.regularPrice,w=e.regularPriceClassName,y=e.regularPriceStyle,E=l()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var _=v&&g!==v,k=Object(o.createElement)("span",{className:l()("wc-block-components-product-price__value",j)});return _?k=Object(o.createElement)(p,{currency:n,price:g,priceClassName:j,priceStyle:h,regularPrice:v,regularPriceClassName:w,regularPriceStyle:y}):null!==m&&null!==d?k=Object(o.createElement)(b,{currency:n,maxPrice:d,minPrice:m,priceClassName:j,priceStyle:h}):null!==g&&(k=Object(o.createElement)(i.a,{className:l()("wc-block-components-product-price__value",j),currency:n,value:g,style:h})),Object(o.createElement)("span",{className:E},Object(o.createInterpolateElement)(s,{price:k}))}},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(7);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var l={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},u={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,l=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:l,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(8),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},131:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(49),l=r(4),u=r(6),b=r.n(u),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,u=e.onSelect,d=e.disabled,f=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},f,{key:r.id,className:t,isSelected:n,item:r,onSelect:u,isSingle:!0,disabled:d})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(l.Spinner,null)))}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(37),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),l=r(8),u=r.n(l),b=r(0),p=r(7),d=r(34),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},v=function(e){var t=e.children,r=Object(b.useState)({}),n=u()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),l=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),v=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),w={getValidationError:i,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(b.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:l};return Object(b.createElement)(j.Provider,{value:w},t)}},133:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(19),s=r.n(i),l=r(20),u=r.n(l),b=r(10),p=r.n(b),d=r(0),f=r(7),m=r(1),O=r(4);function g(e){var t=e.level,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(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}var j=function(e){s()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=p()(t);if(r){var c=p()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return u()(this,e)});function o(){return c()(this,o),n.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),
6
  /* translators: %s: heading level e.g: "2", "3", "4" */
7
- title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),o}(d.Component);t.a=j},136:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(11);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return y}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(14)),l=r(68),u=r(63),b=r(9),p=r.n(b),d=r(6),f=r.n(d),m=r(890),O=(r(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(i.useContext)(v)},y=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),w=j[0],y=j[1],E=Object(l.a)().dispatchStoreEvent,_=Object(u.b)().isEditor,k=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,h(h({},r),{},{context:r.context||p})),E("store-notice-create",{status:e,content:t,options:r})}),[f,E,p]),P=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,removeNotice:P,context:p,setIsSuppressed:y},S=w?null:Object(i.createElement)(g,{className:n,notices:C.notices,removeNotice:C.removeNotice,isEditor:_});return Object(i.createElement)(v.Provider,{value:C},o&&S,t)}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(8),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},143:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(66),a=r(158),i=r(3),s=r(12),l=r(45);t.a=function(e){var t=(Object(l.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},149:function(e,t,r){"use strict";var n=r(33),c=r.n(n),o=r(5),a=r.n(o),i=r(9),s=r.n(i),l=r(0),u=r(1),b=r(7),p=(r(2),r(49)),d=r(21),f=r(17),m=r.n(f),O=r(18),g=r.n(O),j=r(19),h=r.n(j),v=r(20),w=r.n(v),y=r(10),E=r.n(y);var _=Object(d.createHigherOrderComponent)((function(e){var t=function(t){h()(o,t);var r,n,c=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E()(r);if(n){var c=E()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return w()(this,e)});function o(){return m()(this,o),c.apply(this,arguments)}return g()(o,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(l.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),o}(l.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),k=r(302),P=r(29),C=r.n(P),S=r(13),x=r.n(S),N=r(22),D=r.n(N),B=r(34),R=r.n(B),T=r(39),A=r(42);function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=Object(d.createHigherOrderComponent)((function(e){var t=function(t){h()(o,t);var r,n,c=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E()(r);if(n){var c=E()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return w()(this,e)});function o(){var e;m()(this,o);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(T.g)(o).then((function(t){var r=t.map((function(e){return L(L({},e),{},{parent:o})}));e.setState({variations:L(L({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=C()(D.a.mark((function t(r){var n;return D.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(A.a)(r);case 2:n=t.sent,e.setState({variations:L(L({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({variations:L(L({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(o,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!R()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(l.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),o}(l.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),V=r(52),F=r(6),M=r.n(F),H=r(131);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(214);var Q={list:Object(u.__)("Products","woo-gutenberg-products-block"),noItems:Object(u.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(u.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(u.__)("Product search results updated.","woo-gutenberg-products-block")},Y=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,h=e.variationsLoading;if(r)return Object(l.createElement)(V.a,{error:r});var v=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(v));return Object(l.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=M()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(l.createElement)(H.a,s()({},e,{className:M()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||h,countLabel:t.variations.length>0?Object(u.sprintf)(
8
  /* translators: %1$d is the number of variations of a product product. */
9
- Object(u.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(u.sprintf)(
10
  /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
11
- Object(u._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)}));var O=Object(b.isEmpty)(t.variation)?e:G(G({},e),{},{item:G(G({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(l.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))}:null),onSearch:d,messages:Q,isHierarchical:!0})};Y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=_(Object(k.a)(z(Object(d.withInstanceId)(Y))))},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},154:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(25),l=r(6),u=r.n(l),b=(r(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,l=e.name,p=e.permalink,d=void 0===p?"":p,f=a()(e,b),m=u()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:m},f,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(l)}})):Object(i.createElement)("a",c()({className:m,href:d},f,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(l)}}))}},155:function(e,t,r){"use strict";var n=r(0),c=r(119),o=r(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},l=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},u=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var l=a.match(/([\s]+)/g),u=l?l.length:0,b=c.slice(0,t+u);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?l(s,t):u(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},156:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,c=e.label,i=e.onChange,s=e.options,l=e.screenReaderLabel,u=e.readOnly,b=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.a,{label:c,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:u,value:b},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},158:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(26),c=r(38),o=function(e,t){if(c.n>2)return Object(n.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(n.registerBlockType)(e,t)},i=function(){return c.n>2},s=function(){return c.n>1}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(3),c=r(113),o=r(23),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},165:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(24),c=r(14),o=r(0),a=r(62),i=r(127),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,l=void 0===s?[]:s,u=e.query,b=void 0===u?{}:u,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(l),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},175:function(e,t){},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=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"}))},191:function(e,t){e.exports=window.wp.warning},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},214:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,l=Object(c.b)(),u=l.getValidationError,b=l.getValidationErrorId;if(!r||"string"!=typeof r){var p=u(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},277:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),a=(r(362),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(o.useRef)(null);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(o.createElement)(e,c()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var c=n[0];a(c),null==c||c.focus()}else a(e)}(t,n):a(t)))}})))}}},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(29),a=r.n(o),i=r(8),s=r.n(i),l=r(16),u=r.n(l),b=r(0),p=r(22),d=r.n(p),f=r(38),m=r(39),O=r(222),g=r(42),j=["selected"];t.a=function(e){return function(t){var r=t.selected,n=u()(t,j),o=Object(b.useState)(!0),i=s()(o,2),l=i[0],p=i[1],h=Object(b.useState)(null),v=s()(h,2),w=v[0],y=v[1],E=Object(b.useState)([]),_=s()(E,2),k=_[0],P=_[1],C=f.o.productCount>100,S=function(){var e=a()(d.a.mark((function e(t){var r;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(g.a)(t);case 2:r=e.sent,y(r),p(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(b.useEffect)((function(){Object(m.h)({selected:r}).then((function(e){P(e),p(!1)})).catch(S)}),[r]);var x=Object(O.a)((function(e){Object(m.h)({selected:r,search:e}).then((function(e){P(e),p(!1)})).catch(S)}),400),N=s()(x,1)[0],D=Object(b.useCallback)((function(e){p(!0),N(e)}),[p,N]);return Object(b.createElement)(e,c()({},n,{selected:r,error:w,products:k,isLoading:l,onSearch:C?D:null}))}}},303:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},304:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(6),s=r.n(i),l=r(41),u=r(45),b=r(86);r(557),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(u.useInnerBlockLayoutContext)().parentClassName,i=Object(u.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(l.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},31:function(e,t){e.exports=window.moment},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(37),c=r.n(n),o=r(29),a=r.n(o),i=r(22),s=r.n(i),l=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},u=r(50);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,u,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=l(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((u=i.n()).done){e.next=19;break}return p=u.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=l(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(u.a)(f)&&!Object(u.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},361:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.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=o},362:function(e,t){},372:function(e,t){},373:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(159);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.b)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},374:function(e,t,r){"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}}},375:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(8),s=r.n(i),l=r(0),u=(r(2),r(1)),b=r(6),p=r.n(b),d=r(3),f=r(45),m=r(86),O=r(68),g=r(304);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(558);var v=function(){return Object(l.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},w=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,u=i.src,b=i.srcset,p=i.sizes,d=h({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:u,srcSet:b,sizes:p});return Object(l.createElement)(l.Fragment,null,d.src&&Object(l.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(l.createElement)(v,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.showProductLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,y=Object(l.useState)(!1),E=s()(y,2),_=E[0],k=E[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(l.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(l.createElement)(v,null));var C=!!j.images.length,S=C?j.images[0]:null,x=o?"a":l.Fragment,N=Object(u.sprintf)(
12
  /* translators: %s is referring to the product name */
13
- Object(u.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=h(h({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":N}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(l.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(l.createElement)(x,o&&D,!!i&&Object(l.createElement)(g.default,{align:d,product:j}),Object(l.createElement)(w,{fallbackAlt:j.name,image:S,onLoad:function(){return k(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},376:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},377:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(8),i=r.n(a),s=r(1),l=r(62),u=r(879),b={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},p=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},d=r(5),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g="idle",j=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=b;break;case"set_idle":e=t.status!==g?O(O({},t),{},{status:g}):t;break;case"set_disabled":e="disabled"!==t.status?O(O({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?O(O({},t),{},{quantity:n}):t;break;case"set_request_params":e=O(O({},t),{},{requestParams:O(O({},t.requestParams),o)});break;case"set_processing_response":e=O(O({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?O(O({},t),{},{status:"processing",hasError:!1}):t).hasError?e:O(O({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?O(O({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?O(O({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:O(O({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?O(O({},e),{},{status:g}):e;break;case"set_no_error":e=t.hasError?O(O({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=g),e},h=r(126),v=r(321),w=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(v.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(v.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(v.a)("add_to_cart_before_processing",e)}},y=r(322),E=r(132),_=r(59),k=r(50),P=Object(n.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:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(n.useContext)(P)},S=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(j,b),a=i()(o,2),d=a[0],f=a[1],m=Object(n.useReducer)(h.b,{}),O=i()(m,2),g=O[0],v=O[1],C=Object(l.a)(g),S=Object(_.a)(),x=S.addErrorNotice,N=S.removeNotices,D=Object(E.b)().setValidationErrors,B=Object(k.c)(),R=B.isSuccessResponse,T=B.isErrorResponse,A=B.isFailResponse,I=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:w(v).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:w(v).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:w(v).onAddToCartBeforeProcessing}}),[v]),L=Object(n.useMemo)((function(){return{resetForm:function(){f({type:"set_pristine"})},submitForm:function(){f({type:"set_before_processing"})},setQuantity:function(e){f(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){f(p(e))},setRequestParams:function(e){f(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){f({type:"set_processing_response",data:e}),f({type:"set_after_processing"})}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(u.a)(r);"disabled"!==e||t?"disabled"!==e&&t&&f({type:"set_disabled"}):f({type:"set_idle"})}),[d.status,r,f]),Object(n.useEffect)((function(){"before_processing"===d.status&&(N("error"),Object(y.a)(C,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&x(t),r&&D(r)})),f({type:"set_idle"})):f({type:"set_processing"})})))}),[d.status,D,x,N,f,C]),Object(n.useEffect)((function(){if("after_processing"===d.status){var e={processingResponse:d.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(T(e)||A(e))&&r&&(t=!0,x(r,n?{context:n}:void 0))})),t};if(d.hasError)return void Object(y.b)(C,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");x(c,{id:"add-to-cart"})}f({type:"set_idle"})}));Object(y.b)(C,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?f(p(!0)):f({type:"set_idle"})}))}}),[d.status,d.hasError,d.processingResponse,L,x,T,A,R,C]);var z=Object(u.b)(r),V={product:r,productType:r.type||"simple",productIsPurchasable:Object(u.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:z,showFormElements:c&&z,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:"idle"===d.status,isDisabled:"disabled"===d.status,isProcessing:"processing"===d.status,isBeforeProcessing:"before_processing"===d.status,isAfterProcessing:"after_processing"===d.status,hasError:d.hasError,eventRegistration:I,dispatchActions:L};return Object(n.createElement)(P.Provider,{value:V},t)},x=r(15),N=r.n(x),D=r(25),B=r(43);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var T=function(){var e=C(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,l=e.isProcessing,u=e.requestParams,b=Object(E.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,m=Object(_.a)(),O=m.addErrorNotice,g=m.removeNotice,j=Object(B.a)().receiveCart,h=Object(n.useState)(!1),v=i()(h,2),w=v[0],y=v[1],k=!a&&l,P=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[o,P]);var S=Object(n.useCallback)((function(){y(!0),g("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},u);N()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){N.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?O(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,O,g,j,t,c,u]);return Object(n.useEffect)((function(){k&&!w&&S()}),[k,S,w]),null},A=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(E.a,null,Object(n.createElement)(S,{product:r,showFormElements:c},t,Object(n.createElement)(T,null)))},I=r(45),L=r(7),z=r(86),V=(r(372),r(90)),F=r(66),M=r(567),H=r(68),q=r(788),G=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(V.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},Q=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(V.a,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(
14
  /* translators: %s number of products in cart. */
15
- Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(F.a,{srcElement:M.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Y=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,l=e.isDisabled,u=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(I.useInnerBlockLayoutContext)().parentName,m=Object(H.a)().dispatchStoreEvent,O=Object(q.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),h=j[0],v=j[1],w=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||v(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Q,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:l,isProcessing:u,isDone:h,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(G,{className:"wc-block-components-product-add-to-cart-button",href:w.url,text:w.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},U=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},W=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},K=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(W,null):t.id&&!t.is_in_stock?Object(n.createElement)(W,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(U,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Y,null))},$=(r(566),r(33)),J=r.n($),X=r(897),Z=r(11),ee=r(234),te={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},re=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,l=e.onChange,u=void 0===l?function(){}:l,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(E.b)(),m=d.getValidationError,O=d.setValidationErrors,g=d.clearValidationError,j=t,h=m(j)||{};return Object(Z.useEffect)((function(){i?g(j):O(f()({},j,{message:p,hidden:!0}))}),[i,j,p,g,O]),Object(Z.useEffect)((function(){return function(){g(j)}}),[j,g]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(X.a,{label:Object(D.decodeEntities)(t),value:i||"",options:[te].concat(J()(c)),onChange:u,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(ee.a,{propertyName:j,elementId:j}))};function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oe=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var se=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(l.a)(t),a=Object(l.a)(r),s=Object(n.useState)(0),u=i()(s,2),b=u[0],p=u[1],d=Object(n.useState)({}),m=i()(d,2),O=m[0],g=m[1],j=Object(n.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=ce(ce({},r),{},f()({},c,null)),s=o?oe(e,t,i):null,l=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,l)})),n}(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return oe(e,t,r)[0]||0}(o,a,O)):b>0&&p(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(re,{key:e,attributeName:e,options:j[e],value:O[e],onChange:function(t){g(ie(ie({},O),{},f()({},e,t)))}})})))},le=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(L.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(se,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},ue=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(W,null):t.id&&!t.is_in_stock?Object(n.createElement)(W,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(le,{product:t,dispatchers:a}),Object(n.createElement)(U,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Y,null))},be=function(){return Object(n.createElement)(Y,null)},pe=r(891),de=function(){return Object(n.createElement)(pe.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},fe=function(){return Object(n.createElement)(de,null)},me=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(ue,null):"grouped"===r?Object(n.createElement)(fe,null):"external"===r?Object(n.createElement)(be,null):"simple"===r||"variation"===r?Object(n.createElement)(K,null):null:Object(n.createElement)(Y,null)};t.a=Object(z.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(I.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(L.isEmpty)(c)});return Object(n.createElement)(A,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(me,null)))}))},378:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(45),l=r(12),u=r(159),b=function(e){var t=e.color,r=e.fontSize;return Object(u.b)()?{color:t,fontSize:r}:{}},p=r(86),d=r(154),f=r(68);r(556),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.showProductLink,g=void 0===O||O,j=e.align,h=e.color,v=e.customColor,w=e.fontSize,y=e.customFontSize,E=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,k=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(l.getColorClassName)("color",h),S=Object(l.getFontSizeClass)(w),x=i()((t={"has-text-color":h||v,"has-font-size":w||y},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(E,"__product-title"),E),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(u.b)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},x,Object(u.b)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:v,fontSize:y}),onClick:function(){k("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(E,"__product-title"),E),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(u.b)()),c()(n,x,Object(u.b)()),n)),style:b({color:v,fontSize:y})})}))},38:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),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 u})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return d})),r.d(t,"c",(function(){return f})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return O})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return j})),r.d(t,"b",(function(){return h}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,l=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),f=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),m=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),g=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),h=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return v})),r.d(t,"a",(function(){return w}));var n=r(5),c=r.n(n),o=r(23),a=r(15),i=r.n(a),s=r(7),l=r(3),u=r(38);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,l=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=u.o.productCount>100,l={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},l),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===a?{}:a});return Promise.all(l.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(l.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},h=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},w=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,u=null!=r,b=null!=n;return!u&&b?(t=c||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,u&&b&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(29),c=r.n(n),o=r(22),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(8),c=r.n(n),o=r(5),a=r.n(o),i=r(7),s=r(0),l=r(24),u=r(14),b=r(25),p=r(142),d=r(162),f=r(63);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},j=O(O({},g),{},{email:""}),h={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:l.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},w={cartCoupons:l.EMPTY_CART_COUPONS,cartItems:l.EMPTY_CART_ITEMS,cartFees:l.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:l.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:l.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:g,shippingRates:l.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:l.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:l.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=null==n?void 0:n.previewCart,o=e.shouldSelect,a=Object(s.useRef)(),b=Object(u.useSelect)((function(e,t){var n=t.dispatch;if(!o)return w;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:l.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:l.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:g,extensions:l.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(l.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),u=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(l.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),h=i.needsShipping?v(i.shippingAddress):m,y=i.fees.length>0?i.fees.map((function(e){return v(e)})):l.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):l.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:u,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},45:function(e,t){e.exports=window.wc.wcBlocksSharedContext},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},48:function(e,t){e.exports=window.wp.escapeHtml},482:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(124),l=r(47),u=r(45),b=r(12),p=r(159),d=r(86);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,h=e.customFontSize,v=e.saleFontSize,w=e.customSaleFontSize,y=e.color,E=e.customColor,_=e.saleColor,k=e.customSaleColor,P=Object(u.useInnerBlockLayoutContext)().parentClassName,C=Object(u.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var x=Object(b.getColorClassName)("color",y),N=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(v),R=i()((t={"has-text-color":y||E,"has-font-size":j||h},c()(t,x,x),c()(t,N,N),t)),T=i()((r={"has-text-color":_||k,"has-font-size":v||w},c()(r,D,D),c()(r,B,B),r)),A={color:E,fontSize:h},I={color:k,fontSize:w},L=C.prices,z=Object(l.getCurrencyFromPriceResponse)(L),V=L.price!==L.regular_price,F=V?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,T,Object(p.b)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.b)()),a)),M=V?I:A;return Object(o.createElement)(s.a,{align:g,className:S,currency:z,price:L.price,priceClassName:F,priceStyle:Object(p.b)()?M:{},minPrice:null==L||null===(d=L.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==L||null===(f=L.price_range)||void 0===f?void 0:f.max_amount,regularPrice:L.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.b)()),m)),regularPriceStyle:Object(p.b)()?A:{}})}))},483:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(6),s=r.n(i),l=r(45),u=r(86),b=(r(559),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(u.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product,i=b(n);if(!i)return null;var u={width:i/5*100+"%"},p=Object(a.sprintf)(
16
  /* translators: %f is referring to the average rating value */
17
- Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:u},p)))}))},484:function(e,t,r){"use strict";r.r(t);var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=(r(2),r(6)),l=r.n(s),u=r(1),b=r(68),p=r(788),d=r(25),f=r(45),m=r(86),O=(r(560),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,h=O.addToCart,v=Number.isFinite(g)&&g>0,w=!a&&s&&f,y=Object(d.decodeEntities)((null==o?void 0:o.description)||""),E=v?Object(u.sprintf)(
18
  /* translators: %s number of products in cart. */
19
- Object(u._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(u.__)("Add to cart","woo-gutenberg-products-block")),_=w?"button":"a",k={};return w?k.onClick=function(){h(),m("cart-add-item",{product:t})}:(k.href=n,k.rel="nofollow",k.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":y,className:l()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:v}),disabled:j},k),E)}),g=function(){return Object(i.createElement)("button",{className:l()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:l()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},486:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(155),l=r(38),u=r(45),b=r(86);r(561),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:l.o.wordCountType||"words"}):null}))},487:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),l=r(45),u=r(86);r(562),t.default=Object(u.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},488:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),l=r(45),u=r(7),b=r(86);r(563),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;return Object(u.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},489:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),l=r(45),u=r(7),b=r(86);r(564),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;return Object(u.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},490:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),l=r(45),u=r(86),b=(r(565),function(e){return Object(a.sprintf)(
20
  /* translators: %d stock amount (number of items in stock for product) */
21
- Object(a.__)("%d left in stock","woo-gutenberg-products-block"),e)});t.default=Object(u.withProductDataContext)((function(e){var t,r=e.className,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.is_purchasable)return null;var u=!!i.is_in_stock,p=i.low_stock_remaining,d=i.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",u),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!u),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!p),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},p?b(p):function(e,t){return t?Object(a.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(a.__)("In Stock","woo-gutenberg-products-block"):Object(a.__)("Out of Stock","woo-gutenberg-products-block")}(u,d))}))},50: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 b}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},l=function(e){return a(e,n.FAIL)},u=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:u,isSuccessResponse:i,isErrorResponse:s,isFailResponse:l}}},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},53:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),l=r(0),u=r(166),b=r(6),p=r.n(b),d=(r(175),["className","value","currency","onValueChange","displayType"]);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,b=s()(e,d),f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),j=m(m(m({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),h=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(l.createElement)(u.a,c()({className:g,displayType:i},j,{value:O,onValueChange:h}))}},55:function(e,t){e.exports=window.wp.hooks},556:function(e,t){},557:function(e,t){},558:function(e,t){},559:function(e,t){},56:function(e,t){e.exports=window.wp.deprecated},560:function(e,t){},561:function(e,t){},562:function(e,t){},563:function(e,t){},564:function(e,t){},565:function(e,t){},566:function(e,t){},567:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},59:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(0),a=r(141);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,i=Object(o.useRef)(t);Object(o.useEffect)((function(){i.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),u=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},l),u),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(14),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,l=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),u=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:l,previewData:s,getPreviewData:u};return Object(n.createElement)(o.Provider,{value:b},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(55),a=r(0),i=r(43);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),l(l({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(37),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function s(e,t){return i(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},757:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},764:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},772:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},773:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(38),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("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:c.m+"previews/pennant.jpg",thumbnail:c.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,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(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},778:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider},785:function(e,t,r){e.exports=r(852)},786:function(e,t){},787:function(e,t){},788:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(8),c=r.n(n),o=r(0),a=r(14),i=r(24),s=r(25),l=r(43),u=r(59),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(l.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(u.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],h=g[1],v=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==v.current&&(v.current=t)}),[n,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},789:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(n.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(n.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(n.createElement)("path",{fill:"currentColor",d:"M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"})));t.a=o},790:function(e,t){},791:function(e,t){},792:function(e,t){},793:function(e,t){},852:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Br}));var n=r(5),c=r.n(n),o=r(9),a=r.n(o),i=r(0),s=r(1),l=r(12),u=r(26),b=r(66),p=r(28),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(159),m=r(6),O=r.n(m),g={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.a)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},deprecated:[{save:function(){}}]},j=r(373),h=r(4),v=r(21),w=r(133),y=r(378),E=r(8),_=r.n(E),k=r(149),P=r(16),C=r.n(P),S=(r(787),["className"]),x=function(e){var t=e.className,r=void 0===t?"":t,n=C()(e,S),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},N=r(45),D=(r(786),function(e){return function(t){return function(r){var n=Object(N.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,u=Object(i.useState)(!a),b=_()(u,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(k.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(x,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),R=Object(s.__)("Product Title","woo-gutenberg-products-block"),T=Object(i.createElement)(b.a,{srcElement:B}),A=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),I=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,u=o.headingLevel,b=o.showProductLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:u,onChange:function(e){return a({headingLevel:e})}}),Object(f.b)()&&Object(i.createElement)(l.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({showProductLink:!b})}})),Object(f.b)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(l.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(l.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(y.a,o)))},L=Object(f.b)()?Object(v.compose)([Object(l.withFontSizes)("fontSize"),Object(l.withColors)("color",{textColor:"color"}),D({icon:T,label:R,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(I):I;function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F={title:R,description:A,icon:{src:T,foreground:"#874FB9"},attributes:j.a,edit:L};Object(u.registerBlockType)("woocommerce/product-title",V(V({},g),F));var M=r(482),H=r(303),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),G=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),Y=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(l.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},U=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,u=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.b)()&&Object(i.createElement)(l.BlockControls,null,Object(i.createElement)(l.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(l.InspectorControls,null,Object(f.b)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(Y,{color:o,setColor:u,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(Y,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},W=Object(f.b)()?Object(v.compose)([Object(l.withFontSizes)("fontSize"),Object(l.withFontSizes)("saleFontSize"),Object(l.withFontSizes)("originalFontSize"),Object(l.withColors)("color",{textColor:"color"}),Object(l.withColors)("saleColor",{textColor:"saleColor"}),Object(l.withColors)("originalColor",{textColor:"originalColor"}),D({icon:G,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(U):U;function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J={productId:{type:"number",default:0}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.b)()&&(J=$($({},J),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var ee={title:q,description:Q,icon:{src:G,foreground:"#874FB9"},attributes:J,edit:W};Object(u.registerBlockType)("woocommerce/product-price",Z(Z({},g),ee));var te=r(374),re=r(88),ne=r(3),ce=r(375),oe=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),ae=Object(s.__)("Product Image","woo-gutenberg-products-block"),ie=Object(i.createElement)(b.a,{srcElement:oe}),se=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),le=D({icon:ie,label:ae,description:Object(s.__)("Choose a product to display its image.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=t.showProductLink,c=t.imageSizing,o=t.showSaleBadge,a=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({showProductLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(re.a,{label:Object(s.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(s.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(s.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(s.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(re.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(i.createInterpolateElement)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(ne.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(s.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ce.a,t)))}));function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe={title:ae,description:se,icon:{src:ie,foreground:"#874FB9"},attributes:te.a,edit:le};Object(u.registerBlockType)("woocommerce/product-image",be(be({},g),pe));var de=r(483),fe=r(772),me=Object(s.__)("Product Rating","woo-gutenberg-products-block"),Oe=Object(i.createElement)(b.a,{srcElement:fe.a});function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he={title:me,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:Oe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Oe,label:me,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(de.default,t)}))};Object(u.registerBlockType)("woocommerce/product-rating",je(je({},g),he));var ve=r(484),we=r(361),ye=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Ee=Object(i.createElement)(b.a,{srcElement:we.a});function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pe={title:ye,description:Object(s.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:Ee,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ee,label:ye,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ve.default,t))}))};Object(u.registerBlockType)("woocommerce/product-button",ke(ke({},g),Pe));var Ce=r(486),Se=r(789),xe=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ne=Object(i.createElement)(b.a,{srcElement:Se.a});function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Re={title:xe,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ne,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ne,label:xe,description:Object(s.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Ce.default,t)}))};Object(u.registerBlockType)("woocommerce/product-summary",Be(Be({},g),Re));var Te=r(304),Ae=r(764),Ie=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),Le=Object(i.createElement)(b.a,{srcElement:Ae.a});function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fe={title:Ie,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Le,foreground:"#874FB9"},supports:{html:!1},attributes:{productId:{type:"number",default:0}},edit:D({icon:Le,label:Ie,description:Object(s.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Te.default,t)}))};Object(u.registerBlockType)("woocommerce/product-sale-badge",Ve(Ve({},g),Fe));var Me=r(143),He=r(487),qe=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Ge=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Qe=Object(i.createElement)(b.a,{srcElement:qe});function Ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var We={title:Ge,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Qe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Qe,label:Ge,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(He.default,t))}))};Object(f.c)("woocommerce/product-sku",Ue(Ue({},g),We));var Ke=r(488),$e=r(757),Je=Object(s.__)("Product Category List","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e.a});function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt={title:Je,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:Xe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Xe,label:Je,description:Object(s.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ke.default,t)))}))};Object(f.c)("woocommerce/product-category-list",et(et({},g),tt));var rt=r(489),nt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),ct=Object(i.createElement)(b.a,{srcElement:Ae.a});function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it={title:nt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:ct,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:ct,label:nt,description:Object(s.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.c)("woocommerce/product-tag-list",at(at({},g),it));var st=r(490),lt=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),ut=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),bt=Object(i.createElement)(b.a,{srcElement:lt});function pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ft={title:ut,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:bt,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:bt,label:ut,description:Object(s.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(st.default,t))}))};Object(f.c)("woocommerce/product-stock-indicator",dt(dt({},g),ft));var mt=r(879),Ot=(r(372),r(377)),gt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),jt=Object(i.createElement)(b.a,{srcElement:we.a});function ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wt={title:gt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:jt,foreground:"#874FB9"},edit:D({icon:jt,label:gt,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(N.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(Me.a,{productId:n.id}),Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(mt.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("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(i.createElement)(h.Disabled,null,Object(i.createElement)(Ot.a,t)))})),attributes:r(376).a};Object(f.c)("woocommerce/product-add-to-cart",vt(vt({},g),wt));var yt=r(17),Et=r.n(yt),_t=r(13),kt=r.n(_t),Pt=r(19),Ct=r.n(Pt),St=r(20),xt=r.n(St),Nt=r(10),Dt=r.n(Nt),Bt=r(14),Rt=(r(2),r(94)),Tt=r(877),At=r(773),It=r(38),Lt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},zt=r(158),Vt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:ne.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:zt.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Ft=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function Mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Gt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Ht(Ht({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ut=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:Yt(Yt({},r),{},{orderBy:!r.orderBy})})}})},Wt=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},Kt=r(18),$t=r.n(Kt),Jt=r(11),Xt=r(7),Zt=r(41),er=(r(793),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,l=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),u=l.minIndex,b=l.maxIndex,p=r&&Boolean(1!==u),d=r&&Boolean(b!==a),f=r&&Boolean(u>3),m=r&&Boolean(b<a-2);p&&3===u&&(u-=1),d&&b===a-2&&(b+=1);var g=[];if(u&&b)for(var j=u;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(Zt.a,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return o(t-1)},title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(Zt.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("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:function(){return o(1)},disabled:1===t},Object(i.createElement)(Zt.a,{label:1,screenReaderLabel:Object(s.sprintf)(
22
  /* translators: %d is the page number (1, 2, 3...). */
23
  Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("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?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(Zt.a,{label:e,screenReaderLabel:Object(s.sprintf)(
24
  /* translators: %d is the page number (1, 2, 3...). */
25
  Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("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:function(){return o(a)},disabled:t===a},Object(i.createElement)(Zt.a,{label:a,screenReaderLabel:Object(s.sprintf)(
26
  /* translators: %d is the page number (1, 2, 3...). */
27
- Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return o(t+1)},title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(Zt.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});er.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var tr=er,rr=r(136),nr=r(108),cr=r(165),or=r(24),ar=r(62);function ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ir(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var lr=r(68),ur=r(277),br=r(64),pr=r(150),dr=function(){var e=Object(N.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:pr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},fr=r(778),mr=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(N.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:fr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},Or=r(156),gr=(r(792),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return Object(i.createElement)(Or.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",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")}],readOnly:r,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:n})}),jr=Object(v.withInstanceId)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(N.useInnerBlockLayoutContext)(),s=o.parentClassName,l=o.parentName,u=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"wc-block-layout",{"is-loading":u});return Object(i.createElement)("li",{className:b,"aria-hidden":u},function e(t,r,n,c){if(n){var o=Object(Tt.a)(t);return n.map((function(n,s){var l=_()(n,2),u=l[0],b=l[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[u];if(!f)return null;var m=r.id||0,O=["layout",u,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(l,t,c,n))})),hr=(r(791),["order","orderby","page","per_page"]);function vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(Xt.isEqual)(t,c)&&Number.isFinite(r)},Er=Object(ur.a)((function(e){var t,r=e.attributes,n=e.currentPage,c=e.onPageChange,o=e.onSortChange,a=e.sortValue,l=e.scrollToTop,u=Object(nr.b)("attributes",[]),b=_()(u,2),p=b[0],d=b[1],f=Object(nr.b)("stock_status",[]),m=_()(f,2),g=m[0],j=m[1],h=Object(nr.b)("min_price"),v=_()(h,2),w=v[0],y=v[1],E=Object(nr.b)("max_price"),k=_()(E,2),P=k[0],S=k[1],x=Object(nr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return wr(wr({},function(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"}}}(t)),{},{catalog_visibility:"catalog",per_page:c*o,page:r})}({attributes:r,sortValue:a,currentPage:n})),D=_()(x,1)[0],B=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(cr.a)(sr(sr({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var s=Object(ar.a)(i),l=Object(ar.a)(o),u=Object(Bt.useSelect)((function(e){var t=e(or.COLLECTIONS_STORE_KEY),c=["x-wp-total",r,n,s,l];return{value:t.getCollectionHeader.apply(t,c),isLoading:t.hasFinishedResolution("getCollectionHeader",c)}}),["x-wp-total",r,n,l,s]),b=u.value,p=u.isLoading;return{value:b,isLoading:void 0===p||p}}(0,sr(sr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}}(D),R=B.products,T=B.totalProducts,A=B.productsLoading,I=Object(N.useInnerBlockLayoutContext)(),L=I.parentClassName,z=I.parentName,V=((t=D).order,t.orderby,t.page,t.per_page,C()(t,hr)||{}),F=Object(lr.a)().dispatchStoreEvent,M=Object(rr.a)({totalQuery:V,totalProducts:T},yr);Object(i.useEffect)((function(){F("product-list-render",{products:R,listName:z})}),[R,z,F]),Object(i.useEffect)((function(){Object(Xt.isEqual)(V,null==M?void 0:M.totalQuery)||(c(1),null!=M&&M.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(br.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(br.speak)(Object(s.sprintf)(
28
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
29
- Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(T))}),[null==M?void 0:M.totalQuery,T,c,V]);var H,q,G,Q,Y,U=r.contentVisibility,W=r.columns*r.rows,K=!Number.isFinite(T)&&Number.isFinite(null==M?void 0:M.totalProducts)&&Object(Xt.isEqual)(V,null==M?void 0:M.totalQuery)?Math.ceil(M.totalProducts/W):Math.ceil(T/W),$=R.length?R:Array.from({length:W}),J=0!==R.length||A,X=p.length>0||g.length>0||Number.isFinite(w)||Number.isFinite(P);return Object(i.createElement)("div",{className:(H=r.columns,q=r.rows,G=r.alignButtons,Q=r.align,Y=void 0!==Q?"align"+Q:"",O()(L,Y,"has-"+H+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":G}))},U.orderBy&&J&&Object(i.createElement)(gr,{onChange:o,value:a}),!J&&X&&Object(i.createElement)(mr,{resetCallback:function(){d([]),j([]),y(null),S(null)}}),!J&&!X&&Object(i.createElement)(dr,null),J&&Object(i.createElement)("ul",{className:"".concat(L,"__products")},$.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(jr,{key:e.id||t,attributes:r,product:e})}))),K>1&&Object(i.createElement)(tr,{currentPage:n,onPageChange:function(e){l({focusableSelector:"a, button"}),c(e)},totalPages:K}))})),_r=function(e){var t=e.attributes,r=Object(i.useState)(1),n=_()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),s=_()(a,2),l=s[0],u=s[1];return Object(i.useEffect)((function(){u(t.orderby)}),[t.orderby]),Object(i.createElement)(Er,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;u(t),o(1)},sortValue:l})},kr=r(188);var Pr=function(e){Ct()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Dt()(t);if(r){var c=Dt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return xt()(this,e)});function c(){return Et()(this,c),n.apply(this,arguments)}return $t()(c,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?kr.a:Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(_r,{attributes:t,urlParameterSuffix:r}))}}]),c}(Jt.Component);r(790);var Cr=function(e){Ct()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Dt()(t);if(r){var c=Dt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return xt()(this,e)});function o(){var e;Et()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),c()(kt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(kt()(e),"blockMap",Object(Tt.a)("woocommerce/all-products")),c()(kt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(kt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(kt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(kt()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(kt()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(l.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Rt.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(ne.getSetting)("min_columns",1),maxColumns:Object(ne.getSetting)("max_columns",6),minRows:Object(ne.getSetting)("min_rows",1),maxRows:Object(ne.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},Ut(r,n),Wt(r,n)))})),c()(kt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(l.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(kt()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(N.ProductDataContextProvider,{product:At.a[0]},Object(i.createElement)(l.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Gt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];qt.map((function(e){var t=_()(e,2),r=t[0],n=t[1];return c.push(Object(u.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(kt()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Pr,{attributes:t})):Ft(c,o)})),c()(kt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===It.o.productCount?Vt(n,c):Object(i.createElement)("div",{className:Lt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return o}(i.Component),Sr=Object(v.compose)(h.withSpokenMessages,Object(Bt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Bt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Cr),xr={columns:Object(ne.getSetting)("default_columns",3),rows:Object(ne.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:qt,isPreview:!1};function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Br={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("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:xr,edit:function(e){return Object(i.createElement)(Sr,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Lt("wc-block-all-products",t)},n),Object(i.createElement)(l.InnerBlocks.Content,null))}};Object(u.registerBlockType)("woocommerce/all-products",Dr(Dr({},Br),{},{deprecated:[{attributes:Object.assign({},Br.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Lt("wc-block-all-products",t)},r),Object(i.createElement)(l.InnerBlocks.Content,null))}}]}))},86:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},87:function(e,t){e.exports=window.ReactDOM},877:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(60),c=r(0),o=r(38);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,482))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,901))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,902))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,483))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,484))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,486))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,304))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,487))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,488))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,489))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,490))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,903))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},879:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},88:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(17),a=r.n(o),i=r(18),s=r.n(i),l=r(13),u=r.n(l),b=r(19),p=r.n(b),d=r(20),f=r.n(d),m=r(10),O=r.n(m),g=r(0),j=r(7),h=r(6),v=r.n(h),w=r(4),y=r(21);r(123);var E=function(e){p()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O()(t);if(r){var c=O()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return f()(this,e)});function o(){var e;return a()(this,o),(e=n.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(w.BaseControl,{id:b,help:e,className:v()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var o={};return u===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),o}(g.Component);t.a=Object(y.withInstanceId)(E)},89:function(e,t){e.exports=window.wp.viewport},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(182),l=r(6),u=r.n(l),b=r(114),p=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,l=a()(e,p),d=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:d},l),n&&Object(i.createElement)(b.a,null),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop},94:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),a=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,l=e.minColumns,u=void 0===l?1:l,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,u,p);i({columns:Number.isNaN(t)?"":t})},min:u,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},97:function(e,t){e.exports=window.wp.date}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([785,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(8),c=r.n(n),o=r(24),a=r(14),i=r(0),s=r(34),u=r.n(s),l=r(62),b=r(136),p=r(78),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},11:function(e,t){e.exports=window.React},113:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(3),s=r(1),u=r(72);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(i.getSetting)("countryLocale",{}),d=function(e){var 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(s.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},f=Object.entries(p).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return b(b(b({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},123:function(e,t){},124:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(53),s=r(6),u=r.n(s),l=(r(2),r(47)),b=(r(206),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,s=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
4
  /* translators: %1$s min price, %2$s max price */
5
+ Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(n),Object(l.formatPrice)(r))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:s})))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,l=e.maxPrice,d=void 0===l?null:l,f=e.minPrice,m=void 0===f?null:f,O=e.price,g=void 0===O?null:O,j=e.priceClassName,h=e.priceStyle,v=e.regularPrice,w=e.regularPriceClassName,y=e.regularPriceStyle,E=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var _=v&&g!==v,k=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",j)});return _?k=Object(o.createElement)(p,{currency:n,price:g,priceClassName:j,priceStyle:h,regularPrice:v,regularPriceClassName:w,regularPriceStyle:y}):null!==m&&null!==d?k=Object(o.createElement)(b,{currency:n,maxPrice:d,minPrice:m,priceClassName:j,priceStyle:h}):null!==g&&(k=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",j),currency:n,value:g,style:h})),Object(o.createElement)("span",{className:E},Object(o.createInterpolateElement)(s,{price:k}))}},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(7);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(8),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},131:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(49),u=r(4),l=r(6),b=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,d=e.disabled,f=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},f,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:d})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(38),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(8),l=r.n(u),b=r(0),p=r(7),d=r(34),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},v=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),v=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),w={getValidationError:i,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(b.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:w},t)}},133:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(19),s=r.n(i),u=r(20),l=r.n(u),b=r(10),p=r.n(b),d=r(0),f=r(7),m=r(1),O=r(4);function g(e){var t=e.level,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(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}var j=function(e){s()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=p()(t);if(r){var c=p()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return l()(this,e)});function o(){return c()(this,o),n.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),
6
  /* translators: %s: heading level e.g: "2", "3", "4" */
7
+ title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),o}(d.Component);t.a=j},136:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(11);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return y}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(14)),u=r(68),l=r(63),b=r(9),p=r.n(b),d=r(6),f=r.n(d),m=r(890),O=(r(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(i.useContext)(v)},y=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),w=j[0],y=j[1],E=Object(u.a)().dispatchStoreEvent,_=Object(l.b)().isEditor,k=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,h(h({},r),{},{context:r.context||p})),E("store-notice-create",{status:e,content:t,options:r})}),[f,E,p]),P=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,removeNotice:P,context:p,setIsSuppressed:y},S=w?null:Object(i.createElement)(g,{className:n,notices:C.notices,removeNotice:C.removeNotice,isEditor:_});return Object(i.createElement)(v.Provider,{value:C},o&&S,t)}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(8),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},143:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(66),a=r(158),i=r(3),s=r(12),u=r(45);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},149:function(e,t,r){"use strict";var n=r(33),c=r.n(n),o=r(5),a=r.n(o),i=r(9),s=r.n(i),u=r(0),l=r(1),b=r(7),p=(r(2),r(49)),d=r(21),f=r(17),m=r.n(f),O=r(18),g=r.n(O),j=r(19),h=r.n(j),v=r(20),w=r.n(v),y=r(10),E=r.n(y);var _=Object(d.createHigherOrderComponent)((function(e){var t=function(t){h()(o,t);var r,n,c=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E()(r);if(n){var c=E()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return w()(this,e)});function o(){return m()(this,o),c.apply(this,arguments)}return g()(o,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),o}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),k=r(302),P=r(29),C=r.n(P),S=r(13),x=r.n(S),N=r(22),D=r.n(N),B=r(34),R=r.n(B),T=r(39),A=r(42);function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=Object(d.createHigherOrderComponent)((function(e){var t=function(t){h()(o,t);var r,n,c=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E()(r);if(n){var c=E()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return w()(this,e)});function o(){var e;m()(this,o);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(T.g)(o).then((function(t){var r=t.map((function(e){return L(L({},e),{},{parent:o})}));e.setState({variations:L(L({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=C()(D.a.mark((function t(r){var n;return D.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(A.a)(r);case 2:n=t.sent,e.setState({variations:L(L({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({variations:L(L({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(o,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!R()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),o}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),V=r(52),F=r(6),M=r.n(F),H=r(131);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(214);var Q={list:Object(l.__)("Products","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(l.__)("Product search results updated.","woo-gutenberg-products-block")},Y=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,h=e.variationsLoading;if(r)return Object(u.createElement)(V.a,{error:r});var v=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(v));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=M()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(H.a,s()({},e,{className:M()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||h,countLabel:t.variations.length>0?Object(l.sprintf)(
8
  /* translators: %1$d is the number of variations of a product product. */
9
+ Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
10
  /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
11
+ Object(l._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)}));var O=Object(b.isEmpty)(t.variation)?e:G(G({},e),{},{item:G(G({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))}:null),onSearch:d,messages:Q,isHierarchical:!0})};Y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=_(Object(k.a)(z(Object(d.withInstanceId)(Y))))},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},154:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(25),u=r(6),l=r.n(u),b=(r(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,p=e.permalink,d=void 0===p?"":p,f=a()(e,b),m=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:m},f,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}})):Object(i.createElement)("a",c()({className:m,href:d},f,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}},155:function(e,t,r){"use strict";var n=r(0),c=r(119),o=r(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},156:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,c=e.label,i=e.onChange,s=e.options,u=e.screenReaderLabel,l=e.readOnly,b=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.a,{label:c,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:l,value:b},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},158:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(26),c=r(37),o=function(e,t){if(c.n>2)return Object(n.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(n.registerBlockType)(e,t)},i=function(){return c.n>2},s=function(){return c.n>1}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(3),c=r(113),o=r(23),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},165:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(24),c=r(14),o=r(0),a=r(62),i=r(127),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},175:function(e,t){},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=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"}))},191:function(e,t){e.exports=window.wp.warning},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},214:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r||"string"!=typeof r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},277:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),a=(r(362),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(o.useRef)(null);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(o.createElement)(e,c()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var c=n[0];a(c),null==c||c.focus()}else a(e)}(t,n):a(t)))}})))}}},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(29),a=r.n(o),i=r(8),s=r.n(i),u=r(16),l=r.n(u),b=r(0),p=r(22),d=r.n(p),f=r(37),m=r(39),O=r(222),g=r(42),j=["selected"];t.a=function(e){return function(t){var r=t.selected,n=l()(t,j),o=Object(b.useState)(!0),i=s()(o,2),u=i[0],p=i[1],h=Object(b.useState)(null),v=s()(h,2),w=v[0],y=v[1],E=Object(b.useState)([]),_=s()(E,2),k=_[0],P=_[1],C=f.o.productCount>100,S=function(){var e=a()(d.a.mark((function e(t){var r;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(g.a)(t);case 2:r=e.sent,y(r),p(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(b.useEffect)((function(){Object(m.h)({selected:r}).then((function(e){P(e),p(!1)})).catch(S)}),[r]);var x=Object(O.a)((function(e){Object(m.h)({selected:r,search:e}).then((function(e){P(e),p(!1)})).catch(S)}),400),N=s()(x,1)[0],D=Object(b.useCallback)((function(e){p(!0),N(e)}),[p,N]);return Object(b.createElement)(e,c()({},n,{selected:r,error:w,products:k,isLoading:u,onSearch:C?D:null}))}}},303:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},304:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(6),s=r.n(i),u=r(41),l=r(45),b=r(86);r(557),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},31:function(e,t){e.exports=window.moment},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(38),c=r.n(n),o=r(29),a=r.n(o),i=r(22),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},361:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.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=o},362:function(e,t){},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),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 u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return d})),r.d(t,"c",(function(){return f})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return O})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return j})),r.d(t,"b",(function(){return h}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),f=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),m=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),g=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),h=Object(c.getSetting)("allowedStates",{})},372:function(e,t){},373:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(159);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.b)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},374:function(e,t,r){"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}}},375:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(8),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(6),p=r.n(b),d=r(3),f=r(45),m=r(86),O=r(68),g=r(304);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(558);var v=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},w=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=h({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(v,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.showProductLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,y=Object(u.useState)(!1),E=s()(y,2),_=E[0],k=E[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(v,null));var C=!!j.images.length,S=C?j.images[0]:null,x=o?"a":u.Fragment,N=Object(l.sprintf)(
12
  /* translators: %s is referring to the product name */
13
+ Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=h(h({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":N}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(x,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(w,{fallbackAlt:j.name,image:S,onLoad:function(){return k(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},376:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},377:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(8),i=r.n(a),s=r(1),u=r(62),l=r(879),b={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},p=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},d=r(5),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g="idle",j=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=b;break;case"set_idle":e=t.status!==g?O(O({},t),{},{status:g}):t;break;case"set_disabled":e="disabled"!==t.status?O(O({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?O(O({},t),{},{quantity:n}):t;break;case"set_request_params":e=O(O({},t),{},{requestParams:O(O({},t.requestParams),o)});break;case"set_processing_response":e=O(O({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?O(O({},t),{},{status:"processing",hasError:!1}):t).hasError?e:O(O({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?O(O({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?O(O({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:O(O({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?O(O({},e),{},{status:g}):e;break;case"set_no_error":e=t.hasError?O(O({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=g),e},h=r(126),v=r(321),w=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(v.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(v.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(v.a)("add_to_cart_before_processing",e)}},y=r(322),E=r(132),_=r(59),k=r(50),P=Object(n.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:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(n.useContext)(P)},S=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(j,b),a=i()(o,2),d=a[0],f=a[1],m=Object(n.useReducer)(h.b,{}),O=i()(m,2),g=O[0],v=O[1],C=Object(u.a)(g),S=Object(_.a)(),x=S.addErrorNotice,N=S.removeNotices,D=Object(E.b)().setValidationErrors,B=Object(k.c)(),R=B.isSuccessResponse,T=B.isErrorResponse,A=B.isFailResponse,I=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:w(v).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:w(v).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:w(v).onAddToCartBeforeProcessing}}),[v]),L=Object(n.useMemo)((function(){return{resetForm:function(){f({type:"set_pristine"})},submitForm:function(){f({type:"set_before_processing"})},setQuantity:function(e){f(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){f(p(e))},setRequestParams:function(e){f(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){f({type:"set_processing_response",data:e}),f({type:"set_after_processing"})}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(l.a)(r);"disabled"!==e||t?"disabled"!==e&&t&&f({type:"set_disabled"}):f({type:"set_idle"})}),[d.status,r,f]),Object(n.useEffect)((function(){"before_processing"===d.status&&(N("error"),Object(y.a)(C,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&x(t),r&&D(r)})),f({type:"set_idle"})):f({type:"set_processing"})})))}),[d.status,D,x,N,f,C]),Object(n.useEffect)((function(){if("after_processing"===d.status){var e={processingResponse:d.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(T(e)||A(e))&&r&&(t=!0,x(r,n?{context:n}:void 0))})),t};if(d.hasError)return void Object(y.b)(C,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");x(c,{id:"add-to-cart"})}f({type:"set_idle"})}));Object(y.b)(C,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?f(p(!0)):f({type:"set_idle"})}))}}),[d.status,d.hasError,d.processingResponse,L,x,T,A,R,C]);var z=Object(l.b)(r),V={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:z,showFormElements:c&&z,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:"idle"===d.status,isDisabled:"disabled"===d.status,isProcessing:"processing"===d.status,isBeforeProcessing:"before_processing"===d.status,isAfterProcessing:"after_processing"===d.status,hasError:d.hasError,eventRegistration:I,dispatchActions:L};return Object(n.createElement)(P.Provider,{value:V},t)},x=r(15),N=r.n(x),D=r(25),B=r(43);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var T=function(){var e=C(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(E.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,m=Object(_.a)(),O=m.addErrorNotice,g=m.removeNotice,j=Object(B.a)().receiveCart,h=Object(n.useState)(!1),v=i()(h,2),w=v[0],y=v[1],k=!a&&u,P=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[o,P]);var S=Object(n.useCallback)((function(){y(!0),g("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);N()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){N.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?O(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,O,g,j,t,c,l]);return Object(n.useEffect)((function(){k&&!w&&S()}),[k,S,w]),null},A=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(E.a,null,Object(n.createElement)(S,{product:r,showFormElements:c},t,Object(n.createElement)(T,null)))},I=r(45),L=r(7),z=r(86),V=(r(372),r(90)),F=r(66),M=r(567),H=r(68),q=r(788),G=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(V.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},Q=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(V.a,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(
14
  /* translators: %s number of products in cart. */
15
+ Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(F.a,{srcElement:M.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Y=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(I.useInnerBlockLayoutContext)().parentName,m=Object(H.a)().dispatchStoreEvent,O=Object(q.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),h=j[0],v=j[1],w=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||v(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Q,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(G,{className:"wc-block-components-product-add-to-cart-button",href:w.url,text:w.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},U=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},W=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},K=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(W,null):t.id&&!t.is_in_stock?Object(n.createElement)(W,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(U,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Y,null))},$=(r(566),r(33)),J=r.n($),X=r(897),Z=r(11),ee=r(234),te={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},re=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(E.b)(),m=d.getValidationError,O=d.setValidationErrors,g=d.clearValidationError,j=t,h=m(j)||{};return Object(Z.useEffect)((function(){i?g(j):O(f()({},j,{message:p,hidden:!0}))}),[i,j,p,g,O]),Object(Z.useEffect)((function(){return function(){g(j)}}),[j,g]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(X.a,{label:Object(D.decodeEntities)(t),value:i||"",options:[te].concat(J()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(ee.a,{propertyName:j,elementId:j}))},ne=r(72);function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ae=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ue=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),m=i()(d,2),O=m[0],g=m[1],j=Object(n.useState)(!1),h=i()(j,2),v=h[0],w=h[1],y=Object(n.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=oe(oe({},r),{},f()({},c,null)),s=o?ae(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){if(!v){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ne.b)(e))return{};var t=Object.keys(e),r={};return 0===t.length||t.forEach((function(t){var n,c=e[t],o=c.terms.filter((function(e){return e.default}));o.length>0&&(r[c.name]=null===(n=o[0])||void 0===n?void 0:n.slug)})),r}(t);e&&g(se({},e)),w(!0)}}),[O,t,v]),Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return ae(e,t,r)[0]||0}(o,a,O)):b>0&&p(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(re,{key:e,attributeName:e,options:y[e],value:O[e],onChange:function(t){g(se(se({},O),{},f()({},e,t)))}})})))},le=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(L.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(ue,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},be=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(W,null):t.id&&!t.is_in_stock?Object(n.createElement)(W,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(le,{product:t,dispatchers:a}),Object(n.createElement)(U,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Y,null))},pe=function(){return Object(n.createElement)(Y,null)},de=r(891),fe=function(){return Object(n.createElement)(de.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},me=function(){return Object(n.createElement)(fe,null)},Oe=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(be,null):"grouped"===r?Object(n.createElement)(me,null):"external"===r?Object(n.createElement)(pe,null):"simple"===r||"variation"===r?Object(n.createElement)(K,null):null:Object(n.createElement)(Y,null)};t.a=Object(z.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(I.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(L.isEmpty)(c)});return Object(n.createElement)(A,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(Oe,null)))}))},378:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(45),u=r(12),l=r(159),b=function(e){var t=e.color,r=e.fontSize;return Object(l.b)()?{color:t,fontSize:r}:{}},p=r(86),d=r(154),f=r(68);r(556),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.showProductLink,g=void 0===O||O,j=e.align,h=e.color,v=e.customColor,w=e.fontSize,y=e.customFontSize,E=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,k=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",h),S=Object(u.getFontSizeClass)(w),x=i()((t={"has-text-color":h||v,"has-font-size":w||y},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(E,"__product-title"),E),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.b)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},x,Object(l.b)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:v,fontSize:y}),onClick:function(){k("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(E,"__product-title"),E),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.b)()),c()(n,x,Object(l.b)()),n)),style:b({color:v,fontSize:y})})}))},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return v})),r.d(t,"a",(function(){return w}));var n=r(5),c=r.n(n),o=r(23),a=r(15),i=r.n(a),s=r(7),u=r(3),l=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===a?{}:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},h=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},w=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,b=null!=n;return!l&&b?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,l&&b&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(29),c=r.n(n),o=r(22),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(8),c=r.n(n),o=r(5),a=r.n(o),i=r(7),s=r(0),u=r(24),l=r(14),b=r(25),p=r(142),d=r(162),f=r(63);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},j=O(O({},g),{},{email:""}),h={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:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},w={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:g,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=null==n?void 0:n.previewCart,o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return w;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:g,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),h=i.needsShipping?v(i.shippingAddress):m,y=i.fees.length>0?i.fees.map((function(e){return v(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},45:function(e,t){e.exports=window.wc.wcBlocksSharedContext},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},48:function(e,t){e.exports=window.wp.escapeHtml},482:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(124),u=r(47),l=r(45),b=r(12),p=r(159),d=r(86);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,h=e.customFontSize,v=e.saleFontSize,w=e.customSaleFontSize,y=e.color,E=e.customColor,_=e.saleColor,k=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var x=Object(b.getColorClassName)("color",y),N=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(v),R=i()((t={"has-text-color":y||E,"has-font-size":j||h},c()(t,x,x),c()(t,N,N),t)),T=i()((r={"has-text-color":_||k,"has-font-size":v||w},c()(r,D,D),c()(r,B,B),r)),A={color:E,fontSize:h},I={color:k,fontSize:w},L=C.prices,z=Object(u.getCurrencyFromPriceResponse)(L),V=L.price!==L.regular_price,F=V?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,T,Object(p.b)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.b)()),a)),M=V?I:A;return Object(o.createElement)(s.a,{align:g,className:S,currency:z,price:L.price,priceClassName:F,priceStyle:Object(p.b)()?M:{},minPrice:null==L||null===(d=L.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==L||null===(f=L.price_range)||void 0===f?void 0:f.max_amount,regularPrice:L.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.b)()),m)),regularPriceStyle:Object(p.b)()?A:{}})}))},483:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(6),s=r.n(i),u=r(45),l=r(86),b=(r(559),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(
16
  /* translators: %f is referring to the average rating value */
17
+ Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},484:function(e,t,r){"use strict";r.r(t);var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=(r(2),r(6)),u=r.n(s),l=r(1),b=r(68),p=r(788),d=r(25),f=r(45),m=r(86),O=(r(560),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,h=O.addToCart,v=Number.isFinite(g)&&g>0,w=!a&&s&&f,y=Object(d.decodeEntities)((null==o?void 0:o.description)||""),E=v?Object(l.sprintf)(
18
  /* translators: %s number of products in cart. */
19
+ Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=w?"button":"a",k={};return w?k.onClick=function(){h(),m("cart-add-item",{product:t})}:(k.href=n,k.rel="nofollow",k.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":y,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:v}),disabled:j},k),E)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},486:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(155),u=r(37),l=r(45),b=r(86);r(561),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.o.wordCountType||"words"}):null}))},487:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(86);r(562),t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},488:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(7),b=r(86);r(563),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},489:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(7),b=r(86);r(564),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},490:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(86),b=(r(565),function(e){return Object(a.sprintf)(
20
  /* translators: %d stock amount (number of items in stock for product) */
21
+ Object(a.__)("%d left in stock","woo-gutenberg-products-block"),e)});t.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,i=Object(u.useProductDataContext)().product;if(!i.id||!i.is_purchasable)return null;var l=!!i.is_in_stock,p=i.low_stock_remaining,d=i.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",l),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!l),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!p),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},p?b(p):function(e,t){return t?Object(a.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(a.__)("In Stock","woo-gutenberg-products-block"):Object(a.__)("Out of Stock","woo-gutenberg-products-block")}(l,d))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},53:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(0),l=r(166),b=r(6),p=r.n(b),d=(r(175),["className","value","currency","onValueChange","displayType"]);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,b=s()(e,d),f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),j=m(m(m({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),h=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},j,{value:O,onValueChange:h}))}},55:function(e,t){e.exports=window.wp.hooks},556:function(e,t){},557:function(e,t){},558:function(e,t){},559:function(e,t){},56:function(e,t){e.exports=window.wp.deprecated},560:function(e,t){},561:function(e,t){},562:function(e,t){},563:function(e,t){},564:function(e,t){},565:function(e,t){},566:function(e,t){},567:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},59:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(0),a=r(141);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,i=Object(o.useRef)(t);Object(o.useEffect)((function(){i.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(14),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(55),a=r(0),i=r(43);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return o})),r.d(t,"d",(function(){return a}));var n=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function a(e,t){return o(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},757:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},764:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},772:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},773:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(37),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("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:c.m+"previews/pennant.jpg",thumbnail:c.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,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(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},778:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider},785:function(e,t,r){e.exports=r(852)},786:function(e,t){},787:function(e,t){},788:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(8),c=r.n(n),o=r(0),a=r(14),i=r(24),s=r(25),u=r(43),l=r(59),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],h=g[1],v=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==v.current&&(v.current=t)}),[n,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},789:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(n.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(n.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(n.createElement)("path",{fill:"currentColor",d:"M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"})));t.a=o},790:function(e,t){},791:function(e,t){},792:function(e,t){},793:function(e,t){},852:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Br}));var n=r(5),c=r.n(n),o=r(9),a=r.n(o),i=r(0),s=r(1),u=r(12),l=r(26),b=r(66),p=r(28),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(159),m=r(6),O=r.n(m),g={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},deprecated:[{attributes:{},save:function(){return null}}]},j=r(373),h=r(4),v=r(21),w=r(133),y=r(378),E=r(8),_=r.n(E),k=r(149),P=r(16),C=r.n(P),S=(r(787),["className"]),x=function(e){var t=e.className,r=void 0===t?"":t,n=C()(e,S),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},N=r(45),D=(r(786),function(e){return function(t){return function(r){var n=Object(N.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=_()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(k.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(x,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),R=Object(s.__)("Product Title","woo-gutenberg-products-block"),T=Object(i.createElement)(b.a,{srcElement:B}),A=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),I=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.showProductLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.b)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({showProductLink:!b})}})),Object(f.b)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(y.a,o)))},L=Object(f.b)()?Object(v.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:T,label:R,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(I):I;function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F={title:R,description:A,icon:{src:T,foreground:"#874FB9"},attributes:j.a,edit:L};Object(l.registerBlockType)("woocommerce/product-title",V(V({},g),F));var M=r(482),H=r(303),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),G=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),Y=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},U=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.b)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.b)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(Y,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(Y,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},W=Object(f.b)()?Object(v.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),D({icon:G,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(U):U;function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J={productId:{type:"number",default:0}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.b)()&&(J=$($({},J),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var ee={title:q,description:Q,icon:{src:G,foreground:"#874FB9"},attributes:J,edit:W};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},g),ee));var te=r(374),re=r(88),ne=r(3),ce=r(375),oe=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),ae=Object(s.__)("Product Image","woo-gutenberg-products-block"),ie=Object(i.createElement)(b.a,{srcElement:oe}),se=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),ue=D({icon:ie,label:ae,description:Object(s.__)("Choose a product to display its image.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=t.showProductLink,c=t.imageSizing,o=t.showSaleBadge,a=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({showProductLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(re.a,{label:Object(s.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(s.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(s.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(s.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(re.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(i.createInterpolateElement)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(ne.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(s.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ce.a,t)))}));function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe={title:ae,description:se,icon:{src:ie,foreground:"#874FB9"},attributes:te.a,edit:ue};Object(l.registerBlockType)("woocommerce/product-image",be(be({},g),pe));var de=r(483),fe=r(772),me=Object(s.__)("Product Rating","woo-gutenberg-products-block"),Oe=Object(i.createElement)(b.a,{srcElement:fe.a});function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he={title:me,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:Oe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Oe,label:me,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(de.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",je(je({},g),he));var ve=r(484),we=r(361),ye=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Ee=Object(i.createElement)(b.a,{srcElement:we.a});function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pe={title:ye,description:Object(s.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:Ee,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ee,label:ye,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ve.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",ke(ke({},g),Pe));var Ce=r(486),Se=r(789),xe=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ne=Object(i.createElement)(b.a,{srcElement:Se.a});function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Re={title:xe,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ne,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ne,label:xe,description:Object(s.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Ce.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Be(Be({},g),Re));var Te=r(304),Ae=r(764),Ie=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),Le=Object(i.createElement)(b.a,{srcElement:Ae.a});function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fe={title:Ie,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Le,foreground:"#874FB9"},supports:{html:!1},attributes:{productId:{type:"number",default:0}},edit:D({icon:Le,label:Ie,description:Object(s.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Te.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Ve(Ve({},g),Fe));var Me=r(143),He=r(487),qe=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Ge=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Qe=Object(i.createElement)(b.a,{srcElement:qe});function Ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var We={title:Ge,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Qe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Qe,label:Ge,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(He.default,t))}))};Object(f.c)("woocommerce/product-sku",Ue(Ue({},g),We));var Ke=r(488),$e=r(757),Je=Object(s.__)("Product Category List","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e.a});function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt={title:Je,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:Xe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Xe,label:Je,description:Object(s.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ke.default,t)))}))};Object(f.c)("woocommerce/product-category-list",et(et({},g),tt));var rt=r(489),nt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),ct=Object(i.createElement)(b.a,{srcElement:Ae.a});function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it={title:nt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:ct,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:ct,label:nt,description:Object(s.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.c)("woocommerce/product-tag-list",at(at({},g),it));var st=r(490),ut=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),lt=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),bt=Object(i.createElement)(b.a,{srcElement:ut});function pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ft={title:lt,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:bt,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:bt,label:lt,description:Object(s.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(st.default,t))}))};Object(f.c)("woocommerce/product-stock-indicator",dt(dt({},g),ft));var mt=r(879),Ot=(r(372),r(377)),gt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),jt=Object(i.createElement)(b.a,{srcElement:we.a});function ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wt={title:gt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:jt,foreground:"#874FB9"},edit:D({icon:jt,label:gt,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(N.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(Me.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(mt.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("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(i.createElement)(h.Disabled,null,Object(i.createElement)(Ot.a,t)))})),attributes:r(376).a};Object(f.c)("woocommerce/product-add-to-cart",vt(vt({},g),wt));var yt=r(17),Et=r.n(yt),_t=r(13),kt=r.n(_t),Pt=r(19),Ct=r.n(Pt),St=r(20),xt=r.n(St),Nt=r(10),Dt=r.n(Nt),Bt=r(14),Rt=(r(2),r(93)),Tt=r(877),At=r(773),It=r(37),Lt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},zt=r(158),Vt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:ne.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:zt.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Ft=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function Mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Gt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Ht(Ht({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ut=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:Yt(Yt({},r),{},{orderBy:!r.orderBy})})}})},Wt=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},Kt=r(18),$t=r.n(Kt),Jt=r(11),Xt=r(7),Zt=r(41),er=(r(793),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),l=u.minIndex,b=u.maxIndex,p=r&&Boolean(1!==l),d=r&&Boolean(b!==a),f=r&&Boolean(l>3),m=r&&Boolean(b<a-2);p&&3===l&&(l-=1),d&&b===a-2&&(b+=1);var g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(Zt.a,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return o(t-1)},title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(Zt.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("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:function(){return o(1)},disabled:1===t},Object(i.createElement)(Zt.a,{label:1,screenReaderLabel:Object(s.sprintf)(
22
  /* translators: %d is the page number (1, 2, 3...). */
23
  Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("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?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(Zt.a,{label:e,screenReaderLabel:Object(s.sprintf)(
24
  /* translators: %d is the page number (1, 2, 3...). */
25
  Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("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:function(){return o(a)},disabled:t===a},Object(i.createElement)(Zt.a,{label:a,screenReaderLabel:Object(s.sprintf)(
26
  /* translators: %d is the page number (1, 2, 3...). */
27
+ Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return o(t+1)},title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(Zt.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});er.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var tr=er,rr=r(136),nr=r(108),cr=r(165),or=r(24),ar=r(62);function ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ir(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ur=r(68),lr=r(277),br=r(64),pr=r(150),dr=function(){var e=Object(N.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:pr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},fr=r(778),mr=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(N.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:fr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},Or=r(156),gr=(r(792),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return Object(i.createElement)(Or.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",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")}],readOnly:r,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:n})}),jr=Object(v.withInstanceId)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(N.useInnerBlockLayoutContext)(),s=o.parentClassName,u=o.parentName,l=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"wc-block-layout",{"is-loading":l});return Object(i.createElement)("li",{className:b,"aria-hidden":l},function e(t,r,n,c){if(n){var o=Object(Tt.a)(t);return n.map((function(n,s){var u=_()(n,2),l=u[0],b=u[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[l];if(!f)return null;var m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))})),hr=(r(791),["order","orderby","page","per_page"]);function vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(Xt.isEqual)(t,c)&&Number.isFinite(r)},Er=Object(lr.a)((function(e){var t,r=e.attributes,n=e.currentPage,c=e.onPageChange,o=e.onSortChange,a=e.sortValue,u=e.scrollToTop,l=Object(nr.b)("attributes",[]),b=_()(l,2),p=b[0],d=b[1],f=Object(nr.b)("stock_status",[]),m=_()(f,2),g=m[0],j=m[1],h=Object(nr.b)("min_price"),v=_()(h,2),w=v[0],y=v[1],E=Object(nr.b)("max_price"),k=_()(E,2),P=k[0],S=k[1],x=Object(nr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return wr(wr({},function(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"}}}(t)),{},{catalog_visibility:"catalog",per_page:c*o,page:r})}({attributes:r,sortValue:a,currentPage:n})),D=_()(x,1)[0],B=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(cr.a)(sr(sr({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var s=Object(ar.a)(i),u=Object(ar.a)(o),l=Object(Bt.useSelect)((function(e){var t=e(or.COLLECTIONS_STORE_KEY),c=["x-wp-total",r,n,s,u];return{value:t.getCollectionHeader.apply(t,c),isLoading:t.hasFinishedResolution("getCollectionHeader",c)}}),["x-wp-total",r,n,u,s]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}(0,sr(sr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}}(D),R=B.products,T=B.totalProducts,A=B.productsLoading,I=Object(N.useInnerBlockLayoutContext)(),L=I.parentClassName,z=I.parentName,V=((t=D).order,t.orderby,t.page,t.per_page,C()(t,hr)||{}),F=Object(ur.a)().dispatchStoreEvent,M=Object(rr.a)({totalQuery:V,totalProducts:T},yr);Object(i.useEffect)((function(){F("product-list-render",{products:R,listName:z})}),[R,z,F]),Object(i.useEffect)((function(){Object(Xt.isEqual)(V,null==M?void 0:M.totalQuery)||(c(1),null!=M&&M.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(br.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(br.speak)(Object(s.sprintf)(
28
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
29
+ Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(T))}),[null==M?void 0:M.totalQuery,T,c,V]);var H,q,G,Q,Y,U=r.contentVisibility,W=r.columns*r.rows,K=!Number.isFinite(T)&&Number.isFinite(null==M?void 0:M.totalProducts)&&Object(Xt.isEqual)(V,null==M?void 0:M.totalQuery)?Math.ceil(M.totalProducts/W):Math.ceil(T/W),$=R.length?R:Array.from({length:W}),J=0!==R.length||A,X=p.length>0||g.length>0||Number.isFinite(w)||Number.isFinite(P);return Object(i.createElement)("div",{className:(H=r.columns,q=r.rows,G=r.alignButtons,Q=r.align,Y=void 0!==Q?"align"+Q:"",O()(L,Y,"has-"+H+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":G}))},U.orderBy&&J&&Object(i.createElement)(gr,{onChange:o,value:a}),!J&&X&&Object(i.createElement)(mr,{resetCallback:function(){d([]),j([]),y(null),S(null)}}),!J&&!X&&Object(i.createElement)(dr,null),J&&Object(i.createElement)("ul",{className:"".concat(L,"__products")},$.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(jr,{key:e.id||t,attributes:r,product:e})}))),K>1&&Object(i.createElement)(tr,{currentPage:n,onPageChange:function(e){u({focusableSelector:"a, button"}),c(e)},totalPages:K}))})),_r=function(e){var t=e.attributes,r=Object(i.useState)(1),n=_()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),s=_()(a,2),u=s[0],l=s[1];return Object(i.useEffect)((function(){l(t.orderby)}),[t.orderby]),Object(i.createElement)(Er,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},kr=r(188);var Pr=function(e){Ct()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Dt()(t);if(r){var c=Dt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return xt()(this,e)});function c(){return Et()(this,c),n.apply(this,arguments)}return $t()(c,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?kr.a:Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(_r,{attributes:t,urlParameterSuffix:r}))}}]),c}(Jt.Component);r(790);var Cr=function(e){Ct()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Dt()(t);if(r){var c=Dt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return xt()(this,e)});function o(){var e;Et()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),c()(kt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(kt()(e),"blockMap",Object(Tt.a)("woocommerce/all-products")),c()(kt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(kt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(kt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(kt()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(kt()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Rt.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(ne.getSetting)("min_columns",1),maxColumns:Object(ne.getSetting)("max_columns",6),minRows:Object(ne.getSetting)("min_rows",1),maxRows:Object(ne.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},Ut(r,n),Wt(r,n)))})),c()(kt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(kt()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(N.ProductDataContextProvider,{product:At.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Gt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];qt.map((function(e){var t=_()(e,2),r=t[0],n=t[1];return c.push(Object(l.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(kt()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Pr,{attributes:t})):Ft(c,o)})),c()(kt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===It.o.productCount?Vt(n,c):Object(i.createElement)("div",{className:Lt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return o}(i.Component),Sr=Object(v.compose)(h.withSpokenMessages,Object(Bt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Bt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Cr),xr={columns:Object(ne.getSetting)("default_columns",3),rows:Object(ne.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:qt,isPreview:!1};function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Br={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("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:xr,edit:function(e){return Object(i.createElement)(Sr,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Lt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Dr(Dr({},Br),{},{deprecated:[{attributes:Object.assign({},Br.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Lt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},86:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},87:function(e,t){e.exports=window.ReactDOM},877:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(60),c=r(0),o=r(37);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,482))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,901))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,902))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,483))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,484))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,486))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,304))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,487))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,488))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,489))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,490))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,903))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},879:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},88:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(17),a=r.n(o),i=r(18),s=r.n(i),u=r(13),l=r.n(u),b=r(19),p=r.n(b),d=r(20),f=r.n(d),m=r(10),O=r.n(m),g=r(0),j=r(7),h=r(6),v=r.n(h),w=r(4),y=r(21);r(123);var E=function(e){p()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O()(t);if(r){var c=O()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return f()(this,e)});function o(){var e;return a()(this,o),(e=n.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(w.BaseControl,{id:b,help:e,className:v()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),o}(g.Component);t.a=Object(y.withInstanceId)(E)},89:function(e,t){e.exports=window.wp.viewport},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(182),u=r(6),l=r.n(u),b=r(114),p=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,p),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:d},u),n&&Object(i.createElement)(b.a,null),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),a=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},96:function(e,t){e.exports=window.wp.date}});
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-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '0e5c3c818dcd1829a90e549879b275f0');
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-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '6af4ac591fde077153eac0abb4ca8f78');
build/all-reviews.js CHANGED
@@ -1,7 +1,7 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],b=0,d=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={7:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[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=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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 u=s;return c.push([774,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),a=r(150),i=r(6),s=r.n(i),l=r(4),u=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},123:function(e,t){},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n=r(0),o=r(1),c=r(4),a=r(12),i=r(3),s=r(88),l=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},u=function(e,t){var r=Object(i.getSetting)("showAvatars",!0),a=Object(i.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(c.SelectControl,{label:Object(o.__)("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:function(e){return t({orderby:e})}}),Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},156:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(6)),c=r.n(o),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,o=e.label,i=e.onChange,s=e.options,l=e.screenReaderLabel,u=e.readOnly,b=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.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:i,readOnly:u,value:b},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},161:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(38),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(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
2
  /* translators: An example person name used for the block previews. */
3
  reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
4
  /* translators: An example person name used for the block previews. */
5
  reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:null,verified:!1}]}}},192: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}}},193:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),a=r(12),i=(r(215),r(85));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},199:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),a=r(4),i=r(12),s=r(17),l=r.n(s),u=r(18),b=r.n(u),d=r(19),p=r.n(d),w=r(20),m=r.n(w),v=r(10),g=r.n(v),f=r(11),h=r(3),O=r(106),y=r(41),j=(r(256),function(e){var t=e.onClick,r=e.label,o=e.screenReaderLabel;return Object(n.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(n.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(n.createElement)(y.a,{label:r,screenReaderLabel:o})))});j.defaultProps={label:Object(o.__)("Load more","woo-gutenberg-products-block")};var _=j,k=r(156),R=(r(253),function(e){var t=e.onChange,r=e.readOnly,c=e.value;return Object(n.createElement)(k.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(o.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(o.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(o.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(o.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(o.__)("Order reviews by","woo-gutenberg-products-block"),value:c})}),E=r(5),P=r.n(E),S=r(6),C=r.n(S),N=r(13),T=r.n(N),x=r(236),L=r.n(x),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=L()(e,{suffix:r,limit:t});return n.html},M=function(e,t,r,n){var o=I(e,t,r);return A(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=D(n,t.clientHeight,r);return n.middle},D=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};var B=function(e){p()(c,e);var t,r,o=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=g()(t);if(r){var o=g()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m()(this,e)});function c(e){var t;return l()(this,c),(t=o.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},t.reviewSummary=Object(f.createRef)(),t.reviewContent=Object(f.createRef)(),t.getButton=t.getButton.bind(T()(t)),t.onClick=t.onClick.bind(T()(t)),t}return b()(c,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:M(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,o=t.lessText,c=t.moreText,a=e?o:c;if(a)return Object(n.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},a)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,o=t.summary,c=t.clampEnabled,a=t.isExpanded;return r?!1===c?Object(n.createElement)("div",{className:e},Object(n.createElement)("div",{ref:this.reviewContent},r)):Object(n.createElement)("div",{className:e},(!a||null===c)&&Object(n.createElement)("div",{ref:this.reviewSummary,"aria-hidden":a,dangerouslySetInnerHTML:{__html:o}}),(a||null===c)&&Object(n.createElement)("div",{ref:this.reviewContent,"aria-hidden":!a},r),this.getButton()):null}}]),c}(f.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(o.__)("Read more","woo-gutenberg-products-block"),lessText:Object(o.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(255);var G=function(e){var t=e.attributes,r=e.review,c=void 0===r?{}:r,a=t.imageType,i=t.showReviewDate,s=t.showReviewerName,l=t.showReviewImage,u=t.showReviewRating,b=t.showReviewContent,d=t.showProductName,p=c.rating,w=!Object.keys(c).length>0,m=Number.isFinite(p)&&u;return Object(n.createElement)("li",{className:C()("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":l}),"aria-hidden":w},(d||i||s||l||m)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},l&&function(e,t,r){var c,a;return r||!e?Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(n.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(n.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(n.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(o.__)("Verified buyer","woo-gutenberg-products-block")},Object(o.__)("Verified buyer","woo-gutenberg-products-block")))}(c,a,w),(d||s||m||i)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},m&&function(e){var t=e.rating,r={width:t/5*100+"%"},c=Object(o.sprintf)(
6
  /* translators: %f is referring to the average rating value */
7
- Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(n.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(n.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(n.createElement)("span",{style:r},c)))}(c),d&&function(e){return Object(n.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(n.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(c),s&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(n.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(c),i&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(n.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(c))),b&&function(e){return Object(n.createElement)(H,{maxLines:10,moreText:Object(o.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(o.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(c))};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){P()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(254);var z=function(e){var t=e.attributes,r=e.reviews,o=Object(h.getSetting)("showAvatars",!0),c=Object(h.getSetting)("reviewRatingsEnabled",!0),a=(o||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s=V(V({},t),{},{showReviewImage:a,showReviewRating:i});return Object(n.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(n.createElement)(G,{attributes:s}):r.map((function(e,t){return Object(n.createElement)(G,{key:e.id||t,attributes:s,review:e})})))},W=r(9),U=r.n(W),J=r(29),q=r.n(J),Y=r(22),K=r.n(Y),Q=r(34),X=r.n(Q),Z=r(85),$=r(42);var ee=function(e){var t=function(t){p()(a,t);var r,o,c=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g()(r);if(o){var n=g()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m()(this,e)});function a(){var e;l()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),P()(T()(e),"isPreview",!!e.props.attributes.previewReviews),P()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),P()(T()(e),"isMounted",!1),P()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),P()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.props.onReviewsLoadError,t.next=5,Object($.a)(r);case 5:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 8:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()),e}return b()(a,[{key:"componentDidMount",value:function(){this.isMounted=!0,this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnmount",value:function(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.isMounted&&e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,o=r.error,c=r.loading,a=r.reviews,i=r.totalReviews;return Object(n.createElement)(e,U()({},this.props,{error:o,isLoading:c,reviews:a.slice(0,t),totalReviews:i}))}}]),a}(f.Component);P()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,o=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(o," )"),t}(function(e){p()(i,e);var t,r,c=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=g()(t);if(r){var o=g()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m()(this,e)});function i(){return l()(this,i),c.apply(this,arguments)}return b()(i,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,c=e.isLoading,i=e.noReviewsPlaceholder,s=e.reviews,l=e.totalReviews;if(r)return Object(n.createElement)(O.a,{className:"wc-block-featured-product-error",error:r,isLoading:c});if(0===s.length&&!c)return Object(n.createElement)(i,{attributes:t});var u=Object(h.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(a.Disabled,null,t.showOrderby&&u&&Object(n.createElement)(R,{readOnly:!0,value:t.orderby}),Object(n.createElement)(z,{attributes:t,reviews:s}),t.showLoadMore&&l>s.length&&Object(n.createElement)(_,{screenReaderLabel:Object(o.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),i}(f.Component));t.a=function(e){var t=e.attributes,r=e.icon,s=e.name,l=e.noReviewsPlaceholder,u=t.categoryIds,b=t.productId,d=t.reviewsOnPageLoad,p=t.showProductName,w=t.showReviewDate,m=t.showReviewerName,v=t.showReviewContent,g=t.showReviewImage,f=t.showReviewRating,h=Object(Z.d)(t.orderby),O=h.order,y=h.orderby,j=!(v||f||w||m||g||p),_=Object(i.useBlockProps)({className:Object(Z.a)(t)});return j?Object(n.createElement)(a.Placeholder,{icon:r,label:s},Object(o.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(n.createElement)("div",_,Object(n.createElement)(ee,{attributes:t,categoryIds:u,delayFunction:function(e){return Object(c.debounce)(e,400)},noReviewsPlaceholder:l,orderby:y,order:O,productId:b,reviewsToDisplay:d}))}},21:function(e,t){e.exports=window.wp.compose},215:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},253:function(e,t){},254:function(e,t){},255:function(e,t){},256:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},34:function(e,t){e.exports=window.wp.isShallowEqual},38: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 u})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return v})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return f})),r.d(t,"b",(function(){return h}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),w=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),m=o.STORE_PAGES.cart.permalink,v=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),g=Object(o.getSetting)("allowedCountries",{}),f=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,u=null!=r,b=null!=n;return!u&&b?(t=o||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,u&&b&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(29),o=r.n(n),c=r(22),a=r.n(c),i=r(1),s=function(){var e=o()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),a=r.n(c),i=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},774:function(e,t,r){e.exports=r(864)},85: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 u})),r.d(t,"b",(function(){return b}));var n=r(15),o=r.n(n),c=r(6),a=r.n(c),i=r(3),s=function(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=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,i=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),a()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":i,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},864:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),a=r(1),i=r(26),s=r(66),l=r(28),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(215),r(12)),d=r(4),p=(r(2),r(199)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(a.__)("All Reviews","woo-gutenberg-products-block")},Object(a.__)("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"))},m=r(144),v=r(192),g=r(193),f=r(161);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(a.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:O(O({},f.a),{},{attributes:O(O({},f.a.attributes),{},{showProductName:!0})}),attributes:O(O({},v.a),{},{showProductName:{type:"boolean",default:!0}}),transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(i.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(a.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(m.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings","woo-gutenberg-products-block")},Object(m.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(a.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},save:g.a})},88:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(17),a=r.n(c),i=r(18),s=r.n(i),l=r(13),u=r.n(l),b=r(19),d=r.n(b),p=r(20),w=r.n(p),m=r(10),v=r.n(m),g=r(0),f=r(7),h=r(6),O=r.n(h),y=r(4),j=r(21);r(123);var _=function(e){d()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var o=v()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return w()(this,e)});function c(){var e;return a()(this,c),(e=n.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(c,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(f.isFunction)(s)?s(c):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(g.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),c}(g.Component);t.a=Object(j.withInstanceId)(_)}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],b=0,d=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={7:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[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=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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 u=s;return c.push([774,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),a=r(150),i=r(6),s=r.n(i),l=r(4),u=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},123:function(e,t){},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n=r(0),o=r(1),c=r(4),a=r(12),i=r(3),s=r(88),l=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},u=function(e,t){var r=Object(i.getSetting)("showAvatars",!0),a=Object(i.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(c.SelectControl,{label:Object(o.__)("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:function(e){return t({orderby:e})}}),Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},156:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(6)),c=r.n(o),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,o=e.label,i=e.onChange,s=e.options,l=e.screenReaderLabel,u=e.readOnly,b=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.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:i,readOnly:u,value:b},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},161:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(37),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(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
2
  /* translators: An example person name used for the block previews. */
3
  reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
4
  /* translators: An example person name used for the block previews. */
5
  reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:null,verified:!1}]}}},192: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}}},193:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),a=r(12),i=(r(215),r(85));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},199:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),a=r(4),i=r(12),s=r(17),l=r.n(s),u=r(18),b=r.n(u),d=r(19),p=r.n(d),w=r(20),m=r.n(w),v=r(10),g=r.n(v),f=r(11),h=r(3),O=r(106),y=r(41),j=(r(256),function(e){var t=e.onClick,r=e.label,o=e.screenReaderLabel;return Object(n.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(n.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(n.createElement)(y.a,{label:r,screenReaderLabel:o})))});j.defaultProps={label:Object(o.__)("Load more","woo-gutenberg-products-block")};var _=j,k=r(156),R=(r(253),function(e){var t=e.onChange,r=e.readOnly,c=e.value;return Object(n.createElement)(k.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(o.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(o.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(o.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(o.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(o.__)("Order reviews by","woo-gutenberg-products-block"),value:c})}),E=r(5),P=r.n(E),S=r(6),C=r.n(S),N=r(13),T=r.n(N),x=r(236),L=r.n(x),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=L()(e,{suffix:r,limit:t});return n.html},M=function(e,t,r,n){var o=I(e,t,r);return A(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=D(n,t.clientHeight,r);return n.middle},D=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};var B=function(e){p()(c,e);var t,r,o=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=g()(t);if(r){var o=g()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m()(this,e)});function c(e){var t;return l()(this,c),(t=o.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},t.reviewSummary=Object(f.createRef)(),t.reviewContent=Object(f.createRef)(),t.getButton=t.getButton.bind(T()(t)),t.onClick=t.onClick.bind(T()(t)),t}return b()(c,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:M(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,o=t.lessText,c=t.moreText,a=e?o:c;if(a)return Object(n.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},a)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,o=t.summary,c=t.clampEnabled,a=t.isExpanded;return r?!1===c?Object(n.createElement)("div",{className:e},Object(n.createElement)("div",{ref:this.reviewContent},r)):Object(n.createElement)("div",{className:e},(!a||null===c)&&Object(n.createElement)("div",{ref:this.reviewSummary,"aria-hidden":a,dangerouslySetInnerHTML:{__html:o}}),(a||null===c)&&Object(n.createElement)("div",{ref:this.reviewContent,"aria-hidden":!a},r),this.getButton()):null}}]),c}(f.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(o.__)("Read more","woo-gutenberg-products-block"),lessText:Object(o.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(255);var G=function(e){var t=e.attributes,r=e.review,c=void 0===r?{}:r,a=t.imageType,i=t.showReviewDate,s=t.showReviewerName,l=t.showReviewImage,u=t.showReviewRating,b=t.showReviewContent,d=t.showProductName,p=c.rating,w=!Object.keys(c).length>0,m=Number.isFinite(p)&&u;return Object(n.createElement)("li",{className:C()("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":l}),"aria-hidden":w},(d||i||s||l||m)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},l&&function(e,t,r){var c,a;return r||!e?Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(n.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(n.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(n.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(o.__)("Verified buyer","woo-gutenberg-products-block")},Object(o.__)("Verified buyer","woo-gutenberg-products-block")))}(c,a,w),(d||s||m||i)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},m&&function(e){var t=e.rating,r={width:t/5*100+"%"},c=Object(o.sprintf)(
6
  /* translators: %f is referring to the average rating value */
7
+ Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(n.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(n.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(n.createElement)("span",{style:r},c)))}(c),d&&function(e){return Object(n.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(n.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(c),s&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(n.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(c),i&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(n.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(c))),b&&function(e){return Object(n.createElement)(H,{maxLines:10,moreText:Object(o.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(o.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(c))};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){P()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(254);var z=function(e){var t=e.attributes,r=e.reviews,o=Object(h.getSetting)("showAvatars",!0),c=Object(h.getSetting)("reviewRatingsEnabled",!0),a=(o||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s=V(V({},t),{},{showReviewImage:a,showReviewRating:i});return Object(n.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(n.createElement)(G,{attributes:s}):r.map((function(e,t){return Object(n.createElement)(G,{key:e.id||t,attributes:s,review:e})})))},W=r(9),U=r.n(W),J=r(29),q=r.n(J),Y=r(22),K=r.n(Y),Q=r(34),X=r.n(Q),Z=r(85),$=r(42);var ee=function(e){var t=function(t){p()(a,t);var r,o,c=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g()(r);if(o){var n=g()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m()(this,e)});function a(){var e;l()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),P()(T()(e),"isPreview",!!e.props.attributes.previewReviews),P()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),P()(T()(e),"isMounted",!1),P()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),P()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.props.onReviewsLoadError,t.next=5,Object($.a)(r);case 5:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 8:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()),e}return b()(a,[{key:"componentDidMount",value:function(){this.isMounted=!0,this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnmount",value:function(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.isMounted&&e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,o=r.error,c=r.loading,a=r.reviews,i=r.totalReviews;return Object(n.createElement)(e,U()({},this.props,{error:o,isLoading:c,reviews:a.slice(0,t),totalReviews:i}))}}]),a}(f.Component);P()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,o=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(o," )"),t}(function(e){p()(i,e);var t,r,c=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=g()(t);if(r){var o=g()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m()(this,e)});function i(){return l()(this,i),c.apply(this,arguments)}return b()(i,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,c=e.isLoading,i=e.noReviewsPlaceholder,s=e.reviews,l=e.totalReviews;if(r)return Object(n.createElement)(O.a,{className:"wc-block-featured-product-error",error:r,isLoading:c});if(0===s.length&&!c)return Object(n.createElement)(i,{attributes:t});var u=Object(h.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(a.Disabled,null,t.showOrderby&&u&&Object(n.createElement)(R,{readOnly:!0,value:t.orderby}),Object(n.createElement)(z,{attributes:t,reviews:s}),t.showLoadMore&&l>s.length&&Object(n.createElement)(_,{screenReaderLabel:Object(o.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),i}(f.Component));t.a=function(e){var t=e.attributes,r=e.icon,s=e.name,l=e.noReviewsPlaceholder,u=t.categoryIds,b=t.productId,d=t.reviewsOnPageLoad,p=t.showProductName,w=t.showReviewDate,m=t.showReviewerName,v=t.showReviewContent,g=t.showReviewImage,f=t.showReviewRating,h=Object(Z.d)(t.orderby),O=h.order,y=h.orderby,j=!(v||f||w||m||g||p),_=Object(i.useBlockProps)({className:Object(Z.a)(t)});return j?Object(n.createElement)(a.Placeholder,{icon:r,label:s},Object(o.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(n.createElement)("div",_,Object(n.createElement)(ee,{attributes:t,categoryIds:u,delayFunction:function(e){return Object(c.debounce)(e,400)},noReviewsPlaceholder:l,orderby:y,order:O,productId:b,reviewsToDisplay:d}))}},21:function(e,t){e.exports=window.wp.compose},215:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},253:function(e,t){},254:function(e,t){},255:function(e,t){},256:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},34:function(e,t){e.exports=window.wp.isShallowEqual},37: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 u})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return v})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return f})),r.d(t,"b",(function(){return h}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),w=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),m=o.STORE_PAGES.cart.permalink,v=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),g=Object(o.getSetting)("allowedCountries",{}),f=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,u=null!=r,b=null!=n;return!u&&b?(t=o||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,u&&b&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(29),o=r.n(n),c=r(22),a=r.n(c),i=r(1),s=function(){var e=o()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),a=r.n(c),i=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},774:function(e,t,r){e.exports=r(864)},85: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 u})),r.d(t,"b",(function(){return b}));var n=r(15),o=r.n(n),c=r(6),a=r.n(c),i=r(3),s=function(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=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,i=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),a()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":i,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},864:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),a=r(1),i=r(26),s=r(66),l=r(28),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(215),r(12)),d=r(4),p=(r(2),r(199)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(a.__)("All Reviews","woo-gutenberg-products-block")},Object(a.__)("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"))},m=r(144),v=r(192),g=r(193),f=r(161);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(a.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:O(O({},f.a),{},{attributes:O(O({},f.a.attributes),{},{showProductName:!0})}),attributes:O(O({},v.a),{},{showProductName:{type:"boolean",default:!0}}),transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(i.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(a.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(m.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings","woo-gutenberg-products-block")},Object(m.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(a.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},save:g.a})},88:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(17),a=r.n(c),i=r(18),s=r.n(i),l=r(13),u=r.n(l),b=r(19),d=r.n(b),p=r(20),w=r.n(p),m=r(10),v=r.n(m),g=r(0),f=r(7),h=r(6),O=r.n(h),y=r(4),j=r(21);r(123);var _=function(e){d()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var o=v()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return w()(this,e)});function c(){var e;return a()(this,c),(e=n.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(c,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(f.isFunction)(s)?s(c):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(g.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),c}(g.Component);t.a=Object(j.withInstanceId)(_)}});
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{113:function(t,e,r){"use strict";var n=r(5),i=r.n(n),c=r(8),o=r.n(c),a=r(3),s=r(1),u=r(72);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=Object(a.getSetting)("countryLocale",{}),f=function(t){var e={};return void 0!==t.label&&(e.label=t.label),void 0!==t.required&&(e.required=t.required),void 0!==t.hidden&&(e.hidden=t.hidden),void 0===t.label||t.optionalLabel||(e.optionalLabel=Object(s.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(s.__)("%s (optional)","woo-gutenberg-products-block"),t.label)),t.priority&&(Object(u.a)(t.priority)&&(e.index=t.priority),Object(u.c)(t.priority)&&(e.index=parseInt(t.priority,10))),t.hidden&&(e.required=!1),e},b=Object.entries(l).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,Object.entries(n).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,f(n)]})).reduce((function(t,e){var r=o()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{})]})).reduce((function(t,e){var r=o()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{});e.a=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return t.map((function(t){var r=a.defaultAddressFields[t]||{},i=n[t]||{},c=e[t]||{};return d(d(d({key:t},r),i),c)})).sort((function(t,e){return t.index-e.index}))}},142:function(t,e,r){"use strict";r.d(e,"a",(function(){return c}));var n=r(8),i=r.n(n),c=function(t){return t.reduce((function(t,e){var r=i()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{})}},162:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r(3),i=r(113),c=r(23),o=function(t){var e=t.country,r=void 0===e?"":e,n=t.state,i=void 0===n?"":n,c=t.city,o=void 0===c?"":c,a=t.postcode,s=void 0===a?"":a;return{country:r.trim(),state:i.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(t){var e=t.email,r=void 0===e?"":e;return Object(c.isEmail)(r)?r.trim():""},s=function(t){var e=Object.keys(n.defaultAddressFields),r=Object(i.a)(e,{},t.country),c=Object.assign({},t);return r.forEach((function(e){var r=e.key,n=void 0===r?"":r,i=e.hidden;void 0!==i&&i&&function(t,e){return t in e}(n,t)&&(c[n]="")})),c}},43:function(t,e,r){"use strict";r.d(e,"a",(function(){return j}));var n=r(8),i=r.n(n),c=r(5),o=r.n(c),a=r(7),s=r(0),u=r(24),p=r(14),d=r(25),l=r(142),f=r(162),b=r(63);function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},_=g(g({},v),{},{email:""}),y={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:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},m=function(t){return Object(l.a)(Object.entries(t).map((function(t){var e=i()(t,2),r=e[0],n=e[1];return[r,Object(d.decodeEntities)(n)]})))},h={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(b.b)(),r=e.isEditor,n=e.previewData,i=null==n?void 0:n.previewCart,c=t.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(t,e){var n=e.dispatch;if(!c)return h;if(r)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:u.EMPTY_CART_ITEM_ERRORS,cartTotals:i.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,extensions:u.EMPTY_EXTENSIONS,shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:function(){}};var o=t(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=m(a.billingAddress),y=a.needsShipping?m(a.shippingAddress):O,j=a.fees.length>0?a.fees.map((function(t){return m(t)})):u.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(t){return g(g({},t),{},{label:t.code})})):u.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[c]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},63:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));var n=r(0),i=r(14),c=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(c)},a=function(t){var e=t.children,r=t.currentPostId,o=void 0===r?0:r,a=t.previewData,s=void 0===a?{}:a,u=Object(i.useSelect)((function(t){return o||t("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(t){return t in s?s[t]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(c.Provider,{value:d},e)}},68:function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(5),i=r.n(n),c=r(55),o=r(0),a=r(43);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=function(){var t=Object(a.a)(),e=Object(o.useRef)(t);return Object(o.useEffect)((function(){e.current=t}),[t]),{dispatchStoreEvent:Object(o.useCallback)((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(t),e)}catch(t){console.error(t)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e.current}))}catch(t){console.error(t)}}),[])}}},72:function(t,e,r){"use strict";r.d(e,"a",(function(){return c})),r.d(e,"c",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"d",(function(){return s}));var n=r(37),i=r.n(n),c=function(t){return"number"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return!function(t){return null===t}(t)&&"object"===i()(t)};function s(t,e){return a(t)&&e in t}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{113:function(t,e,r){"use strict";var n=r(5),c=r.n(n),i=r(8),o=r.n(i),a=r(3),s=r(1),u=r(72);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=Object(a.getSetting)("countryLocale",{}),f=function(t){var e={};return void 0!==t.label&&(e.label=t.label),void 0!==t.required&&(e.required=t.required),void 0!==t.hidden&&(e.hidden=t.hidden),void 0===t.label||t.optionalLabel||(e.optionalLabel=Object(s.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(s.__)("%s (optional)","woo-gutenberg-products-block"),t.label)),t.priority&&(Object(u.a)(t.priority)&&(e.index=t.priority),Object(u.c)(t.priority)&&(e.index=parseInt(t.priority,10))),t.hidden&&(e.required=!1),e},b=Object.entries(l).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,Object.entries(n).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,f(n)]})).reduce((function(t,e){var r=o()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{})]})).reduce((function(t,e){var r=o()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{});e.a=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return t.map((function(t){var r=a.defaultAddressFields[t]||{},c=n[t]||{},i=e[t]||{};return d(d(d({key:t},r),c),i)})).sort((function(t,e){return t.index-e.index}))}},142:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(8),c=r.n(n),i=function(t){return t.reduce((function(t,e){var r=c()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{})}},162:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r(3),c=r(113),i=r(23),o=function(t){var e=t.country,r=void 0===e?"":e,n=t.state,c=void 0===n?"":n,i=t.city,o=void 0===i?"":i,a=t.postcode,s=void 0===a?"":a;return{country:r.trim(),state:c.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(t){var e=t.email,r=void 0===e?"":e;return Object(i.isEmail)(r)?r.trim():""},s=function(t){var e=Object.keys(n.defaultAddressFields),r=Object(c.a)(e,{},t.country),i=Object.assign({},t);return r.forEach((function(e){var r=e.key,n=void 0===r?"":r,c=e.hidden;void 0!==c&&c&&function(t,e){return t in e}(n,t)&&(i[n]="")})),i}},43:function(t,e,r){"use strict";r.d(e,"a",(function(){return j}));var n=r(8),c=r.n(n),i=r(5),o=r.n(i),a=r(7),s=r(0),u=r(24),p=r(14),d=r(25),l=r(142),f=r(162),b=r(63);function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},_=g(g({},v),{},{email:""}),y={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:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},m=function(t){return Object(l.a)(Object.entries(t).map((function(t){var e=c()(t,2),r=e[0],n=e[1];return[r,Object(d.decodeEntities)(n)]})))},h={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(b.b)(),r=e.isEditor,n=e.previewData,c=null==n?void 0:n.previewCart,i=t.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(t,e){var n=e.dispatch;if(!i)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var o=t(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=m(a.billingAddress),y=a.needsShipping?m(a.shippingAddress):O,j=a.fees.length>0?a.fees.map((function(t){return m(t)})):u.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(t){return g(g({},t),{},{label:t.code})})):u.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[i]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},63:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));var n=r(0),c=r(14),i=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(i)},a=function(t){var e=t.children,r=t.currentPostId,o=void 0===r?0:r,a=t.previewData,s=void 0===a?{}:a,u=Object(c.useSelect)((function(t){return o||t("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(t){return t in s?s[t]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(i.Provider,{value:d},e)}},68:function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(5),c=r.n(n),i=r(55),o=r(0),a=r(43);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=function(){var t=Object(a.a)(),e=Object(o.useRef)(t);return Object(o.useEffect)((function(){e.current=t}),[t]),{dispatchStoreEvent:Object(o.useCallback)((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-".concat(t),e)}catch(t){console.error(t)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e.current}))}catch(t){console.error(t)}}),[])}}},72:function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return c})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o}));var n=function(t){return"number"==typeof t},c=function(t){return"string"==typeof t},i=function(t){return!function(t){return null===t}(t)&&t instanceof Object&&t.constructor===Object};function o(t,e){return i(t)&&e in t}}}]);
build/atomic-block-components/add-to-cart-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{127:function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return y}));var n=r(20),c=r.n(n),o=r(4),a=r.n(o),s=r(23),i=r.n(s),u=r(5),l=r.n(u),f=r(0),d=r(7),b=r(25),p=r.n(b);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),g=function(){return Object(f.useContext)(h)},y=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(f.useCallback)((function(e){return c[e]}),[c]),u=Object(f.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(f.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(O))):t}))}),[]),m=Object(f.useCallback)((function(){o({})}),[]),g=Object(f.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&p()(t[r],e))})),0===Object.values(e).length?t:v(v({},t),e)}))}),[]),y=Object(f.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=v(v({},r[e]),t);return p()(r[e],n)?r:v(v({},r),{},a()({},e,n))}))}),[]),j={getValidationError:s,setValidationErrors:g,clearValidationError:b,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(f.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(f.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=v(v({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:v(v({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return React.createElement(h.Provider,{value:j},t)}},138:function(e,t,r){"use strict";r(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},143:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(23),a=r.n(o),s=r(76),i=r(6),u=r.n(i),l=r(138),f=(r(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,i=a()(e,f),d=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return React.createElement(s.a,c()({className:d},i),n&&React.createElement(l.a,null),React.createElement("span",{className:"wc-block-components-button__text"},o))}},180:function(e,t){},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(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}},191:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(98),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},193:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(20),c=r.n(n),o=r(39),a=r.n(o),s=r(27),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(35);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,d,b;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=f(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,d,b,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=f(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},250:function(e,t){},251:function(e,t){},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r(10);var n=r(127),c=(r(250),function(e){var t=e.errorMessage,r=void 0===t?"":t,c=e.propertyName,o=void 0===c?"":c,a=e.elementId,s=void 0===a?"":a,i=Object(n.b)(),u=i.getValidationError,l=i.getValidationErrorId;if(!r||"string"!=typeof r){var f=u(o)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(s)},r))})},345:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(188);t.a=function(e){return function(t){return function(r){var n=Object(o.a)(e,r);return React.createElement(t,c()({},r,n))}}}},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,c,o=r(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},362:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(5),c=r.n(n),o=r(0),a=r(11),s=r(8),i=r(28),u=r(32),l=r(54),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(s.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,m=b.removeNotice,v=Object(o.useState)(!1),O=c()(v,2),h=O[0],g=O[1],y=Object(o.useRef)(f(n,e));return Object(o.useEffect)((function(){var t=f(n,e);t!==y.current&&(y.current=t)}),[n,e]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:h,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){p(Object(i.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}},368:function(e,t){},369:function(e,t,r){"use strict";var n=r(34),c=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=c},370:function(e,t){},403:function(e,t,r){"use strict";r.r(t);var n=r(345),c=(r(10),r(6)),o=r.n(c),a=r(5),s=r.n(a),i=r(0),u=r(1),l=r(53),f=function(e){return e.is_purchasable||!1},d={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},b=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},p=r(4),m=r.n(p);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h="idle",g=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=d;break;case"set_idle":e=t.status!==h?O(O({},t),{},{status:h}):t;break;case"set_disabled":e="disabled"!==t.status?O(O({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?O(O({},t),{},{quantity:n}):t;break;case"set_request_params":e=O(O({},t),{},{requestParams:O(O({},t.requestParams),o)});break;case"set_processing_response":e=O(O({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?O(O({},t),{},{status:"processing",hasError:!1}):t).hasError?e:O(O({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?O(O({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?O(O({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:O(O({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?O(O({},e),{},{status:h}):e;break;case"set_no_error":e=t.hasError?O(O({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=h),e},y=r(98),j=r(191),E=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(j.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(j.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(j.a)("add_to_cart_before_processing",e)}},w=r(193),_=r(127),P=r(54),k=r(35),R=Object(i.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:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(i.useContext)(R)},A=function(e){var t=e.children,r=e.product,n=e.showFormElements,c=Object(i.useReducer)(g,d),o=s()(c,2),a=o[0],p=o[1],m=Object(i.useReducer)(y.b,{}),v=s()(m,2),O=v[0],h=v[1],j=Object(l.a)(O),C=Object(P.a)(),A=C.addErrorNotice,S=C.removeNotices,N=Object(_.b)().setValidationErrors,D=Object(k.c)(),x=D.isSuccessResponse,T=D.isErrorResponse,V=D.isFailResponse,q=Object(i.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:E(h).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:E(h).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:E(h).onAddToCartBeforeProcessing}}),[h]),I=Object(i.useMemo)((function(){return{resetForm:function(){p({type:"set_pristine"})},submitForm:function(){p({type:"set_before_processing"})},setQuantity:function(e){p(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){p(b(e))},setRequestParams:function(e){p(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){p({type:"set_processing_response",data:e}),p({type:"set_after_processing"})}}}),[]);Object(i.useEffect)((function(){var e=a.status,t=!r.id||!f(r);"disabled"!==e||t?"disabled"!==e&&t&&p({type:"set_disabled"}):p({type:"set_idle"})}),[a.status,r,p]),Object(i.useEffect)((function(){"before_processing"===a.status&&(S("error"),Object(w.a)(j,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&A(t),r&&N(r)})),p({type:"set_idle"})):p({type:"set_processing"})})))}),[a.status,N,A,S,p,j]),Object(i.useEffect)((function(){if("after_processing"===a.status){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(T(e)||V(e))&&r&&(t=!0,A(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(w.b)(j,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");A(c,{id:"add-to-cart"})}p({type:"set_idle"})}));Object(w.b)(j,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?p(b(!0)):p({type:"set_idle"})}))}}),[a.status,a.hasError,a.processingResponse,I,A,T,V,x,j]);var F=function(e){return["simple","variable"].includes(e.type||"simple")}(r),B={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:F,showFormElements:n&&F,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:"idle"===a.status,isDisabled:"disabled"===a.status,isProcessing:"processing"===a.status,isBeforeProcessing:"before_processing"===a.status,isAfterProcessing:"after_processing"===a.status,hasError:a.hasError,eventRegistration:q,dispatchActions:I};return React.createElement(R.Provider,{value:B},t)},S=r(60),N=r.n(S),D=r(28),x=r(32);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var V=function(){var e=C(),t=e.dispatchActions,r=e.product,n=e.quantity,c=e.eventRegistration,o=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(P.a)(),v=p.addErrorNotice,O=p.removeNotice,h=Object(x.a)().receiveCart,g=Object(i.useState)(!1),y=s()(g,2),j=y[0],E=y[1],w=!o&&a,k=Object(i.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(i.useEffect)((function(){var e=c.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[c,k]);var R=Object(i.useCallback)((function(){E(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);N()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){N.a.setNonce(e.headers),e.json().then((function(r){e.ok?h(r):(r.body&&r.body.message?v(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,v,O,h,t,n,l]);return Object(i.useEffect)((function(){w&&!j&&R()}),[w,R,j]),null},q=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_.a,null,React.createElement(A,{product:r,showFormElements:n},t,React.createElement(V,null)))},I=r(101),F=r(7),B=r(249),L=(r(368),r(143)),M=r(152),Q=r(369),W=r(52),H=r(362),K=function(e){var t=e.className,r=e.href,n=e.text,c=e.onClick;return React.createElement(L.a,{className:t,href:r,onClick:c,rel:"nofollow"},n)},J=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,c=e.isDisabled,o=e.isDone,a=e.onClick;return React.createElement(L.a,{className:t,disabled:c,showSpinner:n,onClick:a},o&&r>0?Object(u.sprintf)(
2
  /* translators: %s number of products in cart. */
3
- Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!o&&React.createElement(M.a,{srcElement:Q.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},U=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,c=e.product,o=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(I.useInnerBlockLayoutContext)().parentName,m=Object(W.a)().dispatchStoreEvent,v=Object(H.a)(c.id||0).cartQuantity,O=Object(i.useState)(!1),h=s()(O,2),g=h[0],y=h[1],j=c.add_to_cart||{url:"",text:""};return Object(i.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||y(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===o)&&r?React.createElement(J,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:v,isDisabled:a,isProcessing:l,isDone:g,onClick:function(){b.submitForm(),m("cart-add-item",{product:c,listName:p})}}):React.createElement(K,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:c,listName:p})}})},Y=function(e){var t=e.disabled,r=e.min,n=e.max,c=e.value,o=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:c,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){o(e.target.value)}})},z=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},G=function(){var e=C(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,o=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(z,null):t.id&&!t.is_in_stock?React.createElement(z,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Y,{value:r,min:n,max:c,disabled:a,onChange:o.setQuantity}),React.createElement(U,null))},X=(r(370),r(46)),$=r.n(X),Z=r(404),ee=r(3),te=r(258),re={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ne=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,c=e.value,a=void 0===c?"":c,s=e.onChange,i=void 0===s?function(){}:s,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,O=t,h=b(O)||{};return Object(ee.useEffect)((function(){a?v(O):p(m()({},O,{message:f,hidden:!0}))}),[a,O,f,v,p]),Object(ee.useEffect)((function(){return function(){v(O)}}),[O,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(Z.a,{label:Object(D.decodeEntities)(t),value:a||"",options:[re].concat($()(n)),onChange:i,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),React.createElement(te.a,{propertyName:O,elementId:O}))};function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ae=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ue=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,c=Object(l.a)(t),o=Object(l.a)(r),a=Object(i.useState)(0),u=s()(a,2),f=u[0],d=u[1],b=Object(i.useState)({}),p=s()(b,2),v=p[0],O=p[1],h=Object(i.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=oe(oe({},r),{},m()({},c,null)),i=o?ae(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(c,o,v)}),[v,c,o]);return Object(i.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(c).length?d(function(e,t,r){return ae(e,t,r)[0]||0}(c,o,v)):f>0&&d(0)}),[v,f,c,o]),Object(i.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(c).map((function(e){return React.createElement(ne,{key:e,attributeName:e,options:h[e],value:v[e],onChange:function(t){O(ie(ie({},v),{},m()({},e,t)))}})})))},le=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(F.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),c=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===c.length?null:React.createElement(ue,{attributes:n,variationAttributes:c,setRequestParams:r.setRequestParams})},fe=function(){var e=C(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,o=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(z,null):t.id&&!t.is_in_stock?React.createElement(z,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(le,{product:t,dispatchers:o}),React.createElement(Y,{value:r,min:n,max:c,disabled:a,onChange:o.setQuantity}),React.createElement(U,null))},de=function(){return React.createElement(U,null)},be=r(355),pe=function(){return React.createElement(be.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},me=function(){return React.createElement(pe,null)},ve=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(fe,null):"grouped"===r?React.createElement(me,null):"external"===r?React.createElement(de,null):"simple"===r||"variation"===r?React.createElement(G,null):null:React.createElement(U,null)},Oe=Object(B.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(I.useProductDataContext)().product,c=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(F.isEmpty)(n)});return React.createElement(q,{product:n,showFormElements:r},React.createElement("div",{className:c},React.createElement(ve,null)))}));t.default=Object(n.a)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(Oe)},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(25),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(103);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,i({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,i({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,i({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,i({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,i({},t))}}}),[r]);return i(i(i({notices:t},u),l),{},{setIsSuppressed:c})}},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,c=r(4),o=r.n(c),a=r(7);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,f=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),i(i({},e),{},o()({},c,f))}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{127:function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return y}));var n=r(21),c=r.n(n),o=r(4),a=r.n(o),s=r(23),i=r.n(s),u=r(5),l=r.n(u),f=r(0),d=r(7),b=r(25),p=r.n(b);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),g=function(){return Object(f.useContext)(h)},y=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(f.useCallback)((function(e){return c[e]}),[c]),u=Object(f.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(f.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(O))):t}))}),[]),m=Object(f.useCallback)((function(){o({})}),[]),g=Object(f.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&p()(t[r],e))})),0===Object.values(e).length?t:v(v({},t),e)}))}),[]),y=Object(f.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=v(v({},r[e]),t);return p()(r[e],n)?r:v(v({},r),{},a()({},e,n))}))}),[]),j={getValidationError:s,setValidationErrors:g,clearValidationError:b,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(f.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(f.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=v(v({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:v(v({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return React.createElement(h.Provider,{value:j},t)}},138:function(e,t,r){"use strict";r(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},143:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(23),a=r.n(o),s=r(76),i=r(6),u=r.n(i),l=r(138),f=(r(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,i=a()(e,f),d=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return React.createElement(s.a,c()({className:d},i),n&&React.createElement(l.a,null),React.createElement("span",{className:"wc-block-components-button__text"},o))}},180:function(e,t){},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(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}},191:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(98),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},193:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(21),c=r.n(n),o=r(39),a=r.n(o),s=r(27),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(35);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,d,b;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=f(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,d,b,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=f(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},250:function(e,t){},251:function(e,t){},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r(10);var n=r(127),c=(r(250),function(e){var t=e.errorMessage,r=void 0===t?"":t,c=e.propertyName,o=void 0===c?"":c,a=e.elementId,s=void 0===a?"":a,i=Object(n.b)(),u=i.getValidationError,l=i.getValidationErrorId;if(!r||"string"!=typeof r){var f=u(o)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(s)},r))})},345:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(188);t.a=function(e){return function(t){return function(r){var n=Object(o.a)(e,r);return React.createElement(t,c()({},r,n))}}}},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,c,o=r(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},362:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(5),c=r.n(n),o=r(0),a=r(11),s=r(8),i=r(28),u=r(32),l=r(54),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(s.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,m=b.removeNotice,v=Object(o.useState)(!1),O=c()(v,2),h=O[0],g=O[1],y=Object(o.useRef)(f(n,e));return Object(o.useEffect)((function(){var t=f(n,e);t!==y.current&&(y.current=t)}),[n,e]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:h,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){p(Object(i.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}},368:function(e,t){},369:function(e,t,r){"use strict";var n=r(34),c=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=c},370:function(e,t){},403:function(e,t,r){"use strict";r.r(t);var n=r(345),c=(r(10),r(6)),o=r.n(c),a=r(5),s=r.n(a),i=r(0),u=r(1),l=r(53),f=function(e){return e.is_purchasable||!1},d={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},b=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},p=r(4),m=r.n(p);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h="idle",g=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=d;break;case"set_idle":e=t.status!==h?O(O({},t),{},{status:h}):t;break;case"set_disabled":e="disabled"!==t.status?O(O({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?O(O({},t),{},{quantity:n}):t;break;case"set_request_params":e=O(O({},t),{},{requestParams:O(O({},t.requestParams),o)});break;case"set_processing_response":e=O(O({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?O(O({},t),{},{status:"processing",hasError:!1}):t).hasError?e:O(O({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?O(O({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?O(O({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:O(O({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?O(O({},e),{},{status:h}):e;break;case"set_no_error":e=t.hasError?O(O({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=h),e},y=r(98),j=r(191),E=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(j.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(j.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(j.a)("add_to_cart_before_processing",e)}},w=r(193),_=r(127),P=r(54),k=r(35),R=Object(i.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:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(i.useContext)(R)},A=function(e){var t=e.children,r=e.product,n=e.showFormElements,c=Object(i.useReducer)(g,d),o=s()(c,2),a=o[0],p=o[1],m=Object(i.useReducer)(y.b,{}),v=s()(m,2),O=v[0],h=v[1],j=Object(l.a)(O),C=Object(P.a)(),A=C.addErrorNotice,S=C.removeNotices,N=Object(_.b)().setValidationErrors,D=Object(k.c)(),x=D.isSuccessResponse,T=D.isErrorResponse,V=D.isFailResponse,q=Object(i.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:E(h).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:E(h).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:E(h).onAddToCartBeforeProcessing}}),[h]),I=Object(i.useMemo)((function(){return{resetForm:function(){p({type:"set_pristine"})},submitForm:function(){p({type:"set_before_processing"})},setQuantity:function(e){p(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){p(b(e))},setRequestParams:function(e){p(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){p({type:"set_processing_response",data:e}),p({type:"set_after_processing"})}}}),[]);Object(i.useEffect)((function(){var e=a.status,t=!r.id||!f(r);"disabled"!==e||t?"disabled"!==e&&t&&p({type:"set_disabled"}):p({type:"set_idle"})}),[a.status,r,p]),Object(i.useEffect)((function(){"before_processing"===a.status&&(S("error"),Object(w.a)(j,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&A(t),r&&N(r)})),p({type:"set_idle"})):p({type:"set_processing"})})))}),[a.status,N,A,S,p,j]),Object(i.useEffect)((function(){if("after_processing"===a.status){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(T(e)||V(e))&&r&&(t=!0,A(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(w.b)(j,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");A(c,{id:"add-to-cart"})}p({type:"set_idle"})}));Object(w.b)(j,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?p(b(!0)):p({type:"set_idle"})}))}}),[a.status,a.hasError,a.processingResponse,I,A,T,V,x,j]);var F=function(e){return["simple","variable"].includes(e.type||"simple")}(r),B={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:F,showFormElements:n&&F,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:"idle"===a.status,isDisabled:"disabled"===a.status,isProcessing:"processing"===a.status,isBeforeProcessing:"before_processing"===a.status,isAfterProcessing:"after_processing"===a.status,hasError:a.hasError,eventRegistration:q,dispatchActions:I};return React.createElement(R.Provider,{value:B},t)},S=r(61),N=r.n(S),D=r(28),x=r(32);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var V=function(){var e=C(),t=e.dispatchActions,r=e.product,n=e.quantity,c=e.eventRegistration,o=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(P.a)(),v=p.addErrorNotice,O=p.removeNotice,h=Object(x.a)().receiveCart,g=Object(i.useState)(!1),y=s()(g,2),j=y[0],E=y[1],w=!o&&a,k=Object(i.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(i.useEffect)((function(){var e=c.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[c,k]);var R=Object(i.useCallback)((function(){E(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);N()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){N.a.setNonce(e.headers),e.json().then((function(r){e.ok?h(r):(r.body&&r.body.message?v(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,v,O,h,t,n,l]);return Object(i.useEffect)((function(){w&&!j&&R()}),[w,R,j]),null},q=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_.a,null,React.createElement(A,{product:r,showFormElements:n},t,React.createElement(V,null)))},I=r(101),F=r(7),B=r(249),L=(r(368),r(143)),M=r(152),Q=r(369),W=r(52),H=r(362),K=function(e){var t=e.className,r=e.href,n=e.text,c=e.onClick;return React.createElement(L.a,{className:t,href:r,onClick:c,rel:"nofollow"},n)},J=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,c=e.isDisabled,o=e.isDone,a=e.onClick;return React.createElement(L.a,{className:t,disabled:c,showSpinner:n,onClick:a},o&&r>0?Object(u.sprintf)(
2
  /* translators: %s number of products in cart. */
3
+ Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!o&&React.createElement(M.a,{srcElement:Q.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},U=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,c=e.product,o=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(I.useInnerBlockLayoutContext)().parentName,m=Object(W.a)().dispatchStoreEvent,v=Object(H.a)(c.id||0).cartQuantity,O=Object(i.useState)(!1),h=s()(O,2),g=h[0],y=h[1],j=c.add_to_cart||{url:"",text:""};return Object(i.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||y(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===o)&&r?React.createElement(J,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:v,isDisabled:a,isProcessing:l,isDone:g,onClick:function(){b.submitForm(),m("cart-add-item",{product:c,listName:p})}}):React.createElement(K,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:c,listName:p})}})},Y=function(e){var t=e.disabled,r=e.min,n=e.max,c=e.value,o=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:c,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){o(e.target.value)}})},z=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},G=function(){var e=C(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,o=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(z,null):t.id&&!t.is_in_stock?React.createElement(z,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Y,{value:r,min:n,max:c,disabled:a,onChange:o.setQuantity}),React.createElement(U,null))},X=(r(370),r(46)),$=r.n(X),Z=r(404),ee=r(3),te=r(258),re={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ne=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,c=e.value,a=void 0===c?"":c,s=e.onChange,i=void 0===s?function(){}:s,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,O=t,h=b(O)||{};return Object(ee.useEffect)((function(){a?v(O):p(m()({},O,{message:f,hidden:!0}))}),[a,O,f,v,p]),Object(ee.useEffect)((function(){return function(){v(O)}}),[O,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(Z.a,{label:Object(D.decodeEntities)(t),value:a||"",options:[re].concat($()(n)),onChange:i,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),React.createElement(te.a,{propertyName:O,elementId:O}))},ce=r(49);function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var se=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var le=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,c=Object(l.a)(t),o=Object(l.a)(r),a=Object(i.useState)(0),u=s()(a,2),f=u[0],d=u[1],b=Object(i.useState)({}),p=s()(b,2),v=p[0],O=p[1],h=Object(i.useState)(!1),g=s()(h,2),y=g[0],j=g[1],E=Object(i.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=ae(ae({},r),{},m()({},c,null)),i=o?se(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(c,o,v)}),[v,c,o]);return Object(i.useEffect)((function(){if(!y){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ce.b)(e))return{};var t=Object.keys(e),r={};return 0===t.length||t.forEach((function(t){var n,c=e[t],o=c.terms.filter((function(e){return e.default}));o.length>0&&(r[c.name]=null===(n=o[0])||void 0===n?void 0:n.slug)})),r}(t);e&&O(ue({},e)),j(!0)}}),[v,t,y]),Object(i.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(c).length?d(function(e,t,r){return se(e,t,r)[0]||0}(c,o,v)):f>0&&d(0)}),[v,f,c,o]),Object(i.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(c).map((function(e){return React.createElement(ne,{key:e,attributeName:e,options:E[e],value:v[e],onChange:function(t){O(ue(ue({},v),{},m()({},e,t)))}})})))},fe=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(F.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),c=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===c.length?null:React.createElement(le,{attributes:n,variationAttributes:c,setRequestParams:r.setRequestParams})},de=function(){var e=C(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,o=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(z,null):t.id&&!t.is_in_stock?React.createElement(z,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(fe,{product:t,dispatchers:o}),React.createElement(Y,{value:r,min:n,max:c,disabled:a,onChange:o.setQuantity}),React.createElement(U,null))},be=function(){return React.createElement(U,null)},pe=r(355),me=function(){return React.createElement(pe.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},ve=function(){return React.createElement(me,null)},Oe=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(de,null):"grouped"===r?React.createElement(ve,null):"external"===r?React.createElement(be,null):"simple"===r||"variation"===r?React.createElement(G,null):null:React.createElement(U,null)},he=Object(B.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(I.useProductDataContext)().product,c=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(F.isEmpty)(n)});return React.createElement(q,{product:n,showFormElements:r},React.createElement("div",{className:c},React.createElement(Oe,null)))}));t.default=Object(n.a)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(he)},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(25),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(103);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,i({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,i({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,i({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,i({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,i({},t))}}}),[r]);return i(i(i({notices:t},u),l),{},{setIsSuppressed:c})}},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,c=r(4),o=r.n(c),a=r(7);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,f=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),i(i({},e),{},o()({},c,f))}}}}]);
build/atomic-block-components/add-to-cart.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(7);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),i(i({},e),{},o()({},c,b))}}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(37),c=r.n(n),o=r(5),a=r.n(o),s=r(16),i=r.n(s),u=r(8),l=r.n(u),b=r(0),d=r(7),f=r(34),p=r.n(f);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},g=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),f=Object(b.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(v))):t}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),y={getValidationError:s,setValidationErrors:h,clearValidationError:f,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(b.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},208:function(e,t){},209:function(e,t){},210:function(e,t){},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r||"string"!=typeof r){var d=l(a)||{};if(!d.message||d.hidden)return null;r=d.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p}));var n=r(37),c=r.n(n),o=r(29),a=r.n(o),s=r(22),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var f=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,d,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=b(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:f=e.sent,"object"===c()(f)&&a.push(f),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,d,f,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=b(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return f=d.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},372:function(e,t){},376:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},377:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(8),s=r.n(a),i=r(1),u=r(62),l=r(879),b={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},d=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},f=r(5),p=r.n(f);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v="idle",j=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=b;break;case"set_idle":e=t.status!==v?m(m({},t),{},{status:v}):t;break;case"set_disabled":e="disabled"!==t.status?m(m({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?m(m({},t),{},{quantity:n}):t;break;case"set_request_params":e=m(m({},t),{},{requestParams:m(m({},t.requestParams),o)});break;case"set_processing_response":e=m(m({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?m(m({},t),{},{status:"processing",hasError:!1}):t).hasError?e:m(m({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?m(m({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?m(m({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:m(m({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?m(m({},e),{},{status:v}):e;break;case"set_no_error":e=t.hasError?m(m({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=v),e},h=r(126),g=r(321),y=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(g.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(g.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(g.a)("add_to_cart_before_processing",e)}},E=r(322),_=r(132),w=r(59),P=r(50),k=Object(n.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:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(n.useContext)(k)},A=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(j,b),a=s()(o,2),f=a[0],p=a[1],O=Object(n.useReducer)(h.b,{}),m=s()(O,2),v=m[0],g=m[1],C=Object(u.a)(v),A=Object(w.a)(),S=A.addErrorNotice,x=A.removeNotices,D=Object(_.b)().setValidationErrors,N=Object(P.c)(),V=N.isSuccessResponse,R=N.isErrorResponse,T=N.isFailResponse,q=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:y(g).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:y(g).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:y(g).onAddToCartBeforeProcessing}}),[g]),F=Object(n.useMemo)((function(){return{resetForm:function(){p({type:"set_pristine"})},submitForm:function(){p({type:"set_before_processing"})},setQuantity:function(e){p(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){p(d(e))},setRequestParams:function(e){p(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){p({type:"set_processing_response",data:e}),p({type:"set_after_processing"})}}}),[]);Object(n.useEffect)((function(){var e=f.status,t=!r.id||!Object(l.a)(r);"disabled"!==e||t?"disabled"!==e&&t&&p({type:"set_disabled"}):p({type:"set_idle"})}),[f.status,r,p]),Object(n.useEffect)((function(){"before_processing"===f.status&&(x("error"),Object(E.a)(C,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&D(r)})),p({type:"set_idle"})):p({type:"set_processing"})})))}),[f.status,D,S,x,p,C]),Object(n.useEffect)((function(){if("after_processing"===f.status){var e={processingResponse:f.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(R(e)||T(e))&&r&&(t=!0,S(r,n?{context:n}:void 0))})),t};if(f.hasError)return void Object(E.b)(C,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");S(c,{id:"add-to-cart"})}p({type:"set_idle"})}));Object(E.b)(C,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?p(d(!0)):p({type:"set_idle"})}))}}),[f.status,f.hasError,f.processingResponse,F,S,R,T,V,C]);var B=Object(l.b)(r),I={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:B,showFormElements:c&&B,quantity:f.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:f.requestParams,isIdle:"idle"===f.status,isDisabled:"disabled"===f.status,isProcessing:"processing"===f.status,isBeforeProcessing:"before_processing"===f.status,isAfterProcessing:"after_processing"===f.status,hasError:f.hasError,eventRegistration:q,dispatchActions:F};return Object(n.createElement)(k.Provider,{value:I},t)},S=r(15),x=r.n(S),D=r(25),N=r(43);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var R=function(){var e=C(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(_.b)(),d=b.hasValidationErrors,f=b.showAllValidationErrors,O=Object(w.a)(),m=O.addErrorNotice,v=O.removeNotice,j=Object(N.a)().receiveCart,h=Object(n.useState)(!1),g=s()(h,2),y=g[0],E=g[1],P=!a&&u,k=Object(n.useCallback)((function(){return!d||(f(),{type:"error"})}),[d,f]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var A=Object(n.useCallback)((function(){E(!0),v("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);x()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){x.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?m(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,m,v,j,t,c,l]);return Object(n.useEffect)((function(){P&&!y&&A()}),[P,A,y]),null},T=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(_.a,null,Object(n.createElement)(A,{product:r,showFormElements:c},t,Object(n.createElement)(R,null)))},q=r(45),F=r(7),B=r(86),I=(r(372),r(90)),L=r(66),M=r(567),Q=r(68),W=r(788),H=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(I.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},K=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(I.a,{className:t,disabled:o,showSpinner:c,onClick:s},a&&r>0?Object(i.sprintf)(
2
  /* translators: %s number of products in cart. */
3
- Object(i._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(i.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(L.a,{srcElement:M.a,alt:Object(i.__)("Done","woo-gutenberg-products-block")}))},U=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,d=e.hasError,f=e.dispatchActions,p=Object(q.useInnerBlockLayoutContext)().parentName,O=Object(Q.a)().dispatchStoreEvent,m=Object(W.a)(o.id||0).cartQuantity,v=Object(n.useState)(!1),j=s()(v,2),h=j[0],g=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[b,d]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(K,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){f.submitForm(),O("cart-add-item",{product:o,listName:p})}}):Object(n.createElement)(H,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(i.__)("View Product","woo-gutenberg-products-block"),onClick:function(){O("product-view-link",{product:o,listName:p})}})},z=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},G=function(e){var t=e.reason,r=void 0===t?Object(i.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},J=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(G,null):t.id&&!t.is_in_stock?Object(n.createElement)(G,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(z,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(U,null))},Y=(r(566),r(33)),X=r.n(Y),$=r(897),Z=r(11),ee=r(234),te={value:"",label:Object(i.__)("Select an option","woo-gutenberg-products-block")},re=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,d=void 0===b?Object(i.__)("Please select a value.","woo-gutenberg-products-block"):b,f=Object(_.b)(),O=f.getValidationError,m=f.setValidationErrors,v=f.clearValidationError,j=t,h=O(j)||{};return Object(Z.useEffect)((function(){s?v(j):m(p()({},j,{message:d,hidden:!0}))}),[s,j,d,v,m]),Object(Z.useEffect)((function(){return function(){v(j)}}),[j,v]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)($.a,{label:Object(D.decodeEntities)(t),value:s||"",options:[te].concat(X()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(ee.a,{propertyName:j,elementId:j}))};function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oe=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ie=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],d=l[1],f=Object(n.useState)({}),O=s()(f,2),m=O[0],v=O[1],j=Object(n.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=ce(ce({},r),{},p()({},c,null)),i=o?oe(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return oe(e,t,r)[0]||0}(o,a,m)):b>0&&d(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(re,{key:e,attributeName:e,options:j[e],value:m[e],onChange:function(t){v(se(se({},m),{},p()({},e,t)))}})})))},ue=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(F.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(ie,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},le=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(G,null):t.id&&!t.is_in_stock?Object(n.createElement)(G,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(ue,{product:t,dispatchers:a}),Object(n.createElement)(z,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(U,null))},be=function(){return Object(n.createElement)(U,null)},de=r(891),fe=function(){return Object(n.createElement)(de.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},pe=function(){return Object(n.createElement)(fe,null)},Oe=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(le,null):"grouped"===r?Object(n.createElement)(pe,null):"external"===r?Object(n.createElement)(be,null):"simple"===r||"variation"===r?Object(n.createElement)(J,null):null:Object(n.createElement)(U,null)};t.a=Object(B.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(q.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(F.isEmpty)(c)});return Object(n.createElement)(T,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(Oe,null)))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},566:function(e,t){},567:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},879:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),s=r(0),i=r(182),u=r(6),l=r.n(u),b=r(114),d=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,d),f=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(s.createElement)(i.a,c()({className:f},u),n&&Object(s.createElement)(b.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}},903:function(e,t,r){"use strict";r.r(t);var n=r(900),c=r(377),o=r(376);t.default=Object(n.a)(o.a)(c.a)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(7);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),i(i({},e),{},o()({},c,b))}}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(38),c=r.n(n),o=r(5),a=r.n(o),s=r(16),i=r.n(s),u=r(8),l=r.n(u),b=r(0),f=r(7),d=r(34),p=r.n(d);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},g=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(v))):t}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(f.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),y={getValidationError:s,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(b.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},208:function(e,t){},209:function(e,t){},210:function(e,t){},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r||"string"!=typeof r){var f=l(a)||{};if(!f.message||f.hidden)return null;r=f.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(38),c=r.n(n),o=r(29),a=r.n(o),s=r(22),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return f(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=b(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,f,d,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=b(a),e.prev=3,s.s();case 5:if((f=s.n()).done){e.next=28;break}return d=f.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},372:function(e,t){},376:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},377:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(8),s=r.n(a),i=r(1),u=r(62),l=r(879),b={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},f=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},d=r(5),p=r.n(d);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v="idle",j=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=b;break;case"set_idle":e=t.status!==v?m(m({},t),{},{status:v}):t;break;case"set_disabled":e="disabled"!==t.status?m(m({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?m(m({},t),{},{quantity:n}):t;break;case"set_request_params":e=m(m({},t),{},{requestParams:m(m({},t.requestParams),o)});break;case"set_processing_response":e=m(m({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?m(m({},t),{},{status:"processing",hasError:!1}):t).hasError?e:m(m({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?m(m({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?m(m({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:m(m({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?m(m({},e),{},{status:v}):e;break;case"set_no_error":e=t.hasError?m(m({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=v),e},h=r(126),g=r(321),y=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(g.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(g.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(g.a)("add_to_cart_before_processing",e)}},E=r(322),_=r(132),w=r(59),P=r(50),k=Object(n.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:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(n.useContext)(k)},A=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(j,b),a=s()(o,2),d=a[0],p=a[1],O=Object(n.useReducer)(h.b,{}),m=s()(O,2),v=m[0],g=m[1],C=Object(u.a)(v),A=Object(w.a)(),S=A.addErrorNotice,x=A.removeNotices,D=Object(_.b)().setValidationErrors,N=Object(P.c)(),V=N.isSuccessResponse,R=N.isErrorResponse,T=N.isFailResponse,q=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:y(g).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:y(g).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:y(g).onAddToCartBeforeProcessing}}),[g]),F=Object(n.useMemo)((function(){return{resetForm:function(){p({type:"set_pristine"})},submitForm:function(){p({type:"set_before_processing"})},setQuantity:function(e){p(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){p(f(e))},setRequestParams:function(e){p(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){p({type:"set_processing_response",data:e}),p({type:"set_after_processing"})}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(l.a)(r);"disabled"!==e||t?"disabled"!==e&&t&&p({type:"set_disabled"}):p({type:"set_idle"})}),[d.status,r,p]),Object(n.useEffect)((function(){"before_processing"===d.status&&(x("error"),Object(E.a)(C,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&D(r)})),p({type:"set_idle"})):p({type:"set_processing"})})))}),[d.status,D,S,x,p,C]),Object(n.useEffect)((function(){if("after_processing"===d.status){var e={processingResponse:d.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(R(e)||T(e))&&r&&(t=!0,S(r,n?{context:n}:void 0))})),t};if(d.hasError)return void Object(E.b)(C,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");S(c,{id:"add-to-cart"})}p({type:"set_idle"})}));Object(E.b)(C,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?p(f(!0)):p({type:"set_idle"})}))}}),[d.status,d.hasError,d.processingResponse,F,S,R,T,V,C]);var B=Object(l.b)(r),I={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:B,showFormElements:c&&B,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:"idle"===d.status,isDisabled:"disabled"===d.status,isProcessing:"processing"===d.status,isBeforeProcessing:"before_processing"===d.status,isAfterProcessing:"after_processing"===d.status,hasError:d.hasError,eventRegistration:q,dispatchActions:F};return Object(n.createElement)(k.Provider,{value:I},t)},S=r(15),x=r.n(S),D=r(25),N=r(43);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var R=function(){var e=C(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(_.b)(),f=b.hasValidationErrors,d=b.showAllValidationErrors,O=Object(w.a)(),m=O.addErrorNotice,v=O.removeNotice,j=Object(N.a)().receiveCart,h=Object(n.useState)(!1),g=s()(h,2),y=g[0],E=g[1],P=!a&&u,k=Object(n.useCallback)((function(){return!f||(d(),{type:"error"})}),[f,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var A=Object(n.useCallback)((function(){E(!0),v("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);x()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){x.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?m(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,m,v,j,t,c,l]);return Object(n.useEffect)((function(){P&&!y&&A()}),[P,A,y]),null},T=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(_.a,null,Object(n.createElement)(A,{product:r,showFormElements:c},t,Object(n.createElement)(R,null)))},q=r(45),F=r(7),B=r(86),I=(r(372),r(90)),L=r(66),M=r(567),Q=r(68),W=r(788),H=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(I.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},K=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(I.a,{className:t,disabled:o,showSpinner:c,onClick:s},a&&r>0?Object(i.sprintf)(
2
  /* translators: %s number of products in cart. */
3
+ Object(i._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(i.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(L.a,{srcElement:M.a,alt:Object(i.__)("Done","woo-gutenberg-products-block")}))},U=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(q.useInnerBlockLayoutContext)().parentName,O=Object(Q.a)().dispatchStoreEvent,m=Object(W.a)(o.id||0).cartQuantity,v=Object(n.useState)(!1),j=s()(v,2),h=j[0],g=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||g(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(K,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){d.submitForm(),O("cart-add-item",{product:o,listName:p})}}):Object(n.createElement)(H,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(i.__)("View Product","woo-gutenberg-products-block"),onClick:function(){O("product-view-link",{product:o,listName:p})}})},z=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},G=function(e){var t=e.reason,r=void 0===t?Object(i.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},J=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(G,null):t.id&&!t.is_in_stock?Object(n.createElement)(G,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(z,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(U,null))},Y=(r(566),r(33)),X=r.n(Y),$=r(897),Z=r(11),ee=r(234),te={value:"",label:Object(i.__)("Select an option","woo-gutenberg-products-block")},re=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,f=void 0===b?Object(i.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(_.b)(),O=d.getValidationError,m=d.setValidationErrors,v=d.clearValidationError,j=t,h=O(j)||{};return Object(Z.useEffect)((function(){s?v(j):m(p()({},j,{message:f,hidden:!0}))}),[s,j,f,v,m]),Object(Z.useEffect)((function(){return function(){v(j)}}),[j,v]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)($.a,{label:Object(D.decodeEntities)(t),value:s||"",options:[te].concat(X()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(ee.a,{propertyName:j,elementId:j}))},ne=r(72);function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ae=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ue=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],f=l[1],d=Object(n.useState)({}),O=s()(d,2),m=O[0],v=O[1],j=Object(n.useState)(!1),h=s()(j,2),g=h[0],y=h[1],E=Object(n.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=oe(oe({},r),{},p()({},c,null)),i=o?ae(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){if(!g){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ne.b)(e))return{};var t=Object.keys(e),r={};return 0===t.length||t.forEach((function(t){var n,c=e[t],o=c.terms.filter((function(e){return e.default}));o.length>0&&(r[c.name]=null===(n=o[0])||void 0===n?void 0:n.slug)})),r}(t);e&&v(ie({},e)),y(!0)}}),[m,t,g]),Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?f(function(e,t,r){return ae(e,t,r)[0]||0}(o,a,m)):b>0&&f(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(re,{key:e,attributeName:e,options:E[e],value:m[e],onChange:function(t){v(ie(ie({},m),{},p()({},e,t)))}})})))},le=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(F.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(ue,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},be=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(G,null):t.id&&!t.is_in_stock?Object(n.createElement)(G,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(le,{product:t,dispatchers:a}),Object(n.createElement)(z,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(U,null))},fe=function(){return Object(n.createElement)(U,null)},de=r(891),pe=function(){return Object(n.createElement)(de.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Oe=function(){return Object(n.createElement)(pe,null)},me=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(be,null):"grouped"===r?Object(n.createElement)(Oe,null):"external"===r?Object(n.createElement)(fe,null):"simple"===r||"variation"===r?Object(n.createElement)(J,null):null:Object(n.createElement)(U,null)};t.a=Object(B.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(q.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(F.isEmpty)(c)});return Object(n.createElement)(T,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(me,null)))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},566:function(e,t){},567:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},879:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),s=r(0),i=r(182),u=r(6),l=r.n(u),b=r(114),f=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,f),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(s.createElement)(i.a,c()({className:d},u),n&&Object(s.createElement)(b.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}},903:function(e,t,r){"use strict";r.r(t);var n=r(900),c=r(377),o=r(376);t.default=Object(n.a)(o.a)(c.a)}}]);
build/atomic-block-components/price-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{140:function(e,r,c){"use strict";var t=c(4),a=c.n(t),n=c(1),o=c(69),l=c(6),i=c.n(l),u=(c(10),c(62)),s=c(0),p=(c(183),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,l=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
- Object(n.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(u.formatPrice)(t),Object(u.formatPrice)(c))),React.createElement("span",{"aria-hidden":!0},React.createElement(o.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:t,style:l})," — ",React.createElement(o.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:c,style:l})))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,l=e.priceClassName,u=e.priceStyle,s=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:r,renderText:function(e){return React.createElement("del",{className:i()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:r,renderText:function(e){return React.createElement("ins",{className:i()("wc-block-components-product-price__value","is-discounted",l),style:u},e)},value:s}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,n=e.format,l=void 0===n?"<price/>":n,u=e.maxPrice,d=void 0===u?null:u,b=e.minPrice,f=void 0===b?null:b,y=e.price,g=void 0===y?null:y,v=e.priceClassName,_=e.priceStyle,O=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,j=i()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=O&&g!==O,S=React.createElement("span",{className:i()("wc-block-components-product-price__value",v)});return w?S=React.createElement(m,{currency:t,price:g,priceClassName:v,priceStyle:_,regularPrice:O,regularPriceClassName:P,regularPriceStyle:N}):null!==f&&null!==d?S=React.createElement(p,{currency:t,maxPrice:d,minPrice:f,priceClassName:v,priceStyle:_}):null!==g&&(S=React.createElement(o.a,{className:i()("wc-block-components-product-price__value",v),currency:t,value:g,style:_})),React.createElement("span",{className:j},Object(s.createInterpolateElement)(l,{price:S}))}},147:function(e,r){},183:function(e,r){},357:function(e,r,c){"use strict";c.d(r,"a",(function(){return a})),c(275);var t=c(83),a=function(){return t.m>1}},387:function(e,r,c){"use strict";c.r(r);var t=c(4),a=c.n(t),n=(c(10),c(6)),o=c.n(n),l=c(140),i=c(62),u=c(101),s=c(274),p=c(357),m=c(249);r.default=Object(m.withProductDataContext)((function(e){var r,c,t,n,m,d,b,f=e.className,y=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,O=e.customSaleFontSize,P=e.color,N=e.customColor,j=e.saleColor,w=e.customSaleColor,S=Object(u.useInnerBlockLayoutContext)().parentClassName,C=Object(u.useProductDataContext)().product,E=o()(f,a()({},"".concat(S,"__product-price"),S));if(!C.id)return React.createElement(l.a,{align:y,className:E});var R=Object(s.getColorClassName)("color",P),x=Object(s.getFontSizeClass)(g),h=Object(s.getColorClassName)("color",j),k=Object(s.getFontSizeClass)(_),z=o()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,R,R),a()(r,x,x),r)),F=o()((c={"has-text-color":j||w,"has-font-size":_||O},a()(c,h,h),a()(c,k,k),c)),D={color:N,fontSize:v},T={color:w,fontSize:O},V=C.prices,B=Object(i.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,U=I?o()((t={},a()(t,"".concat(S,"__product-price__value"),S),a()(t,F,Object(p.a)()),t)):o()((n={},a()(n,"".concat(S,"__product-price__value"),S),a()(n,z,Object(p.a)()),n)),J=I?T:D;return React.createElement(l.a,{align:y,className:E,currency:B,price:V.price,priceClassName:U,priceStyle:Object(p.a)()?J:{},minPrice:null==V||null===(m=V.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.max_amount,regularPrice:V.regular_price,regularPriceClassName:o()((b={},a()(b,"".concat(S,"__product-price__regular"),S),a()(b,z,Object(p.a)()),b)),regularPriceStyle:Object(p.a)()?D:{}})}))},69:function(e,r,c){"use strict";var t=c(14),a=c.n(t),n=c(4),o=c.n(n),l=c(23),i=c.n(l),u=c(126),s=c(6),p=c.n(s),m=(c(147),["className","value","currency","onValueChange","displayType"]);function d(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function b(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?d(Object(c),!0).forEach((function(r){o()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,o=e.displayType,l=void 0===o?"text":o,s=i()(e,m),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var f=d/Math.pow(10,t.minorUnit);if(!Number.isFinite(f))return null;var y=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),g=b(b(b({},s),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return React.createElement(u.a,a()({className:y,displayType:l},g,{value:f,onValueChange:v}))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{140:function(e,r,c){"use strict";var t=c(4),a=c.n(t),n=c(1),o=c(69),l=c(6),i=c.n(l),u=(c(10),c(58)),s=c(0),p=(c(183),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,l=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
+ Object(n.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(u.formatPrice)(t),Object(u.formatPrice)(c))),React.createElement("span",{"aria-hidden":!0},React.createElement(o.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:t,style:l})," — ",React.createElement(o.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:c,style:l})))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,l=e.priceClassName,u=e.priceStyle,s=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:r,renderText:function(e){return React.createElement("del",{className:i()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),React.createElement(o.a,{currency:r,renderText:function(e){return React.createElement("ins",{className:i()("wc-block-components-product-price__value","is-discounted",l),style:u},e)},value:s}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,n=e.format,l=void 0===n?"<price/>":n,u=e.maxPrice,d=void 0===u?null:u,b=e.minPrice,f=void 0===b?null:b,y=e.price,g=void 0===y?null:y,v=e.priceClassName,_=e.priceStyle,O=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,j=i()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=O&&g!==O,S=React.createElement("span",{className:i()("wc-block-components-product-price__value",v)});return w?S=React.createElement(m,{currency:t,price:g,priceClassName:v,priceStyle:_,regularPrice:O,regularPriceClassName:P,regularPriceStyle:N}):null!==f&&null!==d?S=React.createElement(p,{currency:t,maxPrice:d,minPrice:f,priceClassName:v,priceStyle:_}):null!==g&&(S=React.createElement(o.a,{className:i()("wc-block-components-product-price__value",v),currency:t,value:g,style:_})),React.createElement("span",{className:j},Object(s.createInterpolateElement)(l,{price:S}))}},147:function(e,r){},183:function(e,r){},357:function(e,r,c){"use strict";c.d(r,"a",(function(){return a})),c(275);var t=c(83),a=function(){return t.m>1}},387:function(e,r,c){"use strict";c.r(r);var t=c(4),a=c.n(t),n=(c(10),c(6)),o=c.n(n),l=c(140),i=c(58),u=c(101),s=c(274),p=c(357),m=c(249);r.default=Object(m.withProductDataContext)((function(e){var r,c,t,n,m,d,b,f=e.className,y=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,O=e.customSaleFontSize,P=e.color,N=e.customColor,j=e.saleColor,w=e.customSaleColor,S=Object(u.useInnerBlockLayoutContext)().parentClassName,C=Object(u.useProductDataContext)().product,E=o()(f,a()({},"".concat(S,"__product-price"),S));if(!C.id)return React.createElement(l.a,{align:y,className:E});var R=Object(s.getColorClassName)("color",P),x=Object(s.getFontSizeClass)(g),h=Object(s.getColorClassName)("color",j),k=Object(s.getFontSizeClass)(_),z=o()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,R,R),a()(r,x,x),r)),F=o()((c={"has-text-color":j||w,"has-font-size":_||O},a()(c,h,h),a()(c,k,k),c)),D={color:N,fontSize:v},T={color:w,fontSize:O},V=C.prices,B=Object(i.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,U=I?o()((t={},a()(t,"".concat(S,"__product-price__value"),S),a()(t,F,Object(p.a)()),t)):o()((n={},a()(n,"".concat(S,"__product-price__value"),S),a()(n,z,Object(p.a)()),n)),J=I?T:D;return React.createElement(l.a,{align:y,className:E,currency:B,price:V.price,priceClassName:U,priceStyle:Object(p.a)()?J:{},minPrice:null==V||null===(m=V.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.max_amount,regularPrice:V.regular_price,regularPriceClassName:o()((b={},a()(b,"".concat(S,"__product-price__regular"),S),a()(b,z,Object(p.a)()),b)),regularPriceStyle:Object(p.a)()?D:{}})}))},69:function(e,r,c){"use strict";var t=c(14),a=c.n(t),n=c(4),o=c.n(n),l=c(23),i=c.n(l),u=c(126),s=c(6),p=c.n(s),m=(c(147),["className","value","currency","onValueChange","displayType"]);function d(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function b(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?d(Object(c),!0).forEach((function(r){o()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,o=e.displayType,l=void 0===o?"text":o,s=i()(e,m),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var f=d/Math.pow(10,t.minorUnit);if(!Number.isFinite(f))return null;var y=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),g=b(b(b({},s),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return React.createElement(u.a,a()({className:y,displayType:l},g,{value:f,onValueChange:v}))}}}]);
build/atomic-block-components/summary.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{155:function(t,e,c){"use strict";var n=c(0),r=c(119),o=c(91),a=function(t){var e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},u=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(t,e){return t.replace(/[\s|\.\,]+$/i,"")+e},i=function(t,e){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=u(t),r=n.split(" ").splice(0,e).join(" ");return Object(o.autop)(s(r,c))},l=function(t,e){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",r=u(t),a=r.slice(0,e);if(c)return Object(o.autop)(s(a,n));var i=a.match(/([\s]+)/g),l=i?i.length:0,p=r.slice(0,e+l);return Object(o.autop)(s(p,n))};e.a=function(t){var e=t.source,c=t.maxLength,u=void 0===c?15:c,s=t.countType,p=void 0===s?"words":s,d=t.className,m=void 0===d?"":d,v=Object(n.useMemo)((function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(t),u=Object(r.count)(n,c);if(u<=e)return n;var s=a(n),p=Object(r.count)(s,c);return p<=e?s:"words"===c?i(s,e):l(s,e,"characters_including_spaces"===c)}(e,u,p)}),[e,u,p]);return Object(n.createElement)(n.RawHTML,{className:m},v)}},486:function(t,e,c){"use strict";c.r(e);var n=c(5),r=c.n(n),o=c(0),a=(c(2),c(6)),u=c.n(a),s=c(155),i=c(38),l=c(45),p=c(86);c(561),e.default=Object(p.withProductDataContext)((function(t){var e=t.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c)),source:a,maxLength:150,countType:i.o.wordCountType||"words"}):null}))},561:function(t,e){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{155:function(t,e,c){"use strict";var n=c(0),r=c(119),o=c(91),a=function(t){var e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},u=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(t,e){return t.replace(/[\s|\.\,]+$/i,"")+e},i=function(t,e){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=u(t),r=n.split(" ").splice(0,e).join(" ");return Object(o.autop)(s(r,c))},l=function(t,e){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",r=u(t),a=r.slice(0,e);if(c)return Object(o.autop)(s(a,n));var i=a.match(/([\s]+)/g),l=i?i.length:0,p=r.slice(0,e+l);return Object(o.autop)(s(p,n))};e.a=function(t){var e=t.source,c=t.maxLength,u=void 0===c?15:c,s=t.countType,p=void 0===s?"words":s,d=t.className,m=void 0===d?"":d,v=Object(n.useMemo)((function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(t),u=Object(r.count)(n,c);if(u<=e)return n;var s=a(n),p=Object(r.count)(s,c);return p<=e?s:"words"===c?i(s,e):l(s,e,"characters_including_spaces"===c)}(e,u,p)}),[e,u,p]);return Object(n.createElement)(n.RawHTML,{className:m},v)}},486:function(t,e,c){"use strict";c.r(e);var n=c(5),r=c.n(n),o=c(0),a=(c(2),c(6)),u=c.n(a),s=c(155),i=c(37),l=c(45),p=c(86);c(561),e.default=Object(p.withProductDataContext)((function(t){var e=t.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c)),source:a,maxLength:150,countType:i.o.wordCountType||"words"}):null}))},561:function(t,e){}}]);
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-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '9bb6687730539c5e22b0e42300f63dbf');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c847f9ae0a7b1475786ec96fd457fdf4');
build/attribute-filter-frontend.js CHANGED
@@ -8,7 +8,7 @@ Object(u._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e))
8
  /* translators: Remove chip. */
9
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
10
  /* translators: %s text of the chip to remove. */
11
- Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var j={"aria-label":n,disabled:d,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},I=v?j:{},S=v?{"aria-hidden":!0}:j;return React.createElement(f,o()({},x,I,{className:c()(i,"is-removable"),element:v?"button":x.element,screenReaderText:w,text:y}),React.createElement(_,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},197:function(e,t){},198:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},20:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},202:function(e,t,n){"use strict";e.exports=n(293)},216:function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(23),a=n.n(i),u=n(34),c=["className","size"],s=function(e){var t=e.className,n=e.size,r=a()(e,c);return React.createElement(u.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(s,null);t.a=l},223:function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(4),o=n.n(r),i=n(46),a=n.n(i),u=n(20),c=n.n(u),s=n(5),l=n.n(s),p=n(0),d=n(115),f=n(7),m=n(53),b=n(90),g=n(120),h=n(64);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,o=e.queryState,i=Object(h.a)();i="".concat(i,"-collection-data");var u=Object(b.a)(i),s=l()(u,1)[0],v=Object(b.b)("calculate_attribute_counts",[],i),O=l()(v,2),w=O[0],x=O[1],_=Object(b.b)("calculate_price_range",null,i),E=l()(_,2),j=E[0],I=E[1],S=Object(b.b)("calculate_stock_status_counts",null,i),k=l()(S,2),R=k[0],P=k[1],C=Object(m.a)(t||{}),M=Object(m.a)(n),T=Object(m.a)(r);Object(p.useEffect)((function(){"object"===c()(C)&&Object.keys(C).length&&(w.find((function(e){return e.taxonomy===C.taxonomy}))||x([].concat(a()(w),[C])))}),[C,w,x]),Object(p.useEffect)((function(){j!==M&&void 0!==M&&I(M)}),[M,I,j]),Object(p.useEffect)((function(){R!==T&&void 0!==T&&P(T)}),[T,P,R]);var D=Object(p.useState)(!1),A=l()(D,2),H=A[0],N=A[1],L=Object(d.a)(H,200),B=l()(L,1)[0];H||N(!0);var V=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(f.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(s)}),[s]);return Object(g.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:y(y({},o),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},V),shouldSelect:B})}},23:function(e,t,n){var r=n(77);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29: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.default=e.exports,e.exports.__esModule=!0},290:function(e,t,n){e.exports=n(311)},291:function(e,t){},292:function(e,t){},293:function(e,t,n){"use strict";var r=60103,o=60106,i=60107,a=60108,u=60114,c=60109,s=60110,l=60112,p=60113,d=60120,f=60115,m=60116,b=60121,g=60122,h=60117,v=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),o=O("react.portal"),i=O("react.fragment"),a=O("react.strict_mode"),u=O("react.profiler"),c=O("react.provider"),s=O("react.context"),l=O("react.forward_ref"),p=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),m=O("react.lazy"),b=O("react.block"),g=O("react.server.block"),h=O("react.fundamental"),v=O("react.debug_trace_mode"),y=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case u:case a:case p:case d:return e;default:switch(e=e&&e.$$typeof){case s:case l:case m:case f:case c:return e;default:return t}}case o:return t}}}var x=c,_=r,E=l,j=i,I=m,S=f,k=o,R=u,P=a,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=_,t.ForwardRef=E,t.Fragment=j,t.Lazy=I,t.Memo=S,t.Portal=k,t.Profiler=R,t.StrictMode=P,t.Suspense=C,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===s},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===l},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===f},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===u},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===v||e===a||e===p||e===d||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===f||e.$$typeof===c||e.$$typeof===s||e.$$typeof===l||e.$$typeof===h||e.$$typeof===b||e[0]===g)},t.typeOf=w},3:function(e,t){e.exports=window.React},30:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},311:function(e,t,n){"use strict";n.r(t);var r=n(128),o=n(107),i=n(4),a=n.n(i),u=n(5),c=n.n(u),s=n(1),l=n(33),p=n(53),d=n(99),f=n(90),m=n(120),b=n(223),g=n(0),h=n(171),v=n(10),y=n.n(v),O=n(6),w=n.n(O);function x(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function _(){return(_=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)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var I=n(3);function S(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function k(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function R(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return k(n.overflowY,t)||k(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function P(e,t,n,r,o,i,a,u){return i<e&&a>t||i>e&&a<t?0:i<=e&&u<=n||a>=t&&u>=n?i-e-r:a>t&&u<n||i<e&&u>n?a-t+o:0}n(202);var C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create,Object.create;var M=0;function T(e){return"function"==typeof e?e:D}function D(){}function A(e,t){e&&function(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,u=t.skipOverflowHiddenElements,c="function"==typeof a?a:function(e){return e!==a};if(!S(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,l=[],p=e;S(p)&&c(p);){if((p=p.parentElement)===s){l.push(p);break}null!=p&&p===document.body&&R(p)&&!R(document.documentElement)||null!=p&&R(p,u)&&l.push(p)}for(var d=n.visualViewport?n.visualViewport.width:innerWidth,f=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),h=g.height,v=g.width,y=g.top,O=g.right,w=g.bottom,x=g.left,_="start"===o||"nearest"===o?y:"end"===o?w:y+h/2,E="center"===i?x+v/2:"end"===i?O:x,j=[],I=0;I<l.length;I++){var k=l[I],C=k.getBoundingClientRect(),M=C.height,T=C.width,D=C.top,A=C.right,H=C.bottom,N=C.left;if("if-needed"===r&&y>=0&&x>=0&&w<=f&&O<=d&&y>=D&&w<=H&&x>=N&&O<=A)return j;var L=getComputedStyle(k),B=parseInt(L.borderLeftWidth,10),V=parseInt(L.borderTopWidth,10),K=parseInt(L.borderRightWidth,10),F=parseInt(L.borderBottomWidth,10),q=0,U=0,$="offsetWidth"in k?k.offsetWidth-k.clientWidth-B-K:0,W="offsetHeight"in k?k.offsetHeight-k.clientHeight-V-F:0;if(s===k)q="start"===o?_:"end"===o?_-f:"nearest"===o?P(b,b+f,f,V,F,b+_,b+_+h,h):_-f/2,U="start"===i?E:"center"===i?E-d/2:"end"===i?E-d:P(m,m+d,d,B,K,m+E,m+E+v,v),q=Math.max(0,q+b),U=Math.max(0,U+m);else{q="start"===o?_-D-V:"end"===o?_-H+F+W:"nearest"===o?P(D,H,M,V,F+W,_,_+h,h):_-(D+M/2)+W/2,U="start"===i?E-N-B:"center"===i?E-(N+T/2)+$/2:"end"===i?E-A+K+$:P(N,A,T,B,K+$,E,E+v,v);var G=k.scrollLeft,Y=k.scrollTop;_+=Y-(q=Math.max(0,Math.min(Y+q,k.scrollHeight-M+W))),E+=G-(U=Math.max(0,Math.min(G+U,k.scrollWidth-T+$)))}j.push({el:k,top:q,left:U})}return j}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function H(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function N(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function L(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function V(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function K(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var F=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function q(e){void 0===e&&(e={});var t={};return F.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function U(e,t){return void 0!==e[t]}function $(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function W(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);var u=G(e,a,n,r,o);return-1===u?t>=n?-1:t:u}function G(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a<n;a++)if(!r(a).hasAttribute("disabled"))return a}else for(var u=t-1;u>=0;u--)if(!r(u).hasAttribute("disabled"))return u;return o?e>0?G(1,0,n,r,!1):G(-1,n-1,n,r,!1):-1}function Y(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(H(t,e,n)||r&&H(t,n.document.activeElement,n))}))}var z=N((function(e){X(e).textContent=""}),500);function Q(e,t){var n=X(t);e&&(n.textContent=e,z(t))}function X(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var J=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Z=["refKey","ref"],ee=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],te=["onKeyDown","onBlur","onChange","onInput","onChangeText"],ne=["refKey","ref"],re=["onMouseMove","onMouseDown","onClick","onPress","index","item"],oe=function(){var e=function(e){var t,n;function r(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+String(M++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=q(t),n.internalSetState(_({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=q(t),n.internalSetState(_({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,_({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var u=a?e(t):e;u=n.props.stateReducer(t,u),r=u.hasOwnProperty("selectedItem");var c={},s={};return r&&u.selectedItem!==t.selectedItem&&(o=u.selectedItem),u.type=u.type||0,Object.keys(u).forEach((function(e){t[e]!==u[e]&&(i[e]=u[e]),"type"!==e&&(s[e]=u[e],U(n.props,e)||(c[e]=u[e]))})),a&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,_({},n.getStateAndHelpers(),u)),c}),(function(){T(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=x(o,Z),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=l;var p=n.getState().isOpen;return _(((r={})[a]=B(u,n.rootRef),r.role="combobox",r["aria-expanded"]=p,r["aria-haspopup"]="listbox",r["aria-owns"]=p?n.menuId:null,r["aria-labelledby"]=n.labelId,r),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=W(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=W(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(_({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=_({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=_({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=G(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=G(-1,r-1,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var o=t.onKeyDown,i=t.onKeyUp,a=t.onBlur,u=x(t,ee),c=n.getState().isOpen,s={onClick:L(r,n.buttonHandleClick),onKeyDown:L(o,n.buttonHandleKeyDown),onKeyUp:L(i,n.buttonHandleKeyUp),onBlur:L(a,n.buttonHandleBlur)};return _({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},u.disabled?{}:s,u)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=$(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(E(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return _({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput;t.onChangeText;var u,c=x(t,te),s={},l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;return c.disabled||((u={}).onChange=L(i,a,n.inputHandleChange),u.onKeyDown=L(r,n.inputHandleKeyDown),u.onBlur=L(o,n.inputHandleBlur),s=u),_({"aria-autocomplete":"list","aria-activedescendant":d&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":d?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:p,id:n.inputId},s,c)},n.inputHandleKeyDown=function(e){var t=$(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(E(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=x(o,ne),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=l,_(((r={})[a]=B(u,n.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:n.labelId,r.id=n.menuId,r),c)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick;r.onPress;var u=r.index,c=r.item,s=void 0===c?void 0:c,l=x(r,re);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var p=a,d=((t={onMouseMove:L(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:L(i,(function(e){e.preventDefault()}))}).onClick=L(p,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return _({id:n.getItemId(u),role:"option","aria-selected":n.getState().highlightedIndex===u},f,l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.selectedItem;return _({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.isOpen;return _({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),T(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=N((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(_({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,Q(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,u=r.defaultIsOpen,c=r.initialIsOpen,s=void 0===c?u:c,l=r.initialInputValue,p=void 0===l?"":l,d=r.initialSelectedItem,f=void 0===d?null:d,m=n.getState({highlightedIndex:a,isOpen:s,inputValue:p,selectedItem:f});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,j(t,n);var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},o.getState=function(e){return void 0===e&&(e=this.state),t=e,n=this.props,Object.keys(t).reduce((function(e,r){return e[r]=U(n,r)?n[r]:t[r],e}),{});var t,n},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=W(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,u=this.getRootProps,c=this.getToggleButtonProps,s=this.getLabelProps,l=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,f=this.openMenu,m=this.closeMenu,b=this.toggleMenu,g=this.selectItem,h=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,O=this.clearSelection,w=this.clearItems;return{getRootProps:u,getToggleButtonProps:c,getLabelProps:s,getMenuProps:l,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:f,closeMenu:m,toggleMenu:b,selectItem:g,selectItemAtIndex:h,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:O,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Y(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=Y(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",r),a.addEventListener("touchmove",o),a.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",r),a.removeEventListener("touchmove",o),a.removeEventListener("touchend",i)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){U(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=K(this.props.children,D);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=K(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:function(e){return"string"==typeof e.type}(t)?Object(I.cloneElement)(t,this.getRootProps(function(e){return e.props}(t))):void 0:null},r}(I.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:V,itemToString:function(e){return null==e?"":String(e)},onStateChange:D,onInputValueChange:D,onUserAction:D,onChange:D,onSelect:D,onOuterClick:D,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:A},e.stateChangeTypes=J,e}();N((function(e,t){Q(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?I.useLayoutEffect:I.useEffect;var ie={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:A,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),C(C({},ie),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}}),y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),_({},ie,{getA11yStatusMessage:V,circularNavigation:!0}),y.a.array,y.a.array,y.a.array,y.a.func,y.a.func,y.a.func,y.a.number,y.a.number,y.a.number,y.a.func,y.a.func,y.a.string,y.a.string,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})});var ae=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,o=e.isDisabled,i=e.onFocus,a=e.onRemoveItem,u=e.placeholder,c=e.tabIndex,s=e.value;return React.createElement("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:o,onFocus:i,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&a(t[t.length-1])},placeholder:u,tabIndex:c}))},ue=function(e){var t=e.children,n=e.onClick;return React.createElement("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},ce=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,o=e.highlightedIndex,i=e.options;return React.createElement("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),i.map((function(e,r){var i=t.includes(e.value);return React.createElement("li",n({key:e.value,className:w()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":i,"is-highlighted":o===r}),index:r,item:e.value,"aria-label":i?Object(s.sprintf)(
12
  /* translators: %s is referring to the filter option being removed. */
13
  Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},se=n(194),le=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(se.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(s.sprintf)(
14
  /* translators: %s is referring to the filter option being removed. */
@@ -24,4 +24,4 @@ Object(s.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o
24
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
25
  Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):i&&Object(l.speak)(Object(s.sprintf)(
26
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
27
- Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),i))},i=u.includes(e);F?(n=u.filter((function(t){return t!==e})),i?o({filterRemoved:e}):(n.push(e),n.sort(),o({filterAdded:e}))):(n=i?[]:[e],o({filterAdded:i?null:e,filterRemoved:1===u.length?u[0]:null})),v(n),t.showFilterButton||K(n)}),[u,w,F,K,t.showFilterButton]);if(0===w.length&&!C)return null;var U="h".concat(t.headingLevel),$=!t.isPreview&&C,W=!t.isPreview&&A;return React.createElement(React.Fragment,null,!r&&t.heading&&React.createElement(U,{className:"wc-block-attribute-filter__title"},t.heading),React.createElement("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?React.createElement(ge,{attributeLabel:o.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:$,multiple:F,onChange:q,options:w}):React.createElement(h.a,{className:"wc-block-attribute-filter-list",options:w,checked:u,onChange:q,isLoading:$,isDisabled:W}),t.showFilterButton&&React.createElement(ve.a,{className:"wc-block-attribute-filter__button",disabled:$||W,onClick:function(){return K(u)}})))})),getProps:function(e){return{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}}}})},33:function(e,t){e.exports=window.wp.a11y},34:function(e,t){e.exports=window.wp.primitives},4: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.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,n){var r=n(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,n){var r=n(20).default,o=n(29);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,n){"use strict";var r=n(40),o=n.n(r),i=n(41),a=n.n(i),u=n(29),c=n.n(u),s=n(42),l=n.n(s),p=n(43),d=n.n(p),f=n(30),m=n.n(f),b=n(4),g=n.n(b),h=(n(10),n(3)),v=n(1),y=n(83),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.l,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,i=e.text,a=void 0===i?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):i,u=e.errorMessage,c=e.errorMessagePrefix,s=void 0===c?Object(v.__)("Error:","woo-gutenberg-products-block"):c,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(81);var w=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(c()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(i,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,a=e.renderError,u=e.button,c=this.state,s=c.errorMessage;return c.hasError?"function"==typeof a?a({errorMessage:s}):React.createElement(O,{errorMessage:r?s:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i,button:u}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(h.Component);w.defaultProps={showErrorMessage:!0},t.a=w},46:function(e,t,n){var r=n(94),o=n(95),i=n(67),a=n(96);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},5:function(e,t,n){var r=n(84),o=n(85),i=n(67),a=n(86);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(0),a=n(6),u=n.n(a);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,c=void 0===a?{}:a,l=null!=n,p=null!=r;return!l&&p?(t=o||"span",c=s(s({},c),{},{className:u()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||i.Fragment,l&&p&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))}},53:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(25),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},6: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 a=o.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var u in r)n.call(r,u)&&r[u]&&e.push(u);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)}()},64:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},67:function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,n){"use strict";var r=n(80);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},82:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),a=Object(r.useRef)([]),u=n.leading,c=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var f=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,a.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return p.current=!1,function(){p.current=!0}}),[]);var m=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!u||s.current||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;u&&s.current&&(t=!1),f(),!p.current&&c&&t&&d.current.apply(d,e)}),t),o&&!i.current&&c&&(i.current=setTimeout((function(){var e=a.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,u,c]),b=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,a.current),f())}),[f]);return[m,f,b]}},83:function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return a})),n.d(t,"k",(function(){return u})),n.d(t,"m",(function(){return c})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return p})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return b})),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),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=i.pluginUrl+"images/",u=i.pluginUrl+"build/",c=i.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,d=(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"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return b}));var r=n(5),o=n.n(r),i=n(8),a=n(11),u=n(0),c=n(25),s=n.n(c),l=n(53),p=n(99),d=n(64),f=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e,r])]},m=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(a.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),c=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){c(n,e,t)}),[n,e,c])]},b=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),a=i[0],c=i[1],m=Object(l.a)(a),b=Object(l.a)(e),g=Object(p.a)(b),h=Object(u.useRef)(!1);return Object(u.useEffect)((function(){s()(g,b)||(c(Object.assign({},m,b)),h.current=!0)}),[m,b,g,c]),h.current?[a,c]:[e,c]}},94:function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},95:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},99:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}}});
8
  /* translators: Remove chip. */
9
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
10
  /* translators: %s text of the chip to remove. */
11
+ Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var j={"aria-label":n,disabled:d,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},I=v?j:{},S=v?{"aria-hidden":!0}:j;return React.createElement(f,o()({},x,I,{className:c()(i,"is-removable"),element:v?"button":x.element,screenReaderText:w,text:y}),React.createElement(_,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},197:function(e,t){},198:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},202:function(e,t,n){"use strict";e.exports=n(293)},21:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},216:function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(23),a=n.n(i),u=n(34),c=["className","size"],s=function(e){var t=e.className,n=e.size,r=a()(e,c);return React.createElement(u.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(s,null);t.a=l},223:function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(4),o=n.n(r),i=n(46),a=n.n(i),u=n(21),c=n.n(u),s=n(5),l=n.n(s),p=n(0),d=n(115),f=n(7),m=n(53),b=n(90),g=n(120),h=n(64);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,o=e.queryState,i=Object(h.a)();i="".concat(i,"-collection-data");var u=Object(b.a)(i),s=l()(u,1)[0],v=Object(b.b)("calculate_attribute_counts",[],i),O=l()(v,2),w=O[0],x=O[1],_=Object(b.b)("calculate_price_range",null,i),E=l()(_,2),j=E[0],I=E[1],S=Object(b.b)("calculate_stock_status_counts",null,i),k=l()(S,2),R=k[0],P=k[1],C=Object(m.a)(t||{}),M=Object(m.a)(n),T=Object(m.a)(r);Object(p.useEffect)((function(){"object"===c()(C)&&Object.keys(C).length&&(w.find((function(e){return e.taxonomy===C.taxonomy}))||x([].concat(a()(w),[C])))}),[C,w,x]),Object(p.useEffect)((function(){j!==M&&void 0!==M&&I(M)}),[M,I,j]),Object(p.useEffect)((function(){R!==T&&void 0!==T&&P(T)}),[T,P,R]);var D=Object(p.useState)(!1),A=l()(D,2),H=A[0],N=A[1],L=Object(d.a)(H,200),B=l()(L,1)[0];H||N(!0);var V=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(f.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(s)}),[s]);return Object(g.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:y(y({},o),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},V),shouldSelect:B})}},23:function(e,t,n){var r=n(77);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29: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.default=e.exports,e.exports.__esModule=!0},290:function(e,t,n){e.exports=n(312)},291:function(e,t){},292:function(e,t){},293:function(e,t,n){"use strict";var r=60103,o=60106,i=60107,a=60108,u=60114,c=60109,s=60110,l=60112,p=60113,d=60120,f=60115,m=60116,b=60121,g=60122,h=60117,v=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),o=O("react.portal"),i=O("react.fragment"),a=O("react.strict_mode"),u=O("react.profiler"),c=O("react.provider"),s=O("react.context"),l=O("react.forward_ref"),p=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),m=O("react.lazy"),b=O("react.block"),g=O("react.server.block"),h=O("react.fundamental"),v=O("react.debug_trace_mode"),y=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case u:case a:case p:case d:return e;default:switch(e=e&&e.$$typeof){case s:case l:case m:case f:case c:return e;default:return t}}case o:return t}}}var x=c,_=r,E=l,j=i,I=m,S=f,k=o,R=u,P=a,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=_,t.ForwardRef=E,t.Fragment=j,t.Lazy=I,t.Memo=S,t.Portal=k,t.Profiler=R,t.StrictMode=P,t.Suspense=C,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===s},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===l},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===f},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===u},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===v||e===a||e===p||e===d||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===f||e.$$typeof===c||e.$$typeof===s||e.$$typeof===l||e.$$typeof===h||e.$$typeof===b||e[0]===g)},t.typeOf=w},3:function(e,t){e.exports=window.React},30:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},312:function(e,t,n){"use strict";n.r(t);var r=n(128),o=n(107),i=n(4),a=n.n(i),u=n(5),c=n.n(u),s=n(1),l=n(33),p=n(53),d=n(99),f=n(90),m=n(120),b=n(223),g=n(0),h=n(171),v=n(10),y=n.n(v),O=n(6),w=n.n(O);function x(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function _(){return(_=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)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var I=n(3);function S(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function k(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function R(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return k(n.overflowY,t)||k(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function P(e,t,n,r,o,i,a,u){return i<e&&a>t||i>e&&a<t?0:i<=e&&u<=n||a>=t&&u>=n?i-e-r:a>t&&u<n||i<e&&u>n?a-t+o:0}n(202);var C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create,Object.create;var M=0;function T(e){return"function"==typeof e?e:D}function D(){}function A(e,t){e&&function(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,u=t.skipOverflowHiddenElements,c="function"==typeof a?a:function(e){return e!==a};if(!S(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,l=[],p=e;S(p)&&c(p);){if((p=p.parentElement)===s){l.push(p);break}null!=p&&p===document.body&&R(p)&&!R(document.documentElement)||null!=p&&R(p,u)&&l.push(p)}for(var d=n.visualViewport?n.visualViewport.width:innerWidth,f=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),h=g.height,v=g.width,y=g.top,O=g.right,w=g.bottom,x=g.left,_="start"===o||"nearest"===o?y:"end"===o?w:y+h/2,E="center"===i?x+v/2:"end"===i?O:x,j=[],I=0;I<l.length;I++){var k=l[I],C=k.getBoundingClientRect(),M=C.height,T=C.width,D=C.top,A=C.right,H=C.bottom,N=C.left;if("if-needed"===r&&y>=0&&x>=0&&w<=f&&O<=d&&y>=D&&w<=H&&x>=N&&O<=A)return j;var L=getComputedStyle(k),B=parseInt(L.borderLeftWidth,10),V=parseInt(L.borderTopWidth,10),K=parseInt(L.borderRightWidth,10),F=parseInt(L.borderBottomWidth,10),q=0,U=0,$="offsetWidth"in k?k.offsetWidth-k.clientWidth-B-K:0,W="offsetHeight"in k?k.offsetHeight-k.clientHeight-V-F:0;if(s===k)q="start"===o?_:"end"===o?_-f:"nearest"===o?P(b,b+f,f,V,F,b+_,b+_+h,h):_-f/2,U="start"===i?E:"center"===i?E-d/2:"end"===i?E-d:P(m,m+d,d,B,K,m+E,m+E+v,v),q=Math.max(0,q+b),U=Math.max(0,U+m);else{q="start"===o?_-D-V:"end"===o?_-H+F+W:"nearest"===o?P(D,H,M,V,F+W,_,_+h,h):_-(D+M/2)+W/2,U="start"===i?E-N-B:"center"===i?E-(N+T/2)+$/2:"end"===i?E-A+K+$:P(N,A,T,B,K+$,E,E+v,v);var G=k.scrollLeft,Y=k.scrollTop;_+=Y-(q=Math.max(0,Math.min(Y+q,k.scrollHeight-M+W))),E+=G-(U=Math.max(0,Math.min(G+U,k.scrollWidth-T+$)))}j.push({el:k,top:q,left:U})}return j}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function H(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function N(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function L(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function V(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function K(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var F=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function q(e){void 0===e&&(e={});var t={};return F.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function U(e,t){return void 0!==e[t]}function $(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function W(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);var u=G(e,a,n,r,o);return-1===u?t>=n?-1:t:u}function G(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a<n;a++)if(!r(a).hasAttribute("disabled"))return a}else for(var u=t-1;u>=0;u--)if(!r(u).hasAttribute("disabled"))return u;return o?e>0?G(1,0,n,r,!1):G(-1,n-1,n,r,!1):-1}function Y(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(H(t,e,n)||r&&H(t,n.document.activeElement,n))}))}var z=N((function(e){X(e).textContent=""}),500);function Q(e,t){var n=X(t);e&&(n.textContent=e,z(t))}function X(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var J=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Z=["refKey","ref"],ee=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],te=["onKeyDown","onBlur","onChange","onInput","onChangeText"],ne=["refKey","ref"],re=["onMouseMove","onMouseDown","onClick","onPress","index","item"],oe=function(){var e=function(e){var t,n;function r(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+String(M++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=q(t),n.internalSetState(_({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=q(t),n.internalSetState(_({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,_({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var u=a?e(t):e;u=n.props.stateReducer(t,u),r=u.hasOwnProperty("selectedItem");var c={},s={};return r&&u.selectedItem!==t.selectedItem&&(o=u.selectedItem),u.type=u.type||0,Object.keys(u).forEach((function(e){t[e]!==u[e]&&(i[e]=u[e]),"type"!==e&&(s[e]=u[e],U(n.props,e)||(c[e]=u[e]))})),a&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,_({},n.getStateAndHelpers(),u)),c}),(function(){T(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=x(o,Z),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=l;var p=n.getState().isOpen;return _(((r={})[a]=B(u,n.rootRef),r.role="combobox",r["aria-expanded"]=p,r["aria-haspopup"]="listbox",r["aria-owns"]=p?n.menuId:null,r["aria-labelledby"]=n.labelId,r),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=W(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=W(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(_({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=_({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=_({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=G(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=G(-1,r-1,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var o=t.onKeyDown,i=t.onKeyUp,a=t.onBlur,u=x(t,ee),c=n.getState().isOpen,s={onClick:L(r,n.buttonHandleClick),onKeyDown:L(o,n.buttonHandleKeyDown),onKeyUp:L(i,n.buttonHandleKeyUp),onBlur:L(a,n.buttonHandleBlur)};return _({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},u.disabled?{}:s,u)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=$(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(E(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return _({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput;t.onChangeText;var u,c=x(t,te),s={},l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;return c.disabled||((u={}).onChange=L(i,a,n.inputHandleChange),u.onKeyDown=L(r,n.inputHandleKeyDown),u.onBlur=L(o,n.inputHandleBlur),s=u),_({"aria-autocomplete":"list","aria-activedescendant":d&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":d?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:p,id:n.inputId},s,c)},n.inputHandleKeyDown=function(e){var t=$(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(E(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=x(o,ne),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=l,_(((r={})[a]=B(u,n.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:n.labelId,r.id=n.menuId,r),c)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick;r.onPress;var u=r.index,c=r.item,s=void 0===c?void 0:c,l=x(r,re);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var p=a,d=((t={onMouseMove:L(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:L(i,(function(e){e.preventDefault()}))}).onClick=L(p,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return _({id:n.getItemId(u),role:"option","aria-selected":n.getState().highlightedIndex===u},f,l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.selectedItem;return _({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.isOpen;return _({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),T(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=N((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(_({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,Q(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,u=r.defaultIsOpen,c=r.initialIsOpen,s=void 0===c?u:c,l=r.initialInputValue,p=void 0===l?"":l,d=r.initialSelectedItem,f=void 0===d?null:d,m=n.getState({highlightedIndex:a,isOpen:s,inputValue:p,selectedItem:f});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,j(t,n);var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},o.getState=function(e){return void 0===e&&(e=this.state),t=e,n=this.props,Object.keys(t).reduce((function(e,r){return e[r]=U(n,r)?n[r]:t[r],e}),{});var t,n},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=W(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,u=this.getRootProps,c=this.getToggleButtonProps,s=this.getLabelProps,l=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,f=this.openMenu,m=this.closeMenu,b=this.toggleMenu,g=this.selectItem,h=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,O=this.clearSelection,w=this.clearItems;return{getRootProps:u,getToggleButtonProps:c,getLabelProps:s,getMenuProps:l,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:f,closeMenu:m,toggleMenu:b,selectItem:g,selectItemAtIndex:h,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:O,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Y(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=Y(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",r),a.addEventListener("touchmove",o),a.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",r),a.removeEventListener("touchmove",o),a.removeEventListener("touchend",i)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){U(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=K(this.props.children,D);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=K(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:function(e){return"string"==typeof e.type}(t)?Object(I.cloneElement)(t,this.getRootProps(function(e){return e.props}(t))):void 0:null},r}(I.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:V,itemToString:function(e){return null==e?"":String(e)},onStateChange:D,onInputValueChange:D,onUserAction:D,onChange:D,onSelect:D,onOuterClick:D,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:A},e.stateChangeTypes=J,e}();N((function(e,t){Q(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?I.useLayoutEffect:I.useEffect;var ie={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:A,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),C(C({},ie),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}}),y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),_({},ie,{getA11yStatusMessage:V,circularNavigation:!0}),y.a.array,y.a.array,y.a.array,y.a.func,y.a.func,y.a.func,y.a.number,y.a.number,y.a.number,y.a.func,y.a.func,y.a.string,y.a.string,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})});var ae=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,o=e.isDisabled,i=e.onFocus,a=e.onRemoveItem,u=e.placeholder,c=e.tabIndex,s=e.value;return React.createElement("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:o,onFocus:i,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&a(t[t.length-1])},placeholder:u,tabIndex:c}))},ue=function(e){var t=e.children,n=e.onClick;return React.createElement("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},ce=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,o=e.highlightedIndex,i=e.options;return React.createElement("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),i.map((function(e,r){var i=t.includes(e.value);return React.createElement("li",n({key:e.value,className:w()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":i,"is-highlighted":o===r}),index:r,item:e.value,"aria-label":i?Object(s.sprintf)(
12
  /* translators: %s is referring to the filter option being removed. */
13
  Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},se=n(194),le=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(se.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(s.sprintf)(
14
  /* translators: %s is referring to the filter option being removed. */
24
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
25
  Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):i&&Object(l.speak)(Object(s.sprintf)(
26
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
27
+ Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),i))},i=u.includes(e);F?(n=u.filter((function(t){return t!==e})),i?o({filterRemoved:e}):(n.push(e),n.sort(),o({filterAdded:e}))):(n=i?[]:[e],o({filterAdded:i?null:e,filterRemoved:1===u.length?u[0]:null})),v(n),t.showFilterButton||K(n)}),[u,w,F,K,t.showFilterButton]);if(0===w.length&&!C)return null;var U="h".concat(t.headingLevel),$=!t.isPreview&&C,W=!t.isPreview&&A;return React.createElement(React.Fragment,null,!r&&t.heading&&React.createElement(U,{className:"wc-block-attribute-filter__title"},t.heading),React.createElement("div",{className:"wc-block-attribute-filter style-".concat(t.displayStyle)},"dropdown"===t.displayStyle?React.createElement(ge,{attributeLabel:o.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:$,multiple:F,onChange:q,options:w}):React.createElement(h.a,{className:"wc-block-attribute-filter-list",options:w,checked:u,onChange:q,isLoading:$,isDisabled:W}),t.showFilterButton&&React.createElement(ve.a,{className:"wc-block-attribute-filter__button",disabled:$||W,onClick:function(){return K(u)}})))})),getProps:function(e){return{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}}}})},33:function(e,t){e.exports=window.wp.a11y},34:function(e,t){e.exports=window.wp.primitives},4: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.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,n){var r=n(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,n){var r=n(21).default,o=n(29);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,n){"use strict";var r=n(40),o=n.n(r),i=n(41),a=n.n(i),u=n(29),c=n.n(u),s=n(42),l=n.n(s),p=n(43),d=n.n(p),f=n(30),m=n.n(f),b=n(4),g=n.n(b),h=(n(10),n(3)),v=n(1),y=n(83),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.l,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,i=e.text,a=void 0===i?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):i,u=e.errorMessage,c=e.errorMessagePrefix,s=void 0===c?Object(v.__)("Error:","woo-gutenberg-products-block"):c,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(81);var w=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(c()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(i,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,a=e.renderError,u=e.button,c=this.state,s=c.errorMessage;return c.hasError?"function"==typeof a?a({errorMessage:s}):React.createElement(O,{errorMessage:r?s:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i,button:u}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(h.Component);w.defaultProps={showErrorMessage:!0},t.a=w},46:function(e,t,n){var r=n(94),o=n(95),i=n(67),a=n(96);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},5:function(e,t,n){var r=n(84),o=n(85),i=n(67),a=n(86);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(0),a=n(6),u=n.n(a);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,c=void 0===a?{}:a,l=null!=n,p=null!=r;return!l&&p?(t=o||"span",c=s(s({},c),{},{className:u()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||i.Fragment,l&&p&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))}},53:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(25),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},6: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 a=o.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var u in r)n.call(r,u)&&r[u]&&e.push(u);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)}()},64:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},67:function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,n){"use strict";var r=n(80);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},82:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),a=Object(r.useRef)([]),u=n.leading,c=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var f=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,a.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return p.current=!1,function(){p.current=!0}}),[]);var m=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!u||s.current||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;u&&s.current&&(t=!1),f(),!p.current&&c&&t&&d.current.apply(d,e)}),t),o&&!i.current&&c&&(i.current=setTimeout((function(){var e=a.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,u,c]),b=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,a.current),f())}),[f]);return[m,f,b]}},83:function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return a})),n.d(t,"k",(function(){return u})),n.d(t,"m",(function(){return c})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return p})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return b})),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),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=i.pluginUrl+"images/",u=i.pluginUrl+"build/",c=i.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,d=(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"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return b}));var r=n(5),o=n.n(r),i=n(8),a=n(11),u=n(0),c=n(25),s=n.n(c),l=n(53),p=n(99),d=n(64),f=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e,r])]},m=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(a.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),c=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){c(n,e,t)}),[n,e,c])]},b=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),a=i[0],c=i[1],m=Object(l.a)(a),b=Object(l.a)(e),g=Object(p.a)(b),h=Object(u.useRef)(!1);return Object(u.useEffect)((function(){s()(g,b)||(c(Object.assign({},m,b)),h.current=!0)}),[m,b,g,c]),h.current?[a,c]:[e,c]}},94:function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},95:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},99:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}}});
build/attribute-filter.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => '2b4d77b797ff5411c630dff82f646da5');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'e23a6669926e72cf50a02dd296f8d9a5');
build/attribute-filter.js CHANGED
@@ -10,7 +10,7 @@ Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var x={"aria-label
10
  /* translators: %s is referring the remaining count of options */
11
  Object(i._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(i.sprintf)(
12
  /* translators: %s number of options to reveal. */
13
- Object(i._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[u,w,h]),E=Object(l.useMemo)((function(){return h&&Object(l.createElement)("li",{key:"show-less",className:"show-less"},Object(l.createElement)("button",{onClick:function(){y(!1)},"aria-expanded":!0,"aria-label":Object(i.__)("Show less options","woo-gutenberg-products-block")},Object(i.__)("Show less","woo-gutenberg-products-block")))}),[h]),x=Object(l.useMemo)((function(){var e=u.length>w+5;return Object(l.createElement)(l.Fragment,null,u.map((function(t,n){return Object(l.createElement)(l.Fragment,{key:t.value},Object(l.createElement)("li",e&&!h&&n>=w&&{hidden:!0},Object(l.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:O}),Object(l.createElement)("label",{htmlFor:t.value},t.label)),e&&n===w-1&&k)})),e&&E)}),[u,r,d,h,w,E,k,O]),P=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":f},t);return Object(l.createElement)("ul",{className:P},f?_:x)}},3:function(e,t){e.exports=window.wc.wcSettings},305:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=n(28),u=["className","size"],s=Object(l.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,u);return Object(l.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(l.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},363:function(e,t){},364:function(e,t){},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),l=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",i=u(u({},i),{},{className:l()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,s&&b&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},46:function(e,t){e.exports=window.wp.keycodes},493:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),c=n.n(r),o=n(33),a=n.n(o),l=n(37),i=n.n(l),u=n(8),s=n.n(u),b=n(0),d=n(287),p=n(7),f=n(62),m=n(108),O=n(165),v=n(78);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,c=e.queryState,o=Object(v.a)();o="".concat(o,"-collection-data");var l=Object(m.a)(o),u=s()(l,1)[0],w=Object(m.b)("calculate_attribute_counts",[],o),j=s()(w,2),h=j[0],y=j[1],_=Object(m.b)("calculate_price_range",null,o),k=s()(_,2),E=k[0],x=k[1],P=Object(m.b)("calculate_stock_status_counts",null,o),C=s()(P,2),S=C[0],N=C[1],R=Object(f.a)(t||{}),L=Object(f.a)(n),T=Object(f.a)(r);Object(b.useEffect)((function(){"object"===i()(R)&&Object.keys(R).length&&(h.find((function(e){return e.taxonomy===R.taxonomy}))||y([].concat(a()(h),[R])))}),[R,h,y]),Object(b.useEffect)((function(){E!==L&&void 0!==L&&x(L)}),[L,x,E]),Object(b.useEffect)((function(){S!==T&&void 0!==T&&N(T)}),[T,N,S]);var B=Object(b.useState)(!1),D=s()(B,2),I=D[0],V=D[1],F=Object(d.a)(I,200),M=s()(F,1)[0];I||V(!0);var A=Object(b.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(p.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(u)}),[u]);return Object(O.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:g(g({},c),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},A),shouldSelect:M})}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},797:function(e,t,n){e.exports=n(856)},798:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.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:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"}));t.a=o},799:function(e,t){},800:function(e,t){},801:function(e,t){},856:function(e,t,n){"use strict";n.r(t);var r=n(9),c=n.n(r),o=n(0),a=n(1),l=n(26),i=n(66),u=n(798),s=n(6),b=n.n(s),d=n(8),p=n.n(d),f=n(12),m=n(4),O=n(158),v=n(49),w=n(7),g=n(3),j=n(133),h=n(157),y=n(88),_=n(5),k=n.n(_),E=n(64),x=n(62),P=n(136),C=n(108),S=n(165),N=n(493),R=n(280),L=(n(2),n(243)),T=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,c=e.isDisabled,a=e.onFocus,l=e.onRemoveItem,i=e.placeholder,u=e.tabIndex,s=e.value;return Object(o.createElement)("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:c,onFocus:a,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&l(t[t.length-1])},placeholder:i,tabIndex:u}))},B=function(e){var t=e.children,n=e.onClick;return Object(o.createElement)("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},D=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,c=e.highlightedIndex,l=e.options;return Object(o.createElement)("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),l.map((function(e,r){var l=t.includes(e.value);return Object(o.createElement)("li",n({key:e.value,className:b()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":l,"is-highlighted":c===r}),index:r,item:e.value,"aria-label":l?Object(a.sprintf)(
14
  /* translators: %s is referring to the filter option being removed. */
15
  Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},I=n(220),V=function(e){var t=e.onRemoveItem,n=e.option;return Object(o.createElement)(I.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(a.sprintf)(
16
  /* translators: %s is referring to the filter option being removed. */
@@ -26,8 +26,8 @@ Object(a.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),c
26
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
27
  Object(a.__)("%s filter added.","woo-gutenberg-products-block"),c)):o&&Object(E.speak)(Object(a.sprintf)(
28
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
29
- Object(a.__)("%s filter removed.","woo-gutenberg-products-block"),o))},o=u.includes(e);Y?(n=u.filter((function(t){return t!==e})),o?c({filterRemoved:e}):(n.push(e),n.sort(),c({filterAdded:e}))):(n=o?[]:[e],c({filterAdded:o?null:e,filterRemoved:1===u.length?u[0]:null})),s(n),t.showFilterButton||H(n)}),[u,f,Y,H,t.showFilterButton]);if(0===f.length&&!k)return null;var ee="h".concat(t.headingLevel),te=!t.isPreview&&k,ne=!t.isPreview&&D;return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(ee,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?Object(o.createElement)(z,{attributeLabel:c.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:te,multiple:Y,onChange:X,options:f}):Object(o.createElement)(R.a,{className:"wc-block-attribute-filter-list",options:f,checked:u,onChange:X,isLoading:te,isDisabled:ne}),t.showFilterButton&&Object(o.createElement)(G.a,{className:"wc-block-attribute-filter__button",disabled:te||ne,onClick:function(){return H(u)}})))},te=(n(799),Object(g.getSetting)("attributes",[])),ne=Object(m.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=e.debouncedSpeak,c=t.attributeId,l=t.className,s=t.displayStyle,b=t.heading,d=t.headingLevel,_=t.isPreview,k=t.queryType,E=t.showCounts,x=t.showFilterButton,P=Object(o.useState)(!c&&!_),C=p()(P,2),S=C[0],N=C[1],R=function(e){if(e&&e.length){var t=e[0].id,r=te.find((function(e){return e.attribute_id===t.toString()}));if(r&&c!==t){var o=r.attribute_label;n({attributeId:t,heading:Object(a.sprintf)(
30
  /* translators: %s attribute name. */
31
  Object(a.__)("Filter by %s","woo-gutenberg-products-block"),o)})}}},L=function(e){var t=e.isCompact,n={clear:Object(a.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(a.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:function(e){return Object(a.sprintf)(
32
  /* translators: %d is the number of attributes selected. */
33
- Object(a._n)("%d attribute selected","%d attributes selected",e,"woo-gutenberg-products-block"),e)},updated:Object(a.__)("Product attribute search results updated.","woo-gutenberg-products-block")},r=Object(w.sortBy)(Object(w.toArray)(Object(w.mapValues)(te,(function(e){return{id:parseInt(e.attribute_id,10),name:e.attribute_label}}))),"name");return Object(o.createElement)(v.b,{className:"woocommerce-product-attributes",list:r,selected:r.filter((function(e){return e.id===c})),onChange:R,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(te).length?Object(o.createElement)(m.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{srcElement:u.a}),label:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(a.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("p",null,Object(a.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woo-gutenberg-products-block")),Object(o.createElement)(m.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(g.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(a.__)("Add new attribute","woo-gutenberg-products-block")+" ",Object(o.createElement)(i.a,{srcElement:O.a})),Object(o.createElement)(m.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(a.__)("Learn more","woo-gutenberg-products-block"))):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(f.BlockControls,null,Object(o.createElement)(m.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return N(!S)},isActive:S}]})),Object(o.createElement)(f.InspectorControls,{key:"inspector"},Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(m.ToggleControl,{label:Object(a.__)("Product count","woo-gutenberg-products-block"),help:E?Object(a.__)("Product count is visible.","woo-gutenberg-products-block"):Object(a.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:E,onChange:function(){return n({showCounts:!E})}}),Object(o.createElement)("p",null,Object(a.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(j.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:d,onChange:function(e){return n({headingLevel:e})}})),Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(y.a,{label:Object(a.__)("Query Type","woo-gutenberg-products-block"),help:"and"===k?Object(a.__)("Products that have all of the selected attributes will be shown.","woo-gutenberg-products-block"):Object(a.__)("Products that have any of the selected attributes will be shown.","woo-gutenberg-products-block"),value:k,options:[{label:Object(a.__)("And","woo-gutenberg-products-block"),value:"and"},{label:Object(a.__)("Or","woo-gutenberg-products-block"),value:"or"}],onChange:function(e){return n({queryType:e})}}),Object(o.createElement)(y.a,{label:Object(a.__)("Display Style","woo-gutenberg-products-block"),value:s,options:[{label:Object(a.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(a.__)("Dropdown","woo-gutenberg-products-block"),value:"dropdown"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)(m.ToggleControl,{label:Object(a.__)("Filter button","woo-gutenberg-products-block"),help:x?Object(a.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(a.__)("Products will update as options are selected.","woo-gutenberg-products-block"),checked:x,onChange:function(e){return n({showFilterButton:e})}})),Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),initialOpen:!1},L({isCompact:!0}))),S?Object(o.createElement)(m.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{srcElement:u.a}),label:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(a.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},L({isCompact:!1}),Object(o.createElement)(m.Button,{isPrimary:!0,onClick:function(){N(!1),r(Object(a.__)("Showing Filter Products by Attribute block preview.","woo-gutenberg-products-block"))}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(o.createElement)("div",{className:l},Object(o.createElement)(h.a,{className:"wc-block-attribute-filter__title",headingLevel:d,heading:b,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(m.Disabled,null,Object(o.createElement)(ee,{attributes:t,isEditor:!0}))))}));Object(l.registerBlockType)("woocommerce/attribute-filter",{title:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(i.a,{srcElement:u.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("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},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(a.__)("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:function(e){var t=e.attributes,n=t.className,r=t.showCounts,a=t.queryType,l=t.attributeId,i=t.heading,u=t.headingLevel,s=t.displayStyle,d=t.showFilterButton,p={"data-attribute-id":l,"data-show-counts":r,"data-query-type":a,"data-heading":i,"data-heading-level":u};return"list"!==s&&(p["data-display-style"]=s),d&&(p["data-show-filter-button"]=d),Object(o.createElement)("div",c()({className:b()("is-loading",n)},p),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},87:function(e,t){e.exports=window.ReactDOM},88:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(17),a=n.n(o),l=n(18),i=n.n(l),u=n(13),s=n.n(u),b=n(19),d=n.n(b),p=n(20),f=n.n(p),m=n(10),O=n.n(m),v=n(0),w=n(7),g=n(6),j=n.n(g),h=n(4),y=n(21);n(123);var _=function(e){d()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=O()(t);if(n){var c=O()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return f()(this,e)});function o(){var e;return a()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return i()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,a=n.instanceId,l=n.className,i=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(a);return i&&(e=Object(w.isFunction)(i)?i(o):i),Object(v.createElement)(h.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",l)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(v.createElement)(h.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(v.createElement)(h.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),o}(v.Component);t.a=Object(y.withInstanceId)(_)},89:function(e,t){e.exports=window.wp.viewport},97:function(e,t){e.exports=window.wp.date}});
10
  /* translators: %s is referring the remaining count of options */
11
  Object(i._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(i.sprintf)(
12
  /* translators: %s number of options to reveal. */
13
+ Object(i._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[u,w,h]),E=Object(l.useMemo)((function(){return h&&Object(l.createElement)("li",{key:"show-less",className:"show-less"},Object(l.createElement)("button",{onClick:function(){y(!1)},"aria-expanded":!0,"aria-label":Object(i.__)("Show less options","woo-gutenberg-products-block")},Object(i.__)("Show less","woo-gutenberg-products-block")))}),[h]),x=Object(l.useMemo)((function(){var e=u.length>w+5;return Object(l.createElement)(l.Fragment,null,u.map((function(t,n){return Object(l.createElement)(l.Fragment,{key:t.value},Object(l.createElement)("li",e&&!h&&n>=w&&{hidden:!0},Object(l.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:O}),Object(l.createElement)("label",{htmlFor:t.value},t.label)),e&&n===w-1&&k)})),e&&E)}),[u,r,d,h,w,E,k,O]),P=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":f},t);return Object(l.createElement)("ul",{className:P},f?_:x)}},3:function(e,t){e.exports=window.wc.wcSettings},305:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=n(28),u=["className","size"],s=Object(l.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,u);return Object(l.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(l.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},363:function(e,t){},364:function(e,t){},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),l=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",i=u(u({},i),{},{className:l()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,s&&b&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},46:function(e,t){e.exports=window.wp.keycodes},493:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),c=n.n(r),o=n(33),a=n.n(o),l=n(38),i=n.n(l),u=n(8),s=n.n(u),b=n(0),d=n(287),p=n(7),f=n(62),m=n(108),O=n(165),v=n(78);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,c=e.queryState,o=Object(v.a)();o="".concat(o,"-collection-data");var l=Object(m.a)(o),u=s()(l,1)[0],w=Object(m.b)("calculate_attribute_counts",[],o),j=s()(w,2),h=j[0],y=j[1],_=Object(m.b)("calculate_price_range",null,o),k=s()(_,2),E=k[0],x=k[1],P=Object(m.b)("calculate_stock_status_counts",null,o),C=s()(P,2),S=C[0],N=C[1],R=Object(f.a)(t||{}),L=Object(f.a)(n),T=Object(f.a)(r);Object(b.useEffect)((function(){"object"===i()(R)&&Object.keys(R).length&&(h.find((function(e){return e.taxonomy===R.taxonomy}))||y([].concat(a()(h),[R])))}),[R,h,y]),Object(b.useEffect)((function(){E!==L&&void 0!==L&&x(L)}),[L,x,E]),Object(b.useEffect)((function(){S!==T&&void 0!==T&&N(T)}),[T,N,S]);var B=Object(b.useState)(!1),D=s()(B,2),I=D[0],V=D[1],F=Object(d.a)(I,200),M=s()(F,1)[0];I||V(!0);var A=Object(b.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(p.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(u)}),[u]);return Object(O.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:g(g({},c),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},A),shouldSelect:M})}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},797:function(e,t,n){e.exports=n(856)},798:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.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:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"}));t.a=o},799:function(e,t){},800:function(e,t){},801:function(e,t){},856:function(e,t,n){"use strict";n.r(t);var r=n(9),c=n.n(r),o=n(0),a=n(1),l=n(26),i=n(66),u=n(798),s=n(6),b=n.n(s),d=n(8),p=n.n(d),f=n(12),m=n(4),O=n(158),v=n(49),w=n(7),g=n(3),j=n(133),h=n(157),y=n(88),_=n(5),k=n.n(_),E=n(64),x=n(62),P=n(136),C=n(108),S=n(165),N=n(493),R=n(280),L=(n(2),n(243)),T=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,c=e.isDisabled,a=e.onFocus,l=e.onRemoveItem,i=e.placeholder,u=e.tabIndex,s=e.value;return Object(o.createElement)("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:c,onFocus:a,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&l(t[t.length-1])},placeholder:i,tabIndex:u}))},B=function(e){var t=e.children,n=e.onClick;return Object(o.createElement)("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},D=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,c=e.highlightedIndex,l=e.options;return Object(o.createElement)("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),l.map((function(e,r){var l=t.includes(e.value);return Object(o.createElement)("li",n({key:e.value,className:b()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":l,"is-highlighted":c===r}),index:r,item:e.value,"aria-label":l?Object(a.sprintf)(
14
  /* translators: %s is referring to the filter option being removed. */
15
  Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},I=n(220),V=function(e){var t=e.onRemoveItem,n=e.option;return Object(o.createElement)(I.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(a.sprintf)(
16
  /* translators: %s is referring to the filter option being removed. */
26
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
27
  Object(a.__)("%s filter added.","woo-gutenberg-products-block"),c)):o&&Object(E.speak)(Object(a.sprintf)(
28
  /* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
29
+ Object(a.__)("%s filter removed.","woo-gutenberg-products-block"),o))},o=u.includes(e);Y?(n=u.filter((function(t){return t!==e})),o?c({filterRemoved:e}):(n.push(e),n.sort(),c({filterAdded:e}))):(n=o?[]:[e],c({filterAdded:o?null:e,filterRemoved:1===u.length?u[0]:null})),s(n),t.showFilterButton||H(n)}),[u,f,Y,H,t.showFilterButton]);if(0===f.length&&!k)return null;var ee="h".concat(t.headingLevel),te=!t.isPreview&&k,ne=!t.isPreview&&D;return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(ee,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-".concat(t.displayStyle)},"dropdown"===t.displayStyle?Object(o.createElement)(z,{attributeLabel:c.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:te,multiple:Y,onChange:X,options:f}):Object(o.createElement)(R.a,{className:"wc-block-attribute-filter-list",options:f,checked:u,onChange:X,isLoading:te,isDisabled:ne}),t.showFilterButton&&Object(o.createElement)(G.a,{className:"wc-block-attribute-filter__button",disabled:te||ne,onClick:function(){return H(u)}})))},te=(n(799),Object(g.getSetting)("attributes",[])),ne=Object(m.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=e.debouncedSpeak,c=t.attributeId,l=t.className,s=t.displayStyle,b=t.heading,d=t.headingLevel,_=t.isPreview,k=t.queryType,E=t.showCounts,x=t.showFilterButton,P=Object(o.useState)(!c&&!_),C=p()(P,2),S=C[0],N=C[1],R=function(e){if(e&&e.length){var t=e[0].id,r=te.find((function(e){return e.attribute_id===t.toString()}));if(r&&c!==t){var o=r.attribute_label;n({attributeId:t,heading:Object(a.sprintf)(
30
  /* translators: %s attribute name. */
31
  Object(a.__)("Filter by %s","woo-gutenberg-products-block"),o)})}}},L=function(e){var t=e.isCompact,n={clear:Object(a.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(a.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:function(e){return Object(a.sprintf)(
32
  /* translators: %d is the number of attributes selected. */
33
+ Object(a._n)("%d attribute selected","%d attributes selected",e,"woo-gutenberg-products-block"),e)},updated:Object(a.__)("Product attribute search results updated.","woo-gutenberg-products-block")},r=Object(w.sortBy)(Object(w.toArray)(Object(w.mapValues)(te,(function(e){return{id:parseInt(e.attribute_id,10),name:e.attribute_label}}))),"name");return Object(o.createElement)(v.b,{className:"woocommerce-product-attributes",list:r,selected:r.filter((function(e){return e.id===c})),onChange:R,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(te).length?Object(o.createElement)(m.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{srcElement:u.a}),label:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(a.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("p",null,Object(a.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woo-gutenberg-products-block")),Object(o.createElement)(m.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(g.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(a.__)("Add new attribute","woo-gutenberg-products-block")+" ",Object(o.createElement)(i.a,{srcElement:O.a})),Object(o.createElement)(m.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(a.__)("Learn more","woo-gutenberg-products-block"))):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(f.BlockControls,null,Object(o.createElement)(m.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return N(!S)},isActive:S}]})),Object(o.createElement)(f.InspectorControls,{key:"inspector"},Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(m.ToggleControl,{label:Object(a.__)("Product count","woo-gutenberg-products-block"),help:E?Object(a.__)("Product count is visible.","woo-gutenberg-products-block"):Object(a.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:E,onChange:function(){return n({showCounts:!E})}}),Object(o.createElement)("p",null,Object(a.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(j.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:d,onChange:function(e){return n({headingLevel:e})}})),Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(y.a,{label:Object(a.__)("Query Type","woo-gutenberg-products-block"),help:"and"===k?Object(a.__)("Products that have all of the selected attributes will be shown.","woo-gutenberg-products-block"):Object(a.__)("Products that have any of the selected attributes will be shown.","woo-gutenberg-products-block"),value:k,options:[{label:Object(a.__)("And","woo-gutenberg-products-block"),value:"and"},{label:Object(a.__)("Or","woo-gutenberg-products-block"),value:"or"}],onChange:function(e){return n({queryType:e})}}),Object(o.createElement)(y.a,{label:Object(a.__)("Display Style","woo-gutenberg-products-block"),value:s,options:[{label:Object(a.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(a.__)("Dropdown","woo-gutenberg-products-block"),value:"dropdown"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)(m.ToggleControl,{label:Object(a.__)("Filter button","woo-gutenberg-products-block"),help:x?Object(a.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(a.__)("Products will update as options are selected.","woo-gutenberg-products-block"),checked:x,onChange:function(e){return n({showFilterButton:e})}})),Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),initialOpen:!1},L({isCompact:!0}))),S?Object(o.createElement)(m.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{srcElement:u.a}),label:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(a.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},L({isCompact:!1}),Object(o.createElement)(m.Button,{isPrimary:!0,onClick:function(){N(!1),r(Object(a.__)("Showing Filter Products by Attribute block preview.","woo-gutenberg-products-block"))}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(o.createElement)("div",{className:l},Object(o.createElement)(h.a,{className:"wc-block-attribute-filter__title",headingLevel:d,heading:b,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(m.Disabled,null,Object(o.createElement)(ee,{attributes:t,isEditor:!0}))))}));Object(l.registerBlockType)("woocommerce/attribute-filter",{title:Object(a.__)("Filter Products by Attribute","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(i.a,{srcElement:u.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("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},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(a.__)("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:function(e){var t=e.attributes,n=t.className,r=t.showCounts,a=t.queryType,l=t.attributeId,i=t.heading,u=t.headingLevel,s=t.displayStyle,d=t.showFilterButton,p={"data-attribute-id":l,"data-show-counts":r,"data-query-type":a,"data-heading":i,"data-heading-level":u};return"list"!==s&&(p["data-display-style"]=s),d&&(p["data-show-filter-button"]=d),Object(o.createElement)("div",c()({className:b()("is-loading",n)},p),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},87:function(e,t){e.exports=window.ReactDOM},88:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(17),a=n.n(o),l=n(18),i=n.n(l),u=n(13),s=n.n(u),b=n(19),d=n.n(b),p=n(20),f=n.n(p),m=n(10),O=n.n(m),v=n(0),w=n(7),g=n(6),j=n.n(g),h=n(4),y=n(21);n(123);var _=function(e){d()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=O()(t);if(n){var c=O()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return f()(this,e)});function o(){var e;return a()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return i()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,a=n.instanceId,l=n.className,i=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(a);return i&&(e=Object(w.isFunction)(i)?i(o):i),Object(v.createElement)(h.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",l)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(v.createElement)(h.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(v.createElement)(h.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),o}(v.Component);t.a=Object(y.withInstanceId)(_)},89:function(e,t){e.exports=window.wp.viewport},96:function(e,t){e.exports=window.wp.date}});
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-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-warning'), 'version' => '02366ea96201262bf4652775bf946ef0');
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-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-warning'), 'version' => '59e27b0a737826d43870f2733f3825e6');
build/blocks-checkout.js CHANGED
@@ -1,5 +1,5 @@
1
- this.wc=this.wc||{},this.wc.blocksCheckout=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}return 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=160)}([function(e,t){e.exports=window.wp.element},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.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.i18n},,function(e,t){e.exports=window.lodash},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},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.wcSettings},,function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t,n){var r=n(20),o=n(21),i=n(18),c=n(22);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(2),o="wc/store/cart",i={code:"cart_api_error",message:Object(r.__)("Unable to get cart data from the API.","woo-gutenberg-products-block"),data:{status:500}},c="wc-blocks_cart_update_timestamp"},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.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.React},function(e,t,n){var r=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.dom},,function(e,t,n){var r=n(152);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(43),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(31))},,,function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.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 n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||l||a(d)},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){e.exports=window.wp.keycodes},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.default=e.exports,e.exports.__esModule=!0},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,n){var r=n(155);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(5).default,o=n(34);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"TotalsItem",(function(){return V})),n.d(t,"Subtotal",(function(){return H})),n.d(t,"TotalsTaxes",(function(){return z})),n.d(t,"TotalsFees",(function(){return K})),n.d(t,"mustContain",(function(){return $})),n.d(t,"returnTrue",(function(){return G})),n.d(t,"extensionCartUpdate",(function(){return Z})),n.d(t,"hasValidFills",(function(){return ot})),n.d(t,"useSlot",(function(){return nt})),n.d(t,"createSlotFill",(function(){return it})),n.d(t,"__experimentalRegisterCheckoutFilters",(function(){return lt})),n.d(t,"__experimentalApplyCheckoutFilter",(function(){return ft})),n.d(t,"TotalsWrapper",(function(){return pt})),n.d(t,"hasInnerBlocks",(function(){return mt})),n.d(t,"getRegisteredBlocks",(function(){return ht})),n.d(t,"registerCheckoutBlock",(function(){return gt})),n.d(t,"innerBlockAreas",(function(){return ut})),n.d(t,"ExperimentalOrderMeta",(function(){return jt})),n.d(t,"ExperimentalDiscountsMeta",(function(){return kt})),n.d(t,"ExperimentalOrderShippingPackages",(function(){return Ct})),n.d(t,"Panel",(function(){return Bt})),n.d(t,"SlotFillProvider",(function(){return Ne})),n.d(t,"Button",(function(){return Pn})),n.d(t,"Label",(function(){return Tn}));var r=n(0),o=n(6),i=n.n(o),c=n(15),a=n.n(c),u=n(1),s=n.n(u),l=n(27),f=n.n(l),p=n(17),d=n.n(p);function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(){return(h=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)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){}function O(){}O.resetWarningCache=y;var w=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:O,resetWarningCache:y};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}();function j(){}function S(e){return!!(e||"").match(/\d/)}function x(e){return null==e}function E(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function k(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),i=o[0],c=o[1]||"";return{beforeDecimal:i,afterDecimal:c,hasNagation:n,addNegation:r}}function P(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function _(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function F(e,t,n){return Math.min(Math.max(e,t),n)}function C(e){return Math.max(e.selectionStart,e.selectionEnd)}var T={thousandSeparator:w.oneOfType([w.string,w.oneOf([!0])]),decimalSeparator:w.string,allowedDecimalSeparators:w.arrayOf(w.string),thousandsGroupStyle:w.oneOf(["thousand","lakh","wan"]),decimalScale:w.number,fixedDecimalScale:w.bool,displayType:w.oneOf(["input","text"]),prefix:w.string,suffix:w.string,format:w.oneOfType([w.string,w.func]),removeFormatting:w.func,mask:w.oneOfType([w.string,w.arrayOf(w.string)]),value:w.oneOfType([w.number,w.string]),defaultValue:w.oneOfType([w.number,w.string]),isNumericString:w.bool,customInput:w.elementType,allowNegative:w.bool,allowEmptyFormatting:w.bool,allowLeadingZeros:w.bool,onValueChange:w.func,onKeyDown:w.func,onMouseUp:w.func,onChange:w.func,onFocus:w.func,onBlur:w.func,type:w.oneOf(["text","tel","password"]),isAllowed:w.func,renderText:w.func,getInputRef:w.oneOfType([w.func,w.shape({current:w.any})])},D={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:j,onChange:j,onKeyDown:j,onMouseUp:j,onFocus:j,onBlur:j,isAllowed:function(){return!0}},N=function(e){function t(e){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=!(r=b(t).call(this,e))||"object"!=typeof r&&"function"!=typeof r?g(this):r;var o=e.defaultValue;n.validateProps();var i=n.formatValueProp(o);return n.state={value:i,numAsString:n.removeFormatting(i)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(g(n)),n.onKeyDown=n.onKeyDown.bind(g(n)),n.onMouseUp=n.onMouseUp.bind(g(n)),n.onFocus=n.onFocus.bind(g(n)),n.onBlur=n.onBlur.bind(g(n)),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,i=n.numAsString,c=void 0===i?"":i;if(e!==t){this.validateProps();var a=this.formatNumString(c),u=x(t.value)?a:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(c);(isNaN(l)&&isNaN(f)||l===f)&&a===o&&(null!==r||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),i="-"===e[0];i&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var c=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==c&&(e="".concat(e.substring(0,c),".").concat(e.substring(c+1,e.length).replace(new RegExp(E(r),"g"),""))),i&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,i=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!i||0===o||t||r?"":"|"+E(i)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask ".concat(e," should not contain numeric character;\n "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){_(e,t),setTimeout((function(){e.value===n&&_(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,i=r.suffix,c=r.format;if(""===e)return 0;if(t=F(t,0,e.length),!c){var a="-"===e[0];return F(t,o.length+(a?1:0),e.length-i.length)}if("function"==typeof c)return t;if("#"===c[t]&&S(e[t]))return t;if("#"===c[t-1]&&S(e[t-1]))return t;var u=c.indexOf("#");t=F(t,u,c.lastIndexOf("#")+1);for(var s=c.substring(t,c.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==c[l]||!S(e[l]));)l-=1;return!S(e[f])||"left"===n&&t!==u||t-l<f-t?S(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,i=this.props.format,c=this.state.value,a=this.getNumberRegex(!0),u=(e.match(a)||[]).join(""),s=(t.match(a)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(a)||l===f)&&("0"!==l||!f.match(a)||"0"===f||u.length===s.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof i||c||(r=t.length),this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var i="-"===e[0];i&&(e=e.substring(1,e.length));var c=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==c&&c===e.length-o.length?e.substring(0,c):e,i&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,i=t.length;o<=i;o++){var c=t[o]||"",a=o===i?e.length:e.indexOf(c,n);if(-1===a){r=e;break}r+=e.substring(n,a),n=a+c.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,i=t.length;o<i;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,i=t.suffix,c=t.allowNegative,a=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,p=k(e,c),d=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=P(m,n,r)),s&&(d=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(d,s,a)),o&&(d=o+d),i&&(m+=i),h&&(d="-"+d),d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,i=t.allowEmptyFormatting,c=this.props,a=c.value,u=c.isNumericString,s=!(a=x(a)?e:a)&&0!==a;return s&&i&&(a=""),s&&!i?"":("number"==typeof a&&(a=a.toString(),u=!0),"Infinity"===a&&u&&(a=""),u&&!n&&"number"==typeof r&&(a=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=k(e),i=o.beforeDecimal,c=o.afterDecimal,a=o.hasNagation,u=parseFloat("0.".concat(c||"0")).toFixed(t).split("."),s=i.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=P(u[1]||"",Math.min(t,c.length),n),f=r?".":"";return"".concat(a?"-":"").concat(s).concat(f).concat(l)}(a,r,o)),u?this.formatNumString(a):this.formatInput(a))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,i=n.suffix,c=n.decimalScale,a=n.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-i.length||c&&a&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,i=r.allowNegative,c=r.prefix,a=r.suffix,u=r.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,h=d.selectionEnd,b=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),v=b.start,g=b.end;if(!o&&v===g&&-1!==l.indexOf(n[m])){var y=0===u?"":f;return n.substr(0,m)+y+n.substr(m+1,n.length)}var O=o?0:c.length,w=t.length-(o?0:a.length);if(n.length>t.length||!n.length||v===g||0===m&&h===t.length||m===O&&h===w)return n;if(this.checkIfFormatGotDeleted(v,g,t)&&(n=t),!o){var j=this.removeFormatting(n),S=k(j,i),x=S.beforeDecimal,E=S.afterDecimal,P=S.addNegation,_=e<n.indexOf(f)+1;if(j.length<p.length&&_&&""===x&&!parseFloat(E))return P?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,i=e.numAsString,c=e.caretPos,a=this.props.onValueChange,u=this.state.value;if(n)if(o){if(!c){var s=e.inputValue||n.value,l=C(n);n.value=t,c=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(n,c,t)}else n.value=t;void 0===i&&(i=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:i}),a(this.getValueObject(t,i)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,i=o.isAllowed,c=r.value||"",a=C(t);n=this.correctInputValue(a,c,n);var u=this.formatInput(n)||"",s=this.removeFormatting(u);i(this.getValueObject(u,s))||(u=c),this.updateValue({formattedValue:u,numAsString:s,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,i=t.allowLeadingZeros,c=n.numAsString,a=n.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(c))&&(c=""),i||(c=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(c));var u=this.formatNumString(c);if(u!==a)return this.updateValue({formattedValue:u,numAsString:c,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,c=n.value,a=void 0===c?"":c,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,h=void 0!==s&&l,b=this.getNumberRegex(!1,h),v=new RegExp("-"),g="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:i},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===i){var y=t,O=g?d.indexOf("#"):f.length,w=g?d.lastIndexOf("#")+1:a.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var j="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(a,t,j)}else if("Delete"!==r||b.test(a[t])||v.test(a[t])){if("Backspace"===r&&!b.test(a[t]))if(o<=O+1&&"-"===a[0]&&void 0===d){var S=a.substring(1);this.updateValue({formattedValue:S,caretPos:y,input:n})}else if(!v.test(a[t])){for(;!b.test(a[y-1])&&y>O;)y--;y=this.correctCaretPosition(a,y,"left")}}else for(;!b.test(a[y])&&y<w;)y++;(y!==t||t<O||t>w)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,a),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,i=void 0===o?"":o;if(n===r){var c=this.correctCaretPosition(i,n);c!==n&&this.setPatchedCaretPosition(t,c,i)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,i=n.value,c=void 0===i?"":i,a=t.correctCaretPosition(c,r);a===r||0===r&&o===c.length||t.setPatchedCaretPosition(n,a,c),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,i=r.displayType,c=r.customInput,a=r.renderText,u=r.getInputRef,s=r.format,l=this.state.value,f=(e=this.props,t=T,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),p=h({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0},f,{type:o,value:l,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===i)return a?a(l)||null:d.a.createElement("span",h({},f,{ref:u}),l);if(c){var m=c;return d.a.createElement(m,h({},p,{ref:u}))}return d.a.createElement("input",h({},p,{ref:u}))}}])&&m(n.prototype,r),t}(d.a.Component);N.propTypes=T,N.defaultProps=D;var R=N,M=(n(153),["className","value","currency","onValueChange","displayType"]);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t=e.className,n=e.value,o=e.currency,c=e.onValueChange,u=e.displayType,s=void 0===u?"text":u,l=f()(e,M),p="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(p))return null;var d=p/Math.pow(10,o.minorUnit);if(!Number.isFinite(d))return null;var m=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=A(A(A({},l),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(o)),{},{value:void 0,currency:void 0,onValueChange:void 0}),b=c?function(e){var t=e.value*Math.pow(10,o.minorUnit);c(t)}:function(){};return Object(r.createElement)(R,a()({className:m,displayType:s},h,{value:d,onValueChange:b}))},L=(n(151),function(e){var t=e.value,n=e.currency;return Object(r.isValidElement)(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-item__value"},t):Number.isFinite(t)?Object(r.createElement)(B,{className:"wc-block-components-totals-item__value",currency:n||{},value:t}):null}),V=function(e){var t=e.className,n=e.currency,o=e.label,c=e.value,a=e.description;return Object(r.createElement)("div",{className:i()("wc-block-components-totals-item",t)},Object(r.createElement)("span",{className:"wc-block-components-totals-item__label"},o),Object(r.createElement)(L,{value:c,currency:n}),Object(r.createElement)("div",{className:"wc-block-components-totals-item__description"},a))},U=n(2),W=n(7),H=function(e){var t=e.currency,n=e.values,o=e.className,i=n.total_items,c=n.total_items_tax,a=parseInt(i,10),u=parseInt(c,10);return Object(r.createElement)(V,{className:o,currency:t,label:Object(U.__)("Subtotal","woo-gutenberg-products-block"),value:Object(W.getSetting)("displayCartPricesIncludingTax",!1)?a+u:a})},z=(n(154),function(e){var t=e.currency,n=e.values,o=e.className,c=e.showRateAfterTaxName,a=n.total_tax,u=n.tax_lines;if(!Object(W.getSetting)("taxesEnabled",!0)&&parseInt(a,10)<=0)return null;var s=Object(W.getSetting)("displayItemizedTaxes",!1),l=s&&u.length>0?Object(r.createElement)("div",{className:i()("wc-block-components-totals-taxes",o)},u.map((function(e,n){var o=e.name,i=e.rate,a=e.price,u="".concat(o).concat(c?" ".concat(i):"");return Object(r.createElement)(V,{key:"tax-line-".concat(n),className:"wc-block-components-totals-taxes__grouped-rate",currency:t,label:u,value:parseInt(a,10)})}))," "):null;return s?l:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(V,{className:i()("wc-block-components-totals-taxes",o),currency:t,label:Object(U.__)("Taxes","woo-gutenberg-products-block"),value:parseInt(a,10),description:null}))}),K=function(e){var t=e.currency,n=e.cartFees,o=e.className;return Object(r.createElement)(r.Fragment,null,n.map((function(e,n){var c=e.id,a=e.name,u=e.totals,s=parseInt(u.total,10);if(!s)return null;var l=parseInt(u.total_tax,10);return Object(r.createElement)(V,{key:c||"".concat(n,"-").concat(a),className:i()("wc-block-components-totals-fees",o),currency:t,label:a||Object(U.__)("Fee","woo-gutenberg-products-block"),value:Object(W.getSetting)("displayCartPricesIncludingTax",!1)?s+l:s})})))},$=function(e,t){if(!e.includes(t))throw Error(Object(U.sprintf)(
2
  /* translators: %1$s value passed to filter, %2$s : value that must be included. */
3
- Object(U.__)('Returned value must include %1$s, you passed "%2$s"',"woo-gutenberg-products-block"),e,t));return!0},G=function(){return!0},q=n(10),Y=n(14),Z=function(e){return(0,Object(q.dispatch)(Y.c).applyExtensionCartUpdate)(e)},J=n(9),Q=n.n(J),X=n(11);function ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var te=n(28);function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=Object(r.useContext)(te.a),n=t.slots[e]||{},o=t.fills[e],i=Object(r.useMemo)((function(){return o||[]}),[o]),c=Object(r.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(r.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(r.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(r.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return re(re({},n),{},{updateSlot:c,unregisterSlot:a,fills:i,registerFill:u,unregisterFill:s})}function ie(){return(ie=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)}function ce(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function se(e,t,n){return t&&ue(e.prototype,t),n&&ue(e,n),e}function le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pe(e,t,n){return(pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var de=n(44);function me(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(de.a)(e,t)}var he=n(5),be=n.n(he);function ve(e,t){return!t||"object"!==be()(t)&&"function"!=typeof t?le(e):t}var ge=n(4);function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t){if(e){if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||Oe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e){return function(e){if(Array.isArray(e))return ye(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Oe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var xe=n(45),Ee=n.n(xe);function ke(e){var t=function(e,t){if("object"!==Se(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Se(t)?t:String(t)}function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fe(e){var t,n,o,i,c,a,u,s,l,f,p,d=e.children,m=(t=we(Object(r.useState)({}),2),n=t[0],o=t[1],i=we(Object(r.useState)({}),2),c=i[0],a=i[1],u=Object(r.useCallback)((function(e,t,n){o((function(r){var o=r[e]||{};return _e(_e({},r),{},ee({},e,_e(_e({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),s=Object(r.useCallback)((function(e,t){o((function(n){var r=n[e],o=ce(n,[e].map(ke));return(null==r?void 0:r.ref)===t?o:n}))}),[]),l=Object(r.useCallback)((function(e,t){var r=n[e];if(r&&!Ee()(r.fillProps,t)){r.fillProps=t;var o=c[e];o&&o.map((function(e){return e.current.rerender()}))}}),[n,c]),f=Object(r.useCallback)((function(e,t){a((function(n){return _e(_e({},n),{},ee({},e,[].concat(je(n[e]||[]),[t])))}))}),[]),p=Object(r.useCallback)((function(e,t){a((function(n){return n[e]?_e(_e({},n),{},ee({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(r.useMemo)((function(){return{slots:n,fills:c,registerSlot:u,updateSlot:l,unregisterSlot:s,registerFill:f,unregisterFill:p}}),[n,c,u,l,s,f,p]));return Object(r.createElement)(te.a.Provider,{value:m},d)}var Ce=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Te=Ce.Provider,De=Ce.Consumer,Ne=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).registerSlot=e.registerSlot.bind(le(e)),e.registerFill=e.registerFill.bind(le(e)),e.unregisterSlot=e.unregisterSlot.bind(le(e)),e.unregisterFill=e.unregisterFill.bind(le(e)),e.getSlot=e.getSlot.bind(le(e)),e.getFills=e.getFills.bind(le(e)),e.hasFills=e.hasFills.bind(le(e)),e.subscribe=e.subscribe.bind(le(e)),e.slots={},e.fills={},e.listeners=[],e.contextValue={registerSlot:e.registerSlot,unregisterSlot:e.unregisterSlot,registerFill:e.registerFill,unregisterFill:e.unregisterFill,getSlot:e.getSlot,getFills:e.getFills,hasFills:e.hasFills,subscribe:e.subscribe},e}return se(i,[{key:"registerSlot",value:function(e,t){var n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}},{key:"registerFill",value:function(e,t){this.fills[e]=[].concat(je(this.fills[e]||[]),[t]),this.forceUpdateSlot(e)}},{key:"unregisterSlot",value:function(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}},{key:"unregisterFill",value:function(e,t){this.fills[e]=Object(ge.without)(this.fills[e],t),this.resetFillOccurrence(e),this.forceUpdateSlot(e)}},{key:"getSlot",value:function(e){return this.slots[e]}},{key:"getFills",value:function(e,t){return this.slots[e]!==t?[]:Object(ge.sortBy)(this.fills[e],"occurrence")}},{key:"hasFills",value:function(e){return this.fills[e]&&!!this.fills[e].length}},{key:"resetFillOccurrence",value:function(e){Object(ge.forEach)(this.fills[e],(function(e){e.occurrence=void 0}))}},{key:"forceUpdateSlot",value:function(e){var t=this.getSlot(e);t&&t.forceUpdate()}},{key:"triggerListeners",value:function(){this.listeners.forEach((function(e){return e()}))}},{key:"subscribe",value:function(e){var t=this;return this.listeners.push(e),function(){t.listeners=Object(ge.without)(t.listeners,e)}}},{key:"render",value:function(){return Object(r.createElement)(Te,{value:this.contextValue},Object(r.createElement)(Fe,null,this.props.children))}}]),i}(r.Component);var Re=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(le(e)),e}return se(i,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||pe(fe(i.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,o=e.fillProps,i=void 0===o?{}:o,c=e.getFills,a=Object(ge.map)(c(n,this),(function(e){var t=e.occurrence,n=Object(ge.isFunction)(e.children)?e.children(i):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(ge.isString)(e))return e;var o="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:o})}))})).filter(Object(ge.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(ge.isFunction)(t)?t(a):a)}}]),i}(r.Component),Me=function(e){return Object(r.createElement)(De,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(r.createElement)(Re,ie({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},Ie=0;function Ae(e){var t=e.name,n=e.children,o=e.registerFill,i=e.unregisterFill,c=function(e){var t=Object(r.useContext)(Ce),n=t.getSlot,o=t.subscribe,i=we(Object(r.useState)(n(e)),2),c=i[0],a=i[1];return Object(r.useEffect)((function(){return a(n(e)),o((function(){a(n(e))}))}),[e]),c}(t),a=Object(r.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++Ie),Object(r.useLayoutEffect)((function(){return o(t,a.current),function(){return i(t,a.current)}}),[]),Object(r.useLayoutEffect)((function(){a.current.children=n,c&&c.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==a.current.name&&(i(a.current.name,a.current),a.current.name=t,o(t,a.current))}),[t]),c&&c.node?(Object(ge.isFunction)(n)&&(n=n(c.props.fillProps)),Object(r.createPortal)(n,c.node)):null}var Be=function(e){return Object(r.createElement)(De,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(Ae,ie({},e,{registerFill:n,unregisterFill:o}))}))};function Le(e){var t=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.as,c=void 0===i?"div":i,a=ce(e,["name","fillProps","as"]),u=Object(r.useContext)(te.a),s=Object(r.useRef)();return Object(r.useLayoutEffect)((function(){return u.registerSlot(t,s,o),function(){u.unregisterSlot(t,s)}}),[u.registerSlot,u.unregisterSlot,t]),Object(r.useLayoutEffect)((function(){u.updateSlot(t,o)})),Object(r.createElement)(c,ie({ref:s},a))}function Ve(e){var t,n=e.name,o=e.children,i=oe(n),c=Object(r.useRef)({rerender:(t=we(Object(r.useState)({}),2)[1],function(){return t({})})});return Object(r.useEffect)((function(){return i.registerFill(c),function(){i.unregisterFill(c)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(r.createPortal)(o,i.ref.current)):null}function Ue(e){var t=e.bubblesVirtually,n=ce(e,["bubblesVirtually"]);return t?Object(r.createElement)(Le,n):Object(r.createElement)(Me,n)}function We(e){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Be,e),Object(r.createElement)(Ve,e))}function He(e){var t=function(t){return Object(r.createElement)(We,ie({name:e},t))};t.displayName=e+"Fill";var n=function(t){return Object(r.createElement)(Ue,ie({name:e},t))};return n.displayName=e+"Slot",{Fill:t,Slot:n}}var ze=n(23),Ke=n.n(ze),$e=n(24),Ge=n.n($e),qe=n(34),Ye=n.n(qe),Ze=n(46),Je=n.n(Ze),Qe=n(47),Xe=n.n(Qe),et=n(36),tt=n.n(et);var nt,rt=function(e){Je()(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=tt()(t);if(n){var o=tt()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Xe()(this,e)});function i(){var e;Ke()(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=o.call.apply(o,[this].concat(n)),s()(Ye()(e),"state",{errorMessage:"",hasError:!1}),e}return Ge()(i,[{key:"render",value:function(){var e=this.props.renderError,t=this.state,n=t.errorMessage;return t.hasError?"function"==typeof e?e(n):Object(r.createElement)("p",null,n):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(r.createElement)(r.Fragment,null,Object(r.createElement)("strong",null,e.status),": "+e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(p.Component),ot=function(e){return Array.isArray(e)&&e.filter(Boolean).length>0};nt=oe;var it=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=He(e),o=n.Fill,i=n.Slot,c=function(e){var n=e.children;return Object(r.createElement)(o,null,(function(e){return r.Children.map(n,(function(n){return Object(r.createElement)(rt,{renderError:W.CURRENT_USER_IS_ADMIN?t:function(){return null}},Object(r.cloneElement)(n,e))}))}))},u=function(e){return Object(r.createElement)(i,a()({},e,{bubblesVirtually:!0}))};return{Fill:c,Slot:u}};function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ut,st={},lt=function(e,t){Object.keys(t).includes("couponName")&&Q()("snackbarNotices",{alternative:"snackbarNoticeVisibility",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417"}),Object.keys(t).includes("couponName")&&Q()("couponName",{alternative:"coupons",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/bb921d21f42e21f38df2b1c87b48e07aa4cb0538/docs/extensibility/available-filters.md#coupons"}),st=at(at({},st),{},s()({},e,t))},ft=function(e){var t=e.filterName,n=e.defaultValue,o=e.extensions,i=void 0===o?null:o,c=e.arg,a=void 0===c?null:c,u=e.validation,s=void 0===u?G:u;return Object(r.useMemo)((function(){var e=function(e){return Object.keys(st).map((function(t){return st[t][e]})).filter(Boolean)}(t),r=n;return e.forEach((function(e){try{var t=e(r,i||{},a);if(be()(t)!==be()(r))throw new Error(Object(U.sprintf)(
4
  /* translators: %1$s is the type of the variable passed to the filter function, %2$s is the type of the value returned by the filter function. */
5
- Object(U.__)("The type returned by checkout filters must be the same as the type they receive. The function received %1$s but returned %2$s.","woo-gutenberg-products-block"),be()(r),be()(t)));r=s(t)?t:r}catch(e){if(W.CURRENT_USER_IS_ADMIN)throw e;console.error(e)}})),r}),[t,n,i,a,s])},pt=(n(156),function(e){var t=e.children,n=e.slotWrapper,o=void 0!==n&&n;return p.Children.count(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-wrapper".concat(o?" slot-wrapper":"")},t):null});!function(e){e.CHECKOUT="woocommerce/checkout",e.CHECKOUT_FIELDS="woocommerce/checkout-fields-block",e.CHECKOUT_TOTALS="woocommerce/checkout-totals-block",e.CONTACT_INFORMATION="woocommerce/checkout-contact-information-block",e.SHIPPING_ADDRESS="woocommerce/checkout-shipping-address-block",e.BILLING_ADDRESS="woocommerce/checkout-billing-address-block",e.SHIPPING_METHODS="woocommerce/checkout-shipping-methods-block",e.PAYMENT_METHODS="woocommerce/checkout-payment-methods-block",e.CART="woocommerce/cart-i2",e.EMPTY_CART="woocommerce/empty-cart-block",e.FILLED_CART="woocommerce/filled-cart-block",e.CART_ITEMS="woocommerce/cart-items-block",e.CART_TOTALS="woocommerce/cart-totals-block"}(ut||(ut={}));var dt={},mt=function(e){return Object.values(ut).includes(e)},ht=function(e){return mt(e)?Object.values(dt).filter((function(t){var n=t.metadata;return((null==n?void 0:n.parent)||[]).includes(e)})):[]},bt=n(48),vt=function(e){return!function(e){return null===e}(e)&&"object"===be()(e)},gt=function(e){var t,n,r,o;!function(e,t,n){if(vt(e)){var r=be()(e.metadata);if("object"!==r)throw new Error("Incorrect value for the ".concat("metadata"," argument when registering a block component. It was a ").concat(r,", but must be a ").concat("object","."))}}(e),function(e){if(function(e,t,n){var r=be()(t);if("string"!==r)throw new Error("Incorrect value for the ".concat("blockName"," argument when registering a checkout block. It was a ").concat(r,", but must be a ").concat("string","."))}(0,e),!e)throw new Error("Value for the blockName argument must not be empty.")}(e.metadata.name),function(e){if("string"!=typeof e&&!Array.isArray(e))throw new Error("Incorrect value for the parent argument when registering a checkout block. It was a ".concat(be()(e),", but must be a string or array of strings."));if("string"==typeof e&&!mt(e))throw new Error("When registering a checkout block, the parent must be a valid inner block area.");if(Array.isArray(e)&&!e.some((function(e){return mt(e)})))throw new Error("When registering a checkout block, the parent must be a valid inner block area.")}(e.metadata.parent),function(e,t){var n=e.component;if(n){if("function"==typeof n)return;if(vt(n)&&n.$$typeof&&n.$$typeof===Symbol.for("react.lazy"))return}throw new Error("Incorrect value for the ".concat("component"," argument when registering a block component. Component must be a valid React Element or Lazy callback."))}(e),Object(bt.registerBlockComponent)({blockName:e.metadata.name,component:e.component}),dt[e.metadata.name]={blockName:e.metadata.name,metadata:e.metadata,component:e.component,force:!(null===(t=e.metadata)||void 0===t||null===(n=t.attributes)||void 0===n||null===(r=n.lock)||void 0===r||null===(o=r.default)||void 0===o||!o.remove)}},yt=it("__experimentalOrderMeta"),Ot=yt.Fill,wt=yt.Slot;Ot.Slot=function(e){var t=e.className,n=e.extensions,o=e.cart,c=nt("__experimentalOrderMeta").fills;return ot(c)&&Object(r.createElement)(pt,{slotWrapper:!0},Object(r.createElement)(wt,{className:i()(t,"wc-block-components-order-meta"),fillProps:{extensions:n,cart:o}}))};var jt=Ot,St=it("__experimentalDiscountsMeta"),xt=St.Fill,Et=St.Slot;xt.Slot=function(e){var t=e.className,n=e.extensions,o=e.cart,c=nt("__experimentalDiscountsMeta").fills;return ot(c)&&Object(r.createElement)(pt,{slotWrapper:!0},Object(r.createElement)(Et,{className:i()(t,"wc-block-components-discounts-meta"),fillProps:{extensions:n,cart:o}}))};var kt=xt,Pt=it("__experimentalOrderShippingPackages"),_t=Pt.Fill,Ft=Pt.Slot;_t.Slot=function(e){var t=e.className,n=e.collapsible,o=e.noResultsMessage,c=e.renderOption,a=e.extensions,u=e.cart,s=e.components,l=nt("__experimentalOrderShippingPackages").fills.length>1;return Object(r.createElement)(Ft,{className:i()("wc-block-components-shipping-rates-control",t),fillProps:{collapsible:n,collapse:l,showItems:l,noResultsMessage:o,renderOption:c,extensions:a,cart:u,components:s}})};var Ct=_t,Tt=n(12),Dt=n.n(Tt),Nt=["srcElement","size"];function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Mt=function(e){var t=e.srcElement,n=e.size,o=void 0===n?24:n,i=f()(e,Nt);return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:o,height:o},i)):null},It=Object(r.createElement)(X.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"})),At=Object(r.createElement)(X.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"})),Bt=(n(157),function(e){var t=e.children,n=e.className,o=e.initialOpen,c=void 0!==o&&o,a=e.hasBorder,u=void 0!==a&&a,s=e.title,l=e.titleTag,f=void 0===l?"div":l,p=Object(r.useState)(c),d=Dt()(p,2),m=d[0],h=d[1];return Object(r.createElement)("div",{className:i()(n,"wc-block-components-panel",{"has-border":u})},Object(r.createElement)(f,null,Object(r.createElement)("button",{"aria-expanded":m,className:"wc-block-components-panel__button",onClick:function(){return h(!m)}},Object(r.createElement)(Mt,{"aria-hidden":"true",className:"wc-block-components-panel__button-icon",srcElement:m?It:At}),s)),m&&Object(r.createElement)("div",{className:"wc-block-components-panel__content"},t))}),Lt=n(25),Vt=n(33),Ut=n(16),Wt=Object(r.createElement)(X.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(X.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"}));function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kt(e,t,n,r,o,i,c){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==i&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==i&&(p=s);var d,m={popoverLeft:f,contentWidth:f-a>0?a:f},h={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},b=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)b="center";else if("left"===n&&m.contentWidth===a)b="left";else if("right"===n&&h.contentWidth===a)b="right";else{var g="left"==(b=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;v=g!==a?g:null}if(d="center"===b?l.popoverLeft:"left"===b?m.popoverLeft:h.popoverLeft,c){var y=c.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:b,popoverLeft:d,contentWidth:v}}function $t(e,t,n,r,o,i,c){var a=t.height;if(o){var u=(Object(Lt.getScrollContainer)(i)||document.body).getBoundingClientRect().top+a-c;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={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},d=n,m=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var h="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==a?h:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Gt=Object(r.createContext)({focusHistory:[]}),qt=Gt.Provider,Yt=Gt.Consumer;qt.displayName="FocusReturnProvider",Yt.displayName="FocusReturnConsumer",r.Component;var Zt=Object(Ut.createHigherOrderComponent)((function e(t){if((o=t)instanceof r.Component||"function"==typeof o){var n=t;return e({})(n)}var o,i=t.onFocusReturn,c=void 0===i?ge.stubTrue:i;return function(e){var t=function(t){me(a,t);var n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function a(){var e;return ae(this,a),(e=i.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return se(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,o=[].concat(je(ge.without.apply(void 0,[this.props.focus.focusHistory].concat(je(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),a}(r.Component);return function(e){return Object(r.createElement)(Yt,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var Jt=Object(Ut.createHigherOrderComponent)((function(e){return function(t){me(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function c(){var e;return ae(this,c),(e=i.apply(this,arguments)).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(le(e)),e}return se(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===Vt.TAB){var t=Lt.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),c}(r.Component)}),"withConstrainedTabbing");var Qt=["button","submit"];var Xt=Object(Ut.createHigherOrderComponent)((function(e){return function(t){me(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function c(){var e;return ae(this,c),(e=i.apply(this,arguments)).bindNode=e.bindNode.bind(le(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(le(e)),e.queueBlurCheck=e.queueBlurCheck.bind(le(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(le(e)),e}return se(c,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(ge.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(ge.includes)(Qt,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,ie({ref:this.bindNode},this.props)))}}]),c}(r.Component)}),"withFocusOutside")(function(e){me(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function o(){return ae(this,o),r.apply(this,arguments)}return se(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(r.Component));function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=fe(e);if(t){var o=fe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ve(this,n)}}var tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,i=void 0===o?"lockscroll":o,c=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](i),n.documentElement.classList[r](i),e||(t.scrollTop=a)}function s(){0===c&&u(!0),++c}function l(){1===c&&u(!1),--c}return function(e){me(n,e);var t=en(n);function n(){return ae(this,n),t.apply(this,arguments)}return se(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(r.Component)}();function nn(e){e.stopPropagation()}var rn=Object(r.forwardRef)((function(e,t){var n=e.children,o=ce(e,["children"]);return Object(r.createElement)("div",ie({},o,{ref:t,onMouseDown:nn}),n)}));function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function an(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=we(r.split(" "),2),a=c[0],u=c[1],s=void 0===u?"center":u;return i()("components-animate__appear",(ee(o={},"is-from-"+s,"center"!==s),ee(o,"is-from-"+a,"middle"!==a),o))}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):"loading"===t?i()("components-animate__loading"):void 0}function un(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:an(cn({type:t},r))})}var sn=Jt(Zt((function(e){return e.children})));function ln(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,i=r.paddingBottom,c=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function fn(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function pn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function dn(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var mn=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,c=e.children,a=e.className,u=e.noArrow,s=void 0===u||u,l=e.isAlternate,f=e.position,p=void 0===f?"bottom right":f,d=(e.range,e.focusOnMount),m=void 0===d?"firstElement":d,h=e.anchorRef,b=e.shouldAnchorIncludePadding,v=e.anchorRect,g=e.getAnchorRect,y=e.expandOnMobile,O=e.animate,w=void 0===O||O,j=e.onClickOutside,S=e.onFocusOutside,x=e.__unstableSticky,E=e.__unstableSlotName,k=void 0===E?"Popover":E,P=e.__unstableObserveElement,_=e.__unstableBoundaryParent,F=ce(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(r.useRef)(null),T=Object(r.useRef)(null),D=Object(r.useRef)(),N=Object(Ut.useViewportMatch)("medium","<"),R=we(Object(r.useState)(),2),M=R[0],I=R[1],A=oe(k),B=y&&N,L=we(Object(Ut.useResizeObserver)(),2),V=L[0],U=L[1];s=B||s,Object(r.useLayoutEffect)((function(){if(B)return dn(D.current,"is-without-arrow",s),dn(D.current,"is-alternate",l),fn(D.current,"data-x-axis"),fn(D.current,"data-y-axis"),pn(D.current,"top"),pn(D.current,"left"),pn(T.current,"maxHeight"),void pn(T.current,"maxWidth");var e=function(){if(D.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(Lt.getRectangleFromRange)(r);if(r instanceof window.Element){var i=r.getBoundingClientRect();return o?i:ln(i,r)}var c=r.top,a=r.bottom,u=c.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ln(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ln(p,f)}}(C,v,g,h,b);if(e){var t,n,r=D.current,o=r.offsetParent,i=r.ownerDocument,c=0;if(o&&o!==i.body){var a=o.getBoundingClientRect();c=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}_&&(t=null===(n=D.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=we(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=$t(e,t,s,p,r,o,i),m=Kt(e,t,f,p,r,d.yAxis,c);return zt(zt({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),p,x,D.current,c,t),f=u.popoverTop,d=u.popoverLeft,m=u.xAxis,y=u.yAxis,O=u.contentHeight,w=u.contentWidth;"number"==typeof f&&"number"==typeof d&&(pn(D.current,"top",f+"px"),pn(D.current,"left",d+"px")),dn(D.current,"is-without-arrow",s||"center"===m&&"middle"===y),dn(D.current,"is-alternate",l),fn(D.current,"data-x-axis",m),fn(D.current,"data-y-axis",y),pn(T.current,"maxHeight","number"==typeof O?O+"px":""),pn(T.current,"maxWidth","number"==typeof w?w+"px":""),I(({left:"right",right:"left"}[m]||"center")+" "+({top:"bottom",bottom:"top"}[y]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),P&&(n=new window.MutationObserver(e)).observe(P,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[B,v,g,h,b,p,U,x,P,_]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=Lt.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(m,T);var W=function(e){e.keyCode===Vt.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)},H=Object(r.createElement)(Xt,{onFocusOutside:function(e){if(S)S(e);else if(j){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Q()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(t)}else n&&n()}},Object(r.createElement)(un,{type:w&&M?"appear":null,options:{origin:M}},(function(e){var o=e.className;return Object(r.createElement)(rn,ie({className:i()("components-popover",a,o,{"is-expanded":B,"is-without-arrow":s,"is-alternate":l})},F,{onKeyDown:W,ref:D}),B&&Object(r.createElement)(tn,null),B&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(xn,{className:"components-popover__close",icon:Wt,onClick:n})),Object(r.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(r.createElement)("div",{style:{position:"relative"}},V,c)))})));return m&&(H=Object(r.createElement)(sn,null,H)),A.ref&&(H=Object(r.createElement)(We,{name:k},H)),h||v?H:Object(r.createElement)("span",{ref:C},H)};mn.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(r.createElement)(Ue,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var hn=mn,bn=function(e){var t,n,o=e.shortcut,i=e.className;return o?(Object(ge.isString)(o)&&(t=o),Object(ge.isObject)(o)&&(t=o.display,n=o.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null};var vn=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).delayedSetIsOver=Object(ge.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return se(i,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(ge.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,o=e.text,i=e.shortcut;if(1!==r.Children.count(t))return t;var c=r.Children.only(t),a=this.state.isOver;return Object(r.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(r.concatChildren)(c.props.children,a&&Object(r.createElement)(hn,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},o,Object(r.createElement)(bn,{className:"components-tooltip__shortcut",shortcut:i})))})}}]),i}(r.Component),gn=function(e){var t=e.icon,n=e.className,o=ce(e,["icon","className"]),i=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(r.createElement)("span",ie({className:i},o))};function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wn=function(e){var t=e.icon,n=void 0===t?null:t,o=e.size,i=ce(e,["icon","size"]);if("string"==typeof n)return Object(r.createElement)(gn,ie({icon:n},i));if(n&&gn===n.type)return Object(r.cloneElement)(n,On({},i));var c=o||24;if("function"==typeof n)return n.prototype instanceof r.Component?Object(r.createElement)(n,On({size:c},i)):n(On({size:c},i));if(n&&("svg"===n.type||n.type===X.SVG)){var a=On(On({width:c,height:c},n.props),i);return Object(r.createElement)(X.SVG,a)}return Object(r.isValidElement)(n)?Object(r.cloneElement)(n,On({size:c},i)):n};function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Sn=["onMouseDown","onClick"],xn=Object(r.forwardRef)((function(e,t){var n=e.href,o=e.target,c=e.isPrimary,a=e.isSmall,u=e.isTertiary,s=e.isPressed,l=e.isBusy,f=e.isDefault,p=e.isSecondary,d=e.isLink,m=e.isDestructive,h=e.className,b=e.disabled,v=e.icon,g=e.iconSize,y=e.showTooltip,O=e.tooltipPosition,w=e.shortcut,j=e.label,S=e.children,x=e.__experimentalIsFocusable,E=ce(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);f&&Q()("Button isDefault prop",{alternative:"isSecondary"});var k=i()("components-button",h,{"is-secondary":f||p,"is-primary":c,"is-small":a,"is-tertiary":u,"is-pressed":s,"is-busy":l,"is-link":d,"is-destructive":m,"has-text":!!v&&!!S,"has-icon":!!v}),P=b&&!x,_=void 0===n||P?"button":"a",F="a"===_?{href:n,target:o}:{type:"button",disabled:P,"aria-pressed":s};if(b&&x){F["aria-disabled"]=!0;var C,T=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jn(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jn(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}(Sn);try{for(T.s();!(C=T.n()).done;)E[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){T.e(e)}finally{T.f()}}var D=!P&&(y&&j||w||!!j&&(!S||Object(ge.isArray)(S)&&!S.length)&&!1!==y),N=Object(r.createElement)(_,ie({},F,E,{className:k,"aria-label":E["aria-label"]||j,ref:t}),v&&Object(r.createElement)(wn,{icon:v,size:g}),S);return D?Object(r.createElement)(vn,{text:j,shortcut:w,position:O},N):N})),En=(n(159),function(){return Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}),kn=(n(158),["className","showSpinner","children"]),Pn=function(e){var t=e.className,n=e.showSpinner,o=void 0!==n&&n,c=e.children,u=f()(e,kn),s=i()("wc-block-components-button",t,{"wc-block-components-button--loading":o});return Object(r.createElement)(xn,a()({className:s},u),o&&Object(r.createElement)(En,null),Object(r.createElement)("span",{className:"wc-block-components-button__text"},c))};function Fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Tn=function(e){var t,n=e.label,o=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,u=void 0===a?{}:a,s=null!=n,l=null!=o;return!s&&l?(t=c||"span",u=Cn(Cn({},u),{},{className:i()(u.className,"screen-reader-text")}),Object(r.createElement)(t,u,o)):(t=c||r.Fragment,s&&l&&n!==o?Object(r.createElement)(t,u,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,u,n))}}]);
1
+ this.wc=this.wc||{},this.wc.blocksCheckout=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}return 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=160)}([function(e,t){e.exports=window.wp.element},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.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.i18n},,function(e,t){e.exports=window.lodash},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){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wc.wcSettings},,function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t,n){var r=n(20),o=n(21),i=n(18),c=n(22);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(2),o="wc/store/cart",i={code:"cart_api_error",message:Object(r.__)("Unable to get cart data from the API.","woo-gutenberg-products-block"),data:{status:500}},c="wc-blocks_cart_update_timestamp"},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.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.React},function(e,t,n){var r=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.dom},,function(e,t,n){var r=n(152);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(43),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(31))},,,function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.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 n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||l||a(d)},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){e.exports=window.wp.keycodes},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.default=e.exports,e.exports.__esModule=!0},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,n){var r=n(155);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(6).default,o=n(34);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"TotalsItem",(function(){return V})),n.d(t,"Subtotal",(function(){return H})),n.d(t,"TotalsTaxes",(function(){return z})),n.d(t,"TotalsFees",(function(){return K})),n.d(t,"mustContain",(function(){return $})),n.d(t,"returnTrue",(function(){return G})),n.d(t,"extensionCartUpdate",(function(){return Z})),n.d(t,"hasValidFills",(function(){return ot})),n.d(t,"useSlot",(function(){return nt})),n.d(t,"createSlotFill",(function(){return it})),n.d(t,"__experimentalRegisterCheckoutFilters",(function(){return lt})),n.d(t,"__experimentalApplyCheckoutFilter",(function(){return ft})),n.d(t,"TotalsWrapper",(function(){return pt})),n.d(t,"hasInnerBlocks",(function(){return mt})),n.d(t,"getRegisteredBlocks",(function(){return ht})),n.d(t,"registerCheckoutBlock",(function(){return gt})),n.d(t,"innerBlockAreas",(function(){return ut})),n.d(t,"ExperimentalOrderMeta",(function(){return jt})),n.d(t,"ExperimentalDiscountsMeta",(function(){return kt})),n.d(t,"ExperimentalOrderShippingPackages",(function(){return Ct})),n.d(t,"Panel",(function(){return Bt})),n.d(t,"SlotFillProvider",(function(){return Ne})),n.d(t,"Button",(function(){return Pn})),n.d(t,"Label",(function(){return Tn}));var r=n(0),o=n(5),i=n.n(o),c=n(15),a=n.n(c),u=n(1),s=n.n(u),l=n(27),f=n.n(l),p=n(17),d=n.n(p);function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(){return(h=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)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){}function O(){}O.resetWarningCache=y;var w=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:O,resetWarningCache:y};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}();function j(){}function S(e){return!!(e||"").match(/\d/)}function x(e){return null==e}function E(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function k(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),i=o[0],c=o[1]||"";return{beforeDecimal:i,afterDecimal:c,hasNagation:n,addNegation:r}}function P(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function _(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function F(e,t,n){return Math.min(Math.max(e,t),n)}function C(e){return Math.max(e.selectionStart,e.selectionEnd)}var T={thousandSeparator:w.oneOfType([w.string,w.oneOf([!0])]),decimalSeparator:w.string,allowedDecimalSeparators:w.arrayOf(w.string),thousandsGroupStyle:w.oneOf(["thousand","lakh","wan"]),decimalScale:w.number,fixedDecimalScale:w.bool,displayType:w.oneOf(["input","text"]),prefix:w.string,suffix:w.string,format:w.oneOfType([w.string,w.func]),removeFormatting:w.func,mask:w.oneOfType([w.string,w.arrayOf(w.string)]),value:w.oneOfType([w.number,w.string]),defaultValue:w.oneOfType([w.number,w.string]),isNumericString:w.bool,customInput:w.elementType,allowNegative:w.bool,allowEmptyFormatting:w.bool,allowLeadingZeros:w.bool,onValueChange:w.func,onKeyDown:w.func,onMouseUp:w.func,onChange:w.func,onFocus:w.func,onBlur:w.func,type:w.oneOf(["text","tel","password"]),isAllowed:w.func,renderText:w.func,getInputRef:w.oneOfType([w.func,w.shape({current:w.any})])},D={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:j,onChange:j,onKeyDown:j,onMouseUp:j,onFocus:j,onBlur:j,isAllowed:function(){return!0}},N=function(e){function t(e){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=!(r=b(t).call(this,e))||"object"!=typeof r&&"function"!=typeof r?g(this):r;var o=e.defaultValue;n.validateProps();var i=n.formatValueProp(o);return n.state={value:i,numAsString:n.removeFormatting(i)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(g(n)),n.onKeyDown=n.onKeyDown.bind(g(n)),n.onMouseUp=n.onMouseUp.bind(g(n)),n.onFocus=n.onFocus.bind(g(n)),n.onBlur=n.onBlur.bind(g(n)),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,i=n.numAsString,c=void 0===i?"":i;if(e!==t){this.validateProps();var a=this.formatNumString(c),u=x(t.value)?a:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(c);(isNaN(l)&&isNaN(f)||l===f)&&a===o&&(null!==r||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),i="-"===e[0];i&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var c=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==c&&(e="".concat(e.substring(0,c),".").concat(e.substring(c+1,e.length).replace(new RegExp(E(r),"g"),""))),i&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,i=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!i||0===o||t||r?"":"|"+E(i)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask ".concat(e," should not contain numeric character;\n "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){_(e,t),setTimeout((function(){e.value===n&&_(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,i=r.suffix,c=r.format;if(""===e)return 0;if(t=F(t,0,e.length),!c){var a="-"===e[0];return F(t,o.length+(a?1:0),e.length-i.length)}if("function"==typeof c)return t;if("#"===c[t]&&S(e[t]))return t;if("#"===c[t-1]&&S(e[t-1]))return t;var u=c.indexOf("#");t=F(t,u,c.lastIndexOf("#")+1);for(var s=c.substring(t,c.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==c[l]||!S(e[l]));)l-=1;return!S(e[f])||"left"===n&&t!==u||t-l<f-t?S(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,i=this.props.format,c=this.state.value,a=this.getNumberRegex(!0),u=(e.match(a)||[]).join(""),s=(t.match(a)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(a)||l===f)&&("0"!==l||!f.match(a)||"0"===f||u.length===s.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof i||c||(r=t.length),this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var i="-"===e[0];i&&(e=e.substring(1,e.length));var c=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==c&&c===e.length-o.length?e.substring(0,c):e,i&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,i=t.length;o<=i;o++){var c=t[o]||"",a=o===i?e.length:e.indexOf(c,n);if(-1===a){r=e;break}r+=e.substring(n,a),n=a+c.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,i=t.length;o<i;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,i=t.suffix,c=t.allowNegative,a=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,p=k(e,c),d=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=P(m,n,r)),s&&(d=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(d,s,a)),o&&(d=o+d),i&&(m+=i),h&&(d="-"+d),d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,i=t.allowEmptyFormatting,c=this.props,a=c.value,u=c.isNumericString,s=!(a=x(a)?e:a)&&0!==a;return s&&i&&(a=""),s&&!i?"":("number"==typeof a&&(a=a.toString(),u=!0),"Infinity"===a&&u&&(a=""),u&&!n&&"number"==typeof r&&(a=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=k(e),i=o.beforeDecimal,c=o.afterDecimal,a=o.hasNagation,u=parseFloat("0.".concat(c||"0")).toFixed(t).split("."),s=i.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=P(u[1]||"",Math.min(t,c.length),n),f=r?".":"";return"".concat(a?"-":"").concat(s).concat(f).concat(l)}(a,r,o)),u?this.formatNumString(a):this.formatInput(a))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,i=n.suffix,c=n.decimalScale,a=n.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-i.length||c&&a&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,i=r.allowNegative,c=r.prefix,a=r.suffix,u=r.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,h=d.selectionEnd,b=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),v=b.start,g=b.end;if(!o&&v===g&&-1!==l.indexOf(n[m])){var y=0===u?"":f;return n.substr(0,m)+y+n.substr(m+1,n.length)}var O=o?0:c.length,w=t.length-(o?0:a.length);if(n.length>t.length||!n.length||v===g||0===m&&h===t.length||m===O&&h===w)return n;if(this.checkIfFormatGotDeleted(v,g,t)&&(n=t),!o){var j=this.removeFormatting(n),S=k(j,i),x=S.beforeDecimal,E=S.afterDecimal,P=S.addNegation,_=e<n.indexOf(f)+1;if(j.length<p.length&&_&&""===x&&!parseFloat(E))return P?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,i=e.numAsString,c=e.caretPos,a=this.props.onValueChange,u=this.state.value;if(n)if(o){if(!c){var s=e.inputValue||n.value,l=C(n);n.value=t,c=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(n,c,t)}else n.value=t;void 0===i&&(i=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:i}),a(this.getValueObject(t,i)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,i=o.isAllowed,c=r.value||"",a=C(t);n=this.correctInputValue(a,c,n);var u=this.formatInput(n)||"",s=this.removeFormatting(u);i(this.getValueObject(u,s))||(u=c),this.updateValue({formattedValue:u,numAsString:s,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,i=t.allowLeadingZeros,c=n.numAsString,a=n.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(c))&&(c=""),i||(c=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(c));var u=this.formatNumString(c);if(u!==a)return this.updateValue({formattedValue:u,numAsString:c,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,c=n.value,a=void 0===c?"":c,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,h=void 0!==s&&l,b=this.getNumberRegex(!1,h),v=new RegExp("-"),g="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:i},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===i){var y=t,O=g?d.indexOf("#"):f.length,w=g?d.lastIndexOf("#")+1:a.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var j="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(a,t,j)}else if("Delete"!==r||b.test(a[t])||v.test(a[t])){if("Backspace"===r&&!b.test(a[t]))if(o<=O+1&&"-"===a[0]&&void 0===d){var S=a.substring(1);this.updateValue({formattedValue:S,caretPos:y,input:n})}else if(!v.test(a[t])){for(;!b.test(a[y-1])&&y>O;)y--;y=this.correctCaretPosition(a,y,"left")}}else for(;!b.test(a[y])&&y<w;)y++;(y!==t||t<O||t>w)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,a),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,i=void 0===o?"":o;if(n===r){var c=this.correctCaretPosition(i,n);c!==n&&this.setPatchedCaretPosition(t,c,i)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,i=n.value,c=void 0===i?"":i,a=t.correctCaretPosition(c,r);a===r||0===r&&o===c.length||t.setPatchedCaretPosition(n,a,c),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,i=r.displayType,c=r.customInput,a=r.renderText,u=r.getInputRef,s=r.format,l=this.state.value,f=(e=this.props,t=T,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),p=h({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0},f,{type:o,value:l,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===i)return a?a(l)||null:d.a.createElement("span",h({},f,{ref:u}),l);if(c){var m=c;return d.a.createElement(m,h({},p,{ref:u}))}return d.a.createElement("input",h({},p,{ref:u}))}}])&&m(n.prototype,r),t}(d.a.Component);N.propTypes=T,N.defaultProps=D;var R=N,M=(n(153),["className","value","currency","onValueChange","displayType"]);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t=e.className,n=e.value,o=e.currency,c=e.onValueChange,u=e.displayType,s=void 0===u?"text":u,l=f()(e,M),p="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(p))return null;var d=p/Math.pow(10,o.minorUnit);if(!Number.isFinite(d))return null;var m=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=A(A(A({},l),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(o)),{},{value:void 0,currency:void 0,onValueChange:void 0}),b=c?function(e){var t=e.value*Math.pow(10,o.minorUnit);c(t)}:function(){};return Object(r.createElement)(R,a()({className:m,displayType:s},h,{value:d,onValueChange:b}))},L=(n(151),function(e){var t=e.value,n=e.currency;return Object(r.isValidElement)(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-item__value"},t):Number.isFinite(t)?Object(r.createElement)(B,{className:"wc-block-components-totals-item__value",currency:n||{},value:t}):null}),V=function(e){var t=e.className,n=e.currency,o=e.label,c=e.value,a=e.description;return Object(r.createElement)("div",{className:i()("wc-block-components-totals-item",t)},Object(r.createElement)("span",{className:"wc-block-components-totals-item__label"},o),Object(r.createElement)(L,{value:c,currency:n}),Object(r.createElement)("div",{className:"wc-block-components-totals-item__description"},a))},U=n(2),W=n(7),H=function(e){var t=e.currency,n=e.values,o=e.className,i=n.total_items,c=n.total_items_tax,a=parseInt(i,10),u=parseInt(c,10);return Object(r.createElement)(V,{className:o,currency:t,label:Object(U.__)("Subtotal","woo-gutenberg-products-block"),value:Object(W.getSetting)("displayCartPricesIncludingTax",!1)?a+u:a})},z=(n(154),function(e){var t=e.currency,n=e.values,o=e.className,c=e.showRateAfterTaxName,a=n.total_tax,u=n.tax_lines;if(!Object(W.getSetting)("taxesEnabled",!0)&&parseInt(a,10)<=0)return null;var s=Object(W.getSetting)("displayItemizedTaxes",!1),l=s&&u.length>0?Object(r.createElement)("div",{className:i()("wc-block-components-totals-taxes",o)},u.map((function(e,n){var o=e.name,i=e.rate,a=e.price,u="".concat(o).concat(c?" ".concat(i):"");return Object(r.createElement)(V,{key:"tax-line-".concat(n),className:"wc-block-components-totals-taxes__grouped-rate",currency:t,label:u,value:parseInt(a,10)})}))," "):null;return s?l:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(V,{className:i()("wc-block-components-totals-taxes",o),currency:t,label:Object(U.__)("Taxes","woo-gutenberg-products-block"),value:parseInt(a,10),description:null}))}),K=function(e){var t=e.currency,n=e.cartFees,o=e.className;return Object(r.createElement)(r.Fragment,null,n.map((function(e,n){var c=e.id,a=e.name,u=e.totals,s=parseInt(u.total,10);if(!s)return null;var l=parseInt(u.total_tax,10);return Object(r.createElement)(V,{key:c||"".concat(n,"-").concat(a),className:i()("wc-block-components-totals-fees",o),currency:t,label:a||Object(U.__)("Fee","woo-gutenberg-products-block"),value:Object(W.getSetting)("displayCartPricesIncludingTax",!1)?s+l:s})})))},$=function(e,t){if(!e.includes(t))throw Error(Object(U.sprintf)(
2
  /* translators: %1$s value passed to filter, %2$s : value that must be included. */
3
+ Object(U.__)('Returned value must include %1$s, you passed "%2$s"',"woo-gutenberg-products-block"),e,t));return!0},G=function(){return!0},q=n(10),Y=n(14),Z=function(e){return(0,Object(q.dispatch)(Y.c).applyExtensionCartUpdate)(e)},J=n(9),Q=n.n(J),X=n(11);function ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var te=n(28);function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=Object(r.useContext)(te.a),n=t.slots[e]||{},o=t.fills[e],i=Object(r.useMemo)((function(){return o||[]}),[o]),c=Object(r.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(r.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(r.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(r.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return re(re({},n),{},{updateSlot:c,unregisterSlot:a,fills:i,registerFill:u,unregisterFill:s})}function ie(){return(ie=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)}function ce(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function se(e,t,n){return t&&ue(e.prototype,t),n&&ue(e,n),e}function le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pe(e,t,n){return(pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var de=n(44);function me(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(de.a)(e,t)}var he=n(6),be=n.n(he);function ve(e,t){return!t||"object"!==be()(t)&&"function"!=typeof t?le(e):t}var ge=n(4);function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t){if(e){if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||Oe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e){return function(e){if(Array.isArray(e))return ye(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Oe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var xe=n(45),Ee=n.n(xe);function ke(e){var t=function(e,t){if("object"!==Se(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Se(t)?t:String(t)}function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fe(e){var t,n,o,i,c,a,u,s,l,f,p,d=e.children,m=(t=we(Object(r.useState)({}),2),n=t[0],o=t[1],i=we(Object(r.useState)({}),2),c=i[0],a=i[1],u=Object(r.useCallback)((function(e,t,n){o((function(r){var o=r[e]||{};return _e(_e({},r),{},ee({},e,_e(_e({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),s=Object(r.useCallback)((function(e,t){o((function(n){var r=n[e],o=ce(n,[e].map(ke));return(null==r?void 0:r.ref)===t?o:n}))}),[]),l=Object(r.useCallback)((function(e,t){var r=n[e];if(r&&!Ee()(r.fillProps,t)){r.fillProps=t;var o=c[e];o&&o.map((function(e){return e.current.rerender()}))}}),[n,c]),f=Object(r.useCallback)((function(e,t){a((function(n){return _e(_e({},n),{},ee({},e,[].concat(je(n[e]||[]),[t])))}))}),[]),p=Object(r.useCallback)((function(e,t){a((function(n){return n[e]?_e(_e({},n),{},ee({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(r.useMemo)((function(){return{slots:n,fills:c,registerSlot:u,updateSlot:l,unregisterSlot:s,registerFill:f,unregisterFill:p}}),[n,c,u,l,s,f,p]));return Object(r.createElement)(te.a.Provider,{value:m},d)}var Ce=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Te=Ce.Provider,De=Ce.Consumer,Ne=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).registerSlot=e.registerSlot.bind(le(e)),e.registerFill=e.registerFill.bind(le(e)),e.unregisterSlot=e.unregisterSlot.bind(le(e)),e.unregisterFill=e.unregisterFill.bind(le(e)),e.getSlot=e.getSlot.bind(le(e)),e.getFills=e.getFills.bind(le(e)),e.hasFills=e.hasFills.bind(le(e)),e.subscribe=e.subscribe.bind(le(e)),e.slots={},e.fills={},e.listeners=[],e.contextValue={registerSlot:e.registerSlot,unregisterSlot:e.unregisterSlot,registerFill:e.registerFill,unregisterFill:e.unregisterFill,getSlot:e.getSlot,getFills:e.getFills,hasFills:e.hasFills,subscribe:e.subscribe},e}return se(i,[{key:"registerSlot",value:function(e,t){var n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}},{key:"registerFill",value:function(e,t){this.fills[e]=[].concat(je(this.fills[e]||[]),[t]),this.forceUpdateSlot(e)}},{key:"unregisterSlot",value:function(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}},{key:"unregisterFill",value:function(e,t){this.fills[e]=Object(ge.without)(this.fills[e],t),this.resetFillOccurrence(e),this.forceUpdateSlot(e)}},{key:"getSlot",value:function(e){return this.slots[e]}},{key:"getFills",value:function(e,t){return this.slots[e]!==t?[]:Object(ge.sortBy)(this.fills[e],"occurrence")}},{key:"hasFills",value:function(e){return this.fills[e]&&!!this.fills[e].length}},{key:"resetFillOccurrence",value:function(e){Object(ge.forEach)(this.fills[e],(function(e){e.occurrence=void 0}))}},{key:"forceUpdateSlot",value:function(e){var t=this.getSlot(e);t&&t.forceUpdate()}},{key:"triggerListeners",value:function(){this.listeners.forEach((function(e){return e()}))}},{key:"subscribe",value:function(e){var t=this;return this.listeners.push(e),function(){t.listeners=Object(ge.without)(t.listeners,e)}}},{key:"render",value:function(){return Object(r.createElement)(Te,{value:this.contextValue},Object(r.createElement)(Fe,null,this.props.children))}}]),i}(r.Component);var Re=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(le(e)),e}return se(i,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||pe(fe(i.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,o=e.fillProps,i=void 0===o?{}:o,c=e.getFills,a=Object(ge.map)(c(n,this),(function(e){var t=e.occurrence,n=Object(ge.isFunction)(e.children)?e.children(i):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(ge.isString)(e))return e;var o="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:o})}))})).filter(Object(ge.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(ge.isFunction)(t)?t(a):a)}}]),i}(r.Component),Me=function(e){return Object(r.createElement)(De,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(r.createElement)(Re,ie({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},Ie=0;function Ae(e){var t=e.name,n=e.children,o=e.registerFill,i=e.unregisterFill,c=function(e){var t=Object(r.useContext)(Ce),n=t.getSlot,o=t.subscribe,i=we(Object(r.useState)(n(e)),2),c=i[0],a=i[1];return Object(r.useEffect)((function(){return a(n(e)),o((function(){a(n(e))}))}),[e]),c}(t),a=Object(r.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++Ie),Object(r.useLayoutEffect)((function(){return o(t,a.current),function(){return i(t,a.current)}}),[]),Object(r.useLayoutEffect)((function(){a.current.children=n,c&&c.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==a.current.name&&(i(a.current.name,a.current),a.current.name=t,o(t,a.current))}),[t]),c&&c.node?(Object(ge.isFunction)(n)&&(n=n(c.props.fillProps)),Object(r.createPortal)(n,c.node)):null}var Be=function(e){return Object(r.createElement)(De,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(Ae,ie({},e,{registerFill:n,unregisterFill:o}))}))};function Le(e){var t=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.as,c=void 0===i?"div":i,a=ce(e,["name","fillProps","as"]),u=Object(r.useContext)(te.a),s=Object(r.useRef)();return Object(r.useLayoutEffect)((function(){return u.registerSlot(t,s,o),function(){u.unregisterSlot(t,s)}}),[u.registerSlot,u.unregisterSlot,t]),Object(r.useLayoutEffect)((function(){u.updateSlot(t,o)})),Object(r.createElement)(c,ie({ref:s},a))}function Ve(e){var t,n=e.name,o=e.children,i=oe(n),c=Object(r.useRef)({rerender:(t=we(Object(r.useState)({}),2)[1],function(){return t({})})});return Object(r.useEffect)((function(){return i.registerFill(c),function(){i.unregisterFill(c)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(r.createPortal)(o,i.ref.current)):null}function Ue(e){var t=e.bubblesVirtually,n=ce(e,["bubblesVirtually"]);return t?Object(r.createElement)(Le,n):Object(r.createElement)(Me,n)}function We(e){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Be,e),Object(r.createElement)(Ve,e))}function He(e){var t=function(t){return Object(r.createElement)(We,ie({name:e},t))};t.displayName=e+"Fill";var n=function(t){return Object(r.createElement)(Ue,ie({name:e},t))};return n.displayName=e+"Slot",{Fill:t,Slot:n}}var ze=n(23),Ke=n.n(ze),$e=n(24),Ge=n.n($e),qe=n(34),Ye=n.n(qe),Ze=n(46),Je=n.n(Ze),Qe=n(47),Xe=n.n(Qe),et=n(36),tt=n.n(et);var nt,rt=function(e){Je()(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=tt()(t);if(n){var o=tt()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Xe()(this,e)});function i(){var e;Ke()(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=o.call.apply(o,[this].concat(n)),s()(Ye()(e),"state",{errorMessage:"",hasError:!1}),e}return Ge()(i,[{key:"render",value:function(){var e=this.props.renderError,t=this.state,n=t.errorMessage;return t.hasError?"function"==typeof e?e(n):Object(r.createElement)("p",null,n):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(r.createElement)(r.Fragment,null,Object(r.createElement)("strong",null,e.status),": "+e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(p.Component),ot=function(e){return Array.isArray(e)&&e.filter(Boolean).length>0};nt=oe;var it=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=He(e),o=n.Fill,i=n.Slot,c=function(e){var n=e.children;return Object(r.createElement)(o,null,(function(e){return r.Children.map(n,(function(n){return Object(r.createElement)(rt,{renderError:W.CURRENT_USER_IS_ADMIN?t:function(){return null}},Object(r.cloneElement)(n,e))}))}))},u=function(e){return Object(r.createElement)(i,a()({},e,{bubblesVirtually:!0}))};return{Fill:c,Slot:u}};function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ut,st={},lt=function(e,t){Object.keys(t).includes("couponName")&&Q()("snackbarNotices",{alternative:"snackbarNoticeVisibility",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417"}),Object.keys(t).includes("couponName")&&Q()("couponName",{alternative:"coupons",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/bb921d21f42e21f38df2b1c87b48e07aa4cb0538/docs/extensibility/available-filters.md#coupons"}),st=at(at({},st),{},s()({},e,t))},ft=function(e){var t=e.filterName,n=e.defaultValue,o=e.extensions,i=void 0===o?null:o,c=e.arg,a=void 0===c?null:c,u=e.validation,s=void 0===u?G:u;return Object(r.useMemo)((function(){var e=function(e){return Object.keys(st).map((function(t){return st[t][e]})).filter(Boolean)}(t),r=n;return e.forEach((function(e){try{var t=e(r,i||{},a);if(be()(t)!==be()(r))throw new Error(Object(U.sprintf)(
4
  /* translators: %1$s is the type of the variable passed to the filter function, %2$s is the type of the value returned by the filter function. */
5
+ Object(U.__)("The type returned by checkout filters must be the same as the type they receive. The function received %1$s but returned %2$s.","woo-gutenberg-products-block"),be()(r),be()(t)));r=s(t)?t:r}catch(e){if(W.CURRENT_USER_IS_ADMIN)throw e;console.error(e)}})),r}),[t,n,i,a,s])},pt=(n(156),function(e){var t=e.children,n=e.slotWrapper,o=void 0!==n&&n;return p.Children.count(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-wrapper".concat(o?" slot-wrapper":"")},t):null});!function(e){e.CHECKOUT="woocommerce/checkout",e.CHECKOUT_FIELDS="woocommerce/checkout-fields-block",e.CHECKOUT_TOTALS="woocommerce/checkout-totals-block",e.CONTACT_INFORMATION="woocommerce/checkout-contact-information-block",e.SHIPPING_ADDRESS="woocommerce/checkout-shipping-address-block",e.BILLING_ADDRESS="woocommerce/checkout-billing-address-block",e.SHIPPING_METHODS="woocommerce/checkout-shipping-methods-block",e.PAYMENT_METHODS="woocommerce/checkout-payment-methods-block",e.CART="woocommerce/cart-i2",e.EMPTY_CART="woocommerce/empty-cart-block",e.FILLED_CART="woocommerce/filled-cart-block",e.CART_ITEMS="woocommerce/cart-items-block",e.CART_TOTALS="woocommerce/cart-totals-block"}(ut||(ut={}));var dt={},mt=function(e){return Object.values(ut).includes(e)},ht=function(e){return mt(e)?Object.values(dt).filter((function(t){var n=t.metadata;return((null==n?void 0:n.parent)||[]).includes(e)})):[]},bt=n(48),vt=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object},gt=function(e){var t,n,r,o;!function(e,t,n){if(vt(e)){var r=be()(e.metadata);if("object"!==r)throw new Error("Incorrect value for the ".concat("metadata"," argument when registering a block component. It was a ").concat(r,", but must be a ").concat("object","."))}}(e),function(e){if(function(e,t,n){var r=be()(t);if("string"!==r)throw new Error("Incorrect value for the ".concat("blockName"," argument when registering a checkout block. It was a ").concat(r,", but must be a ").concat("string","."))}(0,e),!e)throw new Error("Value for the blockName argument must not be empty.")}(e.metadata.name),function(e){if("string"!=typeof e&&!Array.isArray(e))throw new Error("Incorrect value for the parent argument when registering a checkout block. It was a ".concat(be()(e),", but must be a string or array of strings."));if("string"==typeof e&&!mt(e))throw new Error("When registering a checkout block, the parent must be a valid inner block area.");if(Array.isArray(e)&&!e.some((function(e){return mt(e)})))throw new Error("When registering a checkout block, the parent must be a valid inner block area.")}(e.metadata.parent),function(e,t){var n=e.component;if(n){if("function"==typeof n)return;if(vt(n)&&n.$$typeof&&n.$$typeof===Symbol.for("react.lazy"))return}throw new Error("Incorrect value for the ".concat("component"," argument when registering a block component. Component must be a valid React Element or Lazy callback."))}(e),Object(bt.registerBlockComponent)({blockName:e.metadata.name,component:e.component}),dt[e.metadata.name]={blockName:e.metadata.name,metadata:e.metadata,component:e.component,force:!(null===(t=e.metadata)||void 0===t||null===(n=t.attributes)||void 0===n||null===(r=n.lock)||void 0===r||null===(o=r.default)||void 0===o||!o.remove)}},yt=it("__experimentalOrderMeta"),Ot=yt.Fill,wt=yt.Slot;Ot.Slot=function(e){var t=e.className,n=e.extensions,o=e.cart,c=nt("__experimentalOrderMeta").fills;return ot(c)&&Object(r.createElement)(pt,{slotWrapper:!0},Object(r.createElement)(wt,{className:i()(t,"wc-block-components-order-meta"),fillProps:{extensions:n,cart:o}}))};var jt=Ot,St=it("__experimentalDiscountsMeta"),xt=St.Fill,Et=St.Slot;xt.Slot=function(e){var t=e.className,n=e.extensions,o=e.cart,c=nt("__experimentalDiscountsMeta").fills;return ot(c)&&Object(r.createElement)(pt,{slotWrapper:!0},Object(r.createElement)(Et,{className:i()(t,"wc-block-components-discounts-meta"),fillProps:{extensions:n,cart:o}}))};var kt=xt,Pt=it("__experimentalOrderShippingPackages"),_t=Pt.Fill,Ft=Pt.Slot;_t.Slot=function(e){var t=e.className,n=e.collapsible,o=e.noResultsMessage,c=e.renderOption,a=e.extensions,u=e.cart,s=e.components,l=nt("__experimentalOrderShippingPackages").fills.length>1;return Object(r.createElement)(Ft,{className:i()("wc-block-components-shipping-rates-control",t),fillProps:{collapsible:n,collapse:l,showItems:l,noResultsMessage:o,renderOption:c,extensions:a,cart:u,components:s}})};var Ct=_t,Tt=n(12),Dt=n.n(Tt),Nt=["srcElement","size"];function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Mt=function(e){var t=e.srcElement,n=e.size,o=void 0===n?24:n,i=f()(e,Nt);return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:o,height:o},i)):null},It=Object(r.createElement)(X.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"})),At=Object(r.createElement)(X.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"})),Bt=(n(157),function(e){var t=e.children,n=e.className,o=e.initialOpen,c=void 0!==o&&o,a=e.hasBorder,u=void 0!==a&&a,s=e.title,l=e.titleTag,f=void 0===l?"div":l,p=Object(r.useState)(c),d=Dt()(p,2),m=d[0],h=d[1];return Object(r.createElement)("div",{className:i()(n,"wc-block-components-panel",{"has-border":u})},Object(r.createElement)(f,null,Object(r.createElement)("button",{"aria-expanded":m,className:"wc-block-components-panel__button",onClick:function(){return h(!m)}},Object(r.createElement)(Mt,{"aria-hidden":"true",className:"wc-block-components-panel__button-icon",srcElement:m?It:At}),s)),m&&Object(r.createElement)("div",{className:"wc-block-components-panel__content"},t))}),Lt=n(25),Vt=n(33),Ut=n(16),Wt=Object(r.createElement)(X.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(X.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"}));function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kt(e,t,n,r,o,i,c){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==i&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==i&&(p=s);var d,m={popoverLeft:f,contentWidth:f-a>0?a:f},h={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},b=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)b="center";else if("left"===n&&m.contentWidth===a)b="left";else if("right"===n&&h.contentWidth===a)b="right";else{var g="left"==(b=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;v=g!==a?g:null}if(d="center"===b?l.popoverLeft:"left"===b?m.popoverLeft:h.popoverLeft,c){var y=c.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:b,popoverLeft:d,contentWidth:v}}function $t(e,t,n,r,o,i,c){var a=t.height;if(o){var u=(Object(Lt.getScrollContainer)(i)||document.body).getBoundingClientRect().top+a-c;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={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},d=n,m=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var h="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==a?h:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Gt=Object(r.createContext)({focusHistory:[]}),qt=Gt.Provider,Yt=Gt.Consumer;qt.displayName="FocusReturnProvider",Yt.displayName="FocusReturnConsumer",r.Component;var Zt=Object(Ut.createHigherOrderComponent)((function e(t){if((o=t)instanceof r.Component||"function"==typeof o){var n=t;return e({})(n)}var o,i=t.onFocusReturn,c=void 0===i?ge.stubTrue:i;return function(e){var t=function(t){me(a,t);var n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function a(){var e;return ae(this,a),(e=i.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return se(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,o=[].concat(je(ge.without.apply(void 0,[this.props.focus.focusHistory].concat(je(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),a}(r.Component);return function(e){return Object(r.createElement)(Yt,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var Jt=Object(Ut.createHigherOrderComponent)((function(e){return function(t){me(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function c(){var e;return ae(this,c),(e=i.apply(this,arguments)).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(le(e)),e}return se(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===Vt.TAB){var t=Lt.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),c}(r.Component)}),"withConstrainedTabbing");var Qt=["button","submit"];var Xt=Object(Ut.createHigherOrderComponent)((function(e){return function(t){me(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function c(){var e;return ae(this,c),(e=i.apply(this,arguments)).bindNode=e.bindNode.bind(le(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(le(e)),e.queueBlurCheck=e.queueBlurCheck.bind(le(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(le(e)),e}return se(c,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(ge.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(ge.includes)(Qt,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,ie({ref:this.bindNode},this.props)))}}]),c}(r.Component)}),"withFocusOutside")(function(e){me(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function o(){return ae(this,o),r.apply(this,arguments)}return se(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(r.Component));function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=fe(e);if(t){var o=fe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ve(this,n)}}var tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,i=void 0===o?"lockscroll":o,c=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](i),n.documentElement.classList[r](i),e||(t.scrollTop=a)}function s(){0===c&&u(!0),++c}function l(){1===c&&u(!1),--c}return function(e){me(n,e);var t=en(n);function n(){return ae(this,n),t.apply(this,arguments)}return se(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(r.Component)}();function nn(e){e.stopPropagation()}var rn=Object(r.forwardRef)((function(e,t){var n=e.children,o=ce(e,["children"]);return Object(r.createElement)("div",ie({},o,{ref:t,onMouseDown:nn}),n)}));function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function an(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=we(r.split(" "),2),a=c[0],u=c[1],s=void 0===u?"center":u;return i()("components-animate__appear",(ee(o={},"is-from-"+s,"center"!==s),ee(o,"is-from-"+a,"middle"!==a),o))}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):"loading"===t?i()("components-animate__loading"):void 0}function un(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:an(cn({type:t},r))})}var sn=Jt(Zt((function(e){return e.children})));function ln(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,i=r.paddingBottom,c=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function fn(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function pn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function dn(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var mn=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,c=e.children,a=e.className,u=e.noArrow,s=void 0===u||u,l=e.isAlternate,f=e.position,p=void 0===f?"bottom right":f,d=(e.range,e.focusOnMount),m=void 0===d?"firstElement":d,h=e.anchorRef,b=e.shouldAnchorIncludePadding,v=e.anchorRect,g=e.getAnchorRect,y=e.expandOnMobile,O=e.animate,w=void 0===O||O,j=e.onClickOutside,S=e.onFocusOutside,x=e.__unstableSticky,E=e.__unstableSlotName,k=void 0===E?"Popover":E,P=e.__unstableObserveElement,_=e.__unstableBoundaryParent,F=ce(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(r.useRef)(null),T=Object(r.useRef)(null),D=Object(r.useRef)(),N=Object(Ut.useViewportMatch)("medium","<"),R=we(Object(r.useState)(),2),M=R[0],I=R[1],A=oe(k),B=y&&N,L=we(Object(Ut.useResizeObserver)(),2),V=L[0],U=L[1];s=B||s,Object(r.useLayoutEffect)((function(){if(B)return dn(D.current,"is-without-arrow",s),dn(D.current,"is-alternate",l),fn(D.current,"data-x-axis"),fn(D.current,"data-y-axis"),pn(D.current,"top"),pn(D.current,"left"),pn(T.current,"maxHeight"),void pn(T.current,"maxWidth");var e=function(){if(D.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(Lt.getRectangleFromRange)(r);if(r instanceof window.Element){var i=r.getBoundingClientRect();return o?i:ln(i,r)}var c=r.top,a=r.bottom,u=c.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ln(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ln(p,f)}}(C,v,g,h,b);if(e){var t,n,r=D.current,o=r.offsetParent,i=r.ownerDocument,c=0;if(o&&o!==i.body){var a=o.getBoundingClientRect();c=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}_&&(t=null===(n=D.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=we(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=$t(e,t,s,p,r,o,i),m=Kt(e,t,f,p,r,d.yAxis,c);return zt(zt({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),p,x,D.current,c,t),f=u.popoverTop,d=u.popoverLeft,m=u.xAxis,y=u.yAxis,O=u.contentHeight,w=u.contentWidth;"number"==typeof f&&"number"==typeof d&&(pn(D.current,"top",f+"px"),pn(D.current,"left",d+"px")),dn(D.current,"is-without-arrow",s||"center"===m&&"middle"===y),dn(D.current,"is-alternate",l),fn(D.current,"data-x-axis",m),fn(D.current,"data-y-axis",y),pn(T.current,"maxHeight","number"==typeof O?O+"px":""),pn(T.current,"maxWidth","number"==typeof w?w+"px":""),I(({left:"right",right:"left"}[m]||"center")+" "+({top:"bottom",bottom:"top"}[y]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),P&&(n=new window.MutationObserver(e)).observe(P,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[B,v,g,h,b,p,U,x,P,_]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=Lt.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(m,T);var W=function(e){e.keyCode===Vt.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)},H=Object(r.createElement)(Xt,{onFocusOutside:function(e){if(S)S(e);else if(j){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Q()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(t)}else n&&n()}},Object(r.createElement)(un,{type:w&&M?"appear":null,options:{origin:M}},(function(e){var o=e.className;return Object(r.createElement)(rn,ie({className:i()("components-popover",a,o,{"is-expanded":B,"is-without-arrow":s,"is-alternate":l})},F,{onKeyDown:W,ref:D}),B&&Object(r.createElement)(tn,null),B&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(xn,{className:"components-popover__close",icon:Wt,onClick:n})),Object(r.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(r.createElement)("div",{style:{position:"relative"}},V,c)))})));return m&&(H=Object(r.createElement)(sn,null,H)),A.ref&&(H=Object(r.createElement)(We,{name:k},H)),h||v?H:Object(r.createElement)("span",{ref:C},H)};mn.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(r.createElement)(Ue,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var hn=mn,bn=function(e){var t,n,o=e.shortcut,i=e.className;return o?(Object(ge.isString)(o)&&(t=o),Object(ge.isObject)(o)&&(t=o.display,n=o.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null};var vn=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).delayedSetIsOver=Object(ge.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return se(i,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(ge.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,o=e.text,i=e.shortcut;if(1!==r.Children.count(t))return t;var c=r.Children.only(t),a=this.state.isOver;return Object(r.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(r.concatChildren)(c.props.children,a&&Object(r.createElement)(hn,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},o,Object(r.createElement)(bn,{className:"components-tooltip__shortcut",shortcut:i})))})}}]),i}(r.Component),gn=function(e){var t=e.icon,n=e.className,o=ce(e,["icon","className"]),i=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(r.createElement)("span",ie({className:i},o))};function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wn=function(e){var t=e.icon,n=void 0===t?null:t,o=e.size,i=ce(e,["icon","size"]);if("string"==typeof n)return Object(r.createElement)(gn,ie({icon:n},i));if(n&&gn===n.type)return Object(r.cloneElement)(n,On({},i));var c=o||24;if("function"==typeof n)return n.prototype instanceof r.Component?Object(r.createElement)(n,On({size:c},i)):n(On({size:c},i));if(n&&("svg"===n.type||n.type===X.SVG)){var a=On(On({width:c,height:c},n.props),i);return Object(r.createElement)(X.SVG,a)}return Object(r.isValidElement)(n)?Object(r.cloneElement)(n,On({size:c},i)):n};function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Sn=["onMouseDown","onClick"],xn=Object(r.forwardRef)((function(e,t){var n=e.href,o=e.target,c=e.isPrimary,a=e.isSmall,u=e.isTertiary,s=e.isPressed,l=e.isBusy,f=e.isDefault,p=e.isSecondary,d=e.isLink,m=e.isDestructive,h=e.className,b=e.disabled,v=e.icon,g=e.iconSize,y=e.showTooltip,O=e.tooltipPosition,w=e.shortcut,j=e.label,S=e.children,x=e.__experimentalIsFocusable,E=ce(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);f&&Q()("Button isDefault prop",{alternative:"isSecondary"});var k=i()("components-button",h,{"is-secondary":f||p,"is-primary":c,"is-small":a,"is-tertiary":u,"is-pressed":s,"is-busy":l,"is-link":d,"is-destructive":m,"has-text":!!v&&!!S,"has-icon":!!v}),P=b&&!x,_=void 0===n||P?"button":"a",F="a"===_?{href:n,target:o}:{type:"button",disabled:P,"aria-pressed":s};if(b&&x){F["aria-disabled"]=!0;var C,T=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jn(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jn(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}(Sn);try{for(T.s();!(C=T.n()).done;)E[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){T.e(e)}finally{T.f()}}var D=!P&&(y&&j||w||!!j&&(!S||Object(ge.isArray)(S)&&!S.length)&&!1!==y),N=Object(r.createElement)(_,ie({},F,E,{className:k,"aria-label":E["aria-label"]||j,ref:t}),v&&Object(r.createElement)(wn,{icon:v,size:g}),S);return D?Object(r.createElement)(vn,{text:j,shortcut:w,position:O},N):N})),En=(n(159),function(){return Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}),kn=(n(158),["className","showSpinner","children"]),Pn=function(e){var t=e.className,n=e.showSpinner,o=void 0!==n&&n,c=e.children,u=f()(e,kn),s=i()("wc-block-components-button",t,{"wc-block-components-button--loading":o});return Object(r.createElement)(xn,a()({className:s},u),o&&Object(r.createElement)(En,null),Object(r.createElement)("span",{className:"wc-block-components-button__text"},c))};function Fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Tn=function(e){var t,n=e.label,o=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,u=void 0===a?{}:a,s=null!=n,l=null!=o;return!s&&l?(t=c||"span",u=Cn(Cn({},u),{},{className:i()(u.className,"screen-reader-text")}),Object(r.createElement)(t,u,o)):(t=c||r.Fragment,s&&l&&n!==o?Object(r.createElement)(t,u,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,u,n))}}]);
build/cart-blocks/checkout-button-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[22],{143:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(23),o=n.n(r),i=n(76),s=n(6),l=n.n(s),u=n(138),d=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,c=void 0!==n&&n,r=e.children,s=o()(e,d),m=l()("wc-block-components-button",t,{"wc-block-components-button--loading":c});return React.createElement(i.a,a()({className:m},s),c&&React.createElement(u.a,null),React.createElement("span",{className:"wc-block-components-button__text"},r))}},187:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var c=n(53),a=n(173),r=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(a.b)(),n=t.paymentMethods,r=t.expressPaymentMethods,o=t.paymentMethodsInitialized,i=t.expressPaymentMethodsInitialized,s=Object(c.a)(n),l=Object(c.a)(r);return{paymentMethods:e?l:s,isInitialized:e?i:o}},o=function(){return r(!1)},i=function(){return r(!0)}},192:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(4),o=n.n(r),i=n(6),s=n.n(i),l=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},u=function(e){var t=e.id,n=e.src,c=void 0===n?null:n,a=e.alt,r=void 0===a?"":a;return c?React.createElement("img",{className:l(t),src:c,alt:r}):null},d=n(83),m=[{id:"alipay",alt:"Alipay",src:d.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.l+"payment-methods/wechat.svg"}],p=n(20),b=n.n(p),f=n(49);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(265),t.a=function(e){var t=e.icons,n=void 0===t?[]:t,c=e.align,r=void 0===c?"center":c,o=function(e){var t={};return e.forEach((function(e){var n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"===b()(e)&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(f.c)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}(n);if(0===o.length)return null;var i=s()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===r,"wc-block-components-payment-method-icons--align-right":"right"===r});return React.createElement("div",{className:i},o.map((function(e){var t,n=y(y({},e),(t=e.id,m.find((function(e){return e.id===t}))||{}));return React.createElement(u,a()({key:"payment-method-icon-"+e.id},n))})))}},251:function(e,t){},265:function(e,t){},273:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},324:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var c=n(5),a=n.n(c),r=n(0),o={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},i=function(){var e=Object(r.useState)(""),t=a()(e,2),n=t[0],c=t[1],i=Object(r.useRef)(null),s=Object(r.useRef)("function"!=typeof IntersectionObserver?{observe:function(){},unobserve:function(){}}:new IntersectionObserver((function(e){e[0].isIntersecting?c("visible"):c(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return Object(r.useLayoutEffect)((function(){var e=i.current,t=s.current;return e&&t.observe(e),function(){t.unobserve(e)}}),[]),[React.createElement("div",{"aria-hidden":!0,ref:i,style:o}),n]}},345:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,a()({},n,c))}}}},385:function(e,t,n){"use strict";(function(e){var c=n(5),a=n.n(c),r=n(1),o=n(0),i=n(192),s=n(143),l=n(83),u=n(48),d=n(187),m=n(324),p=(n(386),function(e){return Object.values(e).reduce((function(e,t){return null!==t.icons&&(e=e.concat(t.icons)),e}),[])});t.a=function(t){var n=t.link,c=Object(u.b)().isCalculating,b=Object(m.a)(),f=a()(b,2),v=f[0],y=f[1],h=Object(o.useState)(!1),g=a()(h,2),w=g[0],O=g[1],j=Object(d.b)().paymentMethods;Object(o.useEffect)((function(){if("function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener){var t=function(){O(!1)};return e.addEventListener("pageshow",t),function(){e.removeEventListener("pageshow",t)}}}),[]);var k=React.createElement(React.Fragment,null,React.createElement(s.a,{className:"wc-block-cart__submit-button",href:n||l.d,disabled:c,onClick:function(){return O(!0)},showSpinner:w},Object(r.__)("Proceed to Checkout","woo-gutenberg-products-block")),React.createElement(i.a,{icons:p(j)}));return React.createElement("div",{className:"wc-block-cart__submit"},v,React.createElement("div",{className:"wc-block-cart__submit-container"},k),"below"===y&&React.createElement("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},k))}}).call(this,n(273))},386:function(e,t){},415:function(e,t,n){"use strict";n.r(t);var c=n(345),a=n(2),r=n(385);t.default=Object(c.a)({checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}})((function(e){var t=e.checkoutPageId;return React.createElement(r.a,{link:Object(a.getSetting)("page-"+t,!1)})}))}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[22],{143:function(t,e,n){"use strict";var c=n(14),a=n.n(c),r=n(23),o=n.n(r),i=n(76),s=n(6),l=n.n(s),u=n(138),d=(n(251),["className","showSpinner","children"]);e.a=function(t){var e=t.className,n=t.showSpinner,c=void 0!==n&&n,r=t.children,s=o()(t,d),m=l()("wc-block-components-button",e,{"wc-block-components-button--loading":c});return React.createElement(i.a,a()({className:m},s),c&&React.createElement(u.a,null),React.createElement("span",{className:"wc-block-components-button__text"},r))}},187:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var c=n(53),a=n(173),r=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=Object(a.b)(),n=e.paymentMethods,r=e.expressPaymentMethods,o=e.paymentMethodsInitialized,i=e.expressPaymentMethodsInitialized,s=Object(c.a)(n),l=Object(c.a)(r);return{paymentMethods:t?l:s,isInitialized:t?i:o}},o=function(){return r(!1)},i=function(){return r(!0)}},192:function(t,e,n){"use strict";var c=n(14),a=n.n(c),r=n(4),o=n.n(r),i=n(6),s=n.n(i),l=function(t){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t)},u=function(t){var e=t.id,n=t.src,c=void 0===n?null:n,a=t.alt,r=void 0===a?"":a;return c?React.createElement("img",{className:l(e),src:c,alt:r}):null},d=n(83),m=[{id:"alipay",alt:"Alipay",src:d.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.l+"payment-methods/wechat.svg"}],p=n(21),b=n.n(p),f=n(49);function v(t,e){var n=Object.keys(t);if(O