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