PluginProbe ʕ •ᴥ•ʔ
WooCommerce / 8.5.0-beta.1
WooCommerce v8.5.0-beta.1
10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 7.8.0-beta.1 7.8.0-beta.2 7.8.0-rc.1 7.8.0-rc.2 7.8.1 7.8.2 7.8.3 7.8.4 7.9.0 7.9.0-beta.1 7.9.0-beta.2 7.9.0-rc.2 7.9.0-rc.3 7.9.1 7.9.2 8.0.0 8.0.0-beta.1 8.0.0-beta.2 8.0.0-rc.1 8.0.0-rc.2 8.0.1 8.0.2 8.0.3 8.0.4 8.0.5 8.1.0 8.1.0-beta.1 8.1.0-rc.1 8.1.0-rc.2 8.1.1 8.1.2 8.1.3 8.1.4 8.2.0 8.2.0-beta.1 8.2.0-rc.1 8.2.0-rc.2 8.2.1 8.2.2 8.2.3 8.2.4 8.2.5 8.3.0 8.3.0-beta.1 8.3.0-rc.1 8.3.0-rc.2 8.3.1 8.3.2 8.3.3 8.3.4 8.4.0 8.4.0-beta.1 8.4.0-rc.1 8.4.1 8.4.2 8.4.3 8.5.0 8.5.0-beta.1 8.5.0-rc.1 8.5.1 8.5.2 8.5.3 8.5.4 8.5.5 8.6.0 8.6.0-beta.1 8.6.0-rc.1 8.6.1 8.6.2 8.6.3 8.6.4 8.7.0 8.7.0-beta.1 8.7.0-beta.2 8.7.0-rc.1 8.7.1 8.7.2 8.7.3 8.8.0 8.8.0-beta.1 8.8.0-rc.1 8.8.1 8.8.2 8.8.3 8.8.4 8.8.5 8.8.6 8.8.7 8.9.0 8.9.0-beta.1 8.9.0-rc.1 8.9.1 8.9.2 8.9.3 8.9.4 8.9.5 9.0.0 9.0.0-beta.1 9.0.0-beta.2 9.0.0-rc.1 9.0.1 9.0.2 9.0.3 9.0.4 9.1.0 9.1.0-beta.1 9.1.0-rc.1 9.1.1 9.1.2 9.1.3 9.1.4 9.1.5 9.1.6 9.2.0 9.2.0-beta.1 9.2.0-rc.1 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.3.0 9.3.0-beta.1 9.3.0-rc.1 9.3.1 9.3.2 9.3.3 9.3.4 9.3.5 9.3.6 9.4.0 9.4.0-beta.1 9.4.0-beta.2 9.4.0-rc.1 9.4.0-rc.2 9.4.0-rc.3 9.4.0-rc.4 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.5.0 9.5.0-beta.1 9.5.0-beta.2 9.5.0-rc.1 9.5.1 9.5.2 9.5.3 9.5.4 9.6.0 9.6.0-beta.1 9.6.0-beta.2 9.6.0-rc.1 9.6.1 9.6.2 9.6.3 9.6.4 9.7.0 9.7.0-beta.1 9.7.0-rc.1 9.7.1 9.7.2 9.7.3 9.8.0 9.8.0-beta.1 9.8.0-rc.1 9.8.1 9.8.2 9.8.3 9.8.4 9.8.5 9.8.6 9.8.7 9.9.0 9.9.0-beta.1 9.9.0-rc.1 9.9.1 9.9.2 9.9.3 9.9.4 9.9.5 9.9.6 9.9.7 3.7.3 7.1.2 3.8.0 7.2.0 3.8.0-beta.1 7.2.0-beta.1 3.8.0-rc.1 7.2.0-beta.2 3.8.0-rc.2 7.2.0-rc.1 3.8.1 7.2.0-rc.2 3.8.2 7.2.1 3.8.3 7.2.2 3.9.0 7.2.3 3.9.0-beta.1 7.2.4 3.9.0-beta.2 7.3.0 3.9.0-rc.1 7.3.0-beta.1 3.9.0-rc.2 7.3.0-beta.2 3.9.0-rc.3 7.3.0-rc.1 3.9.0-rc.4 7.3.0-rc.2 3.9.1 7.3.1 3.9.2 7.4.0 3.9.3 7.4.0-beta.1 3.9.4 7.4.0-beta.2 3.9.5 7.4.0-rc.1 4.0.0 7.4.0-rc.2 4.0.0-beta.1 7.4.1 4.0.0-rc.1 7.4.2 4.0.0-rc.2 7.5.0 4.0.1 7.5.0-beta.1 4.0.2 7.5.0-beta.2 4.0.3 7.5.0-rc.1 4.0.4 7.5.1 4.1.0 7.5.2 4.1.0-beta.1 7.6.0 4.1.0-beta.2 7.6.0-beta.1 4.1.0-rc.1 7.6.0-beta.2 4.1.0-rc.2 7.6.0-rc.1 4.1.1 7.6.0-rc.2 4.1.2 7.6.0-rc.3 4.1.3 7.6.1 4.1.4 7.6.2 4.2.0 7.7.0 4.2.0-RC.1 7.7.0-beta.1 4.2.0-RC.2 7.7.0-beta.2 4.2.0-beta.1 7.7.0-rc.1 4.2.1 7.7.1 4.2.2 7.7.2 4.2.3 7.7.3 4.2.4 7.8.0 4.2.5 4.3.0 4.3.0-beta.1 4.3.0-rc.1 4.3.0-rc.2 4.3.0-rc.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.4.0 4.4.0-beta.1 4.4.0-rc.1 4.4.1 4.4.2 4.4.3 4.4.4 4.5.0 4.5.0-beta.1 4.5.0-rc.1 4.5.0-rc.3 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.0-beta.1 4.6.0-rc.1 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.7.0 4.7.0-beta.1 4.7.0-beta.2 4.7.0-rc.1 4.7.1 4.7.1-beta.1 4.7.2 4.7.3 4.7.4 4.8.0 4.8.0-beta.1 4.8.0-rc.1 4.8.0-rc.2 4.8.1 4.8.2 4.8.3 4.9.0 4.9.0-beta.1 4.9.0-rc.1 4.9.0-rc.2 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 5.0.0 5.0.0-beta.1 5.0.0-beta.2 5.0.0-rc.1 5.0.0-rc.2 5.0.0-rc.3 5.0.1 5.0.2 5.0.3 5.1.0 5.1.0-beta.1 5.1.0-rc.1 trunk 5.1.1 10.0.0 5.1.2 10.0.0-rc.1 5.1.3 10.0.0-rc.2 5.2.0 10.0.1 5.2.0-beta.1 10.0.2 5.2.0-rc.1 10.0.3 5.2.0-rc.2 10.0.4 5.2.1 10.0.5 5.2.2 10.0.6 5.2.3 10.1.0 5.2.4 10.1.0-rc.1 5.2.5 10.1.0-rc.2 5.3.0 10.1.0-rc.3 5.3.0-beta.1 10.1.0-rc.4 5.3.0-rc.1 10.1.1 5.3.0-rc.2 10.1.2 5.3.1 10.1.3 5.3.2 10.1.4 5.3.3 10.2.0 5.4.0 10.2.0-beta.1 5.4.0-beta.1 10.2.0-beta.2 5.4.0-rc.1 10.2.0-rc.1 5.4.1 10.2.1 5.4.2 10.2.2 5.4.3 10.2.3 5.4.4 10.2.4 5.4.5 10.3.0 5.5.0 10.3.0-beta.1 5.5.0-beta.1 10.3.0-beta.2 5.5.0-rc.1 10.3.0-rc.1 5.5.0-rc.2 10.3.0-rc.2 5.5.1 10.3.1 5.5.2 10.3.2 5.5.3 10.3.3 5.5.4 10.3.4 5.5.5 10.3.5 5.6.0 10.3.6 5.6.0-beta.1 10.3.7 5.6.0-rc.1 10.3.8 5.6.0-rc.2 10.4.0 5.6.1 10.4.0-beta.1 5.6.2 10.4.0-beta.2 5.6.3 10.4.0-rc.1 5.7.0 10.4.1 5.7.0-beta.1 10.4.2 5.7.0-rc.1 10.4.3 5.7.1 10.4.4 5.7.2 10.5.0 5.7.3 10.5.0-beta.1 5.8.0 10.5.0-beta.2 5.8.0-beta.1 10.5.0-rc.1 5.8.0-beta.2 10.5.0-rc.2 5.8.0-rc.1 10.5.0-rc.3 5.8.1 10.5.1 5.8.2 10.5.2 5.9.0 10.5.3 5.9.0-beta.1 10.6.0 5.9.0-rc.1 10.6.0-beta.1 5.9.0-rc.2 10.6.0-beta.2 5.9.1 10.6.0-rc.1 5.9.2 10.6.1 6.0.0 10.6.2 6.0.0-beta.1 10.7.0 6.0.0-rc.1 10.7.0-beta.1 6.0.1 10.7.0-beta.2 6.0.2 10.7.0-rc.1 6.1.0 3.0.0 6.1.0-beta.1 3.0.1 6.1.0-rc.1 3.0.2 6.1.0-rc.2 3.0.3 6.1.1 3.0.4 6.1.2 3.0.5 6.1.3 3.0.6 6.2.0 3.0.7 6.2.0-beta.1 3.0.8 6.2.0-rc.1 3.0.9 6.2.0-rc.2 3.1.0 6.2.1 3.1.1 6.2.2 3.1.2 6.2.3 3.2.0 6.3.0 3.2.1 6.3.0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / assets / client / blocks / collection-rating-filter.js
woocommerce / assets / client / blocks Last commit date
active-filters 2 years ago add-to-cart-form 2 years ago all-products 2 years ago attribute-filter 2 years ago base-components-mini-cart-contents-block 2 years ago base-components-product-price~mini-cart-contents-block 2 years ago breadcrumbs 2 years ago cart-blocks 2 years ago catalog-sorting 2 years ago checkout 2 years ago checkout-blocks 2 years ago classic-shortcode 2 years ago collection-active-filters 2 years ago collection-attribute-filter 2 years ago collection-filters 2 years ago collection-price-filter 2 years ago collection-rating-filter 2 years ago collection-stock-filter 2 years ago customer-account 2 years ago featured-category 2 years ago featured-product 2 years ago filter-wrapper 2 years ago handpicked-products 2 years ago inner-blocks 2 years ago mini-cart 2 years ago mini-cart-contents-block 2 years ago order-confirmation-additional-information 2 years ago order-confirmation-billing-address 2 years ago order-confirmation-billing-wrapper 2 years ago order-confirmation-downloads 2 years ago order-confirmation-downloads-wrapper 2 years ago order-confirmation-shipping-address 2 years ago order-confirmation-shipping-wrapper 2 years ago order-confirmation-status 2 years ago order-confirmation-summary 2 years ago order-confirmation-totals 2 years ago order-confirmation-totals-wrapper 2 years ago page-content-wrapper 2 years ago price-filter 2 years ago product-average-rating 2 years ago product-best-sellers 2 years ago product-button 2 years ago product-categories 2 years ago product-category 2 years ago product-collection 2 years ago product-collection-no-results 2 years ago product-details 2 years ago product-gallery 2 years ago product-gallery-large-image 2 years ago product-gallery-large-image-next-previous 2 years ago product-gallery-pager 2 years ago product-gallery-thumbnails 2 years ago product-image-gallery 2 years ago product-meta 2 years ago product-new 2 years ago product-rating 2 years ago product-rating-counter 2 years ago product-rating-stars 2 years ago product-results-count 2 years ago product-reviews 2 years ago product-tag 2 years ago product-template 2 years ago product-top-rated 2 years ago products-by-attribute 2 years ago rating-filter 2 years ago related-products 2 years ago single-product 2 years ago stock-filter 2 years ago store-notices 2 years ago active-filters-frontend.asset.php 2 years ago active-filters-frontend.js 2 years ago active-filters-frontend.js.map 2 years ago active-filters-rtl.css 2 years ago active-filters-style.asset.php 2 years ago active-filters-style.js.map 2 years ago active-filters-wrapper-frontend.js 2 years ago active-filters-wrapper-frontend.js.map 2 years ago active-filters-wrapper-rtl.css 2 years ago active-filters-wrapper-style.js.map 2 years ago active-filters-wrapper.css 2 years ago active-filters-wrapper.css.map 2 years ago active-filters.asset.php 2 years ago active-filters.css 2 years ago active-filters.css.map 2 years ago active-filters.js 2 years ago active-filters.js.map 2 years ago add-to-cart-form-rtl.css 2 years ago add-to-cart-form-style.asset.php 2 years ago add-to-cart-form-style.js.map 2 years ago add-to-cart-form.css 2 years ago add-to-cart-form.css.map 2 years ago all-products-frontend.asset.php 2 years ago all-products-frontend.js 2 years ago all-products-frontend.js.map 2 years ago all-products-rtl.css 2 years ago all-products-style.asset.php 2 years ago all-products-style.js.map 2 years ago all-products.asset.php 2 years ago all-products.css 2 years ago all-products.css.map 2 years ago all-products.js 2 years ago all-products.js.map 2 years ago all-reviews-rtl.css 2 years ago all-reviews-style.asset.php 2 years ago all-reviews-style.js.map 2 years ago all-reviews.asset.php 2 years ago all-reviews.css 2 years ago all-reviews.css.map 2 years ago all-reviews.js 2 years ago all-reviews.js.map 2 years ago assets_js_base_context_hooks_collections_use-collection_ts-assets_js_base_context_hooks_use-q-fdf7ba-style.js.map 2 years ago assets_js_base_context_hooks_use-store-add-to-cart_ts-assets_js_base_context_hooks_use-store--e30f56-style.js.map 2 years ago attribute-filter-frontend.asset.php 2 years ago attribute-filter-frontend.js 2 years ago attribute-filter-frontend.js.map 2 years ago attribute-filter-rtl.css 2 years ago attribute-filter-style.asset.php 2 years ago attribute-filter-style.js.map 2 years ago attribute-filter-wrapper-frontend.js 2 years ago attribute-filter-wrapper-frontend.js.map 2 years ago attribute-filter-wrapper-rtl.css 2 years ago attribute-filter-wrapper-style.js.map 2 years ago attribute-filter-wrapper.css 2 years ago attribute-filter-wrapper.css.map 2 years ago attribute-filter.asset.php 2 years ago attribute-filter.css 2 years ago attribute-filter.css.map 2 years ago attribute-filter.js 2 years ago attribute-filter.js.map 2 years ago base-components-attribute-filter-wrapper-index.tsx-style.js.map 2 years ago base-components-price-filter-wrapper-index.tsx-style.js.map 2 years ago base-components-price-filter-wrapper-style.scss-rtl.css 2 years ago base-components-price-filter-wrapper-style.scss.css 2 years ago base-components-price-filter-wrapper-style.scss.css.map 2 years ago base-components-rating-filter-wrapper-index.tsx-style.js.map 2 years ago base-components-rating-filter-wrapper-style.scss-rtl.css 2 years ago base-components-rating-filter-wrapper-style.scss.css 2 years ago base-components-rating-filter-wrapper-style.scss.css.map 2 years ago base-components-stock-filter-wrapper-index.tsx-style.js.map 2 years ago base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss-rtl.css 2 years ago base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss.css 2 years ago base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss.css.map 2 years ago base-context-product-add-to-cart-index.js-style.js.map 2 years ago blocks-checkout.asset.php 2 years ago blocks-checkout.js 2 years ago blocks-checkout.js.map 2 years ago blocks-components.asset.php 2 years ago blocks-components.js 2 years ago blocks-components.js.map 2 years ago breadcrumbs-rtl.css 2 years ago breadcrumbs-style.asset.php 2 years ago breadcrumbs-style.js.map 2 years ago breadcrumbs.asset.php 2 years ago breadcrumbs.css 2 years ago breadcrumbs.css.map 2 years ago breadcrumbs.js 2 years ago breadcrumbs.js.map 2 years ago cart-frontend.asset.php 2 years ago cart-frontend.js 2 years ago cart-frontend.js.map 2 years ago cart-rtl.css 2 years ago cart-style.asset.php 2 years ago cart-style.js.map 2 years ago cart.asset.php 2 years ago cart.css 2 years ago cart.css.map 2 years ago cart.js 2 years ago cart.js.map 2 years ago catalog-sorting-rtl.css 2 years ago catalog-sorting-style.asset.php 2 years ago catalog-sorting-style.js.map 2 years ago catalog-sorting.asset.php 2 years ago catalog-sorting.css 2 years ago catalog-sorting.css.map 2 years ago catalog-sorting.js 2 years ago catalog-sorting.js.map 2 years ago checkout-frontend.asset.php 2 years ago checkout-frontend.js 2 years ago checkout-frontend.js.map 2 years ago checkout-rtl.css 2 years ago checkout-style.asset.php 2 years ago checkout-style.js.map 2 years ago checkout.asset.php 2 years ago checkout.css 2 years ago checkout.css.map 2 years ago checkout.js 2 years ago checkout.js.map 2 years ago classic-shortcode-rtl.css 2 years ago classic-shortcode-style.asset.php 2 years ago classic-shortcode-style.js.map 2 years ago classic-shortcode.asset.php 2 years ago classic-shortcode.css 2 years ago classic-shortcode.css.map 2 years ago classic-shortcode.js 2 years ago classic-shortcode.js.map 2 years ago collection-active-filters-frontend.asset.php 2 years ago collection-active-filters-frontend.js 2 years ago collection-active-filters-frontend.js.map 2 years ago collection-active-filters-rtl.css 2 years ago collection-active-filters-style.asset.php 2 years ago collection-active-filters-style.js.map 2 years ago collection-active-filters.asset.php 2 years ago collection-active-filters.css 2 years ago collection-active-filters.css.map 2 years ago collection-active-filters.js 2 years ago collection-active-filters.js.map 2 years ago collection-attribute-filter-frontend.asset.php 2 years ago collection-attribute-filter-frontend.js 2 years ago collection-attribute-filter-frontend.js.map 2 years ago collection-attribute-filter-rtl.css 2 years ago collection-attribute-filter-style.asset.php 2 years ago collection-attribute-filter-style.js.map 2 years ago collection-attribute-filter.asset.php 2 years ago collection-attribute-filter.css 2 years ago collection-attribute-filter.css.map 2 years ago collection-attribute-filter.js 2 years ago collection-attribute-filter.js.map 2 years ago collection-filters-style.asset.php 2 years ago collection-filters-style.js.map 2 years ago collection-filters.asset.php 2 years ago collection-filters.js 2 years ago collection-filters.js.map 2 years ago collection-price-filter-frontend.asset.php 2 years ago collection-price-filter-frontend.js 2 years ago collection-price-filter-frontend.js.map 2 years ago collection-price-filter-rtl.css 2 years ago collection-price-filter-style.asset.php 2 years ago collection-price-filter-style.js.map 2 years ago collection-price-filter.asset.php 2 years ago collection-price-filter.css 2 years ago collection-price-filter.css.map 2 years ago collection-price-filter.js 2 years ago collection-price-filter.js.map 2 years ago collection-rating-filter-frontend.asset.php 2 years ago collection-rating-filter-frontend.js 2 years ago collection-rating-filter-frontend.js.map 2 years ago collection-rating-filter-rtl.css 2 years ago collection-rating-filter-style.asset.php 2 years ago collection-rating-filter-style.js.map 2 years ago collection-rating-filter.asset.php 2 years ago collection-rating-filter.css 2 years ago collection-rating-filter.css.map 2 years ago collection-rating-filter.js 2 years ago collection-rating-filter.js.map 2 years ago collection-stock-filter-frontend.asset.php 2 years ago collection-stock-filter-frontend.js 2 years ago collection-stock-filter-frontend.js.map 2 years ago collection-stock-filter-rtl.css 2 years ago collection-stock-filter-style.asset.php 2 years ago collection-stock-filter-style.js.map 2 years ago collection-stock-filter.asset.php 2 years ago collection-stock-filter.css 2 years ago collection-stock-filter.css.map 2 years ago collection-stock-filter.js 2 years ago collection-stock-filter.js.map 2 years ago customer-account-rtl.css 2 years ago customer-account-style.asset.php 2 years ago customer-account-style.js.map 2 years ago customer-account.asset.php 2 years ago customer-account.css 2 years ago customer-account.css.map 2 years ago customer-account.js 2 years ago customer-account.js.map 2 years ago featured-category-rtl.css 2 years ago featured-category-style.asset.php 2 years ago featured-category-style.js.map 2 years ago featured-category.asset.php 2 years ago featured-category.css 2 years ago featured-category.css.map 2 years ago featured-category.js 2 years ago featured-category.js.map 2 years ago featured-product-rtl.css 2 years ago featured-product-style.asset.php 2 years ago featured-product-style.js.map 2 years ago featured-product.asset.php 2 years ago featured-product.css 2 years ago featured-product.css.map 2 years ago featured-product.js 2 years ago featured-product.js.map 2 years ago filter-wrapper-frontend.asset.php 2 years ago filter-wrapper-frontend.js 2 years ago filter-wrapper-frontend.js.map 2 years ago filter-wrapper-rtl.css 2 years ago filter-wrapper-style.asset.php 2 years ago filter-wrapper-style.js.map 2 years ago filter-wrapper.asset.php 2 years ago filter-wrapper.css 2 years ago filter-wrapper.css.map 2 years ago filter-wrapper.js 2 years ago filter-wrapper.js.map 2 years ago handpicked-products-style.asset.php 2 years ago handpicked-products-style.js.map 2 years ago handpicked-products.asset.php 2 years ago handpicked-products.js 2 years ago handpicked-products.js.map 2 years ago legacy-template-rtl.css 2 years ago legacy-template-style.asset.php 2 years ago legacy-template-style.js.map 2 years ago legacy-template.asset.php 2 years ago legacy-template.css 2 years ago legacy-template.css.map 2 years ago legacy-template.js 2 years ago legacy-template.js.map 2 years ago mini-cart-component-frontend.asset.php 2 years ago mini-cart-component-frontend.js 2 years ago mini-cart-component-frontend.js.map 2 years ago mini-cart-contents-rtl.css 2 years ago mini-cart-contents-style.asset.php 2 years ago mini-cart-contents-style.js.map 2 years ago mini-cart-contents.asset.php 2 years ago mini-cart-contents.css 2 years ago mini-cart-contents.css.map 2 years ago mini-cart-contents.js 2 years ago mini-cart-contents.js.map 2 years ago mini-cart-frontend.asset.php 2 years ago mini-cart-frontend.js 2 years ago mini-cart-frontend.js.map 2 years ago mini-cart-rtl.css 2 years ago mini-cart-style.asset.php 2 years ago mini-cart-style.js.map 2 years ago mini-cart.asset.php 2 years ago mini-cart.css 2 years ago mini-cart.css.map 2 years ago mini-cart.js 2 years ago mini-cart.js.map 2 years ago order-confirmation-additional-information-rtl.css 2 years ago order-confirmation-additional-information-style.asset.php 2 years ago order-confirmation-additional-information-style.js.map 2 years ago order-confirmation-additional-information.asset.php 2 years ago order-confirmation-additional-information.css 2 years ago order-confirmation-additional-information.css.map 2 years ago order-confirmation-additional-information.js 2 years ago order-confirmation-additional-information.js.map 2 years ago order-confirmation-billing-address-rtl.css 2 years ago order-confirmation-billing-address-style.asset.php 2 years ago order-confirmation-billing-address-style.js.map 2 years ago order-confirmation-billing-address.asset.php 2 years ago order-confirmation-billing-address.css 2 years ago order-confirmation-billing-address.css.map 2 years ago order-confirmation-billing-address.js 2 years ago order-confirmation-billing-address.js.map 2 years ago order-confirmation-billing-wrapper-style.asset.php 2 years ago order-confirmation-billing-wrapper-style.js.map 2 years ago order-confirmation-billing-wrapper.asset.php 2 years ago order-confirmation-billing-wrapper.js 2 years ago order-confirmation-billing-wrapper.js.map 2 years ago order-confirmation-downloads-rtl.css 2 years ago order-confirmation-downloads-style.asset.php 2 years ago order-confirmation-downloads-style.js.map 2 years ago order-confirmation-downloads-wrapper-style.asset.php 2 years ago order-confirmation-downloads-wrapper-style.js.map 2 years ago order-confirmation-downloads-wrapper.asset.php 2 years ago order-confirmation-downloads-wrapper.js 2 years ago order-confirmation-downloads-wrapper.js.map 2 years ago order-confirmation-downloads.asset.php 2 years ago order-confirmation-downloads.css 2 years ago order-confirmation-downloads.css.map 2 years ago order-confirmation-downloads.js 2 years ago order-confirmation-downloads.js.map 2 years ago order-confirmation-shipping-address-rtl.css 2 years ago order-confirmation-shipping-address-style.asset.php 2 years ago order-confirmation-shipping-address-style.js.map 2 years ago order-confirmation-shipping-address.asset.php 2 years ago order-confirmation-shipping-address.css 2 years ago order-confirmation-shipping-address.css.map 2 years ago order-confirmation-shipping-address.js 2 years ago order-confirmation-shipping-address.js.map 2 years ago order-confirmation-shipping-wrapper-style.asset.php 2 years ago order-confirmation-shipping-wrapper-style.js.map 2 years ago order-confirmation-shipping-wrapper.asset.php 2 years ago order-confirmation-shipping-wrapper.js 2 years ago order-confirmation-shipping-wrapper.js.map 2 years ago order-confirmation-status-rtl.css 2 years ago order-confirmation-status-style.asset.php 2 years ago order-confirmation-status-style.js.map 2 years ago order-confirmation-status.asset.php 2 years ago order-confirmation-status.css 2 years ago order-confirmation-status.css.map 2 years ago order-confirmation-status.js 2 years ago order-confirmation-status.js.map 2 years ago order-confirmation-summary-rtl.css 2 years ago order-confirmation-summary-style.asset.php 2 years ago order-confirmation-summary-style.js.map 2 years ago order-confirmation-summary.asset.php 2 years ago order-confirmation-summary.css 2 years ago order-confirmation-summary.css.map 2 years ago order-confirmation-summary.js 2 years ago order-confirmation-summary.js.map 2 years ago order-confirmation-totals-rtl.css 2 years ago order-confirmation-totals-style.asset.php 2 years ago order-confirmation-totals-style.js.map 2 years ago order-confirmation-totals-wrapper-style.asset.php 2 years ago order-confirmation-totals-wrapper-style.js.map 2 years ago order-confirmation-totals-wrapper.asset.php 2 years ago order-confirmation-totals-wrapper.js 2 years ago order-confirmation-totals-wrapper.js.map 2 years ago order-confirmation-totals.asset.php 2 years ago order-confirmation-totals.css 2 years ago order-confirmation-totals.css.map 2 years ago order-confirmation-totals.js 2 years ago order-confirmation-totals.js.map 2 years ago packages-style-rtl.css 2 years ago packages-style-style.asset.php 2 years ago packages-style-style.js.map 2 years ago packages-style.css 2 years ago packages-style.css.map 2 years ago page-content-wrapper-style.asset.php 2 years ago page-content-wrapper-style.js.map 2 years ago page-content-wrapper.asset.php 2 years ago page-content-wrapper.js 2 years ago page-content-wrapper.js.map 2 years ago price-filter-frontend.asset.php 2 years ago price-filter-frontend.js 2 years ago price-filter-frontend.js.map 2 years ago price-filter-rtl.css 2 years ago price-filter-style.asset.php 2 years ago price-filter-style.js.map 2 years ago price-filter-wrapper-frontend.js 2 years ago price-filter-wrapper-frontend.js.map 2 years ago price-filter-wrapper-rtl.css 2 years ago price-filter-wrapper-style.js.map 2 years ago price-filter-wrapper.css 2 years ago price-filter-wrapper.css.map 2 years ago price-filter.asset.php 2 years ago price-filter.css 2 years ago price-filter.css.map 2 years ago price-filter.js 2 years ago price-filter.js.map 2 years ago price-format.asset.php 2 years ago price-format.js 2 years ago price-format.js.map 2 years ago product-add-to-cart-frontend.js 2 years ago product-add-to-cart-frontend.js.map 2 years ago product-add-to-cart-rtl.css 2 years ago product-add-to-cart-style.js.map 2 years ago product-add-to-cart.css 2 years ago product-add-to-cart.css.map 2 years ago product-add-to-cart.js 2 years ago product-add-to-cart.js.map 2 years ago product-average-rating-frontend.js 2 years ago product-average-rating-frontend.js.map 2 years ago product-average-rating-style.js.map 2 years ago product-average-rating.js 2 years ago product-average-rating.js.map 2 years ago product-best-sellers-style.asset.php 2 years ago product-best-sellers-style.js.map 2 years ago product-best-sellers.asset.php 2 years ago product-best-sellers.js 2 years ago product-best-sellers.js.map 2 years ago product-button-frontend.js 2 years ago product-button-frontend.js.map 2 years ago product-button-interactivity-frontend.asset.php 2 years ago product-button-interactivity-frontend.js 2 years ago product-button-interactivity-frontend.js.map 2 years ago product-button-rtl.css 2 years ago product-button-style.js.map 2 years ago product-button.css 2 years ago product-button.css.map 2 years ago product-button.js 2 years ago product-button.js.map 2 years ago product-categories-rtl.css 2 years ago product-categories-style.asset.php 2 years ago product-categories-style.js.map 2 years ago product-categories.asset.php 2 years ago product-categories.css 2 years ago product-categories.css.map 2 years ago product-categories.js 2 years ago product-categories.js.map 2 years ago product-category-style.asset.php 2 years ago product-category-style.js.map 2 years ago product-category.asset.php 2 years ago product-category.js 2 years ago product-category.js.map 2 years ago product-collection-no-results-style.asset.php 2 years ago product-collection-no-results-style.js.map 2 years ago product-collection-no-results.asset.php 2 years ago product-collection-no-results.js 2 years ago product-collection-no-results.js.map 2 years ago product-collection-style.asset.php 2 years ago product-collection-style.js.map 2 years ago product-collection.asset.php 2 years ago product-collection.js 2 years ago product-collection.js.map 2 years ago product-details-rtl.css 2 years ago product-details-style.asset.php 2 years ago product-details-style.js.map 2 years ago product-details.css 2 years ago product-details.css.map 2 years ago product-gallery-frontend.asset.php 2 years ago product-gallery-frontend.js 2 years ago product-gallery-frontend.js.map 2 years ago product-gallery-large-image-frontend.asset.php 2 years ago product-gallery-large-image-frontend.js 2 years ago product-gallery-large-image-frontend.js.map 2 years ago product-gallery-large-image-next-previous-style.asset.php 2 years ago product-gallery-large-image-next-previous-style.js.map 2 years ago product-gallery-large-image-next-previous.asset.php 2 years ago product-gallery-large-image-next-previous.js 2 years ago product-gallery-large-image-next-previous.js.map 2 years ago product-gallery-large-image-style.asset.php 2 years ago product-gallery-large-image-style.js.map 2 years ago product-gallery-large-image.asset.php 2 years ago product-gallery-large-image.js 2 years ago product-gallery-large-image.js.map 2 years ago product-gallery-pager-style.asset.php 2 years ago product-gallery-pager-style.js.map 2 years ago product-gallery-pager.asset.php 2 years ago product-gallery-pager.js 2 years ago product-gallery-pager.js.map 2 years ago product-gallery-rtl.css 2 years ago product-gallery-style.asset.php 2 years ago product-gallery-style.js.map 2 years ago product-gallery-thumbnails-style.asset.php 2 years ago product-gallery-thumbnails-style.js.map 2 years ago product-gallery-thumbnails.asset.php 2 years ago product-gallery-thumbnails.js 2 years ago product-gallery-thumbnails.js.map 2 years ago product-gallery.asset.php 2 years ago product-gallery.css 2 years ago product-gallery.css.map 2 years ago product-gallery.js 2 years ago product-gallery.js.map 2 years ago product-image-frontend.js 2 years ago product-image-frontend.js.map 2 years ago product-image-gallery-rtl.css 2 years ago product-image-gallery-style.asset.php 2 years ago product-image-gallery-style.js.map 2 years ago product-image-gallery.css 2 years ago product-image-gallery.css.map 2 years ago product-image-rtl.css 2 years ago product-image-style.js.map 2 years ago product-image.css 2 years ago product-image.css.map 2 years ago product-image.js 2 years ago product-image.js.map 2 years ago product-new-style.asset.php 2 years ago product-new-style.js.map 2 years ago product-new.asset.php 2 years ago product-new.js 2 years ago product-new.js.map 2 years ago product-on-sale-style.asset.php 2 years ago product-on-sale-style.js.map 2 years ago product-on-sale.asset.php 2 years ago product-on-sale.js 2 years ago product-on-sale.js.map 2 years ago product-price-frontend.js 2 years ago product-price-frontend.js.map 2 years ago product-price-rtl.css 2 years ago product-price-style.js.map 2 years ago product-price.css 2 years ago product-price.css.map 2 years ago product-price.js 2 years ago product-price.js.map 2 years ago product-query-rtl.css 2 years ago product-query-style.asset.php 2 years ago product-query-style.js.map 2 years ago product-query.asset.php 2 years ago product-query.css 2 years ago product-query.css.map 2 years ago product-query.js 2 years ago product-query.js.map 2 years ago product-rating-counter-frontend.js 2 years ago product-rating-counter-frontend.js.map 2 years ago product-rating-counter-style.js.map 2 years ago product-rating-counter.js 2 years ago product-rating-counter.js.map 2 years ago product-rating-frontend.js 2 years ago product-rating-frontend.js.map 2 years ago product-rating-rtl.css 2 years ago product-rating-stars-frontend.js 2 years ago product-rating-stars-frontend.js.map 2 years ago product-rating-stars-rtl.css 2 years ago product-rating-stars-style.js.map 2 years ago product-rating-stars.css 2 years ago product-rating-stars.css.map 2 years ago product-rating-stars.js 2 years ago product-rating-stars.js.map 2 years ago product-rating-style.js.map 2 years ago product-rating.css 2 years ago product-rating.css.map 2 years ago product-rating.js 2 years ago product-rating.js.map 2 years ago product-results-count-rtl.css 2 years ago product-results-count-style.asset.php 2 years ago product-results-count-style.js.map 2 years ago product-results-count.asset.php 2 years ago product-results-count.css 2 years ago product-results-count.css.map 2 years ago product-results-count.js 2 years ago product-results-count.js.map 2 years ago product-reviews-rtl.css 2 years ago product-reviews-style.asset.php 2 years ago product-reviews-style.js.map 2 years ago product-reviews.css 2 years ago product-reviews.css.map 2 years ago product-sale-badge-frontend.js 2 years ago product-sale-badge-frontend.js.map 2 years ago product-sale-badge-rtl.css 2 years ago product-sale-badge-style.js.map 2 years ago product-sale-badge.css 2 years ago product-sale-badge.css.map 2 years ago product-sale-badge.js 2 years ago product-sale-badge.js.map 2 years ago product-search-rtl.css 2 years ago product-search-style.asset.php 2 years ago product-search-style.js.map 2 years ago product-search.asset.php 2 years ago product-search.css 2 years ago product-search.css.map 2 years ago product-search.js 2 years ago product-search.js.map 2 years ago product-sku-frontend.js 2 years ago product-sku-frontend.js.map 2 years ago product-sku-rtl.css 2 years ago product-sku-style.js.map 2 years ago product-sku.css 2 years ago product-sku.css.map 2 years ago product-sku.js 2 years ago product-sku.js.map 2 years ago product-stock-indicator-frontend.js 2 years ago product-stock-indicator-frontend.js.map 2 years ago product-stock-indicator-rtl.css 2 years ago product-stock-indicator-style.js.map 2 years ago product-stock-indicator.css 2 years ago product-stock-indicator.css.map 2 years ago product-stock-indicator.js 2 years ago product-stock-indicator.js.map 2 years ago product-summary-frontend.js 2 years ago product-summary-frontend.js.map 2 years ago product-summary-rtl.css 2 years ago product-summary-style.js.map 2 years ago product-summary.css 2 years ago product-summary.css.map 2 years ago product-summary.js 2 years ago product-summary.js.map 2 years ago product-tag-style.asset.php 2 years ago product-tag-style.js.map 2 years ago product-tag.asset.php 2 years ago product-tag.js 2 years ago product-tag.js.map 2 years ago product-template-rtl.css 2 years ago product-template-style.asset.php 2 years ago product-template-style.js.map 2 years ago product-template.asset.php 2 years ago product-template.css 2 years ago product-template.css.map 2 years ago product-template.js 2 years ago product-template.js.map 2 years ago product-title-frontend.js 2 years ago product-title-frontend.js.map 2 years ago product-title-rtl.css 2 years ago product-title-style.js.map 2 years ago product-title.css 2 years ago product-title.css.map 2 years ago product-title.js 2 years ago product-title.js.map 2 years ago product-top-rated-style.asset.php 2 years ago product-top-rated-style.js.map 2 years ago product-top-rated.asset.php 2 years ago product-top-rated.js 2 years ago product-top-rated.js.map 2 years ago products-by-attribute-style.asset.php 2 years ago products-by-attribute-style.js.map 2 years ago products-by-attribute.asset.php 2 years ago products-by-attribute.js 2 years ago products-by-attribute.js.map 2 years ago rating-filter-frontend.asset.php 2 years ago rating-filter-frontend.js 2 years ago rating-filter-frontend.js.map 2 years ago rating-filter-rtl.css 2 years ago rating-filter-style.asset.php 2 years ago rating-filter-style.js.map 2 years ago rating-filter-wrapper-frontend.js 2 years ago rating-filter-wrapper-frontend.js.map 2 years ago rating-filter-wrapper-rtl.css 2 years ago rating-filter-wrapper-style.js.map 2 years ago rating-filter-wrapper.css 2 years ago rating-filter-wrapper.css.map 2 years ago rating-filter.asset.php 2 years ago rating-filter.css 2 years ago rating-filter.css.map 2 years ago rating-filter.js 2 years ago rating-filter.js.map 2 years ago reviews-by-category-rtl.css 2 years ago reviews-by-category-style.asset.php 2 years ago reviews-by-category-style.js.map 2 years ago reviews-by-category.asset.php 2 years ago reviews-by-category.css 2 years ago reviews-by-category.css.map 2 years ago reviews-by-category.js 2 years ago reviews-by-category.js.map 2 years ago reviews-by-product-rtl.css 2 years ago reviews-by-product-style.asset.php 2 years ago reviews-by-product-style.js.map 2 years ago reviews-by-product.asset.php 2 years ago reviews-by-product.css 2 years ago reviews-by-product.css.map 2 years ago reviews-by-product.js 2 years ago reviews-by-product.js.map 2 years ago reviews-frontend.asset.php 2 years ago reviews-frontend.js 2 years ago reviews-frontend.js.map 2 years ago single-product-rtl.css 2 years ago single-product-style.asset.php 2 years ago single-product-style.js.map 2 years ago single-product.asset.php 2 years ago single-product.css 2 years ago single-product.css.map 2 years ago single-product.js 2 years ago single-product.js.map 2 years ago stock-filter-frontend.asset.php 2 years ago stock-filter-frontend.js 2 years ago stock-filter-frontend.js.map 2 years ago stock-filter-rtl.css 2 years ago stock-filter-style.asset.php 2 years ago stock-filter-style.js.map 2 years ago stock-filter-wrapper-frontend.js 2 years ago stock-filter-wrapper-frontend.js.map 2 years ago stock-filter-wrapper-rtl.css 2 years ago stock-filter-wrapper-style.js.map 2 years ago stock-filter-wrapper.css 2 years ago stock-filter-wrapper.css.map 2 years ago stock-filter.asset.php 2 years ago stock-filter.css 2 years ago stock-filter.css.map 2 years ago stock-filter.js 2 years ago stock-filter.js.map 2 years ago store-notices-rtl.css 2 years ago store-notices-style.asset.php 2 years ago store-notices-style.js.map 2 years ago store-notices.asset.php 2 years ago store-notices.css 2 years ago store-notices.css.map 2 years ago store-notices.js 2 years ago store-notices.js.map 2 years ago vendors-node_modules_pnpm_dinero_js_1_9_1_node_modules_dinero_js_build_esm_dinero_js-style.js.map 2 years ago vendors-node_modules_pnpm_param-case_3_0_4_node_modules_param-case_dist_es2015_index_js-style.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-019903-style.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-37238e-frontend.js 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-37238e-frontend.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-68c184-style.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-70a73f-frontend.js 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-70a73f-frontend.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-849324-frontend.js 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-849324-frontend.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-bab841-style.js.map 2 years ago vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-c6918e-style.js.map 2 years ago wc-blocks-classic-template-revert-button-style-rtl.css 2 years ago wc-blocks-classic-template-revert-button-style-style.asset.php 2 years ago wc-blocks-classic-template-revert-button-style-style.js.map 2 years ago wc-blocks-classic-template-revert-button-style.css 2 years ago wc-blocks-classic-template-revert-button-style.css.map 2 years ago wc-blocks-classic-template-revert-button.asset.php 2 years ago wc-blocks-classic-template-revert-button.js 2 years ago wc-blocks-classic-template-revert-button.js.map 2 years ago wc-blocks-data.asset.php 2 years ago wc-blocks-data.js 2 years ago wc-blocks-data.js.map 2 years ago wc-blocks-editor-style-rtl.css 2 years ago wc-blocks-editor-style.css 2 years ago wc-blocks-editor-style.css.map 2 years ago wc-blocks-google-analytics.asset.php 2 years ago wc-blocks-google-analytics.js 2 years ago wc-blocks-google-analytics.js.map 2 years ago wc-blocks-middleware.asset.php 2 years ago wc-blocks-middleware.js 2 years ago wc-blocks-middleware.js.map 2 years ago wc-blocks-registry.asset.php 2 years ago wc-blocks-registry.js 2 years ago wc-blocks-registry.js.map 2 years ago wc-blocks-rtl.css 2 years ago wc-blocks-shared-context.asset.php 2 years ago wc-blocks-shared-context.js 2 years ago wc-blocks-shared-context.js.map 2 years ago wc-blocks-shared-hocs.asset.php 2 years ago wc-blocks-shared-hocs.js 2 years ago wc-blocks-shared-hocs.js.map 2 years ago wc-blocks-style.asset.php 2 years ago wc-blocks-style.js.map 2 years ago wc-blocks-vendors.asset.php 2 years ago wc-blocks-vendors.js 2 years ago wc-blocks-vendors.js.map 2 years ago wc-blocks.asset.php 2 years ago wc-blocks.css 2 years ago wc-blocks.css.map 2 years ago wc-blocks.js 2 years ago wc-blocks.js.map 2 years ago wc-interactivity-checkbox-list-rtl.css 2 years ago wc-interactivity-checkbox-list-style.asset.php 2 years ago wc-interactivity-checkbox-list-style.js.map 2 years ago wc-interactivity-checkbox-list.asset.php 2 years ago wc-interactivity-checkbox-list.css 2 years ago wc-interactivity-checkbox-list.css.map 2 years ago wc-interactivity-checkbox-list.js 2 years ago wc-interactivity-checkbox-list.js.map 2 years ago wc-interactivity-dropdown-rtl.css 2 years ago wc-interactivity-dropdown-style.asset.php 2 years ago wc-interactivity-dropdown-style.js.map 2 years ago wc-interactivity-dropdown.asset.php 2 years ago wc-interactivity-dropdown.css 2 years ago wc-interactivity-dropdown.css.map 2 years ago wc-interactivity-dropdown.js 2 years ago wc-interactivity-dropdown.js.map 2 years ago wc-interactivity.asset.php 2 years ago wc-interactivity.js 2 years ago wc-interactivity.js.map 2 years ago wc-payment-method-bacs.asset.php 2 years ago wc-payment-method-bacs.js 2 years ago wc-payment-method-bacs.js.map 2 years ago wc-payment-method-cheque.asset.php 2 years ago wc-payment-method-cheque.js 2 years ago wc-payment-method-cheque.js.map 2 years ago wc-payment-method-cod.asset.php 2 years ago wc-payment-method-cod.js 2 years ago wc-payment-method-cod.js.map 2 years ago wc-payment-method-paypal.asset.php 2 years ago wc-payment-method-paypal.js 2 years ago wc-payment-method-paypal.js.map 2 years ago wc-settings.asset.php 2 years ago wc-settings.js 2 years ago wc-settings.js.map 2 years ago wc-shipping-method-pickup-location.asset.php 2 years ago wc-shipping-method-pickup-location.js 2 years ago wc-shipping-method-pickup-location.js.map 2 years ago
collection-rating-filter.js
3154 lines
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./assets/js/base/components/form-token-field/index.tsx":
5 /*!**************************************************************!*\
6 !*** ./assets/js/base/components/form-token-field/index.tsx ***!
7 \**************************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
16 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
17 /* harmony import */ var wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! wordpress-components */ "../../node_modules/.pnpm/@wordpress+components@14.2.0_@types+react@17.0.71_react-dom@17.0.2_react-with-direction@1.4.0_g43nmvk3ohn3r3z6u5eunaboqa/node_modules/@wordpress/components/build-module/form-token-field/index.js");
18 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
19 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
20 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/form-token-field/style.scss");
21 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_2__);
22
23 /**
24 * External dependencies
25 */
26
27
28
29 /**
30 * Internal dependencies
31 */
32
33 const FormTokenField = ({
34 className,
35 style,
36 suggestions,
37 multiple = true,
38 saveTransform = incompleteToken => incompleteToken.trim().replace(/\s/g, '-'),
39 messages = {},
40 validateInput = token => suggestions.includes(token),
41 label = '',
42 ...props
43 }) => {
44 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
45 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-blocks-components-form-token-field-wrapper', className, {
46 'single-selection': !multiple
47 }),
48 style: style
49 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(wordpress_components__WEBPACK_IMPORTED_MODULE_3__["default"], {
50 label: label,
51 __experimentalExpandOnFocus: true,
52 __experimentalShowHowTo: false,
53 __experimentalValidateInput: validateInput,
54 saveTransform: saveTransform,
55 maxLength: multiple ? undefined : 1,
56 suggestions: suggestions,
57 messages: messages,
58 ...props
59 }));
60 };
61 FormTokenField.__docgenInfo = {
62 "description": "",
63 "methods": [],
64 "displayName": "FormTokenField",
65 "props": {
66 "multiple": {
67 "defaultValue": {
68 "value": "true",
69 "computed": false
70 },
71 "required": false,
72 "tsType": {
73 "name": "boolean"
74 },
75 "description": ""
76 },
77 "saveTransform": {
78 "defaultValue": {
79 "value": "( incompleteToken ) =>\nincompleteToken.trim().replace( /\\s/g, '-' )",
80 "computed": false
81 },
82 "required": false,
83 "tsType": {
84 "name": "signature",
85 "type": "function",
86 "raw": "( value: string ) => string",
87 "signature": {
88 "arguments": [{
89 "name": "value",
90 "type": {
91 "name": "string"
92 }
93 }],
94 "return": {
95 "name": "string"
96 }
97 }
98 },
99 "description": ""
100 },
101 "messages": {
102 "defaultValue": {
103 "value": "{}",
104 "computed": false
105 },
106 "required": false,
107 "tsType": {
108 "name": "Record",
109 "elements": [{
110 "name": "string"
111 }, {
112 "name": "string"
113 }],
114 "raw": "Record< string, string >"
115 },
116 "description": ""
117 },
118 "validateInput": {
119 "defaultValue": {
120 "value": "( token: string ) => suggestions.includes( token )",
121 "computed": false
122 },
123 "required": false,
124 "tsType": {
125 "name": "signature",
126 "type": "function",
127 "raw": "( token: string ) => boolean",
128 "signature": {
129 "arguments": [{
130 "name": "token",
131 "type": {
132 "name": "string"
133 }
134 }],
135 "return": {
136 "name": "boolean"
137 }
138 }
139 },
140 "description": ""
141 },
142 "label": {
143 "defaultValue": {
144 "value": "''",
145 "computed": false
146 },
147 "required": false,
148 "tsType": {
149 "name": "string"
150 },
151 "description": ""
152 },
153 "className": {
154 "required": false,
155 "tsType": {
156 "name": "string"
157 },
158 "description": ""
159 },
160 "disabled": {
161 "required": false,
162 "tsType": {
163 "name": "boolean"
164 },
165 "description": ""
166 },
167 "displayTransform": {
168 "required": false,
169 "tsType": {
170 "name": "signature",
171 "type": "function",
172 "raw": "( value: string ) => string",
173 "signature": {
174 "arguments": [{
175 "name": "value",
176 "type": {
177 "name": "string"
178 }
179 }],
180 "return": {
181 "name": "string"
182 }
183 }
184 },
185 "description": ""
186 },
187 "onChange": {
188 "required": true,
189 "tsType": {
190 "name": "signature",
191 "type": "function",
192 "raw": "( value: string[] ) => void",
193 "signature": {
194 "arguments": [{
195 "name": "value",
196 "type": {
197 "name": "Array",
198 "elements": [{
199 "name": "string"
200 }],
201 "raw": "string[]"
202 }
203 }],
204 "return": {
205 "name": "void"
206 }
207 }
208 },
209 "description": ""
210 },
211 "placeholder": {
212 "required": false,
213 "tsType": {
214 "name": "string"
215 },
216 "description": ""
217 },
218 "style": {
219 "required": false,
220 "tsType": {
221 "name": "ReactCSSProperties",
222 "raw": "React.CSSProperties"
223 },
224 "description": ""
225 },
226 "suggestions": {
227 "required": true,
228 "tsType": {
229 "name": "Array",
230 "elements": [{
231 "name": "string"
232 }],
233 "raw": "string[]"
234 },
235 "description": ""
236 },
237 "value": {
238 "required": true,
239 "tsType": {
240 "name": "Array",
241 "elements": [{
242 "name": "string"
243 }],
244 "raw": "string[]"
245 },
246 "description": ""
247 }
248 }
249 };
250 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FormTokenField);
251 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
252 STORYBOOK_REACT_CLASSES["assets/js/base/components/form-token-field/index.tsx"] = {
253 name: "FormTokenField",
254 docgenInfo: FormTokenField.__docgenInfo,
255 path: "assets/js/base/components/form-token-field/index.tsx"
256 };
257 }
258
259 /***/ }),
260
261 /***/ "./assets/js/base/components/product-rating/index.tsx":
262 /*!************************************************************!*\
263 !*** ./assets/js/base/components/product-rating/index.tsx ***!
264 \************************************************************/
265 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
266
267 "use strict";
268 __webpack_require__.r(__webpack_exports__);
269 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
270 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
271 /* harmony export */ });
272 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
273 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
274 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
275 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
276 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
277 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
278 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/product-rating/style.scss");
279 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_3__);
280
281 /**
282 * External dependencies
283 */
284
285
286
287 /**
288 * Internal dependencies
289 */
290
291 const Rating = ({
292 className,
293 rating,
294 ratedProductsCount
295 }) => {
296 const ratingClassName = classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-block-components-product-rating', className);
297 const starStyle = {
298 width: rating / 5 * 100 + '%'
299 };
300 const ratingText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %f is referring to the average rating value */
301 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Rated %f out of 5', 'woocommerce'), rating);
302 const ratingHTML = {
303 __html: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %s is the rating value wrapped in HTML strong tags. */
304 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Rated %s out of 5', 'woocommerce'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)('<strong class="rating">%f</strong>', rating))
305 };
306 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
307 className: ratingClassName
308 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
309 className: 'wc-block-components-product-rating__stars',
310 role: "img",
311 "aria-label": ratingText
312 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
313 style: starStyle,
314 dangerouslySetInnerHTML: ratingHTML
315 })), ratedProductsCount !== null ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
316 className: 'wc-block-components-product-rating-count'
317 }, "(", ratedProductsCount, ")") : null);
318 };
319 Rating.__docgenInfo = {
320 "description": "",
321 "methods": [],
322 "displayName": "Rating",
323 "props": {
324 "className": {
325 "required": false,
326 "tsType": {
327 "name": "string"
328 },
329 "description": ""
330 },
331 "rating": {
332 "required": true,
333 "tsType": {
334 "name": "union",
335 "raw": "0 | 1 | 2 | 3 | 4 | 5",
336 "elements": [{
337 "name": "literal",
338 "value": "0"
339 }, {
340 "name": "literal",
341 "value": "1"
342 }, {
343 "name": "literal",
344 "value": "2"
345 }, {
346 "name": "literal",
347 "value": "3"
348 }, {
349 "name": "literal",
350 "value": "4"
351 }, {
352 "name": "literal",
353 "value": "5"
354 }]
355 },
356 "description": ""
357 },
358 "ratedProductsCount": {
359 "required": false,
360 "tsType": {
361 "name": "union",
362 "raw": "number | null",
363 "elements": [{
364 "name": "number"
365 }, {
366 "name": "null"
367 }]
368 },
369 "description": ""
370 }
371 }
372 };
373 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rating);
374 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
375 STORYBOOK_REACT_CLASSES["assets/js/base/components/product-rating/index.tsx"] = {
376 name: "Rating",
377 docgenInfo: Rating.__docgenInfo,
378 path: "assets/js/base/components/product-rating/index.tsx"
379 };
380 }
381
382 /***/ }),
383
384 /***/ "./assets/js/base/context/hooks/collections/use-collection-data.ts":
385 /*!*************************************************************************!*\
386 !*** ./assets/js/base/context/hooks/collections/use-collection-data.ts ***!
387 \*************************************************************************/
388 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
389
390 "use strict";
391 __webpack_require__.r(__webpack_exports__);
392 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
393 /* harmony export */ useCollectionData: () => (/* binding */ useCollectionData)
394 /* harmony export */ });
395 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
396 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
397 /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js");
398 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
399 /* harmony import */ var fast_sort__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-sort */ "../../node_modules/.pnpm/fast-sort@3.4.0/node_modules/fast-sort/dist/sort.mjs");
400 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts");
401 /* harmony import */ var _use_query_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../use-query-state */ "./assets/js/base/context/hooks/use-query-state.js");
402 /* harmony import */ var _use_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./use-collection */ "./assets/js/base/context/hooks/collections/use-collection.ts");
403 /* harmony import */ var _providers_query_state_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../providers/query-state-context */ "./assets/js/base/context/providers/query-state-context.js");
404 /**
405 * External dependencies
406 */
407
408
409
410
411
412
413 /**
414 * Internal dependencies
415 */
416
417
418
419 const buildCollectionDataQuery = collectionDataQueryState => {
420 const query = collectionDataQueryState;
421 if (Array.isArray(collectionDataQueryState.calculate_attribute_counts)) {
422 query.calculate_attribute_counts = (0,fast_sort__WEBPACK_IMPORTED_MODULE_1__.sort)(collectionDataQueryState.calculate_attribute_counts.map(({
423 taxonomy,
424 queryType
425 }) => {
426 return {
427 taxonomy,
428 query_type: queryType
429 };
430 })).asc(['taxonomy', 'query_type']);
431 }
432 return query;
433 };
434 const useCollectionData = ({
435 queryAttribute,
436 queryPrices,
437 queryStock,
438 queryRating,
439 queryState,
440 isEditor = false
441 }) => {
442 let context = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_2__.useQueryStateContext)();
443 context = `${context}-collection-data`;
444 const [collectionDataQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByContext)(context);
445 const [calculateAttributesQueryState, setCalculateAttributesQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_attribute_counts', [], context);
446 const [calculatePriceRangeQueryState, setCalculatePriceRangeQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_price_range', null, context);
447 const [calculateStockStatusQueryState, setCalculateStockStatusQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_stock_status_counts', null, context);
448 const [calculateRatingQueryState, setCalculateRatingQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_rating_counts', null, context);
449 const currentQueryAttribute = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryAttribute || {});
450 const currentQueryPrices = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryPrices);
451 const currentQueryStock = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryStock);
452 const currentQueryRating = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryRating);
453 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
454 if (typeof currentQueryAttribute === 'object' && Object.keys(currentQueryAttribute).length) {
455 const foundAttribute = calculateAttributesQueryState.find(attribute => {
456 return (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_5__.objectHasProp)(currentQueryAttribute, 'taxonomy') && attribute.taxonomy === currentQueryAttribute.taxonomy;
457 });
458 if (!foundAttribute) {
459 setCalculateAttributesQueryState([...calculateAttributesQueryState, currentQueryAttribute]);
460 }
461 }
462 }, [currentQueryAttribute, calculateAttributesQueryState, setCalculateAttributesQueryState]);
463 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
464 if (calculatePriceRangeQueryState !== currentQueryPrices && currentQueryPrices !== undefined) {
465 setCalculatePriceRangeQueryState(currentQueryPrices);
466 }
467 }, [currentQueryPrices, setCalculatePriceRangeQueryState, calculatePriceRangeQueryState]);
468 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
469 if (calculateStockStatusQueryState !== currentQueryStock && currentQueryStock !== undefined) {
470 setCalculateStockStatusQueryState(currentQueryStock);
471 }
472 }, [currentQueryStock, setCalculateStockStatusQueryState, calculateStockStatusQueryState]);
473 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
474 if (calculateRatingQueryState !== currentQueryRating && currentQueryRating !== undefined) {
475 setCalculateRatingQueryState(currentQueryRating);
476 }
477 }, [currentQueryRating, setCalculateRatingQueryState, calculateRatingQueryState]);
478
479 // Defer the select query so all collection-data query vars can be gathered.
480 const [shouldSelect, setShouldSelect] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(isEditor);
481 const [debouncedShouldSelect] = (0,use_debounce__WEBPACK_IMPORTED_MODULE_6__.useDebounce)(shouldSelect, 200);
482 if (!shouldSelect) {
483 setShouldSelect(true);
484 }
485 const collectionDataQueryVars = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
486 return buildCollectionDataQuery(collectionDataQueryState);
487 }, [collectionDataQueryState]);
488 return (0,_use_collection__WEBPACK_IMPORTED_MODULE_7__.useCollection)({
489 namespace: '/wc/store/v1',
490 resourceName: 'products/collection-data',
491 query: {
492 ...queryState,
493 page: undefined,
494 per_page: undefined,
495 orderby: undefined,
496 order: undefined,
497 ...collectionDataQueryVars
498 },
499 shouldSelect: debouncedShouldSelect
500 });
501 };
502
503 /***/ }),
504
505 /***/ "./assets/js/base/context/hooks/collections/use-collection.ts":
506 /*!********************************************************************!*\
507 !*** ./assets/js/base/context/hooks/collections/use-collection.ts ***!
508 \********************************************************************/
509 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
510
511 "use strict";
512 __webpack_require__.r(__webpack_exports__);
513 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
514 /* harmony export */ useCollection: () => (/* binding */ useCollection)
515 /* harmony export */ });
516 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
517 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__);
518 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
519 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
520 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
521 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
522 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts");
523 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-throw-error.ts");
524 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/error.ts");
525 /**
526 * External dependencies
527 */
528
529
530
531
532
533
534 /**
535 * This is a custom hook that is wired up to the `wc/store/collections` data
536 * store. Given a collections option object, this will ensure a component is
537 * kept up to date with the collection matching that query in the store state.
538 *
539 * @throws {Object} Throws an exception object if there was a problem with the
540 * API request, to be picked up by BlockErrorBoundry.
541 *
542 * @param {Object} options An object declaring the various
543 * collection arguments.
544 * @param {string} options.namespace The namespace for the collection.
545 * Example: `'/wc/blocks'`
546 * @param {string} options.resourceName The name of the resource for the
547 * collection. Example:
548 * `'products/attributes'`
549 * @param {Array} [options.resourceValues] An array of values (in correct order)
550 * that are substituted in the route
551 * placeholders for the collection route.
552 * Example: `[10, 20]`
553 * @param {Object} [options.query] An object of key value pairs for the
554 * query to execute on the collection
555 * Example:
556 * `{ order: 'ASC', order_by: 'price' }`
557 * @param {boolean} [options.shouldSelect] If false, the previous results will be
558 * returned and internal selects will not
559 * fire.
560 *
561 * @return {Object} This hook will return an object with two properties:
562 * - results An array of collection items returned.
563 * - isLoading A boolean indicating whether the collection is
564 * loading (true) or not.
565 */
566
567 const useCollection = options => {
568 const {
569 namespace,
570 resourceName,
571 resourceValues = [],
572 query = {},
573 shouldSelect = true
574 } = options;
575 if (!namespace || !resourceName) {
576 throw new Error('The options object must have valid values for the namespace and ' + 'the resource properties.');
577 }
578 const currentResults = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)({
579 results: [],
580 isLoading: true
581 });
582 // ensure we feed the previous reference if it's equivalent
583 const currentQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__.useShallowEqual)(query);
584 const currentResourceValues = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__.useShallowEqual)(resourceValues);
585 const throwError = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useThrowError)();
586 const results = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
587 if (!shouldSelect) {
588 return null;
589 }
590 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.COLLECTIONS_STORE_KEY);
591 const args = [namespace, resourceName, currentQuery, currentResourceValues];
592 const error = store.getCollectionError(...args);
593 if (error) {
594 if ((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_5__.isError)(error)) {
595 throwError(error);
596 } else {
597 throw new Error('TypeError: `error` object is not an instance of Error constructor');
598 }
599 }
600 return {
601 results: store.getCollection(...args),
602 isLoading: !store.hasFinishedResolution('getCollection', args)
603 };
604 }, [namespace, resourceName, currentResourceValues, currentQuery, shouldSelect]);
605 // if selector was not bailed, then update current results. Otherwise return
606 // previous results
607 if (results !== null) {
608 currentResults.current = results;
609 }
610 return currentResults.current;
611 };
612
613 /***/ }),
614
615 /***/ "./assets/js/base/context/hooks/use-query-state.js":
616 /*!*********************************************************!*\
617 !*** ./assets/js/base/context/hooks/use-query-state.js ***!
618 \*********************************************************/
619 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
620
621 "use strict";
622 __webpack_require__.r(__webpack_exports__);
623 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
624 /* harmony export */ useQueryStateByContext: () => (/* binding */ useQueryStateByContext),
625 /* harmony export */ useQueryStateByKey: () => (/* binding */ useQueryStateByKey),
626 /* harmony export */ useSynchronizedQueryState: () => (/* binding */ useSynchronizedQueryState)
627 /* harmony export */ });
628 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
629 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__);
630 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
631 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
632 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
633 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
634 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal");
635 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__);
636 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts");
637 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-previous.ts");
638 /* harmony import */ var _providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../providers/query-state-context */ "./assets/js/base/context/providers/query-state-context.js");
639 /**
640 * External dependencies
641 */
642
643
644
645
646
647
648 /**
649 * Internal dependencies
650 */
651
652
653
654 /**
655 * A custom hook that exposes the current query state and a setter for the query
656 * state store for the given context.
657 *
658 * "Query State" is a wp.data store that keeps track of an arbitrary object of
659 * query keys and their values.
660 *
661 * @param {string} [context] What context to retrieve the query state for. If not
662 * provided, this hook will attempt to get the context
663 * from the query state context provided by the
664 * QueryStateContextProvider
665 *
666 * @return {Array} An array that has two elements. The first element is the
667 * query state value for the given context. The second element
668 * is a dispatcher function for setting the query state.
669 */
670 const useQueryStateByContext = context => {
671 const queryStateContext = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__.useQueryStateContext)();
672 context = context || queryStateContext;
673 const queryState = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
674 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY);
675 return store.getValueForQueryContext(context, undefined);
676 }, [context]);
677 const {
678 setValueForQueryContext
679 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY);
680 const setQueryState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(value => {
681 setValueForQueryContext(context, value);
682 }, [context, setValueForQueryContext]);
683 return [queryState, setQueryState];
684 };
685
686 /**
687 * A custom hook that exposes the current query state value and a setter for the
688 * given context and query key.
689 *
690 * "Query State" is a wp.data store that keeps track of an arbitrary object of
691 * query keys and their values.
692 *
693 * @param {*} queryKey The specific query key to retrieve the value for.
694 * @param {*} [defaultValue] Default value if query does not exist.
695 * @param {string} [context] What context to retrieve the query state for. If
696 * not provided will attempt to use what is provided
697 * by query state context.
698 *
699 * @return {*} Whatever value is set at the query state index using the
700 * provided context and query key.
701 */
702 const useQueryStateByKey = (queryKey, defaultValue, context) => {
703 const queryStateContext = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__.useQueryStateContext)();
704 context = context || queryStateContext;
705 const queryValue = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
706 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY);
707 return store.getValueForQueryKey(context, queryKey, defaultValue);
708 },
709 // eslint-disable-next-line react-hooks/exhaustive-deps
710 [context, queryKey]);
711 const {
712 setQueryValue
713 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY);
714 const setQueryValueByKey = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(value => {
715 setQueryValue(context, queryKey, value);
716 }, [context, queryKey, setQueryValue]);
717 return [queryValue, setQueryValueByKey];
718 };
719
720 /**
721 * A custom hook that works similarly to useQueryStateByContext. However, this
722 * hook allows for synchronizing with a provided queryState object.
723 *
724 * This hook does the following things with the provided `synchronizedQuery`
725 * object:
726 *
727 * - whenever synchronizedQuery varies between renders, the queryState will be
728 * updated to a merged object of the internal queryState and the provided
729 * object. Note, any values from the same properties between objects will
730 * be set from synchronizedQuery.
731 * - if there are no changes between renders, then the existing internal
732 * queryState is always returned.
733 * - on initial render, the synchronizedQuery value is returned.
734 *
735 * Typically, this hook would be used in a scenario where there may be external
736 * triggers for updating the query state (i.e. initial population of query
737 * state by hydration or component attributes, or routing url changes that
738 * affect query state).
739 *
740 * @param {Object} synchronizedQuery A provided query state object to
741 * synchronize internal query state with.
742 * @param {string} [context] What context to retrieve the query state
743 * for. If not provided, will be pulled from
744 * the QueryStateContextProvider in the tree.
745 */
746 const useSynchronizedQueryState = (synchronizedQuery, context) => {
747 const queryStateContext = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__.useQueryStateContext)();
748 context = context || queryStateContext;
749 const [queryState, setQueryState] = useQueryStateByContext(context);
750 const currentQueryState = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_5__.useShallowEqual)(queryState);
751 const currentSynchronizedQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_5__.useShallowEqual)(synchronizedQuery);
752 const previousSynchronizedQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_6__.usePrevious)(currentSynchronizedQuery);
753 // used to ensure we allow initial synchronization to occur before
754 // returning non-synced state.
755 const isInitialized = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(false);
756 // update queryState anytime incoming synchronizedQuery changes
757 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
758 if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default()(previousSynchronizedQuery, currentSynchronizedQuery)) {
759 setQueryState(Object.assign({}, currentQueryState, currentSynchronizedQuery));
760 isInitialized.current = true;
761 }
762 }, [currentQueryState, currentSynchronizedQuery, previousSynchronizedQuery, setQueryState]);
763 return isInitialized.current ? [queryState, setQueryState] : [synchronizedQuery, setQueryState];
764 };
765
766 /***/ }),
767
768 /***/ "./assets/js/base/context/providers/query-state-context.js":
769 /*!*****************************************************************!*\
770 !*** ./assets/js/base/context/providers/query-state-context.js ***!
771 \*****************************************************************/
772 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
773
774 "use strict";
775 __webpack_require__.r(__webpack_exports__);
776 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
777 /* harmony export */ QueryStateContextProvider: () => (/* binding */ QueryStateContextProvider),
778 /* harmony export */ useQueryStateContext: () => (/* binding */ useQueryStateContext)
779 /* harmony export */ });
780 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
781 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
782 /**
783 * External dependencies
784 */
785
786
787 /**
788 * Query state context is the index for used for a query state store. By
789 * exposing this via context, it allows for all children blocks to be
790 * synchronized to the same query state defined by the parent in the tree.
791 *
792 * Defaults to 'page' for general global query state shared among all blocks
793 * in a view.
794 *
795 * @member {Object} QueryStateContext A react context object
796 */
797 const QueryStateContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)('page');
798 const useQueryStateContext = () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(QueryStateContext);
799 const QueryStateContextProvider = QueryStateContext.Provider;
800
801 /***/ }),
802
803 /***/ "./assets/js/base/hooks/use-previous.ts":
804 /*!**********************************************!*\
805 !*** ./assets/js/base/hooks/use-previous.ts ***!
806 \**********************************************/
807 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
808
809 "use strict";
810 __webpack_require__.r(__webpack_exports__);
811 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
812 /* harmony export */ usePrevious: () => (/* binding */ usePrevious)
813 /* harmony export */ });
814 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
815 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
816 /**
817 * External dependencies
818 */
819
820 /**
821 * Use Previous based on https://usehooks.com/useprevious/.
822 *
823 * @param {*} value
824 * @param {Function} [validation] Function that needs to validate for the value
825 * to be updated.
826 */
827 function usePrevious(value, validation) {
828 const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
829 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
830 if (ref.current !== value && (!validation || validation(value, ref.current))) {
831 ref.current = value;
832 }
833 }, [value, validation]);
834 return ref.current;
835 }
836
837 /***/ }),
838
839 /***/ "./assets/js/base/hooks/use-shallow-equal.ts":
840 /*!***************************************************!*\
841 !*** ./assets/js/base/hooks/use-shallow-equal.ts ***!
842 \***************************************************/
843 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
844
845 "use strict";
846 __webpack_require__.r(__webpack_exports__);
847 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
848 /* harmony export */ useShallowEqual: () => (/* binding */ useShallowEqual)
849 /* harmony export */ });
850 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
851 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
852 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal");
853 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1__);
854 /**
855 * External dependencies
856 */
857
858
859
860 /**
861 * A custom hook that compares the provided value across renders and returns the
862 * previous instance if shallow equality with previous instance exists.
863 *
864 * This is particularly useful when non-primitive types are used as
865 * dependencies for react hooks.
866 *
867 * @param {*} value Value to keep the same if satisfies shallow equality.
868 *
869 * @return {*} The previous cached instance of the value if the current has shallow equality with it.
870 */
871 function useShallowEqual(value) {
872 const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);
873 if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1___default()(value, ref.current)) {
874 ref.current = value;
875 }
876 return ref.current;
877 }
878
879 /***/ }),
880
881 /***/ "./assets/js/base/hooks/use-throw-error.ts":
882 /*!*************************************************!*\
883 !*** ./assets/js/base/hooks/use-throw-error.ts ***!
884 \*************************************************/
885 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
886
887 "use strict";
888 __webpack_require__.r(__webpack_exports__);
889 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
890 /* harmony export */ useThrowError: () => (/* binding */ useThrowError)
891 /* harmony export */ });
892 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
893 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
894 /**
895 * External dependencies
896 */
897
898
899 /**
900 * Helper method for throwing an error in a React Hook.
901 *
902 * @see https://github.com/facebook/react/issues/14981
903 */
904 const useThrowError = () => {
905 const [, setState] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)();
906 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(error => {
907 setState(() => {
908 throw error;
909 });
910 }, []);
911 };
912
913 /***/ }),
914
915 /***/ "./assets/js/base/utils/keyby.ts":
916 /*!***************************************!*\
917 !*** ./assets/js/base/utils/keyby.ts ***!
918 \***************************************/
919 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
920
921 "use strict";
922 __webpack_require__.r(__webpack_exports__);
923 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
924 /* harmony export */ keyBy: () => (/* binding */ keyBy)
925 /* harmony export */ });
926 const keyBy = (array, key) => {
927 return array.reduce((acc, value) => {
928 const computedKey = key ? String(value[key]) : String(value);
929 acc[computedKey] = value;
930 return acc;
931 }, {});
932 };
933
934 /***/ }),
935
936 /***/ "./assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/attribute-select-controls.tsx":
937 /*!********************************************************************************************************************!*\
938 !*** ./assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/attribute-select-controls.tsx ***!
939 \********************************************************************************************************************/
940 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
941
942 "use strict";
943 __webpack_require__.r(__webpack_exports__);
944 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
945 /* harmony export */ AttributeSelectControls: () => (/* binding */ AttributeSelectControls)
946 /* harmony export */ });
947 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
948 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
949 /* harmony import */ var fast_sort__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-sort */ "../../node_modules/.pnpm/fast-sort@3.4.0/node_modules/fast-sort/dist/sort.mjs");
950 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
951 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
952 /* harmony import */ var _woocommerce_editor_components_search_list_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/editor-components/search-list-control */ "./assets/js/editor-components/search-list-control/search-list-control.tsx");
953 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
954 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__);
955
956 /**
957 * External dependencies
958 */
959
960
961
962
963 const ATTRIBUTES = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__.getSetting)('attributes', []);
964 const AttributeSelectControls = ({
965 isCompact,
966 setAttributeId,
967 attributeId
968 }) => {
969 const messages = {
970 clear: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Clear selected attribute', 'woocommerce'),
971 list: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Product Attributes', 'woocommerce'),
972 noItems: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Your store doesn't have any product attributes.", 'woocommerce'),
973 search: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search for a product attribute:', 'woocommerce'),
974 selected: n => (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %d is the number of attributes selected. */
975 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('%d attribute selected', '%d attributes selected', n, 'woocommerce'), n),
976 updated: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Product attribute search results updated.', 'woocommerce')
977 };
978 const list = (0,fast_sort__WEBPACK_IMPORTED_MODULE_1__.sort)(ATTRIBUTES.map(item => {
979 return {
980 id: parseInt(item.attribute_id, 10),
981 name: item.attribute_label
982 };
983 })).asc('name');
984 const onChange = selected => {
985 if (!selected || !selected.length) {
986 return;
987 }
988 const selectedId = selected[0].id;
989 const productAttribute = ATTRIBUTES.find(attribute => attribute.attribute_id === selectedId.toString());
990 if (!productAttribute || attributeId === selectedId) {
991 return;
992 }
993 setAttributeId(selectedId);
994 };
995 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_search_list_control__WEBPACK_IMPORTED_MODULE_4__.SearchListControl, {
996 className: "woocommerce-product-attributes",
997 list: list,
998 selected: list.filter(({
999 id
1000 }) => id === attributeId),
1001 onChange: onChange,
1002 messages: messages,
1003 isSingle: true,
1004 isCompact: isCompact
1005 });
1006 };
1007 AttributeSelectControls.__docgenInfo = {
1008 "description": "",
1009 "methods": [],
1010 "displayName": "AttributeSelectControls",
1011 "props": {
1012 "isCompact": {
1013 "required": true,
1014 "tsType": {
1015 "name": "boolean"
1016 },
1017 "description": ""
1018 },
1019 "setAttributeId": {
1020 "required": true,
1021 "tsType": {
1022 "name": "signature",
1023 "type": "function",
1024 "raw": "( id: number ) => void",
1025 "signature": {
1026 "arguments": [{
1027 "name": "id",
1028 "type": {
1029 "name": "number"
1030 }
1031 }],
1032 "return": {
1033 "name": "void"
1034 }
1035 }
1036 },
1037 "description": ""
1038 },
1039 "attributeId": {
1040 "required": true,
1041 "tsType": {
1042 "name": "number"
1043 },
1044 "description": ""
1045 }
1046 }
1047 };
1048 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1049 STORYBOOK_REACT_CLASSES["assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/attribute-select-controls.tsx"] = {
1050 name: "AttributeSelectControls",
1051 docgenInfo: AttributeSelectControls.__docgenInfo,
1052 path: "assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/attribute-select-controls.tsx"
1053 };
1054 }
1055
1056 /***/ }),
1057
1058 /***/ "./assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/inspector-controls.tsx":
1059 /*!*************************************************************************************************************!*\
1060 !*** ./assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/inspector-controls.tsx ***!
1061 \*************************************************************************************************************/
1062 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1063
1064 "use strict";
1065 __webpack_require__.r(__webpack_exports__);
1066 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1067 /* harmony export */ Inspector: () => (/* binding */ Inspector)
1068 /* harmony export */ });
1069 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1070 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1071 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1072 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
1073 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
1074 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
1075 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1076 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
1077 /* harmony import */ var _attribute_select_controls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attribute-select-controls */ "./assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/attribute-select-controls.tsx");
1078
1079 /**
1080 * External dependencies
1081 */
1082
1083
1084
1085
1086 /**
1087 * Internal dependencies
1088 */
1089
1090 const Inspector = ({
1091 attributes,
1092 setAttributes
1093 }) => {
1094 const {
1095 attributeId,
1096 showCounts,
1097 queryType,
1098 displayStyle,
1099 selectType
1100 } = attributes;
1101 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
1102 key: "inspector"
1103 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
1104 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display Settings', 'woocommerce')
1105 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
1106 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display product count', 'woocommerce'),
1107 checked: showCounts,
1108 onChange: () => setAttributes({
1109 showCounts: !showCounts
1110 })
1111 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControl, {
1112 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Allow selecting multiple options?', 'woocommerce'),
1113 value: selectType || 'multiple',
1114 onChange: value => setAttributes({
1115 selectType: value
1116 }),
1117 className: "wc-block-attribute-filter__multiple-toggle"
1118 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, {
1119 value: "multiple",
1120 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Multiple', 'woocommerce')
1121 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, {
1122 value: "single",
1123 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Single', 'woocommerce')
1124 })), selectType === 'multiple' && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControl, {
1125 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter Conditions', 'woocommerce'),
1126 help: queryType === 'and' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Choose to return filter results for all of the attributes selected.', 'woocommerce') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Choose to return filter results for any of the attributes selected.', 'woocommerce'),
1127 value: queryType,
1128 onChange: value => setAttributes({
1129 queryType: value
1130 }),
1131 className: "wc-block-attribute-filter__conditions-toggle"
1132 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, {
1133 value: "and",
1134 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('All', 'woocommerce')
1135 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, {
1136 value: "or",
1137 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Any', 'woocommerce')
1138 })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControl, {
1139 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display Style', 'woocommerce'),
1140 value: displayStyle,
1141 onChange: value => setAttributes({
1142 displayStyle: value
1143 }),
1144 className: "wc-block-attribute-filter__display-toggle"
1145 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, {
1146 value: "list",
1147 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('List', 'woocommerce')
1148 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, {
1149 value: "dropdown",
1150 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Dropdown', 'woocommerce')
1151 }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
1152 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Content Settings', 'woocommerce'),
1153 initialOpen: false
1154 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_attribute_select_controls__WEBPACK_IMPORTED_MODULE_4__.AttributeSelectControls, {
1155 isCompact: true,
1156 attributeId: attributeId,
1157 setAttributes: setAttributes
1158 })));
1159 };
1160 Inspector.__docgenInfo = {
1161 "description": "",
1162 "methods": [],
1163 "displayName": "Inspector"
1164 };
1165 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1166 STORYBOOK_REACT_CLASSES["assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/inspector-controls.tsx"] = {
1167 name: "Inspector",
1168 docgenInfo: Inspector.__docgenInfo,
1169 path: "assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/inspector-controls.tsx"
1170 };
1171 }
1172
1173 /***/ }),
1174
1175 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/edit.tsx":
1176 /*!*********************************************************************************!*\
1177 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/edit.tsx ***!
1178 \*********************************************************************************/
1179 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1180
1181 "use strict";
1182 __webpack_require__.r(__webpack_exports__);
1183 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1184 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1185 /* harmony export */ });
1186 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1187 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1188 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1189 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
1190 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
1191 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/chevron-down.js");
1192 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
1193 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
1194 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
1195 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
1196 /* harmony import */ var _woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-components/product-rating */ "./assets/js/base/components/product-rating/index.tsx");
1197 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/use-query-state.js");
1198 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/collections/use-collection-data.ts");
1199 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
1200 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__);
1201 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
1202 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/boolean.ts");
1203 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
1204 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
1205 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components");
1206 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__);
1207 /* harmony import */ var _woocommerce_base_components_form_token_field__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @woocommerce/base-components/form-token-field */ "./assets/js/base/components/form-token-field/index.tsx");
1208 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1209 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__);
1210 /* harmony import */ var _preview__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./preview */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/preview.tsx");
1211 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./style.scss */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/style.scss");
1212 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_10__);
1213 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/utils.ts");
1214 /* harmony import */ var _filter_wrapper_context__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../filter-wrapper/context */ "./assets/js/blocks/filter-wrapper/context.ts");
1215 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/editor.scss");
1216 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_11__);
1217 /* harmony import */ var _attribute_filter_components_inspector_controls__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../attribute-filter/components/inspector-controls */ "./assets/js/blocks/collection-filters/inner-blocks/attribute-filter/components/inspector-controls.tsx");
1218
1219 /**
1220 * External dependencies
1221 */
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235 /**
1236 * Internal dependencies
1237 */
1238
1239
1240
1241
1242
1243
1244 const NoRatings = () => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__.Notice, {
1245 status: "warning",
1246 isDismissible: false
1247 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Your store doesn't have any products with ratings yet. This filter option will display when a product receives a review.", 'woocommerce')));
1248 const Edit = props => {
1249 const {
1250 className
1251 } = props.attributes;
1252 const blockAttributes = props.attributes;
1253 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({
1254 className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wc-block-rating-filter', className)
1255 });
1256 const isEditor = true;
1257 const setWrapperVisibility = (0,_filter_wrapper_context__WEBPACK_IMPORTED_MODULE_12__.useSetWraperVisibility)();
1258 const [queryState] = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_13__.useQueryStateByContext)();
1259 const {
1260 results: filteredCounts,
1261 isLoading: filteredCountsLoading
1262 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_14__.useCollectionData)({
1263 queryRating: true,
1264 queryState,
1265 isEditor
1266 });
1267 const [displayedOptions, setDisplayedOptions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(blockAttributes.isPreview ? _preview__WEBPACK_IMPORTED_MODULE_15__.previewOptions : []);
1268 const isLoading = !blockAttributes.isPreview && filteredCountsLoading && displayedOptions.length === 0;
1269 const isDisabled = !blockAttributes.isPreview && filteredCountsLoading;
1270 const initialFilters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useMemo)(() => (0,_utils__WEBPACK_IMPORTED_MODULE_16__.getActiveFilters)('rating_filter'), []);
1271 const [checked] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(initialFilters);
1272 const [productRatingsQuery] = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_13__.useQueryStateByKey)('rating', initialFilters);
1273
1274 /*
1275 FormTokenField forces the dropdown to reopen on reset, so we create a unique ID to use as the components key.
1276 This will force the component to remount on reset when we change this value.
1277 More info: https://github.com/woocommerce/woocommerce-blocks/pull/6920#issuecomment-1222402482
1278 */
1279 const [remountKey, setRemountKey] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)((0,_utils__WEBPACK_IMPORTED_MODULE_16__.generateUniqueId)());
1280 const [displayNoProductRatingsNotice, setDisplayNoProductRatingsNotice] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(false);
1281 const multiple = blockAttributes.selectType !== 'single';
1282 const showChevron = multiple ? !isLoading && checked.length < displayedOptions.length : !isLoading && checked.length === 0;
1283
1284 /**
1285 * Compare intersection of all ratings and filtered counts to get a list of options to display.
1286 */
1287 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
1288 /**
1289 * Checks if a status slug is in the query state.
1290 *
1291 * @param {string} queryStatus The status slug to check.
1292 */
1293
1294 if (filteredCountsLoading || blockAttributes.isPreview) {
1295 return;
1296 }
1297 const orderedRatings = !filteredCountsLoading && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_17__.objectHasProp)(filteredCounts, 'rating_counts') && Array.isArray(filteredCounts.rating_counts) ? [...filteredCounts.rating_counts].reverse() : [];
1298 if (orderedRatings.length === 0) {
1299 setDisplayedOptions(_preview__WEBPACK_IMPORTED_MODULE_15__.previewOptions);
1300 setDisplayNoProductRatingsNotice(true);
1301 return;
1302 }
1303 const newOptions = orderedRatings.filter(item => (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_17__.isObject)(item) && Object.keys(item).length > 0).map(item => {
1304 var _item$rating;
1305 return {
1306 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_4__["default"], {
1307 key: item === null || item === void 0 ? void 0 : item.rating,
1308 rating: item === null || item === void 0 ? void 0 : item.rating,
1309 ratedProductsCount: blockAttributes.showCounts ? item === null || item === void 0 ? void 0 : item.count : null
1310 }),
1311 value: item === null || item === void 0 ? void 0 : (_item$rating = item.rating) === null || _item$rating === void 0 ? void 0 : _item$rating.toString()
1312 };
1313 });
1314 setDisplayedOptions(newOptions);
1315 setRemountKey((0,_utils__WEBPACK_IMPORTED_MODULE_16__.generateUniqueId)());
1316 }, [blockAttributes.showCounts, blockAttributes.isPreview, filteredCounts, filteredCountsLoading, productRatingsQuery]);
1317 if (!filteredCountsLoading && displayedOptions.length === 0) {
1318 setWrapperVisibility(false);
1319 return null;
1320 }
1321 const hasFilterableProducts = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__.getSettingWithCoercion)('hasFilterableProducts', false, _woocommerce_types__WEBPACK_IMPORTED_MODULE_18__.isBoolean);
1322 if (!hasFilterableProducts) {
1323 setWrapperVisibility(false);
1324 return null;
1325 }
1326 setWrapperVisibility(true);
1327 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_attribute_filter_components_inspector_controls__WEBPACK_IMPORTED_MODULE_19__.Inspector, {
1328 ...props
1329 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1330 ...blockProps
1331 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__.Disabled, null, displayNoProductRatingsNotice && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(NoRatings, null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1332 className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wc-block-rating-filter', `style-${blockAttributes.displayStyle}`, {
1333 'is-loading': isLoading
1334 })
1335 }, blockAttributes.displayStyle === 'dropdown' ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_form_token_field__WEBPACK_IMPORTED_MODULE_8__["default"], {
1336 key: remountKey,
1337 className: classnames__WEBPACK_IMPORTED_MODULE_2___default()({
1338 'single-selection': !multiple,
1339 'is-loading': isLoading
1340 }),
1341 style: {
1342 borderStyle: 'none'
1343 },
1344 suggestions: displayedOptions.filter(option => !checked.includes(option.value)).map(option => option.value),
1345 disabled: isLoading,
1346 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select Rating', 'woocommerce'),
1347 onChange: () => {
1348 // noop
1349 },
1350 value: checked
1351 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1352 // @ts-ignore - FormTokenField doesn't accept custom components, forcing it here to display component
1353 ,
1354 displayTransform: value => {
1355 const resultWithZeroCount = {
1356 value,
1357 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_4__["default"], {
1358 key: Number(value),
1359 rating: Number(value),
1360 ratedProductsCount: 0
1361 })
1362 };
1363 const resultWithNonZeroCount = displayedOptions.find(option => option.value === value);
1364 const displayedResult = resultWithNonZeroCount || resultWithZeroCount;
1365 const {
1366 label,
1367 value: rawValue
1368 } = displayedResult;
1369
1370 // A label - JSX component - is extended with faked string methods to allow using JSX element as an option in FormTokenField
1371 const extendedLabel = Object.assign({}, label, {
1372 toLocaleLowerCase: () => rawValue,
1373 substring: (start, end) => start === 0 && end === 1 ? label : ''
1374 });
1375 return extendedLabel;
1376 },
1377 saveTransform: _utils__WEBPACK_IMPORTED_MODULE_16__.formatSlug,
1378 messages: {
1379 added: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rating filter added.', 'woocommerce'),
1380 removed: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rating filter removed.', 'woocommerce'),
1381 remove: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove rating filter.', 'woocommerce'),
1382 __experimentalInvalid: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Invalid rating filter.', 'woocommerce')
1383 }
1384 }), showChevron && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_20__["default"], {
1385 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_21__["default"],
1386 size: 30
1387 })) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__.CheckboxList, {
1388 className: 'wc-block-rating-filter-list',
1389 options: displayedOptions,
1390 checked: checked,
1391 onChange: () => {
1392 // noop
1393 },
1394 isLoading: isLoading,
1395 isDisabled: isDisabled
1396 })))));
1397 };
1398 Edit.__docgenInfo = {
1399 "description": "",
1400 "methods": [],
1401 "displayName": "Edit"
1402 };
1403 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_9__.withSpokenMessages)(Edit));
1404 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1405 STORYBOOK_REACT_CLASSES["assets/js/blocks/collection-filters/inner-blocks/rating-filter/edit.tsx"] = {
1406 name: "Edit",
1407 docgenInfo: Edit.__docgenInfo,
1408 path: "assets/js/blocks/collection-filters/inner-blocks/rating-filter/edit.tsx"
1409 };
1410 }
1411
1412 /***/ }),
1413
1414 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/index.tsx":
1415 /*!**********************************************************************************!*\
1416 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/index.tsx ***!
1417 \**********************************************************************************/
1418 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1419
1420 "use strict";
1421 __webpack_require__.r(__webpack_exports__);
1422 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1423 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1424 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
1425 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
1426 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
1427 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/star-empty.js");
1428 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
1429 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
1430 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
1431 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
1432 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/edit.tsx");
1433 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/block.json");
1434
1435 /**
1436 * External dependencies
1437 */
1438
1439
1440
1441
1442
1443 /**
1444 * Internal dependencies
1445 */
1446
1447
1448 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__, {
1449 icon: {
1450 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"], {
1451 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"],
1452 className: "wc-block-editor-components-block-icon"
1453 })
1454 },
1455 attributes: {
1456 ..._block_json__WEBPACK_IMPORTED_MODULE_4__.attributes
1457 },
1458 edit: _edit__WEBPACK_IMPORTED_MODULE_7__["default"],
1459 // Save the props to post content.
1460 save({
1461 attributes
1462 }) {
1463 const {
1464 className
1465 } = attributes;
1466 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1467 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save({
1468 className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('is-loading', className)
1469 })
1470 });
1471 }
1472 });
1473
1474 /***/ }),
1475
1476 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/preview.tsx":
1477 /*!************************************************************************************!*\
1478 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/preview.tsx ***!
1479 \************************************************************************************/
1480 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1481
1482 "use strict";
1483 __webpack_require__.r(__webpack_exports__);
1484 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1485 /* harmony export */ previewOptions: () => (/* binding */ previewOptions)
1486 /* harmony export */ });
1487 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1488 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1489 /* harmony import */ var _woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/base-components/product-rating */ "./assets/js/base/components/product-rating/index.tsx");
1490
1491 /**
1492 * External dependencies
1493 */
1494
1495
1496 const previewOptions = [{
1497 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_1__["default"], {
1498 key: 5,
1499 rating: 5,
1500 ratedProductsCount: null
1501 }),
1502 value: '5'
1503 }, {
1504 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_1__["default"], {
1505 key: 4,
1506 rating: 4,
1507 ratedProductsCount: null
1508 }),
1509 value: '4'
1510 }, {
1511 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_1__["default"], {
1512 key: 3,
1513 rating: 3,
1514 ratedProductsCount: null
1515 }),
1516 value: '3'
1517 }, {
1518 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_1__["default"], {
1519 key: 2,
1520 rating: 2,
1521 ratedProductsCount: null
1522 }),
1523 value: '2'
1524 }, {
1525 label: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_rating__WEBPACK_IMPORTED_MODULE_1__["default"], {
1526 key: 1,
1527 rating: 1,
1528 ratedProductsCount: null
1529 }),
1530 value: '1'
1531 }];
1532
1533 /***/ }),
1534
1535 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/utils.ts":
1536 /*!*********************************************************************************!*\
1537 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/utils.ts ***!
1538 \*********************************************************************************/
1539 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1540
1541 "use strict";
1542 __webpack_require__.r(__webpack_exports__);
1543 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1544 /* harmony export */ formatSlug: () => (/* binding */ formatSlug),
1545 /* harmony export */ generateUniqueId: () => (/* binding */ generateUniqueId),
1546 /* harmony export */ getActiveFilters: () => (/* binding */ getActiveFilters),
1547 /* harmony export */ parseAttributes: () => (/* binding */ parseAttributes)
1548 /* harmony export */ });
1549 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts");
1550 /* harmony import */ var _woocommerce_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/utils */ "./assets/js/utils/filters.ts");
1551 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/block.json");
1552 /**
1553 * External dependencies
1554 */
1555
1556
1557
1558 /**
1559 * Internal dependencies
1560 */
1561
1562 const getActiveFilters = (queryParamKey = 'filter_rating') => {
1563 const params = (0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_0__.getUrlParameter)(queryParamKey);
1564 if (!params) {
1565 return [];
1566 }
1567 const parsedParams = (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_1__.isString)(params) ? params.split(',') : params;
1568 return parsedParams;
1569 };
1570 function generateUniqueId() {
1571 return Math.floor(Math.random() * Date.now());
1572 }
1573 const formatSlug = slug => slug.trim().replace(/\s/g, '-').replace(/_/g, '-').replace(/-+/g, '-').replace(/[^a-zA-Z0-9-]/g, '');
1574 const parseAttributes = data => {
1575 return {
1576 showFilterButton: (data === null || data === void 0 ? void 0 : data.showFilterButton) === 'true',
1577 showCounts: (data === null || data === void 0 ? void 0 : data.showCounts) === 'true',
1578 isPreview: false,
1579 displayStyle: (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_1__.isString)(data === null || data === void 0 ? void 0 : data.displayStyle) && data.displayStyle || _block_json__WEBPACK_IMPORTED_MODULE_2__.attributes.displayStyle["default"],
1580 selectType: (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_1__.isString)(data === null || data === void 0 ? void 0 : data.selectType) && data.selectType || _block_json__WEBPACK_IMPORTED_MODULE_2__.attributes.selectType["default"]
1581 };
1582 };
1583
1584 /***/ }),
1585
1586 /***/ "./assets/js/blocks/filter-wrapper/context.ts":
1587 /*!****************************************************!*\
1588 !*** ./assets/js/blocks/filter-wrapper/context.ts ***!
1589 \****************************************************/
1590 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1591
1592 "use strict";
1593 __webpack_require__.r(__webpack_exports__);
1594 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1595 /* harmony export */ FilterBlockContext: () => (/* binding */ FilterBlockContext),
1596 /* harmony export */ useFilterBlockContext: () => (/* binding */ useFilterBlockContext),
1597 /* harmony export */ useSetWraperVisibility: () => (/* binding */ useSetWraperVisibility)
1598 /* harmony export */ });
1599 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
1600 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
1601 /**
1602 * External dependencies
1603 */
1604
1605
1606 /**
1607 * Context consumed by inner blocks.
1608 */
1609
1610 const FilterBlockContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)({});
1611 const useFilterBlockContext = () => {
1612 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(FilterBlockContext);
1613 };
1614 const useSetWraperVisibility = () => {
1615 const {
1616 wrapper
1617 } = useFilterBlockContext();
1618 return isVisible => {
1619 if (!wrapper) {
1620 return;
1621 }
1622 if (wrapper.current) {
1623 wrapper.current.hidden = isVisible ? false : true;
1624 }
1625 };
1626 };
1627
1628 /***/ }),
1629
1630 /***/ "./assets/js/editor-components/search-list-control/item.tsx":
1631 /*!******************************************************************!*\
1632 !*** ./assets/js/editor-components/search-list-control/item.tsx ***!
1633 \******************************************************************/
1634 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1635
1636 "use strict";
1637 __webpack_require__.r(__webpack_exports__);
1638 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1639 /* harmony export */ SearchListItem: () => (/* binding */ SearchListItem),
1640 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1641 /* harmony export */ });
1642 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1643 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1644 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
1645 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
1646 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1647 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
1648 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
1649 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
1650 /* harmony import */ var _woocommerce_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/utils */ "./assets/js/utils/array-operations.ts");
1651 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
1652 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__);
1653 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./assets/js/editor-components/search-list-control/utils.tsx");
1654
1655 /**
1656 * External dependencies
1657 */
1658
1659
1660
1661
1662
1663
1664 /**
1665 * Internal dependencies
1666 */
1667
1668
1669 const Count = ({
1670 label
1671 }) => {
1672 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1673 className: "woocommerce-search-list__item-count"
1674 }, label);
1675 };
1676 const ItemLabel = props => {
1677 const {
1678 item,
1679 search
1680 } = props;
1681 const hasBreadcrumbs = item.breadcrumbs && item.breadcrumbs.length;
1682 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1683 className: "woocommerce-search-list__item-label"
1684 }, hasBreadcrumbs ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1685 className: "woocommerce-search-list__item-prefix"
1686 }, (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getBreadcrumbsForDisplay)(item.breadcrumbs)) : null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1687 className: "woocommerce-search-list__item-name"
1688 }, (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getHighlightedName)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.name), search)));
1689 };
1690 const SearchListItem = ({
1691 countLabel,
1692 className,
1693 depth = 0,
1694 controlId = '',
1695 item,
1696 isSelected,
1697 isSingle,
1698 onSelect,
1699 search = '',
1700 selected,
1701 useExpandedPanelId,
1702 ...props
1703 }) => {
1704 var _item$breadcrumbs, _item$children;
1705 const [expandedPanelId, setExpandedPanelId] = useExpandedPanelId;
1706 const showCount = countLabel !== undefined && countLabel !== null && item.count !== undefined && item.count !== null;
1707 const hasBreadcrumbs = !!((_item$breadcrumbs = item.breadcrumbs) !== null && _item$breadcrumbs !== void 0 && _item$breadcrumbs.length);
1708 const hasChildren = !!((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length);
1709 const isExpanded = expandedPanelId === item.id;
1710 const classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(['woocommerce-search-list__item', `depth-${depth}`, className], {
1711 'has-breadcrumbs': hasBreadcrumbs,
1712 'has-children': hasChildren,
1713 'has-count': showCount,
1714 'is-expanded': isExpanded,
1715 'is-radio-button': isSingle
1716 });
1717 const name = props.name || `search-list-item-${controlId}`;
1718 const id = `${name}-${item.id}`;
1719 const togglePanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
1720 setExpandedPanelId(isExpanded ? -1 : Number(item.id));
1721 }, [isExpanded, item.id, setExpandedPanelId]);
1722 return hasChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1723 className: classes,
1724 onClick: togglePanel,
1725 onKeyDown: e => e.key === 'Enter' || e.key === ' ' ? togglePanel() : null,
1726 role: "treeitem",
1727 tabIndex: 0
1728 }, isSingle ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
1729 type: "radio",
1730 id: id,
1731 name: name,
1732 value: item.value,
1733 onChange: onSelect(item),
1734 onClick: e => e.stopPropagation(),
1735 checked: isSelected,
1736 className: "woocommerce-search-list__item-input",
1737 ...props
1738 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemLabel, {
1739 item: item,
1740 search: search
1741 }), showCount ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Count, {
1742 label: countLabel || item.count
1743 }) : null) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, {
1744 className: "woocommerce-search-list__item-input",
1745 checked: isSelected,
1746 ...(!isSelected &&
1747 // We know that `item.children` is not `undefined` because
1748 // we are here only if `hasChildren` is `true`.
1749 item.children.some(child => selected.find(selectedItem => selectedItem.id === child.id)) ? {
1750 indeterminate: true
1751 } : {}),
1752 label: (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getHighlightedName)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.name), search),
1753 onChange: () => {
1754 if (isSelected) {
1755 onSelect((0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_6__.arrayDifferenceBy)(selected, item.children, 'id'))();
1756 } else {
1757 onSelect((0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_6__.arrayUnionBy)(selected, item.children, 'id'))();
1758 }
1759 },
1760 onClick: e => e.stopPropagation()
1761 }), showCount ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Count, {
1762 label: countLabel || item.count
1763 }) : null)) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
1764 htmlFor: id,
1765 className: classes
1766 }, isSingle ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
1767 ...props,
1768 type: "radio",
1769 id: id,
1770 name: name,
1771 value: item.value,
1772 onChange: onSelect(item),
1773 checked: isSelected,
1774 className: "woocommerce-search-list__item-input"
1775 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemLabel, {
1776 item: item,
1777 search: search
1778 })) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, {
1779 ...props,
1780 id: id,
1781 name: name,
1782 className: "woocommerce-search-list__item-input",
1783 value: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.value),
1784 label: (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getHighlightedName)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.name), search),
1785 onChange: onSelect(item),
1786 checked: isSelected
1787 }), showCount ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Count, {
1788 label: countLabel || item.count
1789 }) : null);
1790 };
1791 SearchListItem.__docgenInfo = {
1792 "description": "",
1793 "methods": [],
1794 "displayName": "SearchListItem",
1795 "props": {
1796 "depth": {
1797 "defaultValue": {
1798 "value": "0",
1799 "computed": false
1800 },
1801 "required": false
1802 },
1803 "controlId": {
1804 "defaultValue": {
1805 "value": "''",
1806 "computed": false
1807 },
1808 "required": false
1809 },
1810 "search": {
1811 "defaultValue": {
1812 "value": "''",
1813 "computed": false
1814 },
1815 "required": false
1816 }
1817 }
1818 };
1819 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchListItem);
1820 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1821 STORYBOOK_REACT_CLASSES["assets/js/editor-components/search-list-control/item.tsx"] = {
1822 name: "SearchListItem",
1823 docgenInfo: SearchListItem.__docgenInfo,
1824 path: "assets/js/editor-components/search-list-control/item.tsx"
1825 };
1826 }
1827
1828 /***/ }),
1829
1830 /***/ "./assets/js/editor-components/search-list-control/search-list-control.tsx":
1831 /*!*********************************************************************************!*\
1832 !*** ./assets/js/editor-components/search-list-control/search-list-control.tsx ***!
1833 \*********************************************************************************/
1834 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1835
1836 "use strict";
1837 __webpack_require__.r(__webpack_exports__);
1838 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1839 /* harmony export */ SearchListControl: () => (/* binding */ SearchListControl),
1840 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1841 /* harmony export */ });
1842 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1843 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1844 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1845 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
1846 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1847 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
1848 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
1849 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
1850 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
1851 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/info.js");
1852 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
1853 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
1854 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
1855 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
1856 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./assets/js/editor-components/search-list-control/utils.tsx");
1857 /* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./item */ "./assets/js/editor-components/search-list-control/item.tsx");
1858 /* harmony import */ var _tag__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../tag */ "./assets/js/editor-components/tag/index.tsx");
1859 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./assets/js/editor-components/search-list-control/style.scss");
1860 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_6__);
1861
1862 /**
1863 * External dependencies
1864 */
1865
1866
1867
1868
1869
1870
1871
1872 /**
1873 * Internal dependencies
1874 */
1875
1876
1877
1878
1879 const defaultRenderListItem = args => {
1880 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_item__WEBPACK_IMPORTED_MODULE_7__["default"], {
1881 ...args
1882 });
1883 };
1884 const ListItems = props => {
1885 const {
1886 list,
1887 selected,
1888 renderItem,
1889 depth = 0,
1890 onSelect,
1891 instanceId,
1892 isSingle,
1893 search,
1894 useExpandedPanelId
1895 } = props;
1896 const [expandedPanelId] = useExpandedPanelId;
1897 if (!list) {
1898 return null;
1899 }
1900 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, null, list.map(item => {
1901 var _item$children, _item$children2;
1902 const isSelected = (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length && !isSingle ? item.children.every(({
1903 id
1904 }) => selected.find(selectedItem => selectedItem.id === id)) : !!selected.find(({
1905 id
1906 }) => id === item.id);
1907 const isExpanded = ((_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.length) && expandedPanelId === item.id;
1908 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
1909 key: item.id
1910 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", null, renderItem({
1911 item,
1912 isSelected,
1913 onSelect,
1914 isSingle,
1915 selected,
1916 search,
1917 depth,
1918 useExpandedPanelId,
1919 controlId: instanceId
1920 })), isExpanded ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItems, {
1921 ...props,
1922 list: item.children,
1923 depth: depth + 1
1924 }) : null);
1925 }));
1926 };
1927 const SelectedListItems = ({
1928 isLoading,
1929 isSingle,
1930 selected,
1931 messages,
1932 onChange,
1933 onRemove
1934 }) => {
1935 if (isLoading || isSingle || !selected) {
1936 return null;
1937 }
1938 const selectedCount = selected.length;
1939 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1940 className: "woocommerce-search-list__selected"
1941 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1942 className: "woocommerce-search-list__selected-header"
1943 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, messages.selected(selectedCount)), selectedCount > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
1944 variant: "link",
1945 isDestructive: true,
1946 onClick: () => onChange([]),
1947 "aria-label": messages.clear
1948 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Clear all', 'woocommerce')) : null), selectedCount > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", null, selected.map((item, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", {
1949 key: i
1950 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tag__WEBPACK_IMPORTED_MODULE_8__["default"], {
1951 label: item.name,
1952 id: item.id,
1953 remove: onRemove
1954 })))) : null);
1955 };
1956 const ListItemsContainer = ({
1957 filteredList,
1958 search,
1959 onSelect,
1960 instanceId,
1961 useExpandedPanelId,
1962 ...props
1963 }) => {
1964 const {
1965 messages,
1966 renderItem,
1967 selected,
1968 isSingle
1969 } = props;
1970 const renderItemCallback = renderItem || defaultRenderListItem;
1971 if (filteredList.length === 0) {
1972 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1973 className: "woocommerce-search-list__list is-not-found"
1974 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1975 className: "woocommerce-search-list__not-found-icon"
1976 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"], {
1977 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__["default"],
1978 role: "img"
1979 })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1980 className: "woocommerce-search-list__not-found-text"
1981 }, search ?
1982 // eslint-disable-next-line @wordpress/valid-sprintf
1983 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(messages.noResults, search) : messages.noItems));
1984 }
1985 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", {
1986 className: "woocommerce-search-list__list"
1987 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItems, {
1988 useExpandedPanelId: useExpandedPanelId,
1989 list: filteredList,
1990 selected: selected,
1991 renderItem: renderItemCallback,
1992 onSelect: onSelect,
1993 instanceId: instanceId,
1994 isSingle: isSingle,
1995 search: search
1996 }));
1997 };
1998
1999 /**
2000 * Component to display a searchable, selectable list of items.
2001 */
2002 const SearchListControl = props => {
2003 const {
2004 className = '',
2005 isCompact,
2006 isHierarchical,
2007 isLoading,
2008 isSingle,
2009 list,
2010 messages: customMessages = _utils__WEBPACK_IMPORTED_MODULE_11__.defaultMessages,
2011 onChange,
2012 onSearch,
2013 selected,
2014 type = 'text',
2015 debouncedSpeak
2016 } = props;
2017 const [search, setSearch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('');
2018 const useExpandedPanelId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(-1);
2019 const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useInstanceId)(SearchListControl);
2020 const messages = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => ({
2021 ..._utils__WEBPACK_IMPORTED_MODULE_11__.defaultMessages,
2022 ...customMessages
2023 }), [customMessages]);
2024 const filteredList = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => {
2025 return (0,_utils__WEBPACK_IMPORTED_MODULE_11__.getFilteredList)(list, search, isHierarchical);
2026 }, [list, search, isHierarchical]);
2027 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
2028 if (debouncedSpeak) {
2029 debouncedSpeak(messages.updated);
2030 }
2031 }, [debouncedSpeak, messages]);
2032 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
2033 if (typeof onSearch === 'function') {
2034 onSearch(search);
2035 }
2036 }, [search, onSearch]);
2037 const onRemove = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(itemId => () => {
2038 if (isSingle) {
2039 onChange([]);
2040 }
2041 const i = selected.findIndex(({
2042 id: selectedId
2043 }) => selectedId === itemId);
2044 onChange([...selected.slice(0, i), ...selected.slice(i + 1)]);
2045 }, [isSingle, selected, onChange]);
2046 const onSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(item => () => {
2047 if (Array.isArray(item)) {
2048 onChange(item);
2049 return;
2050 }
2051 if (selected.findIndex(({
2052 id
2053 }) => id === item.id) !== -1) {
2054 onRemove(item.id)();
2055 return;
2056 }
2057 if (isSingle) {
2058 onChange([item]);
2059 } else {
2060 onChange([...selected, item]);
2061 }
2062 }, [isSingle, onRemove, onChange, selected]);
2063 const onRemoveToken = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(tokens => {
2064 const [removedItem] = selected.filter(item => !tokens.find(token => item.id === token.id));
2065 onRemove(removedItem.id)();
2066 }, [onRemove, selected]);
2067 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
2068 className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('woocommerce-search-list', className, {
2069 'is-compact': isCompact,
2070 'is-loading': isLoading,
2071 'is-token': type === 'token'
2072 })
2073 }, type === 'text' && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectedListItems, {
2074 ...props,
2075 onRemove: onRemove,
2076 messages: messages
2077 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
2078 className: "woocommerce-search-list__search"
2079 }, type === 'text' ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, {
2080 label: messages.search,
2081 type: "search",
2082 value: search,
2083 onChange: value => setSearch(value)
2084 }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.FormTokenField, {
2085 disabled: isLoading,
2086 label: messages.search,
2087 onChange: onRemoveToken,
2088 onInputChange: value => setSearch(value),
2089 suggestions: []
2090 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2091 // @ts-ignore - Ignoring because `__experimentalValidateInput` is not yet in the type definitions.
2092 ,
2093 __experimentalValidateInput: () => false,
2094 value: isLoading ? [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Loading…', 'woocommerce')] : selected.map(token => ({
2095 ...token,
2096 value: token.name
2097 })),
2098 __experimentalShowHowTo: false
2099 })), isLoading ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
2100 className: "woocommerce-search-list__list"
2101 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, null)) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItemsContainer, {
2102 ...props,
2103 search: search,
2104 filteredList: filteredList,
2105 messages: messages,
2106 onSelect: onSelect,
2107 instanceId: instanceId,
2108 useExpandedPanelId: useExpandedPanelId
2109 }));
2110 };
2111 SearchListControl.__docgenInfo = {
2112 "description": "Component to display a searchable, selectable list of items.",
2113 "methods": [],
2114 "displayName": "SearchListControl"
2115 };
2116 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.withSpokenMessages)(SearchListControl));
2117 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
2118 STORYBOOK_REACT_CLASSES["assets/js/editor-components/search-list-control/search-list-control.tsx"] = {
2119 name: "SearchListControl",
2120 docgenInfo: SearchListControl.__docgenInfo,
2121 path: "assets/js/editor-components/search-list-control/search-list-control.tsx"
2122 };
2123 }
2124
2125 /***/ }),
2126
2127 /***/ "./assets/js/editor-components/search-list-control/utils.tsx":
2128 /*!*******************************************************************!*\
2129 !*** ./assets/js/editor-components/search-list-control/utils.tsx ***!
2130 \*******************************************************************/
2131 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2132
2133 "use strict";
2134 __webpack_require__.r(__webpack_exports__);
2135 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2136 /* harmony export */ buildTermsTree: () => (/* binding */ buildTermsTree),
2137 /* harmony export */ defaultMessages: () => (/* binding */ defaultMessages),
2138 /* harmony export */ getBreadcrumbsForDisplay: () => (/* binding */ getBreadcrumbsForDisplay),
2139 /* harmony export */ getFilteredList: () => (/* binding */ getFilteredList),
2140 /* harmony export */ getHighlightedName: () => (/* binding */ getHighlightedName)
2141 /* harmony export */ });
2142 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2143 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2144 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
2145 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
2146 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2147 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
2148 /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/keyby.ts");
2149
2150 /**
2151 * External dependencies
2152 */
2153
2154
2155
2156
2157 /**
2158 * Internal dependencies
2159 */
2160
2161 const defaultMessages = {
2162 clear: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Clear all selected items', 'woocommerce'),
2163 noItems: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No items found.', 'woocommerce'),
2164 /* Translators: %s search term */
2165 noResults: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No results for %s', 'woocommerce'),
2166 search: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search for items', 'woocommerce'),
2167 selected: n => (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: Number of items selected from list. */
2168 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('%d item selected', '%d items selected', n, 'woocommerce'), n),
2169 updated: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search results updated.', 'woocommerce')
2170 };
2171
2172 /**
2173 * Returns terms in a tree form.
2174 *
2175 * @param {Array} filteredList Array of terms, possibly a subset of all terms, in flat format.
2176 * @param {Array} list Array of the full list of terms, defaults to the filteredList.
2177 *
2178 * @return {Array} Array of terms in tree format.
2179 */
2180 const buildTermsTree = (filteredList, list = filteredList) => {
2181 const termsByParent = filteredList.reduce((acc, currentValue) => {
2182 const key = currentValue.parent || 0;
2183 if (!acc[key]) {
2184 acc[key] = [];
2185 }
2186 acc[key].push(currentValue);
2187 return acc;
2188 }, {});
2189 const listById = (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_3__.keyBy)(list, 'id');
2190 const builtParents = ['0'];
2191 const getParentsName = (term = {}) => {
2192 if (!term.parent) {
2193 return term.name ? [term.name] : [];
2194 }
2195 const parentName = getParentsName(listById[term.parent]);
2196 return [...parentName, term.name];
2197 };
2198 const fillWithChildren = terms => {
2199 return terms.map(term => {
2200 const children = termsByParent[term.id];
2201 builtParents.push('' + term.id);
2202 return {
2203 ...term,
2204 breadcrumbs: getParentsName(listById[term.parent]),
2205 children: children && children.length ? fillWithChildren(children) : []
2206 };
2207 });
2208 };
2209 const tree = fillWithChildren(termsByParent['0'] || []);
2210
2211 // Handle remaining items in termsByParent that have not been built (orphaned).
2212 Object.entries(termsByParent).forEach(([termId, terms]) => {
2213 if (!builtParents.includes(termId)) {
2214 tree.push(...fillWithChildren(terms || []));
2215 }
2216 });
2217 return tree;
2218 };
2219 const getFilteredList = (list, search, isHierarchical) => {
2220 if (!search) {
2221 return isHierarchical ? buildTermsTree(list) : list;
2222 }
2223 const re = new RegExp(search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'i');
2224 const filteredList = list.map(item => re.test(item.name) ? item : false).filter(Boolean);
2225 return isHierarchical ? buildTermsTree(filteredList, list) : filteredList;
2226 };
2227 const getHighlightedName = (name, search) => {
2228 if (!search) {
2229 return name;
2230 }
2231 const re = new RegExp(
2232 // Escaping.
2233 `(${search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')})`, 'ig');
2234 const nameParts = name.split(re);
2235 return nameParts.map((part, i) => {
2236 return re.test(part) ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", {
2237 key: i
2238 }, part) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2239 key: i
2240 }, part);
2241 });
2242 };
2243 const getBreadcrumbsForDisplay = breadcrumbs => {
2244 if (breadcrumbs.length === 1) {
2245 return breadcrumbs.slice(0, 1).toString();
2246 }
2247 if (breadcrumbs.length === 2) {
2248 return breadcrumbs.slice(0, 1).toString() + '' + breadcrumbs.slice(-1).toString();
2249 }
2250 return breadcrumbs.slice(0, 1).toString() + '' + breadcrumbs.slice(-1).toString();
2251 };
2252
2253 /***/ }),
2254
2255 /***/ "./assets/js/editor-components/tag/index.tsx":
2256 /*!***************************************************!*\
2257 !*** ./assets/js/editor-components/tag/index.tsx ***!
2258 \***************************************************/
2259 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2260
2261 "use strict";
2262 __webpack_require__.r(__webpack_exports__);
2263 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2264 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2265 /* harmony export */ });
2266 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2267 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2268 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2269 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2270 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
2271 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
2272 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
2273 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
2274 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
2275 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/cancel-circle-filled.js");
2276 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
2277 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__);
2278 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
2279 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
2280 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
2281 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
2282 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/editor-components/tag/editor.scss");
2283 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_7__);
2284
2285 /**
2286 * External dependencies
2287 */
2288
2289
2290
2291
2292
2293
2294
2295
2296 /**
2297 * Internal dependencies
2298 */
2299
2300
2301 /**
2302 * This component can be used to show an item styled as a "tag", optionally with an `X` + "remove"
2303 * or with a popover that is shown on click.
2304 */
2305 const Tag = ({
2306 id,
2307 label,
2308 popoverContents,
2309 remove,
2310 screenReaderLabel,
2311 className = ''
2312 }) => {
2313 const [isVisible, setIsVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(false);
2314 const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useInstanceId)(Tag);
2315 screenReaderLabel = screenReaderLabel || label;
2316 if (!label) {
2317 // A null label probably means something went wrong
2318 return null;
2319 }
2320 label = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(label);
2321 const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('woocommerce-tag', className, {
2322 'has-remove': !!remove
2323 });
2324 const labelId = `woocommerce-tag__label-${instanceId}`;
2325 const labelTextNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2326 className: "screen-reader-text"
2327 }, screenReaderLabel), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2328 "aria-hidden": "true"
2329 }, label));
2330 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2331 className: classes
2332 }, popoverContents ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
2333 className: "woocommerce-tag__text",
2334 id: labelId,
2335 onClick: () => setIsVisible(true)
2336 }, labelTextNode) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2337 className: "woocommerce-tag__text",
2338 id: labelId
2339 }, labelTextNode), popoverContents && isVisible && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Popover, {
2340 onClose: () => setIsVisible(false)
2341 }, popoverContents), remove && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
2342 className: "woocommerce-tag__remove",
2343 onClick: remove(id),
2344 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
2345 // Translators: %s label.
2346 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove %s', 'woocommerce'), label),
2347 "aria-describedby": labelId
2348 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"], {
2349 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"],
2350 size: 20,
2351 className: "clear-icon",
2352 role: "img"
2353 })));
2354 };
2355 Tag.__docgenInfo = {
2356 "description": "This component can be used to show an item styled as a \"tag\", optionally with an `X` + \"remove\"\nor with a popover that is shown on click.",
2357 "methods": [],
2358 "displayName": "Tag",
2359 "props": {
2360 "className": {
2361 "defaultValue": {
2362 "value": "''",
2363 "computed": false
2364 },
2365 "required": false,
2366 "tsType": {
2367 "name": "string"
2368 },
2369 "description": ""
2370 },
2371 "id": {
2372 "required": true,
2373 "tsType": {
2374 "name": "union",
2375 "raw": "string | number",
2376 "elements": [{
2377 "name": "string"
2378 }, {
2379 "name": "number"
2380 }]
2381 },
2382 "description": ""
2383 },
2384 "label": {
2385 "required": true,
2386 "tsType": {
2387 "name": "string"
2388 },
2389 "description": ""
2390 },
2391 "popoverContents": {
2392 "required": false,
2393 "tsType": {
2394 "name": "JSX.Element"
2395 },
2396 "description": ""
2397 },
2398 "remove": {
2399 "required": false,
2400 "tsType": {
2401 "name": "signature",
2402 "type": "function",
2403 "raw": "( id: string | number ) => () => void",
2404 "signature": {
2405 "arguments": [{
2406 "name": "id",
2407 "type": {
2408 "name": "union",
2409 "raw": "string | number",
2410 "elements": [{
2411 "name": "string"
2412 }, {
2413 "name": "number"
2414 }]
2415 }
2416 }],
2417 "return": {
2418 "name": "signature",
2419 "type": "function",
2420 "raw": "() => void",
2421 "signature": {
2422 "arguments": [],
2423 "return": {
2424 "name": "void"
2425 }
2426 }
2427 }
2428 }
2429 },
2430 "description": ""
2431 },
2432 "screenReaderLabel": {
2433 "required": false,
2434 "tsType": {
2435 "name": "string"
2436 },
2437 "description": ""
2438 }
2439 }
2440 };
2441 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tag);
2442 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
2443 STORYBOOK_REACT_CLASSES["assets/js/editor-components/tag/index.tsx"] = {
2444 name: "Tag",
2445 docgenInfo: Tag.__docgenInfo,
2446 path: "assets/js/editor-components/tag/index.tsx"
2447 };
2448 }
2449
2450 /***/ }),
2451
2452 /***/ "./assets/js/types/type-guards/boolean.ts":
2453 /*!************************************************!*\
2454 !*** ./assets/js/types/type-guards/boolean.ts ***!
2455 \************************************************/
2456 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2457
2458 "use strict";
2459 __webpack_require__.r(__webpack_exports__);
2460 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2461 /* harmony export */ isBoolean: () => (/* binding */ isBoolean)
2462 /* harmony export */ });
2463 const isBoolean = term => {
2464 return typeof term === 'boolean';
2465 };
2466
2467 /***/ }),
2468
2469 /***/ "./assets/js/types/type-guards/error.ts":
2470 /*!**********************************************!*\
2471 !*** ./assets/js/types/type-guards/error.ts ***!
2472 \**********************************************/
2473 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2474
2475 "use strict";
2476 __webpack_require__.r(__webpack_exports__);
2477 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2478 /* harmony export */ isError: () => (/* binding */ isError)
2479 /* harmony export */ });
2480 const isError = term => {
2481 return term instanceof Error;
2482 };
2483
2484 /***/ }),
2485
2486 /***/ "./assets/js/types/type-guards/null.ts":
2487 /*!*********************************************!*\
2488 !*** ./assets/js/types/type-guards/null.ts ***!
2489 \*********************************************/
2490 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2491
2492 "use strict";
2493 __webpack_require__.r(__webpack_exports__);
2494 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2495 /* harmony export */ isNull: () => (/* binding */ isNull)
2496 /* harmony export */ });
2497 const isNull = term => {
2498 return term === null;
2499 };
2500
2501 /***/ }),
2502
2503 /***/ "./assets/js/types/type-guards/object.ts":
2504 /*!***********************************************!*\
2505 !*** ./assets/js/types/type-guards/object.ts ***!
2506 \***********************************************/
2507 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2508
2509 "use strict";
2510 __webpack_require__.r(__webpack_exports__);
2511 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2512 /* harmony export */ isEmptyObject: () => (/* binding */ isEmptyObject),
2513 /* harmony export */ isObject: () => (/* binding */ isObject),
2514 /* harmony export */ objectHasProp: () => (/* binding */ objectHasProp)
2515 /* harmony export */ });
2516 /* harmony import */ var _null__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./null */ "./assets/js/types/type-guards/null.ts");
2517 /**
2518 * Internal dependencies
2519 */
2520
2521
2522 const isObject = term => {
2523 return !(0,_null__WEBPACK_IMPORTED_MODULE_0__.isNull)(term) && term instanceof Object && term.constructor === Object;
2524 };
2525 function objectHasProp(target, property) {
2526 // The `in` operator throws a `TypeError` for non-object values.
2527 return isObject(target) && property in target;
2528 }
2529 const isEmptyObject = object => {
2530 return Object.keys(object).length === 0;
2531 };
2532
2533 /***/ }),
2534
2535 /***/ "./assets/js/types/type-guards/string.ts":
2536 /*!***********************************************!*\
2537 !*** ./assets/js/types/type-guards/string.ts ***!
2538 \***********************************************/
2539 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2540
2541 "use strict";
2542 __webpack_require__.r(__webpack_exports__);
2543 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2544 /* harmony export */ isString: () => (/* binding */ isString)
2545 /* harmony export */ });
2546 const isString = term => {
2547 return typeof term === 'string';
2548 };
2549
2550 /***/ }),
2551
2552 /***/ "./assets/js/utils/array-operations.ts":
2553 /*!*********************************************!*\
2554 !*** ./assets/js/utils/array-operations.ts ***!
2555 \*********************************************/
2556 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2557
2558 "use strict";
2559 __webpack_require__.r(__webpack_exports__);
2560 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2561 /* harmony export */ arrayDifferenceBy: () => (/* binding */ arrayDifferenceBy),
2562 /* harmony export */ arrayUnionBy: () => (/* binding */ arrayUnionBy)
2563 /* harmony export */ });
2564 /**
2565 * Returns the difference between two arrays (A - B)
2566 */
2567 function arrayDifferenceBy(a, b, key) {
2568 const keys = new Set(b.map(item => item[key]));
2569 return a.filter(item => !keys.has(item[key]));
2570 }
2571
2572 /**
2573 * Returns the union of two arrays (A ∪ B)
2574 */
2575 function arrayUnionBy(a, b, key) {
2576 const difference = arrayDifferenceBy(b, a, key);
2577 return [...a, ...difference];
2578 }
2579
2580 /***/ }),
2581
2582 /***/ "./assets/js/utils/filters.ts":
2583 /*!************************************!*\
2584 !*** ./assets/js/utils/filters.ts ***!
2585 \************************************/
2586 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2587
2588 "use strict";
2589 __webpack_require__.r(__webpack_exports__);
2590 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2591 /* harmony export */ PREFIX_QUERY_ARG_FILTER_TYPE: () => (/* binding */ PREFIX_QUERY_ARG_FILTER_TYPE),
2592 /* harmony export */ PREFIX_QUERY_ARG_QUERY_TYPE: () => (/* binding */ PREFIX_QUERY_ARG_QUERY_TYPE),
2593 /* harmony export */ changeUrl: () => (/* binding */ changeUrl),
2594 /* harmony export */ getUrlParameter: () => (/* binding */ getUrlParameter),
2595 /* harmony export */ normalizeQueryParams: () => (/* binding */ normalizeQueryParams)
2596 /* harmony export */ });
2597 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
2598 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
2599 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
2600 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__);
2601 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/boolean.ts");
2602 /**
2603 * External dependencies
2604 */
2605
2606
2607
2608 const filteringForPhpTemplate = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__.getSettingWithCoercion)('isRenderingPhpTemplate', false, _woocommerce_types__WEBPACK_IMPORTED_MODULE_2__.isBoolean);
2609
2610 /**
2611 * Returns specified parameter from URL
2612 *
2613 * @param {string} name Parameter you want the value of.
2614 */
2615
2616 const PREFIX_QUERY_ARG_QUERY_TYPE = 'query_type_';
2617 const PREFIX_QUERY_ARG_FILTER_TYPE = 'filter_';
2618 function getUrlParameter(name) {
2619 if (!window) {
2620 return null;
2621 }
2622 return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.getQueryArg)(window.location.href, name);
2623 }
2624
2625 /**
2626 * Change the URL and reload the page if filtering for PHP templates.
2627 *
2628 * @param {string} newUrl New URL to be set.
2629 */
2630 function changeUrl(newUrl) {
2631 if (filteringForPhpTemplate) {
2632 /**
2633 * We want to remove page number from URL whenever filters are changed.
2634 * This will move the user to the first page of results.
2635 *
2636 * There are following page number formats:
2637 * 1. query-{number}-page={number} (ex. query-1-page=2)
2638 * - ref: https://github.com/WordPress/gutenberg/blob/5693a62214b6c76d3dc5f3f69d8aad187748af79/packages/block-library/src/query-pagination-numbers/index.php#L18
2639 * 2. query-page={number} (ex. query-page=2)
2640 * - ref: same as above
2641 * 3. page/{number} (ex. page/2) (Default WordPress pagination format)
2642 */
2643 newUrl = newUrl.replace(/(?:query-(?:\d+-)?page=(\d+))|(?:page\/(\d+))/g, '');
2644
2645 /**
2646 * If the URL ends with '?', we remove the trailing '?' from the URL.
2647 * The trailing '?' in a URL is unnecessary and can cause the page to
2648 * reload, which can negatively affect performance. By removing the '?',
2649 * we prevent this unnecessary reload. This is safe to do even if there
2650 * are query parameters, as they will not be affected by the removal
2651 * of a trailing '?'.
2652 */
2653 if (newUrl.endsWith('?')) {
2654 newUrl = newUrl.slice(0, -1);
2655 }
2656 window.location.href = newUrl;
2657 } else {
2658 window.history.replaceState({}, '', newUrl);
2659 }
2660 }
2661
2662 /**
2663 * Run the query params through buildQueryString to normalise the params.
2664 *
2665 * @param {string} url URL to encode the search param from.
2666 */
2667 const normalizeQueryParams = url => {
2668 const queryArgs = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.getQueryArgs)(url);
2669 return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(url, queryArgs);
2670 };
2671
2672 /***/ }),
2673
2674 /***/ "./assets/js/base/components/form-token-field/style.scss":
2675 /*!***************************************************************!*\
2676 !*** ./assets/js/base/components/form-token-field/style.scss ***!
2677 \***************************************************************/
2678 /***/ (() => {
2679
2680
2681
2682 /***/ }),
2683
2684 /***/ "./assets/js/base/components/product-rating/style.scss":
2685 /*!*************************************************************!*\
2686 !*** ./assets/js/base/components/product-rating/style.scss ***!
2687 \*************************************************************/
2688 /***/ (() => {
2689
2690
2691
2692 /***/ }),
2693
2694 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/editor.scss":
2695 /*!************************************************************************************!*\
2696 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/editor.scss ***!
2697 \************************************************************************************/
2698 /***/ (() => {
2699
2700
2701
2702 /***/ }),
2703
2704 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/style.scss":
2705 /*!***********************************************************************************!*\
2706 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/style.scss ***!
2707 \***********************************************************************************/
2708 /***/ (() => {
2709
2710
2711
2712 /***/ }),
2713
2714 /***/ "./assets/js/editor-components/search-list-control/style.scss":
2715 /*!********************************************************************!*\
2716 !*** ./assets/js/editor-components/search-list-control/style.scss ***!
2717 \********************************************************************/
2718 /***/ (() => {
2719
2720
2721
2722 /***/ }),
2723
2724 /***/ "./assets/js/editor-components/tag/editor.scss":
2725 /*!*****************************************************!*\
2726 !*** ./assets/js/editor-components/tag/editor.scss ***!
2727 \*****************************************************/
2728 /***/ (() => {
2729
2730
2731
2732 /***/ }),
2733
2734 /***/ "react":
2735 /*!************************!*\
2736 !*** external "React" ***!
2737 \************************/
2738 /***/ ((module) => {
2739
2740 "use strict";
2741 module.exports = window["React"];
2742
2743 /***/ }),
2744
2745 /***/ "lodash":
2746 /*!*************************!*\
2747 !*** external "lodash" ***!
2748 \*************************/
2749 /***/ ((module) => {
2750
2751 "use strict";
2752 module.exports = window["lodash"];
2753
2754 /***/ }),
2755
2756 /***/ "@woocommerce/blocks-components":
2757 /*!******************************************!*\
2758 !*** external ["wc","blocksComponents"] ***!
2759 \******************************************/
2760 /***/ ((module) => {
2761
2762 "use strict";
2763 module.exports = window["wc"]["blocksComponents"];
2764
2765 /***/ }),
2766
2767 /***/ "@woocommerce/block-data":
2768 /*!**************************************!*\
2769 !*** external ["wc","wcBlocksData"] ***!
2770 \**************************************/
2771 /***/ ((module) => {
2772
2773 "use strict";
2774 module.exports = window["wc"]["wcBlocksData"];
2775
2776 /***/ }),
2777
2778 /***/ "@woocommerce/settings":
2779 /*!************************************!*\
2780 !*** external ["wc","wcSettings"] ***!
2781 \************************************/
2782 /***/ ((module) => {
2783
2784 "use strict";
2785 module.exports = window["wc"]["wcSettings"];
2786
2787 /***/ }),
2788
2789 /***/ "@wordpress/a11y":
2790 /*!******************************!*\
2791 !*** external ["wp","a11y"] ***!
2792 \******************************/
2793 /***/ ((module) => {
2794
2795 "use strict";
2796 module.exports = window["wp"]["a11y"];
2797
2798 /***/ }),
2799
2800 /***/ "@wordpress/block-editor":
2801 /*!*************************************!*\
2802 !*** external ["wp","blockEditor"] ***!
2803 \*************************************/
2804 /***/ ((module) => {
2805
2806 "use strict";
2807 module.exports = window["wp"]["blockEditor"];
2808
2809 /***/ }),
2810
2811 /***/ "@wordpress/blocks":
2812 /*!********************************!*\
2813 !*** external ["wp","blocks"] ***!
2814 \********************************/
2815 /***/ ((module) => {
2816
2817 "use strict";
2818 module.exports = window["wp"]["blocks"];
2819
2820 /***/ }),
2821
2822 /***/ "@wordpress/components":
2823 /*!************************************!*\
2824 !*** external ["wp","components"] ***!
2825 \************************************/
2826 /***/ ((module) => {
2827
2828 "use strict";
2829 module.exports = window["wp"]["components"];
2830
2831 /***/ }),
2832
2833 /***/ "@wordpress/compose":
2834 /*!*********************************!*\
2835 !*** external ["wp","compose"] ***!
2836 \*********************************/
2837 /***/ ((module) => {
2838
2839 "use strict";
2840 module.exports = window["wp"]["compose"];
2841
2842 /***/ }),
2843
2844 /***/ "@wordpress/data":
2845 /*!******************************!*\
2846 !*** external ["wp","data"] ***!
2847 \******************************/
2848 /***/ ((module) => {
2849
2850 "use strict";
2851 module.exports = window["wp"]["data"];
2852
2853 /***/ }),
2854
2855 /***/ "@wordpress/deprecated":
2856 /*!************************************!*\
2857 !*** external ["wp","deprecated"] ***!
2858 \************************************/
2859 /***/ ((module) => {
2860
2861 "use strict";
2862 module.exports = window["wp"]["deprecated"];
2863
2864 /***/ }),
2865
2866 /***/ "@wordpress/dom":
2867 /*!*****************************!*\
2868 !*** external ["wp","dom"] ***!
2869 \*****************************/
2870 /***/ ((module) => {
2871
2872 "use strict";
2873 module.exports = window["wp"]["dom"];
2874
2875 /***/ }),
2876
2877 /***/ "@wordpress/element":
2878 /*!*********************************!*\
2879 !*** external ["wp","element"] ***!
2880 \*********************************/
2881 /***/ ((module) => {
2882
2883 "use strict";
2884 module.exports = window["wp"]["element"];
2885
2886 /***/ }),
2887
2888 /***/ "@wordpress/html-entities":
2889 /*!**************************************!*\
2890 !*** external ["wp","htmlEntities"] ***!
2891 \**************************************/
2892 /***/ ((module) => {
2893
2894 "use strict";
2895 module.exports = window["wp"]["htmlEntities"];
2896
2897 /***/ }),
2898
2899 /***/ "@wordpress/i18n":
2900 /*!******************************!*\
2901 !*** external ["wp","i18n"] ***!
2902 \******************************/
2903 /***/ ((module) => {
2904
2905 "use strict";
2906 module.exports = window["wp"]["i18n"];
2907
2908 /***/ }),
2909
2910 /***/ "@wordpress/is-shallow-equal":
2911 /*!****************************************!*\
2912 !*** external ["wp","isShallowEqual"] ***!
2913 \****************************************/
2914 /***/ ((module) => {
2915
2916 "use strict";
2917 module.exports = window["wp"]["isShallowEqual"];
2918
2919 /***/ }),
2920
2921 /***/ "@wordpress/keycodes":
2922 /*!**********************************!*\
2923 !*** external ["wp","keycodes"] ***!
2924 \**********************************/
2925 /***/ ((module) => {
2926
2927 "use strict";
2928 module.exports = window["wp"]["keycodes"];
2929
2930 /***/ }),
2931
2932 /***/ "@wordpress/primitives":
2933 /*!************************************!*\
2934 !*** external ["wp","primitives"] ***!
2935 \************************************/
2936 /***/ ((module) => {
2937
2938 "use strict";
2939 module.exports = window["wp"]["primitives"];
2940
2941 /***/ }),
2942
2943 /***/ "@wordpress/url":
2944 /*!*****************************!*\
2945 !*** external ["wp","url"] ***!
2946 \*****************************/
2947 /***/ ((module) => {
2948
2949 "use strict";
2950 module.exports = window["wp"]["url"];
2951
2952 /***/ }),
2953
2954 /***/ "@wordpress/warning":
2955 /*!*********************************!*\
2956 !*** external ["wp","warning"] ***!
2957 \*********************************/
2958 /***/ ((module) => {
2959
2960 "use strict";
2961 module.exports = window["wp"]["warning"];
2962
2963 /***/ }),
2964
2965 /***/ "./assets/js/blocks/collection-filters/inner-blocks/rating-filter/block.json":
2966 /*!***********************************************************************************!*\
2967 !*** ./assets/js/blocks/collection-filters/inner-blocks/rating-filter/block.json ***!
2968 \***********************************************************************************/
2969 /***/ ((module) => {
2970
2971 "use strict";
2972 module.exports = JSON.parse('{"name":"woocommerce/collection-rating-filter","version":"1.0.0","title":"Collection Rating Filter","description":"Enable customers to filter the product collection by rating.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"interactivity":true},"ancestor":["woocommerce/collection-filters"],"usesContext":["collectionData"],"attributes":{"className":{"type":"string","default":""},"showCounts":{"type":"boolean","default":false},"displayStyle":{"type":"string","default":"list"},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false},"queryParam":{"type":"object","default":{"calculate_rating_counts":"true"}}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}');
2973
2974 /***/ })
2975
2976 /******/ });
2977 /************************************************************************/
2978 /******/ // The module cache
2979 /******/ var __webpack_module_cache__ = {};
2980 /******/
2981 /******/ // The require function
2982 /******/ function __webpack_require__(moduleId) {
2983 /******/ // Check if module is in cache
2984 /******/ var cachedModule = __webpack_module_cache__[moduleId];
2985 /******/ if (cachedModule !== undefined) {
2986 /******/ return cachedModule.exports;
2987 /******/ }
2988 /******/ // Create a new module (and put it into the cache)
2989 /******/ var module = __webpack_module_cache__[moduleId] = {
2990 /******/ // no module.id needed
2991 /******/ // no module.loaded needed
2992 /******/ exports: {}
2993 /******/ };
2994 /******/
2995 /******/ // Execute the module function
2996 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
2997 /******/
2998 /******/ // Return the exports of the module
2999 /******/ return module.exports;
3000 /******/ }
3001 /******/
3002 /******/ // expose the modules object (__webpack_modules__)
3003 /******/ __webpack_require__.m = __webpack_modules__;
3004 /******/
3005 /************************************************************************/
3006 /******/ /* webpack/runtime/chunk loaded */
3007 /******/ (() => {
3008 /******/ var deferred = [];
3009 /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
3010 /******/ if(chunkIds) {
3011 /******/ priority = priority || 0;
3012 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
3013 /******/ deferred[i] = [chunkIds, fn, priority];
3014 /******/ return;
3015 /******/ }
3016 /******/ var notFulfilled = Infinity;
3017 /******/ for (var i = 0; i < deferred.length; i++) {
3018 /******/ var [chunkIds, fn, priority] = deferred[i];
3019 /******/ var fulfilled = true;
3020 /******/ for (var j = 0; j < chunkIds.length; j++) {
3021 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
3022 /******/ chunkIds.splice(j--, 1);
3023 /******/ } else {
3024 /******/ fulfilled = false;
3025 /******/ if(priority < notFulfilled) notFulfilled = priority;
3026 /******/ }
3027 /******/ }
3028 /******/ if(fulfilled) {
3029 /******/ deferred.splice(i--, 1)
3030 /******/ var r = fn();
3031 /******/ if (r !== undefined) result = r;
3032 /******/ }
3033 /******/ }
3034 /******/ return result;
3035 /******/ };
3036 /******/ })();
3037 /******/
3038 /******/ /* webpack/runtime/compat get default export */
3039 /******/ (() => {
3040 /******/ // getDefaultExport function for compatibility with non-harmony modules
3041 /******/ __webpack_require__.n = (module) => {
3042 /******/ var getter = module && module.__esModule ?
3043 /******/ () => (module['default']) :
3044 /******/ () => (module);
3045 /******/ __webpack_require__.d(getter, { a: getter });
3046 /******/ return getter;
3047 /******/ };
3048 /******/ })();
3049 /******/
3050 /******/ /* webpack/runtime/define property getters */
3051 /******/ (() => {
3052 /******/ // define getter functions for harmony exports
3053 /******/ __webpack_require__.d = (exports, definition) => {
3054 /******/ for(var key in definition) {
3055 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
3056 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
3057 /******/ }
3058 /******/ }
3059 /******/ };
3060 /******/ })();
3061 /******/
3062 /******/ /* webpack/runtime/global */
3063 /******/ (() => {
3064 /******/ __webpack_require__.g = (function() {
3065 /******/ if (typeof globalThis === 'object') return globalThis;
3066 /******/ try {
3067 /******/ return this || new Function('return this')();
3068 /******/ } catch (e) {
3069 /******/ if (typeof window === 'object') return window;
3070 /******/ }
3071 /******/ })();
3072 /******/ })();
3073 /******/
3074 /******/ /* webpack/runtime/hasOwnProperty shorthand */
3075 /******/ (() => {
3076 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
3077 /******/ })();
3078 /******/
3079 /******/ /* webpack/runtime/make namespace object */
3080 /******/ (() => {
3081 /******/ // define __esModule on exports
3082 /******/ __webpack_require__.r = (exports) => {
3083 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
3084 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3085 /******/ }
3086 /******/ Object.defineProperty(exports, '__esModule', { value: true });
3087 /******/ };
3088 /******/ })();
3089 /******/
3090 /******/ /* webpack/runtime/jsonp chunk loading */
3091 /******/ (() => {
3092 /******/ // no baseURI
3093 /******/
3094 /******/ // object to store loaded and loading chunks
3095 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
3096 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
3097 /******/ var installedChunks = {
3098 /******/ "collection-rating-filter": 0
3099 /******/ };
3100 /******/
3101 /******/ // no chunk on demand loading
3102 /******/
3103 /******/ // no prefetching
3104 /******/
3105 /******/ // no preloaded
3106 /******/
3107 /******/ // no HMR
3108 /******/
3109 /******/ // no HMR manifest
3110 /******/
3111 /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
3112 /******/
3113 /******/ // install a JSONP callback for chunk loading
3114 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
3115 /******/ var [chunkIds, moreModules, runtime] = data;
3116 /******/ // add "moreModules" to the modules object,
3117 /******/ // then flag all "chunkIds" as loaded and fire callback
3118 /******/ var moduleId, chunkId, i = 0;
3119 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
3120 /******/ for(moduleId in moreModules) {
3121 /******/ if(__webpack_require__.o(moreModules, moduleId)) {
3122 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
3123 /******/ }
3124 /******/ }
3125 /******/ if(runtime) var result = runtime(__webpack_require__);
3126 /******/ }
3127 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
3128 /******/ for(;i < chunkIds.length; i++) {
3129 /******/ chunkId = chunkIds[i];
3130 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
3131 /******/ installedChunks[chunkId][0]();
3132 /******/ }
3133 /******/ installedChunks[chunkId] = 0;
3134 /******/ }
3135 /******/ return __webpack_require__.O(result);
3136 /******/ }
3137 /******/
3138 /******/ var chunkLoadingGlobal = self["webpackChunkwebpackWcBlocksJsonp"] = self["webpackChunkwebpackWcBlocksJsonp"] || [];
3139 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
3140 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
3141 /******/ })();
3142 /******/
3143 /************************************************************************/
3144 /******/
3145 /******/ // startup
3146 /******/ // Load entry module and return exports
3147 /******/ // This entry module depends on other loaded chunks and execution need to be delayed
3148 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["wc-blocks-vendors"], () => (__webpack_require__("./assets/js/blocks/collection-filters/inner-blocks/rating-filter/index.tsx")))
3149 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
3150 /******/ ((this.wc = this.wc || {}).blocks = this.wc.blocks || {})["collection-rating-filter"] = __webpack_exports__;
3151 /******/
3152 /******/ })()
3153 ;
3154 //# sourceMappingURL=collection-rating-filter.js.map