droplinked-editor-configs 1.8.5 → 1.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64011,8 +64011,8 @@ const iI = (e) => {
64011
64011
  return Object.assign(r, t), r;
64012
64012
  }, g6 = (e) => e ? iI(e) : iI, Km = {
64013
64013
  search: "",
64014
- sort: "",
64015
- productType: [],
64014
+ sortBy: "",
64015
+ productTypes: [],
64016
64016
  collectionId: []
64017
64017
  }, qr = g6((e) => ({
64018
64018
  stagedProductQuery: Km,
@@ -65333,11 +65333,11 @@ function MNe() {
65333
65333
  ] });
65334
65334
  }
65335
65335
  function ONe() {
65336
- const { isLoading: e, data: t, updateFilter: r } = j7(), n = qr((i) => i.stagedProductQuery.productType);
65336
+ const { isLoading: e, data: t, updateFilter: r } = j7(), n = qr((i) => i.stagedProductQuery.productTypes);
65337
65337
  if (e) return /* @__PURE__ */ p.jsx(A7, {});
65338
65338
  const o = (i, s) => {
65339
65339
  const a = s ? [...n, i] : n.filter((l) => l !== i);
65340
- r("productType", a);
65340
+ r("productTypes", a);
65341
65341
  };
65342
65342
  return /* @__PURE__ */ p.jsx("div", { className: "space-y-4", children: t?.types.map((i, s) => /* @__PURE__ */ p.jsx(
65343
65343
  BG,
@@ -66714,13 +66714,13 @@ function SVe() {
66714
66714
  applyStagedFilters: n.applyStagedFilters
66715
66715
  }));
66716
66716
  function r(n, o) {
66717
- n === "default" ? (e("sort", ""), e("order", void 0)) : (e("sort", n), e("order", o)), t();
66717
+ n === "default" ? (e("sortBy", ""), e("order", void 0)) : (e("sortBy", n), e("order", o)), t();
66718
66718
  }
66719
66719
  return r;
66720
66720
  }
66721
66721
  function nQ({ option: e }) {
66722
66722
  const { stagedSortOption: t, stagedSortOrder: r } = qr((c) => ({
66723
- stagedSortOption: c.stagedProductQuery.sort,
66723
+ stagedSortOption: c.stagedProductQuery.sortBy,
66724
66724
  stagedSortOrder: c.stagedProductQuery.order
66725
66725
  })), n = SVe(), { isDarkTheme: o } = st(), s = e.value === t && e.sortOrder === r || e.value === "default" && t === "" ? o ? "#222" : "#F2F2F2" : void 0, a = o ? "neutral-gray-900" : "neutral-gray-100", l = o ? "text-subtextPlaceholder-Dark" : "text-subtextPlaceholder-Light";
66726
66726
  return /* @__PURE__ */ p.jsxs(
@@ -66738,7 +66738,7 @@ function nQ({ option: e }) {
66738
66738
  }
66739
66739
  function _Ve() {
66740
66740
  const { isDarkTheme: e } = st(), { stagedSortOption: t, stagedSortOrder: r } = qr((o) => ({
66741
- stagedSortOption: o.stagedProductQuery.sort,
66741
+ stagedSortOption: o.stagedProductQuery.sortBy,
66742
66742
  stagedSortOrder: o.stagedProductQuery.order
66743
66743
  })), n = () => {
66744
66744
  const o = k6.find(
@@ -546,7 +546,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
546
546
  *
547
547
  * This source code is licensed under the MIT license found in the
548
548
  * LICENSE file in the root directory of this source tree.
549
- */var bY;function YLe(){return bY||(bY=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=vY();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,f,h,g){var v=s(null),y;v.current===null?(y={hasValue:!1,value:null},v.current=y):y=v.current;var b=a(function(){var _=!1,P,T,C=function(O){if(!_){_=!0,P=O;var R=h(O);if(g!==void 0&&y.hasValue){var L=y.value;if(g(L,R))return T=L,L}return T=R,R}var W=P,$=T;if(r(W,O))return $;var F=h(O);return g!==void 0&&g($,F)?$:(P=O,T=F,F)},E=f===void 0?null:f,S=function(){return C(d())},M=E===null?void 0:function(){return C(E())};return[S,M]},[d,f,h,g]),x=b[0],w=b[1],k=o(u,x,w);return i(function(){y.hasValue=!0,y.value=k},[k]),l(k),k}E4.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),E4}var xY;function GLe(){return xY||(xY=1,process.env.NODE_ENV==="production"?y1.exports=qLe():y1.exports=YLe()),y1.exports}var KLe=GLe();const QLe=xo(KLe),ZLe={},{useSyncExternalStoreWithSelector:XLe}=QLe;function JLe(e,t=e.getState,n){const r=XLe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return m.useDebugValue(r),r}const wY=e=>{(ZLe&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?HLe(e):e,n=(r,o)=>JLe(t,r,o);return Object.assign(n,t),n},P4=e=>e?wY(e):wY,x1={search:"",sort:"",productType:[],collectionId:[]},Vn=P4(e=>({stagedProductQuery:x1,appliedProductQuery:x1,viewMode:"grid",setStagedProductQuery:(t,n)=>e(r=>({stagedProductQuery:{...r.stagedProductQuery,[t]:n}})),applyStagedFilters:()=>e(t=>({appliedProductQuery:{...t.stagedProductQuery}})),resetProductQuery:()=>e(()=>({stagedProductQuery:x1,appliedProductQuery:x1})),setViewMode:t=>e(()=>({viewMode:t}))}));function T4(e){const t=e+"CollectionProvider",[n,r]=fi(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:b}=v,x=m.useRef(null),w=m.useRef(new Map).current;return p.jsx(o,{scope:y,itemMap:w,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",l=qu(a),c=m.forwardRef((v,y)=>{const{scope:b,children:x}=v,w=s(a,b),k=un(y,w.collectionRef);return p.jsx(l,{ref:k,children:x})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=qu(u),h=m.forwardRef((v,y)=>{const{scope:b,children:x,...w}=v,k=m.useRef(null),_=un(y,k),P=s(u,b);return m.useEffect(()=>(P.itemMap.set(k,{ref:k,...w}),()=>void P.itemMap.delete(k))),p.jsx(f,{[d]:"",ref:_,children:x})});h.displayName=u;function g(v){const y=s(e+"CollectionConsumer",v);return m.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((P,T)=>w.indexOf(P.ref.current)-w.indexOf(T.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:c,ItemSlot:h},g,r]}var w1="Collapsible",[e$e,CY]=fi(w1),[t$e,D4]=e$e(w1),kY=D.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[l,c]=gl({prop:r,defaultProp:o??!1,onChange:i,caller:w1});return p.jsx(t$e,{scope:n,disabled:s,contentId:ia(),open:l,onOpenToggle:D.useCallback(()=>c(u=>!u),[c]),children:p.jsx(Dt.div,{"data-state":O4(l),"data-disabled":s?"":void 0,...a,ref:t})})});kY.displayName=w1;var SY="CollapsibleTrigger",_Y=D.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=D4(SY,n);return p.jsx(Dt.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":O4(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Ve(e.onClick,o.onOpenToggle)})});_Y.displayName=SY;var M4="CollapsibleContent",EY=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=D4(M4,e.__scopeCollapsible);return p.jsx(Is,{present:n||o.open,children:({present:s})=>p.jsx(n$e,{...r,ref:t,present:s})})});EY.displayName=M4;var n$e=D.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=D4(M4,n),[a,l]=D.useState(r),c=D.useRef(null),u=un(t,c),d=D.useRef(0),f=d.current,h=D.useRef(0),g=h.current,v=i.open||a,y=D.useRef(v),b=D.useRef(void 0);return D.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),pi(()=>{const x=c.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,h.current=w.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[i.open,r]),p.jsx(Dt.div,{"data-state":O4(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...s,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&o})});function O4(e){return e?"open":"closed"}var r$e=kY,o$e=_Y,s$e=EY,i$e=D.createContext(void 0);function A4(e){const t=D.useContext(i$e);return e||t||"ltr"}var qo="Accordion",a$e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[j4,l$e,c$e]=T4(qo),[C1,Nze]=fi(qo,[c$e,CY]),I4=CY(),PY=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,s=r;return p.jsx(j4.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?p.jsx(p$e,{...s,ref:t}):p.jsx(f$e,{...o,ref:t})})});PY.displayName=qo;var[TY,u$e]=C1(qo),[DY,d$e]=C1(qo,{collapsible:!1}),f$e=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:s=!1,...i}=e,[a,l]=gl({prop:n,defaultProp:r??"",onChange:o,caller:qo});return p.jsx(TY,{scope:e.__scopeAccordion,value:m.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:m.useCallback(()=>s&&l(""),[s,l]),children:p.jsx(DY,{scope:e.__scopeAccordion,collapsible:s,children:p.jsx(MY,{...i,ref:t})})})}),p$e=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=gl({prop:n,defaultProp:r??[],onChange:o,caller:qo}),l=m.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=m.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return p.jsx(TY,{scope:e.__scopeAccordion,value:i,onItemOpen:l,onItemClose:c,children:p.jsx(DY,{scope:e.__scopeAccordion,collapsible:!0,children:p.jsx(MY,{...s,ref:t})})})}),[h$e,k1]=C1(qo),MY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:s="vertical",...i}=e,a=m.useRef(null),l=un(a,t),c=l$e(n),d=A4(o)==="ltr",f=Ve(e.onKeyDown,h=>{if(!a$e.includes(h.key))return;const g=h.target,v=c().filter(C=>!C.ref.current?.disabled),y=v.findIndex(C=>C.ref.current===g),b=v.length;if(y===-1)return;h.preventDefault();let x=y;const w=0,k=b-1,_=()=>{x=y+1,x>k&&(x=w)},P=()=>{x=y-1,x<w&&(x=k)};switch(h.key){case"Home":x=w;break;case"End":x=k;break;case"ArrowRight":s==="horizontal"&&(d?_():P());break;case"ArrowDown":s==="vertical"&&_();break;case"ArrowLeft":s==="horizontal"&&(d?P():_());break;case"ArrowUp":s==="vertical"&&P();break}const T=x%b;v[T].ref.current?.focus()});return p.jsx(h$e,{scope:n,disabled:r,direction:o,orientation:s,children:p.jsx(j4.Slot,{scope:n,children:p.jsx(Dt.div,{...i,"data-orientation":s,ref:l,onKeyDown:r?void 0:f})})})}),S1="AccordionItem",[m$e,L4]=C1(S1),OY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,s=k1(S1,n),i=u$e(S1,n),a=I4(n),l=ia(),c=r&&i.value.includes(r)||!1,u=s.disabled||e.disabled;return p.jsx(m$e,{scope:n,open:c,disabled:u,triggerId:l,children:p.jsx(r$e,{"data-orientation":s.orientation,"data-state":FY(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?i.onItemOpen(r):i.onItemClose(r)}})})});OY.displayName=S1;var AY="AccordionHeader",jY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=k1(qo,n),s=L4(AY,n);return p.jsx(Dt.h3,{"data-orientation":o.orientation,"data-state":FY(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});jY.displayName=AY;var $4="AccordionTrigger",IY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=k1(qo,n),s=L4($4,n),i=d$e($4,n),a=I4(n);return p.jsx(j4.ItemSlot,{scope:n,children:p.jsx(o$e,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...a,...r,ref:t})})});IY.displayName=$4;var LY="AccordionContent",$Y=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=k1(qo,n),s=L4(LY,n),i=I4(n);return p.jsx(s$e,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});$Y.displayName=LY;function FY(e){return e?"open":"closed"}var g$e=PY,v$e=OY,y$e=jY,NY=IY,RY=$Y;const b$e=g$e,BY=D.forwardRef(({className:e,...t},n)=>p.jsx(v$e,{ref:n,className:Ge("border-b",e),...t}));BY.displayName="AccordionItem";const VY=D.forwardRef(({className:e,children:t,chevronClassName:n,...r},o)=>p.jsx(y$e,{className:"flex",children:p.jsxs(NY,{ref:o,className:Ge("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,p.jsx(At.BlackChevronDown,{className:Ge("shrink-0 transition-transform duration-200",n)})]})}));VY.displayName=NY.displayName;const zY=D.forwardRef(({className:e,children:t,...n},r)=>p.jsx(RY,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:p.jsx("div",{className:Ge("pb-4 pt-0",e),children:t})}));zY.displayName=RY.displayName;function x$e(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function HY(e){const[t,n]=D.useState(void 0);return pi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _1="Checkbox",[w$e,Rze]=fi(_1),[C$e,F4]=w$e(_1);function k$e(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=gl({prop:n,defaultProp:o??!1,onChange:l,caller:_1}),[g,v]=D.useState(null),[y,b]=D.useState(null),x=D.useRef(!1),w=g?!!i||!!g.closest("form"):!0,k={checked:f,disabled:s,setChecked:h,control:g,setControl:v,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:la(o)?!1:o,isFormControl:w,bubbleInput:y,setBubbleInput:b};return p.jsx(C$e,{scope:t,...k,children:S$e(d)?d(k):r})}var WY="CheckboxTrigger",UY=D.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:g}=F4(WY,e),v=un(o,u),y=D.useRef(l);return D.useEffect(()=>{const b=s?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[s,d]),p.jsx(Dt.button,{type:"button",role:"checkbox","aria-checked":la(l)?"mixed":l,"aria-required":c,"data-state":QY(l),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:v,onKeyDown:Ve(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Ve(n,b=>{d(x=>la(x)?!0:!x),g&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});UY.displayName=WY;var N4=D.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return p.jsx(k$e,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>p.jsxs(p.Fragment,{children:[p.jsx(UY,{...d,ref:t,__scopeCheckbox:n}),f&&p.jsx(KY,{__scopeCheckbox:n})]})})});N4.displayName=_1;var qY="CheckboxIndicator",YY=D.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=F4(qY,n);return p.jsx(Is,{present:r||la(s.checked)||s.checked===!0,children:p.jsx(Dt.span,{"data-state":QY(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});YY.displayName=qY;var GY="CheckboxBubbleInput",KY=D.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:h}=F4(GY,e),g=un(n,h),v=x$e(s),y=HY(r);D.useEffect(()=>{const x=f;if(!x)return;const w=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(w,"checked").set,P=!o.current;if(v!==s&&_){const T=new Event("click",{bubbles:P});x.indeterminate=la(s),_.call(x,la(s)?!1:s),x.dispatchEvent(T)}},[f,v,s,o]);const b=D.useRef(la(s)?!1:s);return p.jsx(Dt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});KY.displayName=GY;function S$e(e){return typeof e=="function"}function la(e){return e==="indeterminate"}function QY(e){return la(e)?"indeterminate":e?"checked":"unchecked"}/**
549
+ */var bY;function YLe(){return bY||(bY=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=vY();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,f,h,g){var v=s(null),y;v.current===null?(y={hasValue:!1,value:null},v.current=y):y=v.current;var b=a(function(){var _=!1,P,T,C=function(O){if(!_){_=!0,P=O;var R=h(O);if(g!==void 0&&y.hasValue){var L=y.value;if(g(L,R))return T=L,L}return T=R,R}var W=P,$=T;if(r(W,O))return $;var F=h(O);return g!==void 0&&g($,F)?$:(P=O,T=F,F)},E=f===void 0?null:f,S=function(){return C(d())},M=E===null?void 0:function(){return C(E())};return[S,M]},[d,f,h,g]),x=b[0],w=b[1],k=o(u,x,w);return i(function(){y.hasValue=!0,y.value=k},[k]),l(k),k}E4.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),E4}var xY;function GLe(){return xY||(xY=1,process.env.NODE_ENV==="production"?y1.exports=qLe():y1.exports=YLe()),y1.exports}var KLe=GLe();const QLe=xo(KLe),ZLe={},{useSyncExternalStoreWithSelector:XLe}=QLe;function JLe(e,t=e.getState,n){const r=XLe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return m.useDebugValue(r),r}const wY=e=>{(ZLe&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?HLe(e):e,n=(r,o)=>JLe(t,r,o);return Object.assign(n,t),n},P4=e=>e?wY(e):wY,x1={search:"",sortBy:"",productTypes:[],collectionId:[]},Vn=P4(e=>({stagedProductQuery:x1,appliedProductQuery:x1,viewMode:"grid",setStagedProductQuery:(t,n)=>e(r=>({stagedProductQuery:{...r.stagedProductQuery,[t]:n}})),applyStagedFilters:()=>e(t=>({appliedProductQuery:{...t.stagedProductQuery}})),resetProductQuery:()=>e(()=>({stagedProductQuery:x1,appliedProductQuery:x1})),setViewMode:t=>e(()=>({viewMode:t}))}));function T4(e){const t=e+"CollectionProvider",[n,r]=fi(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:b}=v,x=m.useRef(null),w=m.useRef(new Map).current;return p.jsx(o,{scope:y,itemMap:w,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",l=qu(a),c=m.forwardRef((v,y)=>{const{scope:b,children:x}=v,w=s(a,b),k=un(y,w.collectionRef);return p.jsx(l,{ref:k,children:x})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=qu(u),h=m.forwardRef((v,y)=>{const{scope:b,children:x,...w}=v,k=m.useRef(null),_=un(y,k),P=s(u,b);return m.useEffect(()=>(P.itemMap.set(k,{ref:k,...w}),()=>void P.itemMap.delete(k))),p.jsx(f,{[d]:"",ref:_,children:x})});h.displayName=u;function g(v){const y=s(e+"CollectionConsumer",v);return m.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((P,T)=>w.indexOf(P.ref.current)-w.indexOf(T.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:c,ItemSlot:h},g,r]}var w1="Collapsible",[e$e,CY]=fi(w1),[t$e,D4]=e$e(w1),kY=D.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[l,c]=gl({prop:r,defaultProp:o??!1,onChange:i,caller:w1});return p.jsx(t$e,{scope:n,disabled:s,contentId:ia(),open:l,onOpenToggle:D.useCallback(()=>c(u=>!u),[c]),children:p.jsx(Dt.div,{"data-state":O4(l),"data-disabled":s?"":void 0,...a,ref:t})})});kY.displayName=w1;var SY="CollapsibleTrigger",_Y=D.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=D4(SY,n);return p.jsx(Dt.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":O4(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Ve(e.onClick,o.onOpenToggle)})});_Y.displayName=SY;var M4="CollapsibleContent",EY=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=D4(M4,e.__scopeCollapsible);return p.jsx(Is,{present:n||o.open,children:({present:s})=>p.jsx(n$e,{...r,ref:t,present:s})})});EY.displayName=M4;var n$e=D.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=D4(M4,n),[a,l]=D.useState(r),c=D.useRef(null),u=un(t,c),d=D.useRef(0),f=d.current,h=D.useRef(0),g=h.current,v=i.open||a,y=D.useRef(v),b=D.useRef(void 0);return D.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),pi(()=>{const x=c.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,h.current=w.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[i.open,r]),p.jsx(Dt.div,{"data-state":O4(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...s,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&o})});function O4(e){return e?"open":"closed"}var r$e=kY,o$e=_Y,s$e=EY,i$e=D.createContext(void 0);function A4(e){const t=D.useContext(i$e);return e||t||"ltr"}var qo="Accordion",a$e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[j4,l$e,c$e]=T4(qo),[C1,Nze]=fi(qo,[c$e,CY]),I4=CY(),PY=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,s=r;return p.jsx(j4.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?p.jsx(p$e,{...s,ref:t}):p.jsx(f$e,{...o,ref:t})})});PY.displayName=qo;var[TY,u$e]=C1(qo),[DY,d$e]=C1(qo,{collapsible:!1}),f$e=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:s=!1,...i}=e,[a,l]=gl({prop:n,defaultProp:r??"",onChange:o,caller:qo});return p.jsx(TY,{scope:e.__scopeAccordion,value:m.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:m.useCallback(()=>s&&l(""),[s,l]),children:p.jsx(DY,{scope:e.__scopeAccordion,collapsible:s,children:p.jsx(MY,{...i,ref:t})})})}),p$e=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=gl({prop:n,defaultProp:r??[],onChange:o,caller:qo}),l=m.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=m.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return p.jsx(TY,{scope:e.__scopeAccordion,value:i,onItemOpen:l,onItemClose:c,children:p.jsx(DY,{scope:e.__scopeAccordion,collapsible:!0,children:p.jsx(MY,{...s,ref:t})})})}),[h$e,k1]=C1(qo),MY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:s="vertical",...i}=e,a=m.useRef(null),l=un(a,t),c=l$e(n),d=A4(o)==="ltr",f=Ve(e.onKeyDown,h=>{if(!a$e.includes(h.key))return;const g=h.target,v=c().filter(C=>!C.ref.current?.disabled),y=v.findIndex(C=>C.ref.current===g),b=v.length;if(y===-1)return;h.preventDefault();let x=y;const w=0,k=b-1,_=()=>{x=y+1,x>k&&(x=w)},P=()=>{x=y-1,x<w&&(x=k)};switch(h.key){case"Home":x=w;break;case"End":x=k;break;case"ArrowRight":s==="horizontal"&&(d?_():P());break;case"ArrowDown":s==="vertical"&&_();break;case"ArrowLeft":s==="horizontal"&&(d?P():_());break;case"ArrowUp":s==="vertical"&&P();break}const T=x%b;v[T].ref.current?.focus()});return p.jsx(h$e,{scope:n,disabled:r,direction:o,orientation:s,children:p.jsx(j4.Slot,{scope:n,children:p.jsx(Dt.div,{...i,"data-orientation":s,ref:l,onKeyDown:r?void 0:f})})})}),S1="AccordionItem",[m$e,L4]=C1(S1),OY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,s=k1(S1,n),i=u$e(S1,n),a=I4(n),l=ia(),c=r&&i.value.includes(r)||!1,u=s.disabled||e.disabled;return p.jsx(m$e,{scope:n,open:c,disabled:u,triggerId:l,children:p.jsx(r$e,{"data-orientation":s.orientation,"data-state":FY(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?i.onItemOpen(r):i.onItemClose(r)}})})});OY.displayName=S1;var AY="AccordionHeader",jY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=k1(qo,n),s=L4(AY,n);return p.jsx(Dt.h3,{"data-orientation":o.orientation,"data-state":FY(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});jY.displayName=AY;var $4="AccordionTrigger",IY=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=k1(qo,n),s=L4($4,n),i=d$e($4,n),a=I4(n);return p.jsx(j4.ItemSlot,{scope:n,children:p.jsx(o$e,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...a,...r,ref:t})})});IY.displayName=$4;var LY="AccordionContent",$Y=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=k1(qo,n),s=L4(LY,n),i=I4(n);return p.jsx(s$e,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});$Y.displayName=LY;function FY(e){return e?"open":"closed"}var g$e=PY,v$e=OY,y$e=jY,NY=IY,RY=$Y;const b$e=g$e,BY=D.forwardRef(({className:e,...t},n)=>p.jsx(v$e,{ref:n,className:Ge("border-b",e),...t}));BY.displayName="AccordionItem";const VY=D.forwardRef(({className:e,children:t,chevronClassName:n,...r},o)=>p.jsx(y$e,{className:"flex",children:p.jsxs(NY,{ref:o,className:Ge("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,p.jsx(At.BlackChevronDown,{className:Ge("shrink-0 transition-transform duration-200",n)})]})}));VY.displayName=NY.displayName;const zY=D.forwardRef(({className:e,children:t,...n},r)=>p.jsx(RY,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:p.jsx("div",{className:Ge("pb-4 pt-0",e),children:t})}));zY.displayName=RY.displayName;function x$e(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function HY(e){const[t,n]=D.useState(void 0);return pi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _1="Checkbox",[w$e,Rze]=fi(_1),[C$e,F4]=w$e(_1);function k$e(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=gl({prop:n,defaultProp:o??!1,onChange:l,caller:_1}),[g,v]=D.useState(null),[y,b]=D.useState(null),x=D.useRef(!1),w=g?!!i||!!g.closest("form"):!0,k={checked:f,disabled:s,setChecked:h,control:g,setControl:v,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:la(o)?!1:o,isFormControl:w,bubbleInput:y,setBubbleInput:b};return p.jsx(C$e,{scope:t,...k,children:S$e(d)?d(k):r})}var WY="CheckboxTrigger",UY=D.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:g}=F4(WY,e),v=un(o,u),y=D.useRef(l);return D.useEffect(()=>{const b=s?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[s,d]),p.jsx(Dt.button,{type:"button",role:"checkbox","aria-checked":la(l)?"mixed":l,"aria-required":c,"data-state":QY(l),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:v,onKeyDown:Ve(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Ve(n,b=>{d(x=>la(x)?!0:!x),g&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});UY.displayName=WY;var N4=D.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return p.jsx(k$e,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>p.jsxs(p.Fragment,{children:[p.jsx(UY,{...d,ref:t,__scopeCheckbox:n}),f&&p.jsx(KY,{__scopeCheckbox:n})]})})});N4.displayName=_1;var qY="CheckboxIndicator",YY=D.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=F4(qY,n);return p.jsx(Is,{present:r||la(s.checked)||s.checked===!0,children:p.jsx(Dt.span,{"data-state":QY(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});YY.displayName=qY;var GY="CheckboxBubbleInput",KY=D.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:h}=F4(GY,e),g=un(n,h),v=x$e(s),y=HY(r);D.useEffect(()=>{const x=f;if(!x)return;const w=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(w,"checked").set,P=!o.current;if(v!==s&&_){const T=new Event("click",{bubbles:P});x.indeterminate=la(s),_.call(x,la(s)?!1:s),x.dispatchEvent(T)}},[f,v,s,o]);const b=D.useRef(la(s)?!1:s);return p.jsx(Dt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});KY.displayName=GY;function S$e(e){return typeof e=="function"}function la(e){return e==="indeterminate"}function QY(e){return la(e)?"indeterminate":e?"checked":"unchecked"}/**
550
550
  * @license lucide-react v0.525.0 - ISC
551
551
  *
552
552
  * This source code is licensed under the ISC license.
@@ -581,7 +581,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
581
581
  *
582
582
  * This source code is licensed under the ISC license.
583
583
  * See the LICENSE file in the root directory of this source tree.
584
- */const O$e=R4("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),eG=D.forwardRef(({className:e,...t},n)=>p.jsx(N4,{ref:n,className:Ge("peer h-4 w-4 shrink-0 rounded-sm border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",e),...t,children:p.jsx(YY,{className:Ge("flex items-center justify-center text-current"),children:p.jsx(JY,{className:"h-4 w-4"})})}));eG.displayName=N4.displayName;function tG({label:e,count:t,checked:n,onCheckChange:r}){const{isDarkTheme:o}=Je(),s=()=>r(!n),i=Ge("w-5 h-5 border rounded-sm flex items-center justify-center border-shop-textColor",{"border-white bg-white text-black":n&&o,"border-black bg-black text-white":n&&!o}),a=o?"text-subtextPlaceholder-Dark":"text-subtextPlaceholde-Light";return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(eG,{checked:n,onCheckedChange:s,className:i}),p.jsx(ct,{as:"label",className:"flex-1 cursor-pointer text-sm font-normal",onClick:s,children:e}),t!==void 0&&p.jsx(ct,{as:"span",className:`text-sm text-${a}`,children:t})]})}function Yo({className:e,...t}){return p.jsx("div",{className:Ge("animate-pulse rounded-md bg-muted",e),...t})}function B4(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((n,r)=>p.jsxs("div",{className:"flex gap-2 items-center animate-pulse",children:[p.jsx(Yo,{className:Ge("w-5 h-5 rounded-sm",t)}),p.jsx(Yo,{className:Ge("w-1/2 h-4 flex-1 rounded-md",t)}),p.jsx(Yo,{className:Ge("w-8 h-4 rounded-md",t)})]},r))})}const nG=m.createContext(void 0);function A$e({children:e,isLoading:t,applyFiltersDirectly:n,data:r}){const{setStagedProductQuery:o,applyStagedFilters:s}=Vn(a=>({setStagedProductQuery:a.setStagedProductQuery,applyStagedFilters:a.applyStagedFilters})),i=(a,l)=>{o(a,l),n&&s()};return p.jsx(nG.Provider,{value:{isLoading:t,data:r,applyFiltersDirectly:n,updateFilter:i},children:e})}function V4(){const e=m.useContext(nG);if(!e)throw new Error("useFilterData must be used within a ProductFiltersProvider");return e}function j$e(){const{isLoading:e,data:t,updateFilter:n}=V4(),r=t?.collections??[],[o,s]=m.useState(!1),i=o?r:r.slice(0,3),a=Vn(c=>c.stagedProductQuery.collectionId),l=(c,u)=>{const d=u?[...a,c]:a.filter(f=>f!==c);n("collectionId",d)};return e?p.jsx(B4,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[i.map(c=>p.jsx(tG,{label:c.title,count:c.count,checked:a.includes(c._id),onCheckChange:u=>l(c._id,u)},c._id)),r.length>3&&p.jsx(hl,{onClick:()=>s(c=>!c),className:"flex self-center items-center font-medium",iconLeft:p.jsx(At.BlackChevronDown,{className:`text-[#179EF8] ${o?"rotate-180":""}`}),children:o?"Less":"More"})]})}function z4({title:e,children:t}){const{isDarkTheme:n}=Je();return p.jsxs(BY,{value:e,className:"border-b-0",children:[p.jsx(VY,{chevronClassName:n?"[&>path]:stroke-white":"",className:"flex items-center rounded px-3 py-2 text-sm font-normal hover:no-underline bg-shop-foreground",children:p.jsx(ct,{children:e})}),p.jsx(zY,{className:"flex flex-col mt-4 gap-4 px-3 py-0",children:t})]})}function H4(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function W4(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function E1(e){return e!==null&&e.length===1?e[0]:e.slice()}function P1(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function yl(e,t){return U4(function(n,r){let o=n;return o<=r.min&&(o=r.min),o>=r.max&&(o=r.max),o}(e,t),t)}function U4(e,t){const n=(e-t.min)%t.step;let r=e-n;return 2*Math.abs(n)>=t.step&&(r+=n>0?t.step:-t.step),parseFloat(r.toFixed(5))}let q4=function(e){function t(r){var o;(o=e.call(this,r)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=a=>{a.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=a=>{o.setState({pending:!0});const l=o.getMousePosition(a),c=o.getDiffPosition(l[0]),u=o.getValueFromPosition(c);o.move(u)},o.onTouchMove=a=>{if(a.touches.length>1)return;o.setState({pending:!0});const l=o.getTouchPosition(a);if(o.isScrolling===void 0){const d=l[0]-o.startPosition[0],f=l[1]-o.startPosition[1];o.isScrolling=Math.abs(f)>Math.abs(d)}if(o.isScrolling)return void o.setState({index:-1});const c=o.getDiffPosition(l[0]),u=o.getValueFromPosition(c);o.move(u)},o.onKeyDown=a=>{if(!(a.ctrlKey||a.shiftKey||a.altKey||a.metaKey))switch(o.setState({pending:!0}),a.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":a.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":a.preventDefault(),o.moveUpByStep();break;case"Home":a.preventDefault(),o.move(o.props.min);break;case"End":a.preventDefault(),o.move(o.props.max);break;case"PageDown":a.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":a.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=a=>{if(!o.props.disabled&&a.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){const l=o.getMousePosition(a);o.forceValueFromPosition(l[0],c=>{o.start(c,l[0]),P1(o.getMouseEventMap())})}H4(a)}},o.onSliderClick=a=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){const l=o.getMousePosition(a),c=yl(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=a=>l=>{o.props.disabled||(o.start(a),P1(o.getKeyDownEventMap()),H4(l))},o.createOnMouseDown=a=>l=>{if(o.props.disabled||l.button===2)return;o.setState({pending:!0});const c=o.getMousePosition(l);o.start(a,c[0]),P1(o.getMouseEventMap()),H4(l)},o.createOnTouchStart=a=>l=>{if(o.props.disabled||l.touches.length>1)return;o.setState({pending:!0});const c=o.getTouchPosition(l);o.startPosition=c,o.isScrolling=void 0,o.start(a,c[0]),P1(o.getTouchEventMap()),function(u){u.stopPropagation&&u.stopPropagation()}(l)},o.handleResize=()=>{const a=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(a)},o.renderThumb=(a,l)=>{const c=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+l+" "+(o.state.index===l?o.props.thumbActiveClassName:""),u={ref:f=>{o["thumb"+l]=f},key:o.props.thumbClassName+"-"+l,className:c,style:a,onMouseDown:o.createOnMouseDown(l),onTouchStart:o.createOnTouchStart(l),onFocus:o.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[l],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[l]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[l]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},d={index:l,value:E1(o.state.value),valueNow:o.state.value[l]};return o.props.ariaValuetext&&(u["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(d)),o.props.renderThumb(u,d)},o.renderTrack=(a,l,c)=>{const u={key:o.props.trackClassName+"-"+a,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+a,style:o.buildTrackStyle(l,o.state.upperBound-c)},d={index:a,value:E1(o.state.value)};return o.props.renderTrack(u,d)};let s=W4(r.value);s.length||(s=W4(r.defaultValue)),o.pendingResizeTimeouts=[];const i=[];for(let a=0;a<s.length;a+=1)s[a]=yl(s[a],r),i.push(a);return o.resizeObserver=null,o.resizeElementRef=m.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:s,zIndices:i},o}Di(t,e);var n=t.prototype;return n.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(r,o){const s=W4(r.value);return s.length?o.pending?null:{value:s.map(i=>yl(i,r))}:null},n.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},n.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},n.onEnd=function(r){r&&function(o){Object.keys(o).forEach(s=>{typeof document<"u"&&document.removeEventListener(s,o[s],!1)})}(r),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},n.getValue=function(){return E1(this.state.value)},n.getClosestIndex=function(r){let o=Number.MAX_VALUE,s=-1;const{value:i}=this.state,a=i.length;for(let l=0;l<a;l+=1){const c=this.calcOffset(i[l]),u=Math.abs(r-c);u<o&&(o=u,s=l)}return s},n.getMousePosition=function(r){return[r["page"+this.axisKey()],r["page"+this.orthogonalAxisKey()]]},n.getTouchPosition=function(r){const o=r.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},n.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},n.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},n.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},n.getValueFromPosition=function(r){const o=r/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return yl(this.state.startValue+o,this.props)},n.getDiffPosition=function(r){let o=r-this.state.startPosition;return this.props.invert&&(o*=-1),o},n.resize=function(){const{slider:r,thumb0:o}=this;if(!r||!o)return;const s=this.sizeKey(),i=r.getBoundingClientRect(),a=r[s],l=i[this.posMaxKey()],c=i[this.posMinKey()],u=o.getBoundingClientRect()[s.replace("client","").toLowerCase()],d=a-u,f=Math.abs(l-c);this.state.upperBound===d&&this.state.sliderLength===f&&this.state.thumbSize===u||this.setState({upperBound:d,sliderLength:f,thumbSize:u})},n.calcOffset=function(r){const o=this.props.max-this.props.min;return o===0?0:(r-this.props.min)/o*this.state.upperBound},n.calcValue=function(r){return r/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},n.calcOffsetFromPosition=function(r){const{slider:o}=this,s=o.getBoundingClientRect(),i=s[this.posMaxKey()],a=s[this.posMinKey()];let l=r-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?i:a));return this.props.invert&&(l=this.state.sliderLength-l),l-=this.state.thumbSize/2,l},n.forceValueFromPosition=function(r,o){const s=this.calcOffsetFromPosition(r),i=this.getClosestIndex(s),a=yl(this.calcValue(s),this.props),l=this.state.value.slice();l[i]=a;for(let c=0;c<l.length-1;c+=1)if(l[c+1]-l[c]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:l},()=>{o(i),this.fireChangeEvent("onChange")})},n.clearPendingResizeTimeouts=function(){do{const r=this.pendingResizeTimeouts.shift();clearTimeout(r)}while(this.pendingResizeTimeouts.length)},n.start=function(r,o){const s=this["thumb"+r];s&&s.focus();const{zIndices:i}=this.state;i.splice(i.indexOf(r),1),i.push(r),this.setState(a=>({startValue:a.value[r],startPosition:o!==void 0?o:a.startPosition,index:r,zIndices:i}))},n.moveUpByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=yl(this.props.invert&&this.props.orientation==="horizontal"?o-r:o+r,this.props);this.move(Math.min(s,this.props.max))},n.moveDownByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=yl(this.props.invert&&this.props.orientation==="horizontal"?o+r:o-r,this.props);this.move(Math.max(s,this.props.min))},n.move=function(r){const o=this.state.value.slice(),{index:s}=this.state,{length:i}=o,a=o[s];if(r===a)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;const{pearling:l,max:c,min:u,minDistance:d}=this.props;if(!l){if(s>0){const f=o[s-1];r<f+d&&(r=f+d)}if(s<i-1){const f=o[s+1];r>f-d&&(r=f-d)}}o[s]=r,l&&i>1&&(r>a?(this.pushSucceeding(o,d,s),function(f,h,g,v){for(let y=0;y<f;y+=1){const b=v-y*g;h[f-1-y]>b&&(h[f-1-y]=b)}}(i,o,d,c)):r<a&&(this.pushPreceding(o,d,s),function(f,h,g,v){for(let y=0;y<f;y+=1){const b=v+y*g;h[y]<b&&(h[y]=b)}}(i,o,d,u))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},n.pushSucceeding=function(r,o,s){let i,a;for(i=s,a=r[i]+o;r[i+1]!==null&&a>r[i+1];i+=1,a=r[i]+o)r[i+1]=U4(a,this.props)},n.pushPreceding=function(r,o,s){for(let i=s,a=r[i]-o;r[i-1]!==null&&a<r[i-1];i-=1,a=r[i]-o)r[i-1]=U4(a,this.props)},n.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},n.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},n.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},n.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},n.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},n.fireChangeEvent=function(r){this.props[r]&&this.props[r](E1(this.state.value),this.state.index)},n.buildThumbStyle=function(r,o){const s={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return s[this.posMinKey()]=r+"px",s},n.buildTrackStyle=function(r,o){const s={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return s[this.posMinKey()]=r,s[this.posMaxKey()]=o,s},n.buildMarkStyle=function(r){var o;return(o={position:"absolute"})[this.posMinKey()]=r,o},n.renderThumbs=function(r){const{length:o}=r,s=[];for(let a=0;a<o;a+=1)s[a]=this.buildThumbStyle(r[a],a);const i=[];for(let a=0;a<o;a+=1)i[a]=this.renderThumb(s[a],a);return i},n.renderTracks=function(r){const o=[],s=r.length-1;o.push(this.renderTrack(0,0,r[0]));for(let i=0;i<s;i+=1)o.push(this.renderTrack(i+1,r[i],r[i+1]));return o.push(this.renderTrack(s+1,r[s],this.state.upperBound)),o},n.renderMarks=function(){let{marks:r}=this.props;const o=this.props.max-this.props.min+1;return typeof r=="boolean"?r=Array.from({length:o}).map((s,i)=>i):typeof r=="number"&&(r=Array.from({length:o}).map((s,i)=>i).filter(s=>s%r==0)),r.map(parseFloat).sort((s,i)=>s-i).map(s=>{const i=this.calcOffset(s),a={key:s,className:this.props.markClassName,style:this.buildMarkStyle(i)};return this.props.renderMark(a)})},n.render=function(){const r=[],{value:o}=this.state,s=o.length;for(let c=0;c<s;c+=1)r[c]=this.calcOffset(o[c],c);const i=this.props.withTracks?this.renderTracks(r):null,a=this.renderThumbs(r),l=this.props.marks?this.renderMarks():null;return m.createElement("div",{ref:c=>{this.slider=c,this.resizeElementRef.current=c},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},i,a,l)},t}(m.Component);q4.displayName="ReactSlider",q4.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>m.createElement("div",e),renderTrack:e=>m.createElement("div",e),renderMark:e=>m.createElement("span",e)};var I$e=q4;const L$e={USD:p.jsx(At.DollarSign,{}),AUD:p.jsx(At.DollarSign,{}),CAD:p.jsx(At.CAD,{}),GBP:p.jsx(At.GBP,{}),AED:p.jsx(At.AED,{}),CNY:p.jsx(At.CNY,{}),JPY:p.jsx(At.JPY,{}),EUR:p.jsx(At.EUR,{})};function $$e({currencyCode:e,className:t}){return p.jsx("div",{className:t,children:L$e[e]??p.jsx(At.DollarSign,{})})}function F$e({isFocused:e,isDarkTheme:t,textColorParagraphs:n}){const r=Mh("flex flex-1 items-center gap-2 px-4 py-3 rounded-lg border",{"border-black":e&&!t,"border-white":e&&t,[`border-[${n}]`]:!e}),o=Mh("w-full text-sm font-normal bg-transparent placeholder-[#B1B1B1] focus:outline-none focus:ring-0 focus:border-none",{"text-[#B1B1B1]":!e&&!t,"text-[#7B7B7B]":!e&&t,"text-white":e&&t,"text-black":e&&!t}),s=Mh("shrink-0",{"[&_path]:stroke-[#B1B1B1]":!e&&!t,"[&_path]:stroke-[#7B7B7B]":!e&&t,"[&_path]:stroke-white":e&&t,"[&_path]:stroke-black":e&&!t});return{containerClassName:r,inputClassName:o,iconClassName:s}}function rG({value:e,placeholder:t,onValueChange:n,...r}){const{states:{shop:{currency:o,shopDesign:{fontfamily:s,textColorParagraphs:i}}}}=Dr(),{isDarkTheme:a}=Je(),[l,c]=m.useState(!1),{containerClassName:u,iconClassName:d,inputClassName:f}=F$e({isFocused:l,isDarkTheme:a,textColorParagraphs:i});return p.jsxs("div",{className:u,children:[p.jsx($$e,{currencyCode:o.abbreviation,className:d}),p.jsx("input",{type:"number",className:` !font-shopfont ${f}`,value:e,placeholder:t,onChange:({target:{validity:h,value:g}})=>h.valid&&n(+g),onKeyDown:h=>{["+","-","e","."].includes(h.key)&&h.preventDefault()},onFocus:()=>c(!0),onBlur:()=>c(!1),...r})]})}const Y4=(e,t=500)=>{const[n,r]=m.useState(e);return m.useEffect(()=>{const o=setTimeout(()=>r(e),t);return()=>clearTimeout(o)},[e,t]),n};function N$e(){const{states:{shop:{currency:e}}}=Dr(),{isLoading:t,data:n}=V4(),{isDarkTheme:r}=Je(),{min:o=0,max:s=1e5}=n?.price?{min:Math.floor(+U1(n.price.min,e?.conversionRateToUSD)),max:Math.ceil(+U1(n.price.max,e?.conversionRateToUSD))}:{},{minPrice:i,maxPrice:a,setStagedProductQuery:l,applyStagedFilters:c}=Vn(g=>({minPrice:g.stagedProductQuery.minPrice??o,maxPrice:g.stagedProductQuery.maxPrice??s,setStagedProductQuery:g.setStagedProductQuery,applyStagedFilters:g.applyStagedFilters})),u=Y4(i,300),d=Y4(a,300);m.useEffect(()=>{c()},[u,d,c]);const f=g=>{g<a&&l("minPrice",g)},h=g=>{g>i&&l("maxPrice",g)};return t?p.jsx(B4,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(rG,{value:i,placeholder:"0",onValueChange:f,min:o}),p.jsx(At.Separator,{className:"shrink-0"}),p.jsx(rG,{value:a,placeholder:"1000",onValueChange:h,max:s})]}),p.jsx(I$e,{className:"price-range-slider",thumbClassName:r?"dark-price-range-slider__thumb":"price-range-slider__thumb",trackClassName:r?"dark-price-range-slider__track":"price-range-slider__track",value:[i,a],renderThumb:g=>p.jsx("div",{...g}),minDistance:1,onChange:([g,v])=>{l("minPrice",g),l("maxPrice",v)},min:o,max:s})]})}function R$e(){const{isLoading:e,data:t,updateFilter:n}=V4(),r=Vn(s=>s.stagedProductQuery.productType);if(e)return p.jsx(B4,{});const o=(s,i)=>{const a=i?[...r,s]:r.filter(l=>l!==s);n("productType",a)};return p.jsx("div",{className:"space-y-4",children:t?.types.map((s,i)=>p.jsx(tG,{label:s.label,count:s.count,checked:r.includes(s.value),onCheckChange:a=>o(s.value,a)},i))})}const B$e=({shopName:e})=>t1.get(`/shops/v2/public/name/${e}`),V$e=e=>t1.get(`/product-v2/available/filters/${e}`).then(t=>t.data);function z$e(){const{states:{shop:e}}=Dr();return aq({queryFn:()=>V$e(e.name),refetchOnWindowFocus:!1})}function oG({className:e,applyFiltersDirectly:t=!0}){const{isLoading:n,data:r,isError:o}=z$e();return o?p.jsx(ct,{className:`${e} text-[#dc2626]`,children:"An error occurred while fetching product filters. Please try again later."}):p.jsx(A$e,{isLoading:n,applyFiltersDirectly:t,data:r?.data,children:p.jsx(H$e,{className:e})})}function H$e({className:e}){return p.jsxs(b$e,{type:"multiple",className:Ge("flex flex-col gap-6",e),children:[p.jsx(z4,{title:"Type",children:p.jsx(R$e,{})}),p.jsx(z4,{title:"Collection",children:p.jsx(j$e,{})}),p.jsx(z4,{title:"Price",children:p.jsx(N$e,{})})]})}const W$e=(e,t="filled")=>{const{"--dlk-comps":{"--dlk-comps-btn":{"--dlk-comps-btn-styles":n,"--dlk-comps-btn-fill":{"--dlk-comps-btn-fill-styles":r,"--dlk-comps-btn-fill-pseudo":o},"--dlk-comps-btn-out":{"--dlk-comps-btn-out-styles":s,"--dlk-comps-btn-out-pseudo":i}}}}=e;let a={...n};return t==="filled"&&r?a={...a,...r,...o}:t==="outline"&&s&&(a={...a,...s,...i}),a};function sG({variant:e="filled",children:t,...n}){const{states:{shop:{template_options:r,shopDesign:o}}}=Dr(),s={filled:{fontFamily:`${o?.fontfamily} !important`,boxShadow:"unset !important",backgroundColor:o?.textColorParagraphs||"#FFF",color:o?.backgroundBody||"#000",border:"1px solid #555",padding:"20px 10px",_hover:{backgroundColor:o?.backgroundBody||"#EEE"}},outline:{fontFamily:`${o?.fontfamily} !important`,boxShadow:"unset !important",background:"none",color:o?.textColorParagraphs||"#FFF",border:`1px solid ${o?.textColorParagraphs||"#FFF"}`,padding:"20px 10px",_hover:{background:"none"}}};return p.jsx(Ym,{...s[e],...W$e(r,e),...n,children:t})}function iG(){const{isDarkTheme:e,shopDesign:{textColorParagraphs:t}}=Je(),n=Vn(o=>o.applyStagedFilters),r=Vn(o=>o.resetProductQuery);return p.jsxs(cY,{children:[p.jsxs(uY,{className:`flex items-center justify-center gap-[6px] w-10 h-10 md:h-auto md:w-auto md:px-[14px] md:py-[10px] lg:hidden border rounded-lg border-[${t}]`,children:[p.jsx(At.Filter,{className:`shrink-0 ${e?"[&>path]:stroke-white":""}`}),p.jsx(ct,{as:"span",className:"hidden md:block text-sm font-medium",children:"Filters"})]}),p.jsxs(w4,{side:"bottom",className:`flex flex-col max-h-[70vh] p-0 rounded-t-[16px] border-b border-[${t}] bg-${e?"black":"white"}`,closeButtonClassName:`top-4 right-4 md:top-6 md:right-9 ${e?"[&>svg>path]:stroke-white":""}`,children:[p.jsx(C4,{className:`flex items-start p-4 md:px-9 md:py-6 border-b border-[${t}]`,children:p.jsx(ct,{className:"text-sm font-bold",children:"Filters"})}),p.jsx("div",{className:"flex-1 overflow-y-auto",children:p.jsx(oG,{applyFiltersDirectly:!1,className:"p-4 pb-9 md:p-9"})}),p.jsxs(fY,{className:`flex flex-row gap-4 p-4 md:px-9 md:py-6 border-t border-[${t}]`,children:[p.jsx(x4,{asChild:!0,children:p.jsx(sG,{fontSize:14,fontWeight:500,variant:"outline",onClick:r,children:"Reset"})}),p.jsx(x4,{asChild:!0,children:p.jsx(sG,{flex:1,fontSize:14,fontWeight:500,onClick:n,children:"Apply Filters"})})]})]})]})}function aG(){const{isDarkTheme:e}=Je(),t=m.useRef(null),n=Vn(a=>a.stagedProductQuery.search),r=Vn(a=>a.setStagedProductQuery),o=Vn(a=>a.applyStagedFilters),s=Y4(n);m.useEffect(()=>{o()},[s,o]);const i=()=>t.current?.focus();return p.jsxs("div",{className:"flex items-center gap-2 lg:w-[312px] border border-shop-borderColor rounded-lg py-[6px] pl-3 pr-2",children:[p.jsx(At.Search,{className:`shrink-0 ${e?"[&>path]:stroke-white":""}`}),p.jsx("input",{ref:t,type:"text",value:n,onChange:a=>r("search",a.target.value),placeholder:"Search",className:`flex-1 bg-transparent text-sm focus:outline-none !font-shopfont ${e?"text-white dark-placeholder":"text-black light-placeholder"}`}),p.jsx("button",{onClick:i,className:"shrink-0",children:p.jsx(At.SearchInputIcon,{className:`${e?"[&>path]:fill-[#292929]":""}`})})]})}var U$e="Arrow",lG=D.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return p.jsx(Dt.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});lG.displayName=U$e;var q$e=lG,G4="Popper",[cG,uG]=fi(G4),[Y$e,dG]=cG(G4),fG=e=>{const{__scopePopper:t,children:n}=e,[r,o]=D.useState(null);return p.jsx(Y$e,{scope:t,anchor:r,onAnchorChange:o,children:n})};fG.displayName=G4;var pG="PopperAnchor",hG=D.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=dG(pG,n),i=D.useRef(null),a=un(t,i);return D.useEffect(()=>{s.onAnchorChange(r?.current||i.current)}),r?null:p.jsx(Dt.div,{...o,ref:a})});hG.displayName=pG;var K4="PopperContent",[G$e,K$e]=cG(K4),mG=D.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,y=dG(K4,n),[b,x]=D.useState(null),w=un(t,re=>x(re)),[k,_]=D.useState(null),P=HY(k),T=P?.width??0,C=P?.height??0,E=r+(s!=="center"?"-"+s:""),S=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(c)?c:[c],O=M.length>0,R={padding:S,boundary:M.filter(Z$e),altBoundary:O},{refs:L,floatingStyles:W,placement:$,isPositioned:F,middlewareData:U}=MH({strategy:"fixed",placement:E,whileElementsMounted:(...re)=>EH(...re,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[OH({mainAxis:o+C,alignmentAxis:i}),l&&vTe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?yTe():void 0,...R}),l&&AH({...R}),bTe({...R,apply:({elements:re,rects:Y,availableWidth:A,availableHeight:I})=>{const{width:B,height:H}=Y.reference,te=re.floating.style;te.setProperty("--radix-popper-available-width",`${A}px`),te.setProperty("--radix-popper-available-height",`${I}px`),te.setProperty("--radix-popper-anchor-width",`${B}px`),te.setProperty("--radix-popper-anchor-height",`${H}px`)}}),k&&jH({element:k,padding:a}),X$e({arrowWidth:T,arrowHeight:C}),f&&xTe({strategy:"referenceHidden",...R})]}),[K,j]=yG($),z=hi(g);pi(()=>{F&&z?.()},[F,z]);const J=U.arrow?.x,q=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[Q,oe]=D.useState();return pi(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:F?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(G$e,{scope:n,placedSide:K,onArrowChange:_,arrowX:J,arrowY:q,shouldHideArrow:ee,children:p.jsx(Dt.div,{"data-side":K,"data-align":j,...v,ref:w,style:{...v.style,animation:F?void 0:"none"}})})})});mG.displayName=K4;var gG="PopperArrow",Q$e={top:"bottom",right:"left",bottom:"top",left:"right"},vG=D.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=K$e(gG,r),i=Q$e[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(q$e,{...o,ref:n,style:{...o.style,display:"block"}})})});vG.displayName=gG;function Z$e(e){return e!==null}var X$e=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=yG(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=i?d:`${f}px`,v=`${-l}px`):c==="top"?(g=i?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=i?d:`${h}px`):c==="left"&&(g=`${r.floating.width+l}px`,v=i?d:`${h}px`),{data:{x:g,y:v}}}});function yG(e){const[t,n="center"]=e.split("-");return[t,n]}var J$e=fG,eFe=hG,tFe=mG,nFe=vG,Q4="rovingFocusGroup.onEntryFocus",rFe={bubbles:!1,cancelable:!0},ph="RovingFocusGroup",[Z4,bG,oFe]=T4(ph),[sFe,xG]=fi(ph,[oFe]),[iFe,aFe]=sFe(ph),wG=D.forwardRef((e,t)=>p.jsx(Z4.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Z4.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(lFe,{...e,ref:t})})}));wG.displayName=ph;var lFe=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=D.useRef(null),h=un(t,f),g=A4(s),[v,y]=gl({prop:i,defaultProp:a??null,onChange:l,caller:ph}),[b,x]=D.useState(!1),w=hi(c),k=bG(n),_=D.useRef(!1),[P,T]=D.useState(0);return D.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(Q4,w),()=>C.removeEventListener(Q4,w)},[w]),p.jsx(iFe,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:D.useCallback(C=>y(C),[y]),onItemShiftTab:D.useCallback(()=>x(!0),[]),onFocusableItemAdd:D.useCallback(()=>T(C=>C+1),[]),onFocusableItemRemove:D.useCallback(()=>T(C=>C-1),[]),children:p.jsx(Dt.div,{tabIndex:b||P===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{_.current=!0}),onFocus:Ve(e.onFocus,C=>{const E=!_.current;if(C.target===C.currentTarget&&E&&!b){const S=new CustomEvent(Q4,rFe);if(C.currentTarget.dispatchEvent(S),!S.defaultPrevented){const M=k().filter($=>$.focusable),O=M.find($=>$.active),R=M.find($=>$.id===v),W=[O,R,...M].filter(Boolean).map($=>$.ref.current);SG(W,u)}}_.current=!1}),onBlur:Ve(e.onBlur,()=>x(!1))})})}),CG="RovingFocusGroupItem",kG=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=ia(),c=s||l,u=aFe(CG,n),d=u.currentTabStopId===c,f=bG(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=u;return D.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),p.jsx(Z4.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:p.jsx(Dt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ve(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:Ve(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ve(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=dFe(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=f().filter(k=>k.focusable).map(k=>k.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const k=w.indexOf(y.currentTarget);w=u.loop?fFe(w,k+1):w.slice(k+1)}setTimeout(()=>SG(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:v!=null}):i})})});kG.displayName=CG;var cFe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uFe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dFe(e,t,n){const r=uFe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cFe[r]}function SG(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fFe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pFe=wG,hFe=kG,X4=["Enter"," "],mFe=["ArrowDown","PageUp","Home"],_G=["ArrowUp","PageDown","End"],gFe=[...mFe,..._G],vFe={ltr:[...X4,"ArrowRight"],rtl:[...X4,"ArrowLeft"]},yFe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hh="Menu",[mh,bFe,xFe]=T4(hh),[bl,EG]=fi(hh,[xFe,uG,xG]),T1=uG(),PG=xG(),[wFe,xl]=bl(hh),[CFe,gh]=bl(hh),TG=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=T1(t),[l,c]=D.useState(null),u=D.useRef(!1),d=hi(s),f=A4(o);return D.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.jsx(J$e,{...a,children:p.jsx(wFe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:p.jsx(CFe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};TG.displayName=hh;var kFe="MenuAnchor",J4=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=T1(n);return p.jsx(eFe,{...o,...r,ref:t})});J4.displayName=kFe;var e7="MenuPortal",[SFe,DG]=bl(e7,{forceMount:void 0}),MG=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=xl(e7,t);return p.jsx(SFe,{scope:t,forceMount:n,children:p.jsx(Is,{present:n||s.open,children:p.jsx(m4,{asChild:!0,container:o,children:r})})})};MG.displayName=e7;var vo="MenuContent",[_Fe,t7]=bl(vo),OG=D.forwardRef((e,t)=>{const n=DG(vo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xl(vo,e.__scopeMenu),i=gh(vo,e.__scopeMenu);return p.jsx(mh.Provider,{scope:e.__scopeMenu,children:p.jsx(Is,{present:r||s.open,children:p.jsx(mh.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(EFe,{...o,ref:t}):p.jsx(PFe,{...o,ref:t})})})})}),EFe=D.forwardRef((e,t)=>{const n=xl(vo,e.__scopeMenu),r=D.useRef(null),o=un(t,r);return D.useEffect(()=>{const s=r.current;if(s)return vw(s)},[]),p.jsx(n7,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),PFe=D.forwardRef((e,t)=>{const n=xl(vo,e.__scopeMenu);return p.jsx(n7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),TFe=qu("MenuContent.ScrollLock"),n7=D.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,...v}=e,y=xl(vo,n),b=gh(vo,n),x=T1(n),w=PG(n),k=bFe(n),[_,P]=D.useState(null),T=D.useRef(null),C=un(t,T,y.onContentChange),E=D.useRef(0),S=D.useRef(""),M=D.useRef(0),O=D.useRef(null),R=D.useRef("right"),L=D.useRef(0),W=g?ug:D.Fragment,$=g?{as:TFe,allowPinchZoom:!0}:void 0,F=K=>{const j=S.current+K,z=k().filter(re=>!re.disabled),J=document.activeElement,q=z.find(re=>re.ref.current===J)?.textValue,ee=z.map(re=>re.textValue),Q=BFe(ee,j,q),oe=z.find(re=>re.textValue===Q)?.ref.current;(function re(Y){S.current=Y,window.clearTimeout(E.current),Y!==""&&(E.current=window.setTimeout(()=>re(""),1e3))})(j),oe&&setTimeout(()=>oe.focus())};D.useEffect(()=>()=>window.clearTimeout(E.current),[]),Bq();const U=D.useCallback(K=>R.current===O.current?.side&&zFe(K,O.current?.area),[]);return p.jsx(_Fe,{scope:n,searchRef:S,onItemEnter:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),onItemLeave:D.useCallback(K=>{U(K)||(T.current?.focus(),P(null))},[U]),onTriggerLeave:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),pointerGraceTimerRef:M,onPointerGraceIntentChange:D.useCallback(K=>{O.current=K},[]),children:p.jsx(W,{...$,children:p.jsx(h4,{asChild:!0,trapped:o,onMountAutoFocus:Ve(s,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(d4,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:p.jsx(pFe,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:P,onEntryFocus:Ve(l,K=>{b.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(tFe,{role:"menu","aria-orientation":"vertical","data-state":GG(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:C,style:{outline:"none",...v.style},onKeyDown:Ve(v.onKeyDown,K=>{const z=K.target.closest("[data-radix-menu-content]")===K.currentTarget,J=K.ctrlKey||K.altKey||K.metaKey,q=K.key.length===1;z&&(K.key==="Tab"&&K.preventDefault(),!J&&q&&F(K.key));const ee=T.current;if(K.target!==ee||!gFe.includes(K.key))return;K.preventDefault();const oe=k().filter(re=>!re.disabled).map(re=>re.ref.current);_G.includes(K.key)&&oe.reverse(),NFe(oe)}),onBlur:Ve(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(E.current),S.current="")}),onPointerMove:Ve(e.onPointerMove,yh(K=>{const j=K.target,z=L.current!==K.clientX;if(K.currentTarget.contains(j)&&z){const J=K.clientX>L.current?"right":"left";R.current=J,L.current=K.clientX}}))})})})})})})});OG.displayName=vo;var DFe="MenuGroup",r7=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Dt.div,{role:"group",...r,ref:t})});r7.displayName=DFe;var MFe="MenuLabel",AG=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Dt.div,{...r,ref:t})});AG.displayName=MFe;var D1="MenuItem",jG="menu.itemSelect",M1=D.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=D.useRef(null),i=gh(D1,e.__scopeMenu),a=t7(D1,e.__scopeMenu),l=un(t,s),c=D.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(jG,{bubbles:!0,cancelable:!0});d.addEventListener(jG,h=>r?.(h),{once:!0}),Mq(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return p.jsx(IG,{...o,ref:l,disabled:n,onClick:Ve(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:Ve(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:Ve(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||X4.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});M1.displayName=D1;var IG=D.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=t7(D1,n),a=PG(n),l=D.useRef(null),c=un(t,l),[u,d]=D.useState(!1),[f,h]=D.useState("");return D.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[s.children]),p.jsx(mh.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:p.jsx(hFe,{asChild:!0,...a,focusable:!r,children:p.jsx(Dt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:Ve(e.onPointerMove,yh(g=>{r?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ve(e.onPointerLeave,yh(g=>i.onItemLeave(g))),onFocus:Ve(e.onFocus,()=>d(!0)),onBlur:Ve(e.onBlur,()=>d(!1))})})})}),OFe="MenuCheckboxItem",LG=D.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(BG,{scope:e.__scopeMenu,checked:n,children:p.jsx(M1,{role:"menuitemcheckbox","aria-checked":O1(n)?"mixed":n,...o,ref:t,"data-state":s7(n),onSelect:Ve(o.onSelect,()=>r?.(O1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});LG.displayName=OFe;var $G="MenuRadioGroup",[AFe,jFe]=bl($G,{value:void 0,onValueChange:()=>{}}),FG=D.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=hi(r);return p.jsx(AFe,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(r7,{...o,ref:t})})});FG.displayName=$G;var NG="MenuRadioItem",RG=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=jFe(NG,e.__scopeMenu),s=n===o.value;return p.jsx(BG,{scope:e.__scopeMenu,checked:s,children:p.jsx(M1,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":s7(s),onSelect:Ve(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});RG.displayName=NG;var o7="MenuItemIndicator",[BG,IFe]=bl(o7,{checked:!1}),VG=D.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=IFe(o7,n);return p.jsx(Is,{present:r||O1(s.checked)||s.checked===!0,children:p.jsx(Dt.span,{...o,ref:t,"data-state":s7(s.checked)})})});VG.displayName=o7;var LFe="MenuSeparator",zG=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Dt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});zG.displayName=LFe;var $Fe="MenuArrow",HG=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=T1(n);return p.jsx(nFe,{...o,...r,ref:t})});HG.displayName=$Fe;var FFe="MenuSub",[Hze,WG]=bl(FFe),vh="MenuSubTrigger",UG=D.forwardRef((e,t)=>{const n=xl(vh,e.__scopeMenu),r=gh(vh,e.__scopeMenu),o=WG(vh,e.__scopeMenu),s=t7(vh,e.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>u,[u]),D.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),p.jsx(J4,{asChild:!0,...c,children:p.jsx(IG,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":GG(n.open),...e,ref:f1(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ve(e.onPointerMove,yh(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Ve(e.onPointerLeave,yh(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const h=n.content?.dataset.side,g=h==="right",v=g?-5:5,y=f[g?"left":"right"],b=f[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:y,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:y,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ve(e.onKeyDown,d=>{const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||vFe[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});UG.displayName=vh;var qG="MenuSubContent",YG=D.forwardRef((e,t)=>{const n=DG(vo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xl(vo,e.__scopeMenu),i=gh(vo,e.__scopeMenu),a=WG(qG,e.__scopeMenu),l=D.useRef(null),c=un(t,l);return p.jsx(mh.Provider,{scope:e.__scopeMenu,children:p.jsx(Is,{present:r||s.open,children:p.jsx(mh.Slot,{scope:e.__scopeMenu,children:p.jsx(n7,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ve(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ve(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:Ve(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=yFe[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});YG.displayName=qG;function GG(e){return e?"open":"closed"}function O1(e){return e==="indeterminate"}function s7(e){return O1(e)?"indeterminate":e?"checked":"unchecked"}function NFe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function RFe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function BFe(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=RFe(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function VFe(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(o=!o)}return o}function zFe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return VFe(n,t)}function yh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var HFe=TG,WFe=J4,UFe=MG,qFe=OG,YFe=r7,GFe=AG,KFe=M1,QFe=LG,ZFe=FG,XFe=RG,JFe=VG,eNe=zG,tNe=HG,nNe=UG,rNe=YG,A1="DropdownMenu",[oNe,Wze]=fi(A1,[EG]),lr=EG(),[sNe,KG]=oNe(A1),QG=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=lr(t),c=D.useRef(null),[u,d]=gl({prop:o,defaultProp:s??!1,onChange:i,caller:A1});return p.jsx(sNe,{scope:t,triggerId:ia(),triggerRef:c,contentId:ia(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:a,children:p.jsx(HFe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};QG.displayName=A1;var ZG="DropdownMenuTrigger",XG=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=KG(ZG,n),i=lr(n);return p.jsx(WFe,{asChild:!0,...i,children:p.jsx(Dt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:f1(t,s.triggerRef),onPointerDown:Ve(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Ve(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});XG.displayName=ZG;var iNe="DropdownMenuPortal",JG=e=>{const{__scopeDropdownMenu:t,...n}=e,r=lr(t);return p.jsx(UFe,{...r,...n})};JG.displayName=iNe;var eK="DropdownMenuContent",tK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=KG(eK,n),s=lr(n),i=D.useRef(!1);return p.jsx(qFe,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:Ve(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:Ve(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tK.displayName=eK;var aNe="DropdownMenuGroup",lNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(YFe,{...o,...r,ref:t})});lNe.displayName=aNe;var cNe="DropdownMenuLabel",nK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(GFe,{...o,...r,ref:t})});nK.displayName=cNe;var uNe="DropdownMenuItem",rK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(KFe,{...o,...r,ref:t})});rK.displayName=uNe;var dNe="DropdownMenuCheckboxItem",oK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(QFe,{...o,...r,ref:t})});oK.displayName=dNe;var fNe="DropdownMenuRadioGroup",pNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(ZFe,{...o,...r,ref:t})});pNe.displayName=fNe;var hNe="DropdownMenuRadioItem",sK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(XFe,{...o,...r,ref:t})});sK.displayName=hNe;var mNe="DropdownMenuItemIndicator",iK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(JFe,{...o,...r,ref:t})});iK.displayName=mNe;var gNe="DropdownMenuSeparator",aK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(eNe,{...o,...r,ref:t})});aK.displayName=gNe;var vNe="DropdownMenuArrow",yNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(tNe,{...o,...r,ref:t})});yNe.displayName=vNe;var bNe="DropdownMenuSubTrigger",lK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(nNe,{...o,...r,ref:t})});lK.displayName=bNe;var xNe="DropdownMenuSubContent",cK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(rNe,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cK.displayName=xNe;var wNe=QG,CNe=XG,kNe=JG,uK=tK,dK=nK,fK=rK,pK=oK,hK=sK,mK=iK,gK=aK,vK=lK,yK=cK;const SNe=wNe,_Ne=CNe,ENe=D.forwardRef(({className:e,inset:t,children:n,...r},o)=>p.jsxs(vK,{ref:o,className:Ge("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,p.jsx(M$e,{className:"ml-auto"})]}));ENe.displayName=vK.displayName;const PNe=D.forwardRef(({className:e,...t},n)=>p.jsx(yK,{ref:n,className:Ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));PNe.displayName=yK.displayName;const bK=D.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(kNe,{children:p.jsx(uK,{ref:r,sideOffset:t,className:Ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));bK.displayName=uK.displayName;const xK=D.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(fK,{ref:r,className:Ge("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));xK.displayName=fK.displayName;const TNe=D.forwardRef(({className:e,children:t,checked:n,...r},o)=>p.jsxs(pK,{ref:o,className:Ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(mK,{children:p.jsx(JY,{className:"h-4 w-4"})})}),t]}));TNe.displayName=pK.displayName;const DNe=D.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(hK,{ref:r,className:Ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(mK,{children:p.jsx(O$e,{className:"h-2 w-2 fill-current"})})}),t]}));DNe.displayName=hK.displayName;const MNe=D.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(dK,{ref:r,className:Ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));MNe.displayName=dK.displayName;const ONe=D.forwardRef(({className:e,...t},n)=>p.jsx(gK,{ref:n,className:Ge("-mx-1 my-1 h-px bg-muted",e),...t}));ONe.displayName=gK.displayName;const i7=[{value:"default",label:"Default",description:"No Sorting"},{value:"price",label:"Price",description:"High to Low",sortOrder:-1},{value:"price",label:"Price",description:"Low to High",sortOrder:1},{value:"name",label:"Name",description:"A to Z",sortOrder:1},{value:"name",label:"Name",description:"Z to A",sortOrder:-1}];function ANe(){const{setStagedProductQuery:e,applyStagedFilters:t}=Vn(r=>({setStagedProductQuery:r.setStagedProductQuery,applyStagedFilters:r.applyStagedFilters}));function n(r,o){r==="default"?(e("sort",""),e("order",void 0)):(e("sort",r),e("order",o)),t()}return n}function wK({option:e}){const{stagedSortOption:t,stagedSortOrder:n}=Vn(c=>({stagedSortOption:c.stagedProductQuery.sort,stagedSortOrder:c.stagedProductQuery.order})),r=ANe(),{isDarkTheme:o}=Je(),i=e.value===t&&e.sortOrder===n||e.value==="default"&&t===""?o?"#222":"#F2F2F2":void 0,a=o?"neutral-gray-900":"neutral-gray-100",l=o?"text-subtextPlaceholder-Dark":"text-subtextPlaceholder-Light";return p.jsxs("button",{onClick:()=>r(e.value,e.sortOrder),className:`flex items-center justify-between w-full px-4 py-[10px] rounded-md cursor-pointer hover:bg-${a}`,style:i?{backgroundColor:i}:void 0,children:[p.jsx(ct,{as:"span",className:"text-sm font-normal",children:e.label}),p.jsx(ct,{as:"span",className:`text-xs font-normal text-${l}`,children:e.description})]})}function jNe(){const{isDarkTheme:e}=Je(),{stagedSortOption:t,stagedSortOrder:n}=Vn(o=>({stagedSortOption:o.stagedProductQuery.sort,stagedSortOrder:o.stagedProductQuery.order})),r=()=>{const o=i7.find(i=>i.value===t&&i.sortOrder===n);if(!o||o.value==="default")return"Sort Products";const s=`${o.label} (${o.description})`;return s.length>20?`${s.slice(0,20)}...`:s};return p.jsxs(SNe,{children:[p.jsxs(_Ne,{className:"flex w-[250px] select-none items-center justify-between rounded-lg border border-shop-borderColor bg-transparent px-4 py-3",children:[p.jsx(ct,{as:"span",className:`text-sm font-normal ${e?"text-[#7B7B7B]":"text-[#B1B1B1]"}`,children:r()}),p.jsx(At.GrayChevronDown,{})]}),p.jsx(bK,{className:`my-2 flex w-[250px] flex-col gap-2 rounded-lg border-none p-3 ${e?"bg-black":"bg-white"} `,children:i7.map((o,s)=>p.jsx(xK,{className:"p-0",children:p.jsx(wK,{option:o})},s))})]})}function INe({showSearchBar:e,showSort:t,showFilters:n}){return p.jsxs("div",{className:"hidden md:flex justify-between",children:[p.jsxs("div",{className:"flex gap-4",children:[n&&p.jsx(iG,{}),e&&p.jsx(aG,{})]}),t&&p.jsx(jNe,{})]})}function CK({onClick:e,children:t}){const{shopDesign:{textColorParagraphs:n}}=Je();return p.jsx("button",{onClick:e,className:`flex items-center justify-center w-10 h-10 border rounded-lg border-[${n}]`,children:t})}function LNe({onClick:e}){const{isDarkTheme:t}=Je(),n=t?"[&>path]:stroke-white":"";return p.jsx(CK,{onClick:e,children:p.jsx(At.Search,{className:n})})}function $Ne(){const{isDarkTheme:e}=Je();return p.jsxs(cY,{children:[p.jsx(uY,{className:"flex items-center justify-center w-10 h-10 border rounded-lg lg:hidden border-shop-textColor",children:p.jsx(At.Sort,{className:`shrink-0 ${e?"[&_path]:stroke-white":""}`})}),p.jsxs(w4,{side:"bottom",className:`p-0 max-h-full border-b rounded-t-[16px] bg-${e?"black":"white"} border-shop-textColor`,closeButtonClassName:`top-4 right-4 md:top-6 md:right-9 ${e?"[&>svg>path]:stroke-white":""}`,children:[p.jsx(C4,{className:"flex items-start p-4 text-left md:px-9 md:py-6 border-b border-shop-textColor",children:p.jsx(ct,{className:"text-sm font-bold",children:"Sort"})}),p.jsx("div",{className:"flex flex-col gap-2 p-4 pb-9",children:i7.map((t,n)=>p.jsx(x4,{children:p.jsx(wK,{option:t})},n))})]})]})}function FNe({showSearchBar:e,showSort:t,showFilters:n}){const[r,o]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{const i=a=>{s.current&&!s.current.contains(a.target)&&o(!1)};return r?document.addEventListener("mousedown",i):document.removeEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[r]),p.jsx(p.Fragment,{children:r?p.jsx("div",{className:"md:hidden",ref:s,children:p.jsx(aG,{})}):p.jsxs("div",{className:"flex justify-between md:hidden",children:[p.jsxs("div",{className:"flex gap-2",children:[n&&p.jsx(iG,{}),e&&p.jsx(LNe,{onClick:()=>o(!0)})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(NNe,{}),t&&p.jsx($Ne,{})]})]})})}function NNe(){const{isDarkTheme:e}=Je(),{viewMode:t,setViewMode:n}=Vn(s=>({viewMode:s.viewMode,setViewMode:s.setViewMode})),r=t==="grid",o=e?"[&_path]:stroke-white":"";return p.jsx(CK,{onClick:()=>n(r?"list":"grid"),children:r?p.jsx(At.ListView,{className:o}):p.jsx(At.GridView,{className:o})})}function RNe({showSearchBar:e,showSort:t,showFilters:n}){return p.jsxs(p.Fragment,{children:[p.jsx(INe,{showSearchBar:e,showSort:t,showFilters:n}),p.jsx(FNe,{showSearchBar:e,showSort:t,showFilters:n})]})}const kK=({price:e,slug:t,className:n})=>{const{isDarkTheme:r}=Je(),{navigate:o}=Uu(),{states:{shop:{currency:s,tokenBasedPricing:i}}}=Dr(),a="text-base md:text-[18px] cursor-pointer",l=r?"#7B7B7B":"#B1B1B1",c=()=>o(`product/${t}`);return i?.hasTokenBasedPricing?p.jsxs("div",{className:Ge("flex",a,n),onClick:c,children:[p.jsx(ct,{className:"font-medium mr-1",children:(e*i.unit).toFixed(2)}),p.jsx(ct,{className:`text-[${l}]`,children:i.token})]}):p.jsxs(ct,{className:Ge("font-medium",a,n),onClick:c,children:[Sq(+e,s),p.jsx("span",{className:Ge(`text-[${l}]`,"font-normal"),children:s?.abbreviation})]})};function SK({title:e,slug:t,className:n}){const{navigate:r}=Uu();return p.jsx(ct,{as:"h3",onClick:()=>r(`product/${t}`),className:Ge("h-10 md:h-12 text-sm md:text-base font-normal line-clamp-2 cursor-pointer",n),children:e})}var j1={},_K;function BNe(){if(_K)return j1;_K=1,Object.defineProperty(j1,"__esModule",{value:!0});var e=m;function t(C){return Array.prototype.slice.call(C)}function n(C,E){var S=Math.floor(C);return S===E||S+1===E?C:E}function r(){return Date.now()}function o(C,E,S){if(E="data-keen-slider-"+E,S===null)return C.removeAttribute(E);C.setAttribute(E,S||"")}function s(C,E){return E=E||document,typeof C=="function"&&(C=C(E)),Array.isArray(C)?C:typeof C=="string"?t(E.querySelectorAll(C)):C instanceof HTMLElement?[C]:C instanceof NodeList?t(C):[]}function i(C){C.raw&&(C=C.raw),C.cancelable&&!C.defaultPrevented&&C.preventDefault()}function a(C){C.raw&&(C=C.raw),C.stopPropagation&&C.stopPropagation()}function l(){var C=[];return{add:function(E,S,M,O){E.addListener?E.addListener(M):E.addEventListener(S,M,O),C.push([E,S,M,O])},input:function(E,S,M,O){this.add(E,S,function(R){return function(L){L.nativeEvent&&(L=L.nativeEvent);var W=L.changedTouches||[],$=L.targetTouches||[],F=L.detail&&L.detail.x?L.detail:null;return R({id:F?F.identifier?F.identifier:"i":$[0]?$[0]?$[0].identifier:"e":"d",idChanged:F?F.identifier?F.identifier:"i":W[0]?W[0]?W[0].identifier:"e":"d",raw:L,x:F&&F.x?F.x:$[0]?$[0].screenX:F?F.x:L.pageX,y:F&&F.y?F.y:$[0]?$[0].screenY:F?F.y:L.pageY})}}(M),O)},purge:function(){C.forEach(function(E){E[0].removeListener?E[0].removeListener(E[2]):E[0].removeEventListener(E[1],E[2],E[3])}),C=[]}}}function c(C,E,S){return Math.min(Math.max(C,E),S)}function u(C){return(C>0?1:0)-(C<0?1:0)||+C}function d(C){var E=C.getBoundingClientRect();return{height:n(E.height,C.offsetHeight),width:n(E.width,C.offsetWidth)}}function f(C,E,S,M){var O=C&&C[E];return O==null?S:M&&typeof O=="function"?O():O}function h(C){return Math.round(1e6*C)/1e6}function g(C,E){if(C===E)return!0;var S=typeof C;if(S!==typeof E)return!1;if(S!=="object"||C===null||E===null)return S==="function"&&C.toString()===E.toString();if(C.length!==E.length||Object.getOwnPropertyNames(C).length!==Object.getOwnPropertyNames(E).length)return!1;for(var M in C)if(!g(C[M],E[M]))return!1;return!0}var v=function(){return v=Object.assign||function(C){for(var E,S=1,M=arguments.length;S<M;S++)for(var O in E=arguments[S])Object.prototype.hasOwnProperty.call(E,O)&&(C[O]=E[O]);return C},v.apply(this,arguments)};function y(C,E,S){for(var M,O=0,R=E.length;O<R;O++)!M&&O in E||(M||(M=Array.prototype.slice.call(E,0,O)),M[O]=E[O]);return C.concat(M||Array.prototype.slice.call(E))}function b(C){var E,S,M,O,R,L;function W(j){L||(L=j),$(!0);var z=j-L;z>M&&(z=M);var J=O[S];if(J[3]<z)return S++,W(j);var q=J[2],ee=J[4],Q=J[0],oe=J[1]*(0,J[5])(ee===0?1:(z-q)/ee);if(oe&&C.track.to(Q+oe),z<M)return U();L=null,$(!1),F(null),C.emit("animationEnded")}function $(j){E.active=j}function F(j){E.targetIdx=j}function U(){var j;j=W,R=window.requestAnimationFrame(j)}function K(){var j;j=R,window.cancelAnimationFrame(j),$(!1),F(null),L&&C.emit("animationStopped"),L=null}return E={active:!1,start:function(j){if(K(),C.track.details){var z=0,J=C.track.details.position;S=0,M=0,O=j.map(function(q){var ee,Q=Number(J),oe=(ee=q.earlyExit)!==null&&ee!==void 0?ee:q.duration,re=q.easing,Y=q.distance*re(oe/q.duration)||0;J+=Y;var A=M;return M+=oe,z+=Y,[Q,q.distance,A,M,q.duration,re]}),F(C.track.distToIdx(z)),U(),C.emit("animationStarted")}},stop:K,targetIdx:null}}function x(C){var E,S,M,O,R,L,W,$,F,U,K,j,z,J,q=1/0,ee=[],Q=null,oe=0;function re(fe){Se(oe+fe)}function Y(fe){var ce=A(oe+fe).abs;return H(ce)?ce:null}function A(fe){var ce=Math.floor(Math.abs(h(fe/S))),le=h((fe%S+S)%S);le===S&&(le=0);var me=u(fe),ue=W.indexOf(y([],W).reduce(function(De,Be){return Math.abs(Be-le)<Math.abs(De-le)?Be:De})),ge=ue;return me<0&&ce++,ue===L&&(ge=0,ce+=me>0?1:-1),{abs:ge+ce*L*me,origin:ue,rel:ge}}function I(fe,ce,le){var me;if(ce||!se())return B(fe,le);if(!H(fe))return null;var ue=A(le??oe),ge=ue.abs,De=fe-ue.rel,Be=ge+De;me=B(Be);var Ze=B(Be-L*u(De));return(Ze!==null&&Math.abs(Ze)<Math.abs(me)||me===null)&&(me=Ze),h(me)}function B(fe,ce){if(ce==null&&(ce=h(oe)),!H(fe)||fe===null)return null;fe=Math.round(fe);var le=A(ce),me=le.abs,ue=le.rel,ge=le.origin,De=de(fe),Be=(ce%S+S)%S,Ze=W[ge],he=Math.floor((fe-(me-ue))/L)*S;return h(Ze-Be-Ze+W[De]+he+(ge===L?S:0))}function H(fe){return te(fe)===fe}function te(fe){return c(fe,F,U)}function se(){return O.loop}function de(fe){return(fe%L+L)%L}function Se(fe){var ce;ce=fe-oe,ee.push({distance:ce,timestamp:r()}),ee.length>6&&(ee=ee.slice(-6)),oe=h(fe);var le=ne().abs;if(le!==Q){var me=Q!==null;Q=le,me&&C.emit("slideChanged")}}function ne(fe){var ce=fe?null:function(){if(L){var le=se(),me=le?(oe%S+S)%S:oe,ue=(le?oe%S:oe)-R[0][2],ge=0-(ue<0&&le?S-Math.abs(ue):ue),De=0,Be=A(oe),Ze=Be.abs,he=Be.rel,ve=R[he][2],Ce=R.map(function(Te,Xe){var je=ge+De;(je<0-Te[0]||je>1)&&(je+=(Math.abs(je)>S-1&&le?S:0)*u(-je));var et=Xe-he,ut=u(et),kt=et+Ze;le&&(ut===-1&&je>ve&&(kt+=L),ut===1&&je<ve&&(kt-=L),K!==null&&kt<K&&(je+=S),j!==null&&kt>j&&(je-=S));var Vt=je+Te[0]+Te[1],kn=Math.max(je>=0&&Vt<=1?1:Vt<0||je>1?0:je<0?Math.min(1,(Te[0]+je)/Te[0]):(1-je)/Te[0],0);return De+=Te[0]+Te[1],{abs:kt,distance:O.rtl?-1*je+1-Te[0]:je,portion:kn,size:Te[0]}});return Ze=te(Ze),he=de(Ze),{abs:te(Ze),length:M,max:J,maxIdx:U,min:z,minIdx:F,position:oe,progress:le?me/S:oe/M,rel:he,slides:Ce,slidesLength:S}}}();return E.details=ce,C.emit("detailsChanged"),ce}return E={absToRel:de,add:re,details:null,distToIdx:Y,idxToDist:I,init:function(fe){if(function(){if(O=C.options,R=(O.trackConfig||[]).map(function(ue){return[f(ue,"size",1),f(ue,"spacing",0),f(ue,"origin",0)]}),L=R.length){S=h(R.reduce(function(ue,ge){return ue+ge[0]+ge[1]},0));var le,me=L-1;M=h(S+R[0][2]-R[me][0]-R[me][2]-R[me][1]),W=R.reduce(function(ue,ge){if(!ue)return[0];var De=R[ue.length-1],Be=ue[ue.length-1]+(De[0]+De[2])+De[1];return Be-=ge[2],ue[ue.length-1]>Be&&(Be=ue[ue.length-1]),Be=h(Be),ue.push(Be),(!le||le<Be)&&($=ue.length-1),le=Be,ue},null),M===0&&($=0),W.push(h(S))}}(),!L)return ne(!0);var ce;(function(){var le=C.options.range,me=C.options.loop;K=F=me?f(me,"min",-1/0):0,j=U=me?f(me,"max",q):$;var ue=f(le,"min",null),ge=f(le,"max",null);ue!==null&&(F=ue),ge!==null&&(U=ge),z=F===-1/0?F:C.track.idxToDist(F||0,!0,0),J=U===q?U:I(U,!0,0),ge===null&&(j=U),f(le,"align",!1)&&U!==q&&R[de(U)][2]===0&&(J-=1-R[de(U)][0],U=Y(J-oe)),z=h(z),J=h(J)})(),ce=fe,Number(ce)===ce?re(B(te(fe))):ne()},to:Se,velocity:function(){var fe=r(),ce=ee.reduce(function(le,me){var ue=me.distance,ge=me.timestamp;return fe-ge>200||(u(ue)!==u(le.distance)&&le.distance&&(le={distance:0,lastTimestamp:0,time:0}),le.time&&(le.distance+=ue),le.lastTimestamp&&(le.time+=ge-le.lastTimestamp),le.lastTimestamp=ge),le},{distance:0,lastTimestamp:0,time:0});return ce.distance/ce.time||0}}}function w(C){var E,S,M,O,R,L,W,$;function F(Q){return 2*Q}function U(Q){return c(Q,W,$)}function K(Q){return 1-Math.pow(1-Q,3)}function j(){return M?C.track.velocity():0}function z(){ee();var Q=C.options.mode==="free-snap",oe=C.track,re=j();O=u(re);var Y=C.track.details,A=[];if(re||!Q){var I=J(re),B=I.dist,H=I.dur;if(H=F(H),B*=O,Q){var te=oe.idxToDist(oe.distToIdx(B),!0);te&&(B=te)}A.push({distance:B,duration:H,easing:K});var se=Y.position,de=se+B;if(de<R||de>L){var Se=de<R?R-se:L-se,ne=0,fe=re;if(u(Se)===O){var ce=Math.min(Math.abs(Se)/Math.abs(B),1),le=function(ge){return 1-Math.pow(1-ge,1/3)}(ce)*H;A[0].earlyExit=le,fe=re*(1-ce)}else A[0].earlyExit=0,ne+=Se;var me=J(fe,100),ue=me.dist*O;C.options.rubberband&&(A.push({distance:ue,duration:F(me.dur),easing:K}),A.push({distance:-ue+ne,duration:500,easing:K}))}C.animator.start(A)}else C.moveToIdx(U(Y.abs),!0,{duration:500,easing:function(ge){return 1+--ge*ge*ge*ge*ge}})}function J(Q,oe){oe===void 0&&(oe=1e3);var re=147e-9+(Q=Math.abs(Q))/oe;return{dist:Math.pow(Q,2)/re,dur:Q/re}}function q(){var Q=C.track.details;Q&&(R=Q.min,L=Q.max,W=Q.minIdx,$=Q.maxIdx)}function ee(){C.animator.stop()}C.on("updated",q),C.on("optionsChanged",q),C.on("created",q),C.on("dragStarted",function(){M=!1,ee(),E=S=C.track.details.abs}),C.on("dragChecked",function(){M=!0}),C.on("dragEnded",function(){var Q=C.options.mode;Q==="snap"&&function(){var oe=C.track,re=C.track.details,Y=re.position,A=u(j());(Y>L||Y<R)&&(A=0);var I=E+A;re.slides[oe.absToRel(I)].portion===0&&(I-=A),E!==S&&(I=S),u(oe.idxToDist(I,!0))!==A&&(I+=A),I=U(I);var B=oe.idxToDist(I,!0);C.animator.start([{distance:B,duration:500,easing:function(H){return 1+--H*H*H*H*H}}])}(),Q!=="free"&&Q!=="free-snap"||z()}),C.on("dragged",function(){S=C.track.details.abs})}function k(C){var E,S,M,O,R,L,W,$,F,U,K,j,z,J,q,ee,Q,oe,re=l();function Y(ne){if(L&&$===ne.id){var fe=H(ne);if(F){if(!B(ne))return I(ne);U=fe,F=!1,C.emit("dragChecked")}if(ee)return U=fe;i(ne);var ce=function(me){if(Q===-1/0&&oe===1/0)return me;var ue=C.track.details,ge=ue.length,De=ue.position,Be=c(me,Q-De,oe-De);if(ge===0)return 0;if(!C.options.rubberband)return Be;if(De<=oe&&De>=Q||De<Q&&S>0||De>oe&&S<0)return me;var Ze=(De<Q?De-Q:De-oe)/ge,he=O*ge,ve=Math.abs(Ze*he),Ce=Math.max(0,1-ve/R*2);return Ce*Ce*me}(W(U-fe)/O*M);S=u(ce);var le=C.track.details.position;(le>Q&&le<oe||le===Q&&S>0||le===oe&&S<0)&&a(ne),K+=ce,!j&&Math.abs(K*O)>5&&(j=!0),C.track.add(ce),U=fe,C.emit("dragged")}}function A(ne){!L&&C.track.details&&C.track.details.length&&(K=0,L=!0,j=!1,F=!0,$=ne.id,B(ne),U=H(ne),C.emit("dragStarted"))}function I(ne){L&&$===ne.idChanged&&(L=!1,C.emit("dragEnded"))}function B(ne){var fe=te(),ce=fe?ne.y:ne.x,le=fe?ne.x:ne.y,me=z!==void 0&&J!==void 0&&Math.abs(J-le)<=Math.abs(z-ce);return z=ce,J=le,me}function H(ne){return te()?ne.y:ne.x}function te(){return C.options.vertical}function se(){O=C.size,R=te()?window.innerHeight:window.innerWidth;var ne=C.track.details;ne&&(Q=ne.min,oe=ne.max)}function de(ne){j&&(a(ne),i(ne))}function Se(){if(re.purge(),C.options.drag&&!C.options.disabled){var ne;ne=C.options.dragSpeed||1,W=typeof ne=="function"?ne:function(ce){return ce*ne},M=C.options.rtl?-1:1,se(),E=C.container,function(){var ce="data-keen-slider-clickable";s("[".concat(ce,"]:not([").concat(ce,"=false])"),E).map(function(le){re.add(le,"dragstart",a),re.add(le,"mousedown",a),re.add(le,"touchstart",a)})}(),re.add(E,"dragstart",function(ce){i(ce)}),re.add(E,"click",de,{capture:!0}),re.input(E,"ksDragStart",A),re.input(E,"ksDrag",Y),re.input(E,"ksDragEnd",I),re.input(E,"mousedown",A),re.input(E,"mousemove",Y),re.input(E,"mouseleave",I),re.input(E,"mouseup",I),re.input(E,"touchstart",A,{passive:!0}),re.input(E,"touchmove",Y,{passive:!1}),re.input(E,"touchend",I),re.input(E,"touchcancel",I),re.add(window,"wheel",function(ce){L&&i(ce)});var fe="data-keen-slider-scrollable";s("[".concat(fe,"]:not([").concat(fe,"=false])"),C.container).map(function(ce){return function(le){var me;re.input(le,"touchstart",function(ue){me=H(ue),ee=!0,q=!0},{passive:!0}),re.input(le,"touchmove",function(ue){var ge=te(),De=ge?le.scrollHeight-le.clientHeight:le.scrollWidth-le.clientWidth,Be=me-H(ue),Ze=ge?le.scrollTop:le.scrollLeft,he=ge&&le.style.overflowY==="scroll"||!ge&&le.style.overflowX==="scroll";if(me=H(ue),(Be<0&&Ze>0||Be>0&&Ze<De)&&q&&he)return ee=!0;q=!1,i(ue),ee=!1}),re.input(le,"touchend",function(){ee=!1})}(ce)})}}C.on("updated",se),C.on("optionsChanged",Se),C.on("created",Se),C.on("destroyed",re.purge)}function _(C){var E,S,M=null;function O(z,J,q){C.animator.active?L(z,J,q):requestAnimationFrame(function(){return L(z,J,q)})}function R(){O(!1,!1,S)}function L(z,J,q){var ee=0,Q=C.size,oe=C.track.details;if(oe&&E){var re=oe.slides;E.forEach(function(Y,A){if(z)!M&&J&&$(Y,null,q),F(Y,null,q);else{if(!re[A])return;var I=re[A].size*Q;!M&&J&&$(Y,I,q),F(Y,re[A].distance*Q-ee,q),ee+=I}})}}function W(z){return C.options.renderMode==="performance"?Math.round(z):z}function $(z,J,q){var ee=q?"height":"width";J!==null&&(J=W(J)+"px"),z.style["min-"+ee]=J,z.style["max-"+ee]=J}function F(z,J,q){if(J!==null){J=W(J);var ee=q?J:0;J="translate3d(".concat(q?0:J,"px, ").concat(ee,"px, 0)")}z.style.transform=J,z.style["-webkit-transform"]=J}function U(){E&&(L(!0,!0,S),E=null),C.on("detailsChanged",R,!0)}function K(){O(!1,!0,S)}function j(){U(),S=C.options.vertical,C.options.disabled||C.options.renderMode==="custom"||(M=f(C.options.slides,"perView",null)==="auto",C.on("detailsChanged",R),(E=C.slides).length&&K())}C.on("created",j),C.on("optionsChanged",j),C.on("beforeOptionsChanged",function(){U()}),C.on("updated",K),C.on("destroyed",U)}function P(C,E){return function(S){var M,O,R,L,W,$=l();function F(B){var H;o(S.container,"reverse",(H=S.container,window.getComputedStyle(H,null).getPropertyValue("direction")!=="rtl"||B?null:"")),o(S.container,"v",S.options.vertical&&!B?"":null),o(S.container,"disabled",S.options.disabled&&!B?"":null)}function U(){K()&&ee()}function K(){var B=null;if(L.forEach(function(te){te.matches&&(B=te.__media)}),B===M)return!1;M||S.emit("beforeOptionsChanged"),M=B;var H=B?R.breakpoints[B]:R;return S.options=v(v({},R),H),F(),A(),I(),oe(),!0}function j(B){var H=d(B);return(S.options.vertical?H.height:H.width)/S.size||1}function z(){return S.options.trackConfig.length}function J(B){for(var H in M=!1,R=v(v({},E),B),$.purge(),O=S.size,L=[],R.breakpoints||[]){var te=window.matchMedia(H);te.__media=H,L.push(te),$.add(te,"change",U)}$.add(window,"orientationchange",Y),$.add(window,"resize",re),K()}function q(B){S.animator.stop();var H=S.track.details;S.track.init(B??(H?H.abs:0))}function ee(B){q(B),S.emit("optionsChanged")}function Q(B,H){if(B)return J(B),void ee(H);A(),I();var te=z();oe(),z()!==te?ee(H):q(H),S.emit("updated")}function oe(){var B=S.options.slides;if(typeof B=="function")return S.options.trackConfig=B(S.size,S.slides);for(var H=S.slides,te=H.length,se=typeof B=="number"?B:f(B,"number",te,!0),de=[],Se=f(B,"perView",1,!0),ne=f(B,"spacing",0,!0)/S.size||0,fe=Se==="auto"?ne:ne/Se,ce=f(B,"origin","auto"),le=0,me=0;me<se;me++){var ue=Se==="auto"?j(H[me]):1/Se-ne+fe,ge=ce==="center"?.5-ue/2:ce==="auto"?0:ce;de.push({origin:ge,size:ue,spacing:ne}),le+=ue}if(le+=ne*(se-1),ce==="auto"&&!S.options.loop&&Se!==1){var De=0;de.map(function(Be){var Ze=le-De;return De+=Be.size+ne,Ze>=1||(Be.origin=1-Ze-(le>1?0:1-le)),Be})}S.options.trackConfig=de}function re(){A();var B=S.size;S.options.disabled||B===O||(O=B,Q())}function Y(){re(),setTimeout(re,500),setTimeout(re,2e3)}function A(){var B=d(S.container);S.size=(S.options.vertical?B.height:B.width)||1}function I(){S.slides=s(S.options.selector,S.container)}S.container=(W=s(C,document)).length?W[0]:null,S.destroy=function(){$.purge(),S.emit("destroyed"),F(!0)},S.prev=function(){S.moveToIdx(S.track.details.abs-1,!0)},S.next=function(){S.moveToIdx(S.track.details.abs+1,!0)},S.update=Q,J(S.options)}}var T=function(C,E,S){try{return function(M,O){var R,L={};return R={emit:function(W){L[W]&&L[W].forEach(function(F){F(R)});var $=R.options&&R.options[W];$&&$(R)},moveToIdx:function(W,$,F){var U=R.track.idxToDist(W,$);if(U){var K=R.options.defaultAnimation;R.animator.start([{distance:U,duration:f(F||K,"duration",500),easing:f(F||K,"easing",function(j){return 1+--j*j*j*j*j})}])}},on:function(W,$,F){F===void 0&&(F=!1),L[W]||(L[W]=[]);var U=L[W].indexOf($);U>-1?F&&delete L[W][U]:F||L[W].push($)},options:M},function(){if(R.track=x(R),R.animator=b(R),O)for(var W=0,$=O;W<$.length;W++)(0,$[W])(R);R.track.init(R.options.initial||0),R.emit("created")}(),R}(E,y([P(C,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),_,k,w],S||[],!0))}catch(M){console.error(M)}};return j1.useKeenSlider=function(C,E){var S=e.useRef(null),M=e.useRef(!1),O=e.useRef(C),R=e.useCallback(function(L){L?(O.current=C,S.current=new T(L,C,E),M.current=!1):(S.current&&S.current.destroy&&S.current.destroy(),S.current=null)},[]);return e.useEffect(function(){g(O.current,C)||(O.current=C,S.current&&S.current.update(O.current))},[C]),[R,S]},j1}var VNe=BNe();function a7({className:e,onClick:t,children:n}){return p.jsx("div",{className:Ge("p-[6px] border-[0.5px] border-[#DEDEDE] rounded bg-[rgba(255,255,255,0.75)] shadow-[0px_2px_8px_0px_rgba(0,0,0,0.06)] backdrop-blur-[4px]",e),onClick:t,children:n})}function EK({direction:e,isVisible:t,onArrowClick:n}){const r=a=>{a.preventDefault(),n()},o=e==="left"?"left-[-40px]":"right-[-40px]",s=e==="left"?"left-[8px]":"right-[8px]",i=e==="left"?"rotate-90":"-rotate-90";return p.jsx(a7,{className:`absolute top-1/2 ${o} transform -translate-y-1/2 ${i} rounded-full cursor-pointer transition-all duration-500 ease-in-out ${t?s:""} [&_svg]:w-4 [&_svg]:h-4`,onClick:r,children:p.jsx(At.BlackChevronDown,{})})}function zNe({imagesLength:e,isVisible:t,currentIndex:n,onDotClick:r}){return p.jsx("div",{className:`absolute left-1/2 transform -translate-x-1/2 transition-all duration-500 ease-in-out ${t?"bottom-2":"bottom-[-40px]"}`,style:{width:"fit-content"},onClick:o=>o.preventDefault(),children:p.jsx("ul",{className:"flex gap-1 rounded-[20px] bg-[rgba(255,255,255,0.75)] p-1",children:Array.from({length:e}).map((o,s)=>p.jsx("li",{className:`shrink-0 h-1 w-1 rounded-full cursor-pointer transition-all duration-300 ease-in-out ${n===s?"w-4 rounded-3xl bg-black":"bg-[#878787]"}`,onClick:()=>r(s)},s))})})}function HNe({product:e,isHovered:t,isEditing:n}){const{images:r,title:o,slug:s}=e,{navigate:i}=Uu(),[a,l]=m.useState(0),c=r.slice(0,3),[u,d]=VNe.useKeenSlider({loop:!0,slides:{perView:1},mode:"snap",slideChanged:v=>l(v.track.details.rel)});m.useEffect(()=>{!t&&d.current&&(l(0),d.current?.moveToIdx?.(0))},[t]);const f=()=>{i(`product/${s}`)},h=v=>()=>{v()},g=v=>y=>{y.stopPropagation(),d.current?.moveToIdx(v)};return n||c.length===1?p.jsxs("div",{className:"relative overflow-hidden rounded-lg aspect-square cursor-pointer",children:[p.jsx("img",{src:c[0]?.thumbnail,alt:c[0]?.alt||o,onClick:f,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"}),p.jsx(PK,{product:e})]}):p.jsxs("div",{className:"relative overflow-hidden rounded-lg cursor-pointer",children:[p.jsx("div",{ref:u,className:"keen-slider content-start flex overflow-hidden relative touch-pan-y select-none w-full h-full",onClick:f,children:c.map((v,y)=>p.jsx("div",{className:"keen-slider__slide w-full h-full aspect-square flex items-center justify-center",children:p.jsx("img",{src:v.thumbnail,alt:v.alt||`${o}-${y}`,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"})},y))}),p.jsx(PK,{product:e}),p.jsx(EK,{direction:"left",isVisible:t,onArrowClick:h(()=>d.current?.prev())}),p.jsx(EK,{direction:"right",isVisible:t,onArrowClick:h(()=>d.current?.next())}),p.jsx(zNe,{imagesLength:c.length,isVisible:t,onDotClick:g,currentIndex:a})]})}function PK({product:e}){const{discountRuleset:t,gatedRuleset:n}=e;return p.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-2",children:[t&&p.jsx(a7,{children:p.jsx(At.Discount,{})}),n&&p.jsx(a7,{children:p.jsx(At.Gated,{})})]})}function WNe({product:e,isEditing:t}){const{title:n,lowestPrice:r,id:o,slug:s}=e,[i,a]=m.useState(!1);return p.jsxs("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),className:"w-full h-full flex flex-col select-none group",children:[p.jsx(HNe,{product:e,isHovered:i,isEditing:t}),p.jsx(SK,{title:n,slug:s,className:"mt-3"}),p.jsx(kK,{price:r,slug:s,className:"mt-2"})]})}function UNe(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((n,r)=>p.jsxs("div",{children:[p.jsx(Yo,{className:`rounded-lg aspect-square ${t}`}),p.jsx(Yo,{className:`h-10 md:h-12 mt-3 ${t}`}),p.jsx(Yo,{className:`h-6 mt-2 ${t}`})]},r))})}function qNe({product:e}){const{images:t,title:n,lowestPrice:r,discountRuleset:o,gatedRuleset:s,slug:i,id:a}=e,{isDarkTheme:l}=Je(),c=l?"[&_path]:stroke-white":"",{navigate:u}=Uu(),d=(t.find(f=>f.original)??t[0])?.thumbnail||t[0]?.original;return p.jsx("div",{className:"cursor-pointer",onClick:()=>u(`product/${i??a}`),children:p.jsx(TK,{image:p.jsx("img",{src:d,alt:n,className:"w-[70px] h-[70px] object-cover rounded-lg shrink-0"}),title:p.jsx(SK,{title:n,slug:i}),price:p.jsx(kK,{price:r,slug:i}),icons:p.jsxs(p.Fragment,{children:[o&&p.jsx(At.Discount,{className:c}),s&&p.jsx(At.Gated,{className:c})]})})})}function YNe(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((n,r)=>p.jsx(TK,{image:p.jsx(Yo,{className:`w-[70px] h-[70px] rounded-lg shrink-0 ${t}`}),title:p.jsx(Yo,{className:`h-10 w-1/2 ${t}`}),price:p.jsx(Yo,{className:`h-6 w-1/4 ${t}`}),icons:p.jsxs(p.Fragment,{children:[p.jsx(Yo,{className:`w-5 h-5 rounded-full ${t}`}),p.jsx(Yo,{className:`w-5 h-5 rounded-full ${t}`})]})},r))})}function TK({image:e,title:t,price:n,icons:r}){return p.jsxs("div",{className:"flex items-start gap-4",children:[e,p.jsxs("div",{className:"flex-1 flex flex-col gap-[6px]",children:[t,p.jsxs("div",{className:"flex justify-between items-center gap-4",children:[n,p.jsx("div",{className:"flex items-center gap-2",children:r})]})]})]})}function DK(e=768){const[t,n]=m.useState(!1);return m.useEffect(()=>{const r=()=>n(window.innerWidth<e);return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t}function l7({children:e}){const t=DK(),n=Vn(o=>o.viewMode),r=t?n==="grid"?"grid grid-cols-2 gap-x-4 gap-y-6":"grid grid-cols-1 gap-y-6":`grid
584
+ */const O$e=R4("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),eG=D.forwardRef(({className:e,...t},n)=>p.jsx(N4,{ref:n,className:Ge("peer h-4 w-4 shrink-0 rounded-sm border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",e),...t,children:p.jsx(YY,{className:Ge("flex items-center justify-center text-current"),children:p.jsx(JY,{className:"h-4 w-4"})})}));eG.displayName=N4.displayName;function tG({label:e,count:t,checked:n,onCheckChange:r}){const{isDarkTheme:o}=Je(),s=()=>r(!n),i=Ge("w-5 h-5 border rounded-sm flex items-center justify-center border-shop-textColor",{"border-white bg-white text-black":n&&o,"border-black bg-black text-white":n&&!o}),a=o?"text-subtextPlaceholder-Dark":"text-subtextPlaceholde-Light";return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(eG,{checked:n,onCheckedChange:s,className:i}),p.jsx(ct,{as:"label",className:"flex-1 cursor-pointer text-sm font-normal",onClick:s,children:e}),t!==void 0&&p.jsx(ct,{as:"span",className:`text-sm text-${a}`,children:t})]})}function Yo({className:e,...t}){return p.jsx("div",{className:Ge("animate-pulse rounded-md bg-muted",e),...t})}function B4(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((n,r)=>p.jsxs("div",{className:"flex gap-2 items-center animate-pulse",children:[p.jsx(Yo,{className:Ge("w-5 h-5 rounded-sm",t)}),p.jsx(Yo,{className:Ge("w-1/2 h-4 flex-1 rounded-md",t)}),p.jsx(Yo,{className:Ge("w-8 h-4 rounded-md",t)})]},r))})}const nG=m.createContext(void 0);function A$e({children:e,isLoading:t,applyFiltersDirectly:n,data:r}){const{setStagedProductQuery:o,applyStagedFilters:s}=Vn(a=>({setStagedProductQuery:a.setStagedProductQuery,applyStagedFilters:a.applyStagedFilters})),i=(a,l)=>{o(a,l),n&&s()};return p.jsx(nG.Provider,{value:{isLoading:t,data:r,applyFiltersDirectly:n,updateFilter:i},children:e})}function V4(){const e=m.useContext(nG);if(!e)throw new Error("useFilterData must be used within a ProductFiltersProvider");return e}function j$e(){const{isLoading:e,data:t,updateFilter:n}=V4(),r=t?.collections??[],[o,s]=m.useState(!1),i=o?r:r.slice(0,3),a=Vn(c=>c.stagedProductQuery.collectionId),l=(c,u)=>{const d=u?[...a,c]:a.filter(f=>f!==c);n("collectionId",d)};return e?p.jsx(B4,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[i.map(c=>p.jsx(tG,{label:c.title,count:c.count,checked:a.includes(c._id),onCheckChange:u=>l(c._id,u)},c._id)),r.length>3&&p.jsx(hl,{onClick:()=>s(c=>!c),className:"flex self-center items-center font-medium",iconLeft:p.jsx(At.BlackChevronDown,{className:`text-[#179EF8] ${o?"rotate-180":""}`}),children:o?"Less":"More"})]})}function z4({title:e,children:t}){const{isDarkTheme:n}=Je();return p.jsxs(BY,{value:e,className:"border-b-0",children:[p.jsx(VY,{chevronClassName:n?"[&>path]:stroke-white":"",className:"flex items-center rounded px-3 py-2 text-sm font-normal hover:no-underline bg-shop-foreground",children:p.jsx(ct,{children:e})}),p.jsx(zY,{className:"flex flex-col mt-4 gap-4 px-3 py-0",children:t})]})}function H4(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function W4(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function E1(e){return e!==null&&e.length===1?e[0]:e.slice()}function P1(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function yl(e,t){return U4(function(n,r){let o=n;return o<=r.min&&(o=r.min),o>=r.max&&(o=r.max),o}(e,t),t)}function U4(e,t){const n=(e-t.min)%t.step;let r=e-n;return 2*Math.abs(n)>=t.step&&(r+=n>0?t.step:-t.step),parseFloat(r.toFixed(5))}let q4=function(e){function t(r){var o;(o=e.call(this,r)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=a=>{a.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=a=>{o.setState({pending:!0});const l=o.getMousePosition(a),c=o.getDiffPosition(l[0]),u=o.getValueFromPosition(c);o.move(u)},o.onTouchMove=a=>{if(a.touches.length>1)return;o.setState({pending:!0});const l=o.getTouchPosition(a);if(o.isScrolling===void 0){const d=l[0]-o.startPosition[0],f=l[1]-o.startPosition[1];o.isScrolling=Math.abs(f)>Math.abs(d)}if(o.isScrolling)return void o.setState({index:-1});const c=o.getDiffPosition(l[0]),u=o.getValueFromPosition(c);o.move(u)},o.onKeyDown=a=>{if(!(a.ctrlKey||a.shiftKey||a.altKey||a.metaKey))switch(o.setState({pending:!0}),a.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":a.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":a.preventDefault(),o.moveUpByStep();break;case"Home":a.preventDefault(),o.move(o.props.min);break;case"End":a.preventDefault(),o.move(o.props.max);break;case"PageDown":a.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":a.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=a=>{if(!o.props.disabled&&a.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){const l=o.getMousePosition(a);o.forceValueFromPosition(l[0],c=>{o.start(c,l[0]),P1(o.getMouseEventMap())})}H4(a)}},o.onSliderClick=a=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){const l=o.getMousePosition(a),c=yl(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=a=>l=>{o.props.disabled||(o.start(a),P1(o.getKeyDownEventMap()),H4(l))},o.createOnMouseDown=a=>l=>{if(o.props.disabled||l.button===2)return;o.setState({pending:!0});const c=o.getMousePosition(l);o.start(a,c[0]),P1(o.getMouseEventMap()),H4(l)},o.createOnTouchStart=a=>l=>{if(o.props.disabled||l.touches.length>1)return;o.setState({pending:!0});const c=o.getTouchPosition(l);o.startPosition=c,o.isScrolling=void 0,o.start(a,c[0]),P1(o.getTouchEventMap()),function(u){u.stopPropagation&&u.stopPropagation()}(l)},o.handleResize=()=>{const a=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(a)},o.renderThumb=(a,l)=>{const c=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+l+" "+(o.state.index===l?o.props.thumbActiveClassName:""),u={ref:f=>{o["thumb"+l]=f},key:o.props.thumbClassName+"-"+l,className:c,style:a,onMouseDown:o.createOnMouseDown(l),onTouchStart:o.createOnTouchStart(l),onFocus:o.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[l],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[l]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[l]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},d={index:l,value:E1(o.state.value),valueNow:o.state.value[l]};return o.props.ariaValuetext&&(u["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(d)),o.props.renderThumb(u,d)},o.renderTrack=(a,l,c)=>{const u={key:o.props.trackClassName+"-"+a,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+a,style:o.buildTrackStyle(l,o.state.upperBound-c)},d={index:a,value:E1(o.state.value)};return o.props.renderTrack(u,d)};let s=W4(r.value);s.length||(s=W4(r.defaultValue)),o.pendingResizeTimeouts=[];const i=[];for(let a=0;a<s.length;a+=1)s[a]=yl(s[a],r),i.push(a);return o.resizeObserver=null,o.resizeElementRef=m.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:s,zIndices:i},o}Di(t,e);var n=t.prototype;return n.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(r,o){const s=W4(r.value);return s.length?o.pending?null:{value:s.map(i=>yl(i,r))}:null},n.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},n.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},n.onEnd=function(r){r&&function(o){Object.keys(o).forEach(s=>{typeof document<"u"&&document.removeEventListener(s,o[s],!1)})}(r),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},n.getValue=function(){return E1(this.state.value)},n.getClosestIndex=function(r){let o=Number.MAX_VALUE,s=-1;const{value:i}=this.state,a=i.length;for(let l=0;l<a;l+=1){const c=this.calcOffset(i[l]),u=Math.abs(r-c);u<o&&(o=u,s=l)}return s},n.getMousePosition=function(r){return[r["page"+this.axisKey()],r["page"+this.orthogonalAxisKey()]]},n.getTouchPosition=function(r){const o=r.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},n.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},n.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},n.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},n.getValueFromPosition=function(r){const o=r/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return yl(this.state.startValue+o,this.props)},n.getDiffPosition=function(r){let o=r-this.state.startPosition;return this.props.invert&&(o*=-1),o},n.resize=function(){const{slider:r,thumb0:o}=this;if(!r||!o)return;const s=this.sizeKey(),i=r.getBoundingClientRect(),a=r[s],l=i[this.posMaxKey()],c=i[this.posMinKey()],u=o.getBoundingClientRect()[s.replace("client","").toLowerCase()],d=a-u,f=Math.abs(l-c);this.state.upperBound===d&&this.state.sliderLength===f&&this.state.thumbSize===u||this.setState({upperBound:d,sliderLength:f,thumbSize:u})},n.calcOffset=function(r){const o=this.props.max-this.props.min;return o===0?0:(r-this.props.min)/o*this.state.upperBound},n.calcValue=function(r){return r/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},n.calcOffsetFromPosition=function(r){const{slider:o}=this,s=o.getBoundingClientRect(),i=s[this.posMaxKey()],a=s[this.posMinKey()];let l=r-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?i:a));return this.props.invert&&(l=this.state.sliderLength-l),l-=this.state.thumbSize/2,l},n.forceValueFromPosition=function(r,o){const s=this.calcOffsetFromPosition(r),i=this.getClosestIndex(s),a=yl(this.calcValue(s),this.props),l=this.state.value.slice();l[i]=a;for(let c=0;c<l.length-1;c+=1)if(l[c+1]-l[c]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:l},()=>{o(i),this.fireChangeEvent("onChange")})},n.clearPendingResizeTimeouts=function(){do{const r=this.pendingResizeTimeouts.shift();clearTimeout(r)}while(this.pendingResizeTimeouts.length)},n.start=function(r,o){const s=this["thumb"+r];s&&s.focus();const{zIndices:i}=this.state;i.splice(i.indexOf(r),1),i.push(r),this.setState(a=>({startValue:a.value[r],startPosition:o!==void 0?o:a.startPosition,index:r,zIndices:i}))},n.moveUpByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=yl(this.props.invert&&this.props.orientation==="horizontal"?o-r:o+r,this.props);this.move(Math.min(s,this.props.max))},n.moveDownByStep=function(r){r===void 0&&(r=this.props.step);const o=this.state.value[this.state.index],s=yl(this.props.invert&&this.props.orientation==="horizontal"?o+r:o-r,this.props);this.move(Math.max(s,this.props.min))},n.move=function(r){const o=this.state.value.slice(),{index:s}=this.state,{length:i}=o,a=o[s];if(r===a)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;const{pearling:l,max:c,min:u,minDistance:d}=this.props;if(!l){if(s>0){const f=o[s-1];r<f+d&&(r=f+d)}if(s<i-1){const f=o[s+1];r>f-d&&(r=f-d)}}o[s]=r,l&&i>1&&(r>a?(this.pushSucceeding(o,d,s),function(f,h,g,v){for(let y=0;y<f;y+=1){const b=v-y*g;h[f-1-y]>b&&(h[f-1-y]=b)}}(i,o,d,c)):r<a&&(this.pushPreceding(o,d,s),function(f,h,g,v){for(let y=0;y<f;y+=1){const b=v+y*g;h[y]<b&&(h[y]=b)}}(i,o,d,u))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},n.pushSucceeding=function(r,o,s){let i,a;for(i=s,a=r[i]+o;r[i+1]!==null&&a>r[i+1];i+=1,a=r[i]+o)r[i+1]=U4(a,this.props)},n.pushPreceding=function(r,o,s){for(let i=s,a=r[i]-o;r[i-1]!==null&&a<r[i-1];i-=1,a=r[i]-o)r[i-1]=U4(a,this.props)},n.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},n.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},n.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},n.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},n.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},n.fireChangeEvent=function(r){this.props[r]&&this.props[r](E1(this.state.value),this.state.index)},n.buildThumbStyle=function(r,o){const s={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return s[this.posMinKey()]=r+"px",s},n.buildTrackStyle=function(r,o){const s={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return s[this.posMinKey()]=r,s[this.posMaxKey()]=o,s},n.buildMarkStyle=function(r){var o;return(o={position:"absolute"})[this.posMinKey()]=r,o},n.renderThumbs=function(r){const{length:o}=r,s=[];for(let a=0;a<o;a+=1)s[a]=this.buildThumbStyle(r[a],a);const i=[];for(let a=0;a<o;a+=1)i[a]=this.renderThumb(s[a],a);return i},n.renderTracks=function(r){const o=[],s=r.length-1;o.push(this.renderTrack(0,0,r[0]));for(let i=0;i<s;i+=1)o.push(this.renderTrack(i+1,r[i],r[i+1]));return o.push(this.renderTrack(s+1,r[s],this.state.upperBound)),o},n.renderMarks=function(){let{marks:r}=this.props;const o=this.props.max-this.props.min+1;return typeof r=="boolean"?r=Array.from({length:o}).map((s,i)=>i):typeof r=="number"&&(r=Array.from({length:o}).map((s,i)=>i).filter(s=>s%r==0)),r.map(parseFloat).sort((s,i)=>s-i).map(s=>{const i=this.calcOffset(s),a={key:s,className:this.props.markClassName,style:this.buildMarkStyle(i)};return this.props.renderMark(a)})},n.render=function(){const r=[],{value:o}=this.state,s=o.length;for(let c=0;c<s;c+=1)r[c]=this.calcOffset(o[c],c);const i=this.props.withTracks?this.renderTracks(r):null,a=this.renderThumbs(r),l=this.props.marks?this.renderMarks():null;return m.createElement("div",{ref:c=>{this.slider=c,this.resizeElementRef.current=c},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},i,a,l)},t}(m.Component);q4.displayName="ReactSlider",q4.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>m.createElement("div",e),renderTrack:e=>m.createElement("div",e),renderMark:e=>m.createElement("span",e)};var I$e=q4;const L$e={USD:p.jsx(At.DollarSign,{}),AUD:p.jsx(At.DollarSign,{}),CAD:p.jsx(At.CAD,{}),GBP:p.jsx(At.GBP,{}),AED:p.jsx(At.AED,{}),CNY:p.jsx(At.CNY,{}),JPY:p.jsx(At.JPY,{}),EUR:p.jsx(At.EUR,{})};function $$e({currencyCode:e,className:t}){return p.jsx("div",{className:t,children:L$e[e]??p.jsx(At.DollarSign,{})})}function F$e({isFocused:e,isDarkTheme:t,textColorParagraphs:n}){const r=Mh("flex flex-1 items-center gap-2 px-4 py-3 rounded-lg border",{"border-black":e&&!t,"border-white":e&&t,[`border-[${n}]`]:!e}),o=Mh("w-full text-sm font-normal bg-transparent placeholder-[#B1B1B1] focus:outline-none focus:ring-0 focus:border-none",{"text-[#B1B1B1]":!e&&!t,"text-[#7B7B7B]":!e&&t,"text-white":e&&t,"text-black":e&&!t}),s=Mh("shrink-0",{"[&_path]:stroke-[#B1B1B1]":!e&&!t,"[&_path]:stroke-[#7B7B7B]":!e&&t,"[&_path]:stroke-white":e&&t,"[&_path]:stroke-black":e&&!t});return{containerClassName:r,inputClassName:o,iconClassName:s}}function rG({value:e,placeholder:t,onValueChange:n,...r}){const{states:{shop:{currency:o,shopDesign:{fontfamily:s,textColorParagraphs:i}}}}=Dr(),{isDarkTheme:a}=Je(),[l,c]=m.useState(!1),{containerClassName:u,iconClassName:d,inputClassName:f}=F$e({isFocused:l,isDarkTheme:a,textColorParagraphs:i});return p.jsxs("div",{className:u,children:[p.jsx($$e,{currencyCode:o.abbreviation,className:d}),p.jsx("input",{type:"number",className:` !font-shopfont ${f}`,value:e,placeholder:t,onChange:({target:{validity:h,value:g}})=>h.valid&&n(+g),onKeyDown:h=>{["+","-","e","."].includes(h.key)&&h.preventDefault()},onFocus:()=>c(!0),onBlur:()=>c(!1),...r})]})}const Y4=(e,t=500)=>{const[n,r]=m.useState(e);return m.useEffect(()=>{const o=setTimeout(()=>r(e),t);return()=>clearTimeout(o)},[e,t]),n};function N$e(){const{states:{shop:{currency:e}}}=Dr(),{isLoading:t,data:n}=V4(),{isDarkTheme:r}=Je(),{min:o=0,max:s=1e5}=n?.price?{min:Math.floor(+U1(n.price.min,e?.conversionRateToUSD)),max:Math.ceil(+U1(n.price.max,e?.conversionRateToUSD))}:{},{minPrice:i,maxPrice:a,setStagedProductQuery:l,applyStagedFilters:c}=Vn(g=>({minPrice:g.stagedProductQuery.minPrice??o,maxPrice:g.stagedProductQuery.maxPrice??s,setStagedProductQuery:g.setStagedProductQuery,applyStagedFilters:g.applyStagedFilters})),u=Y4(i,300),d=Y4(a,300);m.useEffect(()=>{c()},[u,d,c]);const f=g=>{g<a&&l("minPrice",g)},h=g=>{g>i&&l("maxPrice",g)};return t?p.jsx(B4,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(rG,{value:i,placeholder:"0",onValueChange:f,min:o}),p.jsx(At.Separator,{className:"shrink-0"}),p.jsx(rG,{value:a,placeholder:"1000",onValueChange:h,max:s})]}),p.jsx(I$e,{className:"price-range-slider",thumbClassName:r?"dark-price-range-slider__thumb":"price-range-slider__thumb",trackClassName:r?"dark-price-range-slider__track":"price-range-slider__track",value:[i,a],renderThumb:g=>p.jsx("div",{...g}),minDistance:1,onChange:([g,v])=>{l("minPrice",g),l("maxPrice",v)},min:o,max:s})]})}function R$e(){const{isLoading:e,data:t,updateFilter:n}=V4(),r=Vn(s=>s.stagedProductQuery.productTypes);if(e)return p.jsx(B4,{});const o=(s,i)=>{const a=i?[...r,s]:r.filter(l=>l!==s);n("productTypes",a)};return p.jsx("div",{className:"space-y-4",children:t?.types.map((s,i)=>p.jsx(tG,{label:s.label,count:s.count,checked:r.includes(s.value),onCheckChange:a=>o(s.value,a)},i))})}const B$e=({shopName:e})=>t1.get(`/shops/v2/public/name/${e}`),V$e=e=>t1.get(`/product-v2/available/filters/${e}`).then(t=>t.data);function z$e(){const{states:{shop:e}}=Dr();return aq({queryFn:()=>V$e(e.name),refetchOnWindowFocus:!1})}function oG({className:e,applyFiltersDirectly:t=!0}){const{isLoading:n,data:r,isError:o}=z$e();return o?p.jsx(ct,{className:`${e} text-[#dc2626]`,children:"An error occurred while fetching product filters. Please try again later."}):p.jsx(A$e,{isLoading:n,applyFiltersDirectly:t,data:r?.data,children:p.jsx(H$e,{className:e})})}function H$e({className:e}){return p.jsxs(b$e,{type:"multiple",className:Ge("flex flex-col gap-6",e),children:[p.jsx(z4,{title:"Type",children:p.jsx(R$e,{})}),p.jsx(z4,{title:"Collection",children:p.jsx(j$e,{})}),p.jsx(z4,{title:"Price",children:p.jsx(N$e,{})})]})}const W$e=(e,t="filled")=>{const{"--dlk-comps":{"--dlk-comps-btn":{"--dlk-comps-btn-styles":n,"--dlk-comps-btn-fill":{"--dlk-comps-btn-fill-styles":r,"--dlk-comps-btn-fill-pseudo":o},"--dlk-comps-btn-out":{"--dlk-comps-btn-out-styles":s,"--dlk-comps-btn-out-pseudo":i}}}}=e;let a={...n};return t==="filled"&&r?a={...a,...r,...o}:t==="outline"&&s&&(a={...a,...s,...i}),a};function sG({variant:e="filled",children:t,...n}){const{states:{shop:{template_options:r,shopDesign:o}}}=Dr(),s={filled:{fontFamily:`${o?.fontfamily} !important`,boxShadow:"unset !important",backgroundColor:o?.textColorParagraphs||"#FFF",color:o?.backgroundBody||"#000",border:"1px solid #555",padding:"20px 10px",_hover:{backgroundColor:o?.backgroundBody||"#EEE"}},outline:{fontFamily:`${o?.fontfamily} !important`,boxShadow:"unset !important",background:"none",color:o?.textColorParagraphs||"#FFF",border:`1px solid ${o?.textColorParagraphs||"#FFF"}`,padding:"20px 10px",_hover:{background:"none"}}};return p.jsx(Ym,{...s[e],...W$e(r,e),...n,children:t})}function iG(){const{isDarkTheme:e,shopDesign:{textColorParagraphs:t}}=Je(),n=Vn(o=>o.applyStagedFilters),r=Vn(o=>o.resetProductQuery);return p.jsxs(cY,{children:[p.jsxs(uY,{className:`flex items-center justify-center gap-[6px] w-10 h-10 md:h-auto md:w-auto md:px-[14px] md:py-[10px] lg:hidden border rounded-lg border-[${t}]`,children:[p.jsx(At.Filter,{className:`shrink-0 ${e?"[&>path]:stroke-white":""}`}),p.jsx(ct,{as:"span",className:"hidden md:block text-sm font-medium",children:"Filters"})]}),p.jsxs(w4,{side:"bottom",className:`flex flex-col max-h-[70vh] p-0 rounded-t-[16px] border-b border-[${t}] bg-${e?"black":"white"}`,closeButtonClassName:`top-4 right-4 md:top-6 md:right-9 ${e?"[&>svg>path]:stroke-white":""}`,children:[p.jsx(C4,{className:`flex items-start p-4 md:px-9 md:py-6 border-b border-[${t}]`,children:p.jsx(ct,{className:"text-sm font-bold",children:"Filters"})}),p.jsx("div",{className:"flex-1 overflow-y-auto",children:p.jsx(oG,{applyFiltersDirectly:!1,className:"p-4 pb-9 md:p-9"})}),p.jsxs(fY,{className:`flex flex-row gap-4 p-4 md:px-9 md:py-6 border-t border-[${t}]`,children:[p.jsx(x4,{asChild:!0,children:p.jsx(sG,{fontSize:14,fontWeight:500,variant:"outline",onClick:r,children:"Reset"})}),p.jsx(x4,{asChild:!0,children:p.jsx(sG,{flex:1,fontSize:14,fontWeight:500,onClick:n,children:"Apply Filters"})})]})]})]})}function aG(){const{isDarkTheme:e}=Je(),t=m.useRef(null),n=Vn(a=>a.stagedProductQuery.search),r=Vn(a=>a.setStagedProductQuery),o=Vn(a=>a.applyStagedFilters),s=Y4(n);m.useEffect(()=>{o()},[s,o]);const i=()=>t.current?.focus();return p.jsxs("div",{className:"flex items-center gap-2 lg:w-[312px] border border-shop-borderColor rounded-lg py-[6px] pl-3 pr-2",children:[p.jsx(At.Search,{className:`shrink-0 ${e?"[&>path]:stroke-white":""}`}),p.jsx("input",{ref:t,type:"text",value:n,onChange:a=>r("search",a.target.value),placeholder:"Search",className:`flex-1 bg-transparent text-sm focus:outline-none !font-shopfont ${e?"text-white dark-placeholder":"text-black light-placeholder"}`}),p.jsx("button",{onClick:i,className:"shrink-0",children:p.jsx(At.SearchInputIcon,{className:`${e?"[&>path]:fill-[#292929]":""}`})})]})}var U$e="Arrow",lG=D.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return p.jsx(Dt.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});lG.displayName=U$e;var q$e=lG,G4="Popper",[cG,uG]=fi(G4),[Y$e,dG]=cG(G4),fG=e=>{const{__scopePopper:t,children:n}=e,[r,o]=D.useState(null);return p.jsx(Y$e,{scope:t,anchor:r,onAnchorChange:o,children:n})};fG.displayName=G4;var pG="PopperAnchor",hG=D.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=dG(pG,n),i=D.useRef(null),a=un(t,i);return D.useEffect(()=>{s.onAnchorChange(r?.current||i.current)}),r?null:p.jsx(Dt.div,{...o,ref:a})});hG.displayName=pG;var K4="PopperContent",[G$e,K$e]=cG(K4),mG=D.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,y=dG(K4,n),[b,x]=D.useState(null),w=un(t,re=>x(re)),[k,_]=D.useState(null),P=HY(k),T=P?.width??0,C=P?.height??0,E=r+(s!=="center"?"-"+s:""),S=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(c)?c:[c],O=M.length>0,R={padding:S,boundary:M.filter(Z$e),altBoundary:O},{refs:L,floatingStyles:W,placement:$,isPositioned:F,middlewareData:U}=MH({strategy:"fixed",placement:E,whileElementsMounted:(...re)=>EH(...re,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[OH({mainAxis:o+C,alignmentAxis:i}),l&&vTe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?yTe():void 0,...R}),l&&AH({...R}),bTe({...R,apply:({elements:re,rects:Y,availableWidth:A,availableHeight:I})=>{const{width:B,height:H}=Y.reference,te=re.floating.style;te.setProperty("--radix-popper-available-width",`${A}px`),te.setProperty("--radix-popper-available-height",`${I}px`),te.setProperty("--radix-popper-anchor-width",`${B}px`),te.setProperty("--radix-popper-anchor-height",`${H}px`)}}),k&&jH({element:k,padding:a}),X$e({arrowWidth:T,arrowHeight:C}),f&&xTe({strategy:"referenceHidden",...R})]}),[K,j]=yG($),z=hi(g);pi(()=>{F&&z?.()},[F,z]);const J=U.arrow?.x,q=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[Q,oe]=D.useState();return pi(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:F?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(G$e,{scope:n,placedSide:K,onArrowChange:_,arrowX:J,arrowY:q,shouldHideArrow:ee,children:p.jsx(Dt.div,{"data-side":K,"data-align":j,...v,ref:w,style:{...v.style,animation:F?void 0:"none"}})})})});mG.displayName=K4;var gG="PopperArrow",Q$e={top:"bottom",right:"left",bottom:"top",left:"right"},vG=D.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=K$e(gG,r),i=Q$e[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(q$e,{...o,ref:n,style:{...o.style,display:"block"}})})});vG.displayName=gG;function Z$e(e){return e!==null}var X$e=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=yG(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=i?d:`${f}px`,v=`${-l}px`):c==="top"?(g=i?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=i?d:`${h}px`):c==="left"&&(g=`${r.floating.width+l}px`,v=i?d:`${h}px`),{data:{x:g,y:v}}}});function yG(e){const[t,n="center"]=e.split("-");return[t,n]}var J$e=fG,eFe=hG,tFe=mG,nFe=vG,Q4="rovingFocusGroup.onEntryFocus",rFe={bubbles:!1,cancelable:!0},ph="RovingFocusGroup",[Z4,bG,oFe]=T4(ph),[sFe,xG]=fi(ph,[oFe]),[iFe,aFe]=sFe(ph),wG=D.forwardRef((e,t)=>p.jsx(Z4.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Z4.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(lFe,{...e,ref:t})})}));wG.displayName=ph;var lFe=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=D.useRef(null),h=un(t,f),g=A4(s),[v,y]=gl({prop:i,defaultProp:a??null,onChange:l,caller:ph}),[b,x]=D.useState(!1),w=hi(c),k=bG(n),_=D.useRef(!1),[P,T]=D.useState(0);return D.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(Q4,w),()=>C.removeEventListener(Q4,w)},[w]),p.jsx(iFe,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:D.useCallback(C=>y(C),[y]),onItemShiftTab:D.useCallback(()=>x(!0),[]),onFocusableItemAdd:D.useCallback(()=>T(C=>C+1),[]),onFocusableItemRemove:D.useCallback(()=>T(C=>C-1),[]),children:p.jsx(Dt.div,{tabIndex:b||P===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{_.current=!0}),onFocus:Ve(e.onFocus,C=>{const E=!_.current;if(C.target===C.currentTarget&&E&&!b){const S=new CustomEvent(Q4,rFe);if(C.currentTarget.dispatchEvent(S),!S.defaultPrevented){const M=k().filter($=>$.focusable),O=M.find($=>$.active),R=M.find($=>$.id===v),W=[O,R,...M].filter(Boolean).map($=>$.ref.current);SG(W,u)}}_.current=!1}),onBlur:Ve(e.onBlur,()=>x(!1))})})}),CG="RovingFocusGroupItem",kG=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=ia(),c=s||l,u=aFe(CG,n),d=u.currentTabStopId===c,f=bG(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=u;return D.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),p.jsx(Z4.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:p.jsx(Dt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ve(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:Ve(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ve(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=dFe(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=f().filter(k=>k.focusable).map(k=>k.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const k=w.indexOf(y.currentTarget);w=u.loop?fFe(w,k+1):w.slice(k+1)}setTimeout(()=>SG(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:v!=null}):i})})});kG.displayName=CG;var cFe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uFe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dFe(e,t,n){const r=uFe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cFe[r]}function SG(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fFe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pFe=wG,hFe=kG,X4=["Enter"," "],mFe=["ArrowDown","PageUp","Home"],_G=["ArrowUp","PageDown","End"],gFe=[...mFe,..._G],vFe={ltr:[...X4,"ArrowRight"],rtl:[...X4,"ArrowLeft"]},yFe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hh="Menu",[mh,bFe,xFe]=T4(hh),[bl,EG]=fi(hh,[xFe,uG,xG]),T1=uG(),PG=xG(),[wFe,xl]=bl(hh),[CFe,gh]=bl(hh),TG=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=T1(t),[l,c]=D.useState(null),u=D.useRef(!1),d=hi(s),f=A4(o);return D.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.jsx(J$e,{...a,children:p.jsx(wFe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:p.jsx(CFe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};TG.displayName=hh;var kFe="MenuAnchor",J4=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=T1(n);return p.jsx(eFe,{...o,...r,ref:t})});J4.displayName=kFe;var e7="MenuPortal",[SFe,DG]=bl(e7,{forceMount:void 0}),MG=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=xl(e7,t);return p.jsx(SFe,{scope:t,forceMount:n,children:p.jsx(Is,{present:n||s.open,children:p.jsx(m4,{asChild:!0,container:o,children:r})})})};MG.displayName=e7;var vo="MenuContent",[_Fe,t7]=bl(vo),OG=D.forwardRef((e,t)=>{const n=DG(vo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xl(vo,e.__scopeMenu),i=gh(vo,e.__scopeMenu);return p.jsx(mh.Provider,{scope:e.__scopeMenu,children:p.jsx(Is,{present:r||s.open,children:p.jsx(mh.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(EFe,{...o,ref:t}):p.jsx(PFe,{...o,ref:t})})})})}),EFe=D.forwardRef((e,t)=>{const n=xl(vo,e.__scopeMenu),r=D.useRef(null),o=un(t,r);return D.useEffect(()=>{const s=r.current;if(s)return vw(s)},[]),p.jsx(n7,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),PFe=D.forwardRef((e,t)=>{const n=xl(vo,e.__scopeMenu);return p.jsx(n7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),TFe=qu("MenuContent.ScrollLock"),n7=D.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,...v}=e,y=xl(vo,n),b=gh(vo,n),x=T1(n),w=PG(n),k=bFe(n),[_,P]=D.useState(null),T=D.useRef(null),C=un(t,T,y.onContentChange),E=D.useRef(0),S=D.useRef(""),M=D.useRef(0),O=D.useRef(null),R=D.useRef("right"),L=D.useRef(0),W=g?ug:D.Fragment,$=g?{as:TFe,allowPinchZoom:!0}:void 0,F=K=>{const j=S.current+K,z=k().filter(re=>!re.disabled),J=document.activeElement,q=z.find(re=>re.ref.current===J)?.textValue,ee=z.map(re=>re.textValue),Q=BFe(ee,j,q),oe=z.find(re=>re.textValue===Q)?.ref.current;(function re(Y){S.current=Y,window.clearTimeout(E.current),Y!==""&&(E.current=window.setTimeout(()=>re(""),1e3))})(j),oe&&setTimeout(()=>oe.focus())};D.useEffect(()=>()=>window.clearTimeout(E.current),[]),Bq();const U=D.useCallback(K=>R.current===O.current?.side&&zFe(K,O.current?.area),[]);return p.jsx(_Fe,{scope:n,searchRef:S,onItemEnter:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),onItemLeave:D.useCallback(K=>{U(K)||(T.current?.focus(),P(null))},[U]),onTriggerLeave:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),pointerGraceTimerRef:M,onPointerGraceIntentChange:D.useCallback(K=>{O.current=K},[]),children:p.jsx(W,{...$,children:p.jsx(h4,{asChild:!0,trapped:o,onMountAutoFocus:Ve(s,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(d4,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:p.jsx(pFe,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:P,onEntryFocus:Ve(l,K=>{b.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(tFe,{role:"menu","aria-orientation":"vertical","data-state":GG(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:C,style:{outline:"none",...v.style},onKeyDown:Ve(v.onKeyDown,K=>{const z=K.target.closest("[data-radix-menu-content]")===K.currentTarget,J=K.ctrlKey||K.altKey||K.metaKey,q=K.key.length===1;z&&(K.key==="Tab"&&K.preventDefault(),!J&&q&&F(K.key));const ee=T.current;if(K.target!==ee||!gFe.includes(K.key))return;K.preventDefault();const oe=k().filter(re=>!re.disabled).map(re=>re.ref.current);_G.includes(K.key)&&oe.reverse(),NFe(oe)}),onBlur:Ve(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(E.current),S.current="")}),onPointerMove:Ve(e.onPointerMove,yh(K=>{const j=K.target,z=L.current!==K.clientX;if(K.currentTarget.contains(j)&&z){const J=K.clientX>L.current?"right":"left";R.current=J,L.current=K.clientX}}))})})})})})})});OG.displayName=vo;var DFe="MenuGroup",r7=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Dt.div,{role:"group",...r,ref:t})});r7.displayName=DFe;var MFe="MenuLabel",AG=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Dt.div,{...r,ref:t})});AG.displayName=MFe;var D1="MenuItem",jG="menu.itemSelect",M1=D.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=D.useRef(null),i=gh(D1,e.__scopeMenu),a=t7(D1,e.__scopeMenu),l=un(t,s),c=D.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(jG,{bubbles:!0,cancelable:!0});d.addEventListener(jG,h=>r?.(h),{once:!0}),Mq(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return p.jsx(IG,{...o,ref:l,disabled:n,onClick:Ve(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:Ve(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:Ve(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||X4.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});M1.displayName=D1;var IG=D.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=t7(D1,n),a=PG(n),l=D.useRef(null),c=un(t,l),[u,d]=D.useState(!1),[f,h]=D.useState("");return D.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[s.children]),p.jsx(mh.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:p.jsx(hFe,{asChild:!0,...a,focusable:!r,children:p.jsx(Dt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:Ve(e.onPointerMove,yh(g=>{r?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ve(e.onPointerLeave,yh(g=>i.onItemLeave(g))),onFocus:Ve(e.onFocus,()=>d(!0)),onBlur:Ve(e.onBlur,()=>d(!1))})})})}),OFe="MenuCheckboxItem",LG=D.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(BG,{scope:e.__scopeMenu,checked:n,children:p.jsx(M1,{role:"menuitemcheckbox","aria-checked":O1(n)?"mixed":n,...o,ref:t,"data-state":s7(n),onSelect:Ve(o.onSelect,()=>r?.(O1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});LG.displayName=OFe;var $G="MenuRadioGroup",[AFe,jFe]=bl($G,{value:void 0,onValueChange:()=>{}}),FG=D.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=hi(r);return p.jsx(AFe,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(r7,{...o,ref:t})})});FG.displayName=$G;var NG="MenuRadioItem",RG=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=jFe(NG,e.__scopeMenu),s=n===o.value;return p.jsx(BG,{scope:e.__scopeMenu,checked:s,children:p.jsx(M1,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":s7(s),onSelect:Ve(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});RG.displayName=NG;var o7="MenuItemIndicator",[BG,IFe]=bl(o7,{checked:!1}),VG=D.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=IFe(o7,n);return p.jsx(Is,{present:r||O1(s.checked)||s.checked===!0,children:p.jsx(Dt.span,{...o,ref:t,"data-state":s7(s.checked)})})});VG.displayName=o7;var LFe="MenuSeparator",zG=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Dt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});zG.displayName=LFe;var $Fe="MenuArrow",HG=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=T1(n);return p.jsx(nFe,{...o,...r,ref:t})});HG.displayName=$Fe;var FFe="MenuSub",[Hze,WG]=bl(FFe),vh="MenuSubTrigger",UG=D.forwardRef((e,t)=>{const n=xl(vh,e.__scopeMenu),r=gh(vh,e.__scopeMenu),o=WG(vh,e.__scopeMenu),s=t7(vh,e.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>u,[u]),D.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),p.jsx(J4,{asChild:!0,...c,children:p.jsx(IG,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":GG(n.open),...e,ref:f1(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ve(e.onPointerMove,yh(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Ve(e.onPointerLeave,yh(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const h=n.content?.dataset.side,g=h==="right",v=g?-5:5,y=f[g?"left":"right"],b=f[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:y,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:y,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ve(e.onKeyDown,d=>{const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||vFe[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});UG.displayName=vh;var qG="MenuSubContent",YG=D.forwardRef((e,t)=>{const n=DG(vo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xl(vo,e.__scopeMenu),i=gh(vo,e.__scopeMenu),a=WG(qG,e.__scopeMenu),l=D.useRef(null),c=un(t,l);return p.jsx(mh.Provider,{scope:e.__scopeMenu,children:p.jsx(Is,{present:r||s.open,children:p.jsx(mh.Slot,{scope:e.__scopeMenu,children:p.jsx(n7,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ve(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ve(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:Ve(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=yFe[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});YG.displayName=qG;function GG(e){return e?"open":"closed"}function O1(e){return e==="indeterminate"}function s7(e){return O1(e)?"indeterminate":e?"checked":"unchecked"}function NFe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function RFe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function BFe(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=RFe(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function VFe(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(o=!o)}return o}function zFe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return VFe(n,t)}function yh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var HFe=TG,WFe=J4,UFe=MG,qFe=OG,YFe=r7,GFe=AG,KFe=M1,QFe=LG,ZFe=FG,XFe=RG,JFe=VG,eNe=zG,tNe=HG,nNe=UG,rNe=YG,A1="DropdownMenu",[oNe,Wze]=fi(A1,[EG]),lr=EG(),[sNe,KG]=oNe(A1),QG=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=lr(t),c=D.useRef(null),[u,d]=gl({prop:o,defaultProp:s??!1,onChange:i,caller:A1});return p.jsx(sNe,{scope:t,triggerId:ia(),triggerRef:c,contentId:ia(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:a,children:p.jsx(HFe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};QG.displayName=A1;var ZG="DropdownMenuTrigger",XG=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=KG(ZG,n),i=lr(n);return p.jsx(WFe,{asChild:!0,...i,children:p.jsx(Dt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:f1(t,s.triggerRef),onPointerDown:Ve(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Ve(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});XG.displayName=ZG;var iNe="DropdownMenuPortal",JG=e=>{const{__scopeDropdownMenu:t,...n}=e,r=lr(t);return p.jsx(UFe,{...r,...n})};JG.displayName=iNe;var eK="DropdownMenuContent",tK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=KG(eK,n),s=lr(n),i=D.useRef(!1);return p.jsx(qFe,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:Ve(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:Ve(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tK.displayName=eK;var aNe="DropdownMenuGroup",lNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(YFe,{...o,...r,ref:t})});lNe.displayName=aNe;var cNe="DropdownMenuLabel",nK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(GFe,{...o,...r,ref:t})});nK.displayName=cNe;var uNe="DropdownMenuItem",rK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(KFe,{...o,...r,ref:t})});rK.displayName=uNe;var dNe="DropdownMenuCheckboxItem",oK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(QFe,{...o,...r,ref:t})});oK.displayName=dNe;var fNe="DropdownMenuRadioGroup",pNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(ZFe,{...o,...r,ref:t})});pNe.displayName=fNe;var hNe="DropdownMenuRadioItem",sK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(XFe,{...o,...r,ref:t})});sK.displayName=hNe;var mNe="DropdownMenuItemIndicator",iK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(JFe,{...o,...r,ref:t})});iK.displayName=mNe;var gNe="DropdownMenuSeparator",aK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(eNe,{...o,...r,ref:t})});aK.displayName=gNe;var vNe="DropdownMenuArrow",yNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(tNe,{...o,...r,ref:t})});yNe.displayName=vNe;var bNe="DropdownMenuSubTrigger",lK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(nNe,{...o,...r,ref:t})});lK.displayName=bNe;var xNe="DropdownMenuSubContent",cK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lr(n);return p.jsx(rNe,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cK.displayName=xNe;var wNe=QG,CNe=XG,kNe=JG,uK=tK,dK=nK,fK=rK,pK=oK,hK=sK,mK=iK,gK=aK,vK=lK,yK=cK;const SNe=wNe,_Ne=CNe,ENe=D.forwardRef(({className:e,inset:t,children:n,...r},o)=>p.jsxs(vK,{ref:o,className:Ge("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,p.jsx(M$e,{className:"ml-auto"})]}));ENe.displayName=vK.displayName;const PNe=D.forwardRef(({className:e,...t},n)=>p.jsx(yK,{ref:n,className:Ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));PNe.displayName=yK.displayName;const bK=D.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(kNe,{children:p.jsx(uK,{ref:r,sideOffset:t,className:Ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));bK.displayName=uK.displayName;const xK=D.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(fK,{ref:r,className:Ge("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));xK.displayName=fK.displayName;const TNe=D.forwardRef(({className:e,children:t,checked:n,...r},o)=>p.jsxs(pK,{ref:o,className:Ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(mK,{children:p.jsx(JY,{className:"h-4 w-4"})})}),t]}));TNe.displayName=pK.displayName;const DNe=D.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(hK,{ref:r,className:Ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(mK,{children:p.jsx(O$e,{className:"h-2 w-2 fill-current"})})}),t]}));DNe.displayName=hK.displayName;const MNe=D.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(dK,{ref:r,className:Ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));MNe.displayName=dK.displayName;const ONe=D.forwardRef(({className:e,...t},n)=>p.jsx(gK,{ref:n,className:Ge("-mx-1 my-1 h-px bg-muted",e),...t}));ONe.displayName=gK.displayName;const i7=[{value:"default",label:"Default",description:"No Sorting"},{value:"price",label:"Price",description:"High to Low",sortOrder:-1},{value:"price",label:"Price",description:"Low to High",sortOrder:1},{value:"name",label:"Name",description:"A to Z",sortOrder:1},{value:"name",label:"Name",description:"Z to A",sortOrder:-1}];function ANe(){const{setStagedProductQuery:e,applyStagedFilters:t}=Vn(r=>({setStagedProductQuery:r.setStagedProductQuery,applyStagedFilters:r.applyStagedFilters}));function n(r,o){r==="default"?(e("sortBy",""),e("order",void 0)):(e("sortBy",r),e("order",o)),t()}return n}function wK({option:e}){const{stagedSortOption:t,stagedSortOrder:n}=Vn(c=>({stagedSortOption:c.stagedProductQuery.sortBy,stagedSortOrder:c.stagedProductQuery.order})),r=ANe(),{isDarkTheme:o}=Je(),i=e.value===t&&e.sortOrder===n||e.value==="default"&&t===""?o?"#222":"#F2F2F2":void 0,a=o?"neutral-gray-900":"neutral-gray-100",l=o?"text-subtextPlaceholder-Dark":"text-subtextPlaceholder-Light";return p.jsxs("button",{onClick:()=>r(e.value,e.sortOrder),className:`flex items-center justify-between w-full px-4 py-[10px] rounded-md cursor-pointer hover:bg-${a}`,style:i?{backgroundColor:i}:void 0,children:[p.jsx(ct,{as:"span",className:"text-sm font-normal",children:e.label}),p.jsx(ct,{as:"span",className:`text-xs font-normal text-${l}`,children:e.description})]})}function jNe(){const{isDarkTheme:e}=Je(),{stagedSortOption:t,stagedSortOrder:n}=Vn(o=>({stagedSortOption:o.stagedProductQuery.sortBy,stagedSortOrder:o.stagedProductQuery.order})),r=()=>{const o=i7.find(i=>i.value===t&&i.sortOrder===n);if(!o||o.value==="default")return"Sort Products";const s=`${o.label} (${o.description})`;return s.length>20?`${s.slice(0,20)}...`:s};return p.jsxs(SNe,{children:[p.jsxs(_Ne,{className:"flex w-[250px] select-none items-center justify-between rounded-lg border border-shop-borderColor bg-transparent px-4 py-3",children:[p.jsx(ct,{as:"span",className:`text-sm font-normal ${e?"text-[#7B7B7B]":"text-[#B1B1B1]"}`,children:r()}),p.jsx(At.GrayChevronDown,{})]}),p.jsx(bK,{className:`my-2 flex w-[250px] flex-col gap-2 rounded-lg border-none p-3 ${e?"bg-black":"bg-white"} `,children:i7.map((o,s)=>p.jsx(xK,{className:"p-0",children:p.jsx(wK,{option:o})},s))})]})}function INe({showSearchBar:e,showSort:t,showFilters:n}){return p.jsxs("div",{className:"hidden md:flex justify-between",children:[p.jsxs("div",{className:"flex gap-4",children:[n&&p.jsx(iG,{}),e&&p.jsx(aG,{})]}),t&&p.jsx(jNe,{})]})}function CK({onClick:e,children:t}){const{shopDesign:{textColorParagraphs:n}}=Je();return p.jsx("button",{onClick:e,className:`flex items-center justify-center w-10 h-10 border rounded-lg border-[${n}]`,children:t})}function LNe({onClick:e}){const{isDarkTheme:t}=Je(),n=t?"[&>path]:stroke-white":"";return p.jsx(CK,{onClick:e,children:p.jsx(At.Search,{className:n})})}function $Ne(){const{isDarkTheme:e}=Je();return p.jsxs(cY,{children:[p.jsx(uY,{className:"flex items-center justify-center w-10 h-10 border rounded-lg lg:hidden border-shop-textColor",children:p.jsx(At.Sort,{className:`shrink-0 ${e?"[&_path]:stroke-white":""}`})}),p.jsxs(w4,{side:"bottom",className:`p-0 max-h-full border-b rounded-t-[16px] bg-${e?"black":"white"} border-shop-textColor`,closeButtonClassName:`top-4 right-4 md:top-6 md:right-9 ${e?"[&>svg>path]:stroke-white":""}`,children:[p.jsx(C4,{className:"flex items-start p-4 text-left md:px-9 md:py-6 border-b border-shop-textColor",children:p.jsx(ct,{className:"text-sm font-bold",children:"Sort"})}),p.jsx("div",{className:"flex flex-col gap-2 p-4 pb-9",children:i7.map((t,n)=>p.jsx(x4,{children:p.jsx(wK,{option:t})},n))})]})]})}function FNe({showSearchBar:e,showSort:t,showFilters:n}){const[r,o]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{const i=a=>{s.current&&!s.current.contains(a.target)&&o(!1)};return r?document.addEventListener("mousedown",i):document.removeEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[r]),p.jsx(p.Fragment,{children:r?p.jsx("div",{className:"md:hidden",ref:s,children:p.jsx(aG,{})}):p.jsxs("div",{className:"flex justify-between md:hidden",children:[p.jsxs("div",{className:"flex gap-2",children:[n&&p.jsx(iG,{}),e&&p.jsx(LNe,{onClick:()=>o(!0)})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(NNe,{}),t&&p.jsx($Ne,{})]})]})})}function NNe(){const{isDarkTheme:e}=Je(),{viewMode:t,setViewMode:n}=Vn(s=>({viewMode:s.viewMode,setViewMode:s.setViewMode})),r=t==="grid",o=e?"[&_path]:stroke-white":"";return p.jsx(CK,{onClick:()=>n(r?"list":"grid"),children:r?p.jsx(At.ListView,{className:o}):p.jsx(At.GridView,{className:o})})}function RNe({showSearchBar:e,showSort:t,showFilters:n}){return p.jsxs(p.Fragment,{children:[p.jsx(INe,{showSearchBar:e,showSort:t,showFilters:n}),p.jsx(FNe,{showSearchBar:e,showSort:t,showFilters:n})]})}const kK=({price:e,slug:t,className:n})=>{const{isDarkTheme:r}=Je(),{navigate:o}=Uu(),{states:{shop:{currency:s,tokenBasedPricing:i}}}=Dr(),a="text-base md:text-[18px] cursor-pointer",l=r?"#7B7B7B":"#B1B1B1",c=()=>o(`product/${t}`);return i?.hasTokenBasedPricing?p.jsxs("div",{className:Ge("flex",a,n),onClick:c,children:[p.jsx(ct,{className:"font-medium mr-1",children:(e*i.unit).toFixed(2)}),p.jsx(ct,{className:`text-[${l}]`,children:i.token})]}):p.jsxs(ct,{className:Ge("font-medium",a,n),onClick:c,children:[Sq(+e,s),p.jsx("span",{className:Ge(`text-[${l}]`,"font-normal"),children:s?.abbreviation})]})};function SK({title:e,slug:t,className:n}){const{navigate:r}=Uu();return p.jsx(ct,{as:"h3",onClick:()=>r(`product/${t}`),className:Ge("h-10 md:h-12 text-sm md:text-base font-normal line-clamp-2 cursor-pointer",n),children:e})}var j1={},_K;function BNe(){if(_K)return j1;_K=1,Object.defineProperty(j1,"__esModule",{value:!0});var e=m;function t(C){return Array.prototype.slice.call(C)}function n(C,E){var S=Math.floor(C);return S===E||S+1===E?C:E}function r(){return Date.now()}function o(C,E,S){if(E="data-keen-slider-"+E,S===null)return C.removeAttribute(E);C.setAttribute(E,S||"")}function s(C,E){return E=E||document,typeof C=="function"&&(C=C(E)),Array.isArray(C)?C:typeof C=="string"?t(E.querySelectorAll(C)):C instanceof HTMLElement?[C]:C instanceof NodeList?t(C):[]}function i(C){C.raw&&(C=C.raw),C.cancelable&&!C.defaultPrevented&&C.preventDefault()}function a(C){C.raw&&(C=C.raw),C.stopPropagation&&C.stopPropagation()}function l(){var C=[];return{add:function(E,S,M,O){E.addListener?E.addListener(M):E.addEventListener(S,M,O),C.push([E,S,M,O])},input:function(E,S,M,O){this.add(E,S,function(R){return function(L){L.nativeEvent&&(L=L.nativeEvent);var W=L.changedTouches||[],$=L.targetTouches||[],F=L.detail&&L.detail.x?L.detail:null;return R({id:F?F.identifier?F.identifier:"i":$[0]?$[0]?$[0].identifier:"e":"d",idChanged:F?F.identifier?F.identifier:"i":W[0]?W[0]?W[0].identifier:"e":"d",raw:L,x:F&&F.x?F.x:$[0]?$[0].screenX:F?F.x:L.pageX,y:F&&F.y?F.y:$[0]?$[0].screenY:F?F.y:L.pageY})}}(M),O)},purge:function(){C.forEach(function(E){E[0].removeListener?E[0].removeListener(E[2]):E[0].removeEventListener(E[1],E[2],E[3])}),C=[]}}}function c(C,E,S){return Math.min(Math.max(C,E),S)}function u(C){return(C>0?1:0)-(C<0?1:0)||+C}function d(C){var E=C.getBoundingClientRect();return{height:n(E.height,C.offsetHeight),width:n(E.width,C.offsetWidth)}}function f(C,E,S,M){var O=C&&C[E];return O==null?S:M&&typeof O=="function"?O():O}function h(C){return Math.round(1e6*C)/1e6}function g(C,E){if(C===E)return!0;var S=typeof C;if(S!==typeof E)return!1;if(S!=="object"||C===null||E===null)return S==="function"&&C.toString()===E.toString();if(C.length!==E.length||Object.getOwnPropertyNames(C).length!==Object.getOwnPropertyNames(E).length)return!1;for(var M in C)if(!g(C[M],E[M]))return!1;return!0}var v=function(){return v=Object.assign||function(C){for(var E,S=1,M=arguments.length;S<M;S++)for(var O in E=arguments[S])Object.prototype.hasOwnProperty.call(E,O)&&(C[O]=E[O]);return C},v.apply(this,arguments)};function y(C,E,S){for(var M,O=0,R=E.length;O<R;O++)!M&&O in E||(M||(M=Array.prototype.slice.call(E,0,O)),M[O]=E[O]);return C.concat(M||Array.prototype.slice.call(E))}function b(C){var E,S,M,O,R,L;function W(j){L||(L=j),$(!0);var z=j-L;z>M&&(z=M);var J=O[S];if(J[3]<z)return S++,W(j);var q=J[2],ee=J[4],Q=J[0],oe=J[1]*(0,J[5])(ee===0?1:(z-q)/ee);if(oe&&C.track.to(Q+oe),z<M)return U();L=null,$(!1),F(null),C.emit("animationEnded")}function $(j){E.active=j}function F(j){E.targetIdx=j}function U(){var j;j=W,R=window.requestAnimationFrame(j)}function K(){var j;j=R,window.cancelAnimationFrame(j),$(!1),F(null),L&&C.emit("animationStopped"),L=null}return E={active:!1,start:function(j){if(K(),C.track.details){var z=0,J=C.track.details.position;S=0,M=0,O=j.map(function(q){var ee,Q=Number(J),oe=(ee=q.earlyExit)!==null&&ee!==void 0?ee:q.duration,re=q.easing,Y=q.distance*re(oe/q.duration)||0;J+=Y;var A=M;return M+=oe,z+=Y,[Q,q.distance,A,M,q.duration,re]}),F(C.track.distToIdx(z)),U(),C.emit("animationStarted")}},stop:K,targetIdx:null}}function x(C){var E,S,M,O,R,L,W,$,F,U,K,j,z,J,q=1/0,ee=[],Q=null,oe=0;function re(fe){Se(oe+fe)}function Y(fe){var ce=A(oe+fe).abs;return H(ce)?ce:null}function A(fe){var ce=Math.floor(Math.abs(h(fe/S))),le=h((fe%S+S)%S);le===S&&(le=0);var me=u(fe),ue=W.indexOf(y([],W).reduce(function(De,Be){return Math.abs(Be-le)<Math.abs(De-le)?Be:De})),ge=ue;return me<0&&ce++,ue===L&&(ge=0,ce+=me>0?1:-1),{abs:ge+ce*L*me,origin:ue,rel:ge}}function I(fe,ce,le){var me;if(ce||!se())return B(fe,le);if(!H(fe))return null;var ue=A(le??oe),ge=ue.abs,De=fe-ue.rel,Be=ge+De;me=B(Be);var Ze=B(Be-L*u(De));return(Ze!==null&&Math.abs(Ze)<Math.abs(me)||me===null)&&(me=Ze),h(me)}function B(fe,ce){if(ce==null&&(ce=h(oe)),!H(fe)||fe===null)return null;fe=Math.round(fe);var le=A(ce),me=le.abs,ue=le.rel,ge=le.origin,De=de(fe),Be=(ce%S+S)%S,Ze=W[ge],he=Math.floor((fe-(me-ue))/L)*S;return h(Ze-Be-Ze+W[De]+he+(ge===L?S:0))}function H(fe){return te(fe)===fe}function te(fe){return c(fe,F,U)}function se(){return O.loop}function de(fe){return(fe%L+L)%L}function Se(fe){var ce;ce=fe-oe,ee.push({distance:ce,timestamp:r()}),ee.length>6&&(ee=ee.slice(-6)),oe=h(fe);var le=ne().abs;if(le!==Q){var me=Q!==null;Q=le,me&&C.emit("slideChanged")}}function ne(fe){var ce=fe?null:function(){if(L){var le=se(),me=le?(oe%S+S)%S:oe,ue=(le?oe%S:oe)-R[0][2],ge=0-(ue<0&&le?S-Math.abs(ue):ue),De=0,Be=A(oe),Ze=Be.abs,he=Be.rel,ve=R[he][2],Ce=R.map(function(Te,Xe){var je=ge+De;(je<0-Te[0]||je>1)&&(je+=(Math.abs(je)>S-1&&le?S:0)*u(-je));var et=Xe-he,ut=u(et),kt=et+Ze;le&&(ut===-1&&je>ve&&(kt+=L),ut===1&&je<ve&&(kt-=L),K!==null&&kt<K&&(je+=S),j!==null&&kt>j&&(je-=S));var Vt=je+Te[0]+Te[1],kn=Math.max(je>=0&&Vt<=1?1:Vt<0||je>1?0:je<0?Math.min(1,(Te[0]+je)/Te[0]):(1-je)/Te[0],0);return De+=Te[0]+Te[1],{abs:kt,distance:O.rtl?-1*je+1-Te[0]:je,portion:kn,size:Te[0]}});return Ze=te(Ze),he=de(Ze),{abs:te(Ze),length:M,max:J,maxIdx:U,min:z,minIdx:F,position:oe,progress:le?me/S:oe/M,rel:he,slides:Ce,slidesLength:S}}}();return E.details=ce,C.emit("detailsChanged"),ce}return E={absToRel:de,add:re,details:null,distToIdx:Y,idxToDist:I,init:function(fe){if(function(){if(O=C.options,R=(O.trackConfig||[]).map(function(ue){return[f(ue,"size",1),f(ue,"spacing",0),f(ue,"origin",0)]}),L=R.length){S=h(R.reduce(function(ue,ge){return ue+ge[0]+ge[1]},0));var le,me=L-1;M=h(S+R[0][2]-R[me][0]-R[me][2]-R[me][1]),W=R.reduce(function(ue,ge){if(!ue)return[0];var De=R[ue.length-1],Be=ue[ue.length-1]+(De[0]+De[2])+De[1];return Be-=ge[2],ue[ue.length-1]>Be&&(Be=ue[ue.length-1]),Be=h(Be),ue.push(Be),(!le||le<Be)&&($=ue.length-1),le=Be,ue},null),M===0&&($=0),W.push(h(S))}}(),!L)return ne(!0);var ce;(function(){var le=C.options.range,me=C.options.loop;K=F=me?f(me,"min",-1/0):0,j=U=me?f(me,"max",q):$;var ue=f(le,"min",null),ge=f(le,"max",null);ue!==null&&(F=ue),ge!==null&&(U=ge),z=F===-1/0?F:C.track.idxToDist(F||0,!0,0),J=U===q?U:I(U,!0,0),ge===null&&(j=U),f(le,"align",!1)&&U!==q&&R[de(U)][2]===0&&(J-=1-R[de(U)][0],U=Y(J-oe)),z=h(z),J=h(J)})(),ce=fe,Number(ce)===ce?re(B(te(fe))):ne()},to:Se,velocity:function(){var fe=r(),ce=ee.reduce(function(le,me){var ue=me.distance,ge=me.timestamp;return fe-ge>200||(u(ue)!==u(le.distance)&&le.distance&&(le={distance:0,lastTimestamp:0,time:0}),le.time&&(le.distance+=ue),le.lastTimestamp&&(le.time+=ge-le.lastTimestamp),le.lastTimestamp=ge),le},{distance:0,lastTimestamp:0,time:0});return ce.distance/ce.time||0}}}function w(C){var E,S,M,O,R,L,W,$;function F(Q){return 2*Q}function U(Q){return c(Q,W,$)}function K(Q){return 1-Math.pow(1-Q,3)}function j(){return M?C.track.velocity():0}function z(){ee();var Q=C.options.mode==="free-snap",oe=C.track,re=j();O=u(re);var Y=C.track.details,A=[];if(re||!Q){var I=J(re),B=I.dist,H=I.dur;if(H=F(H),B*=O,Q){var te=oe.idxToDist(oe.distToIdx(B),!0);te&&(B=te)}A.push({distance:B,duration:H,easing:K});var se=Y.position,de=se+B;if(de<R||de>L){var Se=de<R?R-se:L-se,ne=0,fe=re;if(u(Se)===O){var ce=Math.min(Math.abs(Se)/Math.abs(B),1),le=function(ge){return 1-Math.pow(1-ge,1/3)}(ce)*H;A[0].earlyExit=le,fe=re*(1-ce)}else A[0].earlyExit=0,ne+=Se;var me=J(fe,100),ue=me.dist*O;C.options.rubberband&&(A.push({distance:ue,duration:F(me.dur),easing:K}),A.push({distance:-ue+ne,duration:500,easing:K}))}C.animator.start(A)}else C.moveToIdx(U(Y.abs),!0,{duration:500,easing:function(ge){return 1+--ge*ge*ge*ge*ge}})}function J(Q,oe){oe===void 0&&(oe=1e3);var re=147e-9+(Q=Math.abs(Q))/oe;return{dist:Math.pow(Q,2)/re,dur:Q/re}}function q(){var Q=C.track.details;Q&&(R=Q.min,L=Q.max,W=Q.minIdx,$=Q.maxIdx)}function ee(){C.animator.stop()}C.on("updated",q),C.on("optionsChanged",q),C.on("created",q),C.on("dragStarted",function(){M=!1,ee(),E=S=C.track.details.abs}),C.on("dragChecked",function(){M=!0}),C.on("dragEnded",function(){var Q=C.options.mode;Q==="snap"&&function(){var oe=C.track,re=C.track.details,Y=re.position,A=u(j());(Y>L||Y<R)&&(A=0);var I=E+A;re.slides[oe.absToRel(I)].portion===0&&(I-=A),E!==S&&(I=S),u(oe.idxToDist(I,!0))!==A&&(I+=A),I=U(I);var B=oe.idxToDist(I,!0);C.animator.start([{distance:B,duration:500,easing:function(H){return 1+--H*H*H*H*H}}])}(),Q!=="free"&&Q!=="free-snap"||z()}),C.on("dragged",function(){S=C.track.details.abs})}function k(C){var E,S,M,O,R,L,W,$,F,U,K,j,z,J,q,ee,Q,oe,re=l();function Y(ne){if(L&&$===ne.id){var fe=H(ne);if(F){if(!B(ne))return I(ne);U=fe,F=!1,C.emit("dragChecked")}if(ee)return U=fe;i(ne);var ce=function(me){if(Q===-1/0&&oe===1/0)return me;var ue=C.track.details,ge=ue.length,De=ue.position,Be=c(me,Q-De,oe-De);if(ge===0)return 0;if(!C.options.rubberband)return Be;if(De<=oe&&De>=Q||De<Q&&S>0||De>oe&&S<0)return me;var Ze=(De<Q?De-Q:De-oe)/ge,he=O*ge,ve=Math.abs(Ze*he),Ce=Math.max(0,1-ve/R*2);return Ce*Ce*me}(W(U-fe)/O*M);S=u(ce);var le=C.track.details.position;(le>Q&&le<oe||le===Q&&S>0||le===oe&&S<0)&&a(ne),K+=ce,!j&&Math.abs(K*O)>5&&(j=!0),C.track.add(ce),U=fe,C.emit("dragged")}}function A(ne){!L&&C.track.details&&C.track.details.length&&(K=0,L=!0,j=!1,F=!0,$=ne.id,B(ne),U=H(ne),C.emit("dragStarted"))}function I(ne){L&&$===ne.idChanged&&(L=!1,C.emit("dragEnded"))}function B(ne){var fe=te(),ce=fe?ne.y:ne.x,le=fe?ne.x:ne.y,me=z!==void 0&&J!==void 0&&Math.abs(J-le)<=Math.abs(z-ce);return z=ce,J=le,me}function H(ne){return te()?ne.y:ne.x}function te(){return C.options.vertical}function se(){O=C.size,R=te()?window.innerHeight:window.innerWidth;var ne=C.track.details;ne&&(Q=ne.min,oe=ne.max)}function de(ne){j&&(a(ne),i(ne))}function Se(){if(re.purge(),C.options.drag&&!C.options.disabled){var ne;ne=C.options.dragSpeed||1,W=typeof ne=="function"?ne:function(ce){return ce*ne},M=C.options.rtl?-1:1,se(),E=C.container,function(){var ce="data-keen-slider-clickable";s("[".concat(ce,"]:not([").concat(ce,"=false])"),E).map(function(le){re.add(le,"dragstart",a),re.add(le,"mousedown",a),re.add(le,"touchstart",a)})}(),re.add(E,"dragstart",function(ce){i(ce)}),re.add(E,"click",de,{capture:!0}),re.input(E,"ksDragStart",A),re.input(E,"ksDrag",Y),re.input(E,"ksDragEnd",I),re.input(E,"mousedown",A),re.input(E,"mousemove",Y),re.input(E,"mouseleave",I),re.input(E,"mouseup",I),re.input(E,"touchstart",A,{passive:!0}),re.input(E,"touchmove",Y,{passive:!1}),re.input(E,"touchend",I),re.input(E,"touchcancel",I),re.add(window,"wheel",function(ce){L&&i(ce)});var fe="data-keen-slider-scrollable";s("[".concat(fe,"]:not([").concat(fe,"=false])"),C.container).map(function(ce){return function(le){var me;re.input(le,"touchstart",function(ue){me=H(ue),ee=!0,q=!0},{passive:!0}),re.input(le,"touchmove",function(ue){var ge=te(),De=ge?le.scrollHeight-le.clientHeight:le.scrollWidth-le.clientWidth,Be=me-H(ue),Ze=ge?le.scrollTop:le.scrollLeft,he=ge&&le.style.overflowY==="scroll"||!ge&&le.style.overflowX==="scroll";if(me=H(ue),(Be<0&&Ze>0||Be>0&&Ze<De)&&q&&he)return ee=!0;q=!1,i(ue),ee=!1}),re.input(le,"touchend",function(){ee=!1})}(ce)})}}C.on("updated",se),C.on("optionsChanged",Se),C.on("created",Se),C.on("destroyed",re.purge)}function _(C){var E,S,M=null;function O(z,J,q){C.animator.active?L(z,J,q):requestAnimationFrame(function(){return L(z,J,q)})}function R(){O(!1,!1,S)}function L(z,J,q){var ee=0,Q=C.size,oe=C.track.details;if(oe&&E){var re=oe.slides;E.forEach(function(Y,A){if(z)!M&&J&&$(Y,null,q),F(Y,null,q);else{if(!re[A])return;var I=re[A].size*Q;!M&&J&&$(Y,I,q),F(Y,re[A].distance*Q-ee,q),ee+=I}})}}function W(z){return C.options.renderMode==="performance"?Math.round(z):z}function $(z,J,q){var ee=q?"height":"width";J!==null&&(J=W(J)+"px"),z.style["min-"+ee]=J,z.style["max-"+ee]=J}function F(z,J,q){if(J!==null){J=W(J);var ee=q?J:0;J="translate3d(".concat(q?0:J,"px, ").concat(ee,"px, 0)")}z.style.transform=J,z.style["-webkit-transform"]=J}function U(){E&&(L(!0,!0,S),E=null),C.on("detailsChanged",R,!0)}function K(){O(!1,!0,S)}function j(){U(),S=C.options.vertical,C.options.disabled||C.options.renderMode==="custom"||(M=f(C.options.slides,"perView",null)==="auto",C.on("detailsChanged",R),(E=C.slides).length&&K())}C.on("created",j),C.on("optionsChanged",j),C.on("beforeOptionsChanged",function(){U()}),C.on("updated",K),C.on("destroyed",U)}function P(C,E){return function(S){var M,O,R,L,W,$=l();function F(B){var H;o(S.container,"reverse",(H=S.container,window.getComputedStyle(H,null).getPropertyValue("direction")!=="rtl"||B?null:"")),o(S.container,"v",S.options.vertical&&!B?"":null),o(S.container,"disabled",S.options.disabled&&!B?"":null)}function U(){K()&&ee()}function K(){var B=null;if(L.forEach(function(te){te.matches&&(B=te.__media)}),B===M)return!1;M||S.emit("beforeOptionsChanged"),M=B;var H=B?R.breakpoints[B]:R;return S.options=v(v({},R),H),F(),A(),I(),oe(),!0}function j(B){var H=d(B);return(S.options.vertical?H.height:H.width)/S.size||1}function z(){return S.options.trackConfig.length}function J(B){for(var H in M=!1,R=v(v({},E),B),$.purge(),O=S.size,L=[],R.breakpoints||[]){var te=window.matchMedia(H);te.__media=H,L.push(te),$.add(te,"change",U)}$.add(window,"orientationchange",Y),$.add(window,"resize",re),K()}function q(B){S.animator.stop();var H=S.track.details;S.track.init(B??(H?H.abs:0))}function ee(B){q(B),S.emit("optionsChanged")}function Q(B,H){if(B)return J(B),void ee(H);A(),I();var te=z();oe(),z()!==te?ee(H):q(H),S.emit("updated")}function oe(){var B=S.options.slides;if(typeof B=="function")return S.options.trackConfig=B(S.size,S.slides);for(var H=S.slides,te=H.length,se=typeof B=="number"?B:f(B,"number",te,!0),de=[],Se=f(B,"perView",1,!0),ne=f(B,"spacing",0,!0)/S.size||0,fe=Se==="auto"?ne:ne/Se,ce=f(B,"origin","auto"),le=0,me=0;me<se;me++){var ue=Se==="auto"?j(H[me]):1/Se-ne+fe,ge=ce==="center"?.5-ue/2:ce==="auto"?0:ce;de.push({origin:ge,size:ue,spacing:ne}),le+=ue}if(le+=ne*(se-1),ce==="auto"&&!S.options.loop&&Se!==1){var De=0;de.map(function(Be){var Ze=le-De;return De+=Be.size+ne,Ze>=1||(Be.origin=1-Ze-(le>1?0:1-le)),Be})}S.options.trackConfig=de}function re(){A();var B=S.size;S.options.disabled||B===O||(O=B,Q())}function Y(){re(),setTimeout(re,500),setTimeout(re,2e3)}function A(){var B=d(S.container);S.size=(S.options.vertical?B.height:B.width)||1}function I(){S.slides=s(S.options.selector,S.container)}S.container=(W=s(C,document)).length?W[0]:null,S.destroy=function(){$.purge(),S.emit("destroyed"),F(!0)},S.prev=function(){S.moveToIdx(S.track.details.abs-1,!0)},S.next=function(){S.moveToIdx(S.track.details.abs+1,!0)},S.update=Q,J(S.options)}}var T=function(C,E,S){try{return function(M,O){var R,L={};return R={emit:function(W){L[W]&&L[W].forEach(function(F){F(R)});var $=R.options&&R.options[W];$&&$(R)},moveToIdx:function(W,$,F){var U=R.track.idxToDist(W,$);if(U){var K=R.options.defaultAnimation;R.animator.start([{distance:U,duration:f(F||K,"duration",500),easing:f(F||K,"easing",function(j){return 1+--j*j*j*j*j})}])}},on:function(W,$,F){F===void 0&&(F=!1),L[W]||(L[W]=[]);var U=L[W].indexOf($);U>-1?F&&delete L[W][U]:F||L[W].push($)},options:M},function(){if(R.track=x(R),R.animator=b(R),O)for(var W=0,$=O;W<$.length;W++)(0,$[W])(R);R.track.init(R.options.initial||0),R.emit("created")}(),R}(E,y([P(C,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),_,k,w],S||[],!0))}catch(M){console.error(M)}};return j1.useKeenSlider=function(C,E){var S=e.useRef(null),M=e.useRef(!1),O=e.useRef(C),R=e.useCallback(function(L){L?(O.current=C,S.current=new T(L,C,E),M.current=!1):(S.current&&S.current.destroy&&S.current.destroy(),S.current=null)},[]);return e.useEffect(function(){g(O.current,C)||(O.current=C,S.current&&S.current.update(O.current))},[C]),[R,S]},j1}var VNe=BNe();function a7({className:e,onClick:t,children:n}){return p.jsx("div",{className:Ge("p-[6px] border-[0.5px] border-[#DEDEDE] rounded bg-[rgba(255,255,255,0.75)] shadow-[0px_2px_8px_0px_rgba(0,0,0,0.06)] backdrop-blur-[4px]",e),onClick:t,children:n})}function EK({direction:e,isVisible:t,onArrowClick:n}){const r=a=>{a.preventDefault(),n()},o=e==="left"?"left-[-40px]":"right-[-40px]",s=e==="left"?"left-[8px]":"right-[8px]",i=e==="left"?"rotate-90":"-rotate-90";return p.jsx(a7,{className:`absolute top-1/2 ${o} transform -translate-y-1/2 ${i} rounded-full cursor-pointer transition-all duration-500 ease-in-out ${t?s:""} [&_svg]:w-4 [&_svg]:h-4`,onClick:r,children:p.jsx(At.BlackChevronDown,{})})}function zNe({imagesLength:e,isVisible:t,currentIndex:n,onDotClick:r}){return p.jsx("div",{className:`absolute left-1/2 transform -translate-x-1/2 transition-all duration-500 ease-in-out ${t?"bottom-2":"bottom-[-40px]"}`,style:{width:"fit-content"},onClick:o=>o.preventDefault(),children:p.jsx("ul",{className:"flex gap-1 rounded-[20px] bg-[rgba(255,255,255,0.75)] p-1",children:Array.from({length:e}).map((o,s)=>p.jsx("li",{className:`shrink-0 h-1 w-1 rounded-full cursor-pointer transition-all duration-300 ease-in-out ${n===s?"w-4 rounded-3xl bg-black":"bg-[#878787]"}`,onClick:()=>r(s)},s))})})}function HNe({product:e,isHovered:t,isEditing:n}){const{images:r,title:o,slug:s}=e,{navigate:i}=Uu(),[a,l]=m.useState(0),c=r.slice(0,3),[u,d]=VNe.useKeenSlider({loop:!0,slides:{perView:1},mode:"snap",slideChanged:v=>l(v.track.details.rel)});m.useEffect(()=>{!t&&d.current&&(l(0),d.current?.moveToIdx?.(0))},[t]);const f=()=>{i(`product/${s}`)},h=v=>()=>{v()},g=v=>y=>{y.stopPropagation(),d.current?.moveToIdx(v)};return n||c.length===1?p.jsxs("div",{className:"relative overflow-hidden rounded-lg aspect-square cursor-pointer",children:[p.jsx("img",{src:c[0]?.thumbnail,alt:c[0]?.alt||o,onClick:f,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"}),p.jsx(PK,{product:e})]}):p.jsxs("div",{className:"relative overflow-hidden rounded-lg cursor-pointer",children:[p.jsx("div",{ref:u,className:"keen-slider content-start flex overflow-hidden relative touch-pan-y select-none w-full h-full",onClick:f,children:c.map((v,y)=>p.jsx("div",{className:"keen-slider__slide w-full h-full aspect-square flex items-center justify-center",children:p.jsx("img",{src:v.thumbnail,alt:v.alt||`${o}-${y}`,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"})},y))}),p.jsx(PK,{product:e}),p.jsx(EK,{direction:"left",isVisible:t,onArrowClick:h(()=>d.current?.prev())}),p.jsx(EK,{direction:"right",isVisible:t,onArrowClick:h(()=>d.current?.next())}),p.jsx(zNe,{imagesLength:c.length,isVisible:t,onDotClick:g,currentIndex:a})]})}function PK({product:e}){const{discountRuleset:t,gatedRuleset:n}=e;return p.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-2",children:[t&&p.jsx(a7,{children:p.jsx(At.Discount,{})}),n&&p.jsx(a7,{children:p.jsx(At.Gated,{})})]})}function WNe({product:e,isEditing:t}){const{title:n,lowestPrice:r,id:o,slug:s}=e,[i,a]=m.useState(!1);return p.jsxs("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),className:"w-full h-full flex flex-col select-none group",children:[p.jsx(HNe,{product:e,isHovered:i,isEditing:t}),p.jsx(SK,{title:n,slug:s,className:"mt-3"}),p.jsx(kK,{price:r,slug:s,className:"mt-2"})]})}function UNe(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((n,r)=>p.jsxs("div",{children:[p.jsx(Yo,{className:`rounded-lg aspect-square ${t}`}),p.jsx(Yo,{className:`h-10 md:h-12 mt-3 ${t}`}),p.jsx(Yo,{className:`h-6 mt-2 ${t}`})]},r))})}function qNe({product:e}){const{images:t,title:n,lowestPrice:r,discountRuleset:o,gatedRuleset:s,slug:i,id:a}=e,{isDarkTheme:l}=Je(),c=l?"[&_path]:stroke-white":"",{navigate:u}=Uu(),d=(t.find(f=>f.original)??t[0])?.thumbnail||t[0]?.original;return p.jsx("div",{className:"cursor-pointer",onClick:()=>u(`product/${i??a}`),children:p.jsx(TK,{image:p.jsx("img",{src:d,alt:n,className:"w-[70px] h-[70px] object-cover rounded-lg shrink-0"}),title:p.jsx(SK,{title:n,slug:i}),price:p.jsx(kK,{price:r,slug:i}),icons:p.jsxs(p.Fragment,{children:[o&&p.jsx(At.Discount,{className:c}),s&&p.jsx(At.Gated,{className:c})]})})})}function YNe(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((n,r)=>p.jsx(TK,{image:p.jsx(Yo,{className:`w-[70px] h-[70px] rounded-lg shrink-0 ${t}`}),title:p.jsx(Yo,{className:`h-10 w-1/2 ${t}`}),price:p.jsx(Yo,{className:`h-6 w-1/4 ${t}`}),icons:p.jsxs(p.Fragment,{children:[p.jsx(Yo,{className:`w-5 h-5 rounded-full ${t}`}),p.jsx(Yo,{className:`w-5 h-5 rounded-full ${t}`})]})},r))})}function TK({image:e,title:t,price:n,icons:r}){return p.jsxs("div",{className:"flex items-start gap-4",children:[e,p.jsxs("div",{className:"flex-1 flex flex-col gap-[6px]",children:[t,p.jsxs("div",{className:"flex justify-between items-center gap-4",children:[n,p.jsx("div",{className:"flex items-center gap-2",children:r})]})]})]})}function DK(e=768){const[t,n]=m.useState(!1);return m.useEffect(()=>{const r=()=>n(window.innerWidth<e);return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t}function l7({children:e}){const t=DK(),n=Vn(o=>o.viewMode),r=t?n==="grid"?"grid grid-cols-2 gap-x-4 gap-y-6":"grid grid-cols-1 gap-y-6":`grid
585
585
  grid-cols-2
586
586
  md:grid-cols-3
587
587
  lg:grid-cols-4
@@ -1,8 +1,8 @@
1
1
  export interface ProductQuery {
2
2
  search: string;
3
- sort: string;
3
+ sortBy: string;
4
4
  order?: number;
5
- productType: string[];
5
+ productTypes: string[];
6
6
  collectionId: string[];
7
7
  minPrice?: number;
8
8
  maxPrice?: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "droplinked-editor-configs",
3
3
  "private": false,
4
- "version": "1.8.5",
4
+ "version": "1.8.6",
5
5
  "type": "module",
6
6
  "main": "dist/droplinked-editor.umd.js",
7
7
  "module": "dist/droplinked-editor.es.js",
@@ -9,7 +9,7 @@ import Text from 'components/ui/Text';
9
9
  function SortDropdown() {
10
10
  const { isDarkTheme } = useThemeInfo();
11
11
  const { stagedSortOption, stagedSortOrder } = useProductQueryStore((state) => ({
12
- stagedSortOption: state.stagedProductQuery.sort,
12
+ stagedSortOption: state.stagedProductQuery.sortBy,
13
13
  stagedSortOrder: state.stagedProductQuery.order
14
14
  }));
15
15
 
@@ -5,7 +5,7 @@ import useProductQueryStore from "lib/stores/productQueryStore/productQueryStore
5
5
 
6
6
  function SortOptionButton({ option }: { option: SortOption }) {
7
7
  const { stagedSortOption, stagedSortOrder } = useProductQueryStore((state) => ({
8
- stagedSortOption: state.stagedProductQuery.sort,
8
+ stagedSortOption: state.stagedProductQuery.sortBy,
9
9
  stagedSortOrder: state.stagedProductQuery.order,
10
10
  }))
11
11
 
@@ -5,7 +5,7 @@ import { useFilterData } from "components/productGrid/context/ProductFiltersCont
5
5
 
6
6
  function TypeFilter() {
7
7
  const { isLoading, data, updateFilter } = useFilterData()
8
- const productTypes = useProductQueryStore(state => state.stagedProductQuery.productType)
8
+ const productTypes = useProductQueryStore(state => state.stagedProductQuery.productTypes)
9
9
 
10
10
  if (isLoading) return <FilterCheckboxSkeleton />
11
11
 
@@ -14,7 +14,7 @@ function TypeFilter() {
14
14
  [...productTypes, typeValue] :
15
15
  productTypes.filter(t => t !== typeValue)
16
16
 
17
- updateFilter('productType', updatedTypes)
17
+ updateFilter('productTypes', updatedTypes)
18
18
  }
19
19
 
20
20
  return (
@@ -23,11 +23,11 @@ export default function useSortHandler() {
23
23
 
24
24
  function handleSelectChange(sortOption: string, sortOrder?: number) {
25
25
  if (sortOption === 'default') {
26
- setStagedProductQuery('sort', '')
26
+ setStagedProductQuery('sortBy', '')
27
27
  setStagedProductQuery('order', undefined)
28
28
  }
29
29
  else {
30
- setStagedProductQuery('sort', sortOption)
30
+ setStagedProductQuery('sortBy', sortOption)
31
31
  setStagedProductQuery('order', sortOrder)
32
32
  }
33
33
 
@@ -2,9 +2,9 @@ import { create } from 'zustand'
2
2
 
3
3
  export interface ProductQuery {
4
4
  search: string
5
- sort: string
5
+ sortBy: string
6
6
  order?: number
7
- productType: string[]
7
+ productTypes: string[]
8
8
  collectionId: string[]
9
9
  minPrice?: number
10
10
  maxPrice?: number
@@ -23,8 +23,8 @@ interface ProductQueryStore {
23
23
 
24
24
  const initialProductQuery: ProductQuery = {
25
25
  search: "",
26
- sort: "",
27
- productType: [],
26
+ sortBy: "",
27
+ productTypes: [],
28
28
  collectionId: []
29
29
  }
30
30