droplinked-editor-configs 1.9.9 → 1.9.10

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.
@@ -1,7 +1,8 @@
1
1
  import { ComponentProps } from 'react';
2
2
 
3
- interface Props extends ComponentProps<"input"> {
4
- onValueChange: (value: number) => void;
3
+ interface Props extends Omit<ComponentProps<"input">, 'value' | 'onChange'> {
4
+ value: number | string | undefined;
5
+ onValueChange: (value: number | string) => void;
5
6
  }
6
7
  export default function PriceInput({ value, placeholder, onValueChange, ...inputProps }: Props): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -65256,9 +65256,11 @@ function LI({ value: e, placeholder: t, onValueChange: r, ...n }) {
65256
65256
  {
65257
65257
  type: "number",
65258
65258
  className: ` !font-shopfont ${f}`,
65259
- value: e,
65259
+ value: e ?? "",
65260
65260
  placeholder: t,
65261
- onChange: ({ target: { validity: h, value: m } }) => h.valid && r(+m),
65261
+ onChange: ({ target: { validity: h, value: m } }) => {
65262
+ h.valid && r(m === "" ? "" : +m);
65263
+ },
65262
65264
  onKeyDown: (h) => {
65263
65265
  ["+", "-", "e", "."].includes(h.key) && h.preventDefault();
65264
65266
  },
@@ -65281,26 +65283,38 @@ function xBe() {
65281
65283
  min: Math.floor(+X5(r.price.min, e?.conversionRateToUSD)),
65282
65284
  max: Math.ceil(+X5(r.price.max, e?.conversionRateToUSD))
65283
65285
  } : {}, { minPrice: s, maxPrice: a, setStagedProductQuery: l, applyStagedFilters: c } = Fr((m) => ({
65284
- minPrice: m.stagedProductQuery.minPrice ?? o,
65285
- maxPrice: m.stagedProductQuery.maxPrice ?? i,
65286
+ minPrice: m.stagedProductQuery.minPrice,
65287
+ maxPrice: m.stagedProductQuery.maxPrice,
65286
65288
  setStagedProductQuery: m.setStagedProductQuery,
65287
65289
  applyStagedFilters: m.applyStagedFilters
65288
65290
  })), u = W6(s, 300), d = W6(a, 300);
65289
65291
  ue(() => {
65292
+ if (typeof u == "number" && typeof d == "number" && u > d) {
65293
+ l("minPrice", d), l("maxPrice", u);
65294
+ return;
65295
+ }
65290
65296
  c();
65291
- }, [u, d, c]);
65297
+ }, [u, d, c, l]);
65292
65298
  const f = (m) => {
65293
- m < a && l("minPrice", m);
65299
+ if (m === "") {
65300
+ l("minPrice", void 0);
65301
+ return;
65302
+ }
65303
+ typeof m == "number" && l("minPrice", m);
65294
65304
  }, h = (m) => {
65295
- m > s && l("maxPrice", m);
65305
+ if (m === "") {
65306
+ l("maxPrice", void 0);
65307
+ return;
65308
+ }
65309
+ typeof m == "number" && l("maxPrice", m);
65296
65310
  };
65297
65311
  return t ? /* @__PURE__ */ p.jsx(s8, {}) : /* @__PURE__ */ p.jsxs("div", { className: "flex flex-col gap-4", children: [
65298
65312
  /* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-3", children: [
65299
65313
  /* @__PURE__ */ p.jsx(
65300
65314
  LI,
65301
65315
  {
65302
- value: s,
65303
- placeholder: "0",
65316
+ value: s ?? "",
65317
+ placeholder: o.toString(),
65304
65318
  onValueChange: f,
65305
65319
  min: o
65306
65320
  }
@@ -65309,8 +65323,8 @@ function xBe() {
65309
65323
  /* @__PURE__ */ p.jsx(
65310
65324
  LI,
65311
65325
  {
65312
- value: a,
65313
- placeholder: "1000",
65326
+ value: a ?? "",
65327
+ placeholder: i.toString(),
65314
65328
  onValueChange: h,
65315
65329
  max: i
65316
65330
  }
@@ -65322,7 +65336,7 @@ function xBe() {
65322
65336
  className: "price-range-slider",
65323
65337
  thumbClassName: n ? "dark-price-range-slider__thumb" : "price-range-slider__thumb",
65324
65338
  trackClassName: n ? "dark-price-range-slider__track" : "price-range-slider__track",
65325
- value: [s, a],
65339
+ value: [s ?? o, a ?? i],
65326
65340
  renderThumb: (m) => /* @__PURE__ */ p.jsx("div", { ...m }),
65327
65341
  minDistance: 1,
65328
65342
  onChange: ([m, g]) => {
@@ -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 wFe=c7("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),MG=D.forwardRef(({className:e,...t},r)=>p.jsx(l7,{ref:r,className:Ye("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(kG,{className:Ye("flex items-center justify-center text-current"),children:p.jsx(DG,{className:"h-4 w-4"})})}));MG.displayName=l7.displayName;function OG({label:e,count:t,checked:r,onCheckChange:n}){const{isDarkTheme:o}=Je(),s=()=>n(!r),i=Ye("w-5 h-5 border rounded-sm flex items-center justify-center border-shop-textColor",{"border-white bg-white text-black":r&&o,"border-black bg-black text-white":r&&!o}),a=o?"text-subtextPlaceholder-Dark":"text-subtextPlaceholde-Light";return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(MG,{checked:r,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 es({className:e,...t}){return p.jsx("div",{className:Ye("animate-pulse rounded-md bg-muted",e),...t})}function u7(){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((r,n)=>p.jsxs("div",{className:"flex gap-2 items-center animate-pulse",children:[p.jsx(es,{className:Ye("w-5 h-5 rounded-sm",t)}),p.jsx(es,{className:Ye("w-1/2 h-4 flex-1 rounded-md",t)}),p.jsx(es,{className:Ye("w-8 h-4 rounded-md",t)})]},n))})}const AG=g.createContext(void 0);function CFe({children:e,isLoading:t,applyFiltersDirectly:r,data:n}){const{setStagedProductQuery:o,applyStagedFilters:s}=Or(a=>({setStagedProductQuery:a.setStagedProductQuery,applyStagedFilters:a.applyStagedFilters})),i=(a,l)=>{o(a,l),r&&s()};return p.jsx(AG.Provider,{value:{isLoading:t,data:n,applyFiltersDirectly:r,updateFilter:i},children:e})}function d7(){const e=g.useContext(AG);if(!e)throw new Error("useFilterData must be used within a ProductFiltersProvider");return e}function kFe(){const{isLoading:e,data:t,updateFilter:r}=d7(),n=t?.collections??[],[o,s]=g.useState(!1),i=o?n:n.slice(0,3),a=Or(c=>c.stagedProductQuery.collectionId),l=(c,u)=>{const d=u?[...a,c]:a.filter(f=>f!==c);r("collectionId",d)};return e?p.jsx(u7,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[i.map(c=>p.jsx(OG,{label:c.title,count:c.count,checked:a.includes(c._id),onCheckChange:u=>l(c._id,u)},c._id)),n.length>3&&p.jsx(kl,{onClick:()=>s(c=>!c),className:"flex self-center items-center font-medium",iconLeft:p.jsx(It.BlackChevronDown,{className:`text-[#179EF8] ${o?"rotate-180":""}`}),children:o?"Less":"More"})]})}function f7({title:e,children:t}){const{isDarkTheme:r}=Je();return p.jsxs(gG,{value:e,className:"border-b-0",children:[p.jsx(vG,{chevronClassName:r?"[&>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(yG,{className:"flex flex-col mt-4 gap-4 px-3 py-0",children:t})]})}function p7(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function h7(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function z1(e){return e!==null&&e.length===1?e[0]:e.slice()}function H1(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function Pl(e,t){return m7(function(r,n){let o=r;return o<=n.min&&(o=n.min),o>=n.max&&(o=n.max),o}(e,t),t)}function m7(e,t){const r=(e-t.min)%t.step;let n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}let g7=function(e){function t(n){var o;(o=e.call(this,n)||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]),H1(o.getMouseEventMap())})}p7(a)}},o.onSliderClick=a=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){const l=o.getMousePosition(a),c=Pl(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=a=>l=>{o.props.disabled||(o.start(a),H1(o.getKeyDownEventMap()),p7(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]),H1(o.getMouseEventMap()),p7(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]),H1(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:z1(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:z1(o.state.value)};return o.props.renderTrack(u,d)};let s=h7(n.value);s.length||(s=h7(n.defaultValue)),o.pendingResizeTimeouts=[];const i=[];for(let a=0;a<s.length;a+=1)s[a]=Pl(s[a],n),i.push(a);return o.resizeObserver=null,o.resizeElementRef=g.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:s,zIndices:i},o}Ni(t,e);var r=t.prototype;return r.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(n,o){const s=h7(n.value);return s.length?o.pending?null:{value:s.map(i=>Pl(i,n))}:null},r.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},r.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},r.onEnd=function(n){n&&function(o){Object.keys(o).forEach(s=>{typeof document<"u"&&document.removeEventListener(s,o[s],!1)})}(n),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},r.getValue=function(){return z1(this.state.value)},r.getClosestIndex=function(n){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(n-c);u<o&&(o=u,s=l)}return s},r.getMousePosition=function(n){return[n["page"+this.axisKey()],n["page"+this.orthogonalAxisKey()]]},r.getTouchPosition=function(n){const o=n.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},r.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},r.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},r.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},r.getValueFromPosition=function(n){const o=n/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return Pl(this.state.startValue+o,this.props)},r.getDiffPosition=function(n){let o=n-this.state.startPosition;return this.props.invert&&(o*=-1),o},r.resize=function(){const{slider:n,thumb0:o}=this;if(!n||!o)return;const s=this.sizeKey(),i=n.getBoundingClientRect(),a=n[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})},r.calcOffset=function(n){const o=this.props.max-this.props.min;return o===0?0:(n-this.props.min)/o*this.state.upperBound},r.calcValue=function(n){return n/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},r.calcOffsetFromPosition=function(n){const{slider:o}=this,s=o.getBoundingClientRect(),i=s[this.posMaxKey()],a=s[this.posMinKey()];let l=n-(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},r.forceValueFromPosition=function(n,o){const s=this.calcOffsetFromPosition(n),i=this.getClosestIndex(s),a=Pl(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")})},r.clearPendingResizeTimeouts=function(){do{const n=this.pendingResizeTimeouts.shift();clearTimeout(n)}while(this.pendingResizeTimeouts.length)},r.start=function(n,o){const s=this["thumb"+n];s&&s.focus();const{zIndices:i}=this.state;i.splice(i.indexOf(n),1),i.push(n),this.setState(a=>({startValue:a.value[n],startPosition:o!==void 0?o:a.startPosition,index:n,zIndices:i}))},r.moveUpByStep=function(n){n===void 0&&(n=this.props.step);const o=this.state.value[this.state.index],s=Pl(this.props.invert&&this.props.orientation==="horizontal"?o-n:o+n,this.props);this.move(Math.min(s,this.props.max))},r.moveDownByStep=function(n){n===void 0&&(n=this.props.step);const o=this.state.value[this.state.index],s=Pl(this.props.invert&&this.props.orientation==="horizontal"?o+n:o-n,this.props);this.move(Math.max(s,this.props.min))},r.move=function(n){const o=this.state.value.slice(),{index:s}=this.state,{length:i}=o,a=o[s];if(n===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];n<f+d&&(n=f+d)}if(s<i-1){const f=o[s+1];n>f-d&&(n=f-d)}}o[s]=n,l&&i>1&&(n>a?(this.pushSucceeding(o,d,s),function(f,h,m,v){for(let y=0;y<f;y+=1){const b=v-y*m;h[f-1-y]>b&&(h[f-1-y]=b)}}(i,o,d,c)):n<a&&(this.pushPreceding(o,d,s),function(f,h,m,v){for(let y=0;y<f;y+=1){const b=v+y*m;h[y]<b&&(h[y]=b)}}(i,o,d,u))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},r.pushSucceeding=function(n,o,s){let i,a;for(i=s,a=n[i]+o;n[i+1]!==null&&a>n[i+1];i+=1,a=n[i]+o)n[i+1]=m7(a,this.props)},r.pushPreceding=function(n,o,s){for(let i=s,a=n[i]-o;n[i-1]!==null&&a<n[i-1];i-=1,a=n[i]-o)n[i-1]=m7(a,this.props)},r.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},r.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},r.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},r.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},r.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},r.fireChangeEvent=function(n){this.props[n]&&this.props[n](z1(this.state.value),this.state.index)},r.buildThumbStyle=function(n,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()]=n+"px",s},r.buildTrackStyle=function(n,o){const s={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return s[this.posMinKey()]=n,s[this.posMaxKey()]=o,s},r.buildMarkStyle=function(n){var o;return(o={position:"absolute"})[this.posMinKey()]=n,o},r.renderThumbs=function(n){const{length:o}=n,s=[];for(let a=0;a<o;a+=1)s[a]=this.buildThumbStyle(n[a],a);const i=[];for(let a=0;a<o;a+=1)i[a]=this.renderThumb(s[a],a);return i},r.renderTracks=function(n){const o=[],s=n.length-1;o.push(this.renderTrack(0,0,n[0]));for(let i=0;i<s;i+=1)o.push(this.renderTrack(i+1,n[i],n[i+1]));return o.push(this.renderTrack(s+1,n[s],this.state.upperBound)),o},r.renderMarks=function(){let{marks:n}=this.props;const o=this.props.max-this.props.min+1;return typeof n=="boolean"?n=Array.from({length:o}).map((s,i)=>i):typeof n=="number"&&(n=Array.from({length:o}).map((s,i)=>i).filter(s=>s%n==0)),n.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)})},r.render=function(){const n=[],{value:o}=this.state,s=o.length;for(let c=0;c<s;c+=1)n[c]=this.calcOffset(o[c],c);const i=this.props.withTracks?this.renderTracks(n):null,a=this.renderThumbs(n),l=this.props.marks?this.renderMarks():null;return g.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}(g.Component);g7.displayName="ReactSlider",g7.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=>g.createElement("div",e),renderTrack:e=>g.createElement("div",e),renderMark:e=>g.createElement("span",e)};var SFe=g7;const _Fe={USD:p.jsx(It.DollarSign,{}),AUD:p.jsx(It.DollarSign,{}),CAD:p.jsx(It.CAD,{}),GBP:p.jsx(It.GBP,{}),AED:p.jsx(It.AED,{}),CNY:p.jsx(It.CNY,{}),JPY:p.jsx(It.JPY,{}),EUR:p.jsx(It.EUR,{})};function EFe({currencyCode:e,className:t}){return p.jsx("div",{className:t,children:_Fe[e]??p.jsx(It.DollarSign,{})})}function PFe({isFocused:e,isDarkTheme:t,textColorParagraphs:r}){const n=qh("flex flex-1 items-center gap-2 px-4 py-3 rounded-lg border",{"border-black":e&&!t,"border-white":e&&t,[`border-[${r}]`]:!e}),o=qh("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=qh("shrink-0",{"[&_path]:stroke-[#B1B1B1]":!e&&!t,"[&_path]:stroke-[#7B7B7B]":!e&&t,"[&_path]:stroke-white":e&&t,"[&_path]:stroke-black":e&&!t});return{containerClassName:n,inputClassName:o,iconClassName:s}}function jG({value:e,placeholder:t,onValueChange:r,...n}){const{states:{shop:{currency:o,shopDesign:{fontfamily:s,textColorParagraphs:i}}}}=In(),{isDarkTheme:a}=Je(),[l,c]=g.useState(!1),{containerClassName:u,iconClassName:d,inputClassName:f}=PFe({isFocused:l,isDarkTheme:a,textColorParagraphs:i});return p.jsxs("div",{className:u,children:[p.jsx(EFe,{currencyCode:o.abbreviation,className:d}),p.jsx("input",{type:"number",className:` !font-shopfont ${f}`,value:e,placeholder:t,onChange:({target:{validity:h,value:m}})=>h.valid&&r(+m),onKeyDown:h=>{["+","-","e","."].includes(h.key)&&h.preventDefault()},onFocus:()=>c(!0),onBlur:()=>c(!1),...n})]})}const v7=(e,t=500)=>{const[r,n]=g.useState(e);return g.useEffect(()=>{const o=setTimeout(()=>n(e),t);return()=>clearTimeout(o)},[e,t]),r};function TFe(){const{states:{shop:{currency:e}}}=In(),{isLoading:t,data:r}=d7(),{isDarkTheme:n}=Je(),{min:o=0,max:s=1e5}=r?.price?{min:Math.floor(+my(r.price.min,e?.conversionRateToUSD)),max:Math.ceil(+my(r.price.max,e?.conversionRateToUSD))}:{},{minPrice:i,maxPrice:a,setStagedProductQuery:l,applyStagedFilters:c}=Or(m=>({minPrice:m.stagedProductQuery.minPrice??o,maxPrice:m.stagedProductQuery.maxPrice??s,setStagedProductQuery:m.setStagedProductQuery,applyStagedFilters:m.applyStagedFilters})),u=v7(i,300),d=v7(a,300);g.useEffect(()=>{c()},[u,d,c]);const f=m=>{m<a&&l("minPrice",m)},h=m=>{m>i&&l("maxPrice",m)};return t?p.jsx(u7,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(jG,{value:i,placeholder:"0",onValueChange:f,min:o}),p.jsx(It.Separator,{className:"shrink-0"}),p.jsx(jG,{value:a,placeholder:"1000",onValueChange:h,max:s})]}),p.jsx(SFe,{className:"price-range-slider",thumbClassName:n?"dark-price-range-slider__thumb":"price-range-slider__thumb",trackClassName:n?"dark-price-range-slider__track":"price-range-slider__track",value:[i,a],renderThumb:m=>p.jsx("div",{...m}),minDistance:1,onChange:([m,v])=>{l("minPrice",m),l("maxPrice",v)},min:o,max:s})]})}function DFe(){const{isLoading:e,data:t,updateFilter:r}=d7(),n=Or(s=>s.stagedProductQuery.productTypes);if(e)return p.jsx(u7,{});const o=(s,i)=>{const a=i?[...n,s]:n.filter(l=>l!==s);r("productTypes",a)};return p.jsx("div",{className:"space-y-4",children:t?.types.map((s,i)=>p.jsx(OG,{label:s.label,count:s.count,checked:n.includes(s.value),onCheckChange:a=>o(s.value,a)},i))})}const MFe=({shopName:e})=>v1.get(`/shops/v2/public/name/${e}`),OFe=e=>v1.get(`/product-v2/available/filters/${e}`).then(t=>t.data);function AFe(){const{states:{shop:e}}=In();return Fq({queryFn:()=>OFe(e.url),refetchOnWindowFocus:!1})}function IG({className:e,applyFiltersDirectly:t=!0}){const{isLoading:r,data:n,isError:o}=AFe();return o?p.jsx(ct,{className:`${e} text-[#dc2626]`,children:"An error occurred while fetching product filters. Please try again later."}):p.jsx(CFe,{isLoading:r,applyFiltersDirectly:t,data:n?.data,children:p.jsx(jFe,{className:e})})}function jFe({className:e}){return p.jsxs(cFe,{type:"multiple",className:Ye("flex flex-col gap-6",e),children:[p.jsx(f7,{title:"Type",children:p.jsx(DFe,{})}),p.jsx(f7,{title:"Collection",children:p.jsx(kFe,{})}),p.jsx(f7,{title:"Price",children:p.jsx(TFe,{})})]})}const IFe=(e,t="filled")=>{const{"--dlk-comps":{"--dlk-comps-btn":{"--dlk-comps-btn-styles":r,"--dlk-comps-btn-fill":{"--dlk-comps-btn-fill-styles":n,"--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={...r};return t==="filled"&&n?a={...a,...n,...o}:t==="outline"&&s&&(a={...a,...s,...i}),a};function $G({variant:e="filled",children:t,...r}){const{states:{shop:{template_options:n,shopDesign:o}}}=In(),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(cg,{...s[e],...IFe(n,e),...r,children:t})}function LG(){const{isDarkTheme:e,shopDesign:{textColorParagraphs:t}}=Je(),r=Or(o=>o.applyStagedFilters),n=Or(o=>o.resetProductQuery);return p.jsxs(RY,{children:[p.jsxs(BY,{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(It.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(U4,{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(q4,{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(IG,{applyFiltersDirectly:!1,className:"p-4 pb-9 md:p-9"})}),p.jsxs(zY,{className:`flex flex-row gap-4 p-4 md:px-9 md:py-6 border-t border-[${t}]`,children:[p.jsx(W4,{asChild:!0,children:p.jsx($G,{fontSize:14,fontWeight:500,variant:"outline",onClick:n,children:"Reset"})}),p.jsx(W4,{asChild:!0,children:p.jsx($G,{flex:1,fontSize:14,fontWeight:500,onClick:r,children:"Apply Filters"})})]})]})]})}function FG(){const{isDarkTheme:e}=Je(),t=g.useRef(null),r=Or(a=>a.stagedProductQuery.search),n=Or(a=>a.setStagedProductQuery),o=Or(a=>a.applyStagedFilters),s=v7(r);g.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(It.Search,{className:`shrink-0 ${e?"[&>path]:stroke-white":""}`}),p.jsx("input",{ref:t,type:"text",value:r,onChange:a=>n("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(It.SearchInputIcon,{className:`${e?"[&>path]:fill-[#292929]":""}`})})]})}var $Fe="Arrow",NG=D.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return p.jsx(Ot.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});NG.displayName=$Fe;var LFe=NG,y7="Popper",[RG,BG]=wi(y7),[FFe,VG]=RG(y7),zG=e=>{const{__scopePopper:t,children:r}=e,[n,o]=D.useState(null);return p.jsx(FFe,{scope:t,anchor:n,onAnchorChange:o,children:r})};zG.displayName=y7;var HG="PopperAnchor",WG=D.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=VG(HG,r),i=D.useRef(null),a=fr(t,i);return D.useEffect(()=>{s.onAnchorChange(n?.current||i.current)}),n?null:p.jsx(Ot.div,{...o,ref:a})});WG.displayName=HG;var b7="PopperContent",[NFe,RFe]=RG(b7),UG=D.forwardRef((e,t)=>{const{__scopePopper:r,side:n="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:m,...v}=e,y=VG(b7,r),[b,x]=D.useState(null),w=fr(t,ne=>x(ne)),[k,_]=D.useState(null),E=bG(k),T=E?.width??0,C=E?.height??0,P=n+(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(VFe),altBoundary:O},{refs:$,floatingStyles:W,placement:L,isPositioned:F,middlewareData:U}=iW({strategy:"fixed",placement:P,whileElementsMounted:(...ne)=>rW(...ne,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[aW({mainAxis:o+C,alignmentAxis:i}),l&&lDe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?cDe():void 0,...R}),l&&lW({...R}),uDe({...R,apply:({elements:ne,rects:Y,availableWidth:A,availableHeight:I})=>{const{width:B,height:H}=Y.reference,te=ne.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&&cW({element:k,padding:a}),zFe({arrowWidth:T,arrowHeight:C}),f&&dDe({strategy:"referenceHidden",...R})]}),[K,j]=GG(L),z=ki(m);Ci(()=>{F&&z?.()},[F,z]);const J=U.arrow?.x,q=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[Q,oe]=D.useState();return Ci(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:$.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(NFe,{scope:r,placedSide:K,onArrowChange:_,arrowX:J,arrowY:q,shouldHideArrow:ee,children:p.jsx(Ot.div,{"data-side":K,"data-align":j,...v,ref:w,style:{...v.style,animation:F?void 0:"none"}})})})});UG.displayName=b7;var qG="PopperArrow",BFe={top:"bottom",right:"left",bottom:"top",left:"right"},YG=D.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=RFe(qG,n),i=BFe[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(LFe,{...o,ref:r,style:{...o.style,display:"block"}})})});YG.displayName=qG;function VFe(e){return e!==null}var zFe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=GG(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+l/2;let m="",v="";return c==="bottom"?(m=i?d:`${f}px`,v=`${-l}px`):c==="top"?(m=i?d:`${f}px`,v=`${n.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=i?d:`${h}px`):c==="left"&&(m=`${n.floating.width+l}px`,v=i?d:`${h}px`),{data:{x:m,y:v}}}});function GG(e){const[t,r="center"]=e.split("-");return[t,r]}var HFe=zG,WFe=WG,UFe=UG,qFe=YG,x7="rovingFocusGroup.onEntryFocus",YFe={bubbles:!1,cancelable:!0},_h="RovingFocusGroup",[w7,KG,GFe]=X4(_h),[KFe,QG]=wi(_h,[GFe]),[QFe,ZFe]=KFe(_h),ZG=D.forwardRef((e,t)=>p.jsx(w7.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(w7.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(XFe,{...e,ref:t})})}));ZG.displayName=_h;var XFe=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=D.useRef(null),h=fr(t,f),m=r7(s),[v,y]=_l({prop:i,defaultProp:a??null,onChange:l,caller:_h}),[b,x]=D.useState(!1),w=ki(c),k=KG(r),_=D.useRef(!1),[E,T]=D.useState(0);return D.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(x7,w),()=>C.removeEventListener(x7,w)},[w]),p.jsx(QFe,{scope:r,orientation:n,dir:m,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(Ot.div,{tabIndex:b||E===0?-1:0,"data-orientation":n,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{_.current=!0}),onFocus:Ve(e.onFocus,C=>{const P=!_.current;if(C.target===C.currentTarget&&P&&!b){const S=new CustomEvent(x7,YFe);if(C.currentTarget.dispatchEvent(S),!S.defaultPrevented){const M=k().filter(L=>L.focusable),O=M.find(L=>L.active),R=M.find(L=>L.id===v),W=[O,R,...M].filter(Boolean).map(L=>L.ref.current);eK(W,u)}}_.current=!1}),onBlur:Ve(e.onBlur,()=>x(!1))})})}),XG="RovingFocusGroupItem",JG=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=ma(),c=s||l,u=ZFe(XG,r),d=u.currentTabStopId===c,f=KG(r),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:v}=u;return D.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),p.jsx(w7.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:p.jsx(Ot.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ve(e.onMouseDown,y=>{n?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=tNe(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?rNe(w,k+1):w.slice(k+1)}setTimeout(()=>eK(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:v!=null}):i})})});JG.displayName=XG;var JFe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eNe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tNe(e,t,r){const n=eNe(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return JFe[n]}function eK(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function rNe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var nNe=ZG,oNe=JG,C7=["Enter"," "],sNe=["ArrowDown","PageUp","Home"],tK=["ArrowUp","PageDown","End"],iNe=[...sNe,...tK],aNe={ltr:[...C7,"ArrowRight"],rtl:[...C7,"ArrowLeft"]},lNe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Eh="Menu",[Ph,cNe,uNe]=X4(Eh),[Tl,rK]=wi(Eh,[uNe,BG,QG]),W1=BG(),nK=QG(),[dNe,Dl]=Tl(Eh),[fNe,Th]=Tl(Eh),oK=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:s,modal:i=!0}=e,a=W1(t),[l,c]=D.useState(null),u=D.useRef(!1),d=ki(s),f=r7(o);return D.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),p.jsx(HFe,{...a,children:p.jsx(dNe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:c,children:p.jsx(fNe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:n})})})};oK.displayName=Eh;var pNe="MenuAnchor",k7=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=W1(r);return p.jsx(WFe,{...o,...n,ref:t})});k7.displayName=pNe;var S7="MenuPortal",[hNe,sK]=Tl(S7,{forceMount:void 0}),iK=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,s=Dl(S7,t);return p.jsx(hNe,{scope:t,forceMount:r,children:p.jsx(Vs,{present:r||s.open,children:p.jsx(R4,{asChild:!0,container:o,children:n})})})};iK.displayName=S7;var So="MenuContent",[mNe,_7]=Tl(So),aK=D.forwardRef((e,t)=>{const r=sK(So,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Dl(So,e.__scopeMenu),i=Th(So,e.__scopeMenu);return p.jsx(Ph.Provider,{scope:e.__scopeMenu,children:p.jsx(Vs,{present:n||s.open,children:p.jsx(Ph.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(gNe,{...o,ref:t}):p.jsx(vNe,{...o,ref:t})})})})}),gNe=D.forwardRef((e,t)=>{const r=Dl(So,e.__scopeMenu),n=D.useRef(null),o=fr(t,n);return D.useEffect(()=>{const s=n.current;if(s)return Vw(s)},[]),p.jsx(E7,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vNe=D.forwardRef((e,t)=>{const r=Dl(So,e.__scopeMenu);return p.jsx(E7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),yNe=rd("MenuContent.ScrollLock"),E7=D.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...v}=e,y=Dl(So,r),b=Th(So,r),x=W1(r),w=nK(r),k=cNe(r),[_,E]=D.useState(null),T=D.useRef(null),C=fr(t,T,y.onContentChange),P=D.useRef(0),S=D.useRef(""),M=D.useRef(0),O=D.useRef(null),R=D.useRef("right"),$=D.useRef(0),W=m?Eg:D.Fragment,L=m?{as:yNe,allowPinchZoom:!0}:void 0,F=K=>{const j=S.current+K,z=k().filter(ne=>!ne.disabled),J=document.activeElement,q=z.find(ne=>ne.ref.current===J)?.textValue,ee=z.map(ne=>ne.textValue),Q=MNe(ee,j,q),oe=z.find(ne=>ne.textValue===Q)?.ref.current;(function ne(Y){S.current=Y,window.clearTimeout(P.current),Y!==""&&(P.current=window.setTimeout(()=>ne(""),1e3))})(j),oe&&setTimeout(()=>oe.focus())};D.useEffect(()=>()=>window.clearTimeout(P.current),[]),gY();const U=D.useCallback(K=>R.current===O.current?.side&&ANe(K,O.current?.area),[]);return p.jsx(mNe,{scope:r,searchRef:S,onItemEnter:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),onItemLeave:D.useCallback(K=>{U(K)||(T.current?.focus(),E(null))},[U]),onTriggerLeave:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),pointerGraceTimerRef:M,onPointerGraceIntentChange:D.useCallback(K=>{O.current=K},[]),children:p.jsx(W,{...L,children:p.jsx(N4,{asChild:!0,trapped:o,onMountAutoFocus:Ve(s,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx($4,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:p.jsx(nNe,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:_,onCurrentTabStopIdChange:E,onEntryFocus:Ve(l,K=>{b.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(UFe,{role:"menu","aria-orientation":"vertical","data-state":SK(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||!iNe.includes(K.key))return;K.preventDefault();const oe=k().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);tK.includes(K.key)&&oe.reverse(),TNe(oe)}),onBlur:Ve(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(P.current),S.current="")}),onPointerMove:Ve(e.onPointerMove,Mh(K=>{const j=K.target,z=$.current!==K.clientX;if(K.currentTarget.contains(j)&&z){const J=K.clientX>$.current?"right":"left";R.current=J,$.current=K.clientX}}))})})})})})})});aK.displayName=So;var bNe="MenuGroup",P7=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(Ot.div,{role:"group",...n,ref:t})});P7.displayName=bNe;var xNe="MenuLabel",lK=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(Ot.div,{...n,ref:t})});lK.displayName=xNe;var U1="MenuItem",cK="menu.itemSelect",q1=D.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,s=D.useRef(null),i=Th(U1,e.__scopeMenu),a=_7(U1,e.__scopeMenu),l=fr(t,s),c=D.useRef(!1),u=()=>{const d=s.current;if(!r&&d){const f=new CustomEvent(cK,{bubbles:!0,cancelable:!0});d.addEventListener(cK,h=>n?.(h),{once:!0}),iY(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return p.jsx(uK,{...o,ref:l,disabled:r,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!=="";r||f&&d.key===" "||C7.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});q1.displayName=U1;var uK=D.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...s}=e,i=_7(U1,r),a=nK(r),l=D.useRef(null),c=fr(t,l),[u,d]=D.useState(!1),[f,h]=D.useState("");return D.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[s.children]),p.jsx(Ph.ItemSlot,{scope:r,disabled:n,textValue:o??f,children:p.jsx(oNe,{asChild:!0,...a,focusable:!n,children:p.jsx(Ot.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:c,onPointerMove:Ve(e.onPointerMove,Mh(m=>{n?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ve(e.onPointerLeave,Mh(m=>i.onItemLeave(m))),onFocus:Ve(e.onFocus,()=>d(!0)),onBlur:Ve(e.onBlur,()=>d(!1))})})})}),wNe="MenuCheckboxItem",dK=D.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return p.jsx(gK,{scope:e.__scopeMenu,checked:r,children:p.jsx(q1,{role:"menuitemcheckbox","aria-checked":Y1(r)?"mixed":r,...o,ref:t,"data-state":D7(r),onSelect:Ve(o.onSelect,()=>n?.(Y1(r)?!0:!r),{checkForDefaultPrevented:!1})})})});dK.displayName=wNe;var fK="MenuRadioGroup",[CNe,kNe]=Tl(fK,{value:void 0,onValueChange:()=>{}}),pK=D.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,s=ki(n);return p.jsx(CNe,{scope:e.__scopeMenu,value:r,onValueChange:s,children:p.jsx(P7,{...o,ref:t})})});pK.displayName=fK;var hK="MenuRadioItem",mK=D.forwardRef((e,t)=>{const{value:r,...n}=e,o=kNe(hK,e.__scopeMenu),s=r===o.value;return p.jsx(gK,{scope:e.__scopeMenu,checked:s,children:p.jsx(q1,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":D7(s),onSelect:Ve(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});mK.displayName=hK;var T7="MenuItemIndicator",[gK,SNe]=Tl(T7,{checked:!1}),vK=D.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,s=SNe(T7,r);return p.jsx(Vs,{present:n||Y1(s.checked)||s.checked===!0,children:p.jsx(Ot.span,{...o,ref:t,"data-state":D7(s.checked)})})});vK.displayName=T7;var _Ne="MenuSeparator",yK=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(Ot.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});yK.displayName=_Ne;var ENe="MenuArrow",bK=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=W1(r);return p.jsx(qFe,{...o,...n,ref:t})});bK.displayName=ENe;var PNe="MenuSub",[cWe,xK]=Tl(PNe),Dh="MenuSubTrigger",wK=D.forwardRef((e,t)=>{const r=Dl(Dh,e.__scopeMenu),n=Th(Dh,e.__scopeMenu),o=xK(Dh,e.__scopeMenu),s=_7(Dh,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(k7,{asChild:!0,...c,children:p.jsx(uK,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":SK(r.open),...e,ref:T1(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ve(e.onPointerMove,Mh(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:Ve(e.onPointerLeave,Mh(d=>{u();const f=r.content?.getBoundingClientRect();if(f){const h=r.content?.dataset.side,m=h==="right",v=m?-5:5,y=f[m?"left":"right"],b=f[m?"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===" "||aNe[n.dir].includes(d.key)&&(r.onOpenChange(!0),r.content?.focus(),d.preventDefault())})})})});wK.displayName=Dh;var CK="MenuSubContent",kK=D.forwardRef((e,t)=>{const r=sK(So,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Dl(So,e.__scopeMenu),i=Th(So,e.__scopeMenu),a=xK(CK,e.__scopeMenu),l=D.useRef(null),c=fr(t,l);return p.jsx(Ph.Provider,{scope:e.__scopeMenu,children:p.jsx(Vs,{present:n||s.open,children:p.jsx(Ph.Slot,{scope:e.__scopeMenu,children:p.jsx(E7,{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=lNe[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});kK.displayName=CK;function SK(e){return e?"open":"closed"}function Y1(e){return e==="indeterminate"}function D7(e){return Y1(e)?"indeterminate":e?"checked":"unchecked"}function TNe(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function DNe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function MNe(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=DNe(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function ONe(e,t){const{x:r,y:n}=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>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function ANe(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return ONe(r,t)}function Mh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jNe=oK,INe=k7,$Ne=iK,LNe=aK,FNe=P7,NNe=lK,RNe=q1,BNe=dK,VNe=pK,zNe=mK,HNe=vK,WNe=yK,UNe=bK,qNe=wK,YNe=kK,G1="DropdownMenu",[GNe,uWe]=wi(G1,[rK]),pn=rK(),[KNe,_K]=GNe(G1),EK=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=pn(t),c=D.useRef(null),[u,d]=_l({prop:o,defaultProp:s??!1,onChange:i,caller:G1});return p.jsx(KNe,{scope:t,triggerId:ma(),triggerRef:c,contentId:ma(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:a,children:p.jsx(jNe,{...l,open:u,onOpenChange:d,dir:n,modal:a,children:r})})};EK.displayName=G1;var PK="DropdownMenuTrigger",TK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,s=_K(PK,r),i=pn(r);return p.jsx(INe,{asChild:!0,...i,children:p.jsx(Ot.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":n?"":void 0,disabled:n,...o,ref:T1(t,s.triggerRef),onPointerDown:Ve(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Ve(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});TK.displayName=PK;var QNe="DropdownMenuPortal",DK=e=>{const{__scopeDropdownMenu:t,...r}=e,n=pn(t);return p.jsx($Ne,{...n,...r})};DK.displayName=QNe;var MK="DropdownMenuContent",OK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=_K(MK,r),s=pn(r),i=D.useRef(!1);return p.jsx(LNe,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...n,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)"}})});OK.displayName=MK;var ZNe="DropdownMenuGroup",XNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(FNe,{...o,...n,ref:t})});XNe.displayName=ZNe;var JNe="DropdownMenuLabel",AK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(NNe,{...o,...n,ref:t})});AK.displayName=JNe;var eRe="DropdownMenuItem",jK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(RNe,{...o,...n,ref:t})});jK.displayName=eRe;var tRe="DropdownMenuCheckboxItem",IK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(BNe,{...o,...n,ref:t})});IK.displayName=tRe;var rRe="DropdownMenuRadioGroup",nRe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(VNe,{...o,...n,ref:t})});nRe.displayName=rRe;var oRe="DropdownMenuRadioItem",$K=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(zNe,{...o,...n,ref:t})});$K.displayName=oRe;var sRe="DropdownMenuItemIndicator",LK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(HNe,{...o,...n,ref:t})});LK.displayName=sRe;var iRe="DropdownMenuSeparator",FK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(WNe,{...o,...n,ref:t})});FK.displayName=iRe;var aRe="DropdownMenuArrow",lRe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(UNe,{...o,...n,ref:t})});lRe.displayName=aRe;var cRe="DropdownMenuSubTrigger",NK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(qNe,{...o,...n,ref:t})});NK.displayName=cRe;var uRe="DropdownMenuSubContent",RK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(YNe,{...o,...n,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)"}})});RK.displayName=uRe;var dRe=EK,fRe=TK,pRe=DK,BK=OK,VK=AK,zK=jK,HK=IK,WK=$K,UK=LK,qK=FK,YK=NK,GK=RK;const hRe=dRe,mRe=fRe,gRe=D.forwardRef(({className:e,inset:t,children:r,...n},o)=>p.jsxs(YK,{ref:o,className:Ye("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),...n,children:[r,p.jsx(xFe,{className:"ml-auto"})]}));gRe.displayName=YK.displayName;const vRe=D.forwardRef(({className:e,...t},r)=>p.jsx(GK,{ref:r,className:Ye("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}));vRe.displayName=GK.displayName;const KK=D.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(pRe,{children:p.jsx(BK,{ref:n,sideOffset:t,className:Ye("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),...r})}));KK.displayName=BK.displayName;const QK=D.forwardRef(({className:e,inset:t,...r},n)=>p.jsx(zK,{ref:n,className:Ye("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),...r}));QK.displayName=zK.displayName;const yRe=D.forwardRef(({className:e,children:t,checked:r,...n},o)=>p.jsxs(HK,{ref:o,className:Ye("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:r,...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(UK,{children:p.jsx(DG,{className:"h-4 w-4"})})}),t]}));yRe.displayName=HK.displayName;const bRe=D.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(WK,{ref:n,className:Ye("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),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(UK,{children:p.jsx(wFe,{className:"h-2 w-2 fill-current"})})}),t]}));bRe.displayName=WK.displayName;const xRe=D.forwardRef(({className:e,inset:t,...r},n)=>p.jsx(VK,{ref:n,className:Ye("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));xRe.displayName=VK.displayName;const wRe=D.forwardRef(({className:e,...t},r)=>p.jsx(qK,{ref:r,className:Ye("-mx-1 my-1 h-px bg-muted",e),...t}));wRe.displayName=qK.displayName;const M7=[{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 CRe(){const{setStagedProductQuery:e,applyStagedFilters:t}=Or(n=>({setStagedProductQuery:n.setStagedProductQuery,applyStagedFilters:n.applyStagedFilters}));function r(n,o){n==="default"?(e("sortBy",""),e("order",void 0)):(e("sortBy",n),e("order",o)),t()}return r}function ZK({option:e}){const{stagedSortOption:t,stagedSortOrder:r}=Or(c=>({stagedSortOption:c.stagedProductQuery.sortBy,stagedSortOrder:c.stagedProductQuery.order})),n=CRe(),{isDarkTheme:o}=Je(),i=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";return p.jsxs("button",{onClick:()=>n(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 kRe(){const{isDarkTheme:e}=Je(),{stagedSortOption:t,stagedSortOrder:r}=Or(o=>({stagedSortOption:o.stagedProductQuery.sortBy,stagedSortOrder:o.stagedProductQuery.order})),n=()=>{const o=M7.find(i=>i.value===t&&i.sortOrder===r);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(hRe,{children:[p.jsxs(mRe,{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:n()}),p.jsx(It.GrayChevronDown,{})]}),p.jsx(KK,{className:`my-2 flex w-[250px] flex-col gap-2 rounded-lg border-none p-3 ${e?"bg-black":"bg-white"} `,children:M7.map((o,s)=>p.jsx(QK,{className:"p-0",children:p.jsx(ZK,{option:o})},s))})]})}function SRe({showSearchBar:e,showSort:t,showFilters:r}){return p.jsxs("div",{className:"hidden md:flex justify-between",children:[p.jsxs("div",{className:"flex gap-4",children:[r&&p.jsx(LG,{}),e&&p.jsx(FG,{})]}),t&&p.jsx(kRe,{})]})}function XK({onClick:e,children:t}){const{shopDesign:{textColorParagraphs:r}}=Je();return p.jsx("button",{onClick:e,className:`flex items-center justify-center w-10 h-10 border rounded-lg border-[${r}]`,children:t})}function _Re({onClick:e}){const{isDarkTheme:t}=Je(),r=t?"[&>path]:stroke-white":"";return p.jsx(XK,{onClick:e,children:p.jsx(It.Search,{className:r})})}function ERe(){const{isDarkTheme:e}=Je();return p.jsxs(RY,{children:[p.jsx(BY,{className:"flex items-center justify-center w-10 h-10 border rounded-lg lg:hidden border-shop-textColor",children:p.jsx(It.Sort,{className:`shrink-0 ${e?"[&_path]:stroke-white":""}`})}),p.jsxs(U4,{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(q4,{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:M7.map((t,r)=>p.jsx(W4,{children:p.jsx(ZK,{option:t})},r))})]})]})}function PRe({showSearchBar:e,showSort:t,showFilters:r}){const[n,o]=g.useState(!1),s=g.useRef(null);return g.useEffect(()=>{const i=a=>{s.current&&!s.current.contains(a.target)&&o(!1)};return n?document.addEventListener("mousedown",i):document.removeEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[n]),p.jsx(p.Fragment,{children:n?p.jsx("div",{className:"md:hidden",ref:s,children:p.jsx(FG,{})}):p.jsxs("div",{className:"flex justify-between md:hidden",children:[p.jsxs("div",{className:"flex gap-2",children:[r&&p.jsx(LG,{}),e&&p.jsx(_Re,{onClick:()=>o(!0)})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(TRe,{}),t&&p.jsx(ERe,{})]})]})})}function TRe(){const{isDarkTheme:e}=Je(),{viewMode:t,setViewMode:r}=Or(s=>({viewMode:s.viewMode,setViewMode:s.setViewMode})),n=t==="grid",o=e?"[&_path]:stroke-white":"";return p.jsx(XK,{onClick:()=>r(n?"list":"grid"),children:n?p.jsx(It.ListView,{className:o}):p.jsx(It.GridView,{className:o})})}function DRe({showSearchBar:e,showSort:t,showFilters:r}){return p.jsxs(p.Fragment,{children:[p.jsx(SRe,{showSearchBar:e,showSort:t,showFilters:r}),p.jsx(PRe,{showSearchBar:e,showSort:t,showFilters:r})]})}const JK=({price:e,slug:t,className:r})=>{const{isDarkTheme:n}=Je(),{navigate:o}=td(),{states:{shop:{currency:s,tokenBasedPricing:i}}}=In(),a="text-base md:text-[18px] cursor-pointer",l=n?"#7B7B7B":"#B1B1B1",c=()=>o(`product/${t}`);return i?.hasTokenBasedPricing?p.jsxs("div",{className:Ye("flex",a,r),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:Ye("font-medium",a,r),onClick:c,children:[eY(+e,s),p.jsx("span",{className:Ye(`text-[${l}]`,"font-normal"),children:s?.abbreviation})]})};function eQ({title:e,slug:t,className:r}){const{navigate:n}=td();return p.jsx(ct,{as:"h3",onClick:()=>n(`product/${t}`),className:Ye("h-10 md:h-12 text-sm md:text-base font-normal line-clamp-2 cursor-pointer",r),children:e})}var K1={},tQ;function MRe(){if(tQ)return K1;tQ=1,Object.defineProperty(K1,"__esModule",{value:!0});var e=g;function t(C){return Array.prototype.slice.call(C)}function r(C,P){var S=Math.floor(C);return S===P||S+1===P?C:P}function n(){return Date.now()}function o(C,P,S){if(P="data-keen-slider-"+P,S===null)return C.removeAttribute(P);C.setAttribute(P,S||"")}function s(C,P){return P=P||document,typeof C=="function"&&(C=C(P)),Array.isArray(C)?C:typeof C=="string"?t(P.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(P,S,M,O){P.addListener?P.addListener(M):P.addEventListener(S,M,O),C.push([P,S,M,O])},input:function(P,S,M,O){this.add(P,S,function(R){return function($){$.nativeEvent&&($=$.nativeEvent);var W=$.changedTouches||[],L=$.targetTouches||[],F=$.detail&&$.detail.x?$.detail:null;return R({id:F?F.identifier?F.identifier:"i":L[0]?L[0]?L[0].identifier:"e":"d",idChanged:F?F.identifier?F.identifier:"i":W[0]?W[0]?W[0].identifier:"e":"d",raw:$,x:F&&F.x?F.x:L[0]?L[0].screenX:F?F.x:$.pageX,y:F&&F.y?F.y:L[0]?L[0].screenY:F?F.y:$.pageY})}}(M),O)},purge:function(){C.forEach(function(P){P[0].removeListener?P[0].removeListener(P[2]):P[0].removeEventListener(P[1],P[2],P[3])}),C=[]}}}function c(C,P,S){return Math.min(Math.max(C,P),S)}function u(C){return(C>0?1:0)-(C<0?1:0)||+C}function d(C){var P=C.getBoundingClientRect();return{height:r(P.height,C.offsetHeight),width:r(P.width,C.offsetWidth)}}function f(C,P,S,M){var O=C&&C[P];return O==null?S:M&&typeof O=="function"?O():O}function h(C){return Math.round(1e6*C)/1e6}function m(C,P){if(C===P)return!0;var S=typeof C;if(S!==typeof P)return!1;if(S!=="object"||C===null||P===null)return S==="function"&&C.toString()===P.toString();if(C.length!==P.length||Object.getOwnPropertyNames(C).length!==Object.getOwnPropertyNames(P).length)return!1;for(var M in C)if(!m(C[M],P[M]))return!1;return!0}var v=function(){return v=Object.assign||function(C){for(var P,S=1,M=arguments.length;S<M;S++)for(var O in P=arguments[S])Object.prototype.hasOwnProperty.call(P,O)&&(C[O]=P[O]);return C},v.apply(this,arguments)};function y(C,P,S){for(var M,O=0,R=P.length;O<R;O++)!M&&O in P||(M||(M=Array.prototype.slice.call(P,0,O)),M[O]=P[O]);return C.concat(M||Array.prototype.slice.call(P))}function b(C){var P,S,M,O,R,$;function W(j){$||($=j),L(!0);var z=j-$;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();$=null,L(!1),F(null),C.emit("animationEnded")}function L(j){P.active=j}function F(j){P.targetIdx=j}function U(){var j;j=W,R=window.requestAnimationFrame(j)}function K(){var j;j=R,window.cancelAnimationFrame(j),L(!1),F(null),$&&C.emit("animationStopped"),$=null}return P={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,ne=q.easing,Y=q.distance*ne(oe/q.duration)||0;J+=Y;var A=M;return M+=oe,z+=Y,[Q,q.distance,A,M,q.duration,ne]}),F(C.track.distToIdx(z)),U(),C.emit("animationStarted")}},stop:K,targetIdx:null}}function x(C){var P,S,M,O,R,$,W,L,F,U,K,j,z,J,q=1/0,ee=[],Q=null,oe=0;function ne(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===$&&(ge=0,ce+=me>0?1:-1),{abs:ge+ce*$*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-$*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))/$)*S;return h(Ze-Be-Ze+W[De]+he+(ge===$?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%$+$)%$}function Se(fe){var ce;ce=fe-oe,ee.push({distance:ce,timestamp:n()}),ee.length>6&&(ee=ee.slice(-6)),oe=h(fe);var le=re().abs;if(le!==Q){var me=Q!==null;Q=le,me&&C.emit("slideChanged")}}function re(fe){var ce=fe?null:function(){if($){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),_t=et+Ze;le&&(ut===-1&&je>ve&&(_t+=$),ut===1&&je<ve&&(_t-=$),K!==null&&_t<K&&(je+=S),j!==null&&_t>j&&(je-=S));var Ht=je+Te[0]+Te[1],_r=Math.max(je>=0&&Ht<=1?1:Ht<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:_t,distance:O.rtl?-1*je+1-Te[0]:je,portion:_r,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 P.details=ce,C.emit("detailsChanged"),ce}return P={absToRel:de,add:ne,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)]}),$=R.length){S=h(R.reduce(function(ue,ge){return ue+ge[0]+ge[1]},0));var le,me=$-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)&&(L=ue.length-1),le=Be,ue},null),M===0&&(L=0),W.push(h(S))}}(),!$)return re(!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):L;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?ne(B(te(fe))):re()},to:Se,velocity:function(){var fe=n(),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 P,S,M,O,R,$,W,L;function F(Q){return 2*Q}function U(Q){return c(Q,W,L)}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,ne=j();O=u(ne);var Y=C.track.details,A=[];if(ne||!Q){var I=J(ne),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>$){var Se=de<R?R-se:$-se,re=0,fe=ne;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=ne*(1-ce)}else A[0].earlyExit=0,re+=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+re,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 ne=147e-9+(Q=Math.abs(Q))/oe;return{dist:Math.pow(Q,2)/ne,dur:Q/ne}}function q(){var Q=C.track.details;Q&&(R=Q.min,$=Q.max,W=Q.minIdx,L=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(),P=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,ne=C.track.details,Y=ne.position,A=u(j());(Y>$||Y<R)&&(A=0);var I=P+A;ne.slides[oe.absToRel(I)].portion===0&&(I-=A),P!==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 P,S,M,O,R,$,W,L,F,U,K,j,z,J,q,ee,Q,oe,ne=l();function Y(re){if($&&L===re.id){var fe=H(re);if(F){if(!B(re))return I(re);U=fe,F=!1,C.emit("dragChecked")}if(ee)return U=fe;i(re);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(re),K+=ce,!j&&Math.abs(K*O)>5&&(j=!0),C.track.add(ce),U=fe,C.emit("dragged")}}function A(re){!$&&C.track.details&&C.track.details.length&&(K=0,$=!0,j=!1,F=!0,L=re.id,B(re),U=H(re),C.emit("dragStarted"))}function I(re){$&&L===re.idChanged&&($=!1,C.emit("dragEnded"))}function B(re){var fe=te(),ce=fe?re.y:re.x,le=fe?re.x:re.y,me=z!==void 0&&J!==void 0&&Math.abs(J-le)<=Math.abs(z-ce);return z=ce,J=le,me}function H(re){return te()?re.y:re.x}function te(){return C.options.vertical}function se(){O=C.size,R=te()?window.innerHeight:window.innerWidth;var re=C.track.details;re&&(Q=re.min,oe=re.max)}function de(re){j&&(a(re),i(re))}function Se(){if(ne.purge(),C.options.drag&&!C.options.disabled){var re;re=C.options.dragSpeed||1,W=typeof re=="function"?re:function(ce){return ce*re},M=C.options.rtl?-1:1,se(),P=C.container,function(){var ce="data-keen-slider-clickable";s("[".concat(ce,"]:not([").concat(ce,"=false])"),P).map(function(le){ne.add(le,"dragstart",a),ne.add(le,"mousedown",a),ne.add(le,"touchstart",a)})}(),ne.add(P,"dragstart",function(ce){i(ce)}),ne.add(P,"click",de,{capture:!0}),ne.input(P,"ksDragStart",A),ne.input(P,"ksDrag",Y),ne.input(P,"ksDragEnd",I),ne.input(P,"mousedown",A),ne.input(P,"mousemove",Y),ne.input(P,"mouseleave",I),ne.input(P,"mouseup",I),ne.input(P,"touchstart",A,{passive:!0}),ne.input(P,"touchmove",Y,{passive:!1}),ne.input(P,"touchend",I),ne.input(P,"touchcancel",I),ne.add(window,"wheel",function(ce){$&&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;ne.input(le,"touchstart",function(ue){me=H(ue),ee=!0,q=!0},{passive:!0}),ne.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}),ne.input(le,"touchend",function(){ee=!1})}(ce)})}}C.on("updated",se),C.on("optionsChanged",Se),C.on("created",Se),C.on("destroyed",ne.purge)}function _(C){var P,S,M=null;function O(z,J,q){C.animator.active?$(z,J,q):requestAnimationFrame(function(){return $(z,J,q)})}function R(){O(!1,!1,S)}function $(z,J,q){var ee=0,Q=C.size,oe=C.track.details;if(oe&&P){var ne=oe.slides;P.forEach(function(Y,A){if(z)!M&&J&&L(Y,null,q),F(Y,null,q);else{if(!ne[A])return;var I=ne[A].size*Q;!M&&J&&L(Y,I,q),F(Y,ne[A].distance*Q-ee,q),ee+=I}})}}function W(z){return C.options.renderMode==="performance"?Math.round(z):z}function L(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(){P&&($(!0,!0,S),P=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),(P=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 E(C,P){return function(S){var M,O,R,$,W,L=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($.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({},P),B),L.purge(),O=S.size,$=[],R.breakpoints||[]){var te=window.matchMedia(H);te.__media=H,$.push(te),L.add(te,"change",U)}L.add(window,"orientationchange",Y),L.add(window,"resize",ne),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),re=f(B,"spacing",0,!0)/S.size||0,fe=Se==="auto"?re:re/Se,ce=f(B,"origin","auto"),le=0,me=0;me<se;me++){var ue=Se==="auto"?j(H[me]):1/Se-re+fe,ge=ce==="center"?.5-ue/2:ce==="auto"?0:ce;de.push({origin:ge,size:ue,spacing:re}),le+=ue}if(le+=re*(se-1),ce==="auto"&&!S.options.loop&&Se!==1){var De=0;de.map(function(Be){var Ze=le-De;return De+=Be.size+re,Ze>=1||(Be.origin=1-Ze-(le>1?0:1-le)),Be})}S.options.trackConfig=de}function ne(){A();var B=S.size;S.options.disabled||B===O||(O=B,Q())}function Y(){ne(),setTimeout(ne,500),setTimeout(ne,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(){L.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,P,S){try{return function(M,O){var R,$={};return R={emit:function(W){$[W]&&$[W].forEach(function(F){F(R)});var L=R.options&&R.options[W];L&&L(R)},moveToIdx:function(W,L,F){var U=R.track.idxToDist(W,L);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,L,F){F===void 0&&(F=!1),$[W]||($[W]=[]);var U=$[W].indexOf(L);U>-1?F&&delete $[W][U]:F||$[W].push(L)},options:M},function(){if(R.track=x(R),R.animator=b(R),O)for(var W=0,L=O;W<L.length;W++)(0,L[W])(R);R.track.init(R.options.initial||0),R.emit("created")}(),R}(P,y([E(C,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),_,k,w],S||[],!0))}catch(M){console.error(M)}};return K1.useKeenSlider=function(C,P){var S=e.useRef(null),M=e.useRef(!1),O=e.useRef(C),R=e.useCallback(function($){$?(O.current=C,S.current=new T($,C,P),M.current=!1):(S.current&&S.current.destroy&&S.current.destroy(),S.current=null)},[]);return e.useEffect(function(){m(O.current,C)||(O.current=C,S.current&&S.current.update(O.current))},[C]),[R,S]},K1}var ORe=MRe();function O7({className:e,onClick:t,children:r}){return p.jsx("div",{className:Ye("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:r})}function rQ({direction:e,isVisible:t,onArrowClick:r}){const n=a=>{a.preventDefault(),r()},o=e==="left"?"left-[-40px]":"right-[-40px]",s=e==="left"?"left-[8px]":"right-[8px]",i=e==="left"?"rotate-90":"-rotate-90";return p.jsx(O7,{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:n,children:p.jsx(It.BlackChevronDown,{})})}function ARe({imagesLength:e,isVisible:t,currentIndex:r,onDotClick:n}){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 ${r===s?"w-4 rounded-3xl bg-black":"bg-[#878787]"}`,onClick:()=>n(s)},s))})})}function jRe({product:e,isHovered:t,isEditing:r}){const{images:n,title:o,slug:s,defaultImageIndex:i}=e,{navigate:a}=td(),[l,c]=g.useState(0),u=[...n],d="https://upload-file-droplinked.s3.amazonaws.com/4a7a9605254cc8d0b64a6b0ee1250c09aa8b476907b67fd9afc1a180f1b6ad17.png";if(i!==void 0&&i>=0&&i<n.length){const x=u[i];u.splice(i,1),u.unshift(x)}const f=u.slice(0,3),[h,m]=ORe.useKeenSlider({loop:!0,slides:{perView:1},mode:"snap",slideChanged:x=>c(x.track.details.rel)});g.useEffect(()=>{!t&&m.current&&(c(0),m.current?.moveToIdx?.(0))},[t]);const v=()=>{a(`product/${s}`)},y=x=>()=>{x()},b=x=>w=>{w.stopPropagation(),m.current?.moveToIdx(x)};return r||!f[0]||f.length===1?p.jsxs("div",{className:"relative overflow-hidden rounded-lg aspect-square cursor-pointer",children:[p.jsx("img",{src:f[0]?.thumbnail||d,alt:f[0]?.alt||o,onClick:v,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"}),p.jsx(nQ,{product:e})]}):p.jsxs("div",{className:"relative overflow-hidden rounded-lg cursor-pointer",children:[p.jsx("div",{ref:h,className:"keen-slider content-start flex overflow-hidden relative touch-pan-y select-none w-full h-full",onClick:v,children:f.map((x,w)=>p.jsx("div",{className:"keen-slider__slide w-full h-full aspect-square flex items-center justify-center",children:p.jsx("img",{src:x.thumbnail,alt:x.alt||`${o}-${w}`,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"})},w))}),p.jsx(nQ,{product:e}),p.jsx(rQ,{direction:"left",isVisible:t,onArrowClick:y(()=>m.current?.prev())}),p.jsx(rQ,{direction:"right",isVisible:t,onArrowClick:y(()=>m.current?.next())}),p.jsx(ARe,{imagesLength:f.length,isVisible:t,onDotClick:b,currentIndex:l})]})}function nQ({product:e}){const{discountRuleset:t,gatedRuleset:r}=e;return p.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-2",children:[t&&p.jsx(O7,{children:p.jsx(It.Discount,{})}),r&&p.jsx(O7,{children:p.jsx(It.Gated,{})})]})}function IRe({product:e,isEditing:t}){const{title:r,lowestPrice:n,id:o,slug:s}=e,[i,a]=g.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(jRe,{product:e,isHovered:i,isEditing:t}),p.jsx(eQ,{title:r,slug:s,className:"mt-3"}),p.jsx(JK,{price:n,slug:s,className:"mt-2"})]})}function $Re(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((r,n)=>p.jsxs("div",{children:[p.jsx(es,{className:`rounded-lg aspect-square ${t}`}),p.jsx(es,{className:`h-10 md:h-12 mt-3 ${t}`}),p.jsx(es,{className:`h-6 mt-2 ${t}`})]},n))})}function LRe({product:e}){const{images:t,title:r,lowestPrice:n,discountRuleset:o,gatedRuleset:s,slug:i,id:a}=e,{isDarkTheme:l}=Je(),c=l?"[&_path]:stroke-white":"",{navigate:u}=td(),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(oQ,{image:p.jsx("img",{src:d,alt:r,className:"w-[70px] h-[70px] object-cover rounded-lg shrink-0"}),title:p.jsx(eQ,{title:r,slug:i}),price:p.jsx(JK,{price:n,slug:i}),icons:p.jsxs(p.Fragment,{children:[o&&p.jsx(It.Discount,{className:c}),s&&p.jsx(It.Gated,{className:c})]})})})}function FRe(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((r,n)=>p.jsx(oQ,{image:p.jsx(es,{className:`w-[70px] h-[70px] rounded-lg shrink-0 ${t}`}),title:p.jsx(es,{className:`h-10 w-1/2 ${t}`}),price:p.jsx(es,{className:`h-6 w-1/4 ${t}`}),icons:p.jsxs(p.Fragment,{children:[p.jsx(es,{className:`w-5 h-5 rounded-full ${t}`}),p.jsx(es,{className:`w-5 h-5 rounded-full ${t}`})]})},n))})}function oQ({image:e,title:t,price:r,icons:n}){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:[r,p.jsx("div",{className:"flex items-center gap-2",children:n})]})]})]})}function sQ(e=768){const[t,r]=g.useState(!1);return g.useEffect(()=>{const n=()=>r(window.innerWidth<e);return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[e]),t}function A7({children:e}){const t=sQ(),r=Or(o=>o.viewMode),n=t?r==="grid"?"grid grid-cols-2 gap-x-4 gap-y-6":"grid grid-cols-1 gap-y-6":`grid
584
+ */const wFe=c7("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),MG=D.forwardRef(({className:e,...t},r)=>p.jsx(l7,{ref:r,className:Ye("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(kG,{className:Ye("flex items-center justify-center text-current"),children:p.jsx(DG,{className:"h-4 w-4"})})}));MG.displayName=l7.displayName;function OG({label:e,count:t,checked:r,onCheckChange:n}){const{isDarkTheme:o}=Je(),s=()=>n(!r),i=Ye("w-5 h-5 border rounded-sm flex items-center justify-center border-shop-textColor",{"border-white bg-white text-black":r&&o,"border-black bg-black text-white":r&&!o}),a=o?"text-subtextPlaceholder-Dark":"text-subtextPlaceholde-Light";return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(MG,{checked:r,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 es({className:e,...t}){return p.jsx("div",{className:Ye("animate-pulse rounded-md bg-muted",e),...t})}function u7(){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((r,n)=>p.jsxs("div",{className:"flex gap-2 items-center animate-pulse",children:[p.jsx(es,{className:Ye("w-5 h-5 rounded-sm",t)}),p.jsx(es,{className:Ye("w-1/2 h-4 flex-1 rounded-md",t)}),p.jsx(es,{className:Ye("w-8 h-4 rounded-md",t)})]},n))})}const AG=g.createContext(void 0);function CFe({children:e,isLoading:t,applyFiltersDirectly:r,data:n}){const{setStagedProductQuery:o,applyStagedFilters:s}=Or(a=>({setStagedProductQuery:a.setStagedProductQuery,applyStagedFilters:a.applyStagedFilters})),i=(a,l)=>{o(a,l),r&&s()};return p.jsx(AG.Provider,{value:{isLoading:t,data:n,applyFiltersDirectly:r,updateFilter:i},children:e})}function d7(){const e=g.useContext(AG);if(!e)throw new Error("useFilterData must be used within a ProductFiltersProvider");return e}function kFe(){const{isLoading:e,data:t,updateFilter:r}=d7(),n=t?.collections??[],[o,s]=g.useState(!1),i=o?n:n.slice(0,3),a=Or(c=>c.stagedProductQuery.collectionId),l=(c,u)=>{const d=u?[...a,c]:a.filter(f=>f!==c);r("collectionId",d)};return e?p.jsx(u7,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[i.map(c=>p.jsx(OG,{label:c.title,count:c.count,checked:a.includes(c._id),onCheckChange:u=>l(c._id,u)},c._id)),n.length>3&&p.jsx(kl,{onClick:()=>s(c=>!c),className:"flex self-center items-center font-medium",iconLeft:p.jsx(It.BlackChevronDown,{className:`text-[#179EF8] ${o?"rotate-180":""}`}),children:o?"Less":"More"})]})}function f7({title:e,children:t}){const{isDarkTheme:r}=Je();return p.jsxs(gG,{value:e,className:"border-b-0",children:[p.jsx(vG,{chevronClassName:r?"[&>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(yG,{className:"flex flex-col mt-4 gap-4 px-3 py-0",children:t})]})}function p7(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function h7(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function z1(e){return e!==null&&e.length===1?e[0]:e.slice()}function H1(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function Pl(e,t){return m7(function(r,n){let o=r;return o<=n.min&&(o=n.min),o>=n.max&&(o=n.max),o}(e,t),t)}function m7(e,t){const r=(e-t.min)%t.step;let n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}let g7=function(e){function t(n){var o;(o=e.call(this,n)||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]),H1(o.getMouseEventMap())})}p7(a)}},o.onSliderClick=a=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){const l=o.getMousePosition(a),c=Pl(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=a=>l=>{o.props.disabled||(o.start(a),H1(o.getKeyDownEventMap()),p7(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]),H1(o.getMouseEventMap()),p7(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]),H1(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:z1(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:z1(o.state.value)};return o.props.renderTrack(u,d)};let s=h7(n.value);s.length||(s=h7(n.defaultValue)),o.pendingResizeTimeouts=[];const i=[];for(let a=0;a<s.length;a+=1)s[a]=Pl(s[a],n),i.push(a);return o.resizeObserver=null,o.resizeElementRef=g.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:s,zIndices:i},o}Ni(t,e);var r=t.prototype;return r.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(n,o){const s=h7(n.value);return s.length?o.pending?null:{value:s.map(i=>Pl(i,n))}:null},r.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},r.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},r.onEnd=function(n){n&&function(o){Object.keys(o).forEach(s=>{typeof document<"u"&&document.removeEventListener(s,o[s],!1)})}(n),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},r.getValue=function(){return z1(this.state.value)},r.getClosestIndex=function(n){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(n-c);u<o&&(o=u,s=l)}return s},r.getMousePosition=function(n){return[n["page"+this.axisKey()],n["page"+this.orthogonalAxisKey()]]},r.getTouchPosition=function(n){const o=n.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},r.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},r.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},r.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},r.getValueFromPosition=function(n){const o=n/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return Pl(this.state.startValue+o,this.props)},r.getDiffPosition=function(n){let o=n-this.state.startPosition;return this.props.invert&&(o*=-1),o},r.resize=function(){const{slider:n,thumb0:o}=this;if(!n||!o)return;const s=this.sizeKey(),i=n.getBoundingClientRect(),a=n[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})},r.calcOffset=function(n){const o=this.props.max-this.props.min;return o===0?0:(n-this.props.min)/o*this.state.upperBound},r.calcValue=function(n){return n/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},r.calcOffsetFromPosition=function(n){const{slider:o}=this,s=o.getBoundingClientRect(),i=s[this.posMaxKey()],a=s[this.posMinKey()];let l=n-(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},r.forceValueFromPosition=function(n,o){const s=this.calcOffsetFromPosition(n),i=this.getClosestIndex(s),a=Pl(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")})},r.clearPendingResizeTimeouts=function(){do{const n=this.pendingResizeTimeouts.shift();clearTimeout(n)}while(this.pendingResizeTimeouts.length)},r.start=function(n,o){const s=this["thumb"+n];s&&s.focus();const{zIndices:i}=this.state;i.splice(i.indexOf(n),1),i.push(n),this.setState(a=>({startValue:a.value[n],startPosition:o!==void 0?o:a.startPosition,index:n,zIndices:i}))},r.moveUpByStep=function(n){n===void 0&&(n=this.props.step);const o=this.state.value[this.state.index],s=Pl(this.props.invert&&this.props.orientation==="horizontal"?o-n:o+n,this.props);this.move(Math.min(s,this.props.max))},r.moveDownByStep=function(n){n===void 0&&(n=this.props.step);const o=this.state.value[this.state.index],s=Pl(this.props.invert&&this.props.orientation==="horizontal"?o+n:o-n,this.props);this.move(Math.max(s,this.props.min))},r.move=function(n){const o=this.state.value.slice(),{index:s}=this.state,{length:i}=o,a=o[s];if(n===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];n<f+d&&(n=f+d)}if(s<i-1){const f=o[s+1];n>f-d&&(n=f-d)}}o[s]=n,l&&i>1&&(n>a?(this.pushSucceeding(o,d,s),function(f,h,m,v){for(let y=0;y<f;y+=1){const b=v-y*m;h[f-1-y]>b&&(h[f-1-y]=b)}}(i,o,d,c)):n<a&&(this.pushPreceding(o,d,s),function(f,h,m,v){for(let y=0;y<f;y+=1){const b=v+y*m;h[y]<b&&(h[y]=b)}}(i,o,d,u))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},r.pushSucceeding=function(n,o,s){let i,a;for(i=s,a=n[i]+o;n[i+1]!==null&&a>n[i+1];i+=1,a=n[i]+o)n[i+1]=m7(a,this.props)},r.pushPreceding=function(n,o,s){for(let i=s,a=n[i]-o;n[i-1]!==null&&a<n[i-1];i-=1,a=n[i]-o)n[i-1]=m7(a,this.props)},r.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},r.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},r.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},r.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},r.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},r.fireChangeEvent=function(n){this.props[n]&&this.props[n](z1(this.state.value),this.state.index)},r.buildThumbStyle=function(n,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()]=n+"px",s},r.buildTrackStyle=function(n,o){const s={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return s[this.posMinKey()]=n,s[this.posMaxKey()]=o,s},r.buildMarkStyle=function(n){var o;return(o={position:"absolute"})[this.posMinKey()]=n,o},r.renderThumbs=function(n){const{length:o}=n,s=[];for(let a=0;a<o;a+=1)s[a]=this.buildThumbStyle(n[a],a);const i=[];for(let a=0;a<o;a+=1)i[a]=this.renderThumb(s[a],a);return i},r.renderTracks=function(n){const o=[],s=n.length-1;o.push(this.renderTrack(0,0,n[0]));for(let i=0;i<s;i+=1)o.push(this.renderTrack(i+1,n[i],n[i+1]));return o.push(this.renderTrack(s+1,n[s],this.state.upperBound)),o},r.renderMarks=function(){let{marks:n}=this.props;const o=this.props.max-this.props.min+1;return typeof n=="boolean"?n=Array.from({length:o}).map((s,i)=>i):typeof n=="number"&&(n=Array.from({length:o}).map((s,i)=>i).filter(s=>s%n==0)),n.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)})},r.render=function(){const n=[],{value:o}=this.state,s=o.length;for(let c=0;c<s;c+=1)n[c]=this.calcOffset(o[c],c);const i=this.props.withTracks?this.renderTracks(n):null,a=this.renderThumbs(n),l=this.props.marks?this.renderMarks():null;return g.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}(g.Component);g7.displayName="ReactSlider",g7.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=>g.createElement("div",e),renderTrack:e=>g.createElement("div",e),renderMark:e=>g.createElement("span",e)};var SFe=g7;const _Fe={USD:p.jsx(It.DollarSign,{}),AUD:p.jsx(It.DollarSign,{}),CAD:p.jsx(It.CAD,{}),GBP:p.jsx(It.GBP,{}),AED:p.jsx(It.AED,{}),CNY:p.jsx(It.CNY,{}),JPY:p.jsx(It.JPY,{}),EUR:p.jsx(It.EUR,{})};function EFe({currencyCode:e,className:t}){return p.jsx("div",{className:t,children:_Fe[e]??p.jsx(It.DollarSign,{})})}function PFe({isFocused:e,isDarkTheme:t,textColorParagraphs:r}){const n=qh("flex flex-1 items-center gap-2 px-4 py-3 rounded-lg border",{"border-black":e&&!t,"border-white":e&&t,[`border-[${r}]`]:!e}),o=qh("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=qh("shrink-0",{"[&_path]:stroke-[#B1B1B1]":!e&&!t,"[&_path]:stroke-[#7B7B7B]":!e&&t,"[&_path]:stroke-white":e&&t,"[&_path]:stroke-black":e&&!t});return{containerClassName:n,inputClassName:o,iconClassName:s}}function jG({value:e,placeholder:t,onValueChange:r,...n}){const{states:{shop:{currency:o,shopDesign:{fontfamily:s,textColorParagraphs:i}}}}=In(),{isDarkTheme:a}=Je(),[l,c]=g.useState(!1),{containerClassName:u,iconClassName:d,inputClassName:f}=PFe({isFocused:l,isDarkTheme:a,textColorParagraphs:i});return p.jsxs("div",{className:u,children:[p.jsx(EFe,{currencyCode:o.abbreviation,className:d}),p.jsx("input",{type:"number",className:` !font-shopfont ${f}`,value:e??"",placeholder:t,onChange:({target:{validity:h,value:m}})=>{h.valid&&r(m===""?"":+m)},onKeyDown:h=>{["+","-","e","."].includes(h.key)&&h.preventDefault()},onFocus:()=>c(!0),onBlur:()=>c(!1),...n})]})}const v7=(e,t=500)=>{const[r,n]=g.useState(e);return g.useEffect(()=>{const o=setTimeout(()=>n(e),t);return()=>clearTimeout(o)},[e,t]),r};function TFe(){const{states:{shop:{currency:e}}}=In(),{isLoading:t,data:r}=d7(),{isDarkTheme:n}=Je(),{min:o=0,max:s=1e5}=r?.price?{min:Math.floor(+my(r.price.min,e?.conversionRateToUSD)),max:Math.ceil(+my(r.price.max,e?.conversionRateToUSD))}:{},{minPrice:i,maxPrice:a,setStagedProductQuery:l,applyStagedFilters:c}=Or(m=>({minPrice:m.stagedProductQuery.minPrice,maxPrice:m.stagedProductQuery.maxPrice,setStagedProductQuery:m.setStagedProductQuery,applyStagedFilters:m.applyStagedFilters})),u=v7(i,300),d=v7(a,300);g.useEffect(()=>{if(typeof u=="number"&&typeof d=="number"&&u>d){l("minPrice",d),l("maxPrice",u);return}c()},[u,d,c,l]);const f=m=>{if(m===""){l("minPrice",void 0);return}typeof m=="number"&&l("minPrice",m)},h=m=>{if(m===""){l("maxPrice",void 0);return}typeof m=="number"&&l("maxPrice",m)};return t?p.jsx(u7,{}):p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(jG,{value:i??"",placeholder:o.toString(),onValueChange:f,min:o}),p.jsx(It.Separator,{className:"shrink-0"}),p.jsx(jG,{value:a??"",placeholder:s.toString(),onValueChange:h,max:s})]}),p.jsx(SFe,{className:"price-range-slider",thumbClassName:n?"dark-price-range-slider__thumb":"price-range-slider__thumb",trackClassName:n?"dark-price-range-slider__track":"price-range-slider__track",value:[i??o,a??s],renderThumb:m=>p.jsx("div",{...m}),minDistance:1,onChange:([m,v])=>{l("minPrice",m),l("maxPrice",v)},min:o,max:s})]})}function DFe(){const{isLoading:e,data:t,updateFilter:r}=d7(),n=Or(s=>s.stagedProductQuery.productTypes);if(e)return p.jsx(u7,{});const o=(s,i)=>{const a=i?[...n,s]:n.filter(l=>l!==s);r("productTypes",a)};return p.jsx("div",{className:"space-y-4",children:t?.types.map((s,i)=>p.jsx(OG,{label:s.label,count:s.count,checked:n.includes(s.value),onCheckChange:a=>o(s.value,a)},i))})}const MFe=({shopName:e})=>v1.get(`/shops/v2/public/name/${e}`),OFe=e=>v1.get(`/product-v2/available/filters/${e}`).then(t=>t.data);function AFe(){const{states:{shop:e}}=In();return Fq({queryFn:()=>OFe(e.url),refetchOnWindowFocus:!1})}function IG({className:e,applyFiltersDirectly:t=!0}){const{isLoading:r,data:n,isError:o}=AFe();return o?p.jsx(ct,{className:`${e} text-[#dc2626]`,children:"An error occurred while fetching product filters. Please try again later."}):p.jsx(CFe,{isLoading:r,applyFiltersDirectly:t,data:n?.data,children:p.jsx(jFe,{className:e})})}function jFe({className:e}){return p.jsxs(cFe,{type:"multiple",className:Ye("flex flex-col gap-6",e),children:[p.jsx(f7,{title:"Type",children:p.jsx(DFe,{})}),p.jsx(f7,{title:"Collection",children:p.jsx(kFe,{})}),p.jsx(f7,{title:"Price",children:p.jsx(TFe,{})})]})}const IFe=(e,t="filled")=>{const{"--dlk-comps":{"--dlk-comps-btn":{"--dlk-comps-btn-styles":r,"--dlk-comps-btn-fill":{"--dlk-comps-btn-fill-styles":n,"--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={...r};return t==="filled"&&n?a={...a,...n,...o}:t==="outline"&&s&&(a={...a,...s,...i}),a};function $G({variant:e="filled",children:t,...r}){const{states:{shop:{template_options:n,shopDesign:o}}}=In(),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(cg,{...s[e],...IFe(n,e),...r,children:t})}function LG(){const{isDarkTheme:e,shopDesign:{textColorParagraphs:t}}=Je(),r=Or(o=>o.applyStagedFilters),n=Or(o=>o.resetProductQuery);return p.jsxs(RY,{children:[p.jsxs(BY,{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(It.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(U4,{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(q4,{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(IG,{applyFiltersDirectly:!1,className:"p-4 pb-9 md:p-9"})}),p.jsxs(zY,{className:`flex flex-row gap-4 p-4 md:px-9 md:py-6 border-t border-[${t}]`,children:[p.jsx(W4,{asChild:!0,children:p.jsx($G,{fontSize:14,fontWeight:500,variant:"outline",onClick:n,children:"Reset"})}),p.jsx(W4,{asChild:!0,children:p.jsx($G,{flex:1,fontSize:14,fontWeight:500,onClick:r,children:"Apply Filters"})})]})]})]})}function FG(){const{isDarkTheme:e}=Je(),t=g.useRef(null),r=Or(a=>a.stagedProductQuery.search),n=Or(a=>a.setStagedProductQuery),o=Or(a=>a.applyStagedFilters),s=v7(r);g.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(It.Search,{className:`shrink-0 ${e?"[&>path]:stroke-white":""}`}),p.jsx("input",{ref:t,type:"text",value:r,onChange:a=>n("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(It.SearchInputIcon,{className:`${e?"[&>path]:fill-[#292929]":""}`})})]})}var $Fe="Arrow",NG=D.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return p.jsx(Ot.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});NG.displayName=$Fe;var LFe=NG,y7="Popper",[RG,BG]=wi(y7),[FFe,VG]=RG(y7),zG=e=>{const{__scopePopper:t,children:r}=e,[n,o]=D.useState(null);return p.jsx(FFe,{scope:t,anchor:n,onAnchorChange:o,children:r})};zG.displayName=y7;var HG="PopperAnchor",WG=D.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=VG(HG,r),i=D.useRef(null),a=fr(t,i);return D.useEffect(()=>{s.onAnchorChange(n?.current||i.current)}),n?null:p.jsx(Ot.div,{...o,ref:a})});WG.displayName=HG;var b7="PopperContent",[NFe,RFe]=RG(b7),UG=D.forwardRef((e,t)=>{const{__scopePopper:r,side:n="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:m,...v}=e,y=VG(b7,r),[b,x]=D.useState(null),w=fr(t,ne=>x(ne)),[k,_]=D.useState(null),E=bG(k),T=E?.width??0,C=E?.height??0,P=n+(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(VFe),altBoundary:O},{refs:$,floatingStyles:W,placement:L,isPositioned:F,middlewareData:U}=iW({strategy:"fixed",placement:P,whileElementsMounted:(...ne)=>rW(...ne,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[aW({mainAxis:o+C,alignmentAxis:i}),l&&lDe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?cDe():void 0,...R}),l&&lW({...R}),uDe({...R,apply:({elements:ne,rects:Y,availableWidth:A,availableHeight:I})=>{const{width:B,height:H}=Y.reference,te=ne.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&&cW({element:k,padding:a}),zFe({arrowWidth:T,arrowHeight:C}),f&&dDe({strategy:"referenceHidden",...R})]}),[K,j]=GG(L),z=ki(m);Ci(()=>{F&&z?.()},[F,z]);const J=U.arrow?.x,q=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[Q,oe]=D.useState();return Ci(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:$.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(NFe,{scope:r,placedSide:K,onArrowChange:_,arrowX:J,arrowY:q,shouldHideArrow:ee,children:p.jsx(Ot.div,{"data-side":K,"data-align":j,...v,ref:w,style:{...v.style,animation:F?void 0:"none"}})})})});UG.displayName=b7;var qG="PopperArrow",BFe={top:"bottom",right:"left",bottom:"top",left:"right"},YG=D.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=RFe(qG,n),i=BFe[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(LFe,{...o,ref:r,style:{...o.style,display:"block"}})})});YG.displayName=qG;function VFe(e){return e!==null}var zFe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=GG(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+l/2;let m="",v="";return c==="bottom"?(m=i?d:`${f}px`,v=`${-l}px`):c==="top"?(m=i?d:`${f}px`,v=`${n.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=i?d:`${h}px`):c==="left"&&(m=`${n.floating.width+l}px`,v=i?d:`${h}px`),{data:{x:m,y:v}}}});function GG(e){const[t,r="center"]=e.split("-");return[t,r]}var HFe=zG,WFe=WG,UFe=UG,qFe=YG,x7="rovingFocusGroup.onEntryFocus",YFe={bubbles:!1,cancelable:!0},_h="RovingFocusGroup",[w7,KG,GFe]=X4(_h),[KFe,QG]=wi(_h,[GFe]),[QFe,ZFe]=KFe(_h),ZG=D.forwardRef((e,t)=>p.jsx(w7.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(w7.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(XFe,{...e,ref:t})})}));ZG.displayName=_h;var XFe=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=D.useRef(null),h=fr(t,f),m=r7(s),[v,y]=_l({prop:i,defaultProp:a??null,onChange:l,caller:_h}),[b,x]=D.useState(!1),w=ki(c),k=KG(r),_=D.useRef(!1),[E,T]=D.useState(0);return D.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(x7,w),()=>C.removeEventListener(x7,w)},[w]),p.jsx(QFe,{scope:r,orientation:n,dir:m,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(Ot.div,{tabIndex:b||E===0?-1:0,"data-orientation":n,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{_.current=!0}),onFocus:Ve(e.onFocus,C=>{const P=!_.current;if(C.target===C.currentTarget&&P&&!b){const S=new CustomEvent(x7,YFe);if(C.currentTarget.dispatchEvent(S),!S.defaultPrevented){const M=k().filter(L=>L.focusable),O=M.find(L=>L.active),R=M.find(L=>L.id===v),W=[O,R,...M].filter(Boolean).map(L=>L.ref.current);eK(W,u)}}_.current=!1}),onBlur:Ve(e.onBlur,()=>x(!1))})})}),XG="RovingFocusGroupItem",JG=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=ma(),c=s||l,u=ZFe(XG,r),d=u.currentTabStopId===c,f=KG(r),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:v}=u;return D.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),p.jsx(w7.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:p.jsx(Ot.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ve(e.onMouseDown,y=>{n?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=tNe(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?rNe(w,k+1):w.slice(k+1)}setTimeout(()=>eK(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:v!=null}):i})})});JG.displayName=XG;var JFe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eNe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tNe(e,t,r){const n=eNe(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return JFe[n]}function eK(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function rNe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var nNe=ZG,oNe=JG,C7=["Enter"," "],sNe=["ArrowDown","PageUp","Home"],tK=["ArrowUp","PageDown","End"],iNe=[...sNe,...tK],aNe={ltr:[...C7,"ArrowRight"],rtl:[...C7,"ArrowLeft"]},lNe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Eh="Menu",[Ph,cNe,uNe]=X4(Eh),[Tl,rK]=wi(Eh,[uNe,BG,QG]),W1=BG(),nK=QG(),[dNe,Dl]=Tl(Eh),[fNe,Th]=Tl(Eh),oK=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:s,modal:i=!0}=e,a=W1(t),[l,c]=D.useState(null),u=D.useRef(!1),d=ki(s),f=r7(o);return D.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),p.jsx(HFe,{...a,children:p.jsx(dNe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:c,children:p.jsx(fNe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:n})})})};oK.displayName=Eh;var pNe="MenuAnchor",k7=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=W1(r);return p.jsx(WFe,{...o,...n,ref:t})});k7.displayName=pNe;var S7="MenuPortal",[hNe,sK]=Tl(S7,{forceMount:void 0}),iK=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,s=Dl(S7,t);return p.jsx(hNe,{scope:t,forceMount:r,children:p.jsx(Vs,{present:r||s.open,children:p.jsx(R4,{asChild:!0,container:o,children:n})})})};iK.displayName=S7;var So="MenuContent",[mNe,_7]=Tl(So),aK=D.forwardRef((e,t)=>{const r=sK(So,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Dl(So,e.__scopeMenu),i=Th(So,e.__scopeMenu);return p.jsx(Ph.Provider,{scope:e.__scopeMenu,children:p.jsx(Vs,{present:n||s.open,children:p.jsx(Ph.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(gNe,{...o,ref:t}):p.jsx(vNe,{...o,ref:t})})})})}),gNe=D.forwardRef((e,t)=>{const r=Dl(So,e.__scopeMenu),n=D.useRef(null),o=fr(t,n);return D.useEffect(()=>{const s=n.current;if(s)return Vw(s)},[]),p.jsx(E7,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vNe=D.forwardRef((e,t)=>{const r=Dl(So,e.__scopeMenu);return p.jsx(E7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),yNe=rd("MenuContent.ScrollLock"),E7=D.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...v}=e,y=Dl(So,r),b=Th(So,r),x=W1(r),w=nK(r),k=cNe(r),[_,E]=D.useState(null),T=D.useRef(null),C=fr(t,T,y.onContentChange),P=D.useRef(0),S=D.useRef(""),M=D.useRef(0),O=D.useRef(null),R=D.useRef("right"),$=D.useRef(0),W=m?Eg:D.Fragment,L=m?{as:yNe,allowPinchZoom:!0}:void 0,F=K=>{const j=S.current+K,z=k().filter(ne=>!ne.disabled),J=document.activeElement,q=z.find(ne=>ne.ref.current===J)?.textValue,ee=z.map(ne=>ne.textValue),Q=MNe(ee,j,q),oe=z.find(ne=>ne.textValue===Q)?.ref.current;(function ne(Y){S.current=Y,window.clearTimeout(P.current),Y!==""&&(P.current=window.setTimeout(()=>ne(""),1e3))})(j),oe&&setTimeout(()=>oe.focus())};D.useEffect(()=>()=>window.clearTimeout(P.current),[]),gY();const U=D.useCallback(K=>R.current===O.current?.side&&ANe(K,O.current?.area),[]);return p.jsx(mNe,{scope:r,searchRef:S,onItemEnter:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),onItemLeave:D.useCallback(K=>{U(K)||(T.current?.focus(),E(null))},[U]),onTriggerLeave:D.useCallback(K=>{U(K)&&K.preventDefault()},[U]),pointerGraceTimerRef:M,onPointerGraceIntentChange:D.useCallback(K=>{O.current=K},[]),children:p.jsx(W,{...L,children:p.jsx(N4,{asChild:!0,trapped:o,onMountAutoFocus:Ve(s,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx($4,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:p.jsx(nNe,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:_,onCurrentTabStopIdChange:E,onEntryFocus:Ve(l,K=>{b.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(UFe,{role:"menu","aria-orientation":"vertical","data-state":SK(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||!iNe.includes(K.key))return;K.preventDefault();const oe=k().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);tK.includes(K.key)&&oe.reverse(),TNe(oe)}),onBlur:Ve(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(P.current),S.current="")}),onPointerMove:Ve(e.onPointerMove,Mh(K=>{const j=K.target,z=$.current!==K.clientX;if(K.currentTarget.contains(j)&&z){const J=K.clientX>$.current?"right":"left";R.current=J,$.current=K.clientX}}))})})})})})})});aK.displayName=So;var bNe="MenuGroup",P7=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(Ot.div,{role:"group",...n,ref:t})});P7.displayName=bNe;var xNe="MenuLabel",lK=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(Ot.div,{...n,ref:t})});lK.displayName=xNe;var U1="MenuItem",cK="menu.itemSelect",q1=D.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,s=D.useRef(null),i=Th(U1,e.__scopeMenu),a=_7(U1,e.__scopeMenu),l=fr(t,s),c=D.useRef(!1),u=()=>{const d=s.current;if(!r&&d){const f=new CustomEvent(cK,{bubbles:!0,cancelable:!0});d.addEventListener(cK,h=>n?.(h),{once:!0}),iY(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return p.jsx(uK,{...o,ref:l,disabled:r,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!=="";r||f&&d.key===" "||C7.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});q1.displayName=U1;var uK=D.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...s}=e,i=_7(U1,r),a=nK(r),l=D.useRef(null),c=fr(t,l),[u,d]=D.useState(!1),[f,h]=D.useState("");return D.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[s.children]),p.jsx(Ph.ItemSlot,{scope:r,disabled:n,textValue:o??f,children:p.jsx(oNe,{asChild:!0,...a,focusable:!n,children:p.jsx(Ot.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:c,onPointerMove:Ve(e.onPointerMove,Mh(m=>{n?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ve(e.onPointerLeave,Mh(m=>i.onItemLeave(m))),onFocus:Ve(e.onFocus,()=>d(!0)),onBlur:Ve(e.onBlur,()=>d(!1))})})})}),wNe="MenuCheckboxItem",dK=D.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return p.jsx(gK,{scope:e.__scopeMenu,checked:r,children:p.jsx(q1,{role:"menuitemcheckbox","aria-checked":Y1(r)?"mixed":r,...o,ref:t,"data-state":D7(r),onSelect:Ve(o.onSelect,()=>n?.(Y1(r)?!0:!r),{checkForDefaultPrevented:!1})})})});dK.displayName=wNe;var fK="MenuRadioGroup",[CNe,kNe]=Tl(fK,{value:void 0,onValueChange:()=>{}}),pK=D.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,s=ki(n);return p.jsx(CNe,{scope:e.__scopeMenu,value:r,onValueChange:s,children:p.jsx(P7,{...o,ref:t})})});pK.displayName=fK;var hK="MenuRadioItem",mK=D.forwardRef((e,t)=>{const{value:r,...n}=e,o=kNe(hK,e.__scopeMenu),s=r===o.value;return p.jsx(gK,{scope:e.__scopeMenu,checked:s,children:p.jsx(q1,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":D7(s),onSelect:Ve(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});mK.displayName=hK;var T7="MenuItemIndicator",[gK,SNe]=Tl(T7,{checked:!1}),vK=D.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,s=SNe(T7,r);return p.jsx(Vs,{present:n||Y1(s.checked)||s.checked===!0,children:p.jsx(Ot.span,{...o,ref:t,"data-state":D7(s.checked)})})});vK.displayName=T7;var _Ne="MenuSeparator",yK=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(Ot.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});yK.displayName=_Ne;var ENe="MenuArrow",bK=D.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=W1(r);return p.jsx(qFe,{...o,...n,ref:t})});bK.displayName=ENe;var PNe="MenuSub",[cWe,xK]=Tl(PNe),Dh="MenuSubTrigger",wK=D.forwardRef((e,t)=>{const r=Dl(Dh,e.__scopeMenu),n=Th(Dh,e.__scopeMenu),o=xK(Dh,e.__scopeMenu),s=_7(Dh,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(k7,{asChild:!0,...c,children:p.jsx(uK,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":SK(r.open),...e,ref:T1(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ve(e.onPointerMove,Mh(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:Ve(e.onPointerLeave,Mh(d=>{u();const f=r.content?.getBoundingClientRect();if(f){const h=r.content?.dataset.side,m=h==="right",v=m?-5:5,y=f[m?"left":"right"],b=f[m?"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===" "||aNe[n.dir].includes(d.key)&&(r.onOpenChange(!0),r.content?.focus(),d.preventDefault())})})})});wK.displayName=Dh;var CK="MenuSubContent",kK=D.forwardRef((e,t)=>{const r=sK(So,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Dl(So,e.__scopeMenu),i=Th(So,e.__scopeMenu),a=xK(CK,e.__scopeMenu),l=D.useRef(null),c=fr(t,l);return p.jsx(Ph.Provider,{scope:e.__scopeMenu,children:p.jsx(Vs,{present:n||s.open,children:p.jsx(Ph.Slot,{scope:e.__scopeMenu,children:p.jsx(E7,{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=lNe[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});kK.displayName=CK;function SK(e){return e?"open":"closed"}function Y1(e){return e==="indeterminate"}function D7(e){return Y1(e)?"indeterminate":e?"checked":"unchecked"}function TNe(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function DNe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function MNe(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=DNe(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function ONe(e,t){const{x:r,y:n}=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>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function ANe(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return ONe(r,t)}function Mh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jNe=oK,INe=k7,$Ne=iK,LNe=aK,FNe=P7,NNe=lK,RNe=q1,BNe=dK,VNe=pK,zNe=mK,HNe=vK,WNe=yK,UNe=bK,qNe=wK,YNe=kK,G1="DropdownMenu",[GNe,uWe]=wi(G1,[rK]),pn=rK(),[KNe,_K]=GNe(G1),EK=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=pn(t),c=D.useRef(null),[u,d]=_l({prop:o,defaultProp:s??!1,onChange:i,caller:G1});return p.jsx(KNe,{scope:t,triggerId:ma(),triggerRef:c,contentId:ma(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:a,children:p.jsx(jNe,{...l,open:u,onOpenChange:d,dir:n,modal:a,children:r})})};EK.displayName=G1;var PK="DropdownMenuTrigger",TK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,s=_K(PK,r),i=pn(r);return p.jsx(INe,{asChild:!0,...i,children:p.jsx(Ot.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":n?"":void 0,disabled:n,...o,ref:T1(t,s.triggerRef),onPointerDown:Ve(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Ve(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});TK.displayName=PK;var QNe="DropdownMenuPortal",DK=e=>{const{__scopeDropdownMenu:t,...r}=e,n=pn(t);return p.jsx($Ne,{...n,...r})};DK.displayName=QNe;var MK="DropdownMenuContent",OK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=_K(MK,r),s=pn(r),i=D.useRef(!1);return p.jsx(LNe,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...n,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)"}})});OK.displayName=MK;var ZNe="DropdownMenuGroup",XNe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(FNe,{...o,...n,ref:t})});XNe.displayName=ZNe;var JNe="DropdownMenuLabel",AK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(NNe,{...o,...n,ref:t})});AK.displayName=JNe;var eRe="DropdownMenuItem",jK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(RNe,{...o,...n,ref:t})});jK.displayName=eRe;var tRe="DropdownMenuCheckboxItem",IK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(BNe,{...o,...n,ref:t})});IK.displayName=tRe;var rRe="DropdownMenuRadioGroup",nRe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(VNe,{...o,...n,ref:t})});nRe.displayName=rRe;var oRe="DropdownMenuRadioItem",$K=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(zNe,{...o,...n,ref:t})});$K.displayName=oRe;var sRe="DropdownMenuItemIndicator",LK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(HNe,{...o,...n,ref:t})});LK.displayName=sRe;var iRe="DropdownMenuSeparator",FK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(WNe,{...o,...n,ref:t})});FK.displayName=iRe;var aRe="DropdownMenuArrow",lRe=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(UNe,{...o,...n,ref:t})});lRe.displayName=aRe;var cRe="DropdownMenuSubTrigger",NK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(qNe,{...o,...n,ref:t})});NK.displayName=cRe;var uRe="DropdownMenuSubContent",RK=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=pn(r);return p.jsx(YNe,{...o,...n,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)"}})});RK.displayName=uRe;var dRe=EK,fRe=TK,pRe=DK,BK=OK,VK=AK,zK=jK,HK=IK,WK=$K,UK=LK,qK=FK,YK=NK,GK=RK;const hRe=dRe,mRe=fRe,gRe=D.forwardRef(({className:e,inset:t,children:r,...n},o)=>p.jsxs(YK,{ref:o,className:Ye("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),...n,children:[r,p.jsx(xFe,{className:"ml-auto"})]}));gRe.displayName=YK.displayName;const vRe=D.forwardRef(({className:e,...t},r)=>p.jsx(GK,{ref:r,className:Ye("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}));vRe.displayName=GK.displayName;const KK=D.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(pRe,{children:p.jsx(BK,{ref:n,sideOffset:t,className:Ye("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),...r})}));KK.displayName=BK.displayName;const QK=D.forwardRef(({className:e,inset:t,...r},n)=>p.jsx(zK,{ref:n,className:Ye("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),...r}));QK.displayName=zK.displayName;const yRe=D.forwardRef(({className:e,children:t,checked:r,...n},o)=>p.jsxs(HK,{ref:o,className:Ye("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:r,...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(UK,{children:p.jsx(DG,{className:"h-4 w-4"})})}),t]}));yRe.displayName=HK.displayName;const bRe=D.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(WK,{ref:n,className:Ye("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),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(UK,{children:p.jsx(wFe,{className:"h-2 w-2 fill-current"})})}),t]}));bRe.displayName=WK.displayName;const xRe=D.forwardRef(({className:e,inset:t,...r},n)=>p.jsx(VK,{ref:n,className:Ye("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));xRe.displayName=VK.displayName;const wRe=D.forwardRef(({className:e,...t},r)=>p.jsx(qK,{ref:r,className:Ye("-mx-1 my-1 h-px bg-muted",e),...t}));wRe.displayName=qK.displayName;const M7=[{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 CRe(){const{setStagedProductQuery:e,applyStagedFilters:t}=Or(n=>({setStagedProductQuery:n.setStagedProductQuery,applyStagedFilters:n.applyStagedFilters}));function r(n,o){n==="default"?(e("sortBy",""),e("order",void 0)):(e("sortBy",n),e("order",o)),t()}return r}function ZK({option:e}){const{stagedSortOption:t,stagedSortOrder:r}=Or(c=>({stagedSortOption:c.stagedProductQuery.sortBy,stagedSortOrder:c.stagedProductQuery.order})),n=CRe(),{isDarkTheme:o}=Je(),i=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";return p.jsxs("button",{onClick:()=>n(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 kRe(){const{isDarkTheme:e}=Je(),{stagedSortOption:t,stagedSortOrder:r}=Or(o=>({stagedSortOption:o.stagedProductQuery.sortBy,stagedSortOrder:o.stagedProductQuery.order})),n=()=>{const o=M7.find(i=>i.value===t&&i.sortOrder===r);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(hRe,{children:[p.jsxs(mRe,{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:n()}),p.jsx(It.GrayChevronDown,{})]}),p.jsx(KK,{className:`my-2 flex w-[250px] flex-col gap-2 rounded-lg border-none p-3 ${e?"bg-black":"bg-white"} `,children:M7.map((o,s)=>p.jsx(QK,{className:"p-0",children:p.jsx(ZK,{option:o})},s))})]})}function SRe({showSearchBar:e,showSort:t,showFilters:r}){return p.jsxs("div",{className:"hidden md:flex justify-between",children:[p.jsxs("div",{className:"flex gap-4",children:[r&&p.jsx(LG,{}),e&&p.jsx(FG,{})]}),t&&p.jsx(kRe,{})]})}function XK({onClick:e,children:t}){const{shopDesign:{textColorParagraphs:r}}=Je();return p.jsx("button",{onClick:e,className:`flex items-center justify-center w-10 h-10 border rounded-lg border-[${r}]`,children:t})}function _Re({onClick:e}){const{isDarkTheme:t}=Je(),r=t?"[&>path]:stroke-white":"";return p.jsx(XK,{onClick:e,children:p.jsx(It.Search,{className:r})})}function ERe(){const{isDarkTheme:e}=Je();return p.jsxs(RY,{children:[p.jsx(BY,{className:"flex items-center justify-center w-10 h-10 border rounded-lg lg:hidden border-shop-textColor",children:p.jsx(It.Sort,{className:`shrink-0 ${e?"[&_path]:stroke-white":""}`})}),p.jsxs(U4,{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(q4,{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:M7.map((t,r)=>p.jsx(W4,{children:p.jsx(ZK,{option:t})},r))})]})]})}function PRe({showSearchBar:e,showSort:t,showFilters:r}){const[n,o]=g.useState(!1),s=g.useRef(null);return g.useEffect(()=>{const i=a=>{s.current&&!s.current.contains(a.target)&&o(!1)};return n?document.addEventListener("mousedown",i):document.removeEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[n]),p.jsx(p.Fragment,{children:n?p.jsx("div",{className:"md:hidden",ref:s,children:p.jsx(FG,{})}):p.jsxs("div",{className:"flex justify-between md:hidden",children:[p.jsxs("div",{className:"flex gap-2",children:[r&&p.jsx(LG,{}),e&&p.jsx(_Re,{onClick:()=>o(!0)})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(TRe,{}),t&&p.jsx(ERe,{})]})]})})}function TRe(){const{isDarkTheme:e}=Je(),{viewMode:t,setViewMode:r}=Or(s=>({viewMode:s.viewMode,setViewMode:s.setViewMode})),n=t==="grid",o=e?"[&_path]:stroke-white":"";return p.jsx(XK,{onClick:()=>r(n?"list":"grid"),children:n?p.jsx(It.ListView,{className:o}):p.jsx(It.GridView,{className:o})})}function DRe({showSearchBar:e,showSort:t,showFilters:r}){return p.jsxs(p.Fragment,{children:[p.jsx(SRe,{showSearchBar:e,showSort:t,showFilters:r}),p.jsx(PRe,{showSearchBar:e,showSort:t,showFilters:r})]})}const JK=({price:e,slug:t,className:r})=>{const{isDarkTheme:n}=Je(),{navigate:o}=td(),{states:{shop:{currency:s,tokenBasedPricing:i}}}=In(),a="text-base md:text-[18px] cursor-pointer",l=n?"#7B7B7B":"#B1B1B1",c=()=>o(`product/${t}`);return i?.hasTokenBasedPricing?p.jsxs("div",{className:Ye("flex",a,r),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:Ye("font-medium",a,r),onClick:c,children:[eY(+e,s),p.jsx("span",{className:Ye(`text-[${l}]`,"font-normal"),children:s?.abbreviation})]})};function eQ({title:e,slug:t,className:r}){const{navigate:n}=td();return p.jsx(ct,{as:"h3",onClick:()=>n(`product/${t}`),className:Ye("h-10 md:h-12 text-sm md:text-base font-normal line-clamp-2 cursor-pointer",r),children:e})}var K1={},tQ;function MRe(){if(tQ)return K1;tQ=1,Object.defineProperty(K1,"__esModule",{value:!0});var e=g;function t(C){return Array.prototype.slice.call(C)}function r(C,P){var S=Math.floor(C);return S===P||S+1===P?C:P}function n(){return Date.now()}function o(C,P,S){if(P="data-keen-slider-"+P,S===null)return C.removeAttribute(P);C.setAttribute(P,S||"")}function s(C,P){return P=P||document,typeof C=="function"&&(C=C(P)),Array.isArray(C)?C:typeof C=="string"?t(P.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(P,S,M,O){P.addListener?P.addListener(M):P.addEventListener(S,M,O),C.push([P,S,M,O])},input:function(P,S,M,O){this.add(P,S,function(R){return function($){$.nativeEvent&&($=$.nativeEvent);var W=$.changedTouches||[],L=$.targetTouches||[],F=$.detail&&$.detail.x?$.detail:null;return R({id:F?F.identifier?F.identifier:"i":L[0]?L[0]?L[0].identifier:"e":"d",idChanged:F?F.identifier?F.identifier:"i":W[0]?W[0]?W[0].identifier:"e":"d",raw:$,x:F&&F.x?F.x:L[0]?L[0].screenX:F?F.x:$.pageX,y:F&&F.y?F.y:L[0]?L[0].screenY:F?F.y:$.pageY})}}(M),O)},purge:function(){C.forEach(function(P){P[0].removeListener?P[0].removeListener(P[2]):P[0].removeEventListener(P[1],P[2],P[3])}),C=[]}}}function c(C,P,S){return Math.min(Math.max(C,P),S)}function u(C){return(C>0?1:0)-(C<0?1:0)||+C}function d(C){var P=C.getBoundingClientRect();return{height:r(P.height,C.offsetHeight),width:r(P.width,C.offsetWidth)}}function f(C,P,S,M){var O=C&&C[P];return O==null?S:M&&typeof O=="function"?O():O}function h(C){return Math.round(1e6*C)/1e6}function m(C,P){if(C===P)return!0;var S=typeof C;if(S!==typeof P)return!1;if(S!=="object"||C===null||P===null)return S==="function"&&C.toString()===P.toString();if(C.length!==P.length||Object.getOwnPropertyNames(C).length!==Object.getOwnPropertyNames(P).length)return!1;for(var M in C)if(!m(C[M],P[M]))return!1;return!0}var v=function(){return v=Object.assign||function(C){for(var P,S=1,M=arguments.length;S<M;S++)for(var O in P=arguments[S])Object.prototype.hasOwnProperty.call(P,O)&&(C[O]=P[O]);return C},v.apply(this,arguments)};function y(C,P,S){for(var M,O=0,R=P.length;O<R;O++)!M&&O in P||(M||(M=Array.prototype.slice.call(P,0,O)),M[O]=P[O]);return C.concat(M||Array.prototype.slice.call(P))}function b(C){var P,S,M,O,R,$;function W(j){$||($=j),L(!0);var z=j-$;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();$=null,L(!1),F(null),C.emit("animationEnded")}function L(j){P.active=j}function F(j){P.targetIdx=j}function U(){var j;j=W,R=window.requestAnimationFrame(j)}function K(){var j;j=R,window.cancelAnimationFrame(j),L(!1),F(null),$&&C.emit("animationStopped"),$=null}return P={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,ne=q.easing,Y=q.distance*ne(oe/q.duration)||0;J+=Y;var A=M;return M+=oe,z+=Y,[Q,q.distance,A,M,q.duration,ne]}),F(C.track.distToIdx(z)),U(),C.emit("animationStarted")}},stop:K,targetIdx:null}}function x(C){var P,S,M,O,R,$,W,L,F,U,K,j,z,J,q=1/0,ee=[],Q=null,oe=0;function ne(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===$&&(ge=0,ce+=me>0?1:-1),{abs:ge+ce*$*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-$*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))/$)*S;return h(Ze-Be-Ze+W[De]+he+(ge===$?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%$+$)%$}function Se(fe){var ce;ce=fe-oe,ee.push({distance:ce,timestamp:n()}),ee.length>6&&(ee=ee.slice(-6)),oe=h(fe);var le=re().abs;if(le!==Q){var me=Q!==null;Q=le,me&&C.emit("slideChanged")}}function re(fe){var ce=fe?null:function(){if($){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),_t=et+Ze;le&&(ut===-1&&je>ve&&(_t+=$),ut===1&&je<ve&&(_t-=$),K!==null&&_t<K&&(je+=S),j!==null&&_t>j&&(je-=S));var Ht=je+Te[0]+Te[1],_r=Math.max(je>=0&&Ht<=1?1:Ht<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:_t,distance:O.rtl?-1*je+1-Te[0]:je,portion:_r,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 P.details=ce,C.emit("detailsChanged"),ce}return P={absToRel:de,add:ne,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)]}),$=R.length){S=h(R.reduce(function(ue,ge){return ue+ge[0]+ge[1]},0));var le,me=$-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)&&(L=ue.length-1),le=Be,ue},null),M===0&&(L=0),W.push(h(S))}}(),!$)return re(!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):L;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?ne(B(te(fe))):re()},to:Se,velocity:function(){var fe=n(),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 P,S,M,O,R,$,W,L;function F(Q){return 2*Q}function U(Q){return c(Q,W,L)}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,ne=j();O=u(ne);var Y=C.track.details,A=[];if(ne||!Q){var I=J(ne),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>$){var Se=de<R?R-se:$-se,re=0,fe=ne;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=ne*(1-ce)}else A[0].earlyExit=0,re+=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+re,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 ne=147e-9+(Q=Math.abs(Q))/oe;return{dist:Math.pow(Q,2)/ne,dur:Q/ne}}function q(){var Q=C.track.details;Q&&(R=Q.min,$=Q.max,W=Q.minIdx,L=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(),P=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,ne=C.track.details,Y=ne.position,A=u(j());(Y>$||Y<R)&&(A=0);var I=P+A;ne.slides[oe.absToRel(I)].portion===0&&(I-=A),P!==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 P,S,M,O,R,$,W,L,F,U,K,j,z,J,q,ee,Q,oe,ne=l();function Y(re){if($&&L===re.id){var fe=H(re);if(F){if(!B(re))return I(re);U=fe,F=!1,C.emit("dragChecked")}if(ee)return U=fe;i(re);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(re),K+=ce,!j&&Math.abs(K*O)>5&&(j=!0),C.track.add(ce),U=fe,C.emit("dragged")}}function A(re){!$&&C.track.details&&C.track.details.length&&(K=0,$=!0,j=!1,F=!0,L=re.id,B(re),U=H(re),C.emit("dragStarted"))}function I(re){$&&L===re.idChanged&&($=!1,C.emit("dragEnded"))}function B(re){var fe=te(),ce=fe?re.y:re.x,le=fe?re.x:re.y,me=z!==void 0&&J!==void 0&&Math.abs(J-le)<=Math.abs(z-ce);return z=ce,J=le,me}function H(re){return te()?re.y:re.x}function te(){return C.options.vertical}function se(){O=C.size,R=te()?window.innerHeight:window.innerWidth;var re=C.track.details;re&&(Q=re.min,oe=re.max)}function de(re){j&&(a(re),i(re))}function Se(){if(ne.purge(),C.options.drag&&!C.options.disabled){var re;re=C.options.dragSpeed||1,W=typeof re=="function"?re:function(ce){return ce*re},M=C.options.rtl?-1:1,se(),P=C.container,function(){var ce="data-keen-slider-clickable";s("[".concat(ce,"]:not([").concat(ce,"=false])"),P).map(function(le){ne.add(le,"dragstart",a),ne.add(le,"mousedown",a),ne.add(le,"touchstart",a)})}(),ne.add(P,"dragstart",function(ce){i(ce)}),ne.add(P,"click",de,{capture:!0}),ne.input(P,"ksDragStart",A),ne.input(P,"ksDrag",Y),ne.input(P,"ksDragEnd",I),ne.input(P,"mousedown",A),ne.input(P,"mousemove",Y),ne.input(P,"mouseleave",I),ne.input(P,"mouseup",I),ne.input(P,"touchstart",A,{passive:!0}),ne.input(P,"touchmove",Y,{passive:!1}),ne.input(P,"touchend",I),ne.input(P,"touchcancel",I),ne.add(window,"wheel",function(ce){$&&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;ne.input(le,"touchstart",function(ue){me=H(ue),ee=!0,q=!0},{passive:!0}),ne.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}),ne.input(le,"touchend",function(){ee=!1})}(ce)})}}C.on("updated",se),C.on("optionsChanged",Se),C.on("created",Se),C.on("destroyed",ne.purge)}function _(C){var P,S,M=null;function O(z,J,q){C.animator.active?$(z,J,q):requestAnimationFrame(function(){return $(z,J,q)})}function R(){O(!1,!1,S)}function $(z,J,q){var ee=0,Q=C.size,oe=C.track.details;if(oe&&P){var ne=oe.slides;P.forEach(function(Y,A){if(z)!M&&J&&L(Y,null,q),F(Y,null,q);else{if(!ne[A])return;var I=ne[A].size*Q;!M&&J&&L(Y,I,q),F(Y,ne[A].distance*Q-ee,q),ee+=I}})}}function W(z){return C.options.renderMode==="performance"?Math.round(z):z}function L(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(){P&&($(!0,!0,S),P=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),(P=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 E(C,P){return function(S){var M,O,R,$,W,L=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($.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({},P),B),L.purge(),O=S.size,$=[],R.breakpoints||[]){var te=window.matchMedia(H);te.__media=H,$.push(te),L.add(te,"change",U)}L.add(window,"orientationchange",Y),L.add(window,"resize",ne),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),re=f(B,"spacing",0,!0)/S.size||0,fe=Se==="auto"?re:re/Se,ce=f(B,"origin","auto"),le=0,me=0;me<se;me++){var ue=Se==="auto"?j(H[me]):1/Se-re+fe,ge=ce==="center"?.5-ue/2:ce==="auto"?0:ce;de.push({origin:ge,size:ue,spacing:re}),le+=ue}if(le+=re*(se-1),ce==="auto"&&!S.options.loop&&Se!==1){var De=0;de.map(function(Be){var Ze=le-De;return De+=Be.size+re,Ze>=1||(Be.origin=1-Ze-(le>1?0:1-le)),Be})}S.options.trackConfig=de}function ne(){A();var B=S.size;S.options.disabled||B===O||(O=B,Q())}function Y(){ne(),setTimeout(ne,500),setTimeout(ne,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(){L.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,P,S){try{return function(M,O){var R,$={};return R={emit:function(W){$[W]&&$[W].forEach(function(F){F(R)});var L=R.options&&R.options[W];L&&L(R)},moveToIdx:function(W,L,F){var U=R.track.idxToDist(W,L);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,L,F){F===void 0&&(F=!1),$[W]||($[W]=[]);var U=$[W].indexOf(L);U>-1?F&&delete $[W][U]:F||$[W].push(L)},options:M},function(){if(R.track=x(R),R.animator=b(R),O)for(var W=0,L=O;W<L.length;W++)(0,L[W])(R);R.track.init(R.options.initial||0),R.emit("created")}(),R}(P,y([E(C,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),_,k,w],S||[],!0))}catch(M){console.error(M)}};return K1.useKeenSlider=function(C,P){var S=e.useRef(null),M=e.useRef(!1),O=e.useRef(C),R=e.useCallback(function($){$?(O.current=C,S.current=new T($,C,P),M.current=!1):(S.current&&S.current.destroy&&S.current.destroy(),S.current=null)},[]);return e.useEffect(function(){m(O.current,C)||(O.current=C,S.current&&S.current.update(O.current))},[C]),[R,S]},K1}var ORe=MRe();function O7({className:e,onClick:t,children:r}){return p.jsx("div",{className:Ye("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:r})}function rQ({direction:e,isVisible:t,onArrowClick:r}){const n=a=>{a.preventDefault(),r()},o=e==="left"?"left-[-40px]":"right-[-40px]",s=e==="left"?"left-[8px]":"right-[8px]",i=e==="left"?"rotate-90":"-rotate-90";return p.jsx(O7,{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:n,children:p.jsx(It.BlackChevronDown,{})})}function ARe({imagesLength:e,isVisible:t,currentIndex:r,onDotClick:n}){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 ${r===s?"w-4 rounded-3xl bg-black":"bg-[#878787]"}`,onClick:()=>n(s)},s))})})}function jRe({product:e,isHovered:t,isEditing:r}){const{images:n,title:o,slug:s,defaultImageIndex:i}=e,{navigate:a}=td(),[l,c]=g.useState(0),u=[...n],d="https://upload-file-droplinked.s3.amazonaws.com/4a7a9605254cc8d0b64a6b0ee1250c09aa8b476907b67fd9afc1a180f1b6ad17.png";if(i!==void 0&&i>=0&&i<n.length){const x=u[i];u.splice(i,1),u.unshift(x)}const f=u.slice(0,3),[h,m]=ORe.useKeenSlider({loop:!0,slides:{perView:1},mode:"snap",slideChanged:x=>c(x.track.details.rel)});g.useEffect(()=>{!t&&m.current&&(c(0),m.current?.moveToIdx?.(0))},[t]);const v=()=>{a(`product/${s}`)},y=x=>()=>{x()},b=x=>w=>{w.stopPropagation(),m.current?.moveToIdx(x)};return r||!f[0]||f.length===1?p.jsxs("div",{className:"relative overflow-hidden rounded-lg aspect-square cursor-pointer",children:[p.jsx("img",{src:f[0]?.thumbnail||d,alt:f[0]?.alt||o,onClick:v,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"}),p.jsx(nQ,{product:e})]}):p.jsxs("div",{className:"relative overflow-hidden rounded-lg cursor-pointer",children:[p.jsx("div",{ref:h,className:"keen-slider content-start flex overflow-hidden relative touch-pan-y select-none w-full h-full",onClick:v,children:f.map((x,w)=>p.jsx("div",{className:"keen-slider__slide w-full h-full aspect-square flex items-center justify-center",children:p.jsx("img",{src:x.thumbnail,alt:x.alt||`${o}-${w}`,className:"w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-[1.04]"})},w))}),p.jsx(nQ,{product:e}),p.jsx(rQ,{direction:"left",isVisible:t,onArrowClick:y(()=>m.current?.prev())}),p.jsx(rQ,{direction:"right",isVisible:t,onArrowClick:y(()=>m.current?.next())}),p.jsx(ARe,{imagesLength:f.length,isVisible:t,onDotClick:b,currentIndex:l})]})}function nQ({product:e}){const{discountRuleset:t,gatedRuleset:r}=e;return p.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-2",children:[t&&p.jsx(O7,{children:p.jsx(It.Discount,{})}),r&&p.jsx(O7,{children:p.jsx(It.Gated,{})})]})}function IRe({product:e,isEditing:t}){const{title:r,lowestPrice:n,id:o,slug:s}=e,[i,a]=g.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(jRe,{product:e,isHovered:i,isEditing:t}),p.jsx(eQ,{title:r,slug:s,className:"mt-3"}),p.jsx(JK,{price:n,slug:s,className:"mt-2"})]})}function $Re(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((r,n)=>p.jsxs("div",{children:[p.jsx(es,{className:`rounded-lg aspect-square ${t}`}),p.jsx(es,{className:`h-10 md:h-12 mt-3 ${t}`}),p.jsx(es,{className:`h-6 mt-2 ${t}`})]},n))})}function LRe({product:e}){const{images:t,title:r,lowestPrice:n,discountRuleset:o,gatedRuleset:s,slug:i,id:a}=e,{isDarkTheme:l}=Je(),c=l?"[&_path]:stroke-white":"",{navigate:u}=td(),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(oQ,{image:p.jsx("img",{src:d,alt:r,className:"w-[70px] h-[70px] object-cover rounded-lg shrink-0"}),title:p.jsx(eQ,{title:r,slug:i}),price:p.jsx(JK,{price:n,slug:i}),icons:p.jsxs(p.Fragment,{children:[o&&p.jsx(It.Discount,{className:c}),s&&p.jsx(It.Gated,{className:c})]})})})}function FRe(){const{isDarkTheme:e}=Je(),t=e?"bg-gray-700":"bg-gray-300";return p.jsx(p.Fragment,{children:Array.from({length:6}).map((r,n)=>p.jsx(oQ,{image:p.jsx(es,{className:`w-[70px] h-[70px] rounded-lg shrink-0 ${t}`}),title:p.jsx(es,{className:`h-10 w-1/2 ${t}`}),price:p.jsx(es,{className:`h-6 w-1/4 ${t}`}),icons:p.jsxs(p.Fragment,{children:[p.jsx(es,{className:`w-5 h-5 rounded-full ${t}`}),p.jsx(es,{className:`w-5 h-5 rounded-full ${t}`})]})},n))})}function oQ({image:e,title:t,price:r,icons:n}){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:[r,p.jsx("div",{className:"flex items-center gap-2",children:n})]})]})]})}function sQ(e=768){const[t,r]=g.useState(!1);return g.useEffect(()=>{const n=()=>r(window.innerWidth<e);return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[e]),t}function A7({children:e}){const t=sQ(),r=Or(o=>o.viewMode),n=t?r==="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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "droplinked-editor-configs",
3
3
  "private": false,
4
- "version": "1.9.9",
4
+ "version": "1.9.10",
5
5
  "type": "module",
6
6
  "main": "dist/droplinked-editor.umd.js",
7
7
  "module": "dist/droplinked-editor.es.js",
@@ -4,8 +4,9 @@ import CurrencyIcon from './CurrencyIcon'
4
4
  import useThemeInfo from 'hooks/useThemeInfo'
5
5
  import usePriceInputClassNames from 'components/productGrid/hooks/usePriceInputClassNames'
6
6
 
7
- interface Props extends ComponentProps<"input"> {
8
- onValueChange: (value: number) => void
7
+ interface Props extends Omit<ComponentProps<"input">, 'value' | 'onChange'> {
8
+ value: number | string | undefined
9
+ onValueChange: (value: number | string) => void
9
10
  }
10
11
 
11
12
  export default function PriceInput({ value, placeholder, onValueChange, ...inputProps }: Props) {
@@ -21,9 +22,13 @@ export default function PriceInput({ value, placeholder, onValueChange, ...input
21
22
  <input
22
23
  type="number"
23
24
  className={` !font-shopfont ${inputClassName}`}
24
- value={value}
25
+ value={value ?? ''}
25
26
  placeholder={placeholder}
26
- onChange={({ target: { validity, value } }) => validity.valid && onValueChange(+value)}
27
+ onChange={({ target: { validity, value } }) => {
28
+ if (validity.valid) {
29
+ onValueChange(value === '' ? '' : +value)
30
+ }
31
+ }}
27
32
  onKeyDown={(e) => {
28
33
  const invalidKeys = ['+', '-', 'e', '.']
29
34
  if (invalidKeys.includes(e.key)) e.preventDefault()
@@ -21,8 +21,8 @@ export default function PriceRangeFilter() {
21
21
  } : {}
22
22
 
23
23
  const { minPrice, maxPrice, setStagedProductQuery, applyStagedFilters } = useProductQueryStore(state => ({
24
- minPrice: state.stagedProductQuery.minPrice ?? min,
25
- maxPrice: state.stagedProductQuery.maxPrice ?? max,
24
+ minPrice: state.stagedProductQuery.minPrice,
25
+ maxPrice: state.stagedProductQuery.maxPrice,
26
26
  setStagedProductQuery: state.setStagedProductQuery,
27
27
  applyStagedFilters: state.applyStagedFilters
28
28
  }))
@@ -31,15 +31,28 @@ export default function PriceRangeFilter() {
31
31
  const debouncedMaxPrice = useDebounce(maxPrice, 300)
32
32
 
33
33
  useEffect(() => {
34
+ if (typeof debouncedMinPrice === 'number' && typeof debouncedMaxPrice === 'number' && debouncedMinPrice > debouncedMaxPrice) {
35
+ setStagedProductQuery('minPrice', debouncedMaxPrice)
36
+ setStagedProductQuery('maxPrice', debouncedMinPrice)
37
+ return
38
+ }
34
39
  applyStagedFilters()
35
- }, [debouncedMinPrice, debouncedMaxPrice, applyStagedFilters])
40
+ }, [debouncedMinPrice, debouncedMaxPrice, applyStagedFilters, setStagedProductQuery])
36
41
 
37
- const handleMinChange = (newMin: number) => {
38
- if (newMin < maxPrice) setStagedProductQuery('minPrice', newMin)
42
+ const handleMinChange = (newMin: number | string) => {
43
+ if (newMin === '') {
44
+ setStagedProductQuery('minPrice', undefined)
45
+ return
46
+ }
47
+ if (typeof newMin === 'number') setStagedProductQuery('minPrice', newMin)
39
48
  }
40
49
 
41
- const handleMaxChange = (newMax: number) => {
42
- if (newMax > minPrice) setStagedProductQuery('maxPrice', newMax)
50
+ const handleMaxChange = (newMax: number | string) => {
51
+ if (newMax === '') {
52
+ setStagedProductQuery('maxPrice', undefined)
53
+ return
54
+ }
55
+ if (typeof newMax === 'number') setStagedProductQuery('maxPrice', newMax)
43
56
  }
44
57
 
45
58
  if (isLoading) return <FilterCheckboxSkeleton />
@@ -48,15 +61,15 @@ export default function PriceRangeFilter() {
48
61
  <div className="flex flex-col gap-4">
49
62
  <div className="flex items-center gap-3">
50
63
  <PriceInput
51
- value={minPrice}
52
- placeholder="0"
64
+ value={minPrice ?? ''}
65
+ placeholder={min.toString()}
53
66
  onValueChange={handleMinChange}
54
67
  min={min}
55
68
  />
56
69
  <PLPIcons.Separator className="shrink-0" />
57
70
  <PriceInput
58
- value={maxPrice}
59
- placeholder="1000"
71
+ value={maxPrice ?? ''}
72
+ placeholder={max.toString()}
60
73
  onValueChange={handleMaxChange}
61
74
  max={max}
62
75
  />
@@ -65,7 +78,7 @@ export default function PriceRangeFilter() {
65
78
  className="price-range-slider"
66
79
  thumbClassName={isDarkTheme ? "dark-price-range-slider__thumb" : "price-range-slider__thumb"}
67
80
  trackClassName={isDarkTheme ? "dark-price-range-slider__track" : "price-range-slider__track"}
68
- value={[minPrice, maxPrice]}
81
+ value={[minPrice ?? min, maxPrice ?? max]}
69
82
  renderThumb={(props) => <div {...props} />}
70
83
  minDistance={1}
71
84
  onChange={([newMin, newMax]) => {