(()=>{"use strict";const e=window.wc.__experimentalInteractivity;function t(e){e=e.filter(Boolean);const t=new URL(window.location.href);return e.length?t.searchParams.set("rating_filter",e.join(",")):t.searchParams.delete("rating_filter"),t.href}(0,e.store)("woocommerce/collection-rating-filter",{actions:{onCheckboxChange:()=>{const o=(0,e.getContext)("woocommerce/interactivity-checkbox-list").items.filter((e=>e.checked)).map((e=>e.value));(0,e.navigate)(t(o))},onDropdownChange:()=>{var o;const n=null===(o=(0,e.getContext)("woocommerce/interactivity-dropdown").selectedItem)||void 0===o?void 0:o.value;(0,e.navigate)(t([n]))},removeFilter:()=>{const{value:o}=(0,e.getContext)(),n=new URL(window.location.href).searchParams.get("rating_filter")||"",i=""===n?[]:n.split(","),r=i.indexOf(o);r>-1&&i.splice(r,1),(0,e.navigate)(t(i))}}})})();