@billgangcom/theme-lib 1.66.2 → 1.66.4

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"),t=require("./index-yNJDaEUC.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.ReCaptchaProvider=t.q2;exports.aspectRatioOptions=t.aspectRatioOptions;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.bi;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-Bt0EfByO.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.ReCaptchaProvider=t.q2;exports.aspectRatioOptions=t.aspectRatioOptions;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.bi;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { App as o, ColorVariables as t, createTicket as s, hotReload as p, iconNames as r } from "./builder.es.js";
2
- import { q as c, a as l, s as n, b as R } from "./index-B-Mm1sSt.js";
2
+ import { q as c, a as l, s as n, b as R } from "./index-Du7rjeR9.js";
3
3
  export {
4
4
  o as App,
5
5
  t as ColorVariables,
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-yNJDaEUC.cjs"),_=require("react"),ct="_wrapper_kh9z8_2",lt="_block_kh9z8_8",ut="_title_kh9z8_16",dt="_subtitle_kh9z8_23",xt="_alignmentContent_kh9z8_30",pt="_alignments_kh9z8_39",mt="_alignment_kh9z8_30",jt="_circle_kh9z8_64",ht="_paddings_kh9z8_71",_t="_padding_kh9z8_71",gt="_active_kh9z8_97",ft="_input_kh9z8_104",V={wrapper:ct,block:lt,title:ut,subtitle:dt,alignmentContent:xt,alignments:pt,alignment:mt,circle:jt,paddings:ht,padding:_t,active:gt,input:ft},vt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Et=["left","top","right","bottom"],Rt=a=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:c=!0,isPadding:u=!0}=a;function p(m){switch(m){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 j(m){switch(m){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[d,$]=_.useState(null),[E,n]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:V.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:V.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:V.alignmentContent,children:[c&&t.jsxRuntimeExports.jsxs("div",{className:V.block,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:V.alignments,children:vt.map(m=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(m)},className:V.alignment,onMouseEnter:()=>{$(m)},onMouseLeave:()=>{$(null)},children:[m!==i&&d!==m&&t.jsxRuntimeExports.jsx("div",{className:V.circle}),m!==i&&d===m&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(d),fill:"#c2c2c2",width:22,height:22}),m===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(i),fill:"#FF3F19",width:22,height:22})]},m))})]}),u&&t.jsxRuntimeExports.jsxs("div",{className:V.block,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:V.paddings,children:Et.map(m=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(V.padding,{[V.active]:E===m}),onFocus:()=>{n(m)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:j(m),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[m]),onChange:r=>s({...o,[m]:Math.min(Number(r),999)}),max:999,paddingless:!0,borderless:!0})]},m))})]})]})]})},yt="_title_82zux_1",bt="_subtitle_82zux_5",It="_header_82zux_12",St="_text_82zux_13",Nt="_productsBlock_82zux_14",$t="_top_82zux_26",kt="_itemsBlock_82zux_35",Ct="_typeTexts_82zux_41",Bt="_block_82zux_48",wt="_active_82zux_61",Pt="_products_82zux_14",qt="_product_82zux_14",Tt="_button_82zux_80",Mt="_disabled_82zux_91",At="_image_82zux_95",Ot="_info_82zux_102",Dt="_name_82zux_114",Lt="_buttons_82zux_118",zt="_modal_82zux_125",Ft="_link_82zux_145",Vt="_modalOptions_82zux_151",Ut="_addButton_82zux_157",Ht="_deleteButton_82zux_179",U={title:yt,subtitle:bt,header:It,text:St,productsBlock:Nt,top:$t,itemsBlock:kt,typeTexts:Ct,block:Bt,active:wt,products:Pt,product:qt,button:Tt,disabled:Mt,image:At,info:Ot,name:Dt,buttons:Lt,modal:zt,link:Ft,modalOptions:Vt,addButton:Ut,deleteButton:Ht};function Yt({id:a,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:c,transition:u,isDragging:p}=t.useSortable({id:a}),j={transform:t.CSS.Transform.toString(c),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${U.product} ${p?U.dragging:""}`,...o,...s,children:i})}const Wt=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,tags:u,title:p,subtitle:j,draggable:d=!1,withImage:$=!1,addable:E=!0,itemsOptions:n,hasRangeSelector:m=!1,rangeSelectorOptions:r,limit:w,autoScrollInterval:h,deletable:y,aspectRatio:b,setAspectRatio:T}=a,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),A=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const v=s.findIndex(P=>P===I.id),k=s.findIndex(P=>P===S.id);if(v!==-1&&k!==-1){const P=[...s],[g]=P.splice(v,1);P.splice(k,0,g),e(P)}}};function f(x){if($)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 L=(x,I=!1)=>{const S=n.find(k=>k.id===x);if(!S)return;const v=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:k=>{const P=[...s],g=n.find(l=>l.name===k);if(!g)return;const q=g.id,z=P.map(l=>l===x?q:l);e([...z])},value:S.name,options:n.filter(k=>!s.find(P=>P===k.id)).map(k=>k.name),leftAddonOptions:n.map(k=>({value:k.name,addon:f(k.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:U.buttons,children:t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(k=>k!==x))})})})]});return d?t.jsxRuntimeExports.jsx(Yt,{id:x,children:v},t.v4()):t.jsxRuntimeExports.jsx("div",{className:U.product,children:v},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(p||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[p&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:p}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),m&&r&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...r}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[j&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:j}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>L(x,y))})}):s.map(x=>L(x,y)),E&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!(w&&w<=s.length||s.length===n.length)}),size:"s",disabled:!!(w&&w<=s.length||s.length===n.length),onClick:()=>{const x=[...s];let I=null;if(n){for(let S=0;S<n.length;S++)if(!s.find(v=>v===n[S].id)){I=n[S];break}}x.push((I==null?void 0:I.id)||n[0].id),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),b&&T&&t.jsxRuntimeExports.jsx(t.Select,{value:b,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>T(x),leftAddonOptions:t.aspectRatioOptions}),u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:u}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c}),h!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(h.scrollInterval),onChange:x=>h.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Gt="_title_roi3a_1",Xt="_subtitle_roi3a_5",Qt="_header_roi3a_12",Jt="_text_roi3a_13",Kt="_productsBlock_roi3a_14",Zt="_top_roi3a_26",te="_itemsBlock_roi3a_35",ee="_typeTexts_roi3a_41",se="_block_roi3a_48",ne="_active_roi3a_61",ie="_products_roi3a_14",oe="_product_roi3a_14",re="_button_roi3a_80",ae="_disabled_roi3a_91",ce="_image_roi3a_95",le="_info_roi3a_102",ue="_name_roi3a_114",de="_buttons_roi3a_118",xe="_modal_roi3a_125",pe="_link_roi3a_145",me="_modalOptions_roi3a_151",je="_addButton_roi3a_164",he="_deleteButton_roi3a_179",_e="_closeIcon_roi3a_191",F={title:Gt,subtitle:Xt,header:Qt,text:Jt,productsBlock:Kt,top:Zt,itemsBlock:te,typeTexts:ee,block:se,active:ne,products:ie,product:oe,button:re,disabled:ae,image:ce,info:le,name:ue,buttons:de,modal:xe,link:pe,modalOptions:me,addButton:je,deleteButton:he,closeIcon:_e};function ge({product:a,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:c,transition:u,isDragging:p}=t.useSortable({id:a.id}),j={transform:t.CSS.Transform.toString(c),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${F.product} ${p?F.dragging:""}`,...o,...s,children:i})}const fe=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:c,subtitle:u,editable:p=!0,draggable:j=!1,deletable:d=!0,addable:$=!0,itemsType:E,itemsOptions:n,addableOptions:m={},limit:r}=a,[w,h]=_.useState(null),[y,b]=_.useState(null),T=_.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(w){const x=[...s].map(I=>I.id===w.id?w:I);e(x)}},[w]),_.useEffect(()=>{T.current&&y&&(T.current.getBoundingClientRect().height,y.top)},[T.current,y]);const A=(x,I)=>{x.stopPropagation();const S=x.target.getBoundingClientRect();b({top:S.top+window.scrollY,left:S.left-30}),h(I)},f=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const v=s.findIndex(P=>P.id===I.id),k=s.findIndex(P=>P.id===S.id);if(v!==-1&&k!==-1){const P=[...s],[g]=P.splice(v,1);P.splice(k,0,g),e(P)}}},L=(x,I)=>{const S=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})}),E==="select"&&n&&t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const k=[...s],P=n.find(q=>q.name===v);if(!P)return;const g=k.map(q=>q.id===x.id?{...P,name:{"en-US":v}}:q);h({...x,name:{"en-US":v}}),e([...g])},value:x.name,options:n.filter(v=>!s.find(k=>k.name===v.name)).map(v=>v.name)}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[p&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>A(v,x)})}),d&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(v=>v.id!==x.id))})})]})]});return j?t.jsxRuntimeExports.jsx(ge,{product:x,index:I,children:S},x.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:S},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:u}),j?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:f,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>L(x,I))})}):s.map((x,I)=>L(x,I)),$&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(r&&r<=s.length||s.length===(n==null?void 0:n.length))}),size:"s",disabled:!!(r&&r<=s.length||s.length===(n==null?void 0:n.length)),onClick:()=>{const x=[...s];let I=null;if(n){for(let S=0;S<n.length;S++)if(!s.find(v=>v.id===n[S].id)){I=n[S];break}}E==="select"&&n&&x.push({name:I?I.name:n[0].name,id:(I==null?void 0:I.id)||n[0].id,...m}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function ve(a){const{product:i,children:o}=a,{attributes:s,listeners:e,setNodeRef:c,transform:u,transition:p,isDragging:j}=t.useSortable({id:i.id}),d={transform:t.CSS.Transform.toString(u),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:c,style:d,className:`${t.styles.product} ${j?t.styles.dragging:""}`,...s,...e,children:o})}const Ee=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,title:u,subtitle:p,editable:j=!0,draggable:d=!1,deletable:$=!0,addable:E=!0,itemsType:n,itemsPlaceholder:m="",itemsOptions:r,hasRangeSelector:w=!1,rangeSelectorOptions:h,modalOptions:y,addableOptions:b={},limit:T}=a,[D,A]=_.useState(null),[f,L]=_.useState({top:0,left:0}),[x,I]=_.useState(null),S=_.useRef(null),[v,k]=_.useState(!1),P=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const l=()=>{A(null),k(!1)};return document.body.addEventListener("click",l),A(null),k(!1),()=>{A(null),k(!1),document.body.removeEventListener("click",l)}},[]),_.useEffect(()=>{if(D){const l=[...s].map(B=>B.id===D.id?D:B);e(l)}},[D]),_.useEffect(()=>{if(S.current&&x){const l=S.current.getBoundingClientRect().height,B=window.innerHeight;let R=x.top;R+l>B+window.scrollY-200&&(R=B+window.scrollY-l-200),R<0&&(R=10),L({top:R,left:x.left})}},[S.current,x]);const g=(l,B)=>{l.stopPropagation();const R=l.target.getBoundingClientRect();I({top:R.top+window.scrollY,left:R.left-30}),A(B),k(!0)},q=l=>{const{active:B,over:R}=l;if(R&&B.id!==R.id){const M=s.findIndex(O=>O.id===B.id),W=s.findIndex(O=>O.id===R.id);if(M!==-1&&W!==-1){const O=[...s],[Y]=O.splice(M,1);O.splice(W,0,Y),e(O)}}},z=l=>{var R;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),n==="select"&&r&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,name:{"en-US":M}}:Y);A({...l,name:{"en-US":M}}),e([...O])},value:l.name["en-US"],options:r.filter(M=>!s.find(W=>W.name["en-US"]===M))}),n==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,name:{"en-US":M}}:Y);e([...O])},value:l.name["en-US"],placeholder:m}),n==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,images:M}:Y);e([...O])},activeImage:(R=s.find(M=>M.id===l.id))==null?void 0:R.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:M=>g(M,l)})}),$&&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:()=>e(s.filter(M=>M.id!==l.id))})})]})]});return d?t.jsxRuntimeExports.jsx(ve,{product:l,children:B},l.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:B},l.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:l=>o==null?void 0:o(l)})]}),D&&j&&y&&v&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:S,activeItem:D,setActiveItem:A,popupPosition:f,modalOptions:y,setIsOpenModal:k}),w&&h&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...h}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:p}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:P,onDragEnd:q,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(l=>l.id),strategy:t.verticalListSortingStrategy,children:s.map(l=>z(l))})}):s.map(l=>z(l)),E&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(T&&T<=s.length)}),size:"s",disabled:!!(T&&T<=s.length),onClick:()=>{const l=[...s];let B=null;if(r){for(let R=0;R<r.length;R++)if(!s.find(M=>M.name["en-US"]===r[R])){B=r[R];break}}n==="select"&&r?l.push({name:{"en-US":B||r[0]},id:t.v4(),...b,maxSymbols:100}):n==="input"?l.push({name:{"en-US":""},id:t.v4(),...b,maxSymbols:100}):l.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...b,maxSymbols:100}),e(l)},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})]})})})]}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c})]})},Re="_subtitle_jql1y_1",ye="_header_jql1y_8",be="_text_jql1y_9",Ie="_productsBlock_jql1y_10",Se="_buttonsBlock_jql1y_11",Ne="_top_jql1y_23",$e="_itemsBlock_jql1y_32",ke="_typeTexts_jql1y_38",Ce="_block_jql1y_45",Be="_active_jql1y_58",we="_products_jql1y_10",Pe="_product_jql1y_10",qe="_button_jql1y_11",Te="_image_jql1y_88",Me="_info_jql1y_95",Ae="_name_jql1y_107",Oe="_buttons_jql1y_11",De="_modal_jql1y_118",Le="_other_jql1y_138",ze="_options_jql1y_144",Fe="_addButton_jql1y_150",Ve="_deleteButton_jql1y_165",G={subtitle:Re,header:ye,text:be,productsBlock:Ie,buttonsBlock:Se,top:Ne,itemsBlock:$e,typeTexts:ke,block:Ce,active:Be,products:we,product:Pe,button:qe,image:Te,info:Me,name:Ae,buttons:Oe,modal:De,other:Le,options:ze,addButton:Fe,deleteButton:Ve},et=a=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:c=!0}=a,{pages:u}=t.usePagesStore(),[p,j]=_.useState(null),[d,$]=_.useState({top:0,left:0}),[E,n]=_.useState(null),m=_.useRef(null);_.useEffect(()=>{if(p){const h=[...i].map(y=>y.id===p.id?p:y);o(h)}},[p]),_.useEffect(()=>{if(m.current&&E){const h=m.current.getBoundingClientRect().height,y=window.innerHeight;let b=E.top;b+h>y+window.scrollY-200&&(b=y+window.scrollY-h-200),b<0&&(b=10),$({top:b,left:E.left})}},[m.current,E]);const r=(h,y)=>{h.stopPropagation();const b=h.target.getBoundingClientRect();n({top:b.top+window.scrollY-70,left:b.left-(e?30:65)}),j(y)},w=(h,y)=>{const b=[...i],T={...h,id:Math.random().toString(36).substr(2,9)};b.splice(y+1,0,T),o(b)};return t.jsxRuntimeExports.jsxs("div",{className:G.products,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Button Type"}),i.map((h,y)=>t.jsxRuntimeExports.jsxs("div",{className:G.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const D=[...i].map(A=>A.id===h.id?{...h,type:b}:A);o(D)},value:h.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:G.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{w(h,y)}})}),t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:b=>{r(b,h)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const b=i.filter(T=>T.id!==h.id);o(b)},width:20,height:20,fill:"#C12A2A"})})]})]},h.id)),p&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:m,activeButton:p,setActiveButton:j,popupPosition:d,editableLink:c}),e&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:G.button,size:"s",onClick:()=>{const h=[...i];c?h.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:u?Object.values(u)[0].path:"/",openInNewTab:!1}):h.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:u?Object.values(u)[0].path:"/",openInNewTab:!1}),o(h)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:G.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ue=a=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:c=!0,addable:u=!0,deletable:p=!0}=a;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:i,onChange:j=>o(j)})]}),i&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:c,addable:u,deletable:p})]})})};function He(a){const{product:i,children:o}=a,{attributes:s,listeners:e,setNodeRef:c,transform:u,transition:p,isDragging:j}=t.useSortable({id:String(i.listingId)}),d={transform:t.CSS.Transform.toString(u),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:c,style:d,className:`${t.styles$2.product} ${j?t.styles$2.dragging:""}`,...s,...e,children:o})}const Ye=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,title:u,subtitle:p,editable:j=!0,draggable:d=!1,withImage:$=!1,deletable:E=!0,addable:n=!0,itemsType:m,itemsOptions:r,limit:w,aspectRatio:h,setAspectRatio:y}=a,[b,T]=_.useState(null),[D,A]=_.useState({top:0,left:0}),[f,L]=_.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const g=()=>{T(null),L(!1)};return document.body.addEventListener("click",g),T(null),L(!1),()=>{T(null),L(!1),document.body.removeEventListener("click",g)}},[]),_.useEffect(()=>{if(b){const g=[...s].map(q=>q.listingId===b.listingId?b:q);e(g)}},[b]);const I=(g,q)=>{g.stopPropagation();const z=g.target.getBoundingClientRect(),l=100,B=window.innerHeight;let R=z.top+window.scrollY;R+l>B&&(R=B-l-20),L(!0),A({top:R-80,left:z.left-30}),T(q)};function S(g){if($)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const v=g=>{const{active:q,over:z}=g;if(z&&q.id!==z.id){const l=s.findIndex(R=>String(R.listingId)===q.id),B=s.findIndex(R=>String(R.listingId)===z.id);if(l!==-1&&B!==-1){const R=[...s],[M]=R.splice(l,1);R.splice(B,0,M),e(R)}}},k=g=>{const q=r.find(l=>g.listingId===l.id);if(!q)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{const B=[...s],R=r.find(O=>O.productData.name===l);if(!R)return;const M={listingId:R.id,image:R.productData.images.length>0?R.productData.images[0].cfId:""},W=B.map(O=>O.listingId===g.listingId?M:O);T(M),e([...W])},value:q.productData.name,options:[...r.filter(l=>!s.find(B=>B.listingId===l.id)).map(l=>l.productData.name)],leftAddonOptions:r.map(l=>{var B;return{value:l.productData.name,addon:S(((B=l.productData.images[0])==null?void 0:B.cfId)||"")}})}),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:l=>I(l,g)})}),E&&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:()=>e(s.filter(l=>l!==g))})})]})]});return d?t.jsxRuntimeExports.jsx(He,{product:g,children:z},g.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},g.listingId)},P=_.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>o==null?void 0:o(g)})]}),f&&b&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:P,activeItem:b,setActiveItem:T,setIsOpenModal:L,popupPosition:D,itemsOptions:r}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:p}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:v,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(g=>k(g))})}):s.map(g=>k(g)),n&&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 g=[...s];for(let q=0;q<r.length;q++)if(!s.find(z=>z.listingId===r[q].id)){g.push({listingId:r[q].id,image:r[q].productData.images.length>0?r[q].productData.images[0].cfId:""});break}e(g)},disabled:s.length===(w||r.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})]})})})]}),h&&y&&t.jsxRuntimeExports.jsx(t.Select,{value:h,options:Object.keys(t.aspectRatio),onChange:g=>y(g),leftAddonOptions:t.aspectRatioOptions}),i&&c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c})]})},We="_options_1vlf9_1",Ge="_price_1vlf9_13",Xe="_oldPrice_1vlf9_20",Qe="_newPrice_1vlf9_28",Je="_animate_1vlf9_35",Ke="_appearAndBounce_1vlf9_1",Ze="_meta_1vlf9_53",ts="_info_1vlf9_59",es="_infoRight_1vlf9_67",ss="_buttons_1vlf9_74",ns="_variants_1vlf9_81",is="_variant_1vlf9_81",os="_stock_1vlf9_99",rs="_variantInfo_1vlf9_106",as="_quantity_1vlf9_112",cs="_count_1vlf9_119",ls="_focused_1vlf9_136",us="_button_1vlf9_74",ds="_activeVariant_1vlf9_162",xs="_chargeTypes_1vlf9_166",ps="_charge_1vlf9_166",ms="_chargeActive_1vlf9_191",js="_title_1vlf9_199",C={options:We,price:Ge,oldPrice:Xe,newPrice:Qe,animate:Je,appearAndBounce:Ke,meta:Ze,info:ts,infoRight:es,buttons:ss,variants:ns,variant:is,stock:os,variantInfo:rs,quantity:as,count:cs,focused:ls,button:us,activeVariant:ds,chargeTypes:xs,charge:ps,chargeActive:ms,title:js};var K=(a=>(a.ONE_TIME="One-Time",a.RECURRING="Subscribe & Save",a))(K||{});const st=a=>{var D,A;const{product:i,setIsOpen:o}=a,{variants:s}=i,[e,c]=_.useState(s[0]),[u,p]=_.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),j=t.useNavigate(),[d,$]=_.useState(1),{reset:E,addProductToCart:n,addProducts:m}=t.di(),[r,w]=_.useState(!1),{pageContext:h}=t.usePagesStore();_.useEffect(()=>{w(!0);const f=setTimeout(()=>w(!1),600);return()=>clearTimeout(f)},[d]);async function y(){await m((h==null?void 0:h.products)||[]),await n({productId:i.id,productVariantId:e.id,quantity:d}),o==null||o(!1)}function b(){E(),y(),j("/checkout")}function T(f){if(f>=864e5){const v=Math.floor(f/864e5);return`${v} ${v===1?"day":"days"}`}else if(f>=36e5){const v=Math.floor(f/36e5);return`${v} ${v===1?"hour":"hours"}`}else if(f>=6e4){const v=Math.floor(f/6e4);return`${v} ${v===1?"minute":"minutes"}`}else{const v=Math.floor(f/1e3);return`${v} ${v===1?"second":"seconds"}`}}return _.useEffect(()=>{e.quantity&&e.quantity.available===0&&$(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:C.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:C.chargeTypes,children:e.chargeTypes.map(f=>t.jsxRuntimeExports.jsx("div",{className:t.clx(C.charge,{[C.chargeActive]:u===f}),onClick:()=>p(f),children:K[f]},f))}),t.jsxRuntimeExports.jsx("div",{className:C.variants,children:s.map(f=>{var L,x;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(C.variant,{[C.activeVariant]:e.id===f.id}),onClick:()=>c(f),children:[t.jsxRuntimeExports.jsxs("div",{className:C.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:t.splitTextIntoSpans(f.name)}),t.jsxRuntimeExports.jsxs("span",{children:["$",u==="ONE_TIME"?f.price.amount:f.subscriptionSettings?f.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:u==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:C.stock,children:[(L=f.quantity.restrictions)!=null&&L.max||f.quantity.available!==void 0?((x=f.quantity.restrictions)==null?void 0:x.max)||f.quantity.available:"∞"," ","in stock"]})})]},f.id)})}),u==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:C.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{d>1?$(f=>f-1):$(1)},className:C.button,disabled:e.quantity.available&&e.quantity.restrictions&&d<=e.quantity.restrictions.min||e.quantity.available===0,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(d),onChange:f=>$(Number(f)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((A=e.quantity.restrictions)==null?void 0:A.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&d>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{$(f=>f+1)},className:C.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&d>=e.quantity.restrictions.max||e.quantity.available===0),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:C.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:C.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":T(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:C.infoRight,children:u==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",(e.price.amount||0)*d]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*d]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",(e.price.amount||0)*d]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>b(),disabled:e.quantity&&e.quantity.available===0,children:u==="ONE_TIME"?"Buy Now":"Subscribe Now"}),u==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>y(),disabled:e.quantity&&e.quantity.available===0,children:"Add to Cart"})]})]})},hs="_button_14q75_1",_s="_login_14q75_14",gs="_signUp_14q75_18",fs="_buttons_14q75_23",vs="_modal_14q75_32",Es="_closing_14q75_64",Rs="_info_14q75_113",ys="_top_14q75_120",bs="_title_14q75_131",Is="_clear_14q75_138",Ss="_activeClear_14q75_145",Ns="_count_14q75_149",$s="_cart_14q75_164",ks="_empty_14q75_172",Cs="_product_14q75_198",Bs="_products_14q75_207",ws="_image_14q75_215",Ps="_productInfo_14q75_230",qs="_content_14q75_237",Ts="_name_14q75_243",Ms="_price_14q75_249",As="_productButtons_14q75_255",Os="_productButton_14q75_255",Ds="_productCount_14q75_272",Ls="_bottom_14q75_289",zs="_subtotal_14q75_297",Fs="_block_14q75_305",Vs="_shoppingCount_14q75_312",Us="_total_14q75_332",Hs="_link_14q75_338",Ys="_userInfo_14q75_345",Ws="_pagesMobileModal_14q75_356",Gs="_pagesMobileModalContent_14q75_370",Xs="_pagesMobileModalHeader_14q75_376",Qs="_pagesMobileModalFooter_14q75_386",N={button:hs,login:_s,signUp:gs,buttons:fs,modal:vs,"slide-in-fade":"_slide-in-fade_14q75_1","mobile-slide-in-fade":"_mobile-slide-in-fade_14q75_1",closing:Es,"mobile-slide-out-fade":"_mobile-slide-out-fade_14q75_1","slide-out-fade":"_slide-out-fade_14q75_1",info:Rs,top:ys,title:bs,clear:Is,activeClear:Ss,count:Ns,cart:$s,empty:ks,product:Cs,products:Bs,image:ws,productInfo:Ps,content:qs,name:Ts,price:Ms,productButtons:As,productButton:Os,productCount:Ds,bottom:Ls,subtotal:zs,block:Fs,shoppingCount:Vs,total:Us,link:Hs,userInfo:Ys,pagesMobileModal:Ws,pagesMobileModalContent:Gs,pagesMobileModalHeader:Xs,pagesMobileModalFooter:Qs},Js=a=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=a;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[a,i]=_.useState(!1),[o,s]=_.useState([]),{cart:e}=t.di(),{pageContext:c}=t.usePagesStore();function u(n){if(n.variants.length>0){for(let m=0;m<e.parts.length;m++)for(let r=0;r<n.variants.length;r++)if(n.variants[r]&&e.parts[m].productVariantId===n.variants[r].id)return e.parts[m].productVariantId}return n.variants[0].id}function p(n){for(let m=0;m<e.parts.length;m++)for(let r=0;r<n.variants.length;r++)if(n.variants[r]&&e.parts[m].productVariantId===n.variants[r].id)return e.parts[m].quantity}_.useEffect(()=>{(async()=>{var h;const m=e.parts.map(y=>String(y.productId)),w=(((h=c==null?void 0:c.products)==null?void 0:h.filter(y=>m.includes(String(y.id))))||[]).map(y=>({...y,activeVariantId:u(y),quantity:p(y)}));s(w)})()},[e.parts]);function j(n){var m;return!n||!(n!=null&&n.variants)?!1:(m=n.variants.find(r=>r.id===n.activeVariantId))==null?void 0:m.subscriptionSettings}const d=e.parts.length>0&&o.length>0&&!j(o[0]),[$,E]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:n=>{n.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),E(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-primary)"}),d&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:e.parts.length})]}),a&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{E(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:d,isOpen:$})})]})},it=a=>{const{activeProducts:i,isCartNotEmpty:o,isOpen:s}=a,{cart:e,reset:c,getTotalAndDiscount:u,updateQuantityOfProduct:p}=t.di(),j=t.useNavigate();function d(n){j(n)}function $(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1})}function E(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsxs("div",{className:N.info,children:[t.jsxRuntimeExports.jsx("span",{className:N.title,children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,children:e.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:c,children:"Clear all"})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:i.map(n=>t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[n.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:N.image}):t.jsxRuntimeExports.jsx("div",{className:N.image,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsxs("div",{className:N.content,children:[t.jsxRuntimeExports.jsx("div",{className:N.name,children:t.splitTextIntoSpans(n.name)}),t.jsxRuntimeExports.jsxs("div",{className:N.price,children:["$",n.variants.find(m=>m.id===n.activeVariantId).price.amount*((n==null?void 0:n.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n.quantity!==1&&E(n)},className:N.productButton,disabled:n.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.productCount,children:n.quantity}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>$(n),className:N.productButton,disabled:n.quantity===n.variants.find(m=>m.id===n.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},n.id))}),t.jsxRuntimeExports.jsxs("div",{className:N.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:N.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:N.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:N.total,children:["$",u().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>d("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:N.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-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:N.link,children:"view products"})]})]}),tt=({signUp:a,close:i})=>{const o=JSON.parse(localStorage.getItem("token")||"{}"),{data:s}=o,e=t.useNavigate();function c(j){window.location.pathname.includes("/admin/builder")||e(j)}if(!s)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),a&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[u,p]=_.useState("test-email@gmail.com");return _.useEffect(()=>{(async()=>{const d=t.jwtDecode(s);p(d.email)})()},[s]),t.jsxRuntimeExports.jsx("div",{className:N.userInfo,onClick:()=>{c("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:u||"test-email@gmail.com"})})},rt=({children:a,logo:i,setIsOpen:o,signUp:s})=>{const{setIsOpen:e}=t.useModalStore(),c=()=>{e(!1),setTimeout(()=>{o(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:c,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--text-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:a}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:c})})]})},Ks=({children:a,logo:i,signUp:o})=>{const[s,e]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),children:t.jsxRuntimeExports.jsx(rt,{logo:i,setIsOpen:e,signUp:o,children:a})})]})},at=a=>{const{setIsOpenModal:i}=a;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--text-primary)"})})},Zs="_share_10urc_1",tn="_modal_10urc_9",en="_header_10urc_21",sn="_socials_10urc_31",nn="_social_10urc_31",on="_copy_10urc_41",rn="_title_10urc_48",an="_copyWrapper_10urc_54",cn="_copyText_10urc_63",ln="_copyTextMobile_10urc_76",un="_copyTextMiniMobile_10urc_95",X={share:Zs,modal:tn,header:en,socials:sn,social:nn,copy:on,title:rn,copyWrapper:an,copyText:cn,copyTextMobile:ln,copyTextMiniMobile:un},dn=({title:a="Copy Product Link"})=>{const{isOpenModal:i,setIsOpenModal:o}=t.useShareLinkStore();function s(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:X.share,onClick:e=>{e.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),i&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(xn,{title:a})})]})},xn=({title:a="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notification:o,setNotification:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),c=window.location.href;function u(){navigator.clipboard.writeText(c),s({message:"Link copied to clipboard",status:"success"})}function p(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function j(d,$){return d.length>$?d.slice(0,$)+"...":d}return t.jsxRuntimeExports.jsxs("div",{className:X.modal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,children:[t.jsxRuntimeExports.jsx("div",{className:X.title,children:a}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:p,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:X.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:u,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:X.copyText,children:j(c,100)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMobile,children:j(c,40)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMiniMobile,children:j(c,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:u,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},pn="_accordion_1s1lq_1",mn="_header_1s1lq_9",jn="_icon_1s1lq_18",hn="_open_1s1lq_21",_n="_content_1s1lq_25",J={accordion:pn,header:mn,icon:jn,open:hn,content:_n},gn=({title:a,content:i,defaultOpen:o=!1})=>{const[s,e]=_.useState(o),[c,u]=_.useState(0),p=_.useRef(null),j=()=>{e(!s)};return _.useEffect(()=>{p.current&&u(s?p.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:j,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:a}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:p,className:J.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},fn=({children:a,path:i,className:o,target:s="_self",id:e})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:o,role:"link",style:{cursor:"pointer"},id:e,children:a});const c=t.useNavigate(),u=/^https?:\/\//.test(i),p=j=>{u||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.open(i,"_self"):(j.preventDefault(),c(i))};return t.jsxRuntimeExports.jsx("div",{onClick:p,className:o,role:"link",style:{cursor:"pointer"},id:e,children:a})},vn="_buttonsBlock_1b2rb_1",En="_slideUp_1b2rb_1",Rn={buttonsBlock:vn,slideUp:En},yn=a=>{var d,$;const{setIsOpen:i,setModalType:o,productId:s}=a,{cart:e}=t.di(),{pageContext:c}=t.usePagesStore(),u=(d=c==null?void 0:c.listings)==null?void 0:d.find(E=>E.id===s);if(!u)return null;const p=($=c==null?void 0:c.products)==null?void 0:$.find(E=>E.uniquePath===u.productData.uniquePath);if(!p)return null;const j=e.parts.find(E=>E.productId===p.id);return t.jsxRuntimeExports.jsxs("div",{className:Rn.buttonsBlock,onClick:E=>E.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),i(!0)},children:j?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),i(!0)},children:"Buy"})]})},bn="_wrapper_27wzz_1",In="_logo_27wzz_8",Sn="_info_27wzz_12",Z={wrapper:bn,logo:In,info:Sn},Nn=({date:a})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),c={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",c)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:Z.logo,children:i.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:Z.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:i.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(a)})]})]})},$n="_options_mju90_1",kn="_price_mju90_12",Cn="_oldPrice_mju90_19",Bn="_newPrice_mju90_27",wn="_animate_mju90_34",Pn="_appearAndBounce_mju90_1",qn="_meta_mju90_52",Tn="_info_mju90_58",Mn="_infoRight_mju90_66",An="_buttons_mju90_73",On="_variants_mju90_80",Dn="_variant_mju90_80",Ln="_stock_mju90_98",zn="_variantInfo_mju90_105",Fn="_quantity_mju90_111",Vn="_count_mju90_118",Un="_focused_mju90_135",Hn="_button_mju90_73",Yn="_activeVariant_mju90_161",Wn="_chargeTypes_mju90_165",Gn="_charge_mju90_165",Xn="_chargeActive_mju90_190",Qn="_title_mju90_198",Jn="_modal_mju90_204",Kn="_header_mju90_218",H={options:$n,price:kn,oldPrice:Cn,newPrice:Bn,animate:wn,appearAndBounce:Pn,meta:qn,info:Tn,infoRight:Mn,buttons:An,variants:On,variant:Dn,stock:Ln,variantInfo:zn,quantity:Fn,count:Vn,focused:Un,button:Hn,activeVariant:Yn,chargeTypes:Wn,charge:Gn,chargeActive:Xn,title:Qn,modal:Jn,header:Kn},Zn=a=>{var p,j;const{pageContext:i}=t.usePagesStore(),o=(p=i==null?void 0:i.listings)==null?void 0:p.find(d=>d.id===a.productId);if(!o)return;const s=(j=i==null?void 0:i.products)==null?void 0:j.find(d=>d.uniquePath===o.productData.uniquePath);if(!s)return;const e=s.variants[0],[c,u]=_.useState(e.chargeTypes&&e.chargeTypes.length>1?e.chargeTypes[0]:"ONE_TIME");return t.jsxRuntimeExports.jsxs("div",{className:H.modal,onClick:d=>d.stopPropagation(),children:[a.type==="Add To Cart"&&t.jsxRuntimeExports.jsx(ti,{variants:s.variants,activeVariant:e,activeChargeType:c,setActiveChargeType:u,productId:s.id,setIsOpen:a.setIsOpen}),a.type==="Buy Now"&&t.jsxRuntimeExports.jsx(ei,{product:s,setIsOpen:a.setIsOpen})]})},ti=a=>{const{variants:i,activeChargeType:o,setActiveChargeType:s,activeVariant:e,productId:c,setIsOpen:u}=a,{cart:p,addProductToCart:j,addProducts:d,updateQuantityOfProduct:$}=t.di(),{setNotification:E}=t.useNotificationStore(),{pageContext:n}=t.usePagesStore();async function m(r){const w=p.parts.find(h=>h.productId===a.productId&&h.productVariantId===r);w?$({productId:c,productVariantId:r,quantity:w.quantity+1}):(n!=null&&n.products&&await d(n.products),await j({productId:c,productVariantId:r,quantity:1})),E({message:"Product added to cart",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:H.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:H.header,children:[t.jsxRuntimeExports.jsx("div",{id:"h3",children:"Choose a variant"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>u(!1)})]}),e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:H.chargeTypes,children:e.chargeTypes.map(r=>t.jsxRuntimeExports.jsx("div",{className:t.clx(H.charge,{[H.chargeActive]:o===r}),onClick:()=>s(r),children:K[r]},r))}),t.jsxRuntimeExports.jsx("div",{className:H.variants,children:i.map(r=>{var w,h;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(H.variant),onClick:()=>{m(r.id),u(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:H.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:H.title,children:r.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?r.price.amount:r.subscriptionSettings?r.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:H.stock,children:[(w=r.quantity.restrictions)!=null&&w.max||r.quantity.available!==void 0?((h=r.quantity.restrictions)==null?void 0:h.max)||r.quantity.available:"∞"," ","in stock"]})})]},r.id)})})]})},ei=a=>{const{product:i,setIsOpen:o}=a;return t.jsxRuntimeExports.jsxs("div",{className:H.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:H.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(i.name)]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>o(!1),style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})]})},si="_wrapper_1efqk_1",ni="_label_1efqk_10",ii="_contentBorder_1efqk_19",oi="_contentField_1efqk_23",ri="_textarea_1efqk_27",ai="_length_1efqk_42",Q={wrapper:si,label:ni,contentBorder:ii,contentField:oi,textarea:ri,length:ai},ci=a=>{const{onChange:i,label:o,value:s,maxLength:e,placeholder:c="Type something...",type:u="text"}=a,[p,j]=_.useState(s.length),{themeSettings:d}=t.useThemeSettingsStore();function $(E){return u==="number"?E.replace(/[^\d\n]+/g,""):E}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[o&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:o,children:o}),t.jsxRuntimeExports.jsx("textarea",{id:o,value:s,onChange:E=>{const n=$(E.target.value);j(n.length),i(n)},placeholder:c,className:t.clx(Q.textarea,{[Q.contentBorder]:d.inputs.border.active,[Q.contentField]:d.inputs.field.active}),maxLength:e}),e&&t.jsxRuntimeExports.jsxs("div",{className:Q.length,children:[p,"/",e]})]})};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.SelectInfiniteList=t.SelectInfiniteList;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=gn;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ue;exports.CategorySettings=Wt;exports.ChargeTypes=K;exports.EmptyCart=ot;exports.FormSettings=Ee;exports.HeaderButtons=Js;exports.LayoutSettings=Rt;exports.Link=fn;exports.ListingSelector=Ye;exports.MetaInfoPost=Nn;exports.PagesMobileMenu=Ks;exports.PagesMobileModal=rt;exports.PagesSettings=fe;exports.ProductCardButtons=yn;exports.ProductCardModal=Zn;exports.ProductOptions=st;exports.ShareLink=dn;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.TextareaUI=ci;exports.UserInfo=tt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-Bt0EfByO.cjs"),j=require("react"),ct="_wrapper_kh9z8_2",lt="_block_kh9z8_8",dt="_title_kh9z8_16",ut="_subtitle_kh9z8_23",xt="_alignmentContent_kh9z8_30",pt="_alignments_kh9z8_39",mt="_alignment_kh9z8_30",ht="_circle_kh9z8_64",jt="_paddings_kh9z8_71",_t="_padding_kh9z8_71",gt="_active_kh9z8_97",ft="_input_kh9z8_104",V={wrapper:ct,block:lt,title:dt,subtitle:ut,alignmentContent:xt,alignments:pt,alignment:mt,circle:ht,paddings:jt,padding:_t,active:gt,input:ft},Et=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],vt=r=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:l=!0,isPadding:c=!0}=r;function p(u){switch(u){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(u){switch(u){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[h,S]=j.useState(null),[f,n]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:V.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:V.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:V.alignmentContent,children:[l&&t.jsxRuntimeExports.jsxs("div",{className:V.block,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:V.alignments,children:Et.map(u=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(u)},className:V.alignment,onMouseEnter:()=>{S(u)},onMouseLeave:()=>{S(null)},children:[u!==i&&h!==u&&t.jsxRuntimeExports.jsx("div",{className:V.circle}),u!==i&&h===u&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(h),fill:"#c2c2c2",width:22,height:22}),u===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(i),fill:"#FF3F19",width:22,height:22})]},u))})]}),c&&t.jsxRuntimeExports.jsxs("div",{className:V.block,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:V.paddings,children:Rt.map(u=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(V.padding,{[V.active]:f===u}),onFocus:()=>{n(u)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:m(u),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[u]),onChange:a=>s({...o,[u]:Math.min(Number(a),999)}),max:999,paddingless:!0,borderless:!0})]},u))})]})]})]})},yt="_title_82zux_1",bt="_subtitle_82zux_5",It="_header_82zux_12",St="_text_82zux_13",Nt="_productsBlock_82zux_14",$t="_top_82zux_26",Ct="_itemsBlock_82zux_35",kt="_typeTexts_82zux_41",qt="_block_82zux_48",wt="_active_82zux_61",Bt="_products_82zux_14",Pt="_product_82zux_14",Tt="_button_82zux_80",Mt="_disabled_82zux_91",At="_image_82zux_95",Ot="_info_82zux_102",Lt="_name_82zux_114",Dt="_buttons_82zux_118",zt="_modal_82zux_125",Ft="_link_82zux_145",Ut="_modalOptions_82zux_151",Vt="_addButton_82zux_157",Ht="_deleteButton_82zux_179",H={title:yt,subtitle:bt,header:It,text:St,productsBlock:Nt,top:$t,itemsBlock:Ct,typeTexts:kt,block:qt,active:wt,products:Bt,product:Pt,button:Tt,disabled:Mt,image:At,info:Ot,name:Lt,buttons:Dt,modal:zt,link:Ft,modalOptions:Ut,addButton:Vt,deleteButton:Ht};function Yt({id:r,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:l,transition:c,isDragging:p}=t.useSortable({id:r}),m={transform:t.CSS.Transform.toString(l),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:e,style:m,className:`${H.product} ${p?H.dragging:""}`,...o,...s,children:i})}const Wt=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,tags:c,title:p,subtitle:m,draggable:h=!1,withImage:S=!1,addable:f=!0,itemsOptions:n,hasRangeSelector:u=!1,rangeSelectorOptions:a,limit:w,autoScrollInterval:_,deletable:y,aspectRatio:b,setAspectRatio:T}=r,L=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),A=x=>{const{active:I,over:N}=x;if(N&&I.id!==N.id){const R=s.findIndex(B=>B===I.id),C=s.findIndex(B=>B===N.id);if(R!==-1&&C!==-1){const B=[...s],[g]=B.splice(R,1);B.splice(C,0,g),e(B)}}};function E(x){if(S)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 D=(x,I=!1)=>{const N=n.find(C=>C.id===x);if(!N)return;const R=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:C=>{const B=[...s],g=n.find(d=>d.name===C);if(!g)return;const P=g.id,z=B.map(d=>d===x?P:d);e([...z])},value:N.name,options:n.filter(C=>!s.find(B=>B===C.id)).map(C=>C.name),leftAddonOptions:n.map(C=>({value:C.name,addon:E(C.images)}))}),I&&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:()=>e(s.filter(C=>C!==x))})})})]});return h?t.jsxRuntimeExports.jsx(Yt,{id:x,children:R},t.v4()):t.jsxRuntimeExports.jsx("div",{className:H.product,children:R},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(p||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[p&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:p}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),u&&a&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...a}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:m}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:L,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>D(x,y))})}):s.map(x=>D(x,y)),f&&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]:!!(w&&w<=s.length||s.length===n.length)}),size:"s",disabled:!!(w&&w<=s.length||s.length===n.length),onClick:()=>{const x=[...s];let I=null;if(n){for(let N=0;N<n.length;N++)if(!s.find(R=>R===n[N].id)){I=n[N];break}}x.push((I==null?void 0:I.id)||n[0].id),e(x)},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})]})})})]}),b&&T&&t.jsxRuntimeExports.jsx(t.Select,{value:b,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>T(x),leftAddonOptions:t.aspectRatioOptions}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:c}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l}),_!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(_.scrollInterval),onChange:x=>_.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Gt="_title_roi3a_1",Xt="_subtitle_roi3a_5",Qt="_header_roi3a_12",Jt="_text_roi3a_13",Kt="_productsBlock_roi3a_14",Zt="_top_roi3a_26",te="_itemsBlock_roi3a_35",ee="_typeTexts_roi3a_41",se="_block_roi3a_48",ne="_active_roi3a_61",ie="_products_roi3a_14",oe="_product_roi3a_14",ae="_button_roi3a_80",re="_disabled_roi3a_91",ce="_image_roi3a_95",le="_info_roi3a_102",de="_name_roi3a_114",ue="_buttons_roi3a_118",xe="_modal_roi3a_125",pe="_link_roi3a_145",me="_modalOptions_roi3a_151",he="_addButton_roi3a_164",je="_deleteButton_roi3a_179",_e="_closeIcon_roi3a_191",F={title:Gt,subtitle:Xt,header:Qt,text:Jt,productsBlock:Kt,top:Zt,itemsBlock:te,typeTexts:ee,block:se,active:ne,products:ie,product:oe,button:ae,disabled:re,image:ce,info:le,name:de,buttons:ue,modal:xe,link:pe,modalOptions:me,addButton:he,deleteButton:je,closeIcon:_e};function ge({product:r,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:l,transition:c,isDragging:p}=t.useSortable({id:r.id}),m={transform:t.CSS.Transform.toString(l),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:e,style:m,className:`${F.product} ${p?F.dragging:""}`,...o,...s,children:i})}const fe=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:l,subtitle:c,editable:p=!0,draggable:m=!1,deletable:h=!0,addable:S=!0,itemsType:f,itemsOptions:n,addableOptions:u={},limit:a}=r,[w,_]=j.useState(null),[y,b]=j.useState(null),T=j.useRef(null),L=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(w){const x=[...s].map(I=>I.id===w.id?w:I);e(x)}},[w]),j.useEffect(()=>{T.current&&y&&(T.current.getBoundingClientRect().height,y.top)},[T.current,y]);const A=(x,I)=>{x.stopPropagation();const N=x.target.getBoundingClientRect();b({top:N.top+window.scrollY,left:N.left-30}),_(I)},E=x=>{const{active:I,over:N}=x;if(N&&I.id!==N.id){const R=s.findIndex(B=>B.id===I.id),C=s.findIndex(B=>B.id===N.id);if(R!==-1&&C!==-1){const B=[...s],[g]=B.splice(R,1);B.splice(C,0,g),e(B)}}},D=(x,I)=>{const N=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[m&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),f==="select"&&n&&t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const C=[...s],B=n.find(P=>P.name===R);if(!B)return;const g=C.map(P=>P.id===x.id?{...B,name:{"en-US":R}}:P);_({...x,name:{"en-US":R}}),e([...g])},value:x.name,options:n.filter(R=>!s.find(C=>C.name===R.name)).map(R=>R.name)}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[p&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>A(R,x)})}),h&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(R=>R.id!==x.id))})})]})]});return m?t.jsxRuntimeExports.jsx(ge,{product:x,index:I,children:N},x.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:N},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(l||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[l&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:l}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:c}),m?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:L,onDragEnd:E,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>D(x,I))})}):s.map((x,I)=>D(x,I)),S&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(a&&a<=s.length||s.length===(n==null?void 0:n.length))}),size:"s",disabled:!!(a&&a<=s.length||s.length===(n==null?void 0:n.length)),onClick:()=>{const x=[...s];let I=null;if(n){for(let N=0;N<n.length;N++)if(!s.find(R=>R.id===n[N].id)){I=n[N];break}}f==="select"&&n&&x.push({name:I?I.name:n[0].name,id:(I==null?void 0:I.id)||n[0].id,...u}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function Ee(r){const{product:i,children:o}=r,{attributes:s,listeners:e,setNodeRef:l,transform:c,transition:p,isDragging:m}=t.useSortable({id:i.id}),h={transform:t.CSS.Transform.toString(c),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:l,style:h,className:`${t.styles.product} ${m?t.styles.dragging:""}`,...s,...e,children:o})}const Re=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,title:c,subtitle:p,editable:m=!0,draggable:h=!1,deletable:S=!0,addable:f=!0,itemsType:n,itemsPlaceholder:u="",itemsOptions:a,hasRangeSelector:w=!1,rangeSelectorOptions:_,modalOptions:y,addableOptions:b={},limit:T}=r,[L,A]=j.useState(null),[E,D]=j.useState({top:0,left:0}),[x,I]=j.useState(null),N=j.useRef(null),[R,C]=j.useState(!1),B=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const d=()=>{A(null),C(!1)};return document.body.addEventListener("click",d),A(null),C(!1),()=>{A(null),C(!1),document.body.removeEventListener("click",d)}},[]),j.useEffect(()=>{if(L){const d=[...s].map(q=>q.id===L.id?L:q);e(d)}},[L]),j.useEffect(()=>{if(N.current&&x){const d=N.current.getBoundingClientRect().height,q=window.innerHeight;let v=x.top;v+d>q+window.scrollY-200&&(v=q+window.scrollY-d-200),v<0&&(v=10),D({top:v,left:x.left})}},[N.current,x]);const g=(d,q)=>{d.stopPropagation();const v=d.target.getBoundingClientRect();I({top:v.top+window.scrollY,left:v.left-30}),A(q),C(!0)},P=d=>{const{active:q,over:v}=d;if(v&&q.id!==v.id){const M=s.findIndex(O=>O.id===q.id),W=s.findIndex(O=>O.id===v.id);if(M!==-1&&W!==-1){const O=[...s],[Y]=O.splice(M,1);O.splice(W,0,Y),e(O)}}},z=d=>{var v;const q=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),n==="select"&&a&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const O=[...s].map(Y=>Y.id===d.id?{...d,name:{"en-US":M}}:Y);A({...d,name:{"en-US":M}}),e([...O])},value:d.name["en-US"],options:a.filter(M=>!s.find(W=>W.name["en-US"]===M))}),n==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:M=>{const O=[...s].map(Y=>Y.id===d.id?{...d,name:{"en-US":M}}:Y);e([...O])},value:d.name["en-US"],placeholder:u}),n==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:M=>{const O=[...s].map(Y=>Y.id===d.id?{...d,images:M}:Y);e([...O])},activeImage:(v=s.find(M=>M.id===d.id))==null?void 0:v.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[m&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>g(M,d)})}),S&&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:()=>e(s.filter(M=>M.id!==d.id))})})]})]});return h?t.jsxRuntimeExports.jsx(Ee,{product:d,children:q},d.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:q},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:d=>o==null?void 0:o(d)})]}),L&&m&&y&&R&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:N,activeItem:L,setActiveItem:A,popupPosition:E,modalOptions:y,setIsOpenModal:C}),w&&_&&t.jsxRuntimeExports.jsx(t.RangeSelector,{..._}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:p}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:B,onDragEnd:P,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(d=>d.id),strategy:t.verticalListSortingStrategy,children:s.map(d=>z(d))})}):s.map(d=>z(d)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(T&&T<=s.length)}),size:"s",disabled:!!(T&&T<=s.length),onClick:()=>{const d=[...s];let q=null;if(a){for(let v=0;v<a.length;v++)if(!s.find(M=>M.name["en-US"]===a[v])){q=a[v];break}}n==="select"&&a?d.push({name:{"en-US":q||a[0]},id:t.v4(),...b,maxSymbols:100}):n==="input"?d.push({name:{"en-US":""},id:t.v4(),...b,maxSymbols:100}):d.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...b,maxSymbols:100}),e(d)},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})]})})})]}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l})]})},ve="_subtitle_jql1y_1",ye="_header_jql1y_8",be="_text_jql1y_9",Ie="_productsBlock_jql1y_10",Se="_buttonsBlock_jql1y_11",Ne="_top_jql1y_23",$e="_itemsBlock_jql1y_32",Ce="_typeTexts_jql1y_38",ke="_block_jql1y_45",qe="_active_jql1y_58",we="_products_jql1y_10",Be="_product_jql1y_10",Pe="_button_jql1y_11",Te="_image_jql1y_88",Me="_info_jql1y_95",Ae="_name_jql1y_107",Oe="_buttons_jql1y_11",Le="_modal_jql1y_118",De="_other_jql1y_138",ze="_options_jql1y_144",Fe="_addButton_jql1y_150",Ue="_deleteButton_jql1y_165",G={subtitle:ve,header:ye,text:be,productsBlock:Ie,buttonsBlock:Se,top:Ne,itemsBlock:$e,typeTexts:Ce,block:ke,active:qe,products:we,product:Be,button:Pe,image:Te,info:Me,name:Ae,buttons:Oe,modal:Le,other:De,options:ze,addButton:Fe,deleteButton:Ue},et=r=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:l=!0}=r,{pages:c}=t.usePagesStore(),[p,m]=j.useState(null),[h,S]=j.useState({top:0,left:0}),[f,n]=j.useState(null),u=j.useRef(null);j.useEffect(()=>{if(p){const _=[...i].map(y=>y.id===p.id?p:y);o(_)}},[p]),j.useEffect(()=>{if(u.current&&f){const _=u.current.getBoundingClientRect().height,y=window.innerHeight;let b=f.top;b+_>y+window.scrollY-200&&(b=y+window.scrollY-_-200),b<0&&(b=10),S({top:b,left:f.left})}},[u.current,f]);const a=(_,y)=>{_.stopPropagation();const b=_.target.getBoundingClientRect();n({top:b.top+window.scrollY-70,left:b.left-(e?30:65)}),m(y)},w=(_,y)=>{const b=[...i],T={..._,id:Math.random().toString(36).substr(2,9)};b.splice(y+1,0,T),o(b)};return t.jsxRuntimeExports.jsxs("div",{className:G.products,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Button Type"}),i.map((_,y)=>t.jsxRuntimeExports.jsxs("div",{className:G.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const L=[...i].map(A=>A.id===_.id?{..._,type:b}:A);o(L)},value:_.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:G.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{w(_,y)}})}),t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:b=>{a(b,_)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const b=i.filter(T=>T.id!==_.id);o(b)},width:20,height:20,fill:"#C12A2A"})})]})]},_.id)),p&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:u,activeButton:p,setActiveButton:m,popupPosition:h,editableLink:l}),e&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:G.button,size:"s",onClick:()=>{const _=[...i];l?_.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:c?Object.values(c)[0].path:"/",openInNewTab:!1}):_.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:c?Object.values(c)[0].path:"/",openInNewTab:!1}),o(_)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:G.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ve=r=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:l=!0,addable:c=!0,deletable:p=!0}=r;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:i,onChange:m=>o(m)})]}),i&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:l,addable:c,deletable:p})]})})};function He(r){const{product:i,children:o}=r,{attributes:s,listeners:e,setNodeRef:l,transform:c,transition:p,isDragging:m}=t.useSortable({id:String(i.listingId)}),h={transform:t.CSS.Transform.toString(c),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:l,style:h,className:`${t.styles$2.product} ${m?t.styles$2.dragging:""}`,...s,...e,children:o})}const Ye=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,title:c,subtitle:p,editable:m=!0,draggable:h=!1,withImage:S=!1,deletable:f=!0,addable:n=!0,itemsType:u,itemsOptions:a,limit:w,aspectRatio:_,setAspectRatio:y}=r,[b,T]=j.useState(null),[L,A]=j.useState({top:0,left:0}),[E,D]=j.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const g=()=>{T(null),D(!1)};return document.body.addEventListener("click",g),T(null),D(!1),()=>{T(null),D(!1),document.body.removeEventListener("click",g)}},[]),j.useEffect(()=>{if(b){const g=[...s].map(P=>P.listingId===b.listingId?b:P);e(g)}},[b]);const I=(g,P)=>{g.stopPropagation();const z=g.target.getBoundingClientRect(),d=100,q=window.innerHeight;let v=z.top+window.scrollY;v+d>q&&(v=q-d-20),D(!0),A({top:v-80,left:z.left-30}),T(P)};function N(g){if(S)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const R=g=>{const{active:P,over:z}=g;if(z&&P.id!==z.id){const d=s.findIndex(v=>String(v.listingId)===P.id),q=s.findIndex(v=>String(v.listingId)===z.id);if(d!==-1&&q!==-1){const v=[...s],[M]=v.splice(d,1);v.splice(q,0,M),e(v)}}},C=g=>{const P=a.find(d=>g.listingId===d.id);if(!P)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),u==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:d=>{const q=[...s],v=a.find(O=>O.productData.name===d);if(!v)return;const M={listingId:v.id,image:v.productData.images.length>0?v.productData.images[0].cfId:""},W=q.map(O=>O.listingId===g.listingId?M:O);T(M),e([...W])},value:P.productData.name,options:[...a.filter(d=>!s.find(q=>q.listingId===d.id)).map(d=>d.productData.name)],leftAddonOptions:a.map(d=>{var q;return{value:d.productData.name,addon:N(((q=d.productData.images[0])==null?void 0:q.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[m&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:d=>I(d,g)})}),f&&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:()=>e(s.filter(d=>d!==g))})})]})]});return h?t.jsxRuntimeExports.jsx(He,{product:g,children:z},g.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},g.listingId)},B=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>o==null?void 0:o(g)})]}),E&&b&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:B,activeItem:b,setActiveItem:T,setIsOpenModal:D,popupPosition:L,itemsOptions:a}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:p}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:R,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(g=>C(g))})}):s.map(g=>C(g)),n&&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 g=[...s];for(let P=0;P<a.length;P++)if(!s.find(z=>z.listingId===a[P].id)){g.push({listingId:a[P].id,image:a[P].productData.images.length>0?a[P].productData.images[0].cfId:""});break}e(g)},disabled:s.length===(w||a.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})]})})})]}),_&&y&&t.jsxRuntimeExports.jsx(t.Select,{value:_,options:Object.keys(t.aspectRatio),onChange:g=>y(g),leftAddonOptions:t.aspectRatioOptions}),i&&l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l})]})},We="_options_1aiq8_1",Ge="_price_1aiq8_18",Xe="_oldPrice_1aiq8_25",Qe="_newPrice_1aiq8_33",Je="_animate_1aiq8_40",Ke="_appearAndBounce_1aiq8_1",Ze="_meta_1aiq8_58",ts="_info_1aiq8_64",es="_infoRight_1aiq8_72",ss="_buttons_1aiq8_79",ns="_variants_1aiq8_86",is="_variant_1aiq8_86",os="_stock_1aiq8_104",as="_variantInfo_1aiq8_111",rs="_quantity_1aiq8_117",cs="_count_1aiq8_124",ls="_focused_1aiq8_141",ds="_button_1aiq8_79",us="_activeVariant_1aiq8_167",xs="_chargeTypes_1aiq8_171",ps="_charge_1aiq8_171",ms="_chargeActive_1aiq8_196",hs="_title_1aiq8_204",k={options:We,price:Ge,oldPrice:Xe,newPrice:Qe,animate:Je,appearAndBounce:Ke,meta:Ze,info:ts,infoRight:es,buttons:ss,variants:ns,variant:is,stock:os,variantInfo:as,quantity:rs,count:cs,focused:ls,button:ds,activeVariant:us,chargeTypes:xs,charge:ps,chargeActive:ms,title:hs};var K=(r=>(r.ONE_TIME="One-Time",r.RECURRING="Subscribe & Save",r))(K||{});const st=r=>{var L,A;const{product:i,setIsOpen:o}=r,{variants:s}=i,[e,l]=j.useState(s[0]),[c,p]=j.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),m=t.useNavigate(),[h,S]=j.useState(1),{reset:f,addProductToCart:n,addProducts:u}=t.di(),[a,w]=j.useState(!1),{pageContext:_}=t.usePagesStore();j.useEffect(()=>{w(!0);const E=setTimeout(()=>w(!1),600);return()=>clearTimeout(E)},[h]);async function y(){await u((_==null?void 0:_.products)||[]),await n({productId:i.id,productVariantId:e.id,quantity:h}),o==null||o(!1)}function b(){f(),y(),m("/checkout")}function T(E){if(E>=864e5){const R=Math.floor(E/864e5);return`${R} ${R===1?"day":"days"}`}else if(E>=36e5){const R=Math.floor(E/36e5);return`${R} ${R===1?"hour":"hours"}`}else if(E>=6e4){const R=Math.floor(E/6e4);return`${R} ${R===1?"minute":"minutes"}`}else{const R=Math.floor(E/1e3);return`${R} ${R===1?"second":"seconds"}`}}return j.useEffect(()=>{e.quantity&&e.quantity.available===0&&S(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:k.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:k.chargeTypes,children:e.chargeTypes.map(E=>t.jsxRuntimeExports.jsx("div",{className:t.clx(k.charge,{[k.chargeActive]:c===E}),onClick:()=>p(E),children:K[E]},E))}),t.jsxRuntimeExports.jsx("div",{className:k.variants,children:s.map(E=>{var D,x;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(k.variant,{[k.activeVariant]:e.id===E.id}),onClick:()=>l(E),children:[t.jsxRuntimeExports.jsxs("div",{className:k.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:k.title,children:t.splitTextIntoSpans(E.name)}),t.jsxRuntimeExports.jsxs("span",{children:["$",c==="ONE_TIME"?E.price.amount:E.subscriptionSettings?E.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:c==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:k.stock,children:[(D=E.quantity.restrictions)!=null&&D.max||E.quantity.available!==void 0?((x=E.quantity.restrictions)==null?void 0:x.max)||E.quantity.available:"∞"," ","in stock"]})})]},E.id)})}),c==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:k.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{h>1?S(E=>E-1):S(1)},className:k.button,disabled:e.quantity.available&&e.quantity.restrictions&&h<=e.quantity.restrictions.min||e.quantity.available===0,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(h),onChange:E=>S(Number(E)),max:((L=e.quantity.restrictions)==null?void 0:L.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((A=e.quantity.restrictions)==null?void 0:A.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&h>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{S(E=>E+1)},className:k.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&h>=e.quantity.restrictions.max||e.quantity.available===0),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:k.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:k.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":T(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:k.infoRight,children:c==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:a}),children:["$ ",(e.price.amount||0)*h]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*h]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:a}),children:["$ ",(e.price.amount||0)*h]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>b(),disabled:e.quantity&&e.quantity.available===0,children:c==="ONE_TIME"?"Buy Now":"Subscribe Now"}),c==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>y(),disabled:e.quantity&&e.quantity.available===0,children:"Add to Cart"})]})]})},js="_button_14q75_1",_s="_login_14q75_14",gs="_signUp_14q75_18",fs="_buttons_14q75_23",Es="_modal_14q75_32",Rs="_closing_14q75_64",vs="_info_14q75_113",ys="_top_14q75_120",bs="_title_14q75_131",Is="_clear_14q75_138",Ss="_activeClear_14q75_145",Ns="_count_14q75_149",$s="_cart_14q75_164",Cs="_empty_14q75_172",ks="_product_14q75_198",qs="_products_14q75_207",ws="_image_14q75_215",Bs="_productInfo_14q75_230",Ps="_content_14q75_237",Ts="_name_14q75_243",Ms="_price_14q75_249",As="_productButtons_14q75_255",Os="_productButton_14q75_255",Ls="_productCount_14q75_272",Ds="_bottom_14q75_289",zs="_subtotal_14q75_297",Fs="_block_14q75_305",Us="_shoppingCount_14q75_312",Vs="_total_14q75_332",Hs="_link_14q75_338",Ys="_userInfo_14q75_345",Ws="_pagesMobileModal_14q75_356",Gs="_pagesMobileModalContent_14q75_370",Xs="_pagesMobileModalHeader_14q75_376",Qs="_pagesMobileModalFooter_14q75_386",$={button:js,login:_s,signUp:gs,buttons:fs,modal:Es,"slide-in-fade":"_slide-in-fade_14q75_1","mobile-slide-in-fade":"_mobile-slide-in-fade_14q75_1",closing:Rs,"mobile-slide-out-fade":"_mobile-slide-out-fade_14q75_1","slide-out-fade":"_slide-out-fade_14q75_1",info:vs,top:ys,title:bs,clear:Is,activeClear:Ss,count:Ns,cart:$s,empty:Cs,product:ks,products:qs,image:ws,productInfo:Bs,content:Ps,name:Ts,price:Ms,productButtons:As,productButton:Os,productCount:Ls,bottom:Ds,subtotal:zs,block:Fs,shoppingCount:Us,total:Vs,link:Hs,userInfo:Ys,pagesMobileModal:Ws,pagesMobileModalContent:Gs,pagesMobileModalHeader:Xs,pagesMobileModalFooter:Qs},Js=r=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=r;return t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[r,i]=j.useState(!1),[o,s]=j.useState([]),{cart:e}=t.di(),{pageContext:l}=t.usePagesStore();function c(n){if(n.variants.length>0){for(let u=0;u<e.parts.length;u++)for(let a=0;a<n.variants.length;a++)if(n.variants[a]&&e.parts[u].productVariantId===n.variants[a].id)return e.parts[u].productVariantId}return n.variants[0].id}function p(n){for(let u=0;u<e.parts.length;u++)for(let a=0;a<n.variants.length;a++)if(n.variants[a]&&e.parts[u].productVariantId===n.variants[a].id)return e.parts[u].quantity}j.useEffect(()=>{(async()=>{var _;const u=e.parts.map(y=>String(y.productId)),w=(((_=l==null?void 0:l.products)==null?void 0:_.filter(y=>u.includes(String(y.id))))||[]).map(y=>({...y,activeVariantId:c(y),quantity:p(y)}));s(w)})()},[e.parts]);function m(n){var u;return!n||!(n!=null&&n.variants)?!1:(u=n.variants.find(a=>a.id===n.activeVariantId))==null?void 0:u.subscriptionSettings}const h=e.parts.length>0&&o.length>0&&!m(o[0]),[S,f]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:n=>{n.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),f(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-primary)"}),h&&t.jsxRuntimeExports.jsx("div",{className:$.shoppingCount,children:e.parts.length})]}),r&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{f(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:h,isOpen:S})})]})},it=r=>{const{activeProducts:i,isCartNotEmpty:o,isOpen:s}=r,{cart:e,reset:l,getTotalAndDiscount:c,updateQuantityOfProduct:p}=t.di(),m=t.useNavigate();function h(n){m(n)}function S(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1})}function f(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx($.modal,{[$.closing]:!s}),onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[t.jsxRuntimeExports.jsxs("div",{className:$.info,children:[t.jsxRuntimeExports.jsx("span",{className:$.title,children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:$.count,children:e.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx($.clear,{[$.activeClear]:o}),disabled:!o,onClick:l,children:"Clear all"})]}),o?t.jsxRuntimeExports.jsxs("div",{className:$.cart,children:[t.jsxRuntimeExports.jsx("div",{className:$.products,children:i.map(n=>t.jsxRuntimeExports.jsxs("div",{className:$.product,children:[t.jsxRuntimeExports.jsxs("div",{className:$.productInfo,children:[n.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:$.image}):t.jsxRuntimeExports.jsx("div",{className:$.image,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsxs("div",{className:$.content,children:[t.jsxRuntimeExports.jsx("div",{className:$.name,children:t.splitTextIntoSpans(n.name)}),t.jsxRuntimeExports.jsxs("div",{className:$.price,children:["$",n.variants.find(u=>u.id===n.activeVariantId).price.amount*((n==null?void 0:n.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:$.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n.quantity!==1&&f(n)},className:$.productButton,disabled:n.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:$.productCount,children:n.quantity}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>S(n),className:$.productButton,disabled:n.quantity===n.variants.find(u=>u.id===n.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},n.id))}),t.jsxRuntimeExports.jsxs("div",{className:$.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:$.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:$.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:$.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>h("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:$.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-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:$.link,children:"view products"})]})]}),tt=({signUp:r,close:i})=>{const o=JSON.parse(localStorage.getItem("token")||"{}"),{data:s}=o,e=t.useNavigate();function l(m){window.location.pathname.includes("/admin/builder")||e(m)}if(!s)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{l("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),r&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{l("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[c,p]=j.useState("test-email@gmail.com");return j.useEffect(()=>{(async()=>{const h=t.jwtDecode(s);p(h.email)})()},[s]),t.jsxRuntimeExports.jsx("div",{className:$.userInfo,onClick:()=>{l("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:c||"test-email@gmail.com"})})},at=({children:r,logo:i,setIsOpen:o,signUp:s})=>{const{setIsOpen:e}=t.useModalStore(),l=()=>{e(!1),setTimeout(()=>{o(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:$.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:$.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:l,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--text-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:$.pagesMobileModalContent,children:r}),t.jsxRuntimeExports.jsx("div",{className:$.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:l})})]})},Ks=({children:r,logo:i,signUp:o})=>{const[s,e]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(rt,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),hasPadding:!1,children:t.jsxRuntimeExports.jsx(at,{logo:i,setIsOpen:e,signUp:o,children:r})})]})},rt=r=>{const{setIsOpenModal:i}=r;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--text-primary)"})})},Zs="_share_10urc_1",tn="_modal_10urc_9",en="_header_10urc_21",sn="_socials_10urc_31",nn="_social_10urc_31",on="_copy_10urc_41",an="_title_10urc_48",rn="_copyWrapper_10urc_54",cn="_copyText_10urc_63",ln="_copyTextMobile_10urc_76",dn="_copyTextMiniMobile_10urc_95",X={share:Zs,modal:tn,header:en,socials:sn,social:nn,copy:on,title:an,copyWrapper:rn,copyText:cn,copyTextMobile:ln,copyTextMiniMobile:dn},un=({title:r="Copy Product Link"})=>{const{isOpenModal:i,setIsOpenModal:o}=t.useShareLinkStore();function s(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:X.share,onClick:e=>{e.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),i&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(xn,{title:r})})]})},xn=({title:r="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notification:o,setNotification:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),l=window.location.href;function c(){navigator.clipboard.writeText(l),s({message:"Link copied to clipboard",status:"success"})}function p(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function m(h,S){return h.length>S?h.slice(0,S)+"...":h}return t.jsxRuntimeExports.jsxs("div",{className:X.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,children:[t.jsxRuntimeExports.jsx("div",{className:X.title,children:r}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:p,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:X.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:c,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:X.copyText,children:m(l,100)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMobile,children:m(l,40)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMiniMobile,children:m(l,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:c,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},pn="_accordion_1s1lq_1",mn="_header_1s1lq_9",hn="_icon_1s1lq_18",jn="_open_1s1lq_21",_n="_content_1s1lq_25",J={accordion:pn,header:mn,icon:hn,open:jn,content:_n},gn=({title:r,content:i,defaultOpen:o=!1})=>{const[s,e]=j.useState(o),[l,c]=j.useState(0),p=j.useRef(null),m=()=>{e(!s)};return j.useEffect(()=>{p.current&&c(s?p.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:m,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:r}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:p,className:J.content,style:{height:`${l}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},fn=({children:r,path:i,className:o,target:s="_self",id:e})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:o,role:"link",style:{cursor:"pointer"},id:e,children:r});const l=t.useNavigate(),c=/^https?:\/\//.test(i),p=m=>{c||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.open(i,"_self"):(m.preventDefault(),l(i))};return t.jsxRuntimeExports.jsx("div",{onClick:p,className:o,role:"link",style:{cursor:"pointer"},id:e,children:r})},En="_buttonsBlock_1b2rb_1",Rn="_slideUp_1b2rb_1",vn={buttonsBlock:En,slideUp:Rn},yn=r=>{var h,S;const{setIsOpen:i,setModalType:o,productId:s}=r,{cart:e}=t.di(),{pageContext:l}=t.usePagesStore(),c=(h=l==null?void 0:l.listings)==null?void 0:h.find(f=>f.id===s);if(!c)return null;const p=(S=l==null?void 0:l.products)==null?void 0:S.find(f=>f.uniquePath===c.productData.uniquePath);if(!p)return null;const m=e.parts.find(f=>f.productId===p.id);return t.jsxRuntimeExports.jsxs("div",{className:vn.buttonsBlock,onClick:f=>f.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),i(!0)},children:m?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),i(!0)},children:"Buy"})]})},bn="_wrapper_27wzz_1",In="_logo_27wzz_8",Sn="_info_27wzz_12",Z={wrapper:bn,logo:In,info:Sn},Nn=({date:r})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),l={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",l)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:Z.logo,children:i.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:Z.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:i.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(r)})]})]})},$n="_options_puxd1_1",Cn="_price_puxd1_12",kn="_oldPrice_puxd1_19",qn="_newPrice_puxd1_27",wn="_animate_puxd1_34",Bn="_appearAndBounce_puxd1_1",Pn="_meta_puxd1_52",Tn="_info_puxd1_58",Mn="_infoRight_puxd1_66",An="_buttons_puxd1_73",On="_variants_puxd1_80",Ln="_variant_puxd1_80",Dn="_stock_puxd1_98",zn="_variantInfo_puxd1_105",Fn="_quantity_puxd1_111",Un="_count_puxd1_118",Vn="_focused_puxd1_135",Hn="_button_puxd1_73",Yn="_activeVariant_puxd1_161",Wn="_chargeTypes_puxd1_165",Gn="_charge_puxd1_165",Xn="_chargeActive_puxd1_190",Qn="_title_puxd1_198",Jn="_modal_puxd1_204",Kn="_header_puxd1_224",Zn="_productOptions_puxd1_232",ti="_loading_puxd1_236",U={options:$n,price:Cn,oldPrice:kn,newPrice:qn,animate:wn,appearAndBounce:Bn,meta:Pn,info:Tn,infoRight:Mn,buttons:An,variants:On,variant:Ln,stock:Dn,variantInfo:zn,quantity:Fn,count:Un,focused:Vn,button:Hn,activeVariant:Yn,chargeTypes:Wn,charge:Gn,chargeActive:Xn,title:Qn,modal:Jn,header:Kn,productOptions:Zn,loading:ti},ei=r=>{var f;const{pageContext:i,setPageContext:o}=t.usePagesStore(),s=(f=i==null?void 0:i.listings)==null?void 0:f.find(n=>n.id===r.productId),[e,l]=j.useState(!0),[c,p]=j.useState(null),m=(c==null?void 0:c.variants[0])||null,[h,S]=j.useState(m!=null&&m.chargeTypes&&m.chargeTypes.length>1?m.chargeTypes[0]:"ONE_TIME");if(j.useEffect(()=>{(async()=>{l(!0);const u=await t.getDynamicPage(encodeURIComponent(`/product/${s.productData.uniquePath}`));o({...i,products:[...(i==null?void 0:i.products)||[],...(u==null?void 0:u.data.products)||[]]}),p(u==null?void 0:u.data.products[0]),l(!1)})()},[]),e)return t.jsxRuntimeExports.jsx("div",{className:U.modal,onClick:n=>n.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:U.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})})});if(!c){r.setIsOpen(!1);return}if(!m){r.setIsOpen(!1);return}return t.jsxRuntimeExports.jsxs("div",{className:U.modal,onClick:n=>n.stopPropagation(),children:[r.type==="Add To Cart"&&!e&&t.jsxRuntimeExports.jsx(si,{variants:c.variants,activeVariant:m,activeChargeType:h,setActiveChargeType:S,productId:c.id,setIsOpen:r.setIsOpen}),r.type==="Buy Now"&&!e&&t.jsxRuntimeExports.jsx(ni,{product:c,setIsOpen:r.setIsOpen})]})},si=r=>{const{variants:i,activeChargeType:o,setActiveChargeType:s,activeVariant:e,productId:l,setIsOpen:c}=r,{cart:p,addProductToCart:m,addProducts:h,updateQuantityOfProduct:S}=t.di(),{setNotification:f}=t.useNotificationStore(),{pageContext:n}=t.usePagesStore();async function u(a){const w=p.parts.find(_=>_.productId===r.productId&&_.productVariantId===a);w?S({productId:l,productVariantId:a,quantity:w.quantity+1}):(n!=null&&n.products&&await h(n.products),await m({productId:l,productVariantId:a,quantity:1})),f({message:"Product added to cart",status:"success"})}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:U.header,children:[t.jsxRuntimeExports.jsx("div",{id:"h3",children:"Choose a variant"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>c(!1)})]}),e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:U.chargeTypes,children:e.chargeTypes.map(a=>t.jsxRuntimeExports.jsx("div",{className:t.clx(U.charge,{[U.chargeActive]:o===a}),onClick:()=>s(a),children:K[a]},a))}),t.jsxRuntimeExports.jsx("div",{className:U.variants,children:i.map(a=>{var w,_;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(U.variant),onClick:()=>{u(a.id),c(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:U.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:U.title,children:a.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?a.price.amount:a.subscriptionSettings?a.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:U.stock,children:[(w=a.quantity.restrictions)!=null&&w.max||a.quantity.available!==void 0?((_=a.quantity.restrictions)==null?void 0:_.max)||a.quantity.available:"∞"," ","in stock"]})})]},a.id)})})]})},ni=r=>{const{product:i,setIsOpen:o}=r;return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:U.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(i.name)]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>o(!1),style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx("div",{className:U.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})})]})},ii="_wrapper_1efqk_1",oi="_label_1efqk_10",ai="_contentBorder_1efqk_19",ri="_contentField_1efqk_23",ci="_textarea_1efqk_27",li="_length_1efqk_42",Q={wrapper:ii,label:oi,contentBorder:ai,contentField:ri,textarea:ci,length:li},di=r=>{const{onChange:i,label:o,value:s,maxLength:e,placeholder:l="Type something...",type:c="text"}=r,[p,m]=j.useState(s.length),{themeSettings:h}=t.useThemeSettingsStore();function S(f){return c==="number"?f.replace(/[^\d\n]+/g,""):f}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[o&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:o,children:o}),t.jsxRuntimeExports.jsx("textarea",{id:o,value:s,onChange:f=>{const n=S(f.target.value);m(n.length),i(n)},placeholder:l,className:t.clx(Q.textarea,{[Q.contentBorder]:h.inputs.border.active,[Q.contentField]:h.inputs.field.active}),maxLength:e}),e&&t.jsxRuntimeExports.jsxs("div",{className:Q.length,children:[p,"/",e]})]})};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.SelectInfiniteList=t.SelectInfiniteList;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=gn;exports.BurgerMenuButton=rt;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ve;exports.CategorySettings=Wt;exports.ChargeTypes=K;exports.EmptyCart=ot;exports.FormSettings=Re;exports.HeaderButtons=Js;exports.LayoutSettings=vt;exports.Link=fn;exports.ListingSelector=Ye;exports.MetaInfoPost=Nn;exports.PagesMobileMenu=Ks;exports.PagesMobileModal=at;exports.PagesSettings=fe;exports.ProductCardButtons=yn;exports.ProductCardModal=ei;exports.ProductOptions=st;exports.ShareLink=un;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.TextareaUI=di;exports.UserInfo=tt;