"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[23],{89:(e,t,s)=>{s.d(t,{a:()=>f});var l=s(0),n=s(3),r=s(21),i=s(48),d=s(58),o=s(2),a=s(71),c=s(60);function u(){const e=(0,c.a)((e=>e.filterList)),t=(0,o.useMemo)((()=>function(e){return e.some((e=>{var t;return null===(t=e.values)||void 0===t?void 0:t.some((e=>e.selected))}))}(e)),[e]);return(0,l.jsxs)("div",{class:r.a.empty,children:[(0,l.jsx)("h2",{children:"No Results"}),(0,l.jsx)("button",{"data-has-selected-filters":t,onClick:()=>{(0,a.c)(e)},children:"Clear Filters"})]})}function f({collection:e,mobile_slider:t="disabled",desktop_slider:s="disabled"}){var a;(0,i.d)(e);const[c,f]=(0,o.useState)(0),h=(0,o.useRef)(null),v=()=>{const e=h.current;if(!e)return;const t=e.getBoundingClientRect(),s=Array.from(e.children),l=s[s.length-1].getBoundingClientRect().right-t.right<45;let n=1/0;s.forEach(((e,s)=>{const r=e.getBoundingClientRect();if(l&&r.left<0)return;const i=Math.abs(r.left-t.left)+(r.left<0?20:0);i{var t;const s=null===(t=e.transformedMetafields)||void 0===t?void 0:t.disruptors;return s?e.products.flatMap(((e,t)=>{const l=s.find((e=>e.position===t+1));return l?[l,e]:e})):e.products}),[e.products,null===(a=e.transformedMetafields)||void 0===a?void 0:a.disruptors]);return(0,o.useEffect)((()=>{var e;return null===(e=h.current)||void 0===e||e.addEventListener("scroll",v),()=>{var e;null===(e=h.current)||void 0===e||e.removeEventListener("scroll",v)}}),[h.current]),0===p.length?(0,l.jsx)(u,{}):(t=function(e,t){return 1===e||"1.5"===t?"1.5":2===e?"disabled":t}(p.length,t),(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)("div",{class:r.a.container,children:(0,l.jsx)("div",{class:[r.a.collectionItems,"disabled"!==s&&r.a.desktopItemsSlider,"disabled"!==t&&r.a.mobileItemsSlider].join(" "),style:{"--collection-desktop-slider-size":s,"--collection-mobile-slider-size":t},ref:h,"data-slider":"disabled"!==t||"disabled"!==s?"true":void 0,children:p.map(((t,s)=>{if(!t)return null;const n="defaultVariantId"in t?`${t.handle}${t.defaultVariantId}`:`${t.handle}${s}`;return(0,l.jsx)(d.a,{product:t,collectionHandle:e.handle},n)}))})}),"disabled"!==t&&p.length>=parseFloat(t)&&(0,l.jsx)("div",{class:r.a.sliderDots,children:e.products.slice(0,["2.0","2.5"].includes(t)?e.products.length-1:e.products.length).map(((e,t)=>(0,l.jsx)("div",{class:[r.a.dot,t===c&&r.a.dotActive].join(" ")},t)))})]}))}}}]);