Version Description
- 2021-11-25 =
Bug Fixes
- Fix fatal error in certain WP 5.9 pre-release versions. (5183)
Download this release
Release Info
Developer | automattic |
Plugin | WooCommerce Gutenberg Products Block |
Version | 6.3.3 |
Comparing to | |
See all releases |
Code changes from version 6.4.0 to 6.3.3
- assets/js/base/components/quantity-selector/index.tsx +2 -2
- assets/js/base/context/hooks/cart/use-store-cart-event-listeners.ts +1 -1
- assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts +0 -2
- assets/js/base/context/providers/cart-checkout/payment-methods/payment-method-data-context.tsx +1 -1
- assets/js/base/utils/render-frontend.js +9 -39
- assets/js/blocks/cart-checkout/cart/cart-line-items-table/index.tsx +1 -1
- assets/js/blocks/cart-checkout/checkout/index.tsx +0 -87
- assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/edit.tsx +24 -4
- assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/editor.scss +1 -1
- assets/js/blocks/cart-checkout/mini-cart-contents/block.tsx +0 -104
- assets/js/blocks/cart-checkout/mini-cart-contents/edit.tsx +0 -17
- assets/js/blocks/cart-checkout/mini-cart-contents/index.tsx +0 -62
- assets/js/blocks/cart-checkout/mini-cart/block.tsx +97 -51
- assets/js/blocks/cart-checkout/mini-cart/component-frontend.tsx +0 -3
- assets/js/blocks/cart-checkout/mini-cart/test/block.js +8 -15
- assets/js/editor-components/compatibility-notices/cart-checkout-compatibility-notice.tsx +4 -4
- assets/js/editor-components/compatibility-notices/style.scss +0 -31
- assets/js/editor-components/compatibility-notices/woo-image.js +1 -1
- assets/js/types/type-defs/registered-payment-method-props.js +0 -2
- build/active-filters-frontend.asset.php +1 -1
- build/active-filters-frontend.js +4 -4
- build/active-filters.asset.php +1 -1
- build/active-filters.js +3 -3
- build/all-products-frontend.asset.php +1 -1
- build/all-products-frontend.js +4 -4
- build/all-products.asset.php +1 -1
- build/all-products.js +12 -12
- build/all-reviews.asset.php +1 -1
- build/all-reviews.js +3 -3
- build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js +2 -2
- build/atomic-block-components/add-to-cart--atomic-block-components/button.js +1 -1
- build/atomic-block-components/add-to-cart-frontend.js +1 -1
- build/atomic-block-components/add-to-cart.js +2 -2
- build/atomic-block-components/button.js +1 -1
- build/atomic-block-components/category-list.js +1 -1
- build/atomic-block-components/image.js +2 -2
- build/atomic-block-components/price-frontend.js +2 -2
- build/atomic-block-components/price.js +2 -2
- build/atomic-block-components/rating.js +1 -1
- build/atomic-block-components/sale-badge.js +1 -1
- build/atomic-block-components/sku.js +1 -1
- build/atomic-block-components/stock-indicator.js +1 -1
- build/atomic-block-components/summary.js +1 -1
- build/atomic-block-components/tag-list.js +1 -1
- build/atomic-block-components/title.js +1 -1
- build/attribute-filter-frontend.asset.php +1 -1
- build/attribute-filter-frontend.js +5 -5
- build/attribute-filter.asset.php +1 -1
- build/attribute-filter.js +3 -3
assets/js/base/components/quantity-selector/index.tsx
CHANGED
@@ -6,6 +6,7 @@ import { speak } from '@wordpress/a11y';
|
|
6 |
import classNames from 'classnames';
|
7 |
import { useCallback } from '@wordpress/element';
|
8 |
import { DOWN, UP } from '@wordpress/keycodes';
|
|
|
9 |
|
10 |
/**
|
11 |
* Internal dependencies
|
@@ -83,8 +84,7 @@ const QuantitySelector = ( {
|
|
83 |
onKeyDown={ quantityInputOnKeyDown }
|
84 |
onChange={ ( event ) => {
|
85 |
let value =
|
86 |
-
|
87 |
-
! event.target.value
|
88 |
? 0
|
89 |
: parseInt( event.target.value, 10 );
|
90 |
if ( hasMaximum ) {
|
6 |
import classNames from 'classnames';
|
7 |
import { useCallback } from '@wordpress/element';
|
8 |
import { DOWN, UP } from '@wordpress/keycodes';
|
9 |
+
import { isNumber } from '@woocommerce/types';
|
10 |
|
11 |
/**
|
12 |
* Internal dependencies
|
84 |
onKeyDown={ quantityInputOnKeyDown }
|
85 |
onChange={ ( event ) => {
|
86 |
let value =
|
87 |
+
! isNumber( event.target.value ) || ! event.target.value
|
|
|
88 |
? 0
|
89 |
: parseInt( event.target.value, 10 );
|
90 |
if ( hasMaximum ) {
|
assets/js/base/context/hooks/cart/use-store-cart-event-listeners.ts
CHANGED
@@ -36,7 +36,7 @@ const setUp = (): void => {
|
|
36 |
const addListeners = (): void => {
|
37 |
setUp();
|
38 |
|
39 |
-
if ( window.wcBlocksStoreCartListeners.count
|
40 |
const removeJQueryAddedToCartEvent = translateJQueryEventToNative(
|
41 |
'added_to_cart',
|
42 |
`wc-blocks_added_to_cart`
|
36 |
const addListeners = (): void => {
|
37 |
setUp();
|
38 |
|
39 |
+
if ( ! window.wcBlocksStoreCartListeners.count ) {
|
40 |
const removeJQueryAddedToCartEvent = translateJQueryEventToNative(
|
41 |
'added_to_cart',
|
42 |
`wc-blocks_added_to_cart`
|
assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts
CHANGED
@@ -8,7 +8,6 @@ import PaymentMethodLabel from '@woocommerce/base-components/cart-checkout/payme
|
|
8 |
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
|
9 |
import { getSetting } from '@woocommerce/settings';
|
10 |
import deprecated from '@wordpress/deprecated';
|
11 |
-
import LoadingMask from '@woocommerce/base-components/loading-mask';
|
12 |
|
13 |
/**
|
14 |
* Internal dependencies
|
@@ -127,7 +126,6 @@ export const usePaymentMethodInterface = (): Record< string, unknown > => {
|
|
127 |
ValidationInputError,
|
128 |
PaymentMethodIcons,
|
129 |
PaymentMethodLabel,
|
130 |
-
LoadingMask,
|
131 |
},
|
132 |
emitResponse: {
|
133 |
noticeContexts,
|
8 |
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
|
9 |
import { getSetting } from '@woocommerce/settings';
|
10 |
import deprecated from '@wordpress/deprecated';
|
|
|
11 |
|
12 |
/**
|
13 |
* Internal dependencies
|
126 |
ValidationInputError,
|
127 |
PaymentMethodIcons,
|
128 |
PaymentMethodLabel,
|
|
|
129 |
},
|
130 |
emitResponse: {
|
131 |
noticeContexts,
|
assets/js/base/context/providers/cart-checkout/payment-methods/payment-method-data-context.tsx
CHANGED
@@ -60,7 +60,7 @@ export const usePaymentMethodDataContext = (): PaymentMethodDataContextType => {
|
|
60 |
export const PaymentMethodDataProvider = ( {
|
61 |
children,
|
62 |
}: {
|
63 |
-
children: React.
|
64 |
} ): JSX.Element => {
|
65 |
const {
|
66 |
isProcessing: checkoutIsProcessing,
|
60 |
export const PaymentMethodDataProvider = ( {
|
61 |
children,
|
62 |
}: {
|
63 |
+
children: React.ReactChildren;
|
64 |
} ): JSX.Element => {
|
65 |
const {
|
66 |
isProcessing: checkoutIsProcessing,
|
assets/js/base/utils/render-frontend.js
CHANGED
@@ -53,47 +53,17 @@ const renderBlockInContainers = ( {
|
|
53 |
};
|
54 |
el.classList.remove( 'is-loading' );
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
} );
|
64 |
};
|
65 |
|
66 |
-
/**
|
67 |
-
* Renders a block component in a single `container` node.
|
68 |
-
*
|
69 |
-
* @param {Object} props Render props.
|
70 |
-
* @param {Function} props.Block React component to use as a
|
71 |
-
* replacement.
|
72 |
-
* @param {Node} props.container Container to replace with
|
73 |
-
* the Block component.
|
74 |
-
* @param {Object} [props.attributes] Attributes object for the
|
75 |
-
* block.
|
76 |
-
* @param {Object} [props.props] Props object for the block.
|
77 |
-
* @param {Object} [props.errorBoundaryProps] Props object for the error
|
78 |
-
* boundary.
|
79 |
-
*/
|
80 |
-
export const renderBlock = ( {
|
81 |
-
Block,
|
82 |
-
container,
|
83 |
-
attributes = {},
|
84 |
-
props = {},
|
85 |
-
errorBoundaryProps = {},
|
86 |
-
} ) => {
|
87 |
-
render(
|
88 |
-
<BlockErrorBoundary { ...errorBoundaryProps }>
|
89 |
-
<Suspense fallback={ <div className="wc-block-placeholder" /> }>
|
90 |
-
<Block { ...props } attributes={ attributes } />
|
91 |
-
</Suspense>
|
92 |
-
</BlockErrorBoundary>,
|
93 |
-
container
|
94 |
-
);
|
95 |
-
};
|
96 |
-
|
97 |
/**
|
98 |
* Renders the block frontend in the elements matched by the selector which are
|
99 |
* outside the wrapper elements.
|
@@ -171,7 +141,7 @@ const renderBlockInsideWrapper = ( {
|
|
171 |
* Renders the block frontend on page load. If the block is contained inside a
|
172 |
* wrapper element that should be excluded from initial load, it adds the
|
173 |
* appropriate event listeners to render the block when the
|
174 |
-
* `
|
175 |
*
|
176 |
* @param {Object} props Render props.
|
177 |
* @param {Function} props.Block React component to use as a
|
53 |
};
|
54 |
el.classList.remove( 'is-loading' );
|
55 |
|
56 |
+
render(
|
57 |
+
<BlockErrorBoundary { ...errorBoundaryProps }>
|
58 |
+
<Suspense fallback={ <div className="wc-block-placeholder" /> }>
|
59 |
+
<Block { ...props } attributes={ attributes } />
|
60 |
+
</Suspense>
|
61 |
+
</BlockErrorBoundary>,
|
62 |
+
el
|
63 |
+
);
|
64 |
} );
|
65 |
};
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
/**
|
68 |
* Renders the block frontend in the elements matched by the selector which are
|
69 |
* outside the wrapper elements.
|
141 |
* Renders the block frontend on page load. If the block is contained inside a
|
142 |
* wrapper element that should be excluded from initial load, it adds the
|
143 |
* appropriate event listeners to render the block when the
|
144 |
+
* `blocks_render_blocks_frontend` event is triggered.
|
145 |
*
|
146 |
* @param {Object} props Render props.
|
147 |
* @param {Function} props.Block React component to use as a
|
assets/js/blocks/cart-checkout/cart/cart-line-items-table/index.tsx
CHANGED
@@ -19,7 +19,7 @@ const placeholderRows = [ ...Array( 3 ) ].map( ( _x, i ) => (
|
|
19 |
interface CartLineItemsTableProps {
|
20 |
lineItems: CartResponseItem[];
|
21 |
isLoading: boolean;
|
22 |
-
className
|
23 |
}
|
24 |
|
25 |
const setRefs = ( lineItems: CartResponseItem[] ) => {
|
19 |
interface CartLineItemsTableProps {
|
20 |
lineItems: CartResponseItem[];
|
21 |
isLoading: boolean;
|
22 |
+
className: string;
|
23 |
}
|
24 |
|
25 |
const setRefs = ( lineItems: CartResponseItem[] ) => {
|
assets/js/blocks/cart-checkout/checkout/index.tsx
CHANGED
@@ -5,7 +5,6 @@ import { __ } from '@wordpress/i18n';
|
|
5 |
import classnames from 'classnames';
|
6 |
import { Icon, fields } from '@woocommerce/icons';
|
7 |
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
|
8 |
-
import { BlockInstance, createBlock } from '@wordpress/blocks';
|
9 |
|
10 |
/**
|
11 |
* Internal dependencies
|
@@ -49,92 +48,6 @@ const settings = {
|
|
49 |
/>
|
50 |
);
|
51 |
},
|
52 |
-
migrate: ( attributes: {
|
53 |
-
showOrderNotes: boolean;
|
54 |
-
showPolicyLinks: boolean;
|
55 |
-
showReturnToCart: boolean;
|
56 |
-
cartPageId: number;
|
57 |
-
} ) => {
|
58 |
-
const {
|
59 |
-
showOrderNotes,
|
60 |
-
showPolicyLinks,
|
61 |
-
showReturnToCart,
|
62 |
-
cartPageId,
|
63 |
-
} = attributes;
|
64 |
-
return [
|
65 |
-
attributes,
|
66 |
-
[
|
67 |
-
createBlock(
|
68 |
-
'woocommerce/checkout-fields-block',
|
69 |
-
{},
|
70 |
-
[
|
71 |
-
createBlock(
|
72 |
-
'woocommerce/checkout-express-payment-block',
|
73 |
-
{},
|
74 |
-
[]
|
75 |
-
),
|
76 |
-
createBlock(
|
77 |
-
'woocommerce/checkout-contact-information-block',
|
78 |
-
{},
|
79 |
-
[]
|
80 |
-
),
|
81 |
-
createBlock(
|
82 |
-
'woocommerce/checkout-shipping-address-block',
|
83 |
-
{},
|
84 |
-
[]
|
85 |
-
),
|
86 |
-
createBlock(
|
87 |
-
'woocommerce/checkout-billing-address-block',
|
88 |
-
{},
|
89 |
-
[]
|
90 |
-
),
|
91 |
-
createBlock(
|
92 |
-
'woocommerce/checkout-shipping-methods-block',
|
93 |
-
{},
|
94 |
-
[]
|
95 |
-
),
|
96 |
-
createBlock(
|
97 |
-
'woocommerce/checkout-payment-block',
|
98 |
-
{},
|
99 |
-
[]
|
100 |
-
),
|
101 |
-
showOrderNotes
|
102 |
-
? createBlock(
|
103 |
-
'woocommerce/checkout-order-note-block',
|
104 |
-
{},
|
105 |
-
[]
|
106 |
-
)
|
107 |
-
: false,
|
108 |
-
showPolicyLinks
|
109 |
-
? createBlock(
|
110 |
-
'woocommerce/checkout-terms-block',
|
111 |
-
{},
|
112 |
-
[]
|
113 |
-
)
|
114 |
-
: false,
|
115 |
-
createBlock(
|
116 |
-
'woocommerce/checkout-actions-block',
|
117 |
-
{
|
118 |
-
showReturnToCart,
|
119 |
-
cartPageId,
|
120 |
-
},
|
121 |
-
[]
|
122 |
-
),
|
123 |
-
].filter( Boolean ) as BlockInstance[]
|
124 |
-
),
|
125 |
-
createBlock( 'woocommerce/checkout-totals-block', {} ),
|
126 |
-
],
|
127 |
-
];
|
128 |
-
},
|
129 |
-
isEligible: (
|
130 |
-
attributes: Record< string, unknown >,
|
131 |
-
innerBlocks: BlockInstance[]
|
132 |
-
) => {
|
133 |
-
return ! innerBlocks.some(
|
134 |
-
( block: { name: string } ) =>
|
135 |
-
block.name === 'woocommerce/checkout-fields-block'
|
136 |
-
);
|
137 |
-
},
|
138 |
},
|
139 |
],
|
140 |
};
|
5 |
import classnames from 'classnames';
|
6 |
import { Icon, fields } from '@woocommerce/icons';
|
7 |
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
|
|
|
8 |
|
9 |
/**
|
10 |
* Internal dependencies
|
48 |
/>
|
49 |
);
|
50 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
},
|
52 |
],
|
53 |
};
|
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/edit.tsx
CHANGED
@@ -10,7 +10,10 @@ import type { TemplateArray } from '@wordpress/blocks';
|
|
10 |
/**
|
11 |
* Internal dependencies
|
12 |
*/
|
13 |
-
import {
|
|
|
|
|
|
|
14 |
import { useForcedLayout, getAllowedBlocks } from '../../../shared';
|
15 |
import './style.scss';
|
16 |
|
@@ -29,6 +32,12 @@ export const Edit = ( {
|
|
29 |
attributes?.className
|
30 |
),
|
31 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
const allowedBlocks = getAllowedBlocks( innerBlockAreas.CHECKOUT_FIELDS );
|
33 |
|
34 |
const {
|
@@ -42,9 +51,20 @@ export const Edit = ( {
|
|
42 |
[ 'woocommerce/checkout-billing-address-block', {}, [] ],
|
43 |
[ 'woocommerce/checkout-shipping-methods-block', {}, [] ],
|
44 |
[ 'woocommerce/checkout-payment-block', {}, [] ],
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
].filter( Boolean ) as unknown ) as TemplateArray;
|
49 |
|
50 |
useForcedLayout( {
|
10 |
/**
|
11 |
* Internal dependencies
|
12 |
*/
|
13 |
+
import {
|
14 |
+
useCheckoutBlockControlsContext,
|
15 |
+
useCheckoutBlockContext,
|
16 |
+
} from '../../context';
|
17 |
import { useForcedLayout, getAllowedBlocks } from '../../../shared';
|
18 |
import './style.scss';
|
19 |
|
32 |
attributes?.className
|
33 |
),
|
34 |
} );
|
35 |
+
const {
|
36 |
+
showOrderNotes,
|
37 |
+
showPolicyLinks,
|
38 |
+
showReturnToCart,
|
39 |
+
cartPageId,
|
40 |
+
} = useCheckoutBlockContext();
|
41 |
const allowedBlocks = getAllowedBlocks( innerBlockAreas.CHECKOUT_FIELDS );
|
42 |
|
43 |
const {
|
51 |
[ 'woocommerce/checkout-billing-address-block', {}, [] ],
|
52 |
[ 'woocommerce/checkout-shipping-methods-block', {}, [] ],
|
53 |
[ 'woocommerce/checkout-payment-block', {}, [] ],
|
54 |
+
showOrderNotes
|
55 |
+
? [ 'woocommerce/checkout-order-note-block', {}, [] ]
|
56 |
+
: false,
|
57 |
+
showPolicyLinks
|
58 |
+
? [ 'woocommerce/checkout-terms-block', {}, [] ]
|
59 |
+
: false,
|
60 |
+
[
|
61 |
+
'woocommerce/checkout-actions-block',
|
62 |
+
{
|
63 |
+
showReturnToCart,
|
64 |
+
cartPageId,
|
65 |
+
},
|
66 |
+
[],
|
67 |
+
],
|
68 |
].filter( Boolean ) as unknown ) as TemplateArray;
|
69 |
|
70 |
useForcedLayout( {
|
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/editor.scss
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
}
|
14 |
|
15 |
.wc-block-components-checkbox {
|
16 |
-
margin-
|
17 |
}
|
18 |
|
19 |
.wc-block-checkout__terms_notice .components-notice__action {
|
13 |
}
|
14 |
|
15 |
.wc-block-components-checkbox {
|
16 |
+
margin-right: $gap;
|
17 |
}
|
18 |
|
19 |
.wc-block-checkout__terms_notice .components-notice__action {
|
assets/js/blocks/cart-checkout/mini-cart-contents/block.tsx
DELETED
@@ -1,104 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { __ } from '@wordpress/i18n';
|
5 |
-
import { useEffect, useRef } from '@wordpress/element';
|
6 |
-
import {
|
7 |
-
usePaymentMethods,
|
8 |
-
useStoreCart,
|
9 |
-
} from '@woocommerce/base-context/hooks';
|
10 |
-
import { TotalsItem } from '@woocommerce/blocks-checkout';
|
11 |
-
import { CART_URL, CHECKOUT_URL } from '@woocommerce/block-settings';
|
12 |
-
import Button from '@woocommerce/base-components/button';
|
13 |
-
import { PaymentMethodDataProvider } from '@woocommerce/base-context';
|
14 |
-
import { getIconsFromPaymentMethods } from '@woocommerce/base-utils';
|
15 |
-
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
|
16 |
-
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
17 |
-
import { getSetting } from '@woocommerce/settings';
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Internal dependencies
|
21 |
-
*/
|
22 |
-
import CartLineItemsTable from '../cart/cart-line-items-table';
|
23 |
-
|
24 |
-
const PaymentMethodIconsElement = (): JSX.Element => {
|
25 |
-
const { paymentMethods } = usePaymentMethods();
|
26 |
-
return (
|
27 |
-
<PaymentMethodIcons
|
28 |
-
icons={ getIconsFromPaymentMethods( paymentMethods ) }
|
29 |
-
/>
|
30 |
-
);
|
31 |
-
};
|
32 |
-
|
33 |
-
const MiniCartContentsBlock = (): JSX.Element => {
|
34 |
-
const { cartItems, cartIsLoading, cartTotals } = useStoreCart();
|
35 |
-
const emptyCartRef = useRef< HTMLDivElement | null >( null );
|
36 |
-
|
37 |
-
const subTotal = getSetting( 'displayCartPricesIncludingTax', false )
|
38 |
-
? parseInt( cartTotals.total_items, 10 ) +
|
39 |
-
parseInt( cartTotals.total_items_tax, 10 )
|
40 |
-
: parseInt( cartTotals.total_items, 10 );
|
41 |
-
|
42 |
-
useEffect( () => {
|
43 |
-
// If the cart has been completely emptied, move focus to empty cart
|
44 |
-
// element.
|
45 |
-
if ( ! cartIsLoading && cartItems.length === 0 ) {
|
46 |
-
if ( emptyCartRef.current instanceof HTMLElement ) {
|
47 |
-
emptyCartRef.current.focus();
|
48 |
-
}
|
49 |
-
}
|
50 |
-
}, [ cartIsLoading, cartItems.length, emptyCartRef ] );
|
51 |
-
|
52 |
-
return ! cartIsLoading && cartItems.length === 0 ? (
|
53 |
-
<div
|
54 |
-
className="wc-block-mini-cart__empty-cart"
|
55 |
-
tabIndex={ -1 }
|
56 |
-
ref={ emptyCartRef }
|
57 |
-
>
|
58 |
-
{ __( 'Cart is empty', 'woo-gutenberg-products-block' ) }
|
59 |
-
</div>
|
60 |
-
) : (
|
61 |
-
<>
|
62 |
-
<div className="wc-block-mini-cart__items">
|
63 |
-
<CartLineItemsTable
|
64 |
-
lineItems={ cartItems }
|
65 |
-
isLoading={ cartIsLoading }
|
66 |
-
/>
|
67 |
-
</div>
|
68 |
-
<div className="wc-block-mini-cart__footer">
|
69 |
-
<TotalsItem
|
70 |
-
className="wc-block-mini-cart__footer-subtotal"
|
71 |
-
currency={ getCurrencyFromPriceResponse( cartTotals ) }
|
72 |
-
label={ __( 'Subtotal', 'woo-gutenberg-products-block' ) }
|
73 |
-
value={ subTotal }
|
74 |
-
description={ __(
|
75 |
-
'Shipping, taxes, and discounts calculated at checkout.',
|
76 |
-
'woo-gutenberg-products-block'
|
77 |
-
) }
|
78 |
-
/>
|
79 |
-
<div className="wc-block-mini-cart__footer-actions">
|
80 |
-
<Button
|
81 |
-
className="wc-block-mini-cart__footer-cart"
|
82 |
-
href={ CART_URL }
|
83 |
-
>
|
84 |
-
{ __( 'View my cart', 'woo-gutenberg-products-block' ) }
|
85 |
-
</Button>
|
86 |
-
<Button
|
87 |
-
className="wc-block-mini-cart__footer-checkout"
|
88 |
-
href={ CHECKOUT_URL }
|
89 |
-
>
|
90 |
-
{ __(
|
91 |
-
'Go to checkout',
|
92 |
-
'woo-gutenberg-products-block'
|
93 |
-
) }
|
94 |
-
</Button>
|
95 |
-
</div>
|
96 |
-
<PaymentMethodDataProvider>
|
97 |
-
<PaymentMethodIconsElement />
|
98 |
-
</PaymentMethodDataProvider>
|
99 |
-
</div>
|
100 |
-
</>
|
101 |
-
);
|
102 |
-
};
|
103 |
-
|
104 |
-
export default MiniCartContentsBlock;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/mini-cart-contents/edit.tsx
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import type { ReactElement } from 'react';
|
5 |
-
import { useBlockProps } from '@wordpress/block-editor';
|
6 |
-
|
7 |
-
const Edit = (): ReactElement => {
|
8 |
-
const blockProps = useBlockProps();
|
9 |
-
|
10 |
-
return (
|
11 |
-
<div { ...blockProps }>
|
12 |
-
<p>Editing the mini cart contents</p>
|
13 |
-
</div>
|
14 |
-
);
|
15 |
-
};
|
16 |
-
|
17 |
-
export default Edit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/mini-cart-contents/index.tsx
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { __ } from '@wordpress/i18n';
|
5 |
-
import { Icon, cart } from '@woocommerce/icons';
|
6 |
-
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Internal dependencies
|
10 |
-
*/
|
11 |
-
import edit from './edit';
|
12 |
-
|
13 |
-
const settings = {
|
14 |
-
apiVersion: 2,
|
15 |
-
title: __( 'Mini Cart Contents', 'woo-gutenberg-products-block' ),
|
16 |
-
icon: {
|
17 |
-
src: <Icon srcElement={ cart } />,
|
18 |
-
foreground: '#7f54b3',
|
19 |
-
},
|
20 |
-
category: 'woocommerce',
|
21 |
-
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
|
22 |
-
description: __(
|
23 |
-
'Display a mini cart widget.',
|
24 |
-
'woo-gutenberg-products-block'
|
25 |
-
),
|
26 |
-
supports: {
|
27 |
-
align: false,
|
28 |
-
html: false,
|
29 |
-
multiple: false,
|
30 |
-
reusable: false,
|
31 |
-
inserter: false,
|
32 |
-
},
|
33 |
-
attributes: {
|
34 |
-
lock: {
|
35 |
-
type: 'object',
|
36 |
-
default: {
|
37 |
-
remove: true,
|
38 |
-
move: true,
|
39 |
-
},
|
40 |
-
},
|
41 |
-
},
|
42 |
-
example: {
|
43 |
-
attributes: {
|
44 |
-
isPreview: true,
|
45 |
-
},
|
46 |
-
},
|
47 |
-
attributes: {
|
48 |
-
isPreview: {
|
49 |
-
type: 'boolean',
|
50 |
-
default: false,
|
51 |
-
save: false,
|
52 |
-
},
|
53 |
-
},
|
54 |
-
|
55 |
-
edit,
|
56 |
-
|
57 |
-
save() {
|
58 |
-
return null;
|
59 |
-
},
|
60 |
-
};
|
61 |
-
|
62 |
-
registerExperimentalBlockType( 'woocommerce/mini-cart-contents', settings );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/mini-cart/block.tsx
CHANGED
@@ -3,89 +3,69 @@
|
|
3 |
*/
|
4 |
import classnames from 'classnames';
|
5 |
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
|
6 |
import {
|
7 |
-
RawHTML,
|
8 |
-
useState,
|
9 |
-
useEffect,
|
10 |
-
useRef,
|
11 |
-
unmountComponentAtNode,
|
12 |
-
} from '@wordpress/element';
|
13 |
-
import {
|
14 |
-
renderBlock,
|
15 |
translateJQueryEventToNative,
|
|
|
16 |
} from '@woocommerce/base-utils';
|
17 |
-
import {
|
|
|
|
|
|
|
18 |
import Drawer from '@woocommerce/base-components/drawer';
|
19 |
import {
|
20 |
formatPrice,
|
21 |
getCurrencyFromPriceResponse,
|
22 |
} from '@woocommerce/price-format';
|
23 |
import { getSetting } from '@woocommerce/settings';
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
/**
|
26 |
* Internal dependencies
|
27 |
*/
|
|
|
28 |
import QuantityBadge from './quantity-badge';
|
29 |
-
import MiniCartContentsBlock from '../mini-cart-contents/block';
|
30 |
import './style.scss';
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
interface Props {
|
33 |
isInitiallyOpen?: boolean;
|
34 |
transparentButton: boolean;
|
35 |
colorClassNames?: string;
|
36 |
style?: Record< string, Record< string, string > >;
|
37 |
-
contents: string;
|
38 |
}
|
39 |
|
40 |
const MiniCartBlock = ( {
|
41 |
isInitiallyOpen = false,
|
42 |
colorClassNames,
|
43 |
style,
|
44 |
-
contents = '',
|
45 |
}: Props ): JSX.Element => {
|
46 |
-
const {
|
|
|
|
|
|
|
|
|
|
|
47 |
const [ isOpen, setIsOpen ] = useState< boolean >( isInitiallyOpen );
|
|
|
48 |
// We already rendered the HTML drawer placeholder, so we want to skip the
|
49 |
// slide in animation.
|
50 |
const [ skipSlideIn, setSkipSlideIn ] = useState< boolean >(
|
51 |
isInitiallyOpen
|
52 |
);
|
53 |
|
54 |
-
const contentsRef = useRef() as React.MutableRefObject< HTMLDivElement >;
|
55 |
-
|
56 |
-
useEffect( () => {
|
57 |
-
if ( contentsRef.current instanceof Element ) {
|
58 |
-
const container = contentsRef.current.querySelector(
|
59 |
-
'.wc-block-mini-cart-contents'
|
60 |
-
);
|
61 |
-
if ( ! container ) {
|
62 |
-
return;
|
63 |
-
}
|
64 |
-
if ( isOpen ) {
|
65 |
-
renderBlock( {
|
66 |
-
Block: MiniCartContentsBlock,
|
67 |
-
container,
|
68 |
-
} );
|
69 |
-
} else {
|
70 |
-
unmountComponentAtNode( container );
|
71 |
-
}
|
72 |
-
}
|
73 |
-
}, [ isOpen ] );
|
74 |
-
|
75 |
-
useEffect( () => {
|
76 |
-
return () => {
|
77 |
-
const contentsNode = contentsRef.current as unknown;
|
78 |
-
if ( contentsNode instanceof Element ) {
|
79 |
-
const container = contentsNode.querySelector(
|
80 |
-
'.wc-block-mini-cart-contents'
|
81 |
-
);
|
82 |
-
if ( container ) {
|
83 |
-
unmountComponentAtNode( container );
|
84 |
-
}
|
85 |
-
}
|
86 |
-
};
|
87 |
-
}, [] );
|
88 |
-
|
89 |
useEffect( () => {
|
90 |
const openMiniCart = () => {
|
91 |
setSkipSlideIn( false );
|
@@ -113,6 +93,16 @@ const MiniCartBlock = ( {
|
|
113 |
};
|
114 |
}, [] );
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
const subTotal = getSetting( 'displayCartPricesIncludingTax', false )
|
117 |
? parseInt( cartTotals.total_items, 10 ) +
|
118 |
parseInt( cartTotals.total_items_tax, 10 )
|
@@ -135,6 +125,64 @@ const MiniCartBlock = ( {
|
|
135 |
color: style?.color?.text,
|
136 |
};
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
return (
|
139 |
<>
|
140 |
<button
|
@@ -188,9 +236,7 @@ const MiniCartBlock = ( {
|
|
188 |
} }
|
189 |
slideIn={ ! skipSlideIn }
|
190 |
>
|
191 |
-
|
192 |
-
<RawHTML>{ contents }</RawHTML>
|
193 |
-
</div>
|
194 |
</Drawer>
|
195 |
</>
|
196 |
);
|
3 |
*/
|
4 |
import classnames from 'classnames';
|
5 |
import { __, _n, sprintf } from '@wordpress/i18n';
|
6 |
+
import { useState, useEffect, useRef } from '@wordpress/element';
|
7 |
import {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
translateJQueryEventToNative,
|
9 |
+
getIconsFromPaymentMethods,
|
10 |
} from '@woocommerce/base-utils';
|
11 |
+
import {
|
12 |
+
useStoreCart,
|
13 |
+
usePaymentMethods,
|
14 |
+
} from '@woocommerce/base-context/hooks';
|
15 |
import Drawer from '@woocommerce/base-components/drawer';
|
16 |
import {
|
17 |
formatPrice,
|
18 |
getCurrencyFromPriceResponse,
|
19 |
} from '@woocommerce/price-format';
|
20 |
import { getSetting } from '@woocommerce/settings';
|
21 |
+
import { TotalsItem } from '@woocommerce/blocks-checkout';
|
22 |
+
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
|
23 |
+
import { CART_URL, CHECKOUT_URL } from '@woocommerce/block-settings';
|
24 |
+
import Button from '@woocommerce/base-components/button';
|
25 |
+
import { PaymentMethodDataProvider } from '@woocommerce/base-context';
|
26 |
|
27 |
/**
|
28 |
* Internal dependencies
|
29 |
*/
|
30 |
+
import CartLineItemsTable from '../cart/cart-line-items-table';
|
31 |
import QuantityBadge from './quantity-badge';
|
|
|
32 |
import './style.scss';
|
33 |
|
34 |
+
const PaymentMethodIconsElement = (): JSX.Element => {
|
35 |
+
const { paymentMethods } = usePaymentMethods();
|
36 |
+
return (
|
37 |
+
<PaymentMethodIcons
|
38 |
+
icons={ getIconsFromPaymentMethods( paymentMethods ) }
|
39 |
+
/>
|
40 |
+
);
|
41 |
+
};
|
42 |
+
|
43 |
interface Props {
|
44 |
isInitiallyOpen?: boolean;
|
45 |
transparentButton: boolean;
|
46 |
colorClassNames?: string;
|
47 |
style?: Record< string, Record< string, string > >;
|
|
|
48 |
}
|
49 |
|
50 |
const MiniCartBlock = ( {
|
51 |
isInitiallyOpen = false,
|
52 |
colorClassNames,
|
53 |
style,
|
|
|
54 |
}: Props ): JSX.Element => {
|
55 |
+
const {
|
56 |
+
cartItems,
|
57 |
+
cartItemsCount,
|
58 |
+
cartIsLoading,
|
59 |
+
cartTotals,
|
60 |
+
} = useStoreCart();
|
61 |
const [ isOpen, setIsOpen ] = useState< boolean >( isInitiallyOpen );
|
62 |
+
const emptyCartRef = useRef< HTMLDivElement | null >( null );
|
63 |
// We already rendered the HTML drawer placeholder, so we want to skip the
|
64 |
// slide in animation.
|
65 |
const [ skipSlideIn, setSkipSlideIn ] = useState< boolean >(
|
66 |
isInitiallyOpen
|
67 |
);
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
useEffect( () => {
|
70 |
const openMiniCart = () => {
|
71 |
setSkipSlideIn( false );
|
93 |
};
|
94 |
}, [] );
|
95 |
|
96 |
+
useEffect( () => {
|
97 |
+
// If the cart has been completely emptied, move focus to empty cart
|
98 |
+
// element.
|
99 |
+
if ( isOpen && ! cartIsLoading && cartItems.length === 0 ) {
|
100 |
+
if ( emptyCartRef.current instanceof HTMLElement ) {
|
101 |
+
emptyCartRef.current.focus();
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}, [ isOpen, cartIsLoading, cartItems.length, emptyCartRef ] );
|
105 |
+
|
106 |
const subTotal = getSetting( 'displayCartPricesIncludingTax', false )
|
107 |
? parseInt( cartTotals.total_items, 10 ) +
|
108 |
parseInt( cartTotals.total_items_tax, 10 )
|
125 |
color: style?.color?.text,
|
126 |
};
|
127 |
|
128 |
+
const contents =
|
129 |
+
! cartIsLoading && cartItems.length === 0 ? (
|
130 |
+
<div
|
131 |
+
className="wc-block-mini-cart__empty-cart"
|
132 |
+
tabIndex={ -1 }
|
133 |
+
ref={ emptyCartRef }
|
134 |
+
>
|
135 |
+
{ __( 'Cart is empty', 'woo-gutenberg-products-block' ) }
|
136 |
+
</div>
|
137 |
+
) : (
|
138 |
+
<>
|
139 |
+
<div className="wc-block-mini-cart__items">
|
140 |
+
<CartLineItemsTable
|
141 |
+
lineItems={ cartItems }
|
142 |
+
isLoading={ cartIsLoading }
|
143 |
+
/>
|
144 |
+
</div>
|
145 |
+
<div className="wc-block-mini-cart__footer">
|
146 |
+
<TotalsItem
|
147 |
+
className="wc-block-mini-cart__footer-subtotal"
|
148 |
+
currency={ getCurrencyFromPriceResponse( cartTotals ) }
|
149 |
+
label={ __(
|
150 |
+
'Subtotal',
|
151 |
+
'woo-gutenberg-products-block'
|
152 |
+
) }
|
153 |
+
value={ subTotal }
|
154 |
+
description={ __(
|
155 |
+
'Shipping, taxes, and discounts calculated at checkout.',
|
156 |
+
'woo-gutenberg-products-block'
|
157 |
+
) }
|
158 |
+
/>
|
159 |
+
<div className="wc-block-mini-cart__footer-actions">
|
160 |
+
<Button
|
161 |
+
className="wc-block-mini-cart__footer-cart"
|
162 |
+
href={ CART_URL }
|
163 |
+
>
|
164 |
+
{ __(
|
165 |
+
'View my cart',
|
166 |
+
'woo-gutenberg-products-block'
|
167 |
+
) }
|
168 |
+
</Button>
|
169 |
+
<Button
|
170 |
+
className="wc-block-mini-cart__footer-checkout"
|
171 |
+
href={ CHECKOUT_URL }
|
172 |
+
>
|
173 |
+
{ __(
|
174 |
+
'Go to checkout',
|
175 |
+
'woo-gutenberg-products-block'
|
176 |
+
) }
|
177 |
+
</Button>
|
178 |
+
</div>
|
179 |
+
<PaymentMethodDataProvider>
|
180 |
+
<PaymentMethodIconsElement />
|
181 |
+
</PaymentMethodDataProvider>
|
182 |
+
</div>
|
183 |
+
</>
|
184 |
+
);
|
185 |
+
|
186 |
return (
|
187 |
<>
|
188 |
<button
|
236 |
} }
|
237 |
slideIn={ ! skipSlideIn }
|
238 |
>
|
239 |
+
{ contents }
|
|
|
|
|
240 |
</Drawer>
|
241 |
</>
|
242 |
);
|
assets/js/blocks/cart-checkout/mini-cart/component-frontend.tsx
CHANGED
@@ -41,9 +41,6 @@ const renderMiniCartFrontend = () => {
|
|
41 |
isInitiallyOpen: el.dataset.isInitiallyOpen === 'true',
|
42 |
colorClassNames,
|
43 |
style: el.dataset.style ? JSON.parse( el.dataset.style ) : {},
|
44 |
-
contents: el.querySelector(
|
45 |
-
'.wc-block-mini-cart__template-part'
|
46 |
-
)?.innerHTML,
|
47 |
};
|
48 |
},
|
49 |
} );
|
41 |
isInitiallyOpen: el.dataset.isInitiallyOpen === 'true',
|
42 |
colorClassNames,
|
43 |
style: el.dataset.style ? JSON.parse( el.dataset.style ) : {},
|
|
|
|
|
|
|
44 |
};
|
45 |
},
|
46 |
} );
|
assets/js/blocks/cart-checkout/mini-cart/test/block.js
CHANGED
@@ -23,10 +23,7 @@ import { defaultCartState } from '../../../../data/default-states';
|
|
23 |
|
24 |
const MiniCartBlock = ( props ) => (
|
25 |
<SlotFillProvider>
|
26 |
-
<Block
|
27 |
-
contents='<div class="wc-block-mini-cart-contents"></div>'
|
28 |
-
{ ...props }
|
29 |
-
/>
|
30 |
</SlotFillProvider>
|
31 |
);
|
32 |
|
@@ -50,7 +47,7 @@ const mockFullCart = () => {
|
|
50 |
} );
|
51 |
};
|
52 |
|
53 |
-
describe( 'Testing
|
54 |
beforeEach( async () => {
|
55 |
mockFullCart();
|
56 |
// need to clear the store resolution state between tests.
|
@@ -96,12 +93,10 @@ describe( 'Testing Mini Cart', () => {
|
|
96 |
} );
|
97 |
|
98 |
await waitForElementToBeRemoved( () =>
|
99 |
-
screen.queryByLabelText( /3 items
|
100 |
);
|
101 |
await waitFor( () =>
|
102 |
-
expect(
|
103 |
-
screen.getByLabelText( /0 items in cart/i )
|
104 |
-
).toBeInTheDocument()
|
105 |
);
|
106 |
} );
|
107 |
|
@@ -112,18 +107,16 @@ describe( 'Testing Mini Cart', () => {
|
|
112 |
|
113 |
mockFullCart();
|
114 |
// eslint-disable-next-line no-undef
|
115 |
-
const
|
116 |
act( () => {
|
117 |
-
document.body.dispatchEvent(
|
118 |
} );
|
119 |
|
120 |
await waitForElementToBeRemoved( () =>
|
121 |
-
screen.queryByLabelText( /0 items
|
122 |
);
|
123 |
await waitFor( () =>
|
124 |
-
expect(
|
125 |
-
screen.getByLabelText( /3 items in cart/i )
|
126 |
-
).toBeInTheDocument()
|
127 |
);
|
128 |
} );
|
129 |
} );
|
23 |
|
24 |
const MiniCartBlock = ( props ) => (
|
25 |
<SlotFillProvider>
|
26 |
+
<Block { ...props } />
|
|
|
|
|
|
|
27 |
</SlotFillProvider>
|
28 |
);
|
29 |
|
47 |
} );
|
48 |
};
|
49 |
|
50 |
+
describe( 'Testing cart', () => {
|
51 |
beforeEach( async () => {
|
52 |
mockFullCart();
|
53 |
// need to clear the store resolution state between tests.
|
93 |
} );
|
94 |
|
95 |
await waitForElementToBeRemoved( () =>
|
96 |
+
screen.queryByLabelText( /3 items/i )
|
97 |
);
|
98 |
await waitFor( () =>
|
99 |
+
expect( screen.getByLabelText( /0 items/i ) ).toBeInTheDocument()
|
|
|
|
|
100 |
);
|
101 |
} );
|
102 |
|
107 |
|
108 |
mockFullCart();
|
109 |
// eslint-disable-next-line no-undef
|
110 |
+
const removedFromCartEvent = new Event( 'wc-blocks_added_to_cart' );
|
111 |
act( () => {
|
112 |
+
document.body.dispatchEvent( removedFromCartEvent );
|
113 |
} );
|
114 |
|
115 |
await waitForElementToBeRemoved( () =>
|
116 |
+
screen.queryByLabelText( /0 items/i )
|
117 |
);
|
118 |
await waitFor( () =>
|
119 |
+
expect( screen.getAllByLabelText( /3 items/i ).length > 0 )
|
|
|
|
|
120 |
);
|
121 |
} );
|
122 |
} );
|
assets/js/editor-components/compatibility-notices/cart-checkout-compatibility-notice.tsx
CHANGED
@@ -28,7 +28,7 @@ export function CartCheckoutCompatibilityNotice( {
|
|
28 |
|
29 |
return (
|
30 |
<Guide
|
31 |
-
className="
|
32 |
contentLabel={ __(
|
33 |
'Compatibility notice',
|
34 |
'woo-gutenberg-products-block'
|
@@ -40,13 +40,13 @@ export function CartCheckoutCompatibilityNotice( {
|
|
40 |
image: <WooImage />,
|
41 |
content: (
|
42 |
<>
|
43 |
-
<h1 className="
|
44 |
{ __(
|
45 |
'Compatibility notice',
|
46 |
'woo-gutenberg-products-block'
|
47 |
) }
|
48 |
</h1>
|
49 |
-
<p className="
|
50 |
{ createInterpolateElement(
|
51 |
__(
|
52 |
'This block may not be compatible with <em>all</em> checkout extensions and integrations.',
|
@@ -57,7 +57,7 @@ export function CartCheckoutCompatibilityNotice( {
|
|
57 |
}
|
58 |
) }
|
59 |
</p>
|
60 |
-
<p className="
|
61 |
{ createInterpolateElement(
|
62 |
__(
|
63 |
'We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.',
|
28 |
|
29 |
return (
|
30 |
<Guide
|
31 |
+
className="edit-post-welcome-guide"
|
32 |
contentLabel={ __(
|
33 |
'Compatibility notice',
|
34 |
'woo-gutenberg-products-block'
|
40 |
image: <WooImage />,
|
41 |
content: (
|
42 |
<>
|
43 |
+
<h1 className="edit-post-welcome-guide__heading">
|
44 |
{ __(
|
45 |
'Compatibility notice',
|
46 |
'woo-gutenberg-products-block'
|
47 |
) }
|
48 |
</h1>
|
49 |
+
<p className="edit-post-welcome-guide__text">
|
50 |
{ createInterpolateElement(
|
51 |
__(
|
52 |
'This block may not be compatible with <em>all</em> checkout extensions and integrations.',
|
57 |
}
|
58 |
) }
|
59 |
</p>
|
60 |
+
<p className="edit-post-welcome-guide__text">
|
61 |
{ createInterpolateElement(
|
62 |
__(
|
63 |
'We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.',
|
assets/js/editor-components/compatibility-notices/style.scss
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
.wc-block-welcome-guide {
|
2 |
-
width: 312px;
|
3 |
-
|
4 |
-
&.components-modal__frame.components-guide {
|
5 |
-
height: auto;
|
6 |
-
}
|
7 |
-
|
8 |
-
&__image {
|
9 |
-
background: #00a0d2;
|
10 |
-
margin: 0 0 $gap;
|
11 |
-
}
|
12 |
-
|
13 |
-
&__heading {
|
14 |
-
font-size: 24px;
|
15 |
-
line-height: 1.4;
|
16 |
-
margin: $gap 0;
|
17 |
-
padding: 0 $gap-large;
|
18 |
-
}
|
19 |
-
|
20 |
-
&__text {
|
21 |
-
font-size: 13px;
|
22 |
-
line-height: 1.4;
|
23 |
-
margin: 0 0 $gap-large;
|
24 |
-
padding: 0 $gap-large;
|
25 |
-
}
|
26 |
-
|
27 |
-
&__inserter-icon {
|
28 |
-
margin: 0 4px;
|
29 |
-
vertical-align: text-top;
|
30 |
-
}
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/editor-components/compatibility-notices/woo-image.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
const WooImage = ( props ) => (
|
2 |
<div
|
3 |
-
className="
|
4 |
style={ {
|
5 |
display: 'flex',
|
6 |
justifyContent: 'center',
|
1 |
const WooImage = ( props ) => (
|
2 |
<div
|
3 |
+
className="edit-post-welcome-guide__image edit-post-welcome-guide__image__prm-np"
|
4 |
style={ {
|
5 |
display: 'flex',
|
6 |
justifyContent: 'center',
|
assets/js/types/type-defs/registered-payment-method-props.js
CHANGED
@@ -168,8 +168,6 @@
|
|
168 |
* method icons.
|
169 |
* @property {function(Object):Object} PaymentMethodLabel A component used for displaying payment
|
170 |
* method labels, including an icon.
|
171 |
-
* @property {function(Object):Object} LoadingMask A wrapper component used for showing a
|
172 |
-
* loading state when the isLoading prop is true.
|
173 |
*/
|
174 |
|
175 |
/**
|
168 |
* method icons.
|
169 |
* @property {function(Object):Object} PaymentMethodLabel A component used for displaying payment
|
170 |
* method labels, including an icon.
|
|
|
|
|
171 |
*/
|
172 |
|
173 |
/**
|
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' => '
|
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' => '6aaeefc0d3cd18f94bf656259dcee947');
|
build/active-filters-frontend.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=237)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},102:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(9),o=r(11),c=r(0),a=r(45),i=r(83),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=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 d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),y=Object(a.a)(u),
|
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()}},S=
|
6 |
/* translators: %1$s min price, %2$s max price */
|
7 |
Object(a.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(
|
8 |
/* translators: %s min price */
|
9 |
Object(a.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(a.sprintf)(
|
10 |
/* translators: %s max price */
|
11 |
-
Object(a.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},
|
12 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
13 |
-
Object(a.__)("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(m.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(f.a,{screenReaderLabel:p}))))},g=r(102),O=r(32),_=r(145),w=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,s=e.operator,u=void 0===s?"in":s,l=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(i.b)("attributes",[]),m=c()(d,2),y=m[0],w=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),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(a.__)("and","woo-gutenberg-products-block"))),v({type:x,name:Object(O.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(_.a)(y,w,r,e)},showLabel:!1,displayStyle:l})}))))};Object(n.b)({selector:".wp-block-woocommerce-active-filters",Block:function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(i.b)("attributes",[]),l=c()(o,2),d=l[0],m=l[1],g=Object(i.b)("stock_status",[]),O=c()(g,2),_=O[0],x=O[1],h=Object(i.b)("min_price"),j=c()(h,2),E=j[0],S=j[1],R=Object(i.b)("max_price"),k=c()(R,2),P=k[0],T=k[1],N=Object(s.getSetting)("stockStatusOptions",[]),M=Object(u.useMemo)((function(){if(_.length>0)return _.map((function(e){return v({type:Object(a.__)("Stock Status","woo-gutenberg-products-block"),name:N[e],removeCallback:function(){var t=_.filter((function(t){return t!==e}));x(t)},displayStyle:t.displayStyle})}))}),[N,_,x,t.displayStyle]),A=Object(u.useMemo)((function(){return Number.isFinite(E)||Number.isFinite(P)?v({type:Object(a.__)("Price","woo-gutenberg-products-block"),name:y(E,P),removeCallback:function(){S(void 0),T(void 0)},displayStyle:t.displayStyle}):null}),[E,P,t.displayStyle,S,T]),C=Object(u.useMemo)((function(){return d.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(w,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[d,t.displayStyle]);if(!(d.length>0||_.length>0||Number.isFinite(E)||Number.isFinite(P)||n))return null;var B="h".concat(t.headingLevel),L=p()("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(B,{className:"wc-block-active-filters__title"},t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:L},n?React.createElement(React.Fragment,null,v({type:Object(a.__)("Size","woo-gutenberg-products-block"),name:Object(a.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),v({type:Object(a.__)("Color","woo-gutenberg-products-block"),name:Object(a.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,A,M,C)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){S(void 0),T(void 0),m([]),x([])}},React.createElement(f.a,{label:Object(a.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("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}}}})},26:function(e,t,r){var n=r(73);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},27: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},29: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},3:function(e,t){e.exports=window.React},32:function(e,t){e.exports=window.wp.htmlEntities},37: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},38: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},39:function(e,t,r){var n=r(67);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},4:function(e,t,r){var n=r(77),o=r(78),c=r(61),a=r(79);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t,r){var n=r(21).default,o=r(27);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){e.exports=window.wp.primitives},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(19),c=r.n(o);function a(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},46:function(e,t,r){"use strict";var n=r(37),o=r.n(n),c=r(38),a=r.n(c),i=r(27),s=r.n(i),u=r(39),l=r.n(u),p=r(40),f=r.n(p),b=r(29),d=r.n(b),m=r(5),y=r.n(m),v=(r(8),r(3)),g=r(1),O=r(104),_=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(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(g.__)("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(72);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=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}(v.Component);w.defaultProps={showErrorMessage:!0},t.a=w},49:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),a=r(7),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))}},5: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},55: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},6:function(e,t){e.exports=window.lodash},60:function(e,t){e.exports=window.wc.priceFormat},61:function(e,t,r){var n=r(62);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},62: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},67: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},7: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)}()},70:function(e,t,r){"use strict";var n=r(71);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}},71:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},72:function(e,t){},73: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},75: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(4),o=r.n(n),c=r(9),a=r(11),i=r(0),s=r(19),u=r.n(s),l=r(45),p=r(96),f=r(55),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),v=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(y,m)||(s(Object.assign({},d,m)),v.current=!0)}),[d,m,y,s]),v.current?[a,s]:[e,s]}},77:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},78: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},79: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},8:function(e,t,r){e.exports=r(70)()},83:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(4),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},9:function(e,t){e.exports=window.wc.wcBlocksData},95:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d}));var n=r(20),o=r.n(n),c=r(5),a=r.n(c),i=r(0),s=r(46);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 l(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){a()(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=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,o=void 0===n?function(){return{}}:n,c=e.getErrorBoundaryProps,a=void 0===c?function(){return{}}:c;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=o(e,r),c=a(e,r),i=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),b({Block:t,container:e,props:n,attributes:i,errorBoundaryProps:c})}))},b=function(e){var t=e.Block,r=e.container,n=e.attributes,c=void 0===n?{}:n,a=e.props,u=void 0===a?{}:a,l=e.errorBoundaryProps,p=void 0===l?{}:l;Object(i.render)(React.createElement(s.a,p,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},u,{attributes:c})))),r)},d=function(e){var t,r,n,o,c,a,i,s=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,a=t.wrappers,i=document.body.querySelectorAll(c),a.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,a)})),f({Block:r,containers:i,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},96: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}}});
|
1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=237)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},102:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(9),o=r(11),c=r(0),a=r(45),i=r(83),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=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 d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),y=Object(a.a)(u),g=Object(i.a)(),v=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,y],a=o.getCollectionError.apply(o,c);return a&&g(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,y,m,b]);return null!==v&&(d.current=v),d.current}},104: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",{})},11:function(e,t){e.exports=window.wp.data},128:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(26),a=r.n(c),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,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?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}({width:n,height:n},c)):null}},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var n=r(2),o=Object(n.getSetting)("attributes",[]).reduce((function(e,t){var r,n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;return n.id&&e.push(n),e}),[]),c=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},145:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(6),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),s=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),s.push(a)),t(Object(n.sortBy)(s,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},158:function(e,t){},19:function(e,t){e.exports=window.wp.isShallowEqual},2:function(e,t){e.exports=window.wc.wcSettings},20: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},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},215:function(e,t,r){"use strict";var n=r(20),o=r.n(n),c=r(26),a=r.n(c),i=r(44),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},220:function(e,t,r){"use strict";var n=r(20),o=r.n(n),c=r(26),a=r.n(c),i=(r(8),r(7)),s=r.n(i),u=r(1),l=r(128),p=r(215),f=(r(158),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,u=e.className,l=void 0===u?"":u,p=e.radius,b=void 0===p?"small":p,d=e.children,m=void 0===d?null:d,y=a()(e,f),g=i,v=s()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+b),O=Boolean(n&&n!==t);return React.createElement(g,o()({className:v},y),React.createElement("span",{"aria-hidden":O,className:"wc-block-components-chip__text"},t),O&&React.createElement("span",{className:"screen-reader-text"},n),m)},d=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,i=e.disabled,f=void 0!==i&&i,m=e.onRemove,y=void 0===m?function(){}:m,g=e.removeOnAnyClick,v=void 0!==g&&g,O=e.text,_=e.screenReaderText,w=void 0===_?"":_,x=a()(e,d),h=v?"span":"button";if(!r){var j=w&&"string"==typeof w?w:O;r="string"!=typeof j?
|
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()}},S=v?E:{},R=v?{"aria-hidden":!0}:E;return React.createElement(b,o()({},x,S,{className:s()(c,"is-removable"),element:v?"button":x.element,screenReaderText:w,text:O}),React.createElement(h,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},237:function(e,t,r){e.exports=r(257)},238:function(e,t){},257:function(e,t,r){"use strict";r.r(t);var n=r(94),o=r(4),c=r.n(o),a=r(1),i=r(75),s=r(2),u=r(0),l=r(7),p=r.n(l),f=(r(8),r(49)),b=(r(238),r(144)),d=r(60),m=r(220),y=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(a.sprintf)(
|
6 |
/* translators: %1$s min price, %2$s max price */
|
7 |
Object(a.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(
|
8 |
/* translators: %s min price */
|
9 |
Object(a.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(a.sprintf)(
|
10 |
/* translators: %s max price */
|
11 |
+
Object(a.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},g=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,s=void 0===i||i,u=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(a.sprintf)(
|
12 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
13 |
+
Object(a.__)("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(m.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(f.a,{screenReaderLabel:p}))))},v=r(102),O=r(32),_=r(145),w=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,s=e.operator,u=void 0===s?"in":s,l=e.displayStyle,p=Object(v.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(i.b)("attributes",[]),m=c()(d,2),y=m[0],w=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),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(a.__)("and","woo-gutenberg-products-block"))),g({type:x,name:Object(O.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(_.a)(y,w,r,e)},showLabel:!1,displayStyle:l})}))))};Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(i.b)("attributes",[]),l=c()(o,2),d=l[0],m=l[1],v=Object(i.b)("stock_status",[]),O=c()(v,2),_=O[0],x=O[1],h=Object(i.b)("min_price"),j=c()(h,2),E=j[0],S=j[1],R=Object(i.b)("max_price"),k=c()(R,2),P=k[0],T=k[1],N=Object(s.getSetting)("stockStatusOptions",[]),M=Object(u.useMemo)((function(){if(_.length>0)return _.map((function(e){return g({type:Object(a.__)("Stock Status","woo-gutenberg-products-block"),name:N[e],removeCallback:function(){var t=_.filter((function(t){return t!==e}));x(t)},displayStyle:t.displayStyle})}))}),[N,_,x,t.displayStyle]),A=Object(u.useMemo)((function(){return Number.isFinite(E)||Number.isFinite(P)?g({type:Object(a.__)("Price","woo-gutenberg-products-block"),name:y(E,P),removeCallback:function(){S(void 0),T(void 0)},displayStyle:t.displayStyle}):null}),[E,P,t.displayStyle,S,T]),C=Object(u.useMemo)((function(){return d.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(w,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[d,t.displayStyle]);if(!(d.length>0||_.length>0||Number.isFinite(E)||Number.isFinite(P)||n))return null;var L="h".concat(t.headingLevel),B=p()("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,g({type:Object(a.__)("Size","woo-gutenberg-products-block"),name:Object(a.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),g({type:Object(a.__)("Color","woo-gutenberg-products-block"),name:Object(a.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,A,M,C)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){S(void 0),T(void 0),m([]),x([])}},React.createElement(f.a,{label:Object(a.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("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}}}})},26:function(e,t,r){var n=r(73);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},27: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},29: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},3:function(e,t){e.exports=window.React},32:function(e,t){e.exports=window.wp.htmlEntities},37: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},38: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},39:function(e,t,r){var n=r(67);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},4:function(e,t,r){var n=r(77),o=r(78),c=r(61),a=r(79);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t,r){var n=r(21).default,o=r(27);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){e.exports=window.wp.primitives},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(19),c=r.n(o);function a(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},46:function(e,t,r){"use strict";var n=r(37),o=r.n(n),c=r(38),a=r.n(c),i=r(27),s=r.n(i),u=r(39),l=r.n(u),p=r(40),f=r.n(p),b=r(29),d=r.n(b),m=r(5),y=r.n(m),g=(r(8),r(3)),v=r(1),O=r(104),_=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(72);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=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);w.defaultProps={showErrorMessage:!0},t.a=w},49:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),a=r(7),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))}},5: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},55: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},6:function(e,t){e.exports=window.lodash},60:function(e,t){e.exports=window.wc.priceFormat},61:function(e,t,r){var n=r(62);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},62: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},67: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},7: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)}()},70:function(e,t,r){"use strict";var n=r(71);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}},71:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},72:function(e,t){},73: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},75: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(4),o=r.n(n),c=r(9),a=r(11),i=r(0),s=r(19),u=r.n(s),l=r(45),p=r(95),f=r(55),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]}},77:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},78: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},79: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},8:function(e,t,r){e.exports=r(70)()},83:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(4),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},9:function(e,t){e.exports=window.wc.wcBlocksData},94:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(20),o=r.n(n),c=r(5),a=r.n(c),i=r(0),s=r(46);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 l(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){a()(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=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,a=e.getErrorBoundaryProps,u=void 0===a?function(){return{}}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=u(e,r),p=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(i.render)(React.createElement(s.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t,r,n,o,c,a,i,s=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,a=t.wrappers,i=document.body.querySelectorAll(c),a.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,a)})),f({Block:r,containers:i,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},95: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/active-filters.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'fb222798e61cb9615a51be2fe932d0b3');
|
build/active-filters.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,a,i=t[0],l=t[1],s=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(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,i=1;i<n.length;i++){var l=n[i];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={4:0},o=[];function a(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,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},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||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;return o.push([795,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},
|
2 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
3 |
-
Object(m.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(f.createElement)(v.ToolbarGroup,{isCollapsed:r,icon:Object(f.createElement)(O,{level:a}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),o}(f.Component);t.a=h},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(20),a=n(1);n(194),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,i=e.heading,l=e.instanceId,s="h".concat(n);return Object(r.createElement)(s,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(l)},Object(a.__)("Block title","woo-gutenberg-products-block")),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(l),className:"wc-block-editor-components-title",value:i,onChange:o}))}))},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(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}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(25),c=n(14),o=n(0),a=n(58),i=n(127),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,s=void 0===l?[]:l,u=e.query,b=void 0===u?{}:u,p=e.shouldSelect,f=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),v=Object(a.a)(s),O=Object(i.a)(),h=Object(c.useSelect)((function(e){if(!f)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,m,v],a=c.getCollectionError.apply(c,o);return a&&O(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,v,m,f]);return null!==h&&(d.current=h),d.current}},194:function(e,t){},195:function(e,t){},20:function(e,t){e.exports=window.wp.compose},24:function(e,t){e.exports=window.wp.blocks},245:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(4),c=Object(r.getSetting)("attributes",[]).reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),o=function(e){if(e)return c.find((function(t){return t.id===e}))},a=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},246:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(7),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),a=o.length?o[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(c)){var i=a.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));i.length>0&&(a.slug=i.sort(),l.push(a)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(a):(a.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(a,"attribute")))}},25:function(e,t){e.exports=window.wc.wcBlocksData},255:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(21),a=n.n(o),i=n(0),l=(n(2),n(
|
4 |
/* translators: Remove chip. */
|
5 |
Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(
|
6 |
/* translators: %s text of the chip to remove. */
|
7 |
-
Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),k)}var x={"aria-label":n,disabled:f,onClick:O,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||O()}},S=j?x:{},C=j?{"aria-hidden":!0}:x;return Object(i.createElement)(d,c()({},_,S,{className:s()(o,"is-removable"),element:j?"button":_.element,screenReaderText:y,text:g}),Object(i.createElement)(E,c()({className:"wc-block-components-chip__remove"},C),Object(i.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},26:function(e,t){e.exports=window.wp.htmlEntities},27:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wp.components},
|
8 |
/* translators: %1$s min price, %2$s max price */
|
9 |
Object(a.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(E.formatPrice)(e),Object(E.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(
|
10 |
/* translators: %s min price */
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,a,i=t[0],l=t[1],s=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(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,i=1;i<n.length;i++){var l=n[i];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={4:0},o=[];function a(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,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},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||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;return o.push([795,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},103:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m}));var r=n(8),c=n.n(r),o=n(25),a=n(14),i=n(0),l=n(36),s=n.n(l),u=n(58),b=n(143),p=n(71),f=function(e){var t=Object(p.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(i.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(p.a)();n=n||r;var c=Object(a.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},m=function(e,t){var n=Object(p.a)(),r=f(t=t||n),o=c()(r,2),a=o[0],l=o[1],d=Object(u.a)(a),m=Object(u.a)(e),v=Object(b.a)(m),O=Object(i.useRef)(!1);return Object(i.useEffect)((function(){s()(v,m)||(l(Object.assign({},d,m)),O.current=!0)}),[d,m,v,l]),O.current?[a,l]:[e,l]}},11:function(e,t){e.exports=window.React},115:function(e,t){},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(17),a=n.n(o),i=n(18),l=n.n(i),s=n(19),u=n.n(s),b=n(9),p=n.n(b),f=n(0),d=n(7),m=n(1),v=n(3);function O(e){var t=e.level,n={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 n.hasOwnProperty(t)?Object(f.createElement)(v.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(f.createElement)(v.Path,{d:n[t]})):null}var h=function(e){l()(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=p()(t);if(n){var c=p()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return u()(this,e)});function o(){return c()(this,o),r.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(f.createElement)(O,{level:e}),title:Object(m.sprintf)(
|
2 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
3 |
+
Object(m.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(f.createElement)(v.ToolbarGroup,{isCollapsed:r,icon:Object(f.createElement)(O,{level:a}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),o}(f.Component);t.a=h},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(20),a=n(1);n(194),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,i=e.heading,l=e.instanceId,s="h".concat(n);return Object(r.createElement)(s,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(l)},Object(a.__)("Block title","woo-gutenberg-products-block")),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(l),className:"wc-block-editor-components-title",value:i,onChange:o}))}))},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(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}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(25),c=n(14),o=n(0),a=n(58),i=n(127),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,s=void 0===l?[]:l,u=e.query,b=void 0===u?{}:u,p=e.shouldSelect,f=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),v=Object(a.a)(s),O=Object(i.a)(),h=Object(c.useSelect)((function(e){if(!f)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,m,v],a=c.getCollectionError.apply(c,o);return a&&O(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,v,m,f]);return null!==h&&(d.current=h),d.current}},194:function(e,t){},195:function(e,t){},20:function(e,t){e.exports=window.wp.compose},24:function(e,t){e.exports=window.wp.blocks},245:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(4),c=Object(r.getSetting)("attributes",[]).reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),o=function(e){if(e)return c.find((function(t){return t.id===e}))},a=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},246:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(7),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),a=o.length?o[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(c)){var i=a.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));i.length>0&&(a.slug=i.sort(),l.push(a)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(a):(a.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(a,"attribute")))}},25:function(e,t){e.exports=window.wc.wcBlocksData},255:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(21),a=n.n(o),i=n(0),l=(n(2),n(5)),s=n.n(l),u=n(1),b=n(62),p=n(329),f=(n(195),["text","screenReaderText","element","className","radius","children"]),d=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,u=e.className,b=void 0===u?"":u,p=e.radius,d=void 0===p?"small":p,m=e.children,v=void 0===m?null:m,O=a()(e,f),h=l,j=s()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),g=Boolean(r&&r!==t);return Object(i.createElement)(h,c()({className:j},O),Object(i.createElement)("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&Object(i.createElement)("span",{className:"screen-reader-text"},r),v)},m=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,f=void 0!==l&&l,v=e.onRemove,O=void 0===v?function(){}:v,h=e.removeOnAnyClick,j=void 0!==h&&h,g=e.text,w=e.screenReaderText,y=void 0===w?"":w,_=a()(e,m),E=j?"span":"button";if(!n){var k=y&&"string"==typeof y?y:g;n="string"!=typeof k?
|
4 |
/* translators: Remove chip. */
|
5 |
Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(
|
6 |
/* translators: %s text of the chip to remove. */
|
7 |
+
Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),k)}var x={"aria-label":n,disabled:f,onClick:O,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||O()}},S=j?x:{},C=j?{"aria-hidden":!0}:x;return Object(i.createElement)(d,c()({},_,S,{className:s()(o,"is-removable"),element:j?"button":_.element,screenReaderText:y,text:g}),Object(i.createElement)(E,c()({className:"wc-block-components-chip__remove"},C),Object(i.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},26:function(e,t){e.exports=window.wp.htmlEntities},27:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wp.components},329:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(21),a=n.n(o),i=n(0),l=n(27),s=["className","size"],u=Object(i.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,s);return Object(i.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(i.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=u},36:function(e,t){e.exports=window.wp.isShallowEqual},4:function(e,t){e.exports=window.wc.wcSettings},42:function(e,t,n){"use strict";var r=n(6),c=n.n(r),o=n(0),a=n(5),i=n.n(a);function l(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?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(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,l=void 0===a?{}:a,u=null!=n,b=null!=r;return!u&&b?(t=c||"span",l=s(s({},l),{},{className:i()(l.className,"screen-reader-text")}),Object(o.createElement)(t,l,r)):(t=c||o.Fragment,u&&b&&n!==r?Object(o.createElement)(t,l,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,l,n))}},50:function(e,t){e.exports=window.wc.priceFormat},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(36),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},62:function(e,t,n){"use strict";var r=n(6),c=n.n(r),o=n(21),a=n.n(o),i=n(0),l=["srcElement","size"];function s(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,l);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(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},71: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},795:function(e,t,n){e.exports=n(853)},796:function(e,t){},83:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(16),a=n.n(o),i=n(17),l=n.n(i),s=n(13),u=n.n(s),b=n(18),p=n.n(b),f=n(19),d=n.n(f),m=n(9),v=n.n(m),O=n(0),h=n(7),j=n(5),g=n.n(j),w=n(3),y=n(20);n(115);var _=function(e){p()(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=v()(t);if(n){var c=v()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;return a()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return l()(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,i=n.className,l=n.help,s=n.options,u=n.value,b="inspector-toggle-button-control-".concat(a);return l&&(e=Object(h.isFunction)(l)?l(o):l),Object(O.createElement)(w.BaseControl,{id:b,help:e,className:g()("components-toggle-button-control",i)},Object(O.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(O.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},s.map((function(e,n){var o={};return u===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(O.createElement)(w.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}(O.Component);t.a=Object(y.withInstanceId)(_)},853:function(e,t,n){"use strict";n.r(t);var r=n(10),c=n.n(r),o=n(0),a=n(1),i=n(24),l=n(62),s=n(27),u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(5),p=n.n(b),f=n(12),d=n(3),m=n(121),v=n(141),O=n(83),h=n(8),j=n.n(h),g=n(103),w=n(4),y=(n(2),n(42)),_=(n(796),n(245)),E=n(50),k=n(255),x=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(a.sprintf)(
|
8 |
/* translators: %1$s min price, %2$s max price */
|
9 |
Object(a.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(E.formatPrice)(e),Object(E.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(
|
10 |
/* translators: %s min price */
|
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' => '
|
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' => 'd54a5bc396be4b9018fdf082806775f8');
|
build/all-products-frontend.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
!function(e){function t(t){for(var r,o,c=t[0],i=t[1],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?ver="+{0:"e27385e0cfa5401052df",1:"386b08cd201e6bff951d",8:"4b045aa610413ea34888",9:"0e5ac7316c0f383bbcb5",10:"15717610c12b35f572a3",11:"7a65fe9c792d14c0541d",12:"9a808a7a749b53f95eea",13:"eebbdc6f93bae12ae9a5",14:"02e11be896319e7b08a2",15:"8524d4208cefe015f78e",16:"c0926419879c22579c52",17:"a21a71382002eaa1bc38",18:"4520e99a32dcd057983e",19:"dd0d379f0a76c6e45cfd",50:"bf00697fd570c9ae13b0"}[e]}(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=225)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,r){var n=r(77),o=r(78),c=r(61),i=r(79);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){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){e.exports=window.lodash},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,r){e.exports=r(70)()},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){e.exports=window.wp.data},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,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,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(12);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){e.exports=window.wp.isShallowEqual},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){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(63);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){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.compose},function(e,t,r){var n=r(73);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=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(56),o=r(63);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){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=r(6),u=r(0),s=r(9),l=r(11),f=r(32),p=r(101),d=r(151),b=r(36),m=r(107),h=function(e){var t=e.detail;t&&t.preserveCartData||Object(l.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},v=function(){1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},g=function(){Object(u.useEffect)((function(){return function(){if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:function(){}}),0===window.wcBlocksStoreCartListeners.count){var e=Object(m.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(m.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",h),document.body.addEventListener("wc-blocks_removed_from_cart",h),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=function(){e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",h),document.body.removeEventListener("wc-blocks_removed_from_cart",h)}}window.wcBlocksStoreCartListeners.count++}(),v}),[])};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 y(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){i()(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 w={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},j=y(y({},w),{},{email:""}),E={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:""},_=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(f.decodeEntities)(n)]})))},x={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:E,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:w,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},k=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)();g();var f=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!c)return x;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:j,shippingAddress:w,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(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=n(s.CART_STORE_KEY).receiveCart,m=_(a.billingAddress),h=a.needsShipping?_(a.shippingAddress):m,v=a.fees.length>0?a.fees.map((function(e){return _(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return y(y({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:v,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},function(e,t){e.exports=window.wp.a11y},,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,currentView:"",previewData:{},getPreviewData:function(){}})),c=function(){return Object(n.useContext)(o)}},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(67);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(27);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){e.exports=window.wp.dom},,,function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(19),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";var n=r(37),o=r.n(n),c=r(38),i=r.n(c),a=r(27),u=r.n(a),s=r(39),l=r.n(s),f=r(40),p=r.n(f),d=r(29),b=r.n(d),m=r(5),h=r.n(m),v=(r(8),r(3)),g=r(1),O=r(104),y=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(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("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(72);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 p()(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}(v.Component);w.defaultProps={showErrorMessage:!0},t.a=w},,function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(76),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(98))},function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),i=r(7),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,f=null!=n;return!l&&f?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||c.Fragment,l&&f&&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(5),o=r.n(n),c=r(74),i=r(0),a=r(33);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){e.exports=window.wp.deprecated},,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";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.keycodes},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){var n=r(62);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,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(56);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){"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){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,r){"use strict";var n=r(71);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){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){e.exports=window.wp.hooks},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(4),o=r.n(n),c=r(9),i=r(11),a=r(0),u=r(19),s=r.n(u),l=r(45),f=r(96),p=r(55),d=function(e){var t=Object(p.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(p.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(p.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(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t){e.exports=window.wp.warning},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(13),o=r(18),c=r(0),i=r(7),a=r.n(i),u=r(6),s=r(53),l=r.n(s),f=r(14),p=r(15),d=r(16),b=r(17),m=r(10),h=r(23),v=r(41),g=r(58),O=r(25),y=r(108),w=r(22);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)},f=e.left;"right"===n?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===n?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=r,v=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 g="left"==(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var O=i.getBoundingClientRect();d=Math.min(d,O.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function x(e,t,r,n,o,c,i){var a=t.height;if(o){var u=(Object(v.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)},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=r,b=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&f.contentHeight===a)d="top";else if("bottom"===r&&p.contentHeight===a)d="bottom";else{var m="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var k=r(30),R=r(12);var P=Object(c.createContext)({focusHistory:[]}),S=P.Provider,C=P.Consumer;S.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",c.Component;var T=Object(O.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(f.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(p.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(k.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(k.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(O.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(f.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(R.a)(e)),e}return Object(p.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===g.TAB){var t=v.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(f.a)(this,o),n.apply(this,arguments)}return Object(p.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 B(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 L=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=B(r);function r(){return Object(f.a)(this,r),t.apply(this,arguments)}return Object(p.a)(r,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(c.Component)}();function F(e){e.stopPropagation()}var I=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:F}),r)})),z=r(48);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 H(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){Object(w.a)(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}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 H(H({},r),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function q(e,t,r){return(q="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(19);var V=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Y=(V.Provider,V.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(f.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(R.a)(e)),e}return Object(p.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||q(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),Q=function(e){return Object(c.createElement)(Y,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}))}))},K=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)(V),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=++K),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)(Y,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),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(n.a)({ref:f},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)(Q,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,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 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 fe=function(e){var t=e.headerTitle,r=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,w=(e.range,e.focusOnMount),j=void 0===w?"firstElement":w,k=e.anchorRef,R=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,B=e.__unstableSticky,F=e.__unstableSlotName,z=void 0===F?"Popover":F,U=e.__unstableObserveElement,H=e.__unstableBoundaryParent,q=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"]),V=Object(c.useRef)(null),Y=Object(c.useRef)(null),G=Object(c.useRef)(),Q=Object(O.useViewportMatch)("medium","<"),K=Object(c.useState)(),J=Object(h.a)(K,2),X=J[0],$=J[1],Z=W(z),ee=C&&Q,re=Object(O.useResizeObserver)(),ne=Object(h.a)(re,2),oe=ne[0],fe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return le(G.current,"is-without-arrow",p),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(Y.current,"maxHeight"),void se(Y.current,"maxWidth");var e=function(){if(G.current&&Y.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(v.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 f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ae(p,f)}}(V,P,S,k,R);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)}H&&(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],f=void 0===l?"center":l,p=u[2],d=x(e,t,s,p,n,o,c),b=_(e,t,f,p,n,d.yAxis,i);return E(E({},b),d)}(e,fe.height?fe:Y.current.getBoundingClientRect(),m,B,G.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,g=u.contentHeight,O=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",p||"center"===f&&"middle"===b),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis",f),ue(G.current,"data-y-axis",b),se(Y.current,"maxHeight","number"==typeof g?g+"px":""),se(Y.current,"maxWidth","number"==typeof O?O+"px":""),$(({left:"right",right:"left"}[f]||"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),U&&(r=new window.MutationObserver(e)).observe(U,{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,k,R,m,fe,B,U,H]),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=v.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,Y);var pe=function(e){e.keyCode===g.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)(I,Object(n.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},q,{onKeyDown:pe,ref:G}),ee&&Object(c.createElement)(L,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(ge,{className:"components-popover__close",icon:y.a,onClick:r})),Object(c.createElement)("div",{ref:Y,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)),k||P?de:Object(c.createElement)("span",{ref:V},de)};fe.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 pe=fe,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(f.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(p.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)(pe,{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(86);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 ve=["onMouseDown","onClick"],ge=t.a=Object(c.forwardRef)((function(e,t){var r=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,O=e.className,y=e.disabled,w=e.icon,j=e.iconSize,E=e.showTooltip,_=e.tooltipPosition,x=e.shortcut,k=e.label,R=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",O,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!w&&!!R,"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}}}}(ve);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 B=!T&&(E&&k||x||!!k&&(!R||Object(u.isArray)(R)&&!R.length)&&!1!==E),L=Object(c.createElement)(N,Object(n.a)({},D,S,{className:C,"aria-label":S["aria-label"]||k,ref:t}),w&&Object(c.createElement)(me.a,{icon:w,size:j}),R);return B?Object(c.createElement)(be,{text:k,shortcut:x,position:_},L):L}))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(4),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,r){"use strict";var n=r(22),o=r(13),c=r(18),i=r(0),a=r(44),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 f=n||24;if("function"==typeof r)return r.prototype instanceof i.Component?Object(i.createElement)(r,l({size:f},s)):r(l({size:f},s));if(r&&("svg"===r.type||r.type===a.SVG)){var p=l(l({width:f,height:f},r.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(r)?Object(i.cloneElement)(r,l({size:f},s)):r}},function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(4),i=r.n(c),a=r(2),u=r(1),s=r(66);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 f(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 p=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(p).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 f(f(f({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(13),o=r(14),c=r(15),i=r(12),a=r(16),u=r(17),s=r(10),l=r(0),f=r(6),p=r(25);var d=["button","submit"];t.a=Object(p.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,p,b=(r=m,p=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(p){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(f.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(f.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}));var n=r(20),o=r.n(n),c=r(5),i=r.n(c),a=r(0),u=r(46);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 f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,o=void 0===n?function(){return{}}:n,c=e.getErrorBoundaryProps,i=void 0===c?function(){return{}}:c;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=o(e,r),c=i(e,r),a=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),d({Block:t,container:e,props:n,attributes:a,errorBoundaryProps:c})}))},d=function(e){var t=e.Block,r=e.container,n=e.attributes,c=void 0===n?{}:n,i=e.props,s=void 0===i?{}:i,l=e.errorBoundaryProps,f=void 0===l?{}:l;Object(a.render)(React.createElement(u.a,f,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},s,{attributes:c})))),r)},b=function(e){var t,r,n,o,c,i,a,u=document.body.querySelectorAll(f.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)})),p({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),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},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){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,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(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(5),o=r.n(n),c=r(4),i=r.n(c),a=(r(8),r(0)),u=r(11),s=r(52),l=r(36),f=r(20),p=r.n(f),d=r(7),b=r.n(d),m=r(152),h=(r(105),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""}),v=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,p()({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 g(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?g(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(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,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),w=g[0],j=g[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,O(O({},r),{},{context:r.context||p})),E("store-notice-create",{status:e,content:t,options:r})}),[b,E,p]),k=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),R={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:x,removeNotice:k,context:p,setIsSuppressed:j},P=w?null:React.createElement(v,{className:n,notices:R.notices,removeNotice:R.removeNotice,isEditor:_});return React.createElement(y.Provider,{value:R},c&&P,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(4),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,"a",(function(){return u}));var n=r(9),o=r(11),c=r(0),i=r(45),a=r(83),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=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 b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=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&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,h,m,d]);return null!==g&&(b.current=g),b.current}},,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 f})),r.d(t,"j",(function(){return p})),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 v})),r.d(t,"b",(function(){return g}));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),f=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),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",{}),v=Object(o.getSetting)("shippingStates",{}),g=Object(o.getSetting)("allowedStates",{})},function(e,t){},function(e,t){e.exports=window.wp.autop},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}));var n,o=window.CustomEvent||null,c=function(e,t){var r=t.bubbles,n=void 0!==r&&r,c=t.cancelable,i=void 0!==c&&c,a=t.element,u=t.detail,s=void 0===u?{}:u;if(o){a||(a=document.body);var l=new o(e,{bubbles:n,cancelable:i,detail:s});a.dispatchEvent(l)}},i=function(){n&&clearTimeout(n),n=setTimeout((function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},function(e,t,r){"use strict";var n=r(0),o=r(44),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,r){"use strict";var n=r(20),o=r.n(n),c=r(0),i=(r(129),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){e.exports=window.wp.wordcount},,,,,,function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(26),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){},,,,,,,,,,,,,,function(e,t,r){"use strict";r(8);var n=r(7),o=r.n(n),c=r(49),i=r(25);r(161),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,f="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:f}}),React.createElement("select",{id:f,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,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(68),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,r){"use strict";var n=r(0),o=r(6),c=r(7),i=r.n(c),a=r(1),u=r(34),s=r(108),l=r(81);t.a=function(e){var t=e.className,r=e.status,c=void 0===r?"info":r,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,O=void 0===g?[]:g,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":v});return j&&(f=Object(n.createElement)(n.RawHTML,null,f)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},f,O.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,f=e.url;return Object(n.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",r)},o)}))),v&&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){e.exports=window.wc.wcBlocksSharedHocs},,,,,,,function(e,t){},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(31),o=r(0),c=r(104);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,373))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return r.e(11).then(r.bind(null,403))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return r.e(19).then(r.bind(null,404))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return r.e(13).then(r.bind(null,374))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return r.e(9).then(r.bind(null,375))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return r.e(17).then(r.bind(null,376))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return r.e(14).then(r.bind(null,312))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return r.e(15).then(r.bind(null,377))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return r.e(10).then(r.bind(null,378))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return r.e(18).then(r.bind(null,379))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return r.e(16).then(r.bind(null,380))}))}),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,390))}))});var i=function(e){return Object(n.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,function(e,t,r){e.exports=r(250)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(100),o=r(95),c=r(37),i=r.n(c),a=r(38),u=r.n(a),s=r(39),l=r.n(s),f=r(40),p=r.n(f),d=r(29),b=r.n(d),m=r(3),h=(r(8),r(4)),v=r.n(h),g=r(0),O=r(26),y=r.n(O),w=r(5),j=r.n(w),E=r(1),_=r(6),x=r(7),k=r.n(x),R=r(49),P=(r(228),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),f=r&&Boolean(s!==i),p=r&&Boolean(u>3),d=r&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&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(R.a,{screenReaderLabel:Object(E.__)("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(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(R.a,{label:"←",screenReaderLabel:Object(E.__)("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(R.a,{label:1,screenReaderLabel:Object(E.sprintf)(
|
4 |
/* translators: %d is the page number (1, 2, 3...). */
|
5 |
Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","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(R.a,{label:e,screenReaderLabel:Object(E.sprintf)(
|
6 |
/* translators: %d is the page number (1, 2, 3...). */
|
7 |
Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:k()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.a,{label:i,screenReaderLabel:Object(E.sprintf)(
|
8 |
/* translators: %d is the page number (1, 2, 3...). */
|
9 |
-
Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),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(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(R.a,{label:"→",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});P.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var S=P,C=r(
|
10 |
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
|
11 |
-
Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(Y))}),[null==ce?void 0:ce.totalQuery,Y,o,Z]);var ie,ae,ue,se,le,fe=r.contentVisibility,pe=r.columns*r.rows,de=!Number.isFinite(Y)&&Number.isFinite(null==ce?void 0:ce.totalProducts)&&Object(_.isEqual)(Z,null==ce?void 0:ce.totalQuery)?Math.ceil(ce.totalProducts/pe):Math.ceil(Y/pe),be=q.length?q:Array.from({length:pe}),me=0!==q.length||Q,he=l.length>0||b.length>0||Number.isFinite(w)||Number.isFinite(P);return React.createElement("div",{className:(ie=r.columns,ae=r.rows,ue=r.alignButtons,se=r.align,le=void 0!==se?"align"+se:"",k()(X,le,"has-"+ie+"-columns",{"has-multiple-rows":ae>1,"has-aligned-buttons":ue}))},fe.orderBy&&me&&React.createElement(K,{onChange:c,value:i}),!me&&he&&React.createElement(G,{resetCallback:function(){f([]),m([]),j(null),B(null)}}),!me&&!he&&React.createElement(V,null),me&&React.createElement("ul",{className:"".concat(X,"__products")},be.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return React.createElement(ee,{key:e.id||t,attributes:r,product:e})}))),de>1&&React.createElement(S,{currentPage:n,onPageChange:function(e){a({focusableSelector:"a, button"}),o(e)},totalPages:de}))})),ie=function(e){var t=e.attributes,r=Object(
|
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?ver="+{0:"6b737fec71b27bc82066",1:"386b08cd201e6bff951d",8:"e2d95d59d1ff6bdc6e14",9:"76c8b48acad575e6ee1a",10:"15717610c12b35f572a3",11:"025e740edced21298495",12:"80807ed5aaf9088be451",13:"eebbdc6f93bae12ae9a5",14:"cc4a120f665e0fcb7be8",15:"8524d4208cefe015f78e",16:"c0926419879c22579c52",17:"665d6a4bb4eb7e733b59",18:"4520e99a32dcd057983e",19:"124a044d1deae759c5b7",50:"c8c1b62a773934d81b0a"}[e]}(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=225)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,r){var n=r(77),o=r(78),c=r(61),i=r(79);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){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){e.exports=window.lodash},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,r){e.exports=r(70)()},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){e.exports=window.wp.data},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,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,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(12);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){e.exports=window.wp.isShallowEqual},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){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(63);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){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.compose},function(e,t,r){var n=r(73);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=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(56),o=r(63);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){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=r(6),u=r(0),s=r(9),l=r(11),f=r(32),p=r(101),d=r(151),b=r(36),m=r(107),h=function(e){var t=e.detail;t&&t.preserveCartData||Object(l.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},g=function(){1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},v=function(){Object(u.useEffect)((function(){return function(){if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:function(){}}),!window.wcBlocksStoreCartListeners.count){var e=Object(m.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(m.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",h),document.body.addEventListener("wc-blocks_removed_from_cart",h),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=function(){e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",h),document.body.removeEventListener("wc-blocks_removed_from_cart",h)}}window.wcBlocksStoreCartListeners.count++}(),g}),[])};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 y(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){i()(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 w={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},j=y(y({},w),{},{email:""}),E={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:""},_=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(f.decodeEntities)(n)]})))},x={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:E,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:w,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},k=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)();v();var f=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!c)return x;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:j,shippingAddress:w,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(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=n(s.CART_STORE_KEY).receiveCart,m=_(a.billingAddress),h=a.needsShipping?_(a.shippingAddress):m,g=a.fees.length>0?a.fees.map((function(e){return _(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return y(y({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:g,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},function(e,t){e.exports=window.wp.a11y},,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,currentView:"",previewData:{},getPreviewData:function(){}})),c=function(){return Object(n.useContext)(o)}},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(67);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(27);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){e.exports=window.wp.dom},,,function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(19),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";var n=r(37),o=r.n(n),c=r(38),i=r.n(c),a=r(27),u=r.n(a),s=r(39),l=r.n(s),f=r(40),p=r.n(f),d=r(29),b=r.n(d),m=r(5),h=r.n(m),g=(r(8),r(3)),v=r(1),O=r(104),y=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,i=void 0===c?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(v.__)("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(72);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 p()(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,r){"use strict";(function(e){var n=r(0),o=(r(76),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(98))},function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),i=r(7),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,f=null!=n;return!l&&f?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||c.Fragment,l&&f&&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(5),o=r.n(n),c=r(74),i=r(0),a=r(33);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){e.exports=window.wp.deprecated},,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";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.keycodes},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){var n=r(62);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,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(56);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){"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){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,r){"use strict";var n=r(71);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){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){e.exports=window.wp.hooks},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(4),o=r.n(n),c=r(9),i=r(11),a=r(0),u=r(19),s=r.n(u),l=r(45),f=r(95),p=r(55),d=function(e){var t=Object(p.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(p.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(p.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(f.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){e.exports=window.wp.warning},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(13),o=r(18),c=r(0),i=r(7),a=r.n(i),u=r(6),s=r(53),l=r.n(s),f=r(14),p=r(15),d=r(16),b=r(17),m=r(10),h=r(23),g=r(41),v=r(58),O=r(25),y=r(108),w=r(22);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)},f=e.left;"right"===n?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===n?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p: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 v="left"==(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;g=v!==a?v:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var O=i.getBoundingClientRect();d=Math.min(d,O.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)},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=r,b=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&f.contentHeight===a)d="top";else if("bottom"===r&&p.contentHeight===a)d="bottom";else{var m="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var k=r(30),R=r(12);var P=Object(c.createContext)({focusHistory:[]}),S=P.Provider,C=P.Consumer;S.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",c.Component;var T=Object(O.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(f.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(p.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(k.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(k.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(O.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(f.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(R.a)(e)),e}return Object(p.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===v.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(f.a)(this,o),n.apply(this,arguments)}return Object(p.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 B(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 L=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=B(r);function r(){return Object(f.a)(this,r),t.apply(this,arguments)}return Object(p.a)(r,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(c.Component)}();function F(e){e.stopPropagation()}var I=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:F}),r)})),z=r(48);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 H(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){Object(w.a)(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}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 H(H({},r),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function q(e,t,r){return(q="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(19);var V=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Y=(V.Provider,V.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(f.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(R.a)(e)),e}return Object(p.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||q(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),Q=function(e){return Object(c.createElement)(Y,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}))}))},K=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)(V),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=++K),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)(Y,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),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(n.a)({ref:f},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)(Q,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,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 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 fe=function(e){var t=e.headerTitle,r=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,w=(e.range,e.focusOnMount),j=void 0===w?"firstElement":w,k=e.anchorRef,R=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,B=e.__unstableSticky,F=e.__unstableSlotName,z=void 0===F?"Popover":F,U=e.__unstableObserveElement,H=e.__unstableBoundaryParent,q=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"]),V=Object(c.useRef)(null),Y=Object(c.useRef)(null),G=Object(c.useRef)(),Q=Object(O.useViewportMatch)("medium","<"),K=Object(c.useState)(),J=Object(h.a)(K,2),X=J[0],$=J[1],Z=W(z),ee=C&&Q,re=Object(O.useResizeObserver)(),ne=Object(h.a)(re,2),oe=ne[0],fe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return le(G.current,"is-without-arrow",p),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(Y.current,"maxHeight"),void se(Y.current,"maxWidth");var e=function(){if(G.current&&Y.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 f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ae(p,f)}}(V,P,S,k,R);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)}H&&(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],f=void 0===l?"center":l,p=u[2],d=x(e,t,s,p,n,o,c),b=_(e,t,f,p,n,d.yAxis,i);return E(E({},b),d)}(e,fe.height?fe:Y.current.getBoundingClientRect(),m,B,G.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,v=u.contentHeight,O=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",p||"center"===f&&"middle"===b),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis",f),ue(G.current,"data-y-axis",b),se(Y.current,"maxHeight","number"==typeof v?v+"px":""),se(Y.current,"maxWidth","number"==typeof O?O+"px":""),$(({left:"right",right:"left"}[f]||"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),U&&(r=new window.MutationObserver(e)).observe(U,{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,k,R,m,fe,B,U,H]),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,Y);var pe=function(e){e.keyCode===v.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)(I,Object(n.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},q,{onKeyDown:pe,ref:G}),ee&&Object(c.createElement)(L,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(ve,{className:"components-popover__close",icon:y.a,onClick:r})),Object(c.createElement)("div",{ref:Y,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)),k||P?de:Object(c.createElement)("span",{ref:V},de)};fe.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 pe=fe,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(f.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(p.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)(pe,{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(86);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"],ve=t.a=Object(c.forwardRef)((function(e,t){var r=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,g=e.isLink,v=e.isDestructive,O=e.className,y=e.disabled,w=e.icon,j=e.iconSize,E=e.showTooltip,_=e.tooltipPosition,x=e.shortcut,k=e.label,R=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",O,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":g,"is-destructive":v,"has-text":!!w&&!!R,"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 B=!T&&(E&&k||x||!!k&&(!R||Object(u.isArray)(R)&&!R.length)&&!1!==E),L=Object(c.createElement)(N,Object(n.a)({},D,S,{className:C,"aria-label":S["aria-label"]||k,ref:t}),w&&Object(c.createElement)(me.a,{icon:w,size:j}),R);return B?Object(c.createElement)(be,{text:k,shortcut:x,position:_},L):L}))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(4),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,r){"use strict";var n=r(22),o=r(13),c=r(18),i=r(0),a=r(44),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 f=n||24;if("function"==typeof r)return r.prototype instanceof i.Component?Object(i.createElement)(r,l({size:f},s)):r(l({size:f},s));if(r&&("svg"===r.type||r.type===a.SVG)){var p=l(l({width:f,height:f},r.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(r)?Object(i.cloneElement)(r,l({size:f},s)):r}},function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(4),i=r.n(c),a=r(2),u=r(1),s=r(66);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 f(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 p=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(p).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 f(f(f({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(13),o=r(14),c=r(15),i=r(12),a=r(16),u=r(17),s=r(10),l=r(0),f=r(6),p=r(25);var d=["button","submit"];t.a=Object(p.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,p,b=(r=m,p=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(p){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(f.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(f.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}));var n=r(20),o=r.n(n),c=r(5),i=r.n(c),a=r(0),u=r(46);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 f=[".wp-block-woocommerce-cart"],p=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),f=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:f})))),e)}))},d=function(e){var t,r,n,o,c,i,a,u=document.body.querySelectorAll(f.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)})),p({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),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},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){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,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(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(5),o=r.n(n),c=r(4),i=r.n(c),a=(r(8),r(0)),u=r(11),s=r(52),l=r(36),f=r(20),p=r.n(f),d=r(7),b=r.n(d),m=r(152),h=(r(105),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,p()({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 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){o()(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 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,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),v=i()(h,2),w=v[0],j=v[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,O(O({},r),{},{context:r.context||p})),E("store-notice-create",{status:e,content:t,options:r})}),[b,E,p]),k=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),R={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:x,removeNotice:k,context:p,setIsSuppressed:j},P=w?null:React.createElement(g,{className:n,notices:R.notices,removeNotice:R.removeNotice,isEditor:_});return React.createElement(y.Provider,{value:R},c&&P,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(4),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,"a",(function(){return u}));var n=r(9),o=r(11),c=r(0),i=r(45),a=r(83),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=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 b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),g=Object(a.a)(),v=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!==v&&(b.current=v),b.current}},,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 f})),r.d(t,"j",(function(){return p})),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 v}));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),f=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),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",{}),v=Object(o.getSetting)("allowedStates",{})},function(e,t){},function(e,t){e.exports=window.wp.autop},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}));var n,o=window.CustomEvent||null,c=function(e,t){var r=t.bubbles,n=void 0!==r&&r,c=t.cancelable,i=void 0!==c&&c,a=t.element,u=t.detail,s=void 0===u?{}:u;if(o){a||(a=document.body);var l=new o(e,{bubbles:n,cancelable:i,detail:s});a.dispatchEvent(l)}},i=function(){n&&clearTimeout(n),n=setTimeout((function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},function(e,t,r){"use strict";var n=r(0),o=r(44),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,r){"use strict";var n=r(20),o=r.n(n),c=r(0),i=(r(129),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){e.exports=window.wp.wordcount},,,,,,function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(26),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){},,,,,,,,,,,,,,function(e,t,r){"use strict";r(8);var n=r(7),o=r.n(n),c=r(49),i=r(25);r(161),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,f="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:f}}),React.createElement("select",{id:f,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,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(68),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,r){"use strict";var n=r(0),o=r(6),c=r(7),i=r.n(c),a=r(1),u=r(34),s=r(108),l=r(81);t.a=function(e){var t=e.className,r=e.status,c=void 0===r?"info":r,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,g=void 0===h||h,v=e.actions,O=void 0===v?[]:v,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&&(f=Object(n.createElement)(n.RawHTML,null,f)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},f,O.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,f=e.url;return Object(n.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?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){e.exports=window.wc.wcBlocksSharedHocs},,,,,,,function(e,t){},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(31),o=r(0),c=r(104);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,373))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return r.e(11).then(r.bind(null,403))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return r.e(19).then(r.bind(null,404))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return r.e(13).then(r.bind(null,374))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return r.e(9).then(r.bind(null,375))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return r.e(17).then(r.bind(null,376))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return r.e(14).then(r.bind(null,312))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return r.e(15).then(r.bind(null,377))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return r.e(10).then(r.bind(null,378))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return r.e(18).then(r.bind(null,379))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return r.e(16).then(r.bind(null,380))}))}),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,390))}))});var i=function(e){return Object(n.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,function(e,t,r){e.exports=r(250)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(100),o=r(94),c=r(37),i=r.n(c),a=r(38),u=r.n(a),s=r(39),l=r.n(s),f=r(40),p=r.n(f),d=r(29),b=r.n(d),m=r(3),h=(r(8),r(4)),g=r.n(h),v=r(0),O=r(26),y=r.n(O),w=r(5),j=r.n(w),E=r(1),_=r(6),x=r(7),k=r.n(x),R=r(49),P=(r(228),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),f=r&&Boolean(s!==i),p=r&&Boolean(u>3),d=r&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&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(R.a,{screenReaderLabel:Object(E.__)("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(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(R.a,{label:"←",screenReaderLabel:Object(E.__)("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(R.a,{label:1,screenReaderLabel:Object(E.sprintf)(
|
4 |
/* translators: %d is the page number (1, 2, 3...). */
|
5 |
Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","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(R.a,{label:e,screenReaderLabel:Object(E.sprintf)(
|
6 |
/* translators: %d is the page number (1, 2, 3...). */
|
7 |
Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:k()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.a,{label:i,screenReaderLabel:Object(E.sprintf)(
|
8 |
/* translators: %d is the page number (1, 2, 3...). */
|
9 |
+
Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),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(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(R.a,{label:"→",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});P.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var S=P,C=r(95),T=r(75),N=r(102),D=r(9),M=r(11),A=r(45);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 L(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){j()(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 F=r(52),I=r(117),z=r(84),U=r(34),H=r(128),W=r(44),q=React.createElement(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.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"})),V=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(H.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:q,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Y=React.createElement(W.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.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"})),G=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(n,"__no-products")},React.createElement(H.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:Y,size:100}),React.createElement("strong",{className:"".concat(n,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(n,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:r},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},Q=r(143),K=(r(227),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return React.createElement(Q.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",onChange:t,options:[{key:"menu_order",label:Object(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:n})}),J=r(25),X=r(20),$=r.n(X),Z=r(166),ee=Object(J.withInstanceId)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,o=r.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=k()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,r,n,o){if(n){var c=Object(Z.a)(t);return n.map((function(n,i){var a=g()(n,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,r,l.children,o));var p=c[u];if(!p)return null;var d=r.id||0,b=["layout",u,i,o,d];return React.createElement(v.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,$()({},l,{children:f,product:r})))}))}}(a,t,o,n))})),te=(r(226),["order","orderby","page","per_page"]);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){j()(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}var oe=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.totalQuery;return!Object(_.isEqual)(t,o)&&Number.isFinite(r)},ce=Object(I.a)((function(e){var t,r=e.attributes,n=e.currentPage,o=e.onPageChange,c=e.onSortChange,i=e.sortValue,a=e.scrollToTop,u=Object(T.b)("attributes",[]),s=g()(u,2),l=s[0],f=s[1],p=Object(T.b)("stock_status",[]),d=g()(p,2),b=d[0],m=d[1],h=Object(T.b)("min_price"),O=g()(h,2),w=O[0],j=O[1],x=Object(T.b)("max_price"),R=g()(x,2),P=R[0],B=R[1],I=Object(T.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,o=n.columns,c=n.rows;return ne(ne({},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:o*c,page:r})}({attributes:r,sortValue:i,currentPage:n})),H=g()(I,1)[0],W=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(N.a)(L(L({},t),{},{query:e})),n=r.results,o=r.isLoading,c=function(e,t){var r=t.namespace,n=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=void 0===i?{}:i;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(A.a)(a),s=Object(A.a)(c),l=Object(M.useSelect)((function(e){var t=e(D.COLLECTIONS_STORE_KEY),o=["x-wp-total",r,n,u,s];return{value:t.getCollectionHeader.apply(t,o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}}),["x-wp-total",r,n,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}(0,L(L({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(c,10),productsLoading:o}}(H),q=W.products,Y=W.totalProducts,Q=W.productsLoading,J=Object(z.useInnerBlockLayoutContext)(),X=J.parentClassName,$=J.parentName,Z=((t=H).order,t.orderby,t.page,t.per_page,y()(t,te)||{}),re=Object(F.a)().dispatchStoreEvent,ce=Object(C.a)({totalQuery:Z,totalProducts:Y},oe);Object(v.useEffect)((function(){re("product-list-render",{products:q,listName:$})}),[q,$,re]),Object(v.useEffect)((function(){Object(_.isEqual)(Z,null==ce?void 0:ce.totalQuery)||(o(1),null!=ce&&ce.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(U.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(U.speak)(Object(E.sprintf)(
|
10 |
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
|
11 |
+
Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(Y))}),[null==ce?void 0:ce.totalQuery,Y,o,Z]);var ie,ae,ue,se,le,fe=r.contentVisibility,pe=r.columns*r.rows,de=!Number.isFinite(Y)&&Number.isFinite(null==ce?void 0:ce.totalProducts)&&Object(_.isEqual)(Z,null==ce?void 0:ce.totalQuery)?Math.ceil(ce.totalProducts/pe):Math.ceil(Y/pe),be=q.length?q:Array.from({length:pe}),me=0!==q.length||Q,he=l.length>0||b.length>0||Number.isFinite(w)||Number.isFinite(P);return React.createElement("div",{className:(ie=r.columns,ae=r.rows,ue=r.alignButtons,se=r.align,le=void 0!==se?"align"+se:"",k()(X,le,"has-"+ie+"-columns",{"has-multiple-rows":ae>1,"has-aligned-buttons":ue}))},fe.orderBy&&me&&React.createElement(K,{onChange:c,value:i}),!me&&he&&React.createElement(G,{resetCallback:function(){f([]),m([]),j(null),B(null)}}),!me&&!he&&React.createElement(V,null),me&&React.createElement("ul",{className:"".concat(X,"__products")},be.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return React.createElement(ee,{key:e.id||t,attributes:r,product:e})}))),de>1&&React.createElement(S,{currentPage:n,onPageChange:function(e){a({focusableSelector:"a, button"}),o(e)},totalPages:de}))})),ie=function(e){var t=e.attributes,r=Object(v.useState)(1),n=g()(r,2),o=n[0],c=n[1],i=Object(v.useState)(t.orderby),a=g()(i,2),u=a[0],s=a[1];return Object(v.useEffect)((function(){s(t.orderby)}),[t.orderby]),React.createElement(ce,{attributes:t,currentPage:o,onPageChange:function(e){c(e)},onSortChange:function(e){var t=e.target.value;s(t),c(1)},sortValue:u})},ae=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},React.createElement("title",null,"Grid Block Preview"),React.createElement("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var ue=function(e){l()(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=b()(t);if(r){var o=b()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return p()(this,e)});function o(){return i()(this,o),n.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?ae:React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ie,{attributes:t,urlParameterSuffix:r}))}}]),o}(m.Component);Object(o.a)({selector:".wp-block-woocommerce-all-products",Block:function(e){return React.createElement(n.a,{context:"wc/all-products"},React.createElement(ue,e))},getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);
|
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' => '
|
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' => 'd53314a54a9b57df0340e2e38d43227b');
|
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],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={5:0,1:0,2:0,3:0,8:0,9:0,11:0,12:0,13:0,14:0,15:0,16: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/button",3:"atomic-block-components/sale-badge",7:"atomic-block-components/add-to-cart",8:"atomic-block-components/button",9:"atomic-block-components/category-list",10:"atomic-block-components/image",11:"atomic-block-components/price",12:"atomic-block-components/rating",13:"atomic-block-components/sku",14:"atomic-block-components/stock-indicator",15:"atomic-block-components/summary",16:"atomic-block-components/tag-list",17:"atomic-block-components/title"}[e]||e)+".js?ver="+{1:"
|
2 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
3 |
-
Object(m.__)("Heading %d","woo-gutenberg-products-block"),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},126:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(
|
4 |
/* translators: %s Field label. */
|
5 |
-
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}))}},134:function(e,t,r){"use strict";var n=r(0);r(223),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},135:function(e,t){e.exports=window.wp.wordcount},136:function(e,t,r){"use strict";var n=r(34),c=r.n(n),o=r(
|
6 |
/* translators: %1$d is the number of variations of a product product. */
|
7 |
Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
|
8 |
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
|
9 |
-
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)(V(Object(d.withInstanceId)(Y))))},137:function(e,t,r){"use strict";var n=r(0),c=r(27),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},139:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(
|
10 |
/* translators: %1$s min price, %2$s max price */
|
11 |
-
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}))}},142: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))}}},143: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}},148:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(43),c=r.n(n),o=r(5),a=r.n(o),i=r(21),s=r.n(i),u=r(8),l=r.n(u),b=r(0),p=r(7),d=r(36),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)}},149:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(25),c=r(14),o=r(0),a=r(58),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}},15:function(e,t){e.exports=window.wp.apiFetch},162:function(e,t,r){"use strict";var n=r(0),c=r(27),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},172: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"}))},173:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(0),s=r(26),u=r(6),l=r.n(u),b=(r(219),["className","disabled","name","permalink","rel","style","onClick"]);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=e.rel,m=e.style,O=(e.onClick,a()(e,b)),g=l()("wc-block-components-product-name",r);if(o){var j=O;return Object(i.createElement)("span",c()({className:g},j,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}return Object(i.createElement)("a",c()({className:g,href:d,rel:f},O,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)},style:m}))}},174: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(78),l=r(76),b=r(10),p=r.n(b),d=r(6),f=r.n(d),m=r(887),O=(r(221),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)}},175:function(e,t,r){"use strict";var n=r(0),c=r(135),o=r(105),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]:"…",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]:"…",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)}},186:function(e,t){},191:function(e,t){},193:function(e,t){},197:function(e,t){e.exports=window.wp.warning},20:function(e,t){e.exports=window.wp.compose},211: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}),{})}},219:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},224:function(e,t){},23:function(e,t){e.exports=window.wp.url},24:function(e,t){e.exports=window.wp.blocks},25:function(e,t){e.exports=window.wc.wcBlocksData},26:function(e,t){e.exports=window.wp.htmlEntities},27:function(e,t){e.exports=window.wp.primitives},272:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(29),a=r.n(o),i=r(8),s=r.n(i),u=r(21),l=r.n(u),b=r(0),p=r(22),d=r.n(p),f=r(37),m=r(39),O=r(201),g=r(40),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}))}}},273: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(42),l=r(41),b=r(81);r(540),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")}))}))},275:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(148)),o=(r(224),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))})},28:function(e,t){e.exports=window.moment},3:function(e,t){e.exports=window.wp.components},327:function(e,t,r){"use strict";var n=r(0),c=r(27),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},328:function(e,t,r){"use strict";var n=r(0),c=r(27),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},35:function(e,t){e.exports=window.wp.dataControls},36:function(e,t){e.exports=window.wp.isShallowEqual},365:function(e,t){},366:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(113);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},367:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(21),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=r(41),b=r(12),p=r(113),d=r(81),f=r(173),m=r(78),O=(r(539),["children","headingLevel","elementType"]),g=function(e){var t=e.children,r=e.headingLevel,n=e.elementType,c=void 0===n?"h".concat(r):n,o=a()(e,O);return Object(i.createElement)(c,o,t)};t.a=Object(d.withProductDataContext)((function(e){var t,r,n,o,a,s,d,O=e.className,j=e.headingLevel,h=void 0===j?2:j,v=e.showProductLink,w=void 0===v||v,y=e.align,E=e.textColor,_=e.fontSize,k=e.style,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=Object(m.a)().dispatchStoreEvent,x=Object(b.getColorClassName)("color",E),N=Object(b.getFontSizeClass)(_),D=u()("wp-block-woocommerce-product-title",(n={"has-text-color":E||(null==k||null===(t=k.color)||void 0===t?void 0:t.text)||(null==k?void 0:k.color)},c()(n,"has-font-size",_||(null==k||null===(r=k.typography)||void 0===r?void 0:r.fontSize)||(null==k?void 0:k.fontSize)),c()(n,x,x),c()(n,N,N),n)),T={fontSize:(null==k?void 0:k.fontSize)||(null==k||null===(o=k.typography)||void 0===o?void 0:o.fontSize),color:(null==k||null===(a=k.color)||void 0===a?void 0:a.text)||(null==k?void 0:k.color)};return C.id?Object(i.createElement)(g,{headingLevel:h,className:u()(O,"wc-block-components-product-title",(s={},c()(s,"".concat(P,"__product-title"),P),c()(s,"wc-block-components-product-title--align-".concat(y),y&&Object(p.b)()),s))},Object(i.createElement)(f.a,{className:u()(c()({},D,Object(p.b)())),disabled:!w,name:C.name,permalink:C.permalink,rel:w?"nofollow":"",onClick:function(){S("product-view-link",{product:C})},style:Object(p.b)()?T:{}})):Object(i.createElement)(g,{headingLevel:h,className:u()(O,"wc-block-components-product-title",(d={},c()(d,"".concat(P,"__product-title"),P),c()(d,"wc-block-components-product-title--align-".concat(y),y&&Object(p.b)()),c()(d,D,Object(p.b)()),d))})}))},368:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n,c=window.CustomEvent||null,o=function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,i=t.element,s=t.detail,u=void 0===s?{}:s;if(c){i||(i=document.body);var l=new c(e,{bubbles:n,cancelable:a,detail:u});i.dispatchEvent(l)}},a=function(){n&&clearTimeout(n),n=setTimeout((function(){o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},i=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},369: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(4),c=r(133),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}},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(4),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",{})},370: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}}},371:function(e,t,r){"use strict";var n=r(10),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(4),f=r(41),m=r(81),O=r(78),g=r(273);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(541);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})))}))},
|
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)(M.a,{srcElement:F.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(L.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(549),r(34)),J=r.n($),X=r(895),Z=r(11),ee=r(275),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(117);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(I.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(888),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(V.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(L.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(I.isEmpty)(c)});return Object(n.createElement)(A,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(Oe,null)))}))},375:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(43),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(64);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)}}()},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(4),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.wc.wcSettings},40: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")}},41:function(e,t){e.exports=window.wc.wcBlocksSharedContext},42: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))}},44:function(e,t){e.exports=window.wp.keycodes},45:function(e,t){e.exports=window.wp.escapeHtml},476: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(140),u=r(50),l=r(41),b=r(12),p=r(113),d=r(81);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",_),T=Object(b.getFontSizeClass)(v),B=i()((t={"has-text-color":y||E,"has-font-size":j||h},c()(t,x,x),c()(t,N,N),t)),R=i()((r={"has-text-color":_||k,"has-font-size":v||w},c()(r,D,D),c()(r,T,T),r)),A={color:E,fontSize:h},L={color:k,fontSize:w},I=C.prices,V=Object(u.getCurrencyFromPriceResponse)(I),z=I.price!==I.regular_price,M=z?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,R,Object(p.b)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,B,Object(p.b)()),a)),F=z?L:A;return Object(o.createElement)(s.a,{align:g,className:S,currency:V,price:I.price,priceClassName:M,priceStyle:Object(p.b)()?F:{},minPrice:null==I||null===(d=I.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==I||null===(f=I.price_range)||void 0===f?void 0:f.max_amount,regularPrice:I.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,B,Object(p.b)()),m)),regularPriceStyle:Object(p.b)()?A:{}})}))},477: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(81),b=(r(542),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)))}))},
|
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))}))},48:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));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")))}},480:function(e,t,r){"use strict";r.r(t);var n=r(
|
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){e.exports=window.wc.priceFormat},51:function(e,t){e.exports=window.wp.hooks},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return P}));var n=r(8),c=r.n(n),o=r(5),a=r.n(o),i=r(7),s=r(0),u=r(25),l=r(14),b=r(26),p=r(211),d=r(369),f=r(76),m=r(368),O=function(e){var t=e.detail;t&&t.preserveCartData||Object(l.dispatch)(u.CART_STORE_KEY).invalidateResolutionForStore()},g=function(){1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},j=function(){Object(s.useEffect)((function(){return function(){if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:function(){}}),0===window.wcBlocksStoreCartListeners.count){var e=Object(m.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(m.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",O),document.body.addEventListener("wc-blocks_removed_from_cart",O),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=function(){e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",O),document.body.removeEventListener("wc-blocks_removed_from_cart",O)}}window.wcBlocksStoreCartListeners.count++}(),g}),[])};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 v(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){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}var w={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},y=v(v({},w),{},{email:""}),E={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:""},_=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)]})))},k={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:E,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:y,shippingAddress:w,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},P=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)();j();var b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return k;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:y,shippingAddress:w,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=_(i.billingAddress),O=i.needsShipping?_(i.shippingAddress):m,g=i.fees.length>0?i.fees.map((function(e){return _(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return v(v({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:g,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)(O),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}},539:function(e,t){},54:function(e,t){e.exports=window.wc.wcBlocksRegistry},540:function(e,t){},541:function(e,t){},542:function(e,t){},543:function(e,t){},544:function(e,t){},545:function(e,t){},546:function(e,t){},547:function(e,t){},548:function(e,t){},549:function(e,t){},550:function(e,t,r){"use strict";var n=r(0),c=r(27),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},57:function(e,t){e.exports=window.wp.deprecated},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(36),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},59:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(5),a=r.n(o),i=r(21),s=r.n(i),u=r(0),l=r(178),b=r(6),p=r.n(b),d=(r(186),["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}))}},61:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(21),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}},64: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(117);!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}}},66:function(e,t){e.exports=window.wp.a11y},67: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(174);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})}},7:function(e,t){e.exports=window.lodash},70:function(e,t){e.exports=window.wp.dom},71: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},745:function(e,t,r){"use strict";var n=r(0),c=r(27),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},752:function(e,t,r){"use strict";var n=r(0),c=r(27),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},76: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,currentView:"",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.currentView,s=void 0===i?"":i,u=e.previewData,l=void 0===u?{}:u,b=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),p=Object(n.useCallback)((function(e){return e in l?l[e]:{}}),[l]),d={isEditor:!0,currentPostId:b,currentView:s,previewData:l,getPreviewData:p};return Object(n.createElement)(o.Provider,{value:d},t)}},760:function(e,t,r){"use strict";var n=r(0),c=r(27),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},761: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}]},766:function(e,t,r){"use strict";var n=r(0),c=r(27),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},773:function(e,t,r){e.exports=r(846)},774:function(e,t){},775:function(e,t){},776: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(25),s=r(26),u=r(52),l=r(67),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)}))}}}},777:function(e,t,r){"use strict";var n=r(0),c=r(27),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},778:function(e,t){},779:function(e,t){},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(51),a=r(0),i=r(52);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)}}),[])}}},780:function(e,t){},781:function(e,t){},782:function(e,t){},81:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},82:function(e,t){e.exports=window.ReactDOM},83:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(13),l=r.n(u),b=r(18),p=r.n(b),d=r(19),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(7),h=r(6),v=r.n(h),w=r(3),y=r(20);r(116);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)},846:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Ar}));var n=r(5),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(12),l=r(24),b=r(61),p=r(27),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(113),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:"#7f54b3"},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(366),h=r(3),v=r(20),w=r(121),y=r(367),E=r(8),_=r.n(E),k=r(136),P=r(21),C=r.n(P),S=(r(775),["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(41),D=(r(774),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)))}}}),T=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"})),B=Object(s.__)("Product Title","woo-gutenberg-products-block"),R=Object(i.createElement)(b.a,{srcElement:T}),A=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),L=function(e){var t=e.attributes,r=e.setAttributes,n=Object(u.useBlockProps)(),c=t.headingLevel,o=t.showProductLink,a=t.align;return Object(i.createElement)("div",n,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:c,onChange:function(e){return r({headingLevel:e})}}),Object(f.b)()&&Object(i.createElement)(u.AlignmentToolbar,{value:a,onChange:function(e){r({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:o,onChange:function(){return r({showProductLink:!o})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(y.a,t)))},I=Object(f.b)()?Object(v.compose)([D({icon:R,label:B,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(L):L;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 z(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){c()(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 M=z(z({},g),{},{apiVersion:2,title:B,description:A,icon:{src:R,foreground:"#7f54b3"},attributes:j.a,edit:I,supports:Object(f.b)()?{html:!1,color:{background:!1},typography:{fontSize:!0}}:g.supports});Object(l.registerBlockType)("woocommerce/product-title",M);var F=r(476),H=r(327),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","woo-gutenberg-products-block")})))},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)(F.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:"#7f54b3"},attributes:J,edit:W};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},g),ee));var te=r(370),re=r(83),ne=r(4),ce=r(371),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:"#7f54b3"},attributes:te.a,edit:ue};Object(l.registerBlockType)("woocommerce/product-image",be(be({},g),pe));var de=r(477),fe=r(760),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:"#7f54b3"},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(478),we=r(328),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:"#7f54b3"},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(480),Se=r(777),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 Te(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 Be={title:xe,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ne,foreground:"#7f54b3"},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",Te(Te({},g),Be));var Re=r(273),Ae=r(752),Le=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),Ie=Object(i.createElement)(b.a,{srcElement:Ae.a});function Ve(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 ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Me={title:Le,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Ie,foreground:"#7f54b3"},supports:{html:!1},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ie,label:Le,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)(Re.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",ze(ze({},g),Me));var Fe=r(126),He=r(481),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:"#7f54b3"},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)(Fe.a,null),Object(i.createElement)(He.default,t))}))};Object(f.c)("woocommerce/product-sku",Ue(Ue({},g),We));var Ke=r(482),$e=r(745),Je=Object(s.__)("Product Category List","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e.a}),Ze=Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),et=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)(Fe.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ke.default,t)))}));function tt(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 rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nt=rt(rt({},g),{},{title:Je,description:Ze,icon:{src:Xe,foreground:"#7f54b3"},attributes:{productId:{type:"number",default:0}},edit:et});Object(f.c)("woocommerce/product-category-list",nt);var ct=r(483),ot=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),at=Object(i.createElement)(b.a,{srcElement:Ae.a});function it(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 st(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut={title:ot,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:at,foreground:"#7f54b3"},attributes:{productId:{type:"number",default:0}},edit:D({icon:at,label:ot,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)(Fe.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ct.default,t)))}))};Object(f.c)("woocommerce/product-tag-list",st(st({},g),ut));var lt=r(484),bt=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"}))),pt=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),dt=Object(i.createElement)(b.a,{srcElement:bt});function ft(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 mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ot={title:pt,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:dt,foreground:"#7f54b3"},attributes:{productId:{type:"number",default:0}},edit:D({icon:dt,label:pt,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)(Fe.a,null),Object(i.createElement)(lt.default,t))}))};Object(f.c)("woocommerce/product-stock-indicator",mt(mt({},g),Ot));var gt=r(878),jt=(r(365),r(374)),ht=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),vt=Object(i.createElement)(b.a,{srcElement:we.a});function wt(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?wt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Et={title:ht,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:vt,foreground:"#7f54b3"},edit:D({icon:vt,label:ht,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)(Fe.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(gt.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)(jt.a,t)))})),attributes:r(373).a};Object(f.c)("woocommerce/product-add-to-cart",yt(yt({},g),Et));var _t=r(16),kt=r.n(_t),Pt=r(13),Ct=r.n(Pt),St=r(18),xt=r.n(St),Nt=r(19),Dt=r.n(Nt),Tt=r(9),Bt=r.n(Tt),Rt=r(14),At=(r(2),r(87)),Lt=r(874),It=r(761),Vt=r(37),zt=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})},Mt=r(162),Ft=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:Mt.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")))},Ht=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 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 Gt(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 Qt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Yt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Gt(Gt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function Ut(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 Wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kt=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:Wt(Wt({},r),{},{orderBy:!r.orderBy})})}})},$t=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})}})},Jt=r(17),Xt=r.n(Jt),Zt=r(11),er=r(7),tr=r(42),rr=(r(781),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)(tr.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)(tr.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)(tr.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)(tr.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)(tr.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)(tr.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});rr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var nr=rr,cr=r(143),or=r(
|
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)))}(R))}),[null==F?void 0:F.totalQuery,R,c,z]);var H,q,G,Q,Y,U=r.contentVisibility,W=r.columns*r.rows,K=!Number.isFinite(R)&&Number.isFinite(null==F?void 0:F.totalProducts)&&Object(er.isEqual)(z,null==F?void 0:F.totalQuery)?Math.ceil(F.totalProducts/W):Math.ceil(R/W),$=B.length?B:Array.from({length:W}),J=0!==B.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()(I,Y,"has-"+H+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":G}))},U.orderBy&&J&&Object(i.createElement)(hr,{onChange:o,value:a}),!J&&X&&Object(i.createElement)(gr,{resetCallback:function(){d([]),j([]),y(null),S(null)}}),!J&&!X&&Object(i.createElement)(mr,null),J&&Object(i.createElement)("ul",{className:"".concat(I,"__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)(vr,{key:e.id||t,attributes:r,product:e})}))),K>1&&Object(i.createElement)(nr,{currentPage:n,onPageChange:function(e){u({focusableSelector:"a, button"}),c(e)},totalPages:K}))},function(e){var t=Object(i.useRef)(null);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(i.createElement)(_r,a()({},e,{scrollToTop:function(e){var r,n;null!==t.current&&(r=t.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];pr(c),null==c||c.focus()}else pr(e)}(r,n):pr(r)))}})))}),Cr=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)(Pr,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},Sr=r(172);var xr=function(e){xt()(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=Bt()(t);if(r){var c=Bt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return Dt()(this,e)});function c(){return kt()(this,c),n.apply(this,arguments)}return Xt()(c,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?Sr.a:Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Cr,{attributes:t,urlParameterSuffix:r}))}}]),c}(Zt.Component);r(778);var Nr=function(e){xt()(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=Bt()(t);if(r){var c=Bt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return Dt()(this,e)});function o(){var e;kt()(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()(Ct()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Ct()(e),"blockMap",Object(Lt.a)("woocommerce/all-products")),c()(Ct()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Ct()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Ct()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Ct()(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()(Ct()(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)(At.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")},Kt(r,n),$t(r,n)))})),c()(Ct()(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 inner product layout","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Ct()(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:It.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:Yt(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()(Ct()(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)(xr,{attributes:t})):Ht(c,o)})),c()(Ct()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===Vt.o.productCount?Ft(n,c):Object(i.createElement)("div",{className:zt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return o}(i.Component),Dr=Object(v.compose)(h.withSpokenMessages,Object(Rt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Rt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Nr),Tr={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 Br(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 Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Br(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ar={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#7f54b3"},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:Tr,edit:function(e){return Object(i.createElement)(Dr,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:zt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Rr(Rr({},Ar),{},{deprecated:[{attributes:Object.assign({},Ar.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:zt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},85:function(e,t){e.exports=window.wp.viewport},87:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),a=(r(2),r(3));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})}}))}},874:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(54),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(11)]).then(r.bind(null,476))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(3),r.e(10)]).then(r.bind(null,898))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(17)]).then(r.bind(null,899))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(12).then(r.bind(null,477))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(8)]).then(r.bind(null,478))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,480))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(3).then(r.bind(null,273))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,481))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(9).then(r.bind(null,482))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,483))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,484))}))}),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(7)]).then(r.bind(null,900))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},878: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){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={5:0,1:0,2:0,3:0,8:0,9:0,11:0,12:0,13:0,14:0,15:0,16: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/button",3:"atomic-block-components/sale-badge",7:"atomic-block-components/add-to-cart",8:"atomic-block-components/button",9:"atomic-block-components/category-list",10:"atomic-block-components/image",11:"atomic-block-components/price",12:"atomic-block-components/rating",13:"atomic-block-components/sku",14:"atomic-block-components/stock-indicator",15:"atomic-block-components/summary",16:"atomic-block-components/tag-list",17:"atomic-block-components/title"}[e]||e)+".js?ver="+{1:"4574b89b5d2d98229004",2:"85fd0075fd7197a83858",3:"394dfd25050662c29616",7:"d21f234ab46f91d75182",8:"6c6da34c11ef60f828df",9:"25c849f88490835c954a",10:"13be6e133c339bb83627",11:"100aaa139f3b3fe8cc50",12:"f99680c822cfd2c29cf6",13:"cb817bf368e00d171b4f",14:"64ae6d4cabe12e469919",15:"062d1c84277a437a6732",16:"7f7234124d2e3e5a65e8",17:"32f9c73de5b63262ff04"}[e]}(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([773,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},103: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(25),a=r(14),i=r(0),s=r(36),u=r.n(s),l=r(58),b=r(143),p=r(71),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]}},104:function(e,t){e.exports=window.wp.autop},108:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(0),s=r(185),u=r(5),l=r.n(u),b=r(134),p=(r(222),["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))}},11:function(e,t){e.exports=window.React},113:function(e,t){},114:function(e,t){e.exports=window.wp.coreData},115:function(e,t){},116: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(24),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}},117: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}},12:function(e,t){e.exports=window.wp.blockEditor},120:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(0),s=r(46),u=r(3),l=r(5),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)))}},121:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(17),a=r.n(o),i=r(18),s=r.n(i),u=r(19),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(7),m=r(1),O=r(3);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}),title:Object(m.sprintf)(
|
2 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
3 |
+
Object(m.__)("Heading %d","woo-gutenberg-products-block"),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},126:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(62),a=r(162),i=r(4),s=r(12),u=r(41);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}},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}))}),[])}},133:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(8),a=r.n(o),i=r(4),s=r(1),u=r(117);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)(
|
4 |
/* translators: %s Field label. */
|
5 |
+
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}))}},134:function(e,t,r){"use strict";var n=r(0);r(223),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},135:function(e,t){e.exports=window.wp.wordcount},136:function(e,t,r){"use strict";var n=r(34),c=r.n(n),o=r(6),a=r.n(o),i=r(10),s=r.n(i),u=r(0),l=r(1),b=r(7),p=(r(2),r(46)),d=r(20),f=r(16),m=r.n(f),O=r(17),g=r.n(O),j=r(18),h=r.n(j),v=r(19),w=r.n(v),y=r(9),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(272),P=r(29),C=r.n(P),S=r(13),x=r.n(S),N=r(22),D=r.n(N),T=r(36),B=r.n(T),R=r(39),A=r(40);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 I(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){a()(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 V=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(R.g)(o).then((function(t){var r=t.map((function(e){return I(I({},e),{},{parent:o})}));e.setState({variations:I(I({},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:I(I({},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:I(I({},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&&(!B()(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"),z=r(48),M=r(5),F=r.n(M),H=r(120);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(191);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)(z.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=F()("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:F()(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)(
|
6 |
/* translators: %1$d is the number of variations of a product product. */
|
7 |
Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
|
8 |
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
|
9 |
+
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)(V(Object(d.withInstanceId)(Y))))},137:function(e,t,r){"use strict";var n=r(0),c=r(27),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},139:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(5)),o=r.n(c),a=r(42),i=r(20);r(193),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)}))))}))},14:function(e,t){e.exports=window.wp.data},140:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),a=r(1),i=r(59),s=r(5),u=r.n(s),l=(r(2),r(50)),b=(r(220),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)(
|
10 |
/* translators: %1$s min price, %2$s max price */
|
11 |
+
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}))}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(6),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))}}},143: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}},148:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(43),c=r.n(n),o=r(6),a=r.n(o),i=r(21),s=r.n(i),u=r(8),l=r.n(u),b=r(0),p=r(7),d=r(36),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)}},149:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(25),c=r(14),o=r(0),a=r(58),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}},15:function(e,t){e.exports=window.wp.apiFetch},162:function(e,t,r){"use strict";var n=r(0),c=r(27),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},172: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"}))},173:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),i=r(0),s=r(26),u=r(5),l=r.n(u),b=(r(219),["className","disabled","name","permalink","rel","style","onClick"]);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=e.rel,m=e.style,O=(e.onClick,a()(e,b)),g=l()("wc-block-components-product-name",r);if(o){var j=O;return Object(i.createElement)("span",c()({className:g},j,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}return Object(i.createElement)("a",c()({className:g,href:d,rel:f},O,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)},style:m}))}},174:function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return y}));var n=r(6),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(14)),u=r(78),l=r(76),b=r(10),p=r.n(b),d=r(5),f=r.n(d),m=r(885),O=(r(221),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)}},175:function(e,t,r){"use strict";var n=r(0),c=r(135),o=r(104),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]:"…",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]:"…",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)}},186:function(e,t){},191:function(e,t){},193:function(e,t){},197:function(e,t){e.exports=window.wp.warning},20:function(e,t){e.exports=window.wp.compose},211: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}),{})}},219:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},224:function(e,t){},23:function(e,t){e.exports=window.wp.url},24:function(e,t){e.exports=window.wp.blocks},25:function(e,t){e.exports=window.wc.wcBlocksData},26:function(e,t){e.exports=window.wp.htmlEntities},27:function(e,t){e.exports=window.wp.primitives},272:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(29),a=r.n(o),i=r(8),s=r.n(i),u=r(21),l=r.n(u),b=r(0),p=r(22),d=r.n(p),f=r(38),m=r(39),O=r(201),g=r(40),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}))}}},273:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(5),s=r.n(i),u=r(42),l=r(41),b=r(81);r(540),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")}))}))},275:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(148)),o=(r(224),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))})},28:function(e,t){e.exports=window.moment},3:function(e,t){e.exports=window.wp.components},327:function(e,t,r){"use strict";var n=r(0),c=r(27),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},35:function(e,t){e.exports=window.wp.dataControls},36:function(e,t){e.exports=window.wp.isShallowEqual},364:function(e,t){},365:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(116);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},366:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(21),a=r.n(o),i=r(0),s=r(5),u=r.n(s),l=r(41),b=r(12),p=r(116),d=r(81),f=r(173),m=r(78),O=(r(539),["children","headingLevel","elementType"]),g=function(e){var t=e.children,r=e.headingLevel,n=e.elementType,c=void 0===n?"h".concat(r):n,o=a()(e,O);return Object(i.createElement)(c,o,t)};t.a=Object(d.withProductDataContext)((function(e){var t,r,n,o,a,s,d,O=e.className,j=e.headingLevel,h=void 0===j?2:j,v=e.showProductLink,w=void 0===v||v,y=e.align,E=e.textColor,_=e.fontSize,k=e.style,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=Object(m.a)().dispatchStoreEvent,x=Object(b.getColorClassName)("color",E),N=Object(b.getFontSizeClass)(_),D=u()("wp-block-woocommerce-product-title",(n={"has-text-color":E||(null==k||null===(t=k.color)||void 0===t?void 0:t.text)||(null==k?void 0:k.color)},c()(n,"has-font-size",_||(null==k||null===(r=k.typography)||void 0===r?void 0:r.fontSize)||(null==k?void 0:k.fontSize)),c()(n,x,x),c()(n,N,N),n)),T={fontSize:(null==k?void 0:k.fontSize)||(null==k||null===(o=k.typography)||void 0===o?void 0:o.fontSize),color:(null==k||null===(a=k.color)||void 0===a?void 0:a.text)||(null==k?void 0:k.color)};return C.id?Object(i.createElement)(g,{headingLevel:h,className:u()(O,"wc-block-components-product-title",(s={},c()(s,"".concat(P,"__product-title"),P),c()(s,"wc-block-components-product-title--align-".concat(y),y&&Object(p.b)()),s))},Object(i.createElement)(f.a,{className:u()(c()({},D,Object(p.b)())),disabled:!w,name:C.name,permalink:C.permalink,rel:w?"nofollow":"",onClick:function(){S("product-view-link",{product:C})},style:Object(p.b)()?T:{}})):Object(i.createElement)(g,{headingLevel:h,className:u()(O,"wc-block-components-product-title",(d={},c()(d,"".concat(P,"__product-title"),P),c()(d,"wc-block-components-product-title--align-".concat(y),y&&Object(p.b)()),c()(d,D,Object(p.b)()),d))})}))},367:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n,c=window.CustomEvent||null,o=function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,i=t.element,s=t.detail,u=void 0===s?{}:s;if(c){i||(i=document.body);var l=new c(e,{bubbles:n,cancelable:a,detail:u});i.dispatchEvent(l)}},a=function(){n&&clearTimeout(n),n=setTimeout((function(){o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},i=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},368: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(4),c=r(133),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}},369: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}}},370:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(6),a=r.n(o),i=r(8),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(5),p=r.n(b),d=r(4),f=r(41),m=r(81),O=r(78),g=r(273);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(541);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})))}))},371:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(142),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))}}}},372:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},373:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(5)),o=r.n(c),a=r(8),i=r.n(a),s=r(1),u=r(58),l=r(876),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(6),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(142),v=r(371),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(374),E=r(148),_=r(67),k=r(64),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,T=Object(k.c)(),B=T.isSuccessResponse,R=T.isErrorResponse,A=T.isFailResponse,L=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:w(v).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:w(v).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:w(v).onAddToCartBeforeProcessing}}),[v]),I=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;(R(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,I,x,R,A,B,C]);var V=Object(l.b)(r),z={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:V,showFormElements:c&&V,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:L,dispatchActions:I};return Object(n.createElement)(P.Provider,{value:z},t)},x=r(15),N=r.n(x),D=r(26),T=r(52);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}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(E.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,m=Object(_.a)(),O=m.addErrorNotice,g=m.removeNotice,j=Object(T.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?B(Object(r),!0).forEach((function(t){f()(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}({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)(R,null)))},L=r(41),I=r(7),V=r(81),z=(r(364),r(108)),M=r(62),F=r(550),H=r(78),q=r(776),G=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(z.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)(z.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)(M.a,{srcElement:F.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(L.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(549),r(34)),J=r.n($),X=r(893),Z=r(11),ee=r(275),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(117);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(I.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(886),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(V.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(L.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(I.isEmpty)(c)});return Object(n.createElement)(A,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(Oe,null)))}))},374:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(43),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(64);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)}}()},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 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(4),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",{})},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(6),c=r.n(n),o=r(23),a=r(15),i=r.n(a),s=r(7),u=r(4),l=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,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.wc.wcSettings},40: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")}},41:function(e,t){e.exports=window.wc.wcBlocksSharedContext},42:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),a=r(5),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))}},44:function(e,t){e.exports=window.wp.keycodes},45:function(e,t){e.exports=window.wp.escapeHtml},475:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=(r(2),r(5)),i=r.n(a),s=r(140),u=r(50),l=r(41),b=r(12),p=r(116),d=r(81);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",_),T=Object(b.getFontSizeClass)(v),B=i()((t={"has-text-color":y||E,"has-font-size":j||h},c()(t,x,x),c()(t,N,N),t)),R=i()((r={"has-text-color":_||k,"has-font-size":v||w},c()(r,D,D),c()(r,T,T),r)),A={color:E,fontSize:h},L={color:k,fontSize:w},I=C.prices,V=Object(u.getCurrencyFromPriceResponse)(I),z=I.price!==I.regular_price,M=z?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,R,Object(p.b)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,B,Object(p.b)()),a)),F=z?L:A;return Object(o.createElement)(s.a,{align:g,className:S,currency:V,price:I.price,priceClassName:M,priceStyle:Object(p.b)()?F:{},minPrice:null==I||null===(d=I.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==I||null===(f=I.price_range)||void 0===f?void 0:f.max_amount,regularPrice:I.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,B,Object(p.b)()),m)),regularPriceStyle:Object(p.b)()?A:{}})}))},476:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(5),s=r.n(i),u=r(41),l=r(81),b=(r(542),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)))}))},477:function(e,t,r){"use strict";r.r(t);var n=r(10),c=r.n(n),o=r(6),a=r.n(o),i=r(0),s=(r(2),r(5)),u=r.n(s),l=r(1),b=r(78),p=r(776),d=r(26),f=r(41),m=r(81),O=(r(543),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))}))},479:function(e,t,r){"use strict";var n=r(0),c=r(27),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},48:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));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")))}},480:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=(r(2),r(5)),i=r.n(a),s=r(175),u=r(38),l=r(41),b=r(81);r(544),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}))},481:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(5)),s=r.n(i),u=r(41),l=r(81);r(545),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}))},482:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=r(1),i=r(5),s=r.n(i),u=r(41),l=r(7),b=r(81);r(546),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))}))))}))},483:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(5)),s=r.n(i),u=r(41),l=r(7),b=r(81);r(547),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))}))))}))},484:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(5)),s=r.n(i),u=r(41),l=r(81),b=(r(548),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){e.exports=window.wc.priceFormat},51:function(e,t){e.exports=window.wp.hooks},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return P}));var n=r(8),c=r.n(n),o=r(6),a=r.n(o),i=r(7),s=r(0),u=r(25),l=r(14),b=r(26),p=r(211),d=r(368),f=r(76),m=r(367),O=function(e){var t=e.detail;t&&t.preserveCartData||Object(l.dispatch)(u.CART_STORE_KEY).invalidateResolutionForStore()},g=function(){1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},j=function(){Object(s.useEffect)((function(){return function(){if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:function(){}}),!window.wcBlocksStoreCartListeners.count){var e=Object(m.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(m.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",O),document.body.addEventListener("wc-blocks_removed_from_cart",O),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=function(){e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",O),document.body.removeEventListener("wc-blocks_removed_from_cart",O)}}window.wcBlocksStoreCartListeners.count++}(),g}),[])};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 v(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){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}var w={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},y=v(v({},w),{},{email:""}),E={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:""},_=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)]})))},k={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:E,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:y,shippingAddress:w,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},P=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)();j();var b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return k;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:y,shippingAddress:w,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=_(i.billingAddress),O=i.needsShipping?_(i.shippingAddress):m,g=i.fees.length>0?i.fees.map((function(e){return _(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return v(v({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:g,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)(O),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}},539:function(e,t){},54:function(e,t){e.exports=window.wc.wcBlocksRegistry},540:function(e,t){},541:function(e,t){},542:function(e,t){},543:function(e,t){},544:function(e,t){},545:function(e,t){},546:function(e,t){},547:function(e,t){},548:function(e,t){},549:function(e,t){},550:function(e,t,r){"use strict";var n=r(0),c=r(27),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},57:function(e,t){e.exports=window.wp.deprecated},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(36),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},59:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(6),a=r.n(o),i=r(21),s=r.n(i),u=r(0),l=r(178),b=r(5),p=r.n(b),d=(r(186),["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}))}},62:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(21),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}},64: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(117);!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}}},66:function(e,t){e.exports=window.wp.a11y},67:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(6),c=r.n(n),o=r(0),a=r(174);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})}},7:function(e,t){e.exports=window.lodash},70:function(e,t){e.exports=window.wp.dom},71: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},745:function(e,t,r){"use strict";var n=r(0),c=r(27),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},752:function(e,t,r){"use strict";var n=r(0),c=r(27),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},76: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,currentView:"",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.currentView,s=void 0===i?"":i,u=e.previewData,l=void 0===u?{}:u,b=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),p=Object(n.useCallback)((function(e){return e in l?l[e]:{}}),[l]),d={isEditor:!0,currentPostId:b,currentView:s,previewData:l,getPreviewData:p};return Object(n.createElement)(o.Provider,{value:d},t)}},760:function(e,t,r){"use strict";var n=r(0),c=r(27),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},761: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}]},766:function(e,t,r){"use strict";var n=r(0),c=r(27),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},773:function(e,t,r){e.exports=r(845)},774:function(e,t){},775:function(e,t){},776: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(25),s=r(26),u=r(52),l=r(67),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)}))}}}},777:function(e,t,r){"use strict";var n=r(0),c=r(27),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},778:function(e,t){},779:function(e,t){},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(6),c=r.n(n),o=r(51),a=r(0),i=r(52);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)}}),[])}}},780:function(e,t){},781:function(e,t){},782:function(e,t){},81:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},82:function(e,t){e.exports=window.ReactDOM},83:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(13),l=r.n(u),b=r(18),p=r.n(b),d=r(19),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(7),h=r(5),v=r.n(h),w=r(3),y=r(20);r(115);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)},845:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Ar}));var n=r(6),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(12),l=r(24),b=r(62),p=r(27),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(116),m=r(5),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:"#7f54b3"},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(365),h=r(3),v=r(20),w=r(121),y=r(366),E=r(8),_=r.n(E),k=r(136),P=r(21),C=r.n(P),S=(r(775),["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(41),D=(r(774),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)))}}}),T=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"})),B=Object(s.__)("Product Title","woo-gutenberg-products-block"),R=Object(i.createElement)(b.a,{srcElement:T}),A=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),L=function(e){var t=e.attributes,r=e.setAttributes,n=Object(u.useBlockProps)(),c=t.headingLevel,o=t.showProductLink,a=t.align;return Object(i.createElement)("div",n,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:c,onChange:function(e){return r({headingLevel:e})}}),Object(f.b)()&&Object(i.createElement)(u.AlignmentToolbar,{value:a,onChange:function(e){r({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:o,onChange:function(){return r({showProductLink:!o})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(y.a,t)))},I=Object(f.b)()?Object(v.compose)([D({icon:R,label:B,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(L):L;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 z(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){c()(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 M=z(z({},g),{},{apiVersion:2,title:B,description:A,icon:{src:R,foreground:"#7f54b3"},attributes:j.a,edit:I,supports:Object(f.b)()?{html:!1,color:{background:!1},typography:{fontSize:!0}}:g.supports});Object(l.registerBlockType)("woocommerce/product-title",M);var F=r(475),H=r(327),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","woo-gutenberg-products-block")})))},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)(F.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:"#7f54b3"},attributes:J,edit:W};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},g),ee));var te=r(369),re=r(83),ne=r(4),ce=r(370),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:"#7f54b3"},attributes:te.a,edit:ue};Object(l.registerBlockType)("woocommerce/product-image",be(be({},g),pe));var de=r(476),fe=r(760),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:"#7f54b3"},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(477),we=r(479),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:"#7f54b3"},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(480),Se=r(777),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 Te(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 Be={title:xe,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ne,foreground:"#7f54b3"},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",Te(Te({},g),Be));var Re=r(273),Ae=r(752),Le=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),Ie=Object(i.createElement)(b.a,{srcElement:Ae.a});function Ve(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 ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Me={title:Le,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Ie,foreground:"#7f54b3"},supports:{html:!1},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ie,label:Le,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)(Re.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",ze(ze({},g),Me));var Fe=r(126),He=r(481),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:"#7f54b3"},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)(Fe.a,null),Object(i.createElement)(He.default,t))}))};Object(f.c)("woocommerce/product-sku",Ue(Ue({},g),We));var Ke=r(482),$e=r(745),Je=Object(s.__)("Product Category List","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e.a}),Ze=Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),et=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)(Fe.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ke.default,t)))}));function tt(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 rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nt=rt(rt({},g),{},{title:Je,description:Ze,icon:{src:Xe,foreground:"#7f54b3"},attributes:{productId:{type:"number",default:0}},edit:et});Object(f.c)("woocommerce/product-category-list",nt);var ct=r(483),ot=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),at=Object(i.createElement)(b.a,{srcElement:Ae.a});function it(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 st(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut={title:ot,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:at,foreground:"#7f54b3"},attributes:{productId:{type:"number",default:0}},edit:D({icon:at,label:ot,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)(Fe.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ct.default,t)))}))};Object(f.c)("woocommerce/product-tag-list",st(st({},g),ut));var lt=r(484),bt=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"}))),pt=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),dt=Object(i.createElement)(b.a,{srcElement:bt});function ft(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 mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ot={title:pt,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:dt,foreground:"#7f54b3"},attributes:{productId:{type:"number",default:0}},edit:D({icon:dt,label:pt,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)(Fe.a,null),Object(i.createElement)(lt.default,t))}))};Object(f.c)("woocommerce/product-stock-indicator",mt(mt({},g),Ot));var gt=r(876),jt=(r(364),r(373)),ht=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),vt=Object(i.createElement)(b.a,{srcElement:we.a});function wt(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?wt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Et={title:ht,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:vt,foreground:"#7f54b3"},edit:D({icon:vt,label:ht,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)(Fe.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(gt.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)(jt.a,t)))})),attributes:r(372).a};Object(f.c)("woocommerce/product-add-to-cart",yt(yt({},g),Et));var _t=r(16),kt=r.n(_t),Pt=r(13),Ct=r.n(Pt),St=r(18),xt=r.n(St),Nt=r(19),Dt=r.n(Nt),Tt=r(9),Bt=r.n(Tt),Rt=r(14),At=(r(2),r(87)),Lt=r(872),It=r(761),Vt=r(38),zt=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})},Mt=r(162),Ft=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:Mt.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")))},Ht=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 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 Gt(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 Qt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Yt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Gt(Gt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function Ut(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 Wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kt=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:Wt(Wt({},r),{},{orderBy:!r.orderBy})})}})},$t=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})}})},Jt=r(17),Xt=r.n(Jt),Zt=r(11),er=r(7),tr=r(42),rr=(r(781),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)(tr.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)(tr.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)(tr.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)(tr.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)(tr.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)(tr.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});rr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var nr=rr,cr=r(143),or=r(103),ar=r(149),ir=r(25),sr=r(58);function ur(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 lr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ur(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ur(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var br=r(78),pr=(r(782),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}}),dr=r(66),fr=r(137),mr=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:fr.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")))},Or=r(766),gr=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:Or.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")))},jr=r(139),hr=(r(780),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return Object(i.createElement)(jr.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})}),vr=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(Lt.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))})),wr=(r(779),["order","orderby","page","per_page"]);function yr(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 Er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _r,kr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(er.isEqual)(t,c)&&Number.isFinite(r)},Pr=(_r=function(e){var t,r=e.attributes,n=e.currentPage,c=e.onPageChange,o=e.onSortChange,a=e.sortValue,u=e.scrollToTop,l=Object(or.b)("attributes",[]),b=_()(l,2),p=b[0],d=b[1],f=Object(or.b)("stock_status",[]),m=_()(f,2),g=m[0],j=m[1],h=Object(or.b)("min_price"),v=_()(h,2),w=v[0],y=v[1],E=Object(or.b)("max_price"),k=_()(E,2),P=k[0],S=k[1],x=Object(or.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return Er(Er({},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],T=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(ar.a)(lr(lr({},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(sr.a)(i),u=Object(sr.a)(o),l=Object(Rt.useSelect)((function(e){var t=e(ir.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,lr(lr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}}(D),B=T.products,R=T.totalProducts,A=T.productsLoading,L=Object(N.useInnerBlockLayoutContext)(),I=L.parentClassName,V=L.parentName,z=((t=D).order,t.orderby,t.page,t.per_page,C()(t,wr)||{}),M=Object(br.a)().dispatchStoreEvent,F=Object(cr.a)({totalQuery:z,totalProducts:R},kr);Object(i.useEffect)((function(){M("product-list-render",{products:B,listName:V})}),[B,V,M]),Object(i.useEffect)((function(){Object(er.isEqual)(z,null==F?void 0:F.totalQuery)||(c(1),null!=F&&F.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(dr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(dr.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)))}(R))}),[null==F?void 0:F.totalQuery,R,c,z]);var H,q,G,Q,Y,U=r.contentVisibility,W=r.columns*r.rows,K=!Number.isFinite(R)&&Number.isFinite(null==F?void 0:F.totalProducts)&&Object(er.isEqual)(z,null==F?void 0:F.totalQuery)?Math.ceil(F.totalProducts/W):Math.ceil(R/W),$=B.length?B:Array.from({length:W}),J=0!==B.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()(I,Y,"has-"+H+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":G}))},U.orderBy&&J&&Object(i.createElement)(hr,{onChange:o,value:a}),!J&&X&&Object(i.createElement)(gr,{resetCallback:function(){d([]),j([]),y(null),S(null)}}),!J&&!X&&Object(i.createElement)(mr,null),J&&Object(i.createElement)("ul",{className:"".concat(I,"__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)(vr,{key:e.id||t,attributes:r,product:e})}))),K>1&&Object(i.createElement)(nr,{currentPage:n,onPageChange:function(e){u({focusableSelector:"a, button"}),c(e)},totalPages:K}))},function(e){var t=Object(i.useRef)(null);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(i.createElement)(_r,a()({},e,{scrollToTop:function(e){var r,n;null!==t.current&&(r=t.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];pr(c),null==c||c.focus()}else pr(e)}(r,n):pr(r)))}})))}),Cr=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)(Pr,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},Sr=r(172);var xr=function(e){xt()(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=Bt()(t);if(r){var c=Bt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return Dt()(this,e)});function c(){return kt()(this,c),n.apply(this,arguments)}return Xt()(c,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?Sr.a:Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Cr,{attributes:t,urlParameterSuffix:r}))}}]),c}(Zt.Component);r(778);var Nr=function(e){xt()(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=Bt()(t);if(r){var c=Bt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return Dt()(this,e)});function o(){var e;kt()(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()(Ct()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Ct()(e),"blockMap",Object(Lt.a)("woocommerce/all-products")),c()(Ct()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Ct()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Ct()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Ct()(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()(Ct()(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)(At.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")},Kt(r,n),$t(r,n)))})),c()(Ct()(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 inner product layout","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Ct()(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:It.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:Yt(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()(Ct()(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)(xr,{attributes:t})):Ht(c,o)})),c()(Ct()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===Vt.o.productCount?Ft(n,c):Object(i.createElement)("div",{className:zt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return o}(i.Component),Dr=Object(v.compose)(h.withSpokenMessages,Object(Rt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Rt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Nr),Tr={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 Br(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 Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Br(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ar={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#7f54b3"},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:Tr,edit:function(e){return Object(i.createElement)(Dr,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:zt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Rr(Rr({},Ar),{},{deprecated:[{attributes:Object.assign({},Ar.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:zt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},85:function(e,t){e.exports=window.wp.viewport},87:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),a=(r(2),r(3));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})}}))}},872:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(54),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(11)]).then(r.bind(null,475))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(3),r.e(10)]).then(r.bind(null,896))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(17)]).then(r.bind(null,897))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(12).then(r.bind(null,476))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(8)]).then(r.bind(null,477))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,480))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(3).then(r.bind(null,273))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,481))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(9).then(r.bind(null,482))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,483))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,484))}))}),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(7)]).then(r.bind(null,898))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},876: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")}},91: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' => '
|
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' => '6c5acc1d1a1a8fdad5708fad3f452e54');
|
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={6: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([762,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},
|
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}]}}},15:function(e,t){e.exports=window.wp.apiFetch},176: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}}},177:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),a=r(12),i=(r(192),r(80));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)))}},180:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),a=r(3),i=r(12),s=r(16),l=r.n(s),u=r(17),b=r.n(u),d=r(18),p=r.n(d),w=r(19),m=r.n(w),v=r(9),g=r.n(v),f=r(11),h=r(4),O=r(
|
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(238);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(10),U=r.n(W),J=r(29),q=r.n(J),Y=r(22),K=r.n(Y),Q=r(36),X=r.n(Q),Z=r(80),$=r(40);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}))}},192:function(e,t){},193:function(e,t){},20:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},237:function(e,t){},238:function(e,t){},239:function(e,t){},24:function(e,t){e.exports=window.wp.blocks},240:function(e,t){},27:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wp.components},36: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(4),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.wc.wcSettings},40: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")}},42: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))}},45:function(e,t){e.exports=window.wp.escapeHtml},48:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));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")))}},61:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(21),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},762:function(e,t,r){e.exports=r(859)},80: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(4),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}},83:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=r(17),s=r.n(i),l=r(13),u=r.n(l),b=r(18),d=r.n(b),p=r(19),w=r.n(p),m=r(9),v=r.n(m),g=r(0),f=r(7),h=r(6),O=r.n(h),y=r(3),j=r(20);r(116);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)(_)},859: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(24),s=r(61),l=r(27),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(192),r(12)),d=r(3),p=(r(2),r(180)),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(128),v=r(176),g=r(177),f=r(146);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:"#7f54b3"},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})}});
|
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={6: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([762,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},101:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(62)),a=r(137),i=r(5),s=r.n(i),l=r(3),u=r(48);r(138),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},115:function(e,t){},12:function(e,t){e.exports=window.wp.blockEditor},128: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(3),a=r(12),i=r(4),s=r(83),l=function(e,t,r){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:r,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}))}},137:function(e,t,r){"use strict";var n=r(0),o=r(27),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},138:function(e,t){},139:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(5)),c=r.n(o),a=r(42),i=r(20);r(193),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)}))))}))},146: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}]}}},15:function(e,t){e.exports=window.wp.apiFetch},176: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}}},177:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),a=r(12),i=(r(192),r(80));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)))}},180:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),a=r(3),i=r(12),s=r(16),l=r.n(s),u=r(17),b=r.n(u),d=r(18),p=r.n(d),w=r(19),m=r.n(w),v=r(9),g=r.n(v),f=r(11),h=r(4),O=r(101),y=r(42),j=(r(240),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(139),R=(r(237),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(6),P=r.n(E),S=r(5),C=r.n(S),N=r(13),T=r.n(N),x=r(212),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:"…",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(239);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(238);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(10),U=r.n(W),J=r(29),q=r.n(J),Y=r(22),K=r.n(Y),Q=r(36),X=r.n(Q),Z=r(80),$=r(40);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}))}},192:function(e,t){},193:function(e,t){},20:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},237:function(e,t){},238:function(e,t){},239:function(e,t){},24:function(e,t){e.exports=window.wp.blocks},240:function(e,t){},27:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wp.components},36: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(4),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.wc.wcSettings},40: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")}},42:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(0),a=r(5),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))}},45:function(e,t){e.exports=window.wp.escapeHtml},48:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));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")))}},62:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(21),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},762:function(e,t,r){e.exports=r(858)},80: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(5),a=r.n(c),i=r(4),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}},83:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=r(17),s=r.n(i),l=r(13),u=r.n(l),b=r(18),d=r.n(b),p=r(19),w=r.n(p),m=r(9),v=r.n(m),g=r(0),f=r(7),h=r(5),O=r.n(h),y=r(3),j=r(20);r(115);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)(_)},858:function(e,t,r){"use strict";r.r(t);var n=r(6),o=r.n(n),c=r(0),a=r(1),i=r(24),s=r(62),l=r(27),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(192),r(12)),d=r(3),p=(r(2),r(180)),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(128),v=r(176),g=r(177),f=r(146);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:"#7f54b3"},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})}});
|
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],{117: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 i}));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 i(e,t){return o(e)&&t in e}},133:function(e,t,r){"use strict";var n=r(
|
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},b=Object.entries(p).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,f(n)]})).reduce((function(e,t){var r=i()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=i()(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!==b[r]?b[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},211: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}),{})}},
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{117: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 i}));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 i(e,t){return o(e)&&t in e}},133:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(8),i=r.n(o),a=r(4),s=r(1),u=r(117);function d(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?d(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(a.getSetting)("countryLocale",{}),f=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},b=Object.entries(p).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,f(n)]})).reduce((function(e,t){var r=i()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=i()(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!==b[r]?b[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},211: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}),{})}},367:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a}));var n,c=window.CustomEvent||null,o=function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,i=void 0!==o&&o,a=t.element,s=t.detail,u=void 0===s?{}:s;if(c){a||(a=document.body);var d=new c(e,{bubbles:n,cancelable:i,detail:u});a.dispatchEvent(d)}},i=function(){n&&clearTimeout(n),n=setTimeout((function(){o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},368: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 s}));var n=r(4),c=r(133),o=r(23),i=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,i=void 0===o?"":o,a=e.postcode,s=void 0===a?"":a;return{country:r.trim(),state:c.trim(),city:i.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=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}},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return P}));var n=r(8),c=r.n(n),o=r(6),i=r.n(o),a=r(7),s=r(0),u=r(25),d=r(14),l=r(26),p=r(211),f=r(368),b=r(76),v=r(367),O=function(e){var t=e.detail;t&&t.preserveCartData||Object(d.dispatch)(u.CART_STORE_KEY).invalidateResolutionForStore()},_=function(){1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=function(){Object(s.useEffect)((function(){return function(){if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:function(){}}),!window.wcBlocksStoreCartListeners.count){var e=Object(v.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(v.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",O),document.body.addEventListener("wc-blocks_removed_from_cart",O),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=function(){e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",O),document.body.removeEventListener("wc-blocks_removed_from_cart",O)}}window.wcBlocksStoreCartListeners.count++}(),_}),[])};function g(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 y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},w=y(y({},h),{},{email:""}),j={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:""},E=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(l.decodeEntities)(n)]})))},C={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:j,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:w,shippingAddress:h,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.b)(),r=t.isEditor,n=t.previewData,c=null==n?void 0:n.previewCart,o=e.shouldSelect,i=Object(s.useRef)();m();var l=Object(d.useSelect)((function(e,t){var n=t.dispatch;if(!o)return C;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:w,shippingAddress:h,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 i=e(u.CART_STORE_KEY),a=i.getCartData(),s=i.getCartErrors(),d=i.getCartTotals(),l=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,v=E(a.billingAddress),O=a.needsShipping?E(a.shippingAddress):v,_=a.fees.length>0?a.fees.map((function(e){return E(e)})):u.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return y(y({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:_,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:l,cartErrors:s,billingAddress:Object(f.a)(v),shippingAddress:Object(f.a)(O),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[o]);return i.current&&Object(a.isEqual)(i.current,l)||(i.current=l),i.current}},76:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a}));var n=r(0),c=r(14),o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:function(){}}),i=function(){return Object(n.useContext)(o)},a=function(e){var t=e.children,r=e.currentPostId,i=void 0===r?0:r,a=e.currentView,s=void 0===a?"":a,u=e.previewData,d=void 0===u?{}:u,l=Object(c.useSelect)((function(e){return i||e("core/editor").getCurrentPostId()}),[i]),p=Object(n.useCallback)((function(e){return e in d?d[e]:{}}),[d]),f={isEditor:!0,currentPostId:l,currentView:s,previewData:d,getPreviewData:p};return Object(n.createElement)(o.Provider,{value:f},t)}},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(6),c=r.n(n),o=r(51),i=r(0),a=r(52);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 d=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(o.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(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}}}]);
|
build/atomic-block-components/add-to-cart--atomic-block-components/button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{174:function(e,t,n){"use strict";n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return y}));var c=n(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{174:function(e,t,n){"use strict";n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return y}));var c=n(6),r=n.n(c),o=n(8),i=n.n(o),s=n(0),u=(n(2),n(14)),a=n(78),f=n(76),d=n(10),l=n.n(d),b=n(5),v=n.n(b),O=n(885),p=(n(221),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""}),j=function(e){var t=e.className,n=e.notices,c=e.removeNotice,r=n.filter((function(e){return"snackbar"!==e.type}));if(!r.length)return null;var o=v()(t,"wc-block-components-notices");return Object(s.createElement)("div",{className:o},r.map((function(e){return Object(s.createElement)(O.a,l()({key:"store-notice-"+e.id},e,{className:v()("wc-block-components-notices__notice",p(e)),onRemove:function(){e.isDismissible&&c(e.id)}}),e.content)})))};function m(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=Object(s.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(s.useContext)(h)},y=function(e){var t=e.children,n=e.className,c=void 0===n?"":n,r=e.createNoticeContainer,o=void 0===r||r,d=e.context,l=void 0===d?"wc/core":d,b=Object(u.useDispatch)("core/notices"),v=b.createNotice,O=b.removeNotice,p=Object(s.useState)(!1),m=i()(p,2),w=m[0],y=m[1],N=Object(a.a)().dispatchStoreEvent,E=Object(f.b)().isEditor,P=Object(s.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v(e,t,g(g({},n),{},{context:n.context||l})),N("store-notice-create",{status:e,content:t,options:n})}),[v,N,l]),S=Object(s.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;O(e,t)}),[O,l]),D={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:P,removeNotice:S,context:l,setIsSuppressed:y},k=w?null:Object(s.createElement)(j,{className:c,notices:D.notices,removeNotice:D.removeNotice,isEditor:E});return Object(s.createElement)(h.Provider,{value:D},o&&k,t)}},221:function(e,t){},67:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(6),r=n.n(c),o=n(0),i=n(174);function s(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 u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a=function(){var e=Object(i.b)(),t=e.notices,n=e.createNotice,c=e.removeNotice,r=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var a=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||c(t.id)}))},removeNotice:c}}),[c]),f=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,u({},t))}}}),[n]);return u(u(u({notices:t},a),f),{},{setIsSuppressed:r})}},776:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(8),r=n.n(c),o=n(0),i=n(14),s=n(25),u=n(26),a=n(52),f=n(67),d=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},l=function(e){var t=Object(i.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(a.a)(),c=n.cartItems,l=n.cartIsLoading,b=Object(f.a)(),v=b.addErrorNotice,O=b.removeNotice,p=Object(o.useState)(!1),j=r()(p,2),m=j[0],g=j[1],h=Object(o.useRef)(d(c,e));return Object(o.useEffect)((function(){var t=d(c,e);t!==h.current&&(h.current=t)}),[c,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:m,cartIsLoading:l,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,n).then((function(){O("add-to-cart")})).catch((function(e){v(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}}}]);
|
build/atomic-block-components/add-to-cart-frontend.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{126:function(e,t,r){"use strict";r(155),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},155:function(e,t){},157:function(e,t,r){"use strict";var n=r(20),c=r.n(n),o=r(26),a=r.n(o),s=r(81),i=r(7),u=r.n(i),l=r(126),f=(r(204),["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))}},171: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(5),a=r.n(o),s=r(26),i=r.n(s),u=r(4),l=r.n(u),f=r(0),d=r(6),b=r(19),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)}},176:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(99),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))}}}},178: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(35),a=r.n(o),s=r(24),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(43);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)}}()},204:function(e,t){},281:function(e,t){},292:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r(8);var n=r(171),c=(r(281),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))})},332:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(4),c=r.n(n),o=r(0),a=r(11),s=r(9),i=r(32),u=r(33),l=r(51),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)}))}}}},338:function(e,t){},339:function(e,t,r){"use strict";var n=r(44),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},340:function(e,t){},390:function(e,t,r){"use strict";r.r(t);var n=r(154),c=(r(8),r(7)),o=r.n(c),a=r(4),s=r.n(a),i=r(0),u=r(1),l=r(45),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(5),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(99),j=r(176),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(178),_=r(171),P=r(51),k=r(43),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(59),N=r.n(S),D=r(32),x=r(33);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(84),F=r(6),B=(r(338),r(157)),L=r(128),M=r(339),Q=r(52),W=r(332),H=function(e){var t=e.className,r=e.href,n=e.text,c=e.onClick;return React.createElement(B.a,{className:t,href:r,onClick:c,rel:"nofollow"},n)},K=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,c=e.isDisabled,o=e.isDone,a=e.onClick;return React.createElement(B.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(L.a,{srcElement:M.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(Q.a)().dispatchStoreEvent,v=Object(W.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(K,{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(H,{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))},J=(r(340),r(42)),X=r.n(J),$=r(391),Z=r(3),ee=r(292),te={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},re=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(Z.useEffect)((function(){a?v(O):p(m()({},O,{message:f,hidden:!0}))}),[a,O,f,v,p]),Object(Z.useEffect)((function(){return function(){v(O)}}),[O,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement($.a,{label:Object(D.decodeEntities)(t),value:a||"",options:[te].concat(X()(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(ee.a,{propertyName:O,elementId:O}))},ne=r(66);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.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=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(){if(!y){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&&O(ie({},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 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(re,{key:e,attributeName:e,options:E[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(317),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(n.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.withFilteredAttributes)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(Oe)},43: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(66);!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}}},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(19),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},51: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(100);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})}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,c=r(5),o=r.n(c),a=r(6);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],{126:function(e,t,r){"use strict";r(156),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},156:function(e,t){},157:function(e,t,r){"use strict";var n=r(20),c=r.n(n),o=r(26),a=r.n(o),s=r(81),i=r(7),u=r.n(i),l=r(126),f=(r(204),["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))}},171: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(5),a=r.n(o),s=r(26),i=r.n(s),u=r(4),l=r.n(u),f=r(0),d=r(6),b=r(19),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)}},176:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(99),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))}}}},178: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(35),a=r.n(o),s=r(24),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(43);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)}}()},204:function(e,t){},281:function(e,t){},292:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r(8);var n=r(171),c=(r(281),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))})},332:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(4),c=r.n(n),o=r(0),a=r(11),s=r(9),i=r(32),u=r(33),l=r(51),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)}))}}}},338:function(e,t){},339:function(e,t,r){"use strict";var n=r(44),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},340:function(e,t){},390:function(e,t,r){"use strict";r.r(t);var n=r(154),c=(r(8),r(7)),o=r.n(c),a=r(4),s=r.n(a),i=r(0),u=r(1),l=r(45),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(5),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(99),j=r(176),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(178),_=r(171),P=r(51),k=r(43),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(59),N=r.n(S),D=r(32),x=r(33);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(84),F=r(6),B=(r(338),r(157)),L=r(128),M=r(339),Q=r(52),W=r(332),H=function(e){var t=e.className,r=e.href,n=e.text,c=e.onClick;return React.createElement(B.a,{className:t,href:r,onClick:c,rel:"nofollow"},n)},K=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,c=e.isDisabled,o=e.isDone,a=e.onClick;return React.createElement(B.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(L.a,{srcElement:M.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(Q.a)().dispatchStoreEvent,v=Object(W.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(K,{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(H,{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))},J=(r(340),r(42)),X=r.n(J),$=r(391),Z=r(3),ee=r(292),te={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},re=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(Z.useEffect)((function(){a?v(O):p(m()({},O,{message:f,hidden:!0}))}),[a,O,f,v,p]),Object(Z.useEffect)((function(){return function(){v(O)}}),[O,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement($.a,{label:Object(D.decodeEntities)(t),value:a||"",options:[te].concat(X()(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(ee.a,{propertyName:O,elementId:O}))},ne=r(66);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.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=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(){if(!y){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&&O(ie({},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 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(re,{key:e,attributeName:e,options:E[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(317),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(n.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.withFilteredAttributes)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(Oe)},43: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(66);!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}}},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(19),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},51: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(100);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})}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,c=r(5),o=r.n(c),a=r(6);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([[7],{109:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),s=r(0),i=r(185),u=r(6),l=r.n(u),b=r(134),f=(r(222),["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))}},134:function(e,t,r){"use strict";var n=r(0);r(223),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},142: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))}}},148:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(43),c=r.n(n),o=r(5),a=r.n(o),s=r(21),i=r.n(s),u=r(8),l=r.n(u),b=r(0),f=r(7),d=r(36),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)}},222:function(e,t){},223:function(e,t){},224:function(e,t){},275:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(148)),o=(r(224),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))})},365:function(e,t){},372:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(142),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))}}}},373:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},374: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(58),l=r(878),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(142),g=r(372),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(375),_=r(148),w=r(67),P=r(64),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){}}}),A=function(){return Object(n.useContext)(k)},C=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],A=Object(u.a)(v),C=Object(w.a)(),S=C.addErrorNotice,x=C.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)(A,"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,A]),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)(A,"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)(A,"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,A]);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(26),N=r(52);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=A(),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 C=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&&C()}),[P,C,y]),null},T=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(_.a,null,Object(n.createElement)(C,{product:r,showFormElements:c},t,Object(n.createElement)(R,null)))},q=r(41),F=r(7),B=r(81),I=(r(365),r(109)),L=r(61),M=r(550),Q=r(78),W=r(776),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=A(),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=A(),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(549),r(34)),X=r.n(Y),$=r(895),Z=r(11),ee=r(275),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(117);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=A(),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(888),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=A(),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)))}))},375:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(43),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(64);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)}}()},549:function(e,t){},550:function(e,t,r){"use strict";var n=r(0),c=r(27),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},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(36),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},64: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(117);!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}}},878: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")}},900:function(e,t,r){"use strict";r.r(t);var n=r(81),c=r(374),o=r(373);t.default=Object(n.withFilteredAttributes)(o.a)(c.a)}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{108:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(21),a=r.n(o),s=r(0),i=r(185),u=r(5),l=r.n(u),b=r(134),f=(r(222),["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))}},134:function(e,t,r){"use strict";var n=r(0);r(223),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(6),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))}}},148:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(43),c=r.n(n),o=r(6),a=r.n(o),s=r(21),i=r.n(s),u=r(8),l=r.n(u),b=r(0),f=r(7),d=r(36),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)}},222:function(e,t){},223:function(e,t){},224:function(e,t){},275:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(148)),o=(r(224),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))})},364:function(e,t){},371:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(142),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))}}}},372:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},373:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(5)),o=r.n(c),a=r(8),s=r.n(a),i=r(1),u=r(58),l=r(876),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(6),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(142),g=r(371),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(374),_=r(148),w=r(67),P=r(64),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){}}}),A=function(){return Object(n.useContext)(k)},C=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],A=Object(u.a)(v),C=Object(w.a)(),S=C.addErrorNotice,x=C.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)(A,"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,A]),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)(A,"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)(A,"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,A]);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(26),N=r(52);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=A(),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 C=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&&C()}),[P,C,y]),null},T=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(_.a,null,Object(n.createElement)(C,{product:r,showFormElements:c},t,Object(n.createElement)(R,null)))},q=r(41),F=r(7),B=r(81),I=(r(364),r(108)),L=r(62),M=r(550),Q=r(78),W=r(776),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=A(),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=A(),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(549),r(34)),X=r.n(Y),$=r(893),Z=r(11),ee=r(275),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(117);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=A(),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(886),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=A(),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)))}))},374:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(43),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(64);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)}}()},549:function(e,t){},550:function(e,t,r){"use strict";var n=r(0),c=r(27),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},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(36),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},64: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(117);!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}}},876: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")}},898:function(e,t,r){"use strict";r.r(t);var n=r(81),c=r(373),o=r(372);t.default=Object(n.withFilteredAttributes)(o.a)(c.a)}}]);
|
build/atomic-block-components/button.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{
|
2 |
/* translators: %s number of products in cart. */
|
3 |
Object(i._n)("%d in cart","%d in cart",m,"woo-gutenberg-products-block"),m):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(i.__)("Add to cart","woo-gutenberg-products-block")),h=v?"button":"a",g={};return v?g.onClick=function(){O(),k("cart-add-item",{product:o})}:(g.href=e,g.rel="nofollow",g.onClick=function(){k("product-view-link",{product:o})}),Object(r.createElement)(h,n()({"aria-label":C,className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:f}),disabled:j},g),E)}),m=function(){return Object(r.createElement)("button",{className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};o.default=Object(k.withProductDataContext)((function(t){var o=t.className,c=Object(_.useInnerBlockLayoutContext)().parentClassName,e=Object(_.useProductDataContext)().product;return Object(r.createElement)("div",{className:b()(o,"wp-block-button","wc-block-components-product-button",d()({},"".concat(c,"__product-add-to-cart"),c))},e.id?Object(r.createElement)(w,{product:e}):Object(r.createElement)(m,null))}))},543:function(t,o){}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{477:function(t,o,c){"use strict";c.r(o);var e=c(10),n=c.n(e),a=c(6),d=c.n(a),r=c(0),u=(c(2),c(5)),b=c.n(u),i=c(1),l=c(78),s=c(776),p=c(26),_=c(41),k=c(81),w=(c(543),function(t){var o=t.product,c=o.id,e=o.permalink,a=o.add_to_cart,d=o.has_options,u=o.is_purchasable,_=o.is_in_stock,k=Object(l.a)().dispatchStoreEvent,w=Object(s.a)(c),m=w.cartQuantity,j=w.addingToCart,O=w.addToCart,f=Number.isFinite(m)&&m>0,v=!d&&u&&_,C=Object(p.decodeEntities)((null==a?void 0:a.description)||""),E=f?Object(i.sprintf)(
|
2 |
/* translators: %s number of products in cart. */
|
3 |
Object(i._n)("%d in cart","%d in cart",m,"woo-gutenberg-products-block"),m):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(i.__)("Add to cart","woo-gutenberg-products-block")),h=v?"button":"a",g={};return v?g.onClick=function(){O(),k("cart-add-item",{product:o})}:(g.href=e,g.rel="nofollow",g.onClick=function(){k("product-view-link",{product:o})}),Object(r.createElement)(h,n()({"aria-label":C,className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:f}),disabled:j},g),E)}),m=function(){return Object(r.createElement)("button",{className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};o.default=Object(k.withProductDataContext)((function(t){var o=t.className,c=Object(_.useInnerBlockLayoutContext)().parentClassName,e=Object(_.useProductDataContext)().product;return Object(r.createElement)("div",{className:b()(o,"wp-block-button","wc-block-components-product-button",d()({},"".concat(c,"__product-add-to-cart"),c))},e.id?Object(r.createElement)(w,{product:e}):Object(r.createElement)(m,null))}))},543:function(t,o){}}]);
|
build/atomic-block-components/category-list.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{482:function(e,t,c){"use strict";c.r(t);var n=c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{482:function(e,t,c){"use strict";c.r(t);var n=c(6),o=c.n(n),a=c(0),r=c(1),s=c(5),l=c.n(s),u=c(41),i=c(7),b=c(81);c(546),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,c=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(i.isEmpty)(n.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",o()({},"".concat(c,"__product-category-list"),c))},Object(r.__)("Categories:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,c=e.link,n=e.slug;return Object(a.createElement)("li",{key:"category-list-item-".concat(n)},Object(a.createElement)("a",{href:c},t))}))))}))},546:function(e,t){}}]);
|
build/atomic-block-components/image.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{
|
2 |
/* translators: %s is referring to the product name */
|
3 |
-
Object(u.__)("Link to %s","woo-gutenberg-products-block"),j.name),C=w(w({href:j.permalink,rel:"nofollow"},!L&&{"aria-label":B}),{},{onClick:function(){S("product-view-link",{product:j})}});return Object(s.createElement)("div",{className:b()(t,"wc-block-components-product-image",o()({},"".concat(g,"__product-image"),g))},Object(s.createElement)(_,a&&C,!!i&&Object(s.createElement)(O.default,{align:p,product:j}),Object(s.createElement)(k,{fallbackAlt:j.name,image:z,onLoad:function(){return P(!0)},loaded:E,showFullSize:"cropped"!==n})))}))},541:function(e,t){},
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{369:function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},370:function(e,t,c){"use strict";var n=c(10),r=c.n(n),a=c(6),o=c.n(a),i=c(8),l=c.n(i),s=c(0),u=(c(2),c(1)),d=c(5),b=c.n(d),p=c(4),m=c(41),g=c(81),f=c(78),O=c(273);function j(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function w(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?j(Object(c),!0).forEach((function(t){o()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):j(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}c(541);var h=function(){return Object(s.createElement)("img",{src:p.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},k=function(e){var t=e.image,c=e.onLoad,n=e.loaded,a=e.showFullSize,o=e.fallbackAlt,i=t||{},l=i.thumbnail,u=i.src,d=i.srcset,b=i.sizes,p=w({alt:i.alt||o,onLoad:c,hidden:!n,src:l},a&&{src:u,srcSet:d,sizes:b});return Object(s.createElement)(s.Fragment,null,p.src&&Object(s.createElement)("img",r()({"data-testid":"product-image"},p)),!n&&Object(s.createElement)(h,null))};t.a=Object(g.withProductDataContext)((function(e){var t=e.className,c=e.imageSizing,n=void 0===c?"full-size":c,r=e.showProductLink,a=void 0===r||r,i=e.showSaleBadge,d=e.saleBadgeAlign,p=void 0===d?"right":d,g=Object(m.useInnerBlockLayoutContext)().parentClassName,j=Object(m.useProductDataContext)().product,v=Object(s.useState)(!1),y=l()(v,2),E=y[0],P=y[1],S=Object(f.a)().dispatchStoreEvent;if(!j.id)return Object(s.createElement)("div",{className:b()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",o()({},"".concat(g,"__product-image"),g))},Object(s.createElement)(h,null));var L=!!j.images.length,z=L?j.images[0]:null,_=a?"a":s.Fragment,B=Object(u.sprintf)(
|
2 |
/* translators: %s is referring to the product name */
|
3 |
+
Object(u.__)("Link to %s","woo-gutenberg-products-block"),j.name),C=w(w({href:j.permalink,rel:"nofollow"},!L&&{"aria-label":B}),{},{onClick:function(){S("product-view-link",{product:j})}});return Object(s.createElement)("div",{className:b()(t,"wc-block-components-product-image",o()({},"".concat(g,"__product-image"),g))},Object(s.createElement)(_,a&&C,!!i&&Object(s.createElement)(O.default,{align:p,product:j}),Object(s.createElement)(k,{fallbackAlt:j.name,image:z,onLoad:function(){return P(!0)},loaded:E,showFullSize:"cropped"!==n})))}))},541:function(e,t){},896:function(e,t,c){"use strict";c.r(t);var n=c(81),r=c(370),a=c(369);t.default=Object(n.withFilteredAttributes)(a.a)(r.a)}}]);
|
build/atomic-block-components/price-frontend.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{
|
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}))}},207:function(e,r){},327:function(e,r,c){"use strict";c.d(r,"a",(function(){return a})),c(219);var t=c(104),a=function(){return t.m>1}},373:function(e,r,c){"use strict";c.r(r);var t=c(5),a=c.n(t),n=(c(8),c(7)),o=c.n(n),l=c(159),i=c(60),u=c(84),s=c(218),p=c(327),m=c(154);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:{}})}))},85:function(e,r,c){"use strict";var t=c(20),a=c.n(t),n=c(5),o=c.n(n),l=c(26),i=c.n(l),u=c(127),s=c(7),p=c.n(s),m=(c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{155:function(e,r){},159:function(e,r,c){"use strict";var t=c(5),a=c.n(t),n=c(1),o=c(85),l=c(7),i=c.n(l),u=(c(8),c(60)),s=c(0),p=(c(207),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}))}},207:function(e,r){},327:function(e,r,c){"use strict";c.d(r,"a",(function(){return a})),c(219);var t=c(104),a=function(){return t.m>1}},373:function(e,r,c){"use strict";c.r(r);var t=c(5),a=c.n(t),n=(c(8),c(7)),o=c.n(n),l=c(159),i=c(60),u=c(84),s=c(218),p=c(327),m=c(154);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:{}})}))},85:function(e,r,c){"use strict";var t=c(20),a=c.n(t),n=c(5),o=c.n(n),l=c(26),i=c.n(l),u=c(127),s=c(7),p=c.n(s),m=(c(155),["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/price.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{140:function(e,r,c){"use strict";var t=c(
|
2 |
/* translators: %1$s min price, %2$s max price */
|
3 |
-
Object(o.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(u.formatPrice)(t),Object(u.formatPrice)(c))),Object(n.createElement)("span",{"aria-hidden":!0},Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",a),currency:r,value:t,style:i})," — ",Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",a),currency:r,value:c,style:i})))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,i=e.priceClassName,u=e.priceStyle,p=e.price;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e)},value:p}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,o=e.format,i=void 0===o?"<price/>":o,u=e.maxPrice,b=void 0===u?null:u,d=e.minPrice,O=void 0===d?null:d,f=e.price,j=void 0===f?null:f,y=e.priceClassName,g=e.priceStyle,v=e.regularPrice,_=e.regularPriceClassName,P=e.regularPriceStyle,N=s()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=v&&j!==v,S=Object(n.createElement)("span",{className:s()("wc-block-components-product-price__value",y)});return w?S=Object(n.createElement)(m,{currency:t,price:j,priceClassName:y,priceStyle:g,regularPrice:v,regularPriceClassName:_,regularPriceStyle:P}):null!==O&&null!==b?S=Object(n.createElement)(p,{currency:t,maxPrice:b,minPrice:O,priceClassName:y,priceStyle:g}):null!==j&&(S=Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",y),currency:t,value:j,style:g})),Object(n.createElement)("span",{className:N},Object(n.createInterpolateElement)(i,{price:S}))}},186:function(e,r){},220:function(e,r){},
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{140:function(e,r,c){"use strict";var t=c(6),a=c.n(t),n=c(0),o=c(1),l=c(59),i=c(5),s=c.n(i),u=(c(2),c(50)),p=(c(220),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,i=e.priceStyle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)(
|
2 |
/* translators: %1$s min price, %2$s max price */
|
3 |
+
Object(o.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(u.formatPrice)(t),Object(u.formatPrice)(c))),Object(n.createElement)("span",{"aria-hidden":!0},Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",a),currency:r,value:t,style:i})," — ",Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",a),currency:r,value:c,style:i})))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,i=e.priceClassName,u=e.priceStyle,p=e.price;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e)},value:p}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,o=e.format,i=void 0===o?"<price/>":o,u=e.maxPrice,b=void 0===u?null:u,d=e.minPrice,O=void 0===d?null:d,f=e.price,j=void 0===f?null:f,y=e.priceClassName,g=e.priceStyle,v=e.regularPrice,_=e.regularPriceClassName,P=e.regularPriceStyle,N=s()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=v&&j!==v,S=Object(n.createElement)("span",{className:s()("wc-block-components-product-price__value",y)});return w?S=Object(n.createElement)(m,{currency:t,price:j,priceClassName:y,priceStyle:g,regularPrice:v,regularPriceClassName:_,regularPriceStyle:P}):null!==O&&null!==b?S=Object(n.createElement)(p,{currency:t,maxPrice:b,minPrice:O,priceClassName:y,priceStyle:g}):null!==j&&(S=Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",y),currency:t,value:j,style:g})),Object(n.createElement)("span",{className:N},Object(n.createInterpolateElement)(i,{price:S}))}},186:function(e,r){},220:function(e,r){},475:function(e,r,c){"use strict";c.r(r);var t=c(6),a=c.n(t),n=c(0),o=(c(2),c(5)),l=c.n(o),i=c(140),s=c(50),u=c(41),p=c(12),m=c(116),b=c(81);r.default=Object(b.withProductDataContext)((function(e){var r,c,t,o,b,d,O,f=e.className,j=e.align,y=e.fontSize,g=e.customFontSize,v=e.saleFontSize,_=e.customSaleFontSize,P=e.color,N=e.customColor,w=e.saleColor,S=e.customSaleColor,C=Object(u.useInnerBlockLayoutContext)().parentClassName,E=Object(u.useProductDataContext)().product,x=l()(f,a()({},"".concat(C,"__product-price"),C));if(!E.id)return Object(n.createElement)(i.a,{align:j,className:x});var h=Object(p.getColorClassName)("color",P),k=Object(p.getFontSizeClass)(y),z=Object(p.getColorClassName)("color",w),F=Object(p.getFontSizeClass)(v),D=l()((r={"has-text-color":P||N,"has-font-size":y||g},a()(r,h,h),a()(r,k,k),r)),T=l()((c={"has-text-color":w||S,"has-font-size":v||_},a()(c,z,z),a()(c,F,F),c)),V={color:N,fontSize:g},B={color:S,fontSize:_},I=E.prices,U=Object(s.getCurrencyFromPriceResponse)(I),J=I.price!==I.regular_price,M=J?l()((t={},a()(t,"".concat(C,"__product-price__value"),C),a()(t,T,Object(m.b)()),t)):l()((o={},a()(o,"".concat(C,"__product-price__value"),C),a()(o,D,Object(m.b)()),o)),W=J?B:V;return Object(n.createElement)(i.a,{align:j,className:x,currency:U,price:I.price,priceClassName:M,priceStyle:Object(m.b)()?W:{},minPrice:null==I||null===(b=I.price_range)||void 0===b?void 0:b.min_amount,maxPrice:null==I||null===(d=I.price_range)||void 0===d?void 0:d.max_amount,regularPrice:I.regular_price,regularPriceClassName:l()((O={},a()(O,"".concat(C,"__product-price__regular"),C),a()(O,D,Object(m.b)()),O)),regularPriceStyle:Object(m.b)()?V:{}})}))},59:function(e,r,c){"use strict";var t=c(10),a=c.n(t),n=c(6),o=c.n(n),l=c(21),i=c.n(l),s=c(0),u=c(178),p=c(5),m=c.n(p),b=(c(186),["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 O(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,p=i()(e,b),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 j=m()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),y=O(O(O({},p),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}),g=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return Object(s.createElement)(u.a,a()({className:j,displayType:l},y,{value:f,onValueChange:g}))}}}]);
|
build/atomic-block-components/rating.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{
|
2 |
/* translators: %f is referring to the average rating value */
|
3 |
Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),s);return Object(r.createElement)("div",{className:u()(e,"wc-block-components-product-rating",n()({},"".concat(c,"__product-rating"),c))},Object(r.createElement)("div",{className:u()("wc-block-components-product-rating__stars","".concat(c,"__product-rating__stars")),role:"img","aria-label":b},Object(r.createElement)("span",{style:l},b)))}))},542:function(t,e){}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{476:function(t,e,c){"use strict";c.r(e);var a=c(6),n=c.n(a),r=c(0),o=(c(2),c(1)),s=c(5),u=c.n(s),i=c(41),l=c(81),p=(c(542),function(t){var e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0});e.default=Object(l.withProductDataContext)((function(t){var e=t.className,c=Object(i.useInnerBlockLayoutContext)().parentClassName,a=Object(i.useProductDataContext)().product,s=p(a);if(!s)return null;var l={width:s/5*100+"%"},b=Object(o.sprintf)(
|
2 |
/* translators: %f is referring to the average rating value */
|
3 |
Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),s);return Object(r.createElement)("div",{className:u()(e,"wc-block-components-product-rating",n()({},"".concat(c,"__product-rating"),c))},Object(r.createElement)("div",{className:u()("wc-block-components-product-rating__stars","".concat(c,"__product-rating__stars")),role:"img","aria-label":b},Object(r.createElement)("span",{style:l},b)))}))},542:function(t,e){}}]);
|
build/atomic-block-components/sale-badge.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{273:function(e,t,r){"use strict";r.r(t);var c=r(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{273:function(e,t,r){"use strict";r.r(t);var c=r(6),n=r.n(c),a=r(0),o=(r(2),r(1)),s=r(5),l=r.n(s),u=r(42),b=r(41),p=r(81);r(540),t.default=Object(p.withProductDataContext)((function(e){var t=e.className,r=e.align,c=Object(b.useInnerBlockLayoutContext)().parentClassName,s=Object(b.useProductDataContext)().product;if(!s.id||!s.on_sale)return null;var p="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(a.createElement)("div",{className:l()("wc-block-components-product-sale-badge",t,p,n()({},"".concat(c,"__product-onsale"),c))},Object(a.createElement)(u.a,{label:Object(o.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Product on sale","woo-gutenberg-products-block")}))}))},42:function(e,t,r){"use strict";var c=r(6),n=r.n(c),a=r(0),o=r(5),s=r.n(o);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,c)}return r}function u(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){n()(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}t.a=function(e){var t,r=e.label,c=e.screenReaderLabel,n=e.wrapperElement,o=e.wrapperProps,l=void 0===o?{}:o,b=null!=r,p=null!=c;return!b&&p?(t=n||"span",l=u(u({},l),{},{className:s()(l.className,"screen-reader-text")}),Object(a.createElement)(t,l,c)):(t=n||a.Fragment,b&&p&&r!==c?Object(a.createElement)(t,l,Object(a.createElement)("span",{"aria-hidden":"true"},r),Object(a.createElement)("span",{className:"screen-reader-text"},c)):Object(a.createElement)(t,l,r))}},540:function(e,t){}}]);
|
build/atomic-block-components/sku.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{481:function(t,c,e){"use strict";e.r(c);var n=e(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{481:function(t,c,e){"use strict";e.r(c);var n=e(6),o=e.n(n),u=e(0),s=e(1),a=(e(2),e(5)),r=e.n(a),l=e(41),b=e(81);e(545),c.default=Object(b.withProductDataContext)((function(t){var c=t.className,e=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product.sku;return n?Object(u.createElement)("div",{className:r()(c,"wc-block-components-product-sku",o()({},"".concat(e,"__product-sku"),e))},Object(s.__)("SKU:","woo-gutenberg-products-block")," ",Object(u.createElement)("strong",null,n)):null}))},545:function(t,c){}}]);
|
build/atomic-block-components/stock-indicator.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{484:function(o,c,t){"use strict";t.r(c);var n=t(
|
2 |
/* translators: %d stock amount (number of items in stock for product) */
|
3 |
Object(s.__)("%d left in stock","woo-gutenberg-products-block"),o)});c.default=Object(k.withProductDataContext)((function(o){var c,t=o.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var k=!!a.is_in_stock,d=a.low_stock_remaining,l=a.is_on_backorder;return Object(r.createElement)("div",{className:i()(t,"wc-block-components-product-stock-indicator",(c={},e()(c,"".concat(n,"__stock-indicator"),n),e()(c,"wc-block-components-product-stock-indicator--in-stock",k),e()(c,"wc-block-components-product-stock-indicator--out-of-stock",!k),e()(c,"wc-block-components-product-stock-indicator--low-stock",!!d),e()(c,"wc-block-components-product-stock-indicator--available-on-backorder",!!l),c))},d?b(d):function(o,c){return c?Object(s.__)("Available on backorder","woo-gutenberg-products-block"):o?Object(s.__)("In Stock","woo-gutenberg-products-block"):Object(s.__)("Out of Stock","woo-gutenberg-products-block")}(k,l))}))},548:function(o,c){}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{484:function(o,c,t){"use strict";t.r(c);var n=t(6),e=t.n(n),r=t(0),s=t(1),a=(t(2),t(5)),i=t.n(a),u=t(41),k=t(81),b=(t(548),function(o){return Object(s.sprintf)(
|
2 |
/* translators: %d stock amount (number of items in stock for product) */
|
3 |
Object(s.__)("%d left in stock","woo-gutenberg-products-block"),o)});c.default=Object(k.withProductDataContext)((function(o){var c,t=o.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var k=!!a.is_in_stock,d=a.low_stock_remaining,l=a.is_on_backorder;return Object(r.createElement)("div",{className:i()(t,"wc-block-components-product-stock-indicator",(c={},e()(c,"".concat(n,"__stock-indicator"),n),e()(c,"wc-block-components-product-stock-indicator--in-stock",k),e()(c,"wc-block-components-product-stock-indicator--out-of-stock",!k),e()(c,"wc-block-components-product-stock-indicator--low-stock",!!d),e()(c,"wc-block-components-product-stock-indicator--available-on-backorder",!!l),c))},d?b(d):function(o,c){return c?Object(s.__)("Available on backorder","woo-gutenberg-products-block"):o?Object(s.__)("In Stock","woo-gutenberg-products-block"):Object(s.__)("Out of Stock","woo-gutenberg-products-block")}(k,l))}))},548:function(o,c){}}]);
|
build/atomic-block-components/summary.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{175:function(t,e,c){"use strict";var n=c(0),r=c(135),o=c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{175:function(t,e,c){"use strict";var n=c(0),r=c(135),o=c(104),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]:"…",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]:"…",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)}},480:function(t,e,c){"use strict";c.r(e);var n=c(6),r=c.n(n),o=c(0),a=(c(2),c(5)),u=c.n(a),s=c(175),i=c(38),l=c(41),p=c(81);c(544),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}))},544:function(t,e){}}]);
|
build/atomic-block-components/tag-list.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{483:function(t,e,c){"use strict";c.r(e);var n=c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{483:function(t,e,c){"use strict";c.r(e);var n=c(6),a=c.n(n),o=c(0),s=c(1),l=(c(2),c(5)),u=c.n(l),r=c(41),i=c(7),b=c(81);c(547),e.default=Object(b.withProductDataContext)((function(t){var e=t.className,c=Object(r.useInnerBlockLayoutContext)().parentClassName,n=Object(r.useProductDataContext)().product;return Object(i.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-tag-list",a()({},"".concat(c,"__product-tag-list"),c))},Object(s.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(t){var e=t.name,c=t.link,n=t.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:c},e))}))))}))},547:function(t,e){}}]);
|
build/atomic-block-components/title.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{173:function(e,t,n){"use strict";var o=n(10),c=n.n(o),r=n(21),l=n.n(r),i=n(0),a=n(26),s=n(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{173:function(e,t,n){"use strict";var o=n(10),c=n.n(o),r=n(21),l=n.n(r),i=n(0),a=n(26),s=n(5),u=n.n(s),d=(n(219),["className","disabled","name","permalink","rel","style","onClick"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,o=e.disabled,r=void 0!==o&&o,s=e.name,p=e.permalink,b=void 0===p?"":p,m=e.rel,v=e.style,O=(e.onClick,l()(e,d)),f=u()("wc-block-components-product-name",n);if(r){var y=O;return Object(i.createElement)("span",c()({className:f},y,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(s)}}))}return Object(i.createElement)("a",c()({className:f,href:b,rel:m},O,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(s)},style:v}))}},219:function(e,t){},365:function(e,t,n){"use strict";var o=n(6),c=n.n(o),r=n(116);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(r.b)()&&(a=i(i({},a),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=a},366:function(e,t,n){"use strict";var o=n(6),c=n.n(o),r=n(21),l=n.n(r),i=n(0),a=n(5),s=n.n(a),u=n(41),d=n(12),p=n(116),b=n(81),m=n(173),v=n(78),O=(n(539),["children","headingLevel","elementType"]),f=function(e){var t=e.children,n=e.headingLevel,o=e.elementType,c=void 0===o?"h".concat(n):o,r=l()(e,O);return Object(i.createElement)(c,r,t)};t.a=Object(b.withProductDataContext)((function(e){var t,n,o,r,l,a,b,O=e.className,y=e.headingLevel,j=void 0===y?2:y,g=e.showProductLink,h=void 0===g||g,w=e.align,k=e.textColor,S=e.fontSize,C=e.style,P=Object(u.useInnerBlockLayoutContext)().parentClassName,E=Object(u.useProductDataContext)().product,L=Object(v.a)().dispatchStoreEvent,z=Object(d.getColorClassName)("color",k),N=Object(d.getFontSizeClass)(S),_=s()("wp-block-woocommerce-product-title",(o={"has-text-color":k||(null==C||null===(t=C.color)||void 0===t?void 0:t.text)||(null==C?void 0:C.color)},c()(o,"has-font-size",S||(null==C||null===(n=C.typography)||void 0===n?void 0:n.fontSize)||(null==C?void 0:C.fontSize)),c()(o,z,z),c()(o,N,N),o)),x={fontSize:(null==C?void 0:C.fontSize)||(null==C||null===(r=C.typography)||void 0===r?void 0:r.fontSize),color:(null==C||null===(l=C.color)||void 0===l?void 0:l.text)||(null==C?void 0:C.color)};return E.id?Object(i.createElement)(f,{headingLevel:j,className:s()(O,"wc-block-components-product-title",(a={},c()(a,"".concat(P,"__product-title"),P),c()(a,"wc-block-components-product-title--align-".concat(w),w&&Object(p.b)()),a))},Object(i.createElement)(m.a,{className:s()(c()({},_,Object(p.b)())),disabled:!h,name:E.name,permalink:E.permalink,rel:h?"nofollow":"",onClick:function(){L("product-view-link",{product:E})},style:Object(p.b)()?x:{}})):Object(i.createElement)(f,{headingLevel:j,className:s()(O,"wc-block-components-product-title",(b={},c()(b,"".concat(P,"__product-title"),P),c()(b,"wc-block-components-product-title--align-".concat(w),w&&Object(p.b)()),c()(b,_,Object(p.b)()),b))})}))},539:function(e,t){},897:function(e,t,n){"use strict";n.r(t);var o=n(81),c=n(366),r=n(365);t.default=Object(o.withFilteredAttributes)(r.a)(c.a)}}]);
|
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-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c7f5d2d95c6cd2f0f48b7addbf2534c9');
|
build/attribute-filter-frontend.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=231)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r=n(77),o=n(78),i=n(61),a=n(79);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},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.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 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)}()},function(e,t,n){e.exports=n(70)()},function(e,t){e.exports=window.wc.wcBlocksData},,function(e,t){e.exports=window.wp.data},,,,,,,,function(e,t){e.exports=window.wp.isShallowEqual},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){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=n(73);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},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.htmlEntities},,function(e,t){e.exports=window.wp.a11y},,,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,n){var r=n(67);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(21).default,o=n(27);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,n){var r=n(90),o=n(91),i=n(61),a=n(92);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(19),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";var r=n(37),o=n.n(r),i=n(38),a=n.n(i),u=n(27),c=n.n(u),s=n(39),l=n.n(s),p=n(40),d=n.n(p),f=n(29),m=n.n(f),b=n(5),g=n.n(b),h=(n(8),n(3)),v=n(1),y=n(104),w=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(72);var O=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(w,{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);O.defaultProps={showErrorMessage:!0},t.a=O},,,function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(0),a=n(7),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))}},,,,,,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},,,,,,function(e,t,n){var r=n(62);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){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,n){"use strict";var r=n(71);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}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},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,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(4),o=n.n(r),i=n(9),a=n(11),u=n(0),c=n(19),s=n.n(c),l=n(45),p=n(96),d=n(55),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]}},,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,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},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,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]}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(4),o=n.n(r),i=n(0),a=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},,,,,,,function(e,t,n){var r=n(62);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},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},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},function(e,t,n){"use strict";var r=n(1),o=n(49);n(162),t.a=function(e){var t=e.name,n=e.count;return React.createElement(React.Fragment,null,t,Number.isFinite(n)&&React.createElement(o.a,{label:n,screenReaderLabel:Object(r.sprintf)(
|
2 |
/* translators: %s number of products. */
|
3 |
-
Object(r._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}}
|
4 |
/* translators: %s is referring the remaining count of options */
|
5 |
Object(u._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(u.sprintf)(
|
6 |
/* translators: %s number of options to reveal. */
|
7 |
-
Object(u._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[s,v,O]),E=Object(c.useMemo)((function(){return O&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){x(!1)},"aria-expanded":!0,"aria-label":Object(u.__)("Show less options","woo-gutenberg-products-block")},Object(u.__)("Show less","woo-gutenberg-products-block")))}),[O]),I=Object(c.useMemo)((function(){var e=s.length>v+5;return React.createElement(React.Fragment,null,s.map((function(t,n){return React.createElement(c.Fragment,{key:t.value},React.createElement("li",e&&!O&&n>=v&&{hidden:!0},React.createElement("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:g}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===v-1&&j)})),e&&E)}),[s,r,d,O,v,E,j,g]),S=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":m},t);return React.createElement("ul",{className:S},m?_:I)}},,,,,,,,,,,,function(e,t){},,,,function(e,t){},function(e,t){},,,,function(e,t,n){"use strict";e.exports=n(234)},,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(5),o=n.n(r),i=n(42),a=n.n(i),u=n(21),c=n.n(u),s=n(4),l=n.n(s),p=n(0),d=n(118),f=n(6),m=n(45),b=n(75),g=n(102),h=n(55);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 w=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),w=l()(v,2),O=w[0],x=w[1],_=Object(b.b)("calculate_price_range",null,i),j=l()(_,2),E=j[0],I=j[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&&(O.find((function(e){return e.taxonomy===C.taxonomy}))||x([].concat(a()(O),[C])))}),[C,O,x]),Object(p.useEffect)((function(){E!==M&&void 0!==M&&I(M)}),[M,I,E]),Object(p.useEffect)((function(){R!==T&&void 0!==T&&P(T)}),[T,P,R]);var D=Object(p.useState)(!1),A=l()(D,2),N=A[0],H=A[1],
|
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"),j)}var E={"aria-label":n,disabled:d,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},I=v?E:{},S=v?{"aria-hidden":!0}:E;return React.createElement(f,o()({},x,I,{className:c()(i,"is-removable"),element:v?"button":x.element,screenReaderText:O,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})))}},,,,,,,,,,,function(e,t,n){e.exports=n(249)},function(e,t){},function(e,t){},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 w=Symbol.for;r=w("react.element"),o=w("react.portal"),i=w("react.fragment"),a=w("react.strict_mode"),u=w("react.profiler"),c=w("react.provider"),s=w("react.context"),l=w("react.forward_ref"),p=w("react.suspense"),d=w("react.suspense_list"),f=w("react.memo"),m=w("react.lazy"),b=w("react.block"),g=w("react.server.block"),h=w("react.fundamental"),v=w("react.debug_trace_mode"),y=w("react.legacy_hidden")}function O(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,j=l,E=i,I=m,S=f,k=o,R=u,P=a,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=_,t.ForwardRef=j,t.Fragment=E,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 O(e)===s},t.isContextProvider=function(e){return O(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return O(e)===l},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===m},t.isMemo=function(e){return O(e)===f},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===u},t.isStrictMode=function(e){return O(e)===a},t.isSuspense=function(e){return O(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=O},,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(95),o=n(5),i=n.n(o),a=n(4),u=n.n(a),c=n(1),s=n(34),l=n(45),p=n(96),d=n(75),f=n(102),m=n(179),b=n(0),g=n(146),h=n(8),v=n.n(h),y=n(7),w=n.n(y);function O(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 x(){return(x=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){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 E=n(3);function I(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function S(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function k(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return S(n.overflowY,t)||S(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 R(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(167);var P=function(){return(P=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 C=0;function M(e){return"function"==typeof e?e:T}function T(){}function D(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(!I(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,l=[],p=e;I(p)&&c(p);){if((p=p.parentElement)===s){l.push(p);break}null!=p&&p===document.body&&k(p)&&!k(document.documentElement)||null!=p&&k(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,w=g.right,O=g.bottom,x=g.left,_="start"===o||"nearest"===o?y:"end"===o?O:y+h/2,j="center"===i?x+v/2:"end"===i?w:x,E=[],S=0;S<l.length;S++){var P=l[S],C=P.getBoundingClientRect(),M=C.height,T=C.width,D=C.top,A=C.right,N=C.bottom,H=C.left;if("if-needed"===r&&y>=0&&x>=0&&O<=f&&w<=d&&y>=D&&O<=N&&x>=H&&w<=A)return E;var B=getComputedStyle(P),L=parseInt(B.borderLeftWidth,10),V=parseInt(B.borderTopWidth,10),K=parseInt(B.borderRightWidth,10),F=parseInt(B.borderBottomWidth,10),q=0,U=0,$="offsetWidth"in P?P.offsetWidth-P.clientWidth-L-K:0,W="offsetHeight"in P?P.offsetHeight-P.clientHeight-V-F:0;if(s===P)q="start"===o?_:"end"===o?_-f:"nearest"===o?R(b,b+f,f,V,F,b+_,b+_+h,h):_-f/2,U="start"===i?j:"center"===i?j-d/2:"end"===i?j-d:R(m,m+d,d,L,K,m+j,m+j+v,v),q=Math.max(0,q+b),U=Math.max(0,U+m);else{q="start"===o?_-D-V:"end"===o?_-N+F+W:"nearest"===o?R(D,N,M,V,F+W,_,_+h,h):_-(D+M/2)+W/2,U="start"===i?j-H-L:"center"===i?j-(H+T/2)+$/2:"end"===i?j-A+K+$:R(H,A,T,L,K+$,j,j+v,v);var G=P.scrollLeft,Y=P.scrollTop;_+=Y-(q=Math.max(0,Math.min(Y+q,P.scrollHeight-M+W))),j+=G-(U=Math.max(0,Math.min(G+U,P.scrollWidth-T+$)))}E.push({el:P,top:q,left:U})}return E}(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 A(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 H(){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 L(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 V(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function F(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function q(e,t){return void 0!==e[t]}function U(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function $(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=W(e,a,n,r,o);return-1===u?t>=n?-1:t:u}function W(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?W(1,0,n,r,!1):W(-1,n-1,n,r,!1):-1}function G(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(A(t,e,n)||r&&A(t,n.document.activeElement,n))}))}var Y=N((function(e){Q(e).textContent=""}),500);function z(e,t){var n=Q(t);e&&(n.textContent=e,Y(t))}function Q(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 X=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}),J=["refKey","ref"],Z=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],ee=["onKeyDown","onBlur","onChange","onInput","onChangeText"],te=["refKey","ref"],ne=["onMouseMove","onMouseDown","onClick","onPress","index","item"],re=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(C++),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=F(t),n.internalSetState(x({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=F(t),n.internalSetState(x({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,x({},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],q(n.props,e)||(c[e]=u[e]))})),a&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,x({},n.getStateAndHelpers(),u)),c}),(function(){M(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=O(o,J),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 x(((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=$(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=$(-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(x({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=x({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=x({},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=W(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=W(-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=O(t,Z),c=n.getState().isOpen,s={onClick:H(r,n.buttonHandleClick),onKeyDown:H(o,n.buttonHandleKeyDown),onKeyUp:H(i,n.buttonHandleKeyUp),onBlur:H(a,n.buttonHandleBlur)};return x({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=U(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(_(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 x({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=O(t,ee),s={},l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;return c.disabled||((u={}).onChange=H(i,a,n.inputHandleChange),u.onKeyDown=H(r,n.inputHandleKeyDown),u.onBlur=H(o,n.inputHandleBlur),s=u),x({"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=U(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(_(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=O(o,te),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=l,x(((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=O(r,ne);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var p=a,d=((t={onMouseMove:H(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:H(i,(function(e){e.preventDefault()}))}).onClick=H(p,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return x({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=F(e),n.internalSetState((function(t){var r=t.selectedItem;return x({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=F(e),n.internalSetState((function(t){var r=t.isOpen;return x({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),M(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(x({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,z(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]=q(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=$(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,w=this.clearSelection,O=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:w,clearItems:O,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,!G(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=G(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){q(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=V(this.props.children,T);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=V(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:function(e){return"string"==typeof e.type}(t)?Object(E.cloneElement)(t,this.getRootProps(function(e){return e.props}(t))):void 0:null},r}(E.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:L,itemToString:function(e){return null==e?"":String(e)},onStateChange:T,onInputValueChange:T,onUserAction:T,onChange:T,onSelect:T,onOuterClick:T,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:D},e.stateChangeTypes=X,e}();N((function(e,t){z(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect;var oe={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:D,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};v.a.array.isRequired,v.a.func,v.a.func,v.a.func,v.a.bool,v.a.number,v.a.number,v.a.number,v.a.bool,v.a.bool,v.a.bool,v.a.any,v.a.any,v.a.any,v.a.string,v.a.string,v.a.string,v.a.func,v.a.string,v.a.func,v.a.func,v.a.func,v.a.func,v.a.func,v.a.shape({addEventListener:v.a.func,removeEventListener:v.a.func,document:v.a.shape({getElementById:v.a.func,activeElement:v.a.any,body:v.a.any})}),P(P({},oe),{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.":""}}),v.a.array.isRequired,v.a.func,v.a.func,v.a.func,v.a.bool,v.a.number,v.a.number,v.a.number,v.a.bool,v.a.bool,v.a.bool,v.a.any,v.a.any,v.a.any,v.a.string,v.a.string,v.a.string,v.a.string,v.a.string,v.a.string,v.a.func,v.a.string,v.a.string,v.a.func,v.a.func,v.a.func,v.a.func,v.a.func,v.a.func,v.a.shape({addEventListener:v.a.func,removeEventListener:v.a.func,document:v.a.shape({getElementById:v.a.func,activeElement:v.a.any,body:v.a.any})}),x({},oe,{getA11yStatusMessage:L,circularNavigation:!0}),v.a.array,v.a.array,v.a.array,v.a.func,v.a.func,v.a.func,v.a.number,v.a.number,v.a.number,v.a.func,v.a.func,v.a.string,v.a.string,v.a.shape({addEventListener:v.a.func,removeEventListener:v.a.func,document:v.a.shape({getElementById:v.a.func,activeElement:v.a.any,body:v.a.any})});var ie=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}))},ae=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)},ue=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(c.sprintf)(
|
12 |
/* translators: %s is referring to the filter option being removed. */
|
13 |
Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},ce=n(220),se=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(ce.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(c.sprintf)(
|
14 |
/* translators: %s is referring to the filter option being removed. */
|
@@ -18,7 +18,7 @@ Object(c.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)
|
|
18 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
19 |
Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},React.createElement(le.a,{srcElement:pe.a,size:16})))};function fe(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 me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(233);var be=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,a=e.inputLabel,u=void 0===a?"":a,s=e.isDisabled,l=void 0!==s&&s,p=e.isLoading,d=void 0!==p&&p,f=e.multiple,m=void 0!==f&&f,g=e.onChange,h=void 0===g?function(){}:g,v=e.options,y=void 0===v?[]:v,O=Object(b.useRef)(null),x=w()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),_=Object(b.useCallback)((function(e,t){switch(t.type){case re.stateChangeTypes.keyDownEnter:case re.stateChangeTypes.clickItem:return me(me({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:m,inputValue:""});case re.stateChangeTypes.blurInput:case re.stateChangeTypes.mouseUp:return me(me({},t),{},{inputValue:e.inputValue});default:return t}}),[m]);return React.createElement(re,{onChange:h,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,a=e.getMenuProps,s=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:w()(x,{"is-multiple":m,"is-single":!m,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),u),React.createElement(ae,{isOpen:d,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return m?React.createElement(se,{key:e,onRemoveItem:n,option:t}):React.createElement(de,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ie,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&m?null:Object(c.sprintf)(
|
20 |
/* translators: %s attribute name. */
|
21 |
-
Object(c.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!m&&i.length>0?"-1":"0",value:p})),d&&!l&&React.createElement(ue,{checked:i,getItemProps:r,getMenuProps:a,highlightedIndex:s,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},ge=n(93),he=n(119),ve=n(19),ye=n.n(ve),we=n(32),Oe=n(125),xe=n(144),_e=n(145),je=[{value:"preview-1",name:"Blue",label:React.createElement(ge.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(ge.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(ge.a,{name:"Red",count:2})}],Ee={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function Ie(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 Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(232);Object(r.
|
22 |
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
|
23 |
Object(c.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o,i)):o?Object(s.speak)(Object(c.sprintf)(
|
24 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=231)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r=n(77),o=n(78),i=n(61),a=n(79);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},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.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 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)}()},function(e,t,n){e.exports=n(70)()},function(e,t){e.exports=window.wc.wcBlocksData},,function(e,t){e.exports=window.wp.data},,,,,,,,function(e,t){e.exports=window.wp.isShallowEqual},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){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=n(73);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},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.htmlEntities},,function(e,t){e.exports=window.wp.a11y},,,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,n){var r=n(67);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(21).default,o=n(27);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,n){var r=n(90),o=n(91),i=n(61),a=n(92);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(19),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";var r=n(37),o=n.n(r),i=n(38),a=n.n(i),u=n(27),c=n.n(u),s=n(39),l=n.n(s),p=n(40),d=n.n(p),f=n(29),m=n.n(f),b=n(5),g=n.n(b),h=(n(8),n(3)),v=n(1),y=n(104),w=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(72);var O=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(w,{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);O.defaultProps={showErrorMessage:!0},t.a=O},,,function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(0),a=n(7),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))}},,,,,,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},,,,,,function(e,t,n){var r=n(62);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){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,n){"use strict";var r=n(71);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}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},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,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(4),o=n.n(r),i=n(9),a=n(11),u=n(0),c=n(19),s=n.n(c),l=n(45),p=n(95),d=n(55),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]}},,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,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},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,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]}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(4),o=n.n(r),i=n(0),a=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},,,,,,,function(e,t,n){var r=n(62);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},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},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},function(e,t,n){"use strict";var r=n(1),o=n(49);n(162),t.a=function(e){var t=e.name,n=e.count;return React.createElement(React.Fragment,null,t,Number.isFinite(n)&&React.createElement(o.a,{label:n,screenReaderLabel:Object(r.sprintf)(
|
2 |
/* translators: %s number of products. */
|
3 |
+
Object(r._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(20),o=n.n(r),i=n(5),a=n.n(i),u=n(0),c=n(46);function s(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 l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=[".wp-block-woocommerce-cart"],d=function(e){var t=e.Block,n=e.containers,r=e.getProps,i=void 0===r?function(){return{}}:r,a=e.getErrorBoundaryProps,s=void 0===a?function(){return{}}:a;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=i(e,n),a=s(e,n),p=l(l({},e.dataset),r.attributes||{});e.classList.remove("is-loading"),Object(u.render)(React.createElement(c.a,a,React.createElement(u.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:p})))),e)}))},f=function(e){var t,n,r,o,i,a,u,c=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:c}),n=t.Block,r=t.getProps,o=t.getErrorBoundaryProps,i=t.selector,a=t.wrappers,u=document.body.querySelectorAll(i),a.length>0&&Array.prototype.filter.call(u,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,a)})),d({Block:n,containers:u,getProps:r,getErrorBoundaryProps:o}),Array.prototype.forEach.call(c,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,i,a,u;r=(n=l(l({},e),{},{wrapper:t})).Block,o=n.getProps,i=n.getErrorBoundaryProps,a=n.selector,u=n.wrapper.querySelectorAll(a),d({Block:r,containers:u,getProps:o,getErrorBoundaryProps:i})}))}))}},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}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),o=n(11),i=n(0),a=n(45),u=n(83),c=function(e){var t=e.namespace,n=e.resourceName,c=e.resourceValues,s=void 0===c?[]:c,l=e.query,p=void 0===l?{}:l,d=e.shouldSelect,f=void 0===d||d;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var m=Object(i.useRef)({results:[],isLoading:!0}),b=Object(a.a)(p),g=Object(a.a)(s),h=Object(u.a)(),v=Object(o.useSelect)((function(e){if(!f)return null;var o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,b,g],a=o.getCollectionError.apply(o,i);return a&&h(a),{results:o.getCollection.apply(o,i),isLoading:!o.hasFinishedResolution("getCollection",i)}}),[t,n,g,b,f]);return null!==v&&(m.current=v),m.current}},,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",{})},,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(80);function i(e,t){return e===t}function a(e,t,n){var a=n&&n.equalityFn?n.equalityFn:i,u=Object(r.useState)(e),c=u[0],s=u[1],l=Object(o.a)(Object(r.useCallback)((function(e){return s(e)}),[]),t,n),p=l[0],d=l[1],f=l[2],m=Object(r.useRef)(e);return Object(r.useEffect)((function(){a(m.current,e)||(p(e),m.current=e)}),[e,p,a]),[c,d,f]}},function(e,t,n){"use strict";var r=n(1),o=(n(8),n(7)),i=n.n(o),a=n(49),u=(n(130),function(e){var t=e.className,n=e.disabled,o=e.label,u=void 0===o?Object(r.__)("Go","woo-gutenberg-products-block"):o,c=e.onClick,s=e.screenReaderLabel,l=void 0===s?Object(r.__)("Apply filter","woo-gutenberg-products-block"):s;return React.createElement("button",{type:"submit",className:i()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:c},React.createElement(a.a,{label:u,screenReaderLabel:l}))});u.defaultProps={disabled:!1},t.a=u},,,,,,function(e,t){e.exports=window.wp.components},,,function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(26),a=n.n(i),u=n(0),c=["srcElement","size"];function s(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,i=a()(e,c);return Object(u.isValidElement)(t)?Object(u.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i)):null}},,function(e,t){},,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(2),o=Object(r.getSetting)("attributes",[]).reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(6),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),a=i.length?i[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var u=a.slug.filter((function(e){return e!==o})),c=e.filter((function(e){return e.attribute!==n.taxonomy}));u.length>0&&(a.slug=u.sort(),c.push(a)),t(Object(r.sortBy)(c,"attribute"))}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==n.taxonomy}));0===o.length?t(a):(a.push({attribute:n.taxonomy,operator:i,slug:o.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(a,"attribute")))}},function(e,t,n){"use strict";var r=n(42),o=n.n(r),i=n(4),a=n.n(i),u=n(1),c=(n(8),n(0)),s=n(7),l=n.n(s);n(163),t.a=function(e){var t=e.className,n=e.onChange,r=void 0===n?function(){}:n,i=e.options,s=void 0===i?[]:i,p=e.checked,d=void 0===p?[]:p,f=e.isLoading,m=void 0!==f&&f,b=e.isDisabled,g=void 0!==b&&b,h=e.limit,v=void 0===h?10:h,y=Object(c.useState)(!1),w=a()(y,2),O=w[0],x=w[1],_=Object(c.useMemo)((function(){return o()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),j=Object(c.useMemo)((function(){var e=s.length-v;return!O&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){x(!0)},"aria-expanded":!1,"aria-label":Object(u.sprintf)(
|
4 |
/* translators: %s is referring the remaining count of options */
|
5 |
Object(u._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(u.sprintf)(
|
6 |
/* translators: %s number of options to reveal. */
|
7 |
+
Object(u._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[s,v,O]),E=Object(c.useMemo)((function(){return O&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){x(!1)},"aria-expanded":!0,"aria-label":Object(u.__)("Show less options","woo-gutenberg-products-block")},Object(u.__)("Show less","woo-gutenberg-products-block")))}),[O]),I=Object(c.useMemo)((function(){var e=s.length>v+5;return React.createElement(React.Fragment,null,s.map((function(t,n){return React.createElement(c.Fragment,{key:t.value},React.createElement("li",e&&!O&&n>=v&&{hidden:!0},React.createElement("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:g}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===v-1&&j)})),e&&E)}),[s,r,d,O,v,E,j,g]),S=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":m},t);return React.createElement("ul",{className:S},m?_:I)}},,,,,,,,,,,,function(e,t){},,,,function(e,t){},function(e,t){},,,,function(e,t,n){"use strict";e.exports=n(234)},,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(5),o=n.n(r),i=n(42),a=n.n(i),u=n(21),c=n.n(u),s=n(4),l=n.n(s),p=n(0),d=n(118),f=n(6),m=n(45),b=n(75),g=n(102),h=n(55);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 w=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),w=l()(v,2),O=w[0],x=w[1],_=Object(b.b)("calculate_price_range",null,i),j=l()(_,2),E=j[0],I=j[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&&(O.find((function(e){return e.taxonomy===C.taxonomy}))||x([].concat(a()(O),[C])))}),[C,O,x]),Object(p.useEffect)((function(){E!==M&&void 0!==M&&I(M)}),[M,I,E]),Object(p.useEffect)((function(){R!==T&&void 0!==T&&P(T)}),[T,P,R]);var D=Object(p.useState)(!1),A=l()(D,2),N=A[0],H=A[1],L=Object(d.a)(N,200),B=l()(L,1)[0];N||H(!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})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(20),o=n.n(r),i=n(26),a=n.n(i),u=n(44),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},,,,,function(e,t,n){"use strict";var r=n(20),o=n.n(r),i=n(26),a=n.n(i),u=(n(8),n(7)),c=n.n(u),s=n(1),l=n(128),p=n(215),d=(n(158),["text","screenReaderText","element","className","radius","children"]),f=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,u=void 0===i?"li":i,s=e.className,l=void 0===s?"":s,p=e.radius,f=void 0===p?"small":p,m=e.children,b=void 0===m?null:m,g=a()(e,d),h=u,v=c()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),y=Boolean(r&&r!==t);return React.createElement(h,o()({className:v},g),React.createElement("span",{"aria-hidden":y,className:"wc-block-components-chip__text"},t),y&&React.createElement("span",{className:"screen-reader-text"},r),b)},m=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,i=void 0===r?"":r,u=e.disabled,d=void 0!==u&&u,b=e.onRemove,g=void 0===b?function(){}:b,h=e.removeOnAnyClick,v=void 0!==h&&h,y=e.text,w=e.screenReaderText,O=void 0===w?"":w,x=a()(e,m),_=v?"span":"button";if(!n){var j=O&&"string"==typeof O?O:y;n="string"!=typeof j?
|
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"),j)}var E={"aria-label":n,disabled:d,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},I=v?E:{},S=v?{"aria-hidden":!0}:E;return React.createElement(f,o()({},x,I,{className:c()(i,"is-removable"),element:v?"button":x.element,screenReaderText:O,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})))}},,,,,,,,,,,function(e,t,n){e.exports=n(249)},function(e,t){},function(e,t){},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 w=Symbol.for;r=w("react.element"),o=w("react.portal"),i=w("react.fragment"),a=w("react.strict_mode"),u=w("react.profiler"),c=w("react.provider"),s=w("react.context"),l=w("react.forward_ref"),p=w("react.suspense"),d=w("react.suspense_list"),f=w("react.memo"),m=w("react.lazy"),b=w("react.block"),g=w("react.server.block"),h=w("react.fundamental"),v=w("react.debug_trace_mode"),y=w("react.legacy_hidden")}function O(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,j=l,E=i,I=m,S=f,k=o,R=u,P=a,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=_,t.ForwardRef=j,t.Fragment=E,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 O(e)===s},t.isContextProvider=function(e){return O(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return O(e)===l},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===m},t.isMemo=function(e){return O(e)===f},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===u},t.isStrictMode=function(e){return O(e)===a},t.isSuspense=function(e){return O(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=O},,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(94),o=n(5),i=n.n(o),a=n(4),u=n.n(a),c=n(1),s=n(34),l=n(45),p=n(95),d=n(75),f=n(102),m=n(179),b=n(0),g=n(146),h=n(8),v=n.n(h),y=n(7),w=n.n(y);function O(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 x(){return(x=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){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 E=n(3);function I(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function S(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function k(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return S(n.overflowY,t)||S(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 R(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(167);var P=function(){return(P=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 C=0;function M(e){return"function"==typeof e?e:T}function T(){}function D(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(!I(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,l=[],p=e;I(p)&&c(p);){if((p=p.parentElement)===s){l.push(p);break}null!=p&&p===document.body&&k(p)&&!k(document.documentElement)||null!=p&&k(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,w=g.right,O=g.bottom,x=g.left,_="start"===o||"nearest"===o?y:"end"===o?O:y+h/2,j="center"===i?x+v/2:"end"===i?w:x,E=[],S=0;S<l.length;S++){var P=l[S],C=P.getBoundingClientRect(),M=C.height,T=C.width,D=C.top,A=C.right,N=C.bottom,H=C.left;if("if-needed"===r&&y>=0&&x>=0&&O<=f&&w<=d&&y>=D&&O<=N&&x>=H&&w<=A)return E;var L=getComputedStyle(P),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 P?P.offsetWidth-P.clientWidth-B-K:0,W="offsetHeight"in P?P.offsetHeight-P.clientHeight-V-F:0;if(s===P)q="start"===o?_:"end"===o?_-f:"nearest"===o?R(b,b+f,f,V,F,b+_,b+_+h,h):_-f/2,U="start"===i?j:"center"===i?j-d/2:"end"===i?j-d:R(m,m+d,d,B,K,m+j,m+j+v,v),q=Math.max(0,q+b),U=Math.max(0,U+m);else{q="start"===o?_-D-V:"end"===o?_-N+F+W:"nearest"===o?R(D,N,M,V,F+W,_,_+h,h):_-(D+M/2)+W/2,U="start"===i?j-H-B:"center"===i?j-(H+T/2)+$/2:"end"===i?j-A+K+$:R(H,A,T,B,K+$,j,j+v,v);var G=P.scrollLeft,Y=P.scrollTop;_+=Y-(q=Math.max(0,Math.min(Y+q,P.scrollHeight-M+W))),j+=G-(U=Math.max(0,Math.min(G+U,P.scrollWidth-T+$)))}E.push({el:P,top:q,left:U})}return E}(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 A(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 H(){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 L(){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 B(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 V(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function F(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function q(e,t){return void 0!==e[t]}function U(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function $(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=W(e,a,n,r,o);return-1===u?t>=n?-1:t:u}function W(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?W(1,0,n,r,!1):W(-1,n-1,n,r,!1):-1}function G(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(A(t,e,n)||r&&A(t,n.document.activeElement,n))}))}var Y=N((function(e){Q(e).textContent=""}),500);function z(e,t){var n=Q(t);e&&(n.textContent=e,Y(t))}function Q(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 X=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}),J=["refKey","ref"],Z=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],ee=["onKeyDown","onBlur","onChange","onInput","onChangeText"],te=["refKey","ref"],ne=["onMouseMove","onMouseDown","onClick","onPress","index","item"],re=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(C++),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=F(t),n.internalSetState(x({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=F(t),n.internalSetState(x({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,x({},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],q(n.props,e)||(c[e]=u[e]))})),a&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,x({},n.getStateAndHelpers(),u)),c}),(function(){M(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=O(o,J),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 x(((r={})[a]=L(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=$(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=$(-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(x({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=x({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=x({},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=W(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=W(-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=O(t,Z),c=n.getState().isOpen,s={onClick:H(r,n.buttonHandleClick),onKeyDown:H(o,n.buttonHandleKeyDown),onKeyUp:H(i,n.buttonHandleKeyUp),onBlur:H(a,n.buttonHandleBlur)};return x({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=U(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(_(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 x({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=O(t,ee),s={},l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;return c.disabled||((u={}).onChange=H(i,a,n.inputHandleChange),u.onKeyDown=H(r,n.inputHandleKeyDown),u.onBlur=H(o,n.inputHandleBlur),s=u),x({"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=U(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(_(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=O(o,te),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=l,x(((r={})[a]=L(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=O(r,ne);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var p=a,d=((t={onMouseMove:H(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:H(i,(function(e){e.preventDefault()}))}).onClick=H(p,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return x({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=F(e),n.internalSetState((function(t){var r=t.selectedItem;return x({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=F(e),n.internalSetState((function(t){var r=t.isOpen;return x({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),M(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(x({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,z(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]=q(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=$(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,w=this.clearSelection,O=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:w,clearItems:O,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,!G(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=G(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){q(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=V(this.props.children,T);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=V(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:function(e){return"string"==typeof e.type}(t)?Object(E.cloneElement)(t,this.getRootProps(function(e){return e.props}(t))):void 0:null},r}(E.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:B,itemToString:function(e){return null==e?"":String(e)},onStateChange:T,onInputValueChange:T,onUserAction:T,onChange:T,onSelect:T,onOuterClick:T,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:D},e.stateChangeTypes=X,e}();N((function(e,t){z(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect;var oe={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:D,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};v.a.array.isRequired,v.a.func,v.a.func,v.a.func,v.a.bool,v.a.number,v.a.number,v.a.number,v.a.bool,v.a.bool,v.a.bool,v.a.any,v.a.any,v.a.any,v.a.string,v.a.string,v.a.string,v.a.func,v.a.string,v.a.func,v.a.func,v.a.func,v.a.func,v.a.func,v.a.shape({addEventListener:v.a.func,removeEventListener:v.a.func,document:v.a.shape({getElementById:v.a.func,activeElement:v.a.any,body:v.a.any})}),P(P({},oe),{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.":""}}),v.a.array.isRequired,v.a.func,v.a.func,v.a.func,v.a.bool,v.a.number,v.a.number,v.a.number,v.a.bool,v.a.bool,v.a.bool,v.a.any,v.a.any,v.a.any,v.a.string,v.a.string,v.a.string,v.a.string,v.a.string,v.a.string,v.a.func,v.a.string,v.a.string,v.a.func,v.a.func,v.a.func,v.a.func,v.a.func,v.a.func,v.a.shape({addEventListener:v.a.func,removeEventListener:v.a.func,document:v.a.shape({getElementById:v.a.func,activeElement:v.a.any,body:v.a.any})}),x({},oe,{getA11yStatusMessage:B,circularNavigation:!0}),v.a.array,v.a.array,v.a.array,v.a.func,v.a.func,v.a.func,v.a.number,v.a.number,v.a.number,v.a.func,v.a.func,v.a.string,v.a.string,v.a.shape({addEventListener:v.a.func,removeEventListener:v.a.func,document:v.a.shape({getElementById:v.a.func,activeElement:v.a.any,body:v.a.any})});var ie=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}))},ae=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)},ue=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(c.sprintf)(
|
12 |
/* translators: %s is referring to the filter option being removed. */
|
13 |
Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},ce=n(220),se=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(ce.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(c.sprintf)(
|
14 |
/* translators: %s is referring to the filter option being removed. */
|
18 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
19 |
Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},React.createElement(le.a,{srcElement:pe.a,size:16})))};function fe(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 me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(233);var be=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,a=e.inputLabel,u=void 0===a?"":a,s=e.isDisabled,l=void 0!==s&&s,p=e.isLoading,d=void 0!==p&&p,f=e.multiple,m=void 0!==f&&f,g=e.onChange,h=void 0===g?function(){}:g,v=e.options,y=void 0===v?[]:v,O=Object(b.useRef)(null),x=w()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),_=Object(b.useCallback)((function(e,t){switch(t.type){case re.stateChangeTypes.keyDownEnter:case re.stateChangeTypes.clickItem:return me(me({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:m,inputValue:""});case re.stateChangeTypes.blurInput:case re.stateChangeTypes.mouseUp:return me(me({},t),{},{inputValue:e.inputValue});default:return t}}),[m]);return React.createElement(re,{onChange:h,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,a=e.getMenuProps,s=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:w()(x,{"is-multiple":m,"is-single":!m,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),u),React.createElement(ae,{isOpen:d,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return m?React.createElement(se,{key:e,onRemoveItem:n,option:t}):React.createElement(de,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ie,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&m?null:Object(c.sprintf)(
|
20 |
/* translators: %s attribute name. */
|
21 |
+
Object(c.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!m&&i.length>0?"-1":"0",value:p})),d&&!l&&React.createElement(ue,{checked:i,getItemProps:r,getMenuProps:a,highlightedIndex:s,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},ge=n(93),he=n(119),ve=n(19),ye=n.n(ve),we=n(32),Oe=n(125),xe=n(144),_e=n(145),je=[{value:"preview-1",name:"Blue",label:React.createElement(ge.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(ge.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(ge.a,{name:"Red",count:2})}],Ee={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function Ie(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 Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(232);Object(r.a)({selector:".wp-block-woocommerce-attribute-filter",Block:function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?Ee:Object(xe.a)(t.attributeId),i=Object(b.useState)([]),a=u()(i,2),h=a[0],v=a[1],y=Object(b.useState)(t.isPreview&&!t.attributeId?je:[]),w=u()(y,2),O=w[0],x=w[1],_=Object(d.a)(),j=u()(_,1)[0],E=Object(d.b)("attributes",[]),I=u()(E,2),S=I[0],k=I[1],R=Object(f.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[(null==o?void 0:o.id)||0],shouldSelect:t.attributeId>0}),P=R.results,C=R.isLoading,M="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(m.a)({queryAttribute:{taxonomy:null==o?void 0:o.taxonomy,queryType:t.queryType},queryState:Se(Se({},j),{},{attributes:M?j.attributes:null})}),D=T.results,A=T.isLoading,N=Object(b.useCallback)((function(e){return D.attribute_counts?D.attribute_counts.find((function(t){return t.term===e})):null}),[D]);Object(b.useEffect)((function(){if(!C&&!A){var e=P.map((function(e){var n,r=N(e.id);if(!(r||h.includes(e.slug)||(n=e.slug,null!=j&&j.attributes&&j.attributes.some((function(e){var t=e.attribute,r=e.slug,i=void 0===r?[]:r;return t===o.taxonomy&&i.includes(n)})))))return null;var i=r?r.count:0;return{value:e.slug,name:Object(we.decodeEntities)(e.name),label:React.createElement(ge.a,{name:Object(we.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);x(e)}}),[null==o?void 0:o.taxonomy,P,C,t.showCounts,A,N,h,j.attributes]);var H=Object(b.useMemo)((function(){return S.filter((function(e){return e.attribute===(null==o?void 0:o.taxonomy)})).flatMap((function(e){return e.slug}))}),[S,null==o?void 0:o.taxonomy]),L=Object(l.a)(H),B=Object(p.a)(L);Object(b.useEffect)((function(){ye()(B,L)||ye()(h,L)||(v(L),t.showFilterButton||K(L))}),[h,L,B,K,t.showFilterButton]);var V=Object(b.useCallback)((function(e){return P.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[P]),K=Object(b.useCallback)((function(e){r||Object(_e.b)(S,k,o,V(e),"or"===t.queryType?"in":"and")}),[r,S,k,o,V,t.queryType]),F="dropdown"!==t.displayStyle||"or"===t.queryType,q=Object(b.useCallback)((function(e){var n,r=function(e){return O.find((function(t){return t.value===e})).name},o=function(e){var t=e.filterAdded,n=e.filterRemoved,o=t?r(t):null,i=n?r(n):null;o&&i?Object(s.speak)(Object(c.sprintf)(
|
22 |
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
|
23 |
Object(c.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o,i)):o?Object(s.speak)(Object(c.sprintf)(
|
24 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
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' => '
|
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' => '82b053e5ce5dc545329bbf459fcab00d');
|
build/attribute-filter.js
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var r,a,l=t[0],i=t[1],u=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==c[i]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={18:0},o=[];function a(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,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},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 l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=i;return o.push([786,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},
|
2 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
3 |
-
Object(m.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,l=t.onChange;return Object(p.createElement)(O.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(v,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,l)}))})}}]),o}(p.Component);t.a=w},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},129:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(42);n(
|
4 |
/* translators: %s number of products. */
|
5 |
-
Object(c._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(20),a=n(1);n(194),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,l=e.heading,i=e.instanceId,u="h".concat(n);return Object(r.createElement)(u,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(i)},Object(a.__)("Block title","woo-gutenberg-products-block")),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(i),className:"wc-block-editor-components-title",value:l,onChange:o}))}))},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(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}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(25),c=n(14),o=n(0),a=n(58),l=n(127),i=function(e){var t=e.namespace,n=e.resourceName,i=e.resourceValues,u=void 0
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var r,a,l=t[0],i=t[1],u=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==c[i]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={18:0},o=[];function a(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,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},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 l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=i;return o.push([786,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},103:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return m}));var r=n(8),c=n.n(r),o=n(25),a=n(14),l=n(0),i=n(36),u=n.n(i),s=n(58),b=n(143),d=n(71),p=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(l.useCallback)((function(t){r(e,t)}),[e,r])]},f=function(e,t,n){var r=Object(d.a)();n=n||r;var c=Object(a.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),i=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(l.useCallback)((function(t){i(n,e,t)}),[n,e,i])]},m=function(e,t){var n=Object(d.a)(),r=p(t=t||n),o=c()(r,2),a=o[0],i=o[1],f=Object(s.a)(a),m=Object(s.a)(e),O=Object(b.a)(m),v=Object(l.useRef)(!1);return Object(l.useEffect)((function(){u()(O,m)||(i(Object.assign({},f,m)),v.current=!0)}),[f,m,O,i]),v.current?[a,i]:[e,i]}},11:function(e,t){e.exports=window.React},113:function(e,t){},114:function(e,t){e.exports=window.wp.coreData},115:function(e,t){},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(17),a=n.n(o),l=n(18),i=n.n(l),u=n(19),s=n.n(u),b=n(9),d=n.n(b),p=n(0),f=n(7),m=n(1),O=n(3);function v(e){var t=e.level,n={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 n.hasOwnProperty(t)?Object(p.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(O.Path,{d:n[t]})):null}var w=function(e){i()(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=d()(t);if(n){var c=d()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return s()(this,e)});function o(){return c()(this,o),r.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(v,{level:e}),title:Object(m.sprintf)(
|
2 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
3 |
+
Object(m.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,l=t.onChange;return Object(p.createElement)(O.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(v,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,l)}))})}}]),o}(p.Component);t.a=w},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},129:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(42);n(328),t.a=function(e){var t=e.name,n=e.count;return Object(r.createElement)(r.Fragment,null,t,Number.isFinite(n)&&Object(r.createElement)(o.a,{label:n,screenReaderLabel:Object(c.sprintf)(
|
4 |
/* translators: %s number of products. */
|
5 |
+
Object(c._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(20),a=n(1);n(194),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,l=e.heading,i=e.instanceId,u="h".concat(n);return Object(r.createElement)(u,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(i)},Object(a.__)("Block title","woo-gutenberg-products-block")),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(i),className:"wc-block-editor-components-title",value:l,onChange:o}))}))},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(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}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(25),c=n(14),o=n(0),a=n(58),l=n(127),i=function(e){var t=e.namespace,n=e.resourceName,i=e.resourceValues,u=void 0=
|