@billgangcom/theme-lib 1.52.2 → 1.52.3

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.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-Dxxdn8DO.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.splitTextIntoSpans=o.splitTextIntoSpans;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-De3mlDxS.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.splitTextIntoSpans=o.splitTextIntoSpans;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { App as e, ColorVariables as p, hotReload as r, iconNames as s } from "./builder.es.js";
2
- import { s as l } from "./index-B2Rk8_zm.js";
2
+ import { s as l } from "./index-hseNJ-Jo.js";
3
3
  export {
4
4
  e as App,
5
5
  p as ColorVariables,
@@ -19,6 +19,12 @@ interface InputOption<T> {
19
19
  field: keyof T;
20
20
  placeholder?: string;
21
21
  }
22
+ interface InputNumberOption<T> {
23
+ type: 'inputNumber';
24
+ label?: string;
25
+ field: keyof T;
26
+ placeholder?: string;
27
+ }
22
28
  interface InputSwitchOption<T> {
23
29
  type: 'inputSwitch';
24
30
  inputLabel?: string;
@@ -45,7 +51,7 @@ interface SelectOption<T> {
45
51
  leftAddon?: string;
46
52
  switcher?: string;
47
53
  }
48
- export type ModalOption<T> = ImageOption<T> | TextOption<T> | InputOption<T> | InputSwitchOption<T> | ListOption<T> | SelectOption<T>;
54
+ export type ModalOption<T> = ImageOption<T> | TextOption<T> | InputOption<T> | InputSwitchOption<T> | ListOption<T> | SelectOption<T> | InputNumberOption<T>;
49
55
  interface Props<T extends ItemBase> {
50
56
  activeItem: T;
51
57
  setActiveItem: (value: T | null) => void;
@@ -16,6 +16,7 @@ interface Props {
16
16
  editable?: boolean;
17
17
  isSearch?: boolean;
18
18
  centered?: boolean;
19
+ maxSymbols?: number;
19
20
  }
20
21
  export declare const Input: React.FC<Props>;
21
22
  export {};
@@ -6,6 +6,7 @@ interface Props {
6
6
  label?: string;
7
7
  value: string;
8
8
  maxLength?: number;
9
+ type?: 'number' | 'text';
9
10
  }
10
11
  export declare const Textarea: React.FC<Props>;
11
12
  export {};
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-Dxxdn8DO.cjs"),_=require("react");require("@phosphor-icons/react");const at="_wrapper_1ibay_2",rt="_alignmentBlock_1ibay_8",ct="_title_1ibay_15",lt="_subtitle_1ibay_22",dt="_alignmentContent_1ibay_29",ut="_alignments_1ibay_37",xt="_alignment_1ibay_8",mt="_circle_1ibay_60",pt="_paddings_1ibay_67",jt="_padding_1ibay_67",ht="_active_1ibay_91",_t="_input_1ibay_98",U={wrapper:at,alignmentBlock:rt,title:ct,subtitle:lt,alignmentContent:dt,alignments:ut,alignment:xt,circle:mt,paddings:pt,padding:jt,active:ht,input:_t},gt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],ft=["left","top","right","bottom"],Et=l=>{const{alignment:o,padding:e,setPadding:s,setAlignment:n}=l;function h(d){switch(d){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function m(d){switch(d){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[r,p]=_.useState(null),[y,T]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:U.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:U.alignments,children:gt.map(d=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(d)},className:U.alignment,onMouseEnter:()=>{p(d)},onMouseLeave:()=>{p(null)},children:[d!==o&&r!==d&&t.jsxRuntimeExports.jsx("div",{className:U.circle}),d!==o&&r===d&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(r),fill:"#c2c2c2",width:22,height:22}),d===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(o),fill:"#FF3F19",width:22,height:22})]},d))}),t.jsxRuntimeExports.jsx("div",{className:U.paddings,children:ft.map(d=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(U.padding,{[U.active]:y===d}),onFocus:()=>{T(d)},onBlur:()=>{T(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:m(d),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[d]),onChange:i=>s({...e,[d]:Number(i)}),paddingless:!0,borderless:!0})]},d))})]})]})]})},Rt="_title_82zux_1",bt="_subtitle_82zux_5",vt="_header_82zux_12",yt="_text_82zux_13",It="_productsBlock_82zux_14",St="_top_82zux_26",Nt="_itemsBlock_82zux_35",kt="_typeTexts_82zux_41",Ct="_block_82zux_48",$t="_active_82zux_61",Bt="_products_82zux_14",wt="_product_82zux_14",Pt="_button_82zux_80",Mt="_disabled_82zux_91",Tt="_image_82zux_95",qt="_info_82zux_102",At="_name_82zux_114",Ot="_buttons_82zux_118",Lt="_modal_82zux_125",zt="_link_82zux_145",Dt="_modalOptions_82zux_151",Ut="_addButton_82zux_157",Ht="_deleteButton_82zux_179",H={title:Rt,subtitle:bt,header:vt,text:yt,productsBlock:It,top:St,itemsBlock:Nt,typeTexts:kt,block:Ct,active:$t,products:Bt,product:wt,button:Pt,disabled:Mt,image:Tt,info:qt,name:At,buttons:Ot,modal:Lt,link:zt,modalOptions:Dt,addButton:Ut,deleteButton:Ht},Ft=l=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,other:h,title:m,subtitle:r,draggable:p=!1,withImage:y=!1,addable:T=!0,itemsOptions:d,hasRangeSelector:i=!1,rangeSelectorOptions:g,limit:E,autoScrollInterval:j,deletable:R}=l;function N(a){if(y)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const z=(a,k=!1)=>{const w=d.find(q=>q.id===a);if(!w)return;const F=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[p&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const u=[...s],I=d.find(f=>f.name===q);if(!I)return;const B=I.id,c=u.map(f=>f===a?B:f);n([...c])},value:w.name,options:d.filter(q=>!s.find(u=>u===q.id)).map(q=>q.name),leftAddon:N(w.images)}),k&&t.jsxRuntimeExports.jsx("div",{className:H.buttons,children:t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(q=>q!==a))})})})]});return t.jsxRuntimeExports.jsx("div",{className:H.product,children:F},a)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(m||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:m}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:a=>e==null?void 0:e(a)})]}),i&&g&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...g}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:r}),s.map(a=>z(a,R)),T&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(E&&E<=s.length||s.length===d.length)}),size:"s",disabled:!!(E&&E<=s.length||s.length===d.length),onClick:()=>{const a=[...s];let k=null;if(d){for(let w=0;w<d.length;w++)if(!s.find(F=>F===d[w].id)){k=d[w];break}}a.push((k==null?void 0:k.id)||d[0].id),n(a)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),h!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:h}),j!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(j.scrollInterval),onChange:a=>j.setScrollInterval(Number(a)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Vt="_title_roi3a_1",Yt="_subtitle_roi3a_5",Wt="_header_roi3a_12",Gt="_text_roi3a_13",Qt="_productsBlock_roi3a_14",Xt="_top_roi3a_26",Jt="_itemsBlock_roi3a_35",Kt="_typeTexts_roi3a_41",Zt="_block_roi3a_48",te="_active_roi3a_61",ee="_products_roi3a_14",se="_product_roi3a_14",ne="_button_roi3a_80",ie="_disabled_roi3a_91",oe="_image_roi3a_95",ae="_info_roi3a_102",re="_name_roi3a_114",ce="_buttons_roi3a_118",le="_modal_roi3a_125",de="_link_roi3a_145",ue="_modalOptions_roi3a_151",xe="_addButton_roi3a_164",me="_deleteButton_roi3a_179",pe="_closeIcon_roi3a_191",L={title:Vt,subtitle:Yt,header:Wt,text:Gt,productsBlock:Qt,top:Xt,itemsBlock:Jt,typeTexts:Kt,block:Zt,active:te,products:ee,product:se,button:ne,disabled:ie,image:oe,info:ae,name:re,buttons:ce,modal:le,link:de,modalOptions:ue,addButton:xe,deleteButton:me,closeIcon:pe};function je({product:l,children:o}){const{attributes:e,listeners:s,setNodeRef:n,transform:h,transition:m,isDragging:r}=t.useSortable({id:l.id}),p={transform:t.CSS.Transform.toString(h),transition:m};return t.jsxRuntimeExports.jsx("div",{ref:n,style:p,className:`${L.product} ${r?L.dragging:""}`,...e,...s,children:o})}const he=l=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,title:h,subtitle:m,editable:r=!0,draggable:p=!1,deletable:y=!0,addable:T=!0,itemsType:d,itemsOptions:i,addableOptions:g={},limit:E}=l,[j,R]=_.useState(null),[N,z]=_.useState(null),a=_.useRef(null),k=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(j){const u=[...s].map(I=>I.id===j.id?j:I);n(u)}},[j]),_.useEffect(()=>{a.current&&N&&(a.current.getBoundingClientRect().height,N.top)},[a.current,N]);const w=(u,I)=>{u.stopPropagation();const B=u.target.getBoundingClientRect();z({top:B.top+window.scrollY,left:B.left-30}),R(I)},F=u=>{const{active:I,over:B}=u;if(B&&I.id!==B.id){const c=s.findIndex(S=>S.id===I.id),f=s.findIndex(S=>S.id===B.id);if(c!==-1&&f!==-1){const S=[...s],[O]=S.splice(c,1);S.splice(f,0,O),n(S)}}},q=(u,I)=>{const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[p&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),d==="select"&&i&&t.jsxRuntimeExports.jsx(t.Select,{onChange:c=>{const f=[...s],S=i.find($=>$.name===c);if(!S)return;const O=f.map($=>$.id===u.id?{...S,name:{"en-US":c}}:$);R({...u,name:{"en-US":c}}),n([...O])},value:u.name,options:i.filter(c=>!s.find(f=>f.name===c.name)).map(c=>c.name)}),t.jsxRuntimeExports.jsxs("div",{className:L.buttons,children:[r&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:c=>w(c,u)})}),y&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(c=>c.id!==u.id))})})]})]});return p?t.jsxRuntimeExports.jsx(je,{product:u,index:I,children:B},u.id):t.jsxRuntimeExports.jsx("div",{className:L.product,children:B},u.id)};return t.jsxRuntimeExports.jsxs("div",{className:L.productsBlock,children:[(h||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[h&&t.jsxRuntimeExports.jsx("h3",{className:L.title,children:h}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:u=>e==null?void 0:e(u)})]}),t.jsxRuntimeExports.jsxs("div",{className:L.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:L.subtitle,children:m}),p?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:k,onDragEnd:F,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(u=>u.id),strategy:t.verticalListSortingStrategy,children:s.map((u,I)=>q(u,I))})}):s.map((u,I)=>q(u,I)),T&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(L.button,{[L.disabled]:!!(E&&E<=s.length||s.length===(i==null?void 0:i.length))}),size:"s",disabled:!!(E&&E<=s.length||s.length===(i==null?void 0:i.length)),onClick:()=>{const u=[...s];let I=null;if(i){for(let B=0;B<i.length;B++)if(!s.find(c=>c.id===i[B].id)){I=i[B];break}}d==="select"&&i&&u.push({name:I?I.name:i[0].name,id:(I==null?void 0:I.id)||i[0].id,...g}),n(u)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:L.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function _e(l){const{product:o,children:e}=l,{attributes:s,listeners:n,setNodeRef:h,transform:m,transition:r,isDragging:p}=t.useSortable({id:o.id}),y={transform:t.CSS.Transform.toString(m),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:h,style:y,className:`${t.styles.product} ${p?t.styles.dragging:""}`,...s,...n,children:e})}const ge=l=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,other:h,title:m,subtitle:r,editable:p=!0,draggable:y=!1,withImage:T=!1,deletable:d=!0,addable:i=!0,itemsType:g,itemsPlaceholder:E="",itemsOptions:j,hasRangeSelector:R=!1,rangeSelectorOptions:N,modalOptions:z,addableOptions:a={}}=l,[k,w]=_.useState(null),[F,q]=_.useState({top:0,left:0}),[u,I]=_.useState(null),B=_.useRef(null),[c,f]=_.useState(!1),S=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const x=()=>{w(null),f(!1)};return document.body.addEventListener("click",x),w(null),f(!1),()=>{w(null),f(!1),document.body.removeEventListener("click",x)}},[]),_.useEffect(()=>{if(k){const x=[...s].map(P=>P.id===k.id?k:P);n(x)}},[k]),_.useEffect(()=>{if(B.current&&u){const x=B.current.getBoundingClientRect().height,P=window.innerHeight;let C=u.top;C+x>P+window.scrollY-200&&(C=P+window.scrollY-x-200),C<0&&(C=10),q({top:C,left:u.left})}},[B.current,u]);const O=(x,P)=>{x.stopPropagation();const C=x.target.getBoundingClientRect();I({top:C.top+window.scrollY,left:C.left-30}),w(P),f(!0)};function $(x){if(T)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const A=x=>{const{active:P,over:C}=x;if(C&&P.id!==C.id){const M=s.findIndex(D=>D.id===P.id),Q=s.findIndex(D=>D.id===C.id);if(M!==-1&&Q!==-1){const D=[...s],[V]=D.splice(M,1);D.splice(Q,0,V),n(D)}}},Y=x=>{var C;const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&j&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const D=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":M}}:V);w({...x,name:{"en-US":M}}),n([...D])},value:x.name["en-US"],options:j.filter(M=>!s.find(Q=>Q.name["en-US"]===M)),leftAddon:$(x.images)}),g==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:M=>{const D=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":M}}:V);n([...D])},value:x.name["en-US"],placeholder:E}),g==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:M=>{const D=[...s].map(V=>V.id===x.id?{...x,images:M}:V);n([...D])},activeImage:(C=s.find(M=>M.id===x.id))==null?void 0:C.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[p&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>O(M,x)})}),d&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(M=>M.id!==x.id))})})]})]});return y?t.jsxRuntimeExports.jsx(_e,{product:x,children:P},x.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:P},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(m||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:m}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:x=>e==null?void 0:e(x)})]}),k&&p&&z&&c&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:B,activeItem:k,setActiveItem:w,popupPosition:F,modalOptions:z,setIsOpenModal:f}),R&&N&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...N}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:r}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:S,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map(x=>Y(x))})}):s.map(x=>Y(x)),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles.button,size:"s",onClick:()=>{const x=[...s];let P=null;if(j){for(let C=0;C<j.length;C++)if(!s.find(M=>M.name["en-US"]===j[C])){P=j[C];break}}g==="select"&&j?x.push({name:{"en-US":P||j[0]},id:t.v4(),...a,maxSymbols:100}):g==="input"?x.push({name:{"en-US":""},id:t.v4(),...a,maxSymbols:100}):x.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...a,maxSymbols:100}),n(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),h!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:h})]})},fe="_subtitle_jql1y_1",Ee="_header_jql1y_8",Re="_text_jql1y_9",be="_productsBlock_jql1y_10",ve="_buttonsBlock_jql1y_11",ye="_top_jql1y_23",Ie="_itemsBlock_jql1y_32",Se="_typeTexts_jql1y_38",Ne="_block_jql1y_45",ke="_active_jql1y_58",Ce="_products_jql1y_10",$e="_product_jql1y_10",Be="_button_jql1y_11",we="_image_jql1y_88",Pe="_info_jql1y_95",Me="_name_jql1y_107",Te="_buttons_jql1y_11",qe="_modal_jql1y_118",Ae="_other_jql1y_138",Oe="_options_jql1y_144",Le="_addButton_jql1y_150",ze="_deleteButton_jql1y_165",W={subtitle:fe,header:Ee,text:Re,productsBlock:be,buttonsBlock:ve,top:ye,itemsBlock:Ie,typeTexts:Se,block:Ne,active:ke,products:Ce,product:$e,button:Be,image:we,info:Pe,name:Me,buttons:Te,modal:qe,other:Ae,options:Oe,addButton:Le,deleteButton:ze},Z=l=>{const{buttons:o,setButtons:e,deletable:s=!0,addable:n=!0,editableLink:h=!0}=l,{pages:m}=t.usePagesStore(),[r,p]=_.useState(null),[y,T]=_.useState({top:0,left:0}),[d,i]=_.useState(null),g=_.useRef(null);_.useEffect(()=>{if(r){const j=[...o].map(R=>R.id===r.id?r:R);e(j)}},[r]),_.useEffect(()=>{if(g.current&&d){const j=g.current.getBoundingClientRect().height,R=window.innerHeight;let N=d.top;N+j>R+window.scrollY-200&&(N=R+window.scrollY-j-200),N<0&&(N=10),T({top:N,left:d.left})}},[g.current,d]);const E=(j,R)=>{j.stopPropagation();const N=j.target.getBoundingClientRect();i({top:N.top+window.scrollY-70,left:N.left-(n?30:65)}),p(R)};return t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:"Button Type"}),o.map(j=>t.jsxRuntimeExports.jsxs("div",{className:W.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const z=[...o].map(a=>a.id===j.id?{...j,type:R}:a);e(z)},value:j.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:W.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>{E(R,j)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const R=o.filter(N=>N.id!==j.id);e(R)},width:20,height:20,fill:"#C12A2A"})})]})]},j.id)),r&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:g,activeButton:r,setActiveButton:p,popupPosition:y,editableLink:h}),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:W.button,size:"s",onClick:()=>{const j=[...o];h?j.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:m?Object.values(m)[0].name:"Home",openInNewTab:!1}):j.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:m?Object.values(m)[0].name:"Home",openInNewTab:!1}),e(j)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},De=l=>{const{isActiveButtons:o,setIsActiveButtons:e,buttons:s,setButtons:n,editableLink:h=!0}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:m=>e(m)})]}),o&&t.jsxRuntimeExports.jsx(Z,{buttons:s,setButtons:n,editableLink:h})]})})};function Ue(l){const{product:o,children:e}=l,{attributes:s,listeners:n,setNodeRef:h,transform:m,transition:r,isDragging:p}=t.useSortable({id:String(o.listingId)}),y={transform:t.CSS.Transform.toString(m),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:h,style:y,className:`${t.styles$2.product} ${p?t.styles$2.dragging:""}`,...s,...n,children:e})}const He=l=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,other:h,title:m,subtitle:r,editable:p=!0,draggable:y=!1,withImage:T=!1,deletable:d=!0,addable:i=!0,itemsType:g,itemsOptions:E}=l,[j,R]=_.useState(null),[N,z]=_.useState({top:0,left:0}),[a,k]=_.useState(!1),w=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const c=()=>{R(null),k(!1)};return document.body.addEventListener("click",c),R(null),k(!1),()=>{R(null),k(!1),document.body.removeEventListener("click",c)}},[]),_.useEffect(()=>{if(j){const c=[...s].map(f=>f.listingId===j.listingId?j:f);n(c)}},[j]);const F=(c,f)=>{c.stopPropagation();const S=c.target.getBoundingClientRect(),O=100,$=window.innerHeight;let A=S.top+window.scrollY;A+O>$&&(A=$-O-20),k(!0),z({top:A-80,left:S.left-30}),R(f)};function q(c){if(T)return c?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${c}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const u=c=>{const{active:f,over:S}=c;if(S&&f.id!==S.id){const O=s.findIndex(A=>String(A.listingId)===f.id),$=s.findIndex(A=>String(A.listingId)===S.id);if(O!==-1&&$!==-1){const A=[...s],[Y]=A.splice(O,1);A.splice($,0,Y),n(A)}}},I=(c,f)=>{const S=E.find($=>c.listingId===$.id);if(!S)return null;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:$=>{const A=[...s],Y=E.find(C=>C.productData.name===$);if(!Y)return;const x={listingId:Y.id,image:Y.productData.images.length>0?Y.productData.images[0].cfId:""},P=A.map(C=>C.listingId===c.listingId?x:C);R(x),n([...P])},value:S.productData.name,options:[...E.filter($=>!s.find(A=>A.listingId===$.id)).map($=>$.productData.name)],leftAddon:q(c.image||S.productData.images.length>0&&S.productData.images[0].cfId||"")},f),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[p&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:$=>F($,c)})}),d&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter($=>$!==c))})})]})]});return y?t.jsxRuntimeExports.jsx(Ue,{product:c,children:O},c.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:O},c.listingId)},B=_.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(m||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:m}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:c=>e==null?void 0:e(c)})]}),a&&j&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:B,activeItem:j,setActiveItem:R,setIsOpenModal:k,popupPosition:N,itemsOptions:E}),o&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:r}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:w,onDragEnd:u,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(c=>String(c.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((c,f)=>I(c,f))})}):s.map((c,f)=>I(c,f)),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const c=[...s];for(let f=0;f<E.length;f++)if(!s.find(S=>S.listingId===E[f].id)){c.push({listingId:E[f].id,image:E[f].productData.images.length>0?E[f].productData.images[0].cfId:""});break}n(c)},disabled:s.length===E.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),o&&h!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:h})]})},Fe="_options_6cemk_1",Ve="_price_6cemk_12",Ye="_oldPrice_6cemk_19",We="_newPrice_6cemk_27",Ge="_animate_6cemk_34",Qe="_appearAndBounce_6cemk_1",Xe="_meta_6cemk_52",Je="_info_6cemk_58",Ke="_infoRight_6cemk_66",Ze="_buttons_6cemk_73",ts="_variants_6cemk_80",es="_variant_6cemk_80",ss="_stock_6cemk_98",ns="_variantInfo_6cemk_105",is="_quantity_6cemk_111",os="_count_6cemk_118",as="_focused_6cemk_135",rs="_button_6cemk_73",cs="_activeVariant_6cemk_161",ls="_chargeTypes_6cemk_165",ds="_charge_6cemk_165",us="_chargeActive_6cemk_190",xs="_title_6cemk_198",v={options:Fe,price:Ve,oldPrice:Ye,newPrice:We,animate:Ge,appearAndBounce:Qe,meta:Xe,info:Je,infoRight:Ke,buttons:Ze,variants:ts,variant:es,stock:ss,variantInfo:ns,quantity:is,count:os,focused:as,button:rs,activeVariant:cs,chargeTypes:ls,charge:ds,chargeActive:us,title:xs};var tt=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(tt||{});const ms=l=>{var N,z;const{variants:o}=l,[e,s]=_.useState(o[0]),[n,h]=_.useState(e.chargeTypes[0]),m=t.useNavigate(),[r,p]=_.useState(1),{reset:y,addProductToCart:T,getProducts:d}=t.useCart(),[i,g]=_.useState(!1);_.useEffect(()=>{g(!0);const a=setTimeout(()=>g(!1),600);return()=>clearTimeout(a)},[r]);async function E(){await d(),await T({productId:l.id,productVariantId:e.id,quantity:r})}function j(){y(),E(),m("/checkout")}function R(a){if(a>=864e5){const u=Math.floor(a/864e5);return`${u} ${u===1?"day":"days"}`}else if(a>=36e5){const u=Math.floor(a/36e5);return`${u} ${u===1?"hour":"hours"}`}else if(a>=6e4){const u=Math.floor(a/6e4);return`${u} ${u===1?"minute":"minutes"}`}else{const u=Math.floor(a/1e3);return`${u} ${u===1?"second":"seconds"}`}}return _.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&p(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:v.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:v.chargeTypes,children:e.chargeTypes.map(a=>t.jsxRuntimeExports.jsx("div",{className:t.clx(v.charge,{[v.chargeActive]:n===a}),onClick:()=>h(a),children:tt[a]},a))}),t.jsxRuntimeExports.jsx("div",{className:v.variants,children:o.map(a=>{var k;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(v.variant,{[v.activeVariant]:e.id===a.id}),onClick:()=>s(a),children:[t.jsxRuntimeExports.jsxs("div",{className:v.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:v.title,children:a.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",n==="ONE_TIME"?a.price.amount:a.subscriptionSettings?a.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:v.stock,children:[((k=a.quantity.restrictions)==null?void 0:k.max)||a.quantity.available||0," in stock"]})})]},a.id)})}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:v.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{r>1?p(a=>a-1):p(1)},className:v.button,disabled:e.quantity.available===0||e.quantity.restrictions&&r<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(r),onChange:a=>p(Number(a)),max:((N=e.quantity.restrictions)==null?void 0:N.max)||e.quantity.available||1/0,min:((z=e.quantity.restrictions)==null?void 0:z.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{p(a=>a+1)},className:v.button,disabled:!!(e.quantity.restrictions&&r>=e.quantity.restrictions.max||e.quantity.available!==void 0&&r>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:v.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:v.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":R(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:v.infoRight,children:n==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:v.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:i}),children:["$ ",(e.price.amount||0)*r]}),t.jsxRuntimeExports.jsxs("span",{className:v.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*r]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:i}),children:["$ ",(e.price.amount||0)*r]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:v.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:i}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:v.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:i}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>j(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:n==="ONE_TIME"?"Buy Now":"Subscribe Now"}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>E(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},ps="_button_1tdo3_1",js="_login_1tdo3_14",hs="_signUp_1tdo3_18",_s="_buttons_1tdo3_23",gs="_modal_1tdo3_32",fs="_closing_1tdo3_64",Es="_info_1tdo3_113",Rs="_top_1tdo3_120",bs="_title_1tdo3_131",vs="_clear_1tdo3_138",ys="_activeClear_1tdo3_145",Is="_count_1tdo3_149",Ss="_cart_1tdo3_164",Ns="_empty_1tdo3_172",ks="_product_1tdo3_198",Cs="_products_1tdo3_207",$s="_image_1tdo3_215",Bs="_productInfo_1tdo3_221",ws="_content_1tdo3_228",Ps="_name_1tdo3_234",Ms="_price_1tdo3_240",Ts="_productButtons_1tdo3_246",qs="_productButton_1tdo3_246",As="_productCount_1tdo3_266",Os="_bottom_1tdo3_282",Ls="_subtotal_1tdo3_290",zs="_block_1tdo3_298",Ds="_shoppingCount_1tdo3_305",Us="_total_1tdo3_325",Hs="_link_1tdo3_331",Fs="_userInfo_1tdo3_338",Vs="_pagesMobileModal_1tdo3_349",Ys="_pagesMobileModalContent_1tdo3_363",Ws="_pagesMobileModalHeader_1tdo3_369",Gs="_pagesMobileModalFooter_1tdo3_379",b={button:ps,login:js,signUp:hs,buttons:_s,modal:gs,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:fs,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Es,top:Rs,title:bs,clear:vs,activeClear:ys,count:Is,cart:Ss,empty:Ns,product:ks,products:Cs,image:$s,productInfo:Bs,content:ws,name:Ps,price:Ms,productButtons:Ts,productButton:qs,productCount:As,bottom:Os,subtotal:Ls,block:zs,shoppingCount:Ds,total:Us,link:Hs,userInfo:Fs,pagesMobileModal:Vs,pagesMobileModalContent:Ys,pagesMobileModalHeader:Ws,pagesMobileModalFooter:Gs},Qs=l=>{const{shopping:o,signUp:e,isShowUserInfo:s=!0}=l;return t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[o&&t.jsxRuntimeExports.jsx(et,{}),s&&t.jsxRuntimeExports.jsx(K,{signUp:e})]})},et=()=>{const[l,o]=_.useState(!1),[e,s]=_.useState([]),{cart:n,getProducts:h}=t.useCart();function m(i){for(let g=0;g<n.parts.length;g++)for(let E=0;E<i.variants.length;E++)if(n.parts[g].productVariantId===i.variants[g].id)return n.parts[g].productVariantId}function r(i){for(let g=0;g<n.parts.length;g++)for(let E=0;E<i.variants.length;E++)if(n.parts[g].productVariantId===i.variants[g].id)return n.parts[g].quantity}_.useEffect(()=>{(async()=>{const g=n.parts.map(R=>String(R.productId)),j=(await h([...g])).map(R=>({...R,activeVariantId:m(R),quantity:r(R)}));s(j)})()},[n.parts.length]);function p(i){var g;return!i||!(i!=null&&i.variants)?!1:(g=i.variants.find(E=>E.id===i.activeVariantId))==null?void 0:g.subscriptionSettings}const y=n.parts.length>0&&e.length>0&&!p(e[0]),[T,d]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10},onClick:i=>{i.stopPropagation(),window.location.pathname.includes("/admin/builder")||(o(!0),d(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),y&&t.jsxRuntimeExports.jsx("div",{className:b.shoppingCount,children:n.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{d(!1),setTimeout(()=>{o(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(st,{activeProducts:e,isCartNotEmpty:y,isOpen:T})})]})},st=l=>{const{activeProducts:o,isCartNotEmpty:e,isOpen:s}=l,{cart:n,reset:h,getTotalAndDiscount:m,updateQuantityOfProduct:r}=t.useCart(),p=t.useNavigate();function y(i){p(i)}function T(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity+1})}function d(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.modal,{[b.closing]:!s}),onClick:i=>i.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:b.top,children:[t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{className:b.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:b.count,children:n.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(b.clear,{[b.activeClear]:e}),disabled:!e,onClick:h,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:b.cart,children:[t.jsxRuntimeExports.jsx("div",{className:b.products,children:o.map(i=>t.jsxRuntimeExports.jsxs("div",{className:b.product,children:[t.jsxRuntimeExports.jsxs("div",{className:b.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:b.image}),t.jsxRuntimeExports.jsxs("div",{className:b.content,children:[t.jsxRuntimeExports.jsx("div",{className:b.name,children:i.name}),t.jsxRuntimeExports.jsxs("div",{className:b.price,children:["$",i.variants.find(g=>g.id===i.activeVariantId).price.amount*((i==null?void 0:i.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{i.quantity!==1&&d(i)},className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:b.productCount,children:i.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>T(i),className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},i.id))}),t.jsxRuntimeExports.jsxs("div",{className:b.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:b.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:b.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:b.total,children:["$",m().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>y("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(nt,{})]})},nt=()=>t.jsxRuntimeExports.jsxs("div",{className:b.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:b.link,children:"view products"})]})]}),K=({signUp:l})=>{const o=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=o,s=t.useNavigate();function n(r){window.location.pathname.includes("/admin/builder")||s(r)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),l&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[h,m]=_.useState("test-email@gmail.com");return _.useEffect(()=>{(async()=>{const p=t.jwtDecode(e);m(p.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:b.userInfo,onClick:()=>n("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:h||"test-email@gmail.com"})})},it=({children:l,logo:o,setIsOpen:e,signUp:s})=>{const{setIsOpen:n}=t.useModalStore(),h=()=>{n(!1),setTimeout(()=>{e(!1),n(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModal,onClick:m=>m.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:o}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:h,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalContent,children:l}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(K,{signUp:s})})]})},Xs=({children:l,logo:o,signUp:e})=>{const[s,n]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(ot,{setIsOpenModal:n}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsx(it,{logo:o,setIsOpen:n,signUp:e,children:l})})]})},ot=l=>{const{setIsOpenModal:o}=l;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),o(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Js="_share_xddz7_1",Ks="_modal_xddz7_8",Zs="_header_xddz7_20",tn="_socials_xddz7_30",en="_social_xddz7_30",sn="_copy_xddz7_40",nn="_title_xddz7_47",on="_copyWrapper_xddz7_53",an="_copyText_xddz7_62",rn="_copyTextMobile_xddz7_75",cn="_copyTextMiniMobile_xddz7_94",G={share:Js,modal:Ks,header:Zs,socials:tn,social:en,copy:sn,title:nn,copyWrapper:on,copyText:an,copyTextMobile:rn,copyTextMiniMobile:cn},ln=()=>{const{isOpenModal:l,setIsOpenModal:o}=t.useShareLinkStore();function e(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:G.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(dn,{})})]})},dn=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:o,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),n=window.location.href;function h(){navigator.clipboard.writeText(n),e({message:"Link copied to clipboard",status:"success"})}function m(){s(!1),setTimeout(()=>{l(!1),s(!0)},300)}function r(p,y){return p.length>y?p.slice(0,y)+"...":p}return t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:p=>p.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsx("div",{className:G.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:m,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:G.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:h,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:G.copyText,children:r(n,100)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMobile,children:r(n,40)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMiniMobile,children:r(n,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:h,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},un="_accordion_1s1lq_1",xn="_header_1s1lq_9",mn="_icon_1s1lq_18",pn="_open_1s1lq_21",jn="_content_1s1lq_25",X={accordion:un,header:xn,icon:mn,open:pn,content:jn},hn=({title:l,content:o,defaultOpen:e=!1})=>{const[s,n]=_.useState(e),[h,m]=_.useState(0),r=_.useRef(null),p=()=>{n(!s)};return _.useEffect(()=>{r.current&&m(s?r.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:X.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,onClick:p,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(X.icon,{[X.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:r,className:X.content,style:{height:`${h}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:o})})]})},_n=({children:l,path:o,className:e,target:s="_self",id:n})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:n,children:l});const h=t.useNavigate(),m=/^https?:\/\//.test(o),r=p=>{m||s==="_blank"?s==="_blank"?window.open(o,"_blank"):window.location.href=o:(p.preventDefault(),h(o,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:r,className:e,role:"link",style:{cursor:"pointer"},id:n,children:l})},gn="_buttonsBlock_1b2rb_1",fn="_slideUp_1b2rb_1",En={buttonsBlock:gn,slideUp:fn},Rn=()=>t.jsxRuntimeExports.jsxs("div",{className:En.buttonsBlock,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:"Buy"})]}),bn="_wrapper_st58d_1",vn="_label_st58d_10",yn="_textarea_st58d_18",In="_length_st58d_33",J={wrapper:bn,label:vn,textarea:yn,length:In},Sn=l=>{const{onChange:o,label:e,value:s,maxLength:n,placeholder:h="Type something..."}=l,[m,r]=_.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:J.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:J.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:p=>{r(p.target.value.length),o(p.target.value)},placeholder:h,className:J.textarea,maxLength:n}),n&&t.jsxRuntimeExports.jsxs("div",{className:J.length,children:[m,"/",n]})]})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=hn;exports.BurgerMenuButton=ot;exports.ButtonTypeSettings=Z;exports.ButtonsSettings=De;exports.CategorySettings=Ft;exports.EmptyCart=nt;exports.FormSettings=ge;exports.HeaderButtons=Qs;exports.LayoutSettings=Et;exports.Link=_n;exports.ListingSelector=He;exports.PagesMobileMenu=Xs;exports.PagesMobileModal=it;exports.PagesSettings=he;exports.ProductCardButtons=Rn;exports.ProductOptions=ms;exports.ShareLink=ln;exports.ShoppingButton=et;exports.ShoppingModalCart=st;exports.TextareaUI=Sn;exports.UserInfo=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-De3mlDxS.cjs"),_=require("react");require("@phosphor-icons/react");const at="_wrapper_1vmyb_2",rt="_alignmentBlock_1vmyb_8",ct="_title_1vmyb_15",lt="_subtitle_1vmyb_22",dt="_alignmentContent_1vmyb_29",ut="_alignments_1vmyb_37",xt="_alignment_1vmyb_8",mt="_circle_1vmyb_60",pt="_paddings_1vmyb_67",jt="_padding_1vmyb_67",ht="_active_1vmyb_91",_t="_input_1vmyb_98",U={wrapper:at,alignmentBlock:rt,title:ct,subtitle:lt,alignmentContent:dt,alignments:ut,alignment:xt,circle:mt,paddings:pt,padding:jt,active:ht,input:_t},gt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],ft=["left","top","right","bottom"],Et=d=>{const{alignment:o,padding:e,setPadding:s,setAlignment:n}=d;function h(c){switch(c){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function m(c){switch(c){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[r,j]=_.useState(null),[v,B]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:U.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:U.alignments,children:gt.map(c=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(c)},className:U.alignment,onMouseEnter:()=>{j(c)},onMouseLeave:()=>{j(null)},children:[c!==o&&r!==c&&t.jsxRuntimeExports.jsx("div",{className:U.circle}),c!==o&&r===c&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(r),fill:"#c2c2c2",width:22,height:22}),c===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(o),fill:"#FF3F19",width:22,height:22})]},c))}),t.jsxRuntimeExports.jsx("div",{className:U.paddings,children:ft.map(c=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(U.padding,{[U.active]:v===c}),onFocus:()=>{B(c)},onBlur:()=>{B(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:m(c),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[c]),onChange:i=>s({...e,[c]:Math.min(Number(i),999)}),max:999,paddingless:!0,borderless:!0})]},c))})]})]})]})},Rt="_title_82zux_1",bt="_subtitle_82zux_5",vt="_header_82zux_12",yt="_text_82zux_13",It="_productsBlock_82zux_14",St="_top_82zux_26",Nt="_itemsBlock_82zux_35",kt="_typeTexts_82zux_41",Ct="_block_82zux_48",$t="_active_82zux_61",Bt="_products_82zux_14",wt="_product_82zux_14",Pt="_button_82zux_80",Mt="_disabled_82zux_91",Tt="_image_82zux_95",qt="_info_82zux_102",At="_name_82zux_114",Ot="_buttons_82zux_118",Lt="_modal_82zux_125",zt="_link_82zux_145",Dt="_modalOptions_82zux_151",Ut="_addButton_82zux_157",Ht="_deleteButton_82zux_179",H={title:Rt,subtitle:bt,header:vt,text:yt,productsBlock:It,top:St,itemsBlock:Nt,typeTexts:kt,block:Ct,active:$t,products:Bt,product:wt,button:Pt,disabled:Mt,image:Tt,info:qt,name:At,buttons:Ot,modal:Lt,link:zt,modalOptions:Dt,addButton:Ut,deleteButton:Ht},Ft=d=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,other:h,title:m,subtitle:r,draggable:j=!1,withImage:v=!1,addable:B=!0,itemsOptions:c,hasRangeSelector:i=!1,rangeSelectorOptions:g,limit:E,autoScrollInterval:p,deletable:R}=d;function N(a){if(v)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const z=(a,k=!1)=>{const P=c.find(q=>q.id===a);if(!P)return;const F=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[j&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const u=[...s],I=c.find(f=>f.name===q);if(!I)return;const w=I.id,l=u.map(f=>f===a?w:f);n([...l])},value:P.name,options:c.filter(q=>!s.find(u=>u===q.id)).map(q=>q.name),leftAddon:N(P.images)}),k&&t.jsxRuntimeExports.jsx("div",{className:H.buttons,children:t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(q=>q!==a))})})})]});return t.jsxRuntimeExports.jsx("div",{className:H.product,children:F},a)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(m||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:m}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:a=>e==null?void 0:e(a)})]}),i&&g&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...g}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:r}),s.map(a=>z(a,R)),B&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(E&&E<=s.length||s.length===c.length)}),size:"s",disabled:!!(E&&E<=s.length||s.length===c.length),onClick:()=>{const a=[...s];let k=null;if(c){for(let P=0;P<c.length;P++)if(!s.find(F=>F===c[P].id)){k=c[P];break}}a.push((k==null?void 0:k.id)||c[0].id),n(a)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),h!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:h}),p!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(p.scrollInterval),onChange:a=>p.setScrollInterval(Number(a)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Vt="_title_roi3a_1",Yt="_subtitle_roi3a_5",Wt="_header_roi3a_12",Gt="_text_roi3a_13",Qt="_productsBlock_roi3a_14",Xt="_top_roi3a_26",Jt="_itemsBlock_roi3a_35",Kt="_typeTexts_roi3a_41",Zt="_block_roi3a_48",te="_active_roi3a_61",ee="_products_roi3a_14",se="_product_roi3a_14",ne="_button_roi3a_80",ie="_disabled_roi3a_91",oe="_image_roi3a_95",ae="_info_roi3a_102",re="_name_roi3a_114",ce="_buttons_roi3a_118",le="_modal_roi3a_125",de="_link_roi3a_145",ue="_modalOptions_roi3a_151",xe="_addButton_roi3a_164",me="_deleteButton_roi3a_179",pe="_closeIcon_roi3a_191",L={title:Vt,subtitle:Yt,header:Wt,text:Gt,productsBlock:Qt,top:Xt,itemsBlock:Jt,typeTexts:Kt,block:Zt,active:te,products:ee,product:se,button:ne,disabled:ie,image:oe,info:ae,name:re,buttons:ce,modal:le,link:de,modalOptions:ue,addButton:xe,deleteButton:me,closeIcon:pe};function je({product:d,children:o}){const{attributes:e,listeners:s,setNodeRef:n,transform:h,transition:m,isDragging:r}=t.useSortable({id:d.id}),j={transform:t.CSS.Transform.toString(h),transition:m};return t.jsxRuntimeExports.jsx("div",{ref:n,style:j,className:`${L.product} ${r?L.dragging:""}`,...e,...s,children:o})}const he=d=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,title:h,subtitle:m,editable:r=!0,draggable:j=!1,deletable:v=!0,addable:B=!0,itemsType:c,itemsOptions:i,addableOptions:g={},limit:E}=d,[p,R]=_.useState(null),[N,z]=_.useState(null),a=_.useRef(null),k=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(p){const u=[...s].map(I=>I.id===p.id?p:I);n(u)}},[p]),_.useEffect(()=>{a.current&&N&&(a.current.getBoundingClientRect().height,N.top)},[a.current,N]);const P=(u,I)=>{u.stopPropagation();const w=u.target.getBoundingClientRect();z({top:w.top+window.scrollY,left:w.left-30}),R(I)},F=u=>{const{active:I,over:w}=u;if(w&&I.id!==w.id){const l=s.findIndex(S=>S.id===I.id),f=s.findIndex(S=>S.id===w.id);if(l!==-1&&f!==-1){const S=[...s],[O]=S.splice(l,1);S.splice(f,0,O),n(S)}}},q=(u,I)=>{const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[j&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),c==="select"&&i&&t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{const f=[...s],S=i.find($=>$.name===l);if(!S)return;const O=f.map($=>$.id===u.id?{...S,name:{"en-US":l}}:$);R({...u,name:{"en-US":l}}),n([...O])},value:u.name,options:i.filter(l=>!s.find(f=>f.name===l.name)).map(l=>l.name)}),t.jsxRuntimeExports.jsxs("div",{className:L.buttons,children:[r&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:l=>P(l,u)})}),v&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(l=>l.id!==u.id))})})]})]});return j?t.jsxRuntimeExports.jsx(je,{product:u,index:I,children:w},u.id):t.jsxRuntimeExports.jsx("div",{className:L.product,children:w},u.id)};return t.jsxRuntimeExports.jsxs("div",{className:L.productsBlock,children:[(h||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[h&&t.jsxRuntimeExports.jsx("h3",{className:L.title,children:h}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:u=>e==null?void 0:e(u)})]}),t.jsxRuntimeExports.jsxs("div",{className:L.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:L.subtitle,children:m}),j?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:k,onDragEnd:F,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(u=>u.id),strategy:t.verticalListSortingStrategy,children:s.map((u,I)=>q(u,I))})}):s.map((u,I)=>q(u,I)),B&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(L.button,{[L.disabled]:!!(E&&E<=s.length||s.length===(i==null?void 0:i.length))}),size:"s",disabled:!!(E&&E<=s.length||s.length===(i==null?void 0:i.length)),onClick:()=>{const u=[...s];let I=null;if(i){for(let w=0;w<i.length;w++)if(!s.find(l=>l.id===i[w].id)){I=i[w];break}}c==="select"&&i&&u.push({name:I?I.name:i[0].name,id:(I==null?void 0:I.id)||i[0].id,...g}),n(u)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:L.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function _e(d){const{product:o,children:e}=d,{attributes:s,listeners:n,setNodeRef:h,transform:m,transition:r,isDragging:j}=t.useSortable({id:o.id}),v={transform:t.CSS.Transform.toString(m),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:h,style:v,className:`${t.styles.product} ${j?t.styles.dragging:""}`,...s,...n,children:e})}const ge=d=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,other:h,title:m,subtitle:r,editable:j=!0,draggable:v=!1,withImage:B=!1,deletable:c=!0,addable:i=!0,itemsType:g,itemsPlaceholder:E="",itemsOptions:p,hasRangeSelector:R=!1,rangeSelectorOptions:N,modalOptions:z,addableOptions:a={}}=d,[k,P]=_.useState(null),[F,q]=_.useState({top:0,left:0}),[u,I]=_.useState(null),w=_.useRef(null),[l,f]=_.useState(!1),S=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const x=()=>{P(null),f(!1)};return document.body.addEventListener("click",x),P(null),f(!1),()=>{P(null),f(!1),document.body.removeEventListener("click",x)}},[]),_.useEffect(()=>{if(k){const x=[...s].map(M=>M.id===k.id?k:M);n(x)}},[k]),_.useEffect(()=>{if(w.current&&u){const x=w.current.getBoundingClientRect().height,M=window.innerHeight;let C=u.top;C+x>M+window.scrollY-200&&(C=M+window.scrollY-x-200),C<0&&(C=10),q({top:C,left:u.left})}},[w.current,u]);const O=(x,M)=>{x.stopPropagation();const C=x.target.getBoundingClientRect();I({top:C.top+window.scrollY,left:C.left-30}),P(M),f(!0)};function $(x){if(B)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const A=x=>{const{active:M,over:C}=x;if(C&&M.id!==C.id){const T=s.findIndex(D=>D.id===M.id),Q=s.findIndex(D=>D.id===C.id);if(T!==-1&&Q!==-1){const D=[...s],[V]=D.splice(T,1);D.splice(Q,0,V),n(D)}}},Y=x=>{var C;const M=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[v&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:T=>{const D=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":T}}:V);P({...x,name:{"en-US":T}}),n([...D])},value:x.name["en-US"],options:p.filter(T=>!s.find(Q=>Q.name["en-US"]===T)),leftAddon:$(x.images)}),g==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:T=>{const D=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":T}}:V);n([...D])},value:x.name["en-US"],placeholder:E}),g==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:T=>{const D=[...s].map(V=>V.id===x.id?{...x,images:T}:V);n([...D])},activeImage:(C=s.find(T=>T.id===x.id))==null?void 0:C.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[j&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:T=>O(T,x)})}),c&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(T=>T.id!==x.id))})})]})]});return v?t.jsxRuntimeExports.jsx(_e,{product:x,children:M},x.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:M},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(m||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:m}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:x=>e==null?void 0:e(x)})]}),k&&j&&z&&l&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:w,activeItem:k,setActiveItem:P,popupPosition:F,modalOptions:z,setIsOpenModal:f}),R&&N&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...N}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:r}),v?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:S,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map(x=>Y(x))})}):s.map(x=>Y(x)),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles.button,size:"s",onClick:()=>{const x=[...s];let M=null;if(p){for(let C=0;C<p.length;C++)if(!s.find(T=>T.name["en-US"]===p[C])){M=p[C];break}}g==="select"&&p?x.push({name:{"en-US":M||p[0]},id:t.v4(),...a,maxSymbols:100}):g==="input"?x.push({name:{"en-US":""},id:t.v4(),...a,maxSymbols:100}):x.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...a,maxSymbols:100}),n(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),h!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:h})]})},fe="_subtitle_jql1y_1",Ee="_header_jql1y_8",Re="_text_jql1y_9",be="_productsBlock_jql1y_10",ve="_buttonsBlock_jql1y_11",ye="_top_jql1y_23",Ie="_itemsBlock_jql1y_32",Se="_typeTexts_jql1y_38",Ne="_block_jql1y_45",ke="_active_jql1y_58",Ce="_products_jql1y_10",$e="_product_jql1y_10",Be="_button_jql1y_11",we="_image_jql1y_88",Pe="_info_jql1y_95",Me="_name_jql1y_107",Te="_buttons_jql1y_11",qe="_modal_jql1y_118",Ae="_other_jql1y_138",Oe="_options_jql1y_144",Le="_addButton_jql1y_150",ze="_deleteButton_jql1y_165",W={subtitle:fe,header:Ee,text:Re,productsBlock:be,buttonsBlock:ve,top:ye,itemsBlock:Ie,typeTexts:Se,block:Ne,active:ke,products:Ce,product:$e,button:Be,image:we,info:Pe,name:Me,buttons:Te,modal:qe,other:Ae,options:Oe,addButton:Le,deleteButton:ze},Z=d=>{const{buttons:o,setButtons:e,deletable:s=!0,addable:n=!0,editableLink:h=!0}=d,{pages:m}=t.usePagesStore(),[r,j]=_.useState(null),[v,B]=_.useState({top:0,left:0}),[c,i]=_.useState(null),g=_.useRef(null);_.useEffect(()=>{if(r){const p=[...o].map(R=>R.id===r.id?r:R);e(p)}},[r]),_.useEffect(()=>{if(g.current&&c){const p=g.current.getBoundingClientRect().height,R=window.innerHeight;let N=c.top;N+p>R+window.scrollY-200&&(N=R+window.scrollY-p-200),N<0&&(N=10),B({top:N,left:c.left})}},[g.current,c]);const E=(p,R)=>{p.stopPropagation();const N=p.target.getBoundingClientRect();i({top:N.top+window.scrollY-70,left:N.left-(n?30:65)}),j(R)};return t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:"Button Type"}),o.map(p=>t.jsxRuntimeExports.jsxs("div",{className:W.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const z=[...o].map(a=>a.id===p.id?{...p,type:R}:a);e(z)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:W.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>{E(R,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const R=o.filter(N=>N.id!==p.id);e(R)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),r&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:g,activeButton:r,setActiveButton:j,popupPosition:v,editableLink:h}),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:W.button,size:"s",onClick:()=>{const p=[...o];h?p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:m?Object.values(m)[0].name:"Home",openInNewTab:!1}):p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:m?Object.values(m)[0].name:"Home",openInNewTab:!1}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},De=d=>{const{isActiveButtons:o,setIsActiveButtons:e,buttons:s,setButtons:n,editableLink:h=!0}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:m=>e(m)})]}),o&&t.jsxRuntimeExports.jsx(Z,{buttons:s,setButtons:n,editableLink:h})]})})};function Ue(d){const{product:o,children:e}=d,{attributes:s,listeners:n,setNodeRef:h,transform:m,transition:r,isDragging:j}=t.useSortable({id:String(o.listingId)}),v={transform:t.CSS.Transform.toString(m),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:h,style:v,className:`${t.styles$2.product} ${j?t.styles$2.dragging:""}`,...s,...n,children:e})}const He=d=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:n,other:h,title:m,subtitle:r,editable:j=!0,draggable:v=!1,withImage:B=!1,deletable:c=!0,addable:i=!0,itemsType:g,itemsOptions:E}=d,[p,R]=_.useState(null),[N,z]=_.useState({top:0,left:0}),[a,k]=_.useState(!1),P=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const l=()=>{R(null),k(!1)};return document.body.addEventListener("click",l),R(null),k(!1),()=>{R(null),k(!1),document.body.removeEventListener("click",l)}},[]),_.useEffect(()=>{if(p){const l=[...s].map(f=>f.listingId===p.listingId?p:f);n(l)}},[p]);const F=(l,f)=>{l.stopPropagation();const S=l.target.getBoundingClientRect(),O=100,$=window.innerHeight;let A=S.top+window.scrollY;A+O>$&&(A=$-O-20),k(!0),z({top:A-80,left:S.left-30}),R(f)};function q(l){if(B)return l?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const u=l=>{const{active:f,over:S}=l;if(S&&f.id!==S.id){const O=s.findIndex(A=>String(A.listingId)===f.id),$=s.findIndex(A=>String(A.listingId)===S.id);if(O!==-1&&$!==-1){const A=[...s],[Y]=A.splice(O,1);A.splice($,0,Y),n(A)}}},I=(l,f)=>{const S=E.find($=>l.listingId===$.id);if(!S)return null;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[v&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:$=>{const A=[...s],Y=E.find(C=>C.productData.name===$);if(!Y)return;const x={listingId:Y.id,image:Y.productData.images.length>0?Y.productData.images[0].cfId:""},M=A.map(C=>C.listingId===l.listingId?x:C);R(x),n([...M])},value:S.productData.name,options:[...E.filter($=>!s.find(A=>A.listingId===$.id)).map($=>$.productData.name)],leftAddon:q(l.image||S.productData.images.length>0&&S.productData.images[0].cfId||"")},f),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[j&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:$=>F($,l)})}),c&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter($=>$!==l))})})]})]});return v?t.jsxRuntimeExports.jsx(Ue,{product:l,children:O},l.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:O},l.listingId)},w=_.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(m||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:m}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:l=>e==null?void 0:e(l)})]}),a&&p&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:w,activeItem:p,setActiveItem:R,setIsOpenModal:k,popupPosition:N,itemsOptions:E}),o&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:r}),v?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:P,onDragEnd:u,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(l=>String(l.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((l,f)=>I(l,f))})}):s.map((l,f)=>I(l,f)),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const l=[...s];for(let f=0;f<E.length;f++)if(!s.find(S=>S.listingId===E[f].id)){l.push({listingId:E[f].id,image:E[f].productData.images.length>0?E[f].productData.images[0].cfId:""});break}n(l)},disabled:s.length===E.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),o&&h!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:h})]})},Fe="_options_6cemk_1",Ve="_price_6cemk_12",Ye="_oldPrice_6cemk_19",We="_newPrice_6cemk_27",Ge="_animate_6cemk_34",Qe="_appearAndBounce_6cemk_1",Xe="_meta_6cemk_52",Je="_info_6cemk_58",Ke="_infoRight_6cemk_66",Ze="_buttons_6cemk_73",ts="_variants_6cemk_80",es="_variant_6cemk_80",ss="_stock_6cemk_98",ns="_variantInfo_6cemk_105",is="_quantity_6cemk_111",os="_count_6cemk_118",as="_focused_6cemk_135",rs="_button_6cemk_73",cs="_activeVariant_6cemk_161",ls="_chargeTypes_6cemk_165",ds="_charge_6cemk_165",us="_chargeActive_6cemk_190",xs="_title_6cemk_198",y={options:Fe,price:Ve,oldPrice:Ye,newPrice:We,animate:Ge,appearAndBounce:Qe,meta:Xe,info:Je,infoRight:Ke,buttons:Ze,variants:ts,variant:es,stock:ss,variantInfo:ns,quantity:is,count:os,focused:as,button:rs,activeVariant:cs,chargeTypes:ls,charge:ds,chargeActive:us,title:xs};var tt=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(tt||{});const ms=d=>{var N,z;const{variants:o}=d,[e,s]=_.useState(o[0]),[n,h]=_.useState(e.chargeTypes[0]),m=t.useNavigate(),[r,j]=_.useState(1),{reset:v,addProductToCart:B,getProducts:c}=t.useCart(),[i,g]=_.useState(!1);_.useEffect(()=>{g(!0);const a=setTimeout(()=>g(!1),600);return()=>clearTimeout(a)},[r]);async function E(){await c(),await B({productId:d.id,productVariantId:e.id,quantity:r})}function p(){v(),E(),m("/checkout")}function R(a){if(a>=864e5){const u=Math.floor(a/864e5);return`${u} ${u===1?"day":"days"}`}else if(a>=36e5){const u=Math.floor(a/36e5);return`${u} ${u===1?"hour":"hours"}`}else if(a>=6e4){const u=Math.floor(a/6e4);return`${u} ${u===1?"minute":"minutes"}`}else{const u=Math.floor(a/1e3);return`${u} ${u===1?"second":"seconds"}`}}return _.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&j(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:y.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:y.chargeTypes,children:e.chargeTypes.map(a=>t.jsxRuntimeExports.jsx("div",{className:t.clx(y.charge,{[y.chargeActive]:n===a}),onClick:()=>h(a),children:tt[a]},a))}),t.jsxRuntimeExports.jsx("div",{className:y.variants,children:o.map(a=>{var k;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(y.variant,{[y.activeVariant]:e.id===a.id}),onClick:()=>s(a),children:[t.jsxRuntimeExports.jsxs("div",{className:y.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:y.title,children:a.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",n==="ONE_TIME"?a.price.amount:a.subscriptionSettings?a.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:y.stock,children:[((k=a.quantity.restrictions)==null?void 0:k.max)||a.quantity.available||0," in stock"]})})]},a.id)})}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:y.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{r>1?j(a=>a-1):j(1)},className:y.button,disabled:e.quantity.available===0||e.quantity.restrictions&&r<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(r),onChange:a=>j(Number(a)),max:((N=e.quantity.restrictions)==null?void 0:N.max)||e.quantity.available||1/0,min:((z=e.quantity.restrictions)==null?void 0:z.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{j(a=>a+1)},className:y.button,disabled:!!(e.quantity.restrictions&&r>=e.quantity.restrictions.max||e.quantity.available!==void 0&&r>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:y.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:y.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:y.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":R(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:y.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:y.infoRight,children:n==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:y.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(y.newPrice,{[y.animate]:i}),children:["$ ",(e.price.amount||0)*r]}),t.jsxRuntimeExports.jsxs("span",{className:y.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*r]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(y.newPrice,{[y.animate]:i}),children:["$ ",(e.price.amount||0)*r]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:y.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(y.newPrice,{[y.animate]:i}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:y.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(y.newPrice,{[y.animate]:i}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:y.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>p(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:n==="ONE_TIME"?"Buy Now":"Subscribe Now"}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>E(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},ps="_button_1tdo3_1",js="_login_1tdo3_14",hs="_signUp_1tdo3_18",_s="_buttons_1tdo3_23",gs="_modal_1tdo3_32",fs="_closing_1tdo3_64",Es="_info_1tdo3_113",Rs="_top_1tdo3_120",bs="_title_1tdo3_131",vs="_clear_1tdo3_138",ys="_activeClear_1tdo3_145",Is="_count_1tdo3_149",Ss="_cart_1tdo3_164",Ns="_empty_1tdo3_172",ks="_product_1tdo3_198",Cs="_products_1tdo3_207",$s="_image_1tdo3_215",Bs="_productInfo_1tdo3_221",ws="_content_1tdo3_228",Ps="_name_1tdo3_234",Ms="_price_1tdo3_240",Ts="_productButtons_1tdo3_246",qs="_productButton_1tdo3_246",As="_productCount_1tdo3_266",Os="_bottom_1tdo3_282",Ls="_subtotal_1tdo3_290",zs="_block_1tdo3_298",Ds="_shoppingCount_1tdo3_305",Us="_total_1tdo3_325",Hs="_link_1tdo3_331",Fs="_userInfo_1tdo3_338",Vs="_pagesMobileModal_1tdo3_349",Ys="_pagesMobileModalContent_1tdo3_363",Ws="_pagesMobileModalHeader_1tdo3_369",Gs="_pagesMobileModalFooter_1tdo3_379",b={button:ps,login:js,signUp:hs,buttons:_s,modal:gs,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:fs,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Es,top:Rs,title:bs,clear:vs,activeClear:ys,count:Is,cart:Ss,empty:Ns,product:ks,products:Cs,image:$s,productInfo:Bs,content:ws,name:Ps,price:Ms,productButtons:Ts,productButton:qs,productCount:As,bottom:Os,subtotal:Ls,block:zs,shoppingCount:Ds,total:Us,link:Hs,userInfo:Fs,pagesMobileModal:Vs,pagesMobileModalContent:Ys,pagesMobileModalHeader:Ws,pagesMobileModalFooter:Gs},Qs=d=>{const{shopping:o,signUp:e,isShowUserInfo:s=!0}=d;return t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[o&&t.jsxRuntimeExports.jsx(et,{}),s&&t.jsxRuntimeExports.jsx(K,{signUp:e})]})},et=()=>{const[d,o]=_.useState(!1),[e,s]=_.useState([]),{cart:n,getProducts:h}=t.useCart();function m(i){for(let g=0;g<n.parts.length;g++)for(let E=0;E<i.variants.length;E++)if(n.parts[g].productVariantId===i.variants[g].id)return n.parts[g].productVariantId}function r(i){for(let g=0;g<n.parts.length;g++)for(let E=0;E<i.variants.length;E++)if(n.parts[g].productVariantId===i.variants[g].id)return n.parts[g].quantity}_.useEffect(()=>{(async()=>{const g=n.parts.map(R=>String(R.productId)),p=(await h([...g])).map(R=>({...R,activeVariantId:m(R),quantity:r(R)}));s(p)})()},[n.parts.length]);function j(i){var g;return!i||!(i!=null&&i.variants)?!1:(g=i.variants.find(E=>E.id===i.activeVariantId))==null?void 0:g.subscriptionSettings}const v=n.parts.length>0&&e.length>0&&!j(e[0]),[B,c]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10},onClick:i=>{i.stopPropagation(),window.location.pathname.includes("/admin/builder")||(o(!0),c(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),v&&t.jsxRuntimeExports.jsx("div",{className:b.shoppingCount,children:n.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{c(!1),setTimeout(()=>{o(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(st,{activeProducts:e,isCartNotEmpty:v,isOpen:B})})]})},st=d=>{const{activeProducts:o,isCartNotEmpty:e,isOpen:s}=d,{cart:n,reset:h,getTotalAndDiscount:m,updateQuantityOfProduct:r}=t.useCart(),j=t.useNavigate();function v(i){j(i)}function B(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity+1})}function c(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.modal,{[b.closing]:!s}),onClick:i=>i.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:b.top,children:[t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{className:b.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:b.count,children:n.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(b.clear,{[b.activeClear]:e}),disabled:!e,onClick:h,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:b.cart,children:[t.jsxRuntimeExports.jsx("div",{className:b.products,children:o.map(i=>t.jsxRuntimeExports.jsxs("div",{className:b.product,children:[t.jsxRuntimeExports.jsxs("div",{className:b.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:b.image}),t.jsxRuntimeExports.jsxs("div",{className:b.content,children:[t.jsxRuntimeExports.jsx("div",{className:b.name,children:i.name}),t.jsxRuntimeExports.jsxs("div",{className:b.price,children:["$",i.variants.find(g=>g.id===i.activeVariantId).price.amount*((i==null?void 0:i.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{i.quantity!==1&&c(i)},className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:b.productCount,children:i.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>B(i),className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},i.id))}),t.jsxRuntimeExports.jsxs("div",{className:b.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:b.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:b.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:b.total,children:["$",m().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>v("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(nt,{})]})},nt=()=>t.jsxRuntimeExports.jsxs("div",{className:b.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:b.link,children:"view products"})]})]}),K=({signUp:d})=>{const o=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=o,s=t.useNavigate();function n(r){window.location.pathname.includes("/admin/builder")||s(r)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),d&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[h,m]=_.useState("test-email@gmail.com");return _.useEffect(()=>{(async()=>{const j=t.jwtDecode(e);m(j.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:b.userInfo,onClick:()=>n("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:h||"test-email@gmail.com"})})},it=({children:d,logo:o,setIsOpen:e,signUp:s})=>{const{setIsOpen:n}=t.useModalStore(),h=()=>{n(!1),setTimeout(()=>{e(!1),n(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModal,onClick:m=>m.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:o}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:h,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalContent,children:d}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(K,{signUp:s})})]})},Xs=({children:d,logo:o,signUp:e})=>{const[s,n]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(ot,{setIsOpenModal:n}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsx(it,{logo:o,setIsOpen:n,signUp:e,children:d})})]})},ot=d=>{const{setIsOpenModal:o}=d;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),o(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Js="_share_xddz7_1",Ks="_modal_xddz7_8",Zs="_header_xddz7_20",tn="_socials_xddz7_30",en="_social_xddz7_30",sn="_copy_xddz7_40",nn="_title_xddz7_47",on="_copyWrapper_xddz7_53",an="_copyText_xddz7_62",rn="_copyTextMobile_xddz7_75",cn="_copyTextMiniMobile_xddz7_94",G={share:Js,modal:Ks,header:Zs,socials:tn,social:en,copy:sn,title:nn,copyWrapper:on,copyText:an,copyTextMobile:rn,copyTextMiniMobile:cn},ln=()=>{const{isOpenModal:d,setIsOpenModal:o}=t.useShareLinkStore();function e(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:G.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(dn,{})})]})},dn=()=>{const{setIsOpenModal:d}=t.useShareLinkStore(),{notification:o,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),n=window.location.href;function h(){navigator.clipboard.writeText(n),e({message:"Link copied to clipboard",status:"success"})}function m(){s(!1),setTimeout(()=>{d(!1),s(!0)},300)}function r(j,v){return j.length>v?j.slice(0,v)+"...":j}return t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:j=>j.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsx("div",{className:G.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:m,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:G.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:h,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:G.copyText,children:r(n,100)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMobile,children:r(n,40)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMiniMobile,children:r(n,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:h,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},un="_accordion_1s1lq_1",xn="_header_1s1lq_9",mn="_icon_1s1lq_18",pn="_open_1s1lq_21",jn="_content_1s1lq_25",X={accordion:un,header:xn,icon:mn,open:pn,content:jn},hn=({title:d,content:o,defaultOpen:e=!1})=>{const[s,n]=_.useState(e),[h,m]=_.useState(0),r=_.useRef(null),j=()=>{n(!s)};return _.useEffect(()=>{r.current&&m(s?r.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:X.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,onClick:j,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(X.icon,{[X.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:r,className:X.content,style:{height:`${h}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:o})})]})},_n=({children:d,path:o,className:e,target:s="_self",id:n})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:n,children:d});const h=t.useNavigate(),m=/^https?:\/\//.test(o),r=j=>{m||s==="_blank"?s==="_blank"?window.open(o,"_blank"):window.location.href=o:(j.preventDefault(),h(o,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:r,className:e,role:"link",style:{cursor:"pointer"},id:n,children:d})},gn="_buttonsBlock_1b2rb_1",fn="_slideUp_1b2rb_1",En={buttonsBlock:gn,slideUp:fn},Rn=()=>t.jsxRuntimeExports.jsxs("div",{className:En.buttonsBlock,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:"Buy"})]}),bn="_wrapper_st58d_1",vn="_label_st58d_10",yn="_textarea_st58d_18",In="_length_st58d_33",J={wrapper:bn,label:vn,textarea:yn,length:In},Sn=d=>{const{onChange:o,label:e,value:s,maxLength:n,placeholder:h="Type something...",type:m="text"}=d,[r,j]=_.useState(s.length);function v(B){return m==="number"?B.replace(/[^\d\n]+/g,""):B}return t.jsxRuntimeExports.jsxs("div",{className:J.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:J.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,value:s,onChange:B=>{const c=v(B.target.value);j(c.length),o(c)},placeholder:h,className:J.textarea,maxLength:n}),n&&t.jsxRuntimeExports.jsxs("div",{className:J.length,children:[r,"/",n]})]})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=hn;exports.BurgerMenuButton=ot;exports.ButtonTypeSettings=Z;exports.ButtonsSettings=De;exports.CategorySettings=Ft;exports.EmptyCart=nt;exports.FormSettings=ge;exports.HeaderButtons=Qs;exports.LayoutSettings=Et;exports.Link=_n;exports.ListingSelector=He;exports.PagesMobileMenu=Xs;exports.PagesMobileModal=it;exports.PagesSettings=he;exports.ProductCardButtons=Rn;exports.ProductOptions=ms;exports.ShareLink=ln;exports.ShoppingButton=et;exports.ShoppingModalCart=st;exports.TextareaUI=Sn;exports.UserInfo=K;