import*as t from"@wordpress/interactivity";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},r={};e.d(r,{r:()=>c});const o=(n={getContext:()=>t.getContext,store:()=>t.store},a={},e.d(a,n),a);var n,a;function s(t){if(t)return(0,o.store)(t)}function i(){return(0,o.getContext)().item}const{state:c}=(0,o.store)("woocommerce/product-filter-checkbox-list",{state:{get items(){const{storeNamespace:t,isExpanded:e,displayLimit:r}=(0,o.getContext)(),n=s(t)?.state?.selectableItems;if(!Array.isArray(n))return[];const a=function(t){const e=Number(t);return!Number.isFinite(e)||e<0?15:Math.floor(e)}(r);return n.map((t,r)=>({...t,index:r,hidden:t.hidden||!e&&!t.selected&&r>=a}))},get ratingStyle(){const t=i();return t?`width: ${20*Number(t.value)}%`:""},get colorSwatchStyle(){const t=i();return r=t?.visual,r&&"none"!==r.type&&r.value?"image"===r.type?`background-image: url('${e=r.value,e.split("'").join("%27")}');`:`background-color: ${r.value};`:"";var e,r},get isColorSwatchEmpty(){const t=i();return e=t?.visual,!e||"none"===e.type||!e.value;var e}},actions:{toggle(){const t=i();if(!t)return;const{storeNamespace:e}=(0,o.getContext)();s(e)?.actions?.toggle?.(t)},showAll(){(0,o.getContext)().isExpanded=!0}}},{lock:!0});var l=r.r;export{l as checkboxListState};