@billgangcom/theme-lib 1.69.4 → 1.69.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +12 -12
- package/dist/builder.es.js +142 -145
- package/dist/{index-CVyi3AZa.js → index-D0Va9_Ca.js} +46 -46
- package/dist/index.es.js +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +266 -267
- package/package.json +1 -1
|
@@ -15757,46 +15757,46 @@ const W7 = (e) => {
|
|
|
15757
15757
|
] });
|
|
15758
15758
|
};
|
|
15759
15759
|
export {
|
|
15760
|
-
|
|
15761
|
-
|
|
15760
|
+
ra as $,
|
|
15761
|
+
ua as A,
|
|
15762
15762
|
ts as B,
|
|
15763
15763
|
hr as C,
|
|
15764
15764
|
BU as D,
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15765
|
+
s4 as E,
|
|
15766
|
+
q5 as F,
|
|
15767
|
+
K5 as G,
|
|
15768
|
+
z7 as H,
|
|
15769
15769
|
ve as I,
|
|
15770
|
-
|
|
15771
|
-
|
|
15770
|
+
b7 as J,
|
|
15771
|
+
V7 as K,
|
|
15772
15772
|
$7 as L,
|
|
15773
15773
|
H7 as M,
|
|
15774
|
-
|
|
15774
|
+
W7 as N,
|
|
15775
15775
|
S2 as O,
|
|
15776
15776
|
Ts as P,
|
|
15777
|
-
|
|
15777
|
+
q7 as Q,
|
|
15778
15778
|
UH as R,
|
|
15779
15779
|
Qt as S,
|
|
15780
15780
|
Ya as T,
|
|
15781
|
-
|
|
15782
|
-
|
|
15783
|
-
|
|
15784
|
-
|
|
15785
|
-
|
|
15786
|
-
|
|
15787
|
-
|
|
15781
|
+
Ka as U,
|
|
15782
|
+
iH as V,
|
|
15783
|
+
Ja as W,
|
|
15784
|
+
wa as X,
|
|
15785
|
+
m7 as Y,
|
|
15786
|
+
YF as Z,
|
|
15787
|
+
hs as _,
|
|
15788
15788
|
hL as a,
|
|
15789
15789
|
R7 as a$,
|
|
15790
|
-
|
|
15791
|
-
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15790
|
+
Rn as a0,
|
|
15791
|
+
vr as a1,
|
|
15792
|
+
ne as a2,
|
|
15793
|
+
Ls as a3,
|
|
15794
|
+
at as a4,
|
|
15795
|
+
D5 as a5,
|
|
15796
|
+
to as a6,
|
|
15797
|
+
mr as a7,
|
|
15798
|
+
A5 as a8,
|
|
15799
|
+
T5 as a9,
|
|
15800
15800
|
ur as aA,
|
|
15801
15801
|
U5 as aB,
|
|
15802
15802
|
uL as aC,
|
|
@@ -15824,24 +15824,24 @@ export {
|
|
|
15824
15824
|
j$ as aY,
|
|
15825
15825
|
B7 as aZ,
|
|
15826
15826
|
R$ as a_,
|
|
15827
|
-
|
|
15828
|
-
|
|
15829
|
-
|
|
15830
|
-
|
|
15831
|
-
|
|
15832
|
-
|
|
15833
|
-
|
|
15834
|
-
|
|
15835
|
-
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
|
|
15827
|
+
I5 as aa,
|
|
15828
|
+
L5 as ab,
|
|
15829
|
+
Fo as ac,
|
|
15830
|
+
O5 as ad,
|
|
15831
|
+
B5 as ae,
|
|
15832
|
+
N5 as af,
|
|
15833
|
+
zt as ag,
|
|
15834
|
+
Kt as ah,
|
|
15835
|
+
ti as ai,
|
|
15836
|
+
V5 as aj,
|
|
15837
|
+
M5 as ak,
|
|
15838
|
+
Nt as al,
|
|
15839
|
+
Ct as am,
|
|
15840
|
+
Ga as an,
|
|
15841
|
+
cn as ao,
|
|
15842
|
+
g7 as ap,
|
|
15843
|
+
b$ as aq,
|
|
15844
|
+
yl as ar,
|
|
15845
15845
|
Y5 as as,
|
|
15846
15846
|
ut as at,
|
|
15847
15847
|
j5 as au,
|
|
@@ -15885,5 +15885,5 @@ export {
|
|
|
15885
15885
|
j7 as w,
|
|
15886
15886
|
U7 as x,
|
|
15887
15887
|
A4 as y,
|
|
15888
|
-
|
|
15888
|
+
_7 as z
|
|
15889
15889
|
};
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { App as o, ColorVariables as t, ReCaptchaProvider as p, createTicket as s, hotReload as r, iconNames as i, useReCaptcha as c } from "./builder.es.js";
|
|
2
|
-
import { a as n, s as R } from "./index-
|
|
2
|
+
import { a as n, s as R } from "./index-D0Va9_Ca.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-CTXAJEri.cjs"),m=require("react"),lt="_block_kh9z8_8",dt="_title_kh9z8_16",ut="_subtitle_kh9z8_23",xt="_alignmentContent_kh9z8_30",pt="_alignments_kh9z8_39",mt="_alignment_kh9z8_30",jt="_circle_kh9z8_64",ht="_paddings_kh9z8_71",gt="_padding_kh9z8_71",ft="_active_kh9z8_97",U={block:lt,title:dt,subtitle:ut,alignmentContent:xt,alignments:pt,alignment:mt,circle:jt,paddings:ht,padding:gt,active:ft},Et=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],_t=["left","top","right","bottom"],Rt=c=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:r=!0,isPadding:d=!0}=c;function u(a){switch(a){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(a){switch(a){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[h,C]=m.useState(null),[E,n]=m.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:U.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentContent,children:[r&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:U.alignments,children:Et.map(a=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(a)},className:U.alignment,onMouseEnter:()=>{C(a)},onMouseLeave:()=>{C(null)},children:[a!==i&&h!==a&&t.jsxRuntimeExports.jsx("div",{className:U.circle}),a!==i&&h===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(h),fill:"#c2c2c2",width:22,height:22}),a===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(i),fill:"#FF3F19",width:22,height:22})]},a))})]}),d&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:U.paddings,children:_t.map(a=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(U.padding,{[U.active]:E===a}),onFocus:()=>{n(a)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:j(a),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[a]),onChange:p=>s({...o,[a]:Math.min(Number(p),999)}),max:999,paddingless:!0,borderless:!0})]},a))})]})]})]})},vt="_title_82zux_1",yt="_subtitle_82zux_5",bt="_productsBlock_82zux_14",It="_top_82zux_26",St="_products_82zux_14",Nt="_product_82zux_14",Ct="_button_82zux_80",kt="_disabled_82zux_91",Pt="_buttons_82zux_118",wt="_addButton_82zux_157",$t="_deleteButton_82zux_179",V={title:vt,subtitle:yt,productsBlock:bt,top:It,products:St,product:Nt,button:Ct,disabled:kt,buttons:Pt,addButton:wt,deleteButton:$t};function Bt({id:c,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:r,transition:d,isDragging:u}=t.useSortable({id:c}),j={transform:t.CSS.Transform.toString(r),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${V.product} ${u?V.dragging:""}`,...o,...s,children:i})}const Mt=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:r,tags:d,title:u,subtitle:j,draggable:h=!1,withImage:C=!1,addable:E=!0,itemsOptions:n,hasRangeSelector:a=!1,rangeSelectorOptions:p,limit:B,autoScrollInterval:g,deletable:f,aspectRatio:R,setAspectRatio:k}=c,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),O=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const y=s.findIndex(M=>M===I.id),P=s.findIndex(M=>M===S.id);if(y!==-1&&P!==-1){const M=[...s],[_]=M.splice(y,1);M.splice(P,0,_),e(M)}}};function v(x){if(C)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(P=>P.id===x);if(!S)return;const y=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:P=>{const M=[...s],_=n.find(l=>l.name===P);if(!_)return;const T=_.id,z=M.map(l=>l===x?T:l);e([...z])},value:S.name,options:n.filter(P=>!s.find(M=>M===P.id)).map(P=>P.name),leftAddonOptions:n.map(P=>({value:P.name,addon:v(P.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:V.buttons,children:t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(P=>P!==x))})})})]});return h?t.jsxRuntimeExports.jsx(Bt,{id:x,children:y},t.v4()):t.jsxRuntimeExports.jsx("div",{className:V.product,children:y},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),a&&p&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...p}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[j&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:j}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:O,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>L(x,f))})}):s.map(x=>L(x,f)),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(V.button,{[V.disabled]:!!(B&&B<=s.length||s.length===n.length)}),size:"s",disabled:!!(B&&B<=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(y=>y===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:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),R&&k&&t.jsxRuntimeExports.jsx(t.Select,{value:R,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>k(x),leftAddonOptions:t.aspectRatioOptions}),d!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:d}),r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:r}),g!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(g.scrollInterval),onChange:x=>g.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Tt="_title_roi3a_1",qt="_subtitle_roi3a_5",Ot="_productsBlock_roi3a_14",At="_top_roi3a_26",Dt="_products_roi3a_14",Lt="_product_roi3a_14",zt="_button_roi3a_80",Ht="_disabled_roi3a_91",Ut="_buttons_roi3a_118",Ft="_addButton_roi3a_164",Vt="_deleteButton_roi3a_179",H={title:Tt,subtitle:qt,productsBlock:Ot,top:At,products:Dt,product:Lt,button:zt,disabled:Ht,buttons:Ut,addButton:Ft,deleteButton:Vt};function Yt({product:c,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:r,transition:d,isDragging:u}=t.useSortable({id:c.id}),j={transform:t.CSS.Transform.toString(r),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${H.product} ${u?H.dragging:""}`,...o,...s,children:i})}const Gt=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:r,subtitle:d,editable:u=!0,draggable:j=!1,deletable:h=!0,addable:C=!0,itemsType:E,itemsOptions:n,addableOptions:a={},limit:p}=c,[B,g]=m.useState(null),[f,R]=m.useState(null),k=m.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));m.useEffect(()=>{if(B){const x=[...s].map(I=>I.id===B.id?B:I);e(x)}},[B]),m.useEffect(()=>{k.current&&f&&(k.current.getBoundingClientRect().height,f.top)},[k.current,f]);const O=(x,I)=>{x.stopPropagation();const S=x.target.getBoundingClientRect();R({top:S.top+window.scrollY,left:S.left-30}),g(I)},v=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const y=s.findIndex(M=>M.id===I.id),P=s.findIndex(M=>M.id===S.id);if(y!==-1&&P!==-1){const M=[...s],[_]=M.splice(y,1);M.splice(P,0,_),e(M)}}},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:y=>{const P=[...s],M=n.find(T=>T.name===y);if(!M)return;const _=P.map(T=>T.id===x.id?{...M,name:{"en-US":y}}:T);g({...x,name:{"en-US":y}}),e([..._])},value:x.name,options:n.filter(y=>!s.find(P=>P.name===y.name)).map(y=>y.name)}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[u&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>O(y,x)})}),h&&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(y=>y.id!==x.id))})})]})]});return j?t.jsxRuntimeExports.jsx(Yt,{product:x,index:I,children:S},x.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:S},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(r||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:r}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:d}),j?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:v,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)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(p&&p<=s.length||s.length===(n==null?void 0:n.length))}),size:"s",disabled:!!(p&&p<=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(y=>y.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,...a}),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})]})})})]})]})};function Wt(c){const{product:i,children:o}=c,{attributes:s,listeners:e,setNodeRef:r,transform:d,transition:u,isDragging:j}=t.useSortable({id:i.id}),h={transform:t.CSS.Transform.toString(d),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:r,style:h,className:`${t.styles.product} ${j?t.styles.dragging:""}`,...s,...e,children:o})}const Xt=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:r,title:d,subtitle:u,editable:j=!0,draggable:h=!1,deletable:C=!0,addable:E=!0,itemsType:n,itemsPlaceholder:a="",itemsOptions:p,hasRangeSelector:B=!1,rangeSelectorOptions:g,modalOptions:f,addableOptions:R={},limit:k}=c,[D,O]=m.useState(null),[v,L]=m.useState({top:0,left:0}),[x,I]=m.useState(null),S=m.useRef(null),[y,P]=m.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));m.useEffect(()=>{const l=()=>{O(null),P(!1)};return document.body.addEventListener("click",l),O(null),P(!1),()=>{O(null),P(!1),document.body.removeEventListener("click",l)}},[]),m.useEffect(()=>{if(D){const l=[...s].map($=>$.id===D.id?D:$);e(l)}},[D]),m.useEffect(()=>{if(S.current&&x){const l=S.current.getBoundingClientRect().height,$=window.innerHeight;let b=x.top;b+l>$+window.scrollY-200&&(b=$+window.scrollY-l-200),b<0&&(b=10),L({top:b,left:x.left})}},[S.current,x]);const _=(l,$)=>{l.stopPropagation();const b=l.target.getBoundingClientRect();I({top:b.top+window.scrollY,left:b.left-30}),O($),P(!0)},T=l=>{const{active:$,over:b}=l;if(b&&$.id!==b.id){const q=s.findIndex(A=>A.id===$.id),W=s.findIndex(A=>A.id===b.id);if(q!==-1&&W!==-1){const A=[...s],[G]=A.splice(q,1);A.splice(W,0,G),e(A)}}},z=l=>{var b;const $=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"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const A=[...s].map(G=>G.id===l.id?{...l,name:{"en-US":q}}:G);O({...l,name:{"en-US":q}}),e([...A])},value:l.name["en-US"],options:p.filter(q=>!s.find(W=>W.name["en-US"]===q))}),n==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:q=>{const A=[...s].map(G=>G.id===l.id?{...l,name:{"en-US":q}}:G);e([...A])},value:l.name["en-US"],placeholder:a}),n==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:q=>{const A=[...s].map(G=>G.id===l.id?{...l,images:q}:G);e([...A])},activeImage:(b=s.find(q=>q.id===l.id))==null?void 0:b.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:q=>_(q,l)})}),C&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(q=>q.id!==l.id))})})]})]});return h?t.jsxRuntimeExports.jsx(Wt,{product:l,children:$},l.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:$},l.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(d||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:d}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:l=>o==null?void 0:o(l)})]}),D&&j&&f&&y&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:S,activeItem:D,setActiveItem:O,popupPosition:v,modalOptions:f,setIsOpenModal:P}),B&&g&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...g}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:u}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:T,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]:!!(k&&k<=s.length)}),size:"s",disabled:!!(k&&k<=s.length),onClick:()=>{const l=[...s];let $=null;if(p){for(let b=0;b<p.length;b++)if(!s.find(q=>q.name["en-US"]===p[b])){$=p[b];break}}n==="select"&&p?l.push({name:{"en-US":$||p[0]},id:t.v4(),...R,maxSymbols:100}):n==="input"?l.push({name:{"en-US":""},id:t.v4(),...R,maxSymbols:100}):l.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...R,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})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:r})]})},Qt="_subtitle_jql1y_1",Jt="_products_jql1y_10",Kt="_product_jql1y_10",Zt="_button_jql1y_11",te="_buttons_jql1y_11",ee="_addButton_jql1y_150",se="_deleteButton_jql1y_165",X={subtitle:Qt,products:Jt,product:Kt,button:Zt,buttons:te,addButton:ee,deleteButton:se},et=c=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:r=!0}=c,{pages:d}=t.usePagesStore(),[u,j]=m.useState(null),[h,C]=m.useState({top:0,left:0}),[E,n]=m.useState(null),a=m.useRef(null);m.useEffect(()=>{if(u){const g=[...i].map(f=>f.id===u.id?u:f);o(g)}},[u]),m.useEffect(()=>{if(a.current&&E){const g=a.current.getBoundingClientRect().height,f=window.innerHeight;let R=E.top;R+g>f+window.scrollY-200&&(R=f+window.scrollY-g-200),R<0&&(R=10),C({top:R,left:E.left})}},[a.current,E]);const p=(g,f)=>{g.stopPropagation();const R=g.target.getBoundingClientRect();n({top:R.top+window.scrollY-70,left:R.left-(e?30:65)}),j(f)},B=(g,f)=>{const R=[...i],k={...g,id:Math.random().toString(36).substr(2,9)};R.splice(f+1,0,k),o(R)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),i.map((g,f)=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const D=[...i].map(O=>O.id===g.id?{...g,type:R}:O);o(D)},value:g.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{B(g,f)}})}),t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>{p(R,g)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const R=i.filter(k=>k.id!==g.id);o(R)},width:20,height:20,fill:"#C12A2A"})})]})]},g.id)),u&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:a,activeButton:u,setActiveButton:j,popupPosition:h,editableLink:r}),e&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:X.button,size:"s",onClick:()=>{const g=[...i];r?g.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:d?Object.values(d)[0].path:"/",openInNewTab:!1}):g.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:d?Object.values(d)[0].path:"/",openInNewTab:!1}),o(g)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},ne=c=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:r=!0,addable:d=!0,deletable:u=!0}=c;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:r,addable:d,deletable:u})]})})};function ie(c){const{product:i,children:o}=c,{attributes:s,listeners:e,setNodeRef:r,transform:d,transition:u,isDragging:j}=t.useSortable({id:String(i.listingId)}),h={transform:t.CSS.Transform.toString(d),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:r,style:h,className:`${t.styles$2.product} ${j?t.styles$2.dragging:""}`,...s,...e,children:o})}const oe=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:r,title:d,subtitle:u,editable:j=!0,draggable:h=!1,withImage:C=!1,deletable:E=!0,addable:n=!0,itemsType:a,itemsOptions:p,limit:B,aspectRatio:g,setAspectRatio:f}=c,[R,k]=m.useState(null),[D,O]=m.useState({top:0,left:0}),[v,L]=m.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));m.useEffect(()=>{const _=()=>{k(null),L(!1)};return document.body.addEventListener("click",_),k(null),L(!1),()=>{k(null),L(!1),document.body.removeEventListener("click",_)}},[]),m.useEffect(()=>{if(R){const _=[...s].map(T=>T.listingId===R.listingId?R:T);e(_)}},[R]);const I=(_,T)=>{_.stopPropagation();const z=_.target.getBoundingClientRect(),l=100,$=window.innerHeight;let b=z.top+window.scrollY;b+l>$&&(b=$-l-20),L(!0),O({top:b-80,left:z.left-30}),k(T)};function S(_){if(C)return _?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${_}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const y=_=>{const{active:T,over:z}=_;if(z&&T.id!==z.id){const l=s.findIndex(b=>String(b.listingId)===T.id),$=s.findIndex(b=>String(b.listingId)===z.id);if(l!==-1&&$!==-1){const b=[...s],[q]=b.splice(l,1);b.splice($,0,q),e(b)}}},P=_=>{const T=p.find(l=>_.listingId===l.id);if(!T)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})}),a==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{const $=[...s],b=p.find(A=>A.productData.name===l);if(!b)return;const q={listingId:b.id,image:b.productData.images.length>0?b.productData.images[0].cfId:""},W=$.map(A=>A.listingId===_.listingId?q:A);k(q),e([...W])},value:T.productData.name,options:[...p.filter(l=>!s.find($=>$.listingId===l.id)).map(l=>l.productData.name)],leftAddonOptions:p.map(l=>{var $;return{value:l.productData.name,addon:S((($=l.productData.images[0])==null?void 0:$.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,_)})}),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!==_))})})]})]});return h?t.jsxRuntimeExports.jsx(ie,{product:_,children:z},_.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},_.listingId)},M=m.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(d||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:d}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:_=>o==null?void 0:o(_)})]}),v&&R&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:M,activeItem:R,setActiveItem:k,setIsOpenModal:L,popupPosition:D,itemsOptions:p}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:u}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(_=>String(_.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(_=>P(_))})}):s.map(_=>P(_)),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 _=[...s];for(let T=0;T<p.length;T++)if(!s.find(z=>z.listingId===p[T].id)){_.push({listingId:p[T].id,image:p[T].productData.images.length>0?p[T].productData.images[0].cfId:""});break}e(_)},disabled:s.length===(B||p.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})]})})})]}),g&&f&&t.jsxRuntimeExports.jsx(t.Select,{value:g,options:Object.keys(t.aspectRatio),onChange:_=>f(_),leftAddonOptions:t.aspectRatioOptions}),i&&r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:r})]})},ae="_options_167h8_1",re="_price_167h8_18",ce="_oldPrice_167h8_25",le="_newPrice_167h8_33",de="_animate_167h8_40",ue="_meta_167h8_58",xe="_info_167h8_64",pe="_infoRight_167h8_73",me="_buttons_167h8_80",je="_variants_167h8_87",he="_variant_167h8_87",ge="_stock_167h8_105",fe="_variantInfo_167h8_112",Ee="_quantity_167h8_119",_e="_button_167h8_80",Re="_activeVariant_167h8_165",ve="_chargeTypes_167h8_169",ye="_charge_167h8_169",be="_chargeActive_167h8_194",Ie="_title_167h8_202",w={options:ae,price:re,oldPrice:ce,newPrice:le,animate:de,meta:ue,info:xe,infoRight:pe,buttons:me,variants:je,variant:he,stock:ge,variantInfo:fe,quantity:Ee,button:_e,activeVariant:Re,chargeTypes:ve,charge:ye,chargeActive:be,title:Ie};var K=(c=>(c.ONE_TIME="One-Time",c.RECURRING="Subscribe & Save",c))(K||{});const st=c=>{var D,O;const{product:i,setIsOpen:o}=c,{variants:s}=i,[e,r]=m.useState(s[0]),[d,u]=m.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),{notifications:j,setNotifications:h}=t.useNotificationStore(),C=t.useNavigate(),[E,n]=m.useState(1),{reset:a,addProductToCart:p}=t.useCart(),[B,g]=m.useState(!1);m.useEffect(()=>{g(!0);const v=setTimeout(()=>g(!1),600);return()=>clearTimeout(v)},[E]);async function f(){await p({productId:i.id,productVariantId:e.id,quantity:E}),o==null||o(!1),h([...j,{id:t.v4(),message:"Product added to cart",status:"success"}])}function R(){a(),f(),C("/checkout")}function k(v){if(v>=864e5){const y=Math.floor(v/864e5);return`${y} ${y===1?"day":"days"}`}else if(v>=36e5){const y=Math.floor(v/36e5);return`${y} ${y===1?"hour":"hours"}`}else if(v>=6e4){const y=Math.floor(v/6e4);return`${y} ${y===1?"minute":"minutes"}`}else{const y=Math.floor(v/1e3);return`${y} ${y===1?"second":"seconds"}`}}return m.useEffect(()=>{e.quantity&&e.quantity.available===0?n(0):n(1)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:w.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:w.chargeTypes,children:e.chargeTypes.map(v=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:d===v}),onClick:()=>u(v),children:K[v]},v))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:s.map(v=>{var L,x;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===v.id}),onClick:()=>r(v),children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:t.splitTextIntoSpans(v.name)}),t.jsxRuntimeExports.jsxs("span",{children:["$",d==="ONE_TIME"?v.price.amount:v.subscriptionSettings?v.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:d==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,children:[(L=v.quantity.restrictions)!=null&&L.max||v.quantity.available!==void 0?((x=v.quantity.restrictions)==null?void 0:x.max)||v.quantity.available:"∞"," ","in stock"]})})]},v.id)})}),d==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{E>1?n(v=>v-1):n(1)},className:w.button,disabled:e.quantity.available&&e.quantity.restrictions&&E<=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(E),onChange:v=>n(Number(v)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((O=e.quantity.restrictions)==null?void 0:O.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&E>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n(v=>v+1)},className:w.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&E>=e.quantity.restrictions.max||e.quantity.available===0),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:w.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:w.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"var(--text-action)",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":k(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:d==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",(e.price.amount||0)*E]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*E]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",(e.price.amount||0)*E]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>R(),disabled:e.quantity&&e.quantity.available===0,children:d==="ONE_TIME"?"Buy Now":"Subscribe Now"}),d==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>f(),disabled:e.quantity&&e.quantity.available===0,children:"Add to Cart"})]})]})},Se="_buttons_qns27_23",Ne="_modal_qns27_32",Ce="_closing_qns27_64",ke="_info_qns27_113",Pe="_top_qns27_120",we="_title_qns27_131",$e="_clear_qns27_138",Be="_activeClear_qns27_145",Me="_count_qns27_149",Te="_cart_qns27_164",qe="_empty_qns27_172",Oe="_product_qns27_198",Ae="_products_qns27_207",De="_image_qns27_215",Le="_productInfo_qns27_231",ze="_content_qns27_238",He="_name_qns27_244",Ue="_price_qns27_250",Fe="_productButtons_qns27_256",Ve="_productButton_qns27_256",Ye="_productCount_qns27_273",Ge="_bottom_qns27_290",We="_subtotal_qns27_298",Xe="_block_qns27_306",Qe="_shoppingCount_qns27_313",Je="_total_qns27_333",Ke="_link_qns27_339",Ze="_userInfo_qns27_346",ts="_pagesMobileModal_qns27_358",es="_pagesMobileModalContent_qns27_372",ss="_pagesMobileModalHeader_qns27_378",ns="_pagesMobileModalFooter_qns27_388",N={buttons:Se,modal:Ne,closing:Ce,info:ke,top:Pe,title:we,clear:$e,activeClear:Be,count:Me,cart:Te,empty:qe,product:Oe,products:Ae,image:De,productInfo:Le,content:ze,name:He,price:Ue,productButtons:Fe,productButton:Ve,productCount:Ye,bottom:Ge,subtotal:We,block:Xe,shoppingCount:Qe,total:Je,link:Ke,userInfo:Ze,pagesMobileModal:ts,pagesMobileModalContent:es,pagesMobileModalHeader:ss,pagesMobileModalFooter:ns},is=c=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=c;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[c,i]=m.useState(!1),[o,s]=m.useState([]),{cart:e,products:r}=t.useCart();function d(n){if(n.variants.length>0){for(let a=0;a<e.parts.length;a++)for(let p=0;p<n.variants.length;p++)if(n.variants[p]&&e.parts[a].productVariantId===n.variants[p].id)return e.parts[a].productVariantId}return n.variants[0].id}function u(n){for(let a=0;a<e.parts.length;a++)for(let p=0;p<n.variants.length;p++)if(n.variants[p]&&e.parts[a].productVariantId===n.variants[p].id)return e.parts[a].quantity}m.useEffect(()=>{(async()=>{const a=e.parts.map(g=>String(g.productId)),B=(r.filter(g=>a.includes(String(g.id)))||[]).map(g=>({...g,activeVariantId:d(g),quantity:u(g)}));s(B)})()},[e.parts]);function j(n){var a;return!n||!(n!=null&&n.variants)?!1:(a=n.variants.find(p=>p.id===n.activeVariantId))==null?void 0:a.subscriptionSettings}const h=e.parts.length>0&&o.length>0&&!j(o[0]),[C,E]=m.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"}),h&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:e.parts.length})]}),c&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{E(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:h,isOpen:C})})]})},it=c=>{const{activeProducts:i,isCartNotEmpty:o,isOpen:s}=c,{cart:e,reset:r,getTotalAndDiscount:d,updateQuantityOfProduct:u}=t.useCart(),j=t.useNavigate();function h(n){j(n)}function C(n){n.quantity&&u({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1})}function E(n){n.quantity&&u({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:r,children:"Clear all"})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:[...new Map(i.map(n=>[n.id,n])).values()].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(a=>a.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:()=>C(n),className:N.productButton,disabled:n.quantity===n.variants.find(a=>a.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:["$",d().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>h("/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:c,close:i})=>{const o=localStorage.getItem("token"),s=t.useNavigate();function e(u){window.location.pathname.includes("/admin/builder")||s(u)}if(!o)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{e("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),c&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{e("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[r,d]=m.useState("test-email@gmail.com");return m.useEffect(()=>{(async()=>{const j=t.jwtDecode(o);d(j.email)})()},[o]),t.jsxRuntimeExports.jsx("div",{className:N.userInfo,onClick:()=>{e("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:r||"test-email@gmail.com"})})},at=({children:c,logo:i,setIsOpen:o,signUp:s})=>{const{setIsOpen:e}=t.useModalStore(),r=()=>{e(!1),setTimeout(()=>{o(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:d=>d.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:r,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:c}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:r})})]})},os=({children:c,logo:i,signUp:o})=>{const[s,e]=m.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:c})})]})},rt=c=>{const{setIsOpenModal:i}=c;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"})})},as="_share_rlgln_1",rs="_modal_rlgln_8",cs="_header_rlgln_20",ls="_title_rlgln_46",ds="_copyWrapper_rlgln_52",us="_copyText_rlgln_61",xs="_copyTextMobile_rlgln_74",ps="_copyTextMiniMobile_rlgln_93",Q={share:as,modal:rs,header:cs,title:ls,copyWrapper:ds,copyText:us,copyTextMobile:xs,copyTextMiniMobile:ps},ms=({title:c="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:Q.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(js,{title:c})})]})},js=({title:c="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notifications:o,setNotifications:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),r=window.location.href;function d(){navigator.clipboard.writeText(r),s([...o,{id:t.v4(),message:"Link copied to clipboard",status:"success"}])}function u(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function j(h,C){return h.length>C?h.slice(0,C)+"...":h}return t.jsxRuntimeExports.jsxs("div",{className:Q.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,children:[t.jsxRuntimeExports.jsx("div",{className:Q.title,children:c}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:u,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:Q.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:d,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:Q.copyText,children:j(r,100)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMobile,children:j(r,40)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMiniMobile,children:j(r,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:d,children:o.find(h=>h.message==="Link copied to clipboard")?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},hs="_accordion_1s1lq_1",gs="_header_1s1lq_9",fs="_icon_1s1lq_18",Es="_open_1s1lq_21",_s="_content_1s1lq_25",J={accordion:hs,header:gs,icon:fs,open:Es,content:_s},Rs=({title:c,content:i,defaultOpen:o=!1})=>{const[s,e]=m.useState(o),[r,d]=m.useState(0),u=m.useRef(null),j=()=>{e(!s)};return m.useEffect(()=>{u.current&&d(s?u.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:c}),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:u,className:J.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},ct=({children:c,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:c});const r=t.useNavigate(),d=/^https?:\/\//.test(i),u=j=>{d||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.open(i,"_self"):(j.preventDefault(),r(i))};return t.jsxRuntimeExports.jsx("div",{onClick:u,className:o,role:"link",style:{cursor:"pointer"},id:e,children:c})},vs="_buttonsBlock_1b2rb_1",ys={buttonsBlock:vs},bs=c=>{var h,C;const{setIsOpen:i,setModalType:o,productId:s}=c,{cart:e}=t.useCart(),{pageContext:r}=t.usePagesStore(),d=(h=r==null?void 0:r.listings)==null?void 0:h.find(E=>E.id===s);if(!d)return null;const u=(C=r==null?void 0:r.products)==null?void 0:C.find(E=>E.uniquePath===d.productData.uniquePath);if(!u)return null;const j=e.parts.find(E=>E.productId===u.id);return t.jsxRuntimeExports.jsxs("div",{className:ys.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"})]})},Is="_wrapper_27wzz_1",Ss="_logo_27wzz_8",Ns="_info_27wzz_12",Z={wrapper:Is,logo:Ss,info:Ns},Cs=({date:c})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),r={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",r)}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(c)})]})]})},ks="_variants_puxd1_80",Ps="_variant_puxd1_80",ws="_stock_puxd1_98",$s="_variantInfo_puxd1_105",Bs="_chargeTypes_puxd1_165",Ms="_charge_puxd1_165",Ts="_chargeActive_puxd1_190",qs="_title_puxd1_198",Os="_modal_puxd1_204",As="_header_puxd1_224",Ds="_productOptions_puxd1_232",Ls="_loading_puxd1_236",Y={variants:ks,variant:Ps,stock:ws,variantInfo:$s,chargeTypes:Bs,charge:Ms,chargeActive:Ts,title:qs,modal:Os,header:As,productOptions:Ds,loading:Ls},zs=c=>{var n;const{pageContext:i}=t.usePagesStore(),o=(n=i==null?void 0:i.listings)==null?void 0:n.find(a=>a.id===c.productId),[s,e]=m.useState(!0),[r,d]=m.useState(null),u=(r==null?void 0:r.variants[0])||null,[j,h]=m.useState(u!=null&&u.chargeTypes&&u.chargeTypes.length>1?u.chargeTypes[0]:"ONE_TIME"),{addProducts:C}=t.useCart(),{setIsOpen:E}=t.useModalStore();return m.useEffect(()=>{(async()=>{e(!0);const p=await t.getDynamicPage(encodeURIComponent(`/product/${o.productData.uniquePath}`));C(p==null?void 0:p.data.products),d(p==null?void 0:p.data.products[0]),e(!1)})()},[]),m.useEffect(()=>{E(!0)},[]),t.jsxRuntimeExports.jsx(t.Modal,{close:c.setIsOpen,children:t.jsxRuntimeExports.jsxs("div",{className:Y.modal,onClick:a=>a.stopPropagation(),children:[s&&t.jsxRuntimeExports.jsx("div",{className:Y.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})}),c.type==="Add To Cart"&&r&&u&&!s&&t.jsxRuntimeExports.jsx(Hs,{variants:r.variants,activeVariant:u,activeChargeType:j,setActiveChargeType:h,productId:r.id,setIsOpen:c.setIsOpen}),c.type==="Buy Now"&&r&&!s&&t.jsxRuntimeExports.jsx(Us,{product:r,setIsOpen:c.setIsOpen})]})})},Hs=c=>{const{variants:i,activeChargeType:o,setActiveChargeType:s,activeVariant:e,productId:r,setIsOpen:d}=c,{cart:u,addProductToCart:j,addProducts:h,updateQuantityOfProduct:C}=t.useCart(),{notifications:E,setNotifications:n}=t.useNotificationStore(),{pageContext:a}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),B=()=>{p(!1),setTimeout(()=>{d(!1)},300)};async function g(f){const R=u.parts.find(k=>k.productId===c.productId&&k.productVariantId===f);R?C({productId:r,productVariantId:f,quantity:R.quantity+1}):(a!=null&&a.products&&await h(a.products),await j({productId:r,productVariantId:f,quantity:1})),n([...E,{id:t.v4(),message:"Product added to cart",status:"success"}])}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Y.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:B})]}),e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:Y.chargeTypes,children:e.chargeTypes.map(f=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Y.charge,{[Y.chargeActive]:o===f}),onClick:()=>s(f),children:K[f]},f))}),t.jsxRuntimeExports.jsx("div",{className:Y.variants,children:i.map(f=>{var R,k;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(Y.variant),onClick:()=>{g(f.id),d(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:Y.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:Y.title,children:f.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?f.price.amount:f.subscriptionSettings?f.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:Y.stock,children:[(R=f.quantity.restrictions)!=null&&R.max||f.quantity.available!==void 0?((k=f.quantity.restrictions)==null?void 0:k.max)||f.quantity.available:"∞"," ","in stock"]})})]},f.id)})})]})},Us=c=>{const{product:i,setIsOpen:o}=c,{setIsOpen:s}=t.useModalStore(),e=()=>{s(!1),setTimeout(()=>{o(!1)},300)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Y.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:e,style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx("div",{className:Y.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})})]})},Fs="_contentModal_2a136_1",Vs="_modalTop_2a136_13",Ys="_loading_2a136_19",Gs="_modalCards_2a136_27",Ws="_modalImage_2a136_32",Xs="_card_2a136_37",Qs="_cardInfo_2a136_48",Js="_cardButtons_2a136_55",Ks="_title_2a136_61",Zs="_blockImage_2a136_68",F={contentModal:Fs,modalTop:Vs,loading:Ys,modalCards:Gs,modalImage:Ws,card:Xs,cardInfo:Qs,cardButtons:Js,title:Ks,blockImage:Zs},tn=c=>{const{setIsOpen:i,pageContext:o,groupData:s,setProductId:e,setIsProductModalOpen:r}=c,[d,u]=m.useState(null),[j,h]=m.useState(!0),{setIsOpen:C}=t.useModalStore();m.useEffect(()=>{var p;h(!0);const a=(p=o.listings)==null?void 0:p.filter(B=>s.listingIdList.includes(B.id));a&&u([...a]),h(!1)},[o]),m.useEffect(()=>{C(!0)},[]);const E=()=>{C(!1),setTimeout(()=>{i(!1)},300)};function n(a){return a.productData.compareAtPrice?a.productData.compareAtPrice.amount:0}return t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsxs("div",{className:F.contentModal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:F.modalTop,children:[t.jsxRuntimeExports.jsx("span",{className:F.title,id:"h4",children:t.splitTextIntoSpans(s.name)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:E})]}),!j&&d&&t.jsxRuntimeExports.jsx("div",{className:F.modalCards,children:d.map(a=>t.jsxRuntimeExports.jsxs("div",{className:F.card,children:[t.jsxRuntimeExports.jsx("div",{children:a.productData.images[0]?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a.productData.images[0].cfId}/w=500`,alt:"",width:64,height:64,className:F.modalImage}):t.jsxRuntimeExports.jsx("div",{className:t.clx(F.blockImage,F.modalImage),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})})}),t.jsxRuntimeExports.jsxs("div",{className:F.cardInfo,children:[t.jsxRuntimeExports.jsxs("span",{className:F.name,id:"h5",children:[t.splitTextIntoSpans(a.productData.name)," $",a.productData.minPrice.amount," ","- $",n(a)]}),a.productData.shortDescription&&t.jsxRuntimeExports.jsx("span",{className:F.short,id:"md",children:t.splitTextIntoSpans(a.productData.shortDescription)}),t.jsxRuntimeExports.jsx("span",{})]}),t.jsxRuntimeExports.jsxs("div",{className:F.cardButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{e(a.id),i(!1),r(!0)},children:"Buy"}),t.jsxRuntimeExports.jsx(ct,{path:`/product/${a.productData.uniquePath}`,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",children:"View Details"})})]})]},a.id))}),j&&t.jsxRuntimeExports.jsx("div",{className:F.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]})})};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.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectUI=t.Select$1;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TextareaUI=t.Textarea$1;exports.TypesText=t.TypesText;exports.Accordion=Rs;exports.BurgerMenuButton=rt;exports.ButtonTypeSettings=et;exports.ButtonsSettings=ne;exports.CategorySettings=Mt;exports.ChargeTypes=K;exports.EmptyCart=ot;exports.FormSettings=Xt;exports.GroupCardModal=tn;exports.HeaderButtons=is;exports.LayoutSettings=Rt;exports.Link=ct;exports.ListingSelector=oe;exports.MetaInfoPost=Cs;exports.PagesMobileMenu=os;exports.PagesMobileModal=at;exports.PagesSettings=Gt;exports.ProductCardButtons=bs;exports.ProductCardModal=zs;exports.ProductOptions=st;exports.ShareLink=ms;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.UserInfo=tt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CTXAJEri.cjs"),m=require("react"),lt="_block_kh9z8_8",dt="_title_kh9z8_16",ut="_subtitle_kh9z8_23",xt="_alignmentContent_kh9z8_30",pt="_alignments_kh9z8_39",mt="_alignment_kh9z8_30",jt="_circle_kh9z8_64",ht="_paddings_kh9z8_71",gt="_padding_kh9z8_71",ft="_active_kh9z8_97",U={block:lt,title:dt,subtitle:ut,alignmentContent:xt,alignments:pt,alignment:mt,circle:jt,paddings:ht,padding:gt,active:ft},Et=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],_t=["left","top","right","bottom"],Rt=c=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:r=!0,isPadding:d=!0}=c;function u(a){switch(a){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(a){switch(a){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[h,C]=m.useState(null),[E,n]=m.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:U.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentContent,children:[r&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:U.alignments,children:Et.map(a=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(a)},className:U.alignment,onMouseEnter:()=>{C(a)},onMouseLeave:()=>{C(null)},children:[a!==i&&h!==a&&t.jsxRuntimeExports.jsx("div",{className:U.circle}),a!==i&&h===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(h),fill:"#c2c2c2",width:22,height:22}),a===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(i),fill:"#FF3F19",width:22,height:22})]},a))})]}),d&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:U.paddings,children:_t.map(a=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(U.padding,{[U.active]:E===a}),onFocus:()=>{n(a)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:j(a),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[a]),onChange:p=>s({...o,[a]:Math.min(Number(p),999)}),max:999,paddingless:!0,borderless:!0})]},a))})]})]})]})},vt="_title_82zux_1",yt="_subtitle_82zux_5",bt="_productsBlock_82zux_14",It="_top_82zux_26",St="_products_82zux_14",Nt="_product_82zux_14",Ct="_button_82zux_80",Pt="_disabled_82zux_91",kt="_buttons_82zux_118",wt="_addButton_82zux_157",$t="_deleteButton_82zux_179",V={title:vt,subtitle:yt,productsBlock:bt,top:It,products:St,product:Nt,button:Ct,disabled:Pt,buttons:kt,addButton:wt,deleteButton:$t};function Bt({id:c,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:r,transition:d,isDragging:u}=t.useSortable({id:c}),j={transform:t.CSS.Transform.toString(r),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${V.product} ${u?V.dragging:""}`,...o,...s,children:i})}const Mt=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:r,tags:d,title:u,subtitle:j,draggable:h=!1,withImage:C=!1,addable:E=!0,itemsOptions:n,hasRangeSelector:a=!1,rangeSelectorOptions:p,limit:B,autoScrollInterval:g,deletable:f,aspectRatio:R,setAspectRatio:P}=c,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),O=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const y=s.findIndex(M=>M===I.id),k=s.findIndex(M=>M===S.id);if(y!==-1&&k!==-1){const M=[...s],[_]=M.splice(y,1);M.splice(k,0,_),e(M)}}};function v(x){if(C)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 y=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:k=>{const M=[...s],_=n.find(l=>l.name===k);if(!_)return;const T=_.id,z=M.map(l=>l===x?T:l);e([...z])},value:S.name,options:n.filter(k=>!s.find(M=>M===k.id)).map(k=>k.name),leftAddonOptions:n.map(k=>({value:k.name,addon:v(k.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:V.buttons,children:t.jsxRuntimeExports.jsx("div",{className:V.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 h?t.jsxRuntimeExports.jsx(Bt,{id:x,children:y},t.v4()):t.jsxRuntimeExports.jsx("div",{className:V.product,children:y},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),a&&p&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...p}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[j&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:j}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:O,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>L(x,f))})}):s.map(x=>L(x,f)),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(V.button,{[V.disabled]:!!(B&&B<=s.length||s.length===n.length)}),size:"s",disabled:!!(B&&B<=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(y=>y===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:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),R&&P&&t.jsxRuntimeExports.jsx(t.Select,{value:R,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>P(x),leftAddonOptions:t.aspectRatioOptions}),d!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:d}),r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:r}),g!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(g.scrollInterval),onChange:x=>g.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Tt="_title_roi3a_1",qt="_subtitle_roi3a_5",Ot="_productsBlock_roi3a_14",At="_top_roi3a_26",Dt="_products_roi3a_14",Lt="_product_roi3a_14",zt="_button_roi3a_80",Ht="_disabled_roi3a_91",Ut="_buttons_roi3a_118",Ft="_addButton_roi3a_164",Vt="_deleteButton_roi3a_179",H={title:Tt,subtitle:qt,productsBlock:Ot,top:At,products:Dt,product:Lt,button:zt,disabled:Ht,buttons:Ut,addButton:Ft,deleteButton:Vt};function Yt({product:c,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:r,transition:d,isDragging:u}=t.useSortable({id:c.id}),j={transform:t.CSS.Transform.toString(r),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${H.product} ${u?H.dragging:""}`,...o,...s,children:i})}const Gt=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:r,subtitle:d,editable:u=!0,draggable:j=!1,deletable:h=!0,addable:C=!0,itemsType:E,itemsOptions:n,addableOptions:a={},limit:p}=c,[B,g]=m.useState(null),[f,R]=m.useState(null),P=m.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));m.useEffect(()=>{if(B){const x=[...s].map(I=>I.id===B.id?B:I);e(x)}},[B]),m.useEffect(()=>{P.current&&f&&(P.current.getBoundingClientRect().height,f.top)},[P.current,f]);const O=(x,I)=>{x.stopPropagation();const S=x.target.getBoundingClientRect();R({top:S.top+window.scrollY,left:S.left-30}),g(I)},v=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const y=s.findIndex(M=>M.id===I.id),k=s.findIndex(M=>M.id===S.id);if(y!==-1&&k!==-1){const M=[...s],[_]=M.splice(y,1);M.splice(k,0,_),e(M)}}},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:y=>{const k=[...s],M=n.find(T=>T.name===y);if(!M)return;const _=k.map(T=>T.id===x.id?{...M,name:{"en-US":y}}:T);g({...x,name:{"en-US":y}}),e([..._])},value:x.name,options:n.filter(y=>!s.find(k=>k.name===y.name)).map(y=>y.name)}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[u&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>O(y,x)})}),h&&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(y=>y.id!==x.id))})})]})]});return j?t.jsxRuntimeExports.jsx(Yt,{product:x,index:I,children:S},x.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:S},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(r||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:r}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:d}),j?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:v,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)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(p&&p<=s.length||s.length===(n==null?void 0:n.length))}),size:"s",disabled:!!(p&&p<=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(y=>y.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,...a}),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})]})})})]})]})};function Wt(c){const{product:i,children:o}=c,{attributes:s,listeners:e,setNodeRef:r,transform:d,transition:u,isDragging:j}=t.useSortable({id:i.id}),h={transform:t.CSS.Transform.toString(d),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:r,style:h,className:`${t.styles.product} ${j?t.styles.dragging:""}`,...s,...e,children:o})}const Xt=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:r,title:d,subtitle:u,editable:j=!0,draggable:h=!1,deletable:C=!0,addable:E=!0,itemsType:n,itemsPlaceholder:a="",itemsOptions:p,hasRangeSelector:B=!1,rangeSelectorOptions:g,modalOptions:f,addableOptions:R={},limit:P}=c,[D,O]=m.useState(null),[v,L]=m.useState({top:0,left:0}),[x,I]=m.useState(null),S=m.useRef(null),[y,k]=m.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));m.useEffect(()=>{const l=()=>{O(null),k(!1)};return document.body.addEventListener("click",l),O(null),k(!1),()=>{O(null),k(!1),document.body.removeEventListener("click",l)}},[]),m.useEffect(()=>{if(D){const l=[...s].map($=>$.id===D.id?D:$);e(l)}},[D]),m.useEffect(()=>{if(S.current&&x){const l=S.current.getBoundingClientRect().height,$=window.innerHeight;let b=x.top;b+l>$+window.scrollY-200&&(b=$+window.scrollY-l-200),b<0&&(b=10),L({top:b,left:x.left})}},[S.current,x]);const _=(l,$)=>{l.stopPropagation();const b=l.target.getBoundingClientRect();I({top:b.top+window.scrollY,left:b.left-30}),O($),k(!0)},T=l=>{const{active:$,over:b}=l;if(b&&$.id!==b.id){const q=s.findIndex(A=>A.id===$.id),W=s.findIndex(A=>A.id===b.id);if(q!==-1&&W!==-1){const A=[...s],[G]=A.splice(q,1);A.splice(W,0,G),e(A)}}},z=l=>{var b;const $=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"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const A=[...s].map(G=>G.id===l.id?{...l,name:{"en-US":q}}:G);O({...l,name:{"en-US":q}}),e([...A])},value:l.name["en-US"],options:p.filter(q=>!s.find(W=>W.name["en-US"]===q))}),n==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:q=>{const A=[...s].map(G=>G.id===l.id?{...l,name:{"en-US":q}}:G);e([...A])},value:l.name["en-US"],placeholder:a}),n==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:q=>{const A=[...s].map(G=>G.id===l.id?{...l,images:q}:G);e([...A])},activeImage:(b=s.find(q=>q.id===l.id))==null?void 0:b.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:q=>_(q,l)})}),C&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(q=>q.id!==l.id))})})]})]});return h?t.jsxRuntimeExports.jsx(Wt,{product:l,children:$},l.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:$},l.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(d||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:d}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:l=>o==null?void 0:o(l)})]}),D&&j&&f&&y&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:S,activeItem:D,setActiveItem:O,popupPosition:v,modalOptions:f,setIsOpenModal:k}),B&&g&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...g}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:u}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:T,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]:!!(P&&P<=s.length)}),size:"s",disabled:!!(P&&P<=s.length),onClick:()=>{const l=[...s];let $=null;if(p){for(let b=0;b<p.length;b++)if(!s.find(q=>q.name["en-US"]===p[b])){$=p[b];break}}n==="select"&&p?l.push({name:{"en-US":$||p[0]},id:t.v4(),...R,maxSymbols:100}):n==="input"?l.push({name:{"en-US":""},id:t.v4(),...R,maxSymbols:100}):l.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...R,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})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:r})]})},Qt="_subtitle_jql1y_1",Jt="_products_jql1y_10",Kt="_product_jql1y_10",Zt="_button_jql1y_11",te="_buttons_jql1y_11",ee="_addButton_jql1y_150",se="_deleteButton_jql1y_165",X={subtitle:Qt,products:Jt,product:Kt,button:Zt,buttons:te,addButton:ee,deleteButton:se},et=c=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:r=!0}=c,{pages:d}=t.usePagesStore(),[u,j]=m.useState(null),[h,C]=m.useState({top:0,left:0}),[E,n]=m.useState(null),a=m.useRef(null);m.useEffect(()=>{if(u){const g=[...i].map(f=>f.id===u.id?u:f);o(g)}},[u]),m.useEffect(()=>{if(a.current&&E){const g=a.current.getBoundingClientRect().height,f=window.innerHeight;let R=E.top;R+g>f+window.scrollY-200&&(R=f+window.scrollY-g-200),R<0&&(R=10),C({top:R,left:E.left})}},[a.current,E]);const p=(g,f)=>{g.stopPropagation();const R=g.target.getBoundingClientRect();n({top:R.top+window.scrollY-70,left:R.left-(e?30:65)}),j(f)},B=(g,f)=>{const R=[...i],P={...g,id:Math.random().toString(36).substr(2,9)};R.splice(f+1,0,P),o(R)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),i.map((g,f)=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const D=[...i].map(O=>O.id===g.id?{...g,type:R}:O);o(D)},value:g.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{B(g,f)}})}),t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>{p(R,g)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const R=i.filter(P=>P.id!==g.id);o(R)},width:20,height:20,fill:"#C12A2A"})})]})]},g.id)),u&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:a,activeButton:u,setActiveButton:j,popupPosition:h,editableLink:r}),e&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:X.button,size:"s",onClick:()=>{const g=[...i];r?g.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:d?Object.values(d)[0].path:"/",openInNewTab:!1}):g.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:d?Object.values(d)[0].path:"/",openInNewTab:!1}),o(g)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},ne=c=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:r=!0,addable:d=!0,deletable:u=!0}=c;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:r,addable:d,deletable:u})]})})};function ie(c){const{product:i,children:o}=c,{attributes:s,listeners:e,setNodeRef:r,transform:d,transition:u,isDragging:j}=t.useSortable({id:String(i.listingId)}),h={transform:t.CSS.Transform.toString(d),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:r,style:h,className:`${t.styles$2.product} ${j?t.styles$2.dragging:""}`,...s,...e,children:o})}const oe=c=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:r,title:d,subtitle:u,editable:j=!0,draggable:h=!1,withImage:C=!1,deletable:E=!0,addable:n=!0,itemsType:a,itemsOptions:p,limit:B,aspectRatio:g,setAspectRatio:f}=c,[R,P]=m.useState(null),[D,O]=m.useState({top:0,left:0}),[v,L]=m.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));m.useEffect(()=>{const _=()=>{P(null),L(!1)};return document.body.addEventListener("click",_),P(null),L(!1),()=>{P(null),L(!1),document.body.removeEventListener("click",_)}},[]),m.useEffect(()=>{if(R){const _=[...s].map(T=>T.listingId===R.listingId?R:T);e(_)}},[R]);const I=(_,T)=>{_.stopPropagation();const z=_.target.getBoundingClientRect(),l=100,$=window.innerHeight;let b=z.top+window.scrollY;b+l>$&&(b=$-l-20),L(!0),O({top:b-80,left:z.left-30}),P(T)};function S(_){if(C)return _?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${_}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const y=_=>{const{active:T,over:z}=_;if(z&&T.id!==z.id){const l=s.findIndex(b=>String(b.listingId)===T.id),$=s.findIndex(b=>String(b.listingId)===z.id);if(l!==-1&&$!==-1){const b=[...s],[q]=b.splice(l,1);b.splice($,0,q),e(b)}}},k=_=>{const T=p.find(l=>_.listingId===l.id);if(!T)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})}),a==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{const $=[...s],b=p.find(A=>A.productData.name===l);if(!b)return;const q={listingId:b.id,image:b.productData.images.length>0?b.productData.images[0].cfId:""},W=$.map(A=>A.listingId===_.listingId?q:A);P(q),e([...W])},value:T.productData.name,options:[...p.filter(l=>!s.find($=>$.listingId===l.id)).map(l=>l.productData.name)],leftAddonOptions:p.map(l=>{var $;return{value:l.productData.name,addon:S((($=l.productData.images[0])==null?void 0:$.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,_)})}),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!==_))})})]})]});return h?t.jsxRuntimeExports.jsx(ie,{product:_,children:z},_.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},_.listingId)},M=m.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(d||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:d}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:_=>o==null?void 0:o(_)})]}),v&&R&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:M,activeItem:R,setActiveItem:P,setIsOpenModal:L,popupPosition:D,itemsOptions:p}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:u}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(_=>String(_.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(_=>k(_))})}):s.map(_=>k(_)),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 _=[...s];for(let T=0;T<p.length;T++)if(!s.find(z=>z.listingId===p[T].id)){_.push({listingId:p[T].id,image:p[T].productData.images.length>0?p[T].productData.images[0].cfId:""});break}e(_)},disabled:s.length===(B||p.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})]})})})]}),g&&f&&t.jsxRuntimeExports.jsx(t.Select,{value:g,options:Object.keys(t.aspectRatio),onChange:_=>f(_),leftAddonOptions:t.aspectRatioOptions}),i&&r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:r})]})},ae="_options_167h8_1",re="_price_167h8_18",ce="_oldPrice_167h8_25",le="_newPrice_167h8_33",de="_animate_167h8_40",ue="_meta_167h8_58",xe="_info_167h8_64",pe="_infoRight_167h8_73",me="_buttons_167h8_80",je="_variants_167h8_87",he="_variant_167h8_87",ge="_stock_167h8_105",fe="_variantInfo_167h8_112",Ee="_quantity_167h8_119",_e="_button_167h8_80",Re="_activeVariant_167h8_165",ve="_chargeTypes_167h8_169",ye="_charge_167h8_169",be="_chargeActive_167h8_194",Ie="_title_167h8_202",w={options:ae,price:re,oldPrice:ce,newPrice:le,animate:de,meta:ue,info:xe,infoRight:pe,buttons:me,variants:je,variant:he,stock:ge,variantInfo:fe,quantity:Ee,button:_e,activeVariant:Re,chargeTypes:ve,charge:ye,chargeActive:be,title:Ie};var K=(c=>(c.ONE_TIME="One-Time",c.RECURRING="Subscribe & Save",c))(K||{});const st=c=>{var D,O;const{product:i,setIsOpen:o}=c,{variants:s}=i,[e,r]=m.useState(s[0]),[d,u]=m.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),{notifications:j,setNotifications:h}=t.useNotificationStore(),C=t.useNavigate(),[E,n]=m.useState(1),{reset:a,addProductToCart:p}=t.useCart(),[B,g]=m.useState(!1);m.useEffect(()=>{g(!0);const v=setTimeout(()=>g(!1),600);return()=>clearTimeout(v)},[E]);async function f(){await p({productId:i.id,productVariantId:e.id,quantity:E}),o==null||o(!1),h([...j,{id:t.v4(),message:"Product added to cart",status:"success"}])}function R(){a(),f(),C("/checkout")}function P(v){if(v>=864e5){const y=Math.floor(v/864e5);return`${y} ${y===1?"day":"days"}`}else if(v>=36e5){const y=Math.floor(v/36e5);return`${y} ${y===1?"hour":"hours"}`}else if(v>=6e4){const y=Math.floor(v/6e4);return`${y} ${y===1?"minute":"minutes"}`}else{const y=Math.floor(v/1e3);return`${y} ${y===1?"second":"seconds"}`}}return m.useEffect(()=>{e.quantity&&e.quantity.available===0?n(0):n(1)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:w.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:w.chargeTypes,children:e.chargeTypes.map(v=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:d===v}),onClick:()=>u(v),children:K[v]},v))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:s.map(v=>{var L,x;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===v.id}),onClick:()=>r(v),children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:t.splitTextIntoSpans(v.name)}),t.jsxRuntimeExports.jsxs("span",{children:["$",d==="ONE_TIME"?v.price.amount:v.subscriptionSettings?v.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:d==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,children:[(L=v.quantity.restrictions)!=null&&L.max||v.quantity.available!==void 0?((x=v.quantity.restrictions)==null?void 0:x.max)||v.quantity.available:"∞"," ","in stock"]})})]},v.id)})}),d==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{E>1?n(v=>v-1):n(1)},className:w.button,disabled:e.quantity.available&&e.quantity.restrictions&&E<=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(E),onChange:v=>n(Number(v)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((O=e.quantity.restrictions)==null?void 0:O.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&E>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n(v=>v+1)},className:w.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&E>=e.quantity.restrictions.max||e.quantity.available===0),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:w.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:w.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"var(--text-action)",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":P(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:d==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",(e.price.amount||0)*E]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*E]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",(e.price.amount||0)*E]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:B}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>R(),disabled:e.quantity&&e.quantity.available===0,children:d==="ONE_TIME"?"Buy Now":"Subscribe Now"}),d==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>f(),disabled:e.quantity&&e.quantity.available===0,children:"Add to Cart"})]})]})},Se="_buttons_qns27_23",Ne="_modal_qns27_32",Ce="_closing_qns27_64",Pe="_info_qns27_113",ke="_top_qns27_120",we="_title_qns27_131",$e="_clear_qns27_138",Be="_activeClear_qns27_145",Me="_count_qns27_149",Te="_cart_qns27_164",qe="_empty_qns27_172",Oe="_product_qns27_198",Ae="_products_qns27_207",De="_image_qns27_215",Le="_productInfo_qns27_231",ze="_content_qns27_238",He="_name_qns27_244",Ue="_price_qns27_250",Fe="_productButtons_qns27_256",Ve="_productButton_qns27_256",Ye="_productCount_qns27_273",Ge="_bottom_qns27_290",We="_subtotal_qns27_298",Xe="_block_qns27_306",Qe="_shoppingCount_qns27_313",Je="_total_qns27_333",Ke="_link_qns27_339",Ze="_userInfo_qns27_346",ts="_pagesMobileModal_qns27_358",es="_pagesMobileModalContent_qns27_372",ss="_pagesMobileModalHeader_qns27_378",ns="_pagesMobileModalFooter_qns27_388",N={buttons:Se,modal:Ne,closing:Ce,info:Pe,top:ke,title:we,clear:$e,activeClear:Be,count:Me,cart:Te,empty:qe,product:Oe,products:Ae,image:De,productInfo:Le,content:ze,name:He,price:Ue,productButtons:Fe,productButton:Ve,productCount:Ye,bottom:Ge,subtotal:We,block:Xe,shoppingCount:Qe,total:Je,link:Ke,userInfo:Ze,pagesMobileModal:ts,pagesMobileModalContent:es,pagesMobileModalHeader:ss,pagesMobileModalFooter:ns},is=c=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=c;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[c,i]=m.useState(!1),[o,s]=m.useState([]),{cart:e,products:r}=t.useCart();function d(n){if(n.variants.length>0){for(let a=0;a<e.parts.length;a++)for(let p=0;p<n.variants.length;p++)if(n.variants[p]&&e.parts[a].productVariantId===n.variants[p].id)return e.parts[a].productVariantId}return n.variants[0].id}function u(n){for(let a=0;a<e.parts.length;a++)for(let p=0;p<n.variants.length;p++)if(n.variants[p]&&e.parts[a].productVariantId===n.variants[p].id)return e.parts[a].quantity}m.useEffect(()=>{(async()=>{const a=e.parts.map(g=>String(g.productId)),B=(r.filter(g=>a.includes(String(g.id)))||[]).map(g=>({...g,activeVariantId:d(g),quantity:u(g)}));s(B)})()},[e.parts]);function j(n){var a;return!n||!(n!=null&&n.variants)?!1:(a=n.variants.find(p=>p.id===n.activeVariantId))==null?void 0:a.subscriptionSettings}const h=e.parts.length>0&&o.length>0&&!j(o[0]),[C,E]=m.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"}),h&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:e.parts.length})]}),c&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{E(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:h,isOpen:C})})]})},it=c=>{const{activeProducts:i,isCartNotEmpty:o,isOpen:s}=c,{cart:e,reset:r,getTotalAndDiscount:d,updateQuantityOfProduct:u}=t.useCart(),j=t.useNavigate();function h(n){j(n)}function C(n){n.quantity&&u({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1})}function E(n){n.quantity&&u({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:r,children:"Clear all"})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:[...new Map(i.map(n=>[n.id,n])).values()].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(a=>a.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:()=>C(n),className:N.productButton,disabled:n.quantity===n.variants.find(a=>a.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:["$",d().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>h("/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:c,close:i})=>{const{token:o}=t.useStorefrontStore(),s=t.useNavigate(),[e,r]=m.useState("test-email@gmail.com");m.useEffect(()=>{o&&(async()=>{if(!o)return;const j=t.jwtDecode(o);r(j.email)})()},[o]);function d(u){window.location.pathname.includes("/admin/builder")||s(u)}return o?t.jsxRuntimeExports.jsx("div",{className:N.userInfo,onClick:()=>{d("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:e||"test-email@gmail.com"})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{d("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),c&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{d("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]})},at=({children:c,logo:i,setIsOpen:o,signUp:s})=>{const{setIsOpen:e}=t.useModalStore(),r=()=>{e(!1),setTimeout(()=>{o(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:d=>d.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:r,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:c}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:r})})]})},os=({children:c,logo:i,signUp:o})=>{const[s,e]=m.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:c})})]})},rt=c=>{const{setIsOpenModal:i}=c;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"})})},as="_share_rlgln_1",rs="_modal_rlgln_8",cs="_header_rlgln_20",ls="_title_rlgln_46",ds="_copyWrapper_rlgln_52",us="_copyText_rlgln_61",xs="_copyTextMobile_rlgln_74",ps="_copyTextMiniMobile_rlgln_93",Q={share:as,modal:rs,header:cs,title:ls,copyWrapper:ds,copyText:us,copyTextMobile:xs,copyTextMiniMobile:ps},ms=({title:c="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:Q.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(js,{title:c})})]})},js=({title:c="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notifications:o,setNotifications:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),r=window.location.href;function d(){navigator.clipboard.writeText(r),s([...o,{id:t.v4(),message:"Link copied to clipboard",status:"success"}])}function u(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function j(h,C){return h.length>C?h.slice(0,C)+"...":h}return t.jsxRuntimeExports.jsxs("div",{className:Q.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,children:[t.jsxRuntimeExports.jsx("div",{className:Q.title,children:c}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:u,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:Q.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:d,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:Q.copyText,children:j(r,100)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMobile,children:j(r,40)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMiniMobile,children:j(r,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:d,children:o.find(h=>h.message==="Link copied to clipboard")?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},hs="_accordion_1s1lq_1",gs="_header_1s1lq_9",fs="_icon_1s1lq_18",Es="_open_1s1lq_21",_s="_content_1s1lq_25",J={accordion:hs,header:gs,icon:fs,open:Es,content:_s},Rs=({title:c,content:i,defaultOpen:o=!1})=>{const[s,e]=m.useState(o),[r,d]=m.useState(0),u=m.useRef(null),j=()=>{e(!s)};return m.useEffect(()=>{u.current&&d(s?u.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:c}),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:u,className:J.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},ct=({children:c,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:c});const r=t.useNavigate(),d=/^https?:\/\//.test(i),u=j=>{d||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.open(i,"_self"):(j.preventDefault(),r(i))};return t.jsxRuntimeExports.jsx("div",{onClick:u,className:o,role:"link",style:{cursor:"pointer"},id:e,children:c})},vs="_buttonsBlock_1b2rb_1",ys={buttonsBlock:vs},bs=c=>{var h,C;const{setIsOpen:i,setModalType:o,productId:s}=c,{cart:e}=t.useCart(),{pageContext:r}=t.usePagesStore(),d=(h=r==null?void 0:r.listings)==null?void 0:h.find(E=>E.id===s);if(!d)return null;const u=(C=r==null?void 0:r.products)==null?void 0:C.find(E=>E.uniquePath===d.productData.uniquePath);if(!u)return null;const j=e.parts.find(E=>E.productId===u.id);return t.jsxRuntimeExports.jsxs("div",{className:ys.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"})]})},Is="_wrapper_27wzz_1",Ss="_logo_27wzz_8",Ns="_info_27wzz_12",Z={wrapper:Is,logo:Ss,info:Ns},Cs=({date:c})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),r={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",r)}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(c)})]})]})},Ps="_variants_puxd1_80",ks="_variant_puxd1_80",ws="_stock_puxd1_98",$s="_variantInfo_puxd1_105",Bs="_chargeTypes_puxd1_165",Ms="_charge_puxd1_165",Ts="_chargeActive_puxd1_190",qs="_title_puxd1_198",Os="_modal_puxd1_204",As="_header_puxd1_224",Ds="_productOptions_puxd1_232",Ls="_loading_puxd1_236",Y={variants:Ps,variant:ks,stock:ws,variantInfo:$s,chargeTypes:Bs,charge:Ms,chargeActive:Ts,title:qs,modal:Os,header:As,productOptions:Ds,loading:Ls},zs=c=>{var n;const{pageContext:i}=t.usePagesStore(),o=(n=i==null?void 0:i.listings)==null?void 0:n.find(a=>a.id===c.productId),[s,e]=m.useState(!0),[r,d]=m.useState(null),u=(r==null?void 0:r.variants[0])||null,[j,h]=m.useState(u!=null&&u.chargeTypes&&u.chargeTypes.length>1?u.chargeTypes[0]:"ONE_TIME"),{addProducts:C}=t.useCart(),{setIsOpen:E}=t.useModalStore();return m.useEffect(()=>{(async()=>{e(!0);const p=await t.getDynamicPage(encodeURIComponent(`/product/${o.productData.uniquePath}`));C(p==null?void 0:p.data.products),d(p==null?void 0:p.data.products[0]),e(!1)})()},[]),m.useEffect(()=>{E(!0)},[]),t.jsxRuntimeExports.jsx(t.Modal,{close:c.setIsOpen,children:t.jsxRuntimeExports.jsxs("div",{className:Y.modal,onClick:a=>a.stopPropagation(),children:[s&&t.jsxRuntimeExports.jsx("div",{className:Y.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})}),c.type==="Add To Cart"&&r&&u&&!s&&t.jsxRuntimeExports.jsx(Hs,{variants:r.variants,activeVariant:u,activeChargeType:j,setActiveChargeType:h,productId:r.id,setIsOpen:c.setIsOpen}),c.type==="Buy Now"&&r&&!s&&t.jsxRuntimeExports.jsx(Us,{product:r,setIsOpen:c.setIsOpen})]})})},Hs=c=>{const{variants:i,activeChargeType:o,setActiveChargeType:s,activeVariant:e,productId:r,setIsOpen:d}=c,{cart:u,addProductToCart:j,addProducts:h,updateQuantityOfProduct:C}=t.useCart(),{notifications:E,setNotifications:n}=t.useNotificationStore(),{pageContext:a}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),B=()=>{p(!1),setTimeout(()=>{d(!1)},300)};async function g(f){const R=u.parts.find(P=>P.productId===c.productId&&P.productVariantId===f);R?C({productId:r,productVariantId:f,quantity:R.quantity+1}):(a!=null&&a.products&&await h(a.products),await j({productId:r,productVariantId:f,quantity:1})),n([...E,{id:t.v4(),message:"Product added to cart",status:"success"}])}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Y.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:B})]}),e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:Y.chargeTypes,children:e.chargeTypes.map(f=>t.jsxRuntimeExports.jsx("div",{className:t.clx(Y.charge,{[Y.chargeActive]:o===f}),onClick:()=>s(f),children:K[f]},f))}),t.jsxRuntimeExports.jsx("div",{className:Y.variants,children:i.map(f=>{var R,P;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(Y.variant),onClick:()=>{g(f.id),d(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:Y.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:Y.title,children:f.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?f.price.amount:f.subscriptionSettings?f.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:Y.stock,children:[(R=f.quantity.restrictions)!=null&&R.max||f.quantity.available!==void 0?((P=f.quantity.restrictions)==null?void 0:P.max)||f.quantity.available:"∞"," ","in stock"]})})]},f.id)})})]})},Us=c=>{const{product:i,setIsOpen:o}=c,{setIsOpen:s}=t.useModalStore(),e=()=>{s(!1),setTimeout(()=>{o(!1)},300)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:Y.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:e,style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx("div",{className:Y.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})})]})},Fs="_contentModal_2a136_1",Vs="_modalTop_2a136_13",Ys="_loading_2a136_19",Gs="_modalCards_2a136_27",Ws="_modalImage_2a136_32",Xs="_card_2a136_37",Qs="_cardInfo_2a136_48",Js="_cardButtons_2a136_55",Ks="_title_2a136_61",Zs="_blockImage_2a136_68",F={contentModal:Fs,modalTop:Vs,loading:Ys,modalCards:Gs,modalImage:Ws,card:Xs,cardInfo:Qs,cardButtons:Js,title:Ks,blockImage:Zs},tn=c=>{const{setIsOpen:i,pageContext:o,groupData:s,setProductId:e,setIsProductModalOpen:r}=c,[d,u]=m.useState(null),[j,h]=m.useState(!0),{setIsOpen:C}=t.useModalStore();m.useEffect(()=>{var p;h(!0);const a=(p=o.listings)==null?void 0:p.filter(B=>s.listingIdList.includes(B.id));a&&u([...a]),h(!1)},[o]),m.useEffect(()=>{C(!0)},[]);const E=()=>{C(!1),setTimeout(()=>{i(!1)},300)};function n(a){return a.productData.compareAtPrice?a.productData.compareAtPrice.amount:0}return t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsxs("div",{className:F.contentModal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:F.modalTop,children:[t.jsxRuntimeExports.jsx("span",{className:F.title,id:"h4",children:t.splitTextIntoSpans(s.name)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:E})]}),!j&&d&&t.jsxRuntimeExports.jsx("div",{className:F.modalCards,children:d.map(a=>t.jsxRuntimeExports.jsxs("div",{className:F.card,children:[t.jsxRuntimeExports.jsx("div",{children:a.productData.images[0]?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a.productData.images[0].cfId}/w=500`,alt:"",width:64,height:64,className:F.modalImage}):t.jsxRuntimeExports.jsx("div",{className:t.clx(F.blockImage,F.modalImage),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})})}),t.jsxRuntimeExports.jsxs("div",{className:F.cardInfo,children:[t.jsxRuntimeExports.jsxs("span",{className:F.name,id:"h5",children:[t.splitTextIntoSpans(a.productData.name)," $",a.productData.minPrice.amount," ","- $",n(a)]}),a.productData.shortDescription&&t.jsxRuntimeExports.jsx("span",{className:F.short,id:"md",children:t.splitTextIntoSpans(a.productData.shortDescription)}),t.jsxRuntimeExports.jsx("span",{})]}),t.jsxRuntimeExports.jsxs("div",{className:F.cardButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{e(a.id),i(!1),r(!0)},children:"Buy"}),t.jsxRuntimeExports.jsx(ct,{path:`/product/${a.productData.uniquePath}`,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",children:"View Details"})})]})]},a.id))}),j&&t.jsxRuntimeExports.jsx("div",{className:F.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]})})};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.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectUI=t.Select$1;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TextareaUI=t.Textarea$1;exports.TypesText=t.TypesText;exports.Accordion=Rs;exports.BurgerMenuButton=rt;exports.ButtonTypeSettings=et;exports.ButtonsSettings=ne;exports.CategorySettings=Mt;exports.ChargeTypes=K;exports.EmptyCart=ot;exports.FormSettings=Xt;exports.GroupCardModal=tn;exports.HeaderButtons=is;exports.LayoutSettings=Rt;exports.Link=ct;exports.ListingSelector=oe;exports.MetaInfoPost=Cs;exports.PagesMobileMenu=os;exports.PagesMobileModal=at;exports.PagesSettings=Gt;exports.ProductCardButtons=bs;exports.ProductCardModal=zs;exports.ProductOptions=st;exports.ShareLink=ms;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.UserInfo=tt;
|