@billgangcom/theme-lib 1.72.0 → 1.72.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.cjs.js +9 -9
- package/dist/builder.es.js +1232 -1229
- package/dist/{index-C1MFZtIu.js → index-B144ufUm.js} +2791 -2725
- package/dist/{index-C0ITHnt3.cjs → index-CB4WRbjL.cjs} +25 -25
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui/AlignText/index.d.ts +7 -0
- package/dist/ui/FormSettings/popup.d.ts +1 -0
- package/dist/ui/ItemsSettings/popup.d.ts +1 -0
- package/dist/ui/TextSettings/index.d.ts +3 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +14 -13
- 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-CB4WRbjL.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useReCaptcha=t.useReCaptcha;
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { App as s, ColorVariables as t, hotReload as o, iconNames as r, useBuilderPages as p, useCreateTicket as i } from "./builder.es.js";
|
|
2
|
-
import { R as l, a as u, f as R, s as d, b as f, u as m } from "./index-
|
|
2
|
+
import { R as l, a as u, f as R, s as d, b as f, u as m } from "./index-B144ufUm.js";
|
|
3
3
|
export {
|
|
4
4
|
s as App,
|
|
5
5
|
t as ColorVariables,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextType } from '../TypesText';
|
|
3
3
|
import { TypeFontKeys } from '@builder/constants';
|
|
4
|
+
import { AlignText } from '../AlignText';
|
|
4
5
|
interface Props {
|
|
5
6
|
typesText: TextType[];
|
|
6
7
|
setTypesText: (value: TextType[]) => void;
|
|
@@ -12,6 +13,8 @@ interface Props {
|
|
|
12
13
|
subtitle?: string;
|
|
13
14
|
typeFont: TypeFontKeys;
|
|
14
15
|
setTypeFont: (value: TypeFontKeys) => void;
|
|
16
|
+
alignText: AlignText;
|
|
17
|
+
setAlignText: (value: AlignText) => void;
|
|
15
18
|
}
|
|
16
19
|
export declare const TextSettings: React.FC<Props>;
|
|
17
20
|
export {};
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './PagesSettings';
|
|
|
6
6
|
export * from './FormSettings';
|
|
7
7
|
export * from './ButtonsSettings';
|
|
8
8
|
export * from './TypesText';
|
|
9
|
+
export * from './AlignText';
|
|
9
10
|
export * from './ButtonTypeSettings';
|
|
10
11
|
export * from './RangeSelector';
|
|
11
12
|
export * from './ListingSelector';
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-C0ITHnt3.cjs"),g=require("react");require("react-dom");const ct="_block_kh9z8_8",lt="_title_kh9z8_16",dt="_subtitle_kh9z8_23",ut="_alignmentContent_kh9z8_30",xt="_alignments_kh9z8_39",pt="_alignment_kh9z8_30",mt="_circle_kh9z8_64",jt="_paddings_kh9z8_71",ht="_padding_kh9z8_71",gt="_active_kh9z8_97",F={block:ct,title:lt,subtitle:dt,alignmentContent:ut,alignments:xt,alignment:pt,circle:mt,paddings:jt,padding:ht,active:gt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],yt=["left","top","right","bottom"],Et=u=>{const{alignment:n,padding:o,setPadding:s,setAlignment:e,isAlignment:a=!0,isPadding:r=!0}=u;function m(l){switch(l){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 f(l){switch(l){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[y,P]=g.useState(null),[j,p]=g.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:F.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentContent,children:[a&&t.jsxRuntimeExports.jsxs("div",{className:F.block,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:F.alignments,children:ft.map(l=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(l)},className:F.alignment,onMouseEnter:()=>{P(l)},onMouseLeave:()=>{P(null)},children:[l!==n&&y!==l&&t.jsxRuntimeExports.jsx("div",{className:F.circle}),l!==n&&y===l&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(y),fill:"#c2c2c2",width:22,height:22}),l===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(n),fill:"#FF3F19",width:22,height:22})]},l))})]}),r&&t.jsxRuntimeExports.jsxs("div",{className:F.block,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:F.paddings,children:yt.map(l=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(F.padding,{[F.active]:j===l}),onFocus:()=>{p(l)},onBlur:()=>{p(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:f(l),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[l]),onChange:E=>s({...o,[l]:Math.min(Number(E),999)}),max:999,paddingless:!0,borderless:!0})]},l))})]})]})]})},_t="_title_82zux_1",Rt="_subtitle_82zux_5",vt="_productsBlock_82zux_14",bt="_top_82zux_26",It="_products_82zux_14",St="_product_82zux_14",Nt="_button_82zux_80",Ct="_disabled_82zux_91",Pt="_buttons_82zux_118",kt="_addButton_82zux_157",wt="_deleteButton_82zux_179",H={title:_t,subtitle:Rt,productsBlock:vt,top:bt,products:It,product:St,button:Nt,disabled:Ct,buttons:Pt,addButton:kt,deleteButton:wt};function Tt({id:u,children:n}){const{attributes:o,listeners:s,setNodeRef:e,transform:a,transition:r,isDragging:m}=t.useSortable({id:u}),f={transform:t.CSS.Transform.toString(a),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${H.product} ${m?H.dragging:""}`,...o,...s,children:n})}const Bt=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,other:a,tags:r,title:m,subtitle:f,draggable:y=!1,withImage:P=!1,addable:j=!0,itemsOptions:p,hasRangeSelector:l=!1,rangeSelectorOptions:E,limit:_,autoScrollInterval:c,deletable:i,aspectRatio:R,setAspectRatio:C}=u,M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),A=x=>{const{active:I,over:k}=x;if(k&&I.id!==k.id){const B=s.findIndex($=>$===I.id),b=s.findIndex($=>$===k.id);if(B!==-1&&b!==-1){const $=[...s],[v]=$.splice(B,1);$.splice(b,0,v),e($)}}};function V(x){if(P)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 h=(x,I=!1)=>{const k=p.find(b=>b.id===x);if(!k)return;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const $=[...s],v=p.find(d=>d.name===b);if(!v)return;const O=v.id,z=$.map(d=>d===x?O:d);e([...z])},value:k.name,options:p.filter(b=>!s.find($=>$===b.id)).map(b=>b.name),leftAddonOptions:p.map(b=>({value:b.name,addon:V(b.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:H.buttons,children:t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(b=>b!==x))})})})]});return y?t.jsxRuntimeExports.jsx(Tt,{id:x,children:B},t.v4()):t.jsxRuntimeExports.jsx("div",{className:H.product,children:B},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(m||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:m}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:x=>o==null?void 0:o(x)})]}),l&&E&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...E}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[f&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:f}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>h(x,i))})}):s.map(x=>h(x,i)),j&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(_&&_<=s.length||s.length===p.length)}),size:"s",disabled:!!(_&&_<=s.length||s.length===p.length),onClick:()=>{const x=[...s];let I=null;if(p){for(let k=0;k<p.length;k++)if(!s.find(B=>B===p[k].id)){I=p[k];break}}x.push((I==null?void 0:I.id)||p[0].id),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),R&&C&&t.jsxRuntimeExports.jsx(t.Select,{value:R,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>C(x),leftAddonOptions:t.aspectRatioOptions}),r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:r}),a!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:a}),c!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(c.scrollInterval),onChange:x=>c.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Mt="_title_roi3a_1",$t="_subtitle_roi3a_5",Ot="_productsBlock_roi3a_14",qt="_top_roi3a_26",At="_products_roi3a_14",Dt="_product_roi3a_14",Lt="_button_roi3a_80",zt="_disabled_roi3a_91",Ut="_buttons_roi3a_118",Ft="_addButton_roi3a_164",Ht="_deleteButton_roi3a_179",U={title:Mt,subtitle:$t,productsBlock:Ot,top:qt,products:At,product:Dt,button:Lt,disabled:zt,buttons:Ut,addButton:Ft,deleteButton:Ht};function Vt({product:u,children:n}){const{attributes:o,listeners:s,setNodeRef:e,transform:a,transition:r,isDragging:m}=t.useSortable({id:u.id}),f={transform:t.CSS.Transform.toString(a),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${U.product} ${m?U.dragging:""}`,...o,...s,children:n})}const Yt=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,title:a,subtitle:r,editable:m=!0,draggable:f=!1,deletable:y=!0,addable:P=!0,itemsType:j,itemsOptions:p,addableOptions:l={},limit:E}=u,[_,c]=g.useState(null),[i,R]=g.useState(null),C=g.useRef(null),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{if(_){const x=[...s].map(I=>I.id===_.id?_:I);e(x)}},[_]),g.useEffect(()=>{C.current&&i&&(C.current.getBoundingClientRect().height,i.top)},[C.current,i]);const A=(x,I)=>{x.stopPropagation();const k=x.target.getBoundingClientRect();R({top:k.top+window.scrollY,left:k.left-30}),c(I)},V=x=>{const{active:I,over:k}=x;if(k&&I.id!==k.id){const B=s.findIndex($=>$.id===I.id),b=s.findIndex($=>$.id===k.id);if(B!==-1&&b!==-1){const $=[...s],[v]=$.splice(B,1);$.splice(b,0,v),e($)}}},h=(x,I)=>{const k=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[f&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),j==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const b=[...s],$=p.find(O=>O.name===B);if(!$)return;const v=b.map(O=>O.id===x.id?{...$,name:{"en-US":B}}:O);c({...x,name:{"en-US":B}}),e([...v])},value:x.name,options:p.filter(B=>!s.find(b=>b.name===B.name)).map(B=>B.name)}),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[m&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>A(B,x)})}),y&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(B=>B.id!==x.id))})})]})]});return f?t.jsxRuntimeExports.jsx(Vt,{product:x,index:I,children:k},x.id):t.jsxRuntimeExports.jsx("div",{className:U.product,children:k},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(a||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:a}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:r}),f?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:V,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>h(x,I))})}):s.map((x,I)=>h(x,I)),P&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!(E&&E<=s.length||s.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(E&&E<=s.length||s.length===(p==null?void 0:p.length)),onClick:()=>{const x=[...s];let I=null;if(p){for(let k=0;k<p.length;k++)if(!s.find(B=>B.id===p[k].id)){I=p[k];break}}j==="select"&&p&&x.push({name:I?I.name:p[0].name,id:(I==null?void 0:I.id)||p[0].id,...l}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function Gt(u){const{product:n,children:o}=u,{attributes:s,listeners:e,setNodeRef:a,transform:r,transition:m,isDragging:f}=t.useSortable({id:n.id}),y={transform:t.CSS.Transform.toString(r),transition:m};return t.jsxRuntimeExports.jsx("div",{ref:a,style:y,className:`${t.styles.product} ${f?t.styles.dragging:""}`,...s,...e,children:o})}const Wt=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,other:a,title:r,subtitle:m,editable:f=!0,draggable:y=!1,deletable:P=!0,addable:j=!0,itemsType:p,itemsPlaceholder:l="",itemsOptions:E,hasRangeSelector:_=!1,rangeSelectorOptions:c,modalOptions:i,addableOptions:R={},limit:C}=u,[M,A]=g.useState(null),[V,h]=g.useState({top:0,left:0}),[x,I]=g.useState(null),k=g.useRef(null),[B,b]=g.useState(!1),$=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const d=()=>{A(null),b(!1)};return document.body.addEventListener("click",d),A(null),b(!1),()=>{A(null),b(!1),document.body.removeEventListener("click",d)}},[]),g.useEffect(()=>{if(M){const d=[...s].map(T=>T.id===M.id?M:T);e(d)}},[M]),g.useEffect(()=>{if(k.current&&x){const d=k.current.getBoundingClientRect().height,T=window.innerHeight;let S=x.top;S+d>T+window.scrollY-200&&(S=T+window.scrollY-d-200),S<0&&(S=10),h({top:S,left:x.left})}},[k.current,x]);const v=(d,T)=>{d.stopPropagation();const S=d.target.getBoundingClientRect();I({top:S.top+window.scrollY,left:S.left-30}),A(T),b(!0)},O=d=>{const{active:T,over:S}=d;if(S&&T.id!==S.id){const q=s.findIndex(D=>D.id===T.id),W=s.findIndex(D=>D.id===S.id);if(q!==-1&&W!==-1){const D=[...s],[Y]=D.splice(q,1);D.splice(W,0,Y),e(D)}}},z=d=>{var S;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),p==="select"&&E&&t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const D=[...s].map(Y=>Y.id===d.id?{...d,name:{"en-US":q}}:Y);A({...d,name:{"en-US":q}}),e([...D])},value:d.name["en-US"],options:E.filter(q=>!s.find(W=>W.name["en-US"]===q))}),p==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:q=>{const D=[...s].map(Y=>Y.id===d.id?{...d,name:{"en-US":q}}:Y);e([...D])},value:d.name["en-US"],placeholder:l}),p==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:q=>{const D=[...s].map(Y=>Y.id===d.id?{...d,images:q}:Y);e([...D])},activeImage:(S=s.find(q=>q.id===d.id))==null?void 0:S.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:q=>v(q,d)})}),P&&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!==d.id))})})]})]});return y?t.jsxRuntimeExports.jsx(Gt,{product:d,children:T},d.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:T},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(r||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:r}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:d=>o==null?void 0:o(d)})]}),M&&f&&i&&B&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:k,activeItem:M,setActiveItem:A,popupPosition:V,modalOptions:i,setIsOpenModal:b}),_&&c&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...c}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:m}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:$,onDragEnd:O,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(d=>d.id),strategy:t.verticalListSortingStrategy,children:s.map(d=>z(d))})}):s.map(d=>z(d)),j&&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]:!!(C&&C<=s.length)}),size:"s",disabled:!!(C&&C<=s.length),onClick:()=>{const d=[...s];let T=null;if(E){for(let S=0;S<E.length;S++)if(!s.find(q=>q.name["en-US"]===E[S])){T=E[S];break}}p==="select"&&E?d.push({name:{"en-US":T||E[0]},id:t.v4(),...R,maxSymbols:100}):p==="input"?d.push({name:{"en-US":""},id:t.v4(),...R,maxSymbols:100}):d.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...R,maxSymbols:100}),e(d)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:a})]})},Xt="_subtitle_jql1y_1",Qt="_products_jql1y_10",Jt="_product_jql1y_10",Kt="_button_jql1y_11",Zt="_buttons_jql1y_11",te="_addButton_jql1y_150",ee="_deleteButton_jql1y_165",X={subtitle:Xt,products:Qt,product:Jt,button:Kt,buttons:Zt,addButton:te,deleteButton:ee},et=u=>{const{buttons:n,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:a=!0}=u,{pages:r}=t.usePagesStore(),[m,f]=g.useState(null),[y,P]=g.useState({top:0,left:0}),[j,p]=g.useState(null),l=g.useRef(null);g.useEffect(()=>{if(m){const c=[...n].map(i=>i.id===m.id?m:i);o(c)}},[m]),g.useEffect(()=>{if(l.current&&j){const c=l.current.getBoundingClientRect().height,i=window.innerHeight;let R=j.top;R+c>i+window.scrollY-200&&(R=i+window.scrollY-c-200),R<0&&(R=10),P({top:R,left:j.left})}},[l.current,j]);const E=(c,i)=>{c.stopPropagation();const R=c.target.getBoundingClientRect();p({top:R.top+window.scrollY-70,left:R.left-(e?30:65)}),f(i)},_=(c,i)=>{const R=[...n],C={...c,id:Math.random().toString(36).substr(2,9)};R.splice(i+1,0,C),o(R)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),n.map((c,i)=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const M=[...n].map(A=>A.id===c.id?{...c,type:R}:A);o(M)},value:c.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:()=>{_(c,i)}})}),t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>{E(R,c)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const R=n.filter(C=>C.id!==c.id);o(R)},width:20,height:20,fill:"#C12A2A"})})]})]},c.id)),m&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:l,activeButton:m,setActiveButton:f,popupPosition:y,editableLink:a}),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 c=[...n];a?c.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:r?Object.values(r)[0].path:"/",openInNewTab:!1}):c.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:r?Object.values(r)[0].path:"/",openInNewTab:!1}),o(c)},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})]})})})]})},se=u=>{const{isActiveButtons:n,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:a=!0,addable:r=!0,deletable:m=!0}=u;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:f=>o(f)})]}),n&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:a,addable:r,deletable:m})]})})};function ne(u){const{product:n,children:o}=u,{attributes:s,listeners:e,setNodeRef:a,transform:r,transition:m,isDragging:f}=t.useSortable({id:String(n.listingId)}),y={transform:t.CSS.Transform.toString(r),transition:m};return t.jsxRuntimeExports.jsx("div",{ref:a,style:y,className:`${t.styles$2.product} ${f?t.styles$2.dragging:""}`,...s,...e,children:o})}const ie=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,other:a,title:r,subtitle:m,editable:f=!0,draggable:y=!1,withImage:P=!1,deletable:j=!0,addable:p=!0,itemsType:l,itemsOptions:E,limit:_,aspectRatio:c,setAspectRatio:i}=u,[R,C]=g.useState(null),[M,A]=g.useState({top:0,left:0}),[V,h]=g.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const v=()=>{C(null),h(!1)};return document.body.addEventListener("click",v),C(null),h(!1),()=>{C(null),h(!1),document.body.removeEventListener("click",v)}},[]),g.useEffect(()=>{if(R){const v=[...s].map(O=>O.listingId===R.listingId?R:O);e(v)}},[R]);const I=(v,O)=>{v.stopPropagation();const z=v.target.getBoundingClientRect(),d=100,T=window.innerHeight;let S=z.top+window.scrollY;S+d>T&&(S=T-d-20),h(!0),A({top:S-80,left:z.left-30}),C(O)};function k(v){if(P)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const B=v=>{const{active:O,over:z}=v;if(z&&O.id!==z.id){const d=s.findIndex(S=>String(S.listingId)===O.id),T=s.findIndex(S=>String(S.listingId)===z.id);if(d!==-1&&T!==-1){const S=[...s],[q]=S.splice(d,1);S.splice(T,0,q),e(S)}}},b=v=>{const O=E.find(d=>v.listingId===d.id);if(!O)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),l==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:d=>{const T=[...s],S=E.find(D=>D.productData.name===d);if(!S)return;const q={listingId:S.id,image:S.productData.images.length>0?S.productData.images[0].cfId:""},W=T.map(D=>D.listingId===v.listingId?q:D);C(q),e([...W])},value:O.productData.name,options:[...E.filter(d=>!s.find(T=>T.listingId===d.id)).map(d=>d.productData.name)],leftAddonOptions:E.map(d=>{var T;return{value:d.productData.name,addon:k(((T=d.productData.images[0])==null?void 0:T.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:d=>I(d,v)})}),j&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(d=>d!==v))})})]})]});return y?t.jsxRuntimeExports.jsx(ne,{product:v,children:z},v.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},v.listingId)},$=g.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(r||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:r}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:v=>o==null?void 0:o(v)})]}),V&&R&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:$,activeItem:R,setActiveItem:C,setIsOpenModal:h,popupPosition:M,itemsOptions:E}),n&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:m}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:B,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>String(v.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(v=>b(v))})}):s.map(v=>b(v)),p&&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 v=[...s];for(let O=0;O<E.length;O++)if(!s.find(z=>z.listingId===E[O].id)){v.push({listingId:E[O].id,image:E[O].productData.images.length>0?E[O].productData.images[0].cfId:""});break}e(v)},disabled:s.length===(_||E.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),c&&i&&t.jsxRuntimeExports.jsx(t.Select,{value:c,options:Object.keys(t.aspectRatio),onChange:v=>i(v),leftAddonOptions:t.aspectRatioOptions}),n&&a!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:a})]})},oe="_options_s4lx3_1",re="_price_s4lx3_18",ae="_oldPrice_s4lx3_25",ce="_newPrice_s4lx3_34",le="_animate_s4lx3_42",de="_meta_s4lx3_60",ue="_info_s4lx3_66",xe="_infoRight_s4lx3_75",pe="_buttons_s4lx3_82",me="_variants_s4lx3_89",je="_variant_s4lx3_89",he="_stock_s4lx3_107",ge="_variantInfo_s4lx3_115",fe="_quantity_s4lx3_122",ye="_button_s4lx3_82",Ee="_activeVariant_s4lx3_168",_e="_chargeTypes_s4lx3_172",Re="_charge_s4lx3_172",ve="_chargeActive_s4lx3_197",be="_title_s4lx3_205",w={options:oe,price:re,oldPrice:ae,newPrice:ce,animate:le,meta:de,info:ue,infoRight:xe,buttons:pe,variants:me,variant:je,stock:he,variantInfo:ge,quantity:fe,button:ye,activeVariant:Ee,chargeTypes:_e,charge:Re,chargeActive:ve,title:be};var Z=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(Z||{});const st=u=>{var A,V;const{product:n,setIsOpen:o}=u,{variants:s}=n,[e,a]=g.useState(s[0]),[r,m]=g.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),{notifications:f,setNotifications:y}=t.useNotificationStore(),P=t.useNavigate(),[j,p]=g.useState(1),{cart:l,reset:E,addProductToCart:_}=t.useCart(),[c,i]=g.useState(!1);g.useEffect(()=>{i(!0);const h=setTimeout(()=>i(!1),600);return()=>clearTimeout(h)},[j]);async function R(){try{_({productId:n.id,productVariantId:e.id,chargeType:r,quantity:j}),y([...f,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(h){y([...f,{id:t.v4(),message:`Product failed to add to cart: ${h}`,status:"error"}])}o==null||o(!1)}function C(){E(),R(),P("/checkout")}function M(h){if(h>=864e5){const b=Math.floor(h/864e5);return`${b} ${b===1?"day":"days"}`}else if(h>=36e5){const b=Math.floor(h/36e5);return`${b} ${b===1?"hour":"hours"}`}else if(h>=6e4){const b=Math.floor(h/6e4);return`${b} ${b===1?"minute":"minutes"}`}else{const b=Math.floor(h/1e3);return`${b} ${b===1?"second":"seconds"}`}}return g.useEffect(()=>{e.quantity&&e.quantity.available===0?p(0):p(1)},[e.quantity.available]),g.useEffect(()=>{e.chargeTypes&&m(e.chargeTypes.includes(r)?r:e.chargeTypes[0])},[e.chargeTypes]),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(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:r===h}),onClick:()=>m(h),children:Z[h]},h))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:s.filter(h=>{var x;return(x=h.chargeTypes)==null?void 0:x.includes(r)}).map(h=>{var x,I;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===h.id}),onClick:()=>{a(h),p(1)},children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,id:"h4",children:t.splitTextIntoSpans(h.name)}),t.jsxRuntimeExports.jsxs("span",{id:"md",children:[t.formatPrice({amount:r==="ONE_TIME"?h.price.amount:h.subscriptionSettings?h.subscriptionSettings.price.amount:0,currency:r==="ONE_TIME"?h.price.currency:h.subscriptionSettings?h.subscriptionSettings.price.currency:"USD"})," ",r==="RECURRING"&&h.subscriptionSettings&&` / ${t.normalizeInterval(h.subscriptionSettings.recurringIntervalDays||0)}`]})]}),t.jsxRuntimeExports.jsx("div",{id:"md",children:r==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,id:"md",children:[(x=h.quantity.restrictions)!=null&&x.max||h.quantity.available!==void 0?((I=h.quantity.restrictions)==null?void 0:I.max)||h.quantity.available:"∞"," ","in stock"]})})]},h.id)})}),r==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,id:"md",children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{j>1?p(h=>h-1):p(1)},className:w.button,disabled:e.quantity.available&&e.quantity.restrictions&&j<=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(j),onChange:h=>{e.quantity.available&&Number(h)>e.quantity.available?p(e.quantity.available):p(Number(h))},max:((A=e.quantity.restrictions)==null?void 0:A.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((V=e.quantity.restrictions)==null?void 0:V.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&j>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{p(h=>h+1)},className:w.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&j>=e.quantity.restrictions.max||e.quantity.available===0||e.quantity.available&&j>=e.quantity.available),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",{id:"md",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",{id:"md",children:!e.deliveryTime||e.deliveryTime===0?"Instant":M(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{id:"md",children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:r==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,id:"md",children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:c}),children:t.formatPrice({amount:e.price.amount*j,currency:e.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:w.oldPrice,id:"md",children:t.formatPrice({amount:e.compareAtPrice.amount*j,currency:e.compareAtPrice.currency})})]}):t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:c}),id:"md",children:t.formatPrice({amount:e.price.amount*j,currency:e.price.currency})}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,id:"md",children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:c}),id:"md",children:t.formatPrice({amount:e.subscriptionSettings.price.amount*j,currency:e.subscriptionSettings.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:w.oldPrice,id:"md",children:t.formatPrice({amount:e.subscriptionSettings.compareAtPrice.amount*j,currency:e.subscriptionSettings.compareAtPrice.currency})})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:c}),id:"md",children:t.formatPrice({amount:e.subscriptionSettings.price.amount*j,currency:e.subscriptionSettings.price.currency})})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>C(),disabled:e.quantity&&e.quantity.available===0,children:r==="ONE_TIME"?"Buy Now":"Subscribe Now"}),r==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>R(),disabled:e.quantity&&e.quantity.available===0,children:l.parts.some(h=>h.productId===n.id&&h.productVariantId===e.id)?"Add More":"Add to Cart"})]})]})},Ie="_buttons_1uy6y_23",Se="_modal_1uy6y_32",Ne="_closing_1uy6y_65",Ce="_info_1uy6y_114",Pe="_top_1uy6y_121",ke="_title_1uy6y_132",we="_clear_1uy6y_139",Te="_activeClear_1uy6y_146",Be="_count_1uy6y_150",Me="_cart_1uy6y_165",$e="_empty_1uy6y_173",Oe="_product_1uy6y_199",qe="_products_1uy6y_208",Ae="_image_1uy6y_216",De="_productInfo_1uy6y_233",Le="_content_1uy6y_240",ze="_name_1uy6y_246",Ue="_price_1uy6y_252",Fe="_productButtons_1uy6y_258",He="_productButton_1uy6y_258",Ve="_productCount_1uy6y_275",Ye="_bottom_1uy6y_292",Ge="_subtotal_1uy6y_300",We="_block_1uy6y_308",Xe="_shoppingCount_1uy6y_315",Qe="_total_1uy6y_335",Je="_link_1uy6y_341",Ke="_userInfo_1uy6y_348",Ze="_pagesMobileModal_1uy6y_360",ts="_pagesMobileModalContent_1uy6y_374",es="_pagesMobileModalHeader_1uy6y_380",ss="_pagesMobileModalFooter_1uy6y_390",ns="_pageLink_1uy6y_397",is="_rightButtons_1uy6y_406",N={buttons:Ie,modal:Se,closing:Ne,info:Ce,top:Pe,title:ke,clear:we,activeClear:Te,count:Be,cart:Me,empty:$e,product:Oe,products:qe,image:Ae,productInfo:De,content:Le,name:ze,price:Ue,productButtons:Fe,productButton:He,productCount:Ve,bottom:Ye,subtotal:Ge,block:We,shoppingCount:Xe,total:Qe,link:Je,userInfo:Ke,pagesMobileModal:Ze,pagesMobileModalContent:ts,pagesMobileModalHeader:es,pagesMobileModalFooter:ss,pageLink:ns,rightButtons:is,delete:"_delete_1uy6y_413"},os=u=>{const{shopping:n,signUp:o,isShowUserInfo:s=!0}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:(n||s)&&t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[n&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})})},nt=()=>{const[u,n]=g.useState(!1),[o,s]=g.useState([]),[e,a]=g.useState(!1),{cart:r,products:m}=t.useCart();g.useEffect(()=>{(async()=>{const p=r.parts.map(_=>String(_.productId)),l=m.filter(_=>p.includes(String(_.id)))||[];console.log("Products",l);const E=r.parts.map(_=>{const c=l.find(i=>i.id===_.productId);return console.log(c),c?{...c,activeVariantId:_.productVariantId,quantity:_.quantity,chargeType:_.chargeType}:null}).filter(Boolean);console.log("Products with active variants",E),s(E)})()},[r.parts,m]);function f(j){return!j||!(j!=null&&j.variants)?!1:j.chargeType==="RECURRING"}const y=r.parts.length>0&&o.length>0&&!f(o[0]);function P(){a(!1),setTimeout(()=>{n(!1)},300)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:j=>{j.stopPropagation(),window.location.pathname.includes("/admin/builder")||(n(!0),a(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"}),y&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:r.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:P,withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:y,isOpen:e,close:P})})]})},it=u=>{var _,c;const{activeProducts:n,isCartNotEmpty:o,isOpen:s,close:e}=u,{cart:a,reset:r,getTotalAndDiscount:m,updateQuantityOfProduct:f,removeProduct:y}=t.useCart(),P=t.useNavigate();function j(i,R){P(i,{replace:R})}function p(i){i.quantity&&f({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity+1,chargeType:i.chargeType})}function l(i){i.quantity&&f({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity-1,chargeType:i.chargeType})}function E(i){y({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity||1,chargeType:i.chargeType})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:i=>i.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,id:"h4",children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,id:"md",children:a.parts.length})]}),t.jsxRuntimeExports.jsxs("div",{className:N.rightButtons,children:[o&&t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:r,id:"md",children:"Clear all"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:e,hoverable:!0,width:24,height:24,fill:"var(--text-primary)"})]})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:n.map(i=>{var R,C;return t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[i.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.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(((R=i.variants.find(M=>M.id===i.activeVariantId))==null?void 0:R.name)||i.name)}),t.jsxRuntimeExports.jsx("div",{className:N.price,children:t.formatPrice({amount:i.variants.find(M=>M.id===i.activeVariantId).price.amount*((i==null?void 0:i.quantity)||1),currency:i.variants.find(M=>M.id===i.activeVariantId).price.currency})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{i.quantity!==1&&l(i)},className:N.productButton,disabled:i.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("input",{className:N.productCount,type:"number",value:((C=i.quantity)==null?void 0:C.toString())||"",onChange:M=>{const A=Math.min(Number(M.target.value),i.variants.find(V=>V.id===i.activeVariantId).quantity.available||1/0);A<1||f({productId:i.id,productVariantId:i.activeVariantId,quantity:A,chargeType:i.chargeType})},min:1,max:i.variants.find(M=>M.id===i.activeVariantId).quantity.available||1/0}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>p(i),className:N.productButton,disabled:i.quantity===i.variants.find(M=>M.id===i.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.delete,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",fill:"var(--text-action)",width:20,height:20,onClick:()=>E(i),hoverable:!0})})]})]},i.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.jsx("div",{className:N.total,children:t.formatPrice({amount:m().total,currency:a.parts.length>0&&((c=(_=n.find(i=>i.id===a.parts[0].productId))==null?void 0:_.variants.find(i=>i.id===a.parts[0].productVariantId))==null?void 0:c.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>j("/checkout",!1),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",{id:"h5",children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{id:"md",children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,id:"md",children:"view products"})]})]}),tt=({signUp:u,close:n})=>{const{token:o}=t.useStorefrontStore(),s=t.useNavigate(),[e,a]=g.useState("test-email@gmail.com");g.useEffect(()=>{o&&(async()=>{if(!o)return;const f=t.jwtDecode(o);a(f.email)})()},[o]);function r(m){window.location.pathname.includes("/admin/builder")||s(m)}return o?t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:N.userInfo,onClick:()=>{r("/customer-dash"),n==null||n()},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:()=>{r("/customer-dash"),n==null||n()},type:"Secondary",style:{padding:10},children:"Login"}),u&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{r("/customer-dash"),n==null||n()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]})},rt=({logo:u,setIsOpen:n,signUp:o,pages:s})=>{const{setIsOpen:e}=t.useModalStore(),a=()=>{e(!1),setTimeout(()=>{n(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:r=>r.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:u}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:a,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:s.length>0&&s.map(r=>t.jsxRuntimeExports.jsx("div",{className:N.pageLink,onClick:a,children:t.jsxRuntimeExports.jsx(t.Link,{path:r.path,children:r.name["en-US"]},r.id)}))}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:o,close:a})})]})},rs=({logo:u,signUp:n,pages:o})=>{const[s,e]=g.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),hasPadding:!1,children:t.jsxRuntimeExports.jsx(rt,{logo:u,setIsOpen:e,signUp:n,pages:o})})]})},at=u=>{const{setIsOpenModal:n}=u;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||n(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List"})})},as="_share_onabp_1",cs="_modal_onabp_8",ls="_header_onabp_20",ds="_title_onabp_46",us="_copyWrapper_onabp_53",xs="_copyText_onabp_62",ps="_copyTextMobile_onabp_75",ms="_copyTextMiniMobile_onabp_94",Q={share:as,modal:cs,header:ls,title:ds,copyWrapper:us,copyText:xs,copyTextMobile:ps,copyTextMiniMobile:ms},js=({title:u="Copy Product Link"})=>{const{isOpenModal:n,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})}),n&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(hs,{title:u})})]})},hs=({title:u="Copy Product Link"})=>{const{setIsOpenModal:n}=t.useShareLinkStore(),{notifications:o,setNotifications:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),a=window.location.href;function r(){navigator.clipboard.writeText(a),s([...o,{id:t.v4(),message:"Link copied to clipboard",status:"success"}])}function m(){e(!1),setTimeout(()=>{n(!1),e(!0)},300)}function f(y,P){return y.length>P?y.slice(0,P)+"...":y}return t.jsxRuntimeExports.jsxs("div",{className:Q.modal,onClick:y=>y.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,children:[t.jsxRuntimeExports.jsx("div",{className:Q.title,id:"h4",children:u}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:m,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:Q.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:r,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:Q.copyText,id:"md",children:f(a,100)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMobile,id:"md",children:f(a,40)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMiniMobile,id:"md",children:f(a,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:r,children:o.find(y=>y.message==="Link copied to clipboard")?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},gs="_accordion_153d4_1",fs="_header_153d4_12",ys="_icon_153d4_21",Es="_open_153d4_24",_s="_content_153d4_28",Rs="_contentOpen_153d4_36",vs="_contentText_153d4_40",J={accordion:gs,header:fs,icon:ys,open:Es,content:_s,contentOpen:Rs,contentText:vs},bs=({title:u,content:n,defaultOpen:o=!1})=>{const[s,e]=g.useState(o),[a,r]=g.useState(0),m=g.useRef(null),f=()=>{e(!s)};return g.useEffect(()=>{m.current&&r(s?m.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:f,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.content,{[J.contentOpen]:s}),children:t.jsxRuntimeExports.jsx("p",{id:"md",className:J.contentText,ref:m,style:{height:`${a}px`,marginTop:`${a>0?"20px":"0px"}`},children:n})})]})},Is="_buttonsBlock_1b2rb_1",Ss={buttonsBlock:Is},Ns=u=>{var y,P;const{setIsOpen:n,setModalType:o,productId:s}=u,{cart:e}=t.useCart(),{pageContext:a}=t.usePagesStore(),r=(y=a==null?void 0:a.listings)==null?void 0:y.find(j=>j.id===s);if(!r)return null;const m=(P=a==null?void 0:a.products)==null?void 0:P.find(j=>j.uniquePath===r.productData.uniquePath);if(!m)return null;const f=e.parts.find(j=>j.productId===m.id);return t.jsxRuntimeExports.jsxs("div",{className:Ss.buttonsBlock,onClick:j=>j.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),n(!0)},children:f?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),n(!0)},children:"Buy"})]})},Cs="_wrapper_27wzz_1",Ps="_logo_27wzz_8",ks="_info_27wzz_12",K={wrapper:Cs,logo:Ps,info:ks},ws=({date:u})=>{const{general:n}=t.useGeneralStore();if(!n)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),a={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",a)}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:K.logo,children:n.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.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:K.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:n.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(u)})]})]})},Ts="_variants_1f6zq_82",Bs="_variant_1f6zq_82",Ms="_stock_1f6zq_100",$s="_variantInfo_1f6zq_108",Os="_title_1f6zq_202",qs="_modal_1f6zq_208",As="_header_1f6zq_228",Ds="_productOptions_1f6zq_236",Ls="_loading_1f6zq_240",G={variants:Ts,variant:Bs,stock:Ms,variantInfo:$s,title:Os,modal:qs,header:As,productOptions:Ds,loading:Ls},zs=u=>{var p;const{pageContext:n}=t.usePagesStore(),o=(p=n==null?void 0:n.listings)==null?void 0:p.find(l=>l.id===u.productId),[s,e]=g.useState(!0),[a,r]=g.useState(null),m=(a==null?void 0:a.variants[0])||null,[f,y]=g.useState("ONE_TIME"),{addProducts:P}=t.useCart(),{setIsOpen:j}=t.useModalStore();return g.useEffect(()=>{(async()=>{e(!0);const E=await t.getDynamicPage(encodeURIComponent(`/product/${o.productData.uniquePath}`));P(E==null?void 0:E.data.products),r(E==null?void 0:E.data.products[0]),e(!1)})()},[]),g.useEffect(()=>{j(!0)},[]),t.jsxRuntimeExports.jsx(t.Modal,{close:u.setIsOpen,children:t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:l=>l.stopPropagation(),children:[s&&t.jsxRuntimeExports.jsx("div",{className:G.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})}),u.type==="Add To Cart"&&a&&m&&!s&&t.jsxRuntimeExports.jsx(Us,{variants:a.variants,activeVariant:m,activeChargeType:f,setActiveChargeType:y,productId:a.id,setIsOpen:u.setIsOpen}),u.type==="Buy Now"&&a&&!s&&t.jsxRuntimeExports.jsx(Fs,{product:a,setIsOpen:u.setIsOpen})]})})},Us=u=>{const{variants:n,activeChargeType:o,productId:s,setIsOpen:e}=u,{cart:a,addProductToCart:r,addProducts:m,updateQuantityOfProduct:f}=t.useCart(),{notifications:y,setNotifications:P}=t.useNotificationStore(),{pageContext:j}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),l=()=>{p(!1),setTimeout(()=>{e(!1)},300)};async function E(_){const c=n.find(C=>C.id===_),i=a.parts.find(C=>C.productId===u.productId&&C.productVariantId===_);if((c==null?void 0:c.quantity.available)&&(c==null?void 0:c.quantity.restrictions)&&((i==null?void 0:i.quantity)||0)+1>(c==null?void 0:c.quantity.restrictions.max)||(c==null?void 0:c.quantity.available)===0||(c==null?void 0:c.quantity.available)&&((i==null?void 0:i.quantity)||0)+1>(c==null?void 0:c.quantity.available)){P([...y,{id:t.v4(),message:"Product is out of stock",status:"error"}]);return}if(i)f({productId:s,productVariantId:_,quantity:i.quantity+1,chargeType:o});else{j!=null&&j.products&&m(j.products);try{r({productId:s,productVariantId:_,quantity:1,chargeType:o}),P([...y,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(C){P([...y,{id:t.v4(),message:`Product failed to add to cart: ${C}`,status:"error"}])}}}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.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:l})]}),t.jsxRuntimeExports.jsx("div",{className:G.variants,children:n.filter(_=>{var c;return(c=_.chargeTypes)==null?void 0:c.includes(o)}).map(_=>{var c,i,R;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(G.variant),onClick:()=>{E(_.id),e(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:G.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:G.title,id:"h4",children:_.name}),t.jsxRuntimeExports.jsx("span",{id:"md",children:t.formatPrice({amount:o==="ONE_TIME"?_.price.amount:_.subscriptionSettings?_.subscriptionSettings.price.amount:0,currency:o==="ONE_TIME"?_.price.currency:((c=_.subscriptionSettings)==null?void 0:c.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx("div",{id:"md",children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:G.stock,id:"md",children:[(i=_.quantity.restrictions)!=null&&i.max||_.quantity.available!==void 0?((R=_.quantity.restrictions)==null?void 0:R.max)||_.quantity.available:"∞"," ","in stock"]})})]},_.id)})})]})},Fs=u=>{const{product:n,setIsOpen:o}=u,{setIsOpen:s}=t.useModalStore(),e=()=>{s(!1),setTimeout(()=>{o(!1)},300)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(n.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:G.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:n,setIsOpen:o})})]})},Hs="_contentModal_1ptti_1",Vs="_modalTop_1ptti_13",Ys="_loading_1ptti_19",Gs="_modalCards_1ptti_27",Ws="_modalImage_1ptti_32",Xs="_card_1ptti_37",Qs="_cardInfo_1ptti_49",Js="_cardButtons_1ptti_56",Ks="_title_1ptti_62",Zs="_blockImage_1ptti_69",tn="_short_1ptti_78",en="_price_1ptti_82",sn="_oldPrice_1ptti_89",nn="_newPrice_1ptti_98",L={contentModal:Hs,modalTop:Vs,loading:Ys,modalCards:Gs,modalImage:Ws,card:Xs,cardInfo:Qs,cardButtons:Js,title:Ks,blockImage:Zs,short:tn,price:en,oldPrice:sn,newPrice:nn},on=u=>{const{setIsOpen:n,pageContext:o,groupData:s,setProductId:e,setIsProductModalOpen:a,setShowDropdown:r}=u,[m,f]=g.useState(null),[y,P]=g.useState(!0),{setIsOpen:j}=t.useModalStore();g.useEffect(()=>{var E;P(!0);const l=(E=o.listings)==null?void 0:E.filter(_=>s.listingIdList.includes(_.id));l&&f([...l]),P(!1)},[o]),g.useEffect(()=>{j(!0)},[]);const p=()=>{j(!1),setTimeout(()=>{n(!1)},300)};return t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsxs("div",{className:L.contentModal,onClick:l=>l.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:L.modalTop,children:[t.jsxRuntimeExports.jsx("span",{className:L.title,id:"h4",children:t.splitTextIntoSpans(s.name)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:p,fill:"var(--text-primary)"})]}),!y&&m&&t.jsxRuntimeExports.jsx("div",{className:L.modalCards,children:m.map(l=>t.jsxRuntimeExports.jsxs("div",{className:L.card,children:[t.jsxRuntimeExports.jsx("div",{children:l.productData.images[0]?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.productData.images[0].cfId}/w=500`,alt:"",width:64,height:64,className:L.modalImage}):t.jsxRuntimeExports.jsx("div",{className:t.clx(L.blockImage,L.modalImage),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})})}),t.jsxRuntimeExports.jsxs("div",{className:L.cardInfo,children:[t.jsxRuntimeExports.jsx("div",{className:L.name,id:"h5",children:l.productData.compareAtPrice&&(l.productData.compareAtPrice.amount||0)-(l.productData.minPrice.amount||0)>0?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.splitTextIntoSpans(l.productData.name),t.jsxRuntimeExports.jsxs("span",{className:L.price,id:"md",children:[t.jsxRuntimeExports.jsx("span",{className:L.newPrice,id:"md",children:t.formatPrice({amount:l.productData.minPrice.amount,currency:l.productData.minPrice.currency})}),t.jsxRuntimeExports.jsx("span",{className:L.oldPrice,id:"md",children:t.formatPrice({amount:l.productData.compareAtPrice.amount,currency:l.productData.compareAtPrice.currency})})]})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.splitTextIntoSpans(l.productData.name),t.jsxRuntimeExports.jsx("span",{className:L.newPrice,id:"md",children:t.formatPrice({amount:l.productData.minPrice.amount,currency:l.productData.minPrice.currency})})]})}),l.productData.shortDescription&&t.jsxRuntimeExports.jsx("span",{className:L.short,id:"md",children:t.splitTextIntoSpans(l.productData.shortDescription)})]}),t.jsxRuntimeExports.jsxs("div",{className:L.cardButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{e(l.id),n(!1),a(!0)},children:"Buy"}),t.jsxRuntimeExports.jsx(t.Link,{path:`/product/${l.productData.uniquePath}`,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{whiteSpace:"nowrap"},onClick:()=>{r(!1),p()},children:"View Details"})})]})]},l.id))}),y&&t.jsxRuntimeExports.jsx("div",{className:L.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.Link=t.Link;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.SelectTypeText=t.SelectTypeText;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.Wrapper=t.Wrapper;exports.Accordion=bs;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=se;exports.CategorySettings=Bt;exports.ChargeTypes=Z;exports.EmptyCart=ot;exports.FormSettings=Wt;exports.GroupCardModal=on;exports.HeaderButtons=os;exports.LayoutSettings=Et;exports.ListingSelector=ie;exports.MetaInfoPost=ws;exports.PagesMobileMenu=rs;exports.PagesMobileModal=rt;exports.PagesSettings=Yt;exports.ProductCardButtons=Ns;exports.ProductCardModal=zs;exports.ProductOptions=st;exports.ShareLink=js;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.UserInfo=tt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CB4WRbjL.cjs"),g=require("react");require("react-dom");const ct="_block_kh9z8_8",lt="_title_kh9z8_16",dt="_subtitle_kh9z8_23",ut="_alignmentContent_kh9z8_30",xt="_alignments_kh9z8_39",pt="_alignment_kh9z8_30",mt="_circle_kh9z8_64",jt="_paddings_kh9z8_71",ht="_padding_kh9z8_71",gt="_active_kh9z8_97",F={block:ct,title:lt,subtitle:dt,alignmentContent:ut,alignments:xt,alignment:pt,circle:mt,paddings:jt,padding:ht,active:gt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],yt=["left","top","right","bottom"],Et=u=>{const{alignment:n,padding:o,setPadding:s,setAlignment:e,isAlignment:a=!0,isPadding:r=!0}=u;function m(l){switch(l){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 f(l){switch(l){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[y,P]=g.useState(null),[j,p]=g.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:F.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentContent,children:[a&&t.jsxRuntimeExports.jsxs("div",{className:F.block,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:F.alignments,children:ft.map(l=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(l)},className:F.alignment,onMouseEnter:()=>{P(l)},onMouseLeave:()=>{P(null)},children:[l!==n&&y!==l&&t.jsxRuntimeExports.jsx("div",{className:F.circle}),l!==n&&y===l&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(y),fill:"#c2c2c2",width:22,height:22}),l===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(n),fill:"#FF3F19",width:22,height:22})]},l))})]}),r&&t.jsxRuntimeExports.jsxs("div",{className:F.block,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:F.paddings,children:yt.map(l=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(F.padding,{[F.active]:j===l}),onFocus:()=>{p(l)},onBlur:()=>{p(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:f(l),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[l]),onChange:E=>s({...o,[l]:Math.min(Number(E),999)}),max:999,paddingless:!0,borderless:!0})]},l))})]})]})]})},_t="_title_82zux_1",Rt="_subtitle_82zux_5",vt="_productsBlock_82zux_14",bt="_top_82zux_26",It="_products_82zux_14",St="_product_82zux_14",Nt="_button_82zux_80",Ct="_disabled_82zux_91",Pt="_buttons_82zux_118",kt="_addButton_82zux_157",Tt="_deleteButton_82zux_179",H={title:_t,subtitle:Rt,productsBlock:vt,top:bt,products:It,product:St,button:Nt,disabled:Ct,buttons:Pt,addButton:kt,deleteButton:Tt};function wt({id:u,children:n}){const{attributes:o,listeners:s,setNodeRef:e,transform:a,transition:r,isDragging:m}=t.useSortable({id:u}),f={transform:t.CSS.Transform.toString(a),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${H.product} ${m?H.dragging:""}`,...o,...s,children:n})}const Bt=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,other:a,tags:r,title:m,subtitle:f,draggable:y=!1,withImage:P=!1,addable:j=!0,itemsOptions:p,hasRangeSelector:l=!1,rangeSelectorOptions:E,limit:_,autoScrollInterval:c,deletable:i,aspectRatio:R,setAspectRatio:C}=u,M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),A=x=>{const{active:I,over:k}=x;if(k&&I.id!==k.id){const B=s.findIndex($=>$===I.id),b=s.findIndex($=>$===k.id);if(B!==-1&&b!==-1){const $=[...s],[v]=$.splice(B,1);$.splice(b,0,v),e($)}}};function V(x){if(P)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 h=(x,I=!1)=>{const k=p.find(b=>b.id===x);if(!k)return;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const $=[...s],v=p.find(d=>d.name===b);if(!v)return;const O=v.id,z=$.map(d=>d===x?O:d);e([...z])},value:k.name,options:p.filter(b=>!s.find($=>$===b.id)).map(b=>b.name),leftAddonOptions:p.map(b=>({value:b.name,addon:V(b.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:H.buttons,children:t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(b=>b!==x))})})})]});return y?t.jsxRuntimeExports.jsx(wt,{id:x,children:B},t.v4()):t.jsxRuntimeExports.jsx("div",{className:H.product,children:B},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(m||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:m}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:x=>o==null?void 0:o(x)})]}),l&&E&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...E}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[f&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:f}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>h(x,i))})}):s.map(x=>h(x,i)),j&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(_&&_<=s.length||s.length===p.length)}),size:"s",disabled:!!(_&&_<=s.length||s.length===p.length),onClick:()=>{const x=[...s];let I=null;if(p){for(let k=0;k<p.length;k++)if(!s.find(B=>B===p[k].id)){I=p[k];break}}x.push((I==null?void 0:I.id)||p[0].id),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),R&&C&&t.jsxRuntimeExports.jsx(t.Select,{value:R,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>C(x),leftAddonOptions:t.aspectRatioOptions}),r!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:r}),a!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:a}),c!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(c.scrollInterval),onChange:x=>c.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Mt="_title_roi3a_1",$t="_subtitle_roi3a_5",Ot="_productsBlock_roi3a_14",qt="_top_roi3a_26",At="_products_roi3a_14",Dt="_product_roi3a_14",Lt="_button_roi3a_80",zt="_disabled_roi3a_91",Ut="_buttons_roi3a_118",Ft="_addButton_roi3a_164",Ht="_deleteButton_roi3a_179",U={title:Mt,subtitle:$t,productsBlock:Ot,top:qt,products:At,product:Dt,button:Lt,disabled:zt,buttons:Ut,addButton:Ft,deleteButton:Ht};function Vt({product:u,children:n}){const{attributes:o,listeners:s,setNodeRef:e,transform:a,transition:r,isDragging:m}=t.useSortable({id:u.id}),f={transform:t.CSS.Transform.toString(a),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${U.product} ${m?U.dragging:""}`,...o,...s,children:n})}const Yt=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,title:a,subtitle:r,editable:m=!0,draggable:f=!1,deletable:y=!0,addable:P=!0,itemsType:j,itemsOptions:p,addableOptions:l={},limit:E}=u,[_,c]=g.useState(null),[i,R]=g.useState(null),C=g.useRef(null),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{if(_){const x=[...s].map(I=>I.id===_.id?_:I);e(x)}},[_]),g.useEffect(()=>{C.current&&i&&(C.current.getBoundingClientRect().height,i.top)},[C.current,i]);const A=(x,I)=>{x.stopPropagation();const k=x.target.getBoundingClientRect();R({top:k.top+window.scrollY,left:k.left-30}),c(I)},V=x=>{const{active:I,over:k}=x;if(k&&I.id!==k.id){const B=s.findIndex($=>$.id===I.id),b=s.findIndex($=>$.id===k.id);if(B!==-1&&b!==-1){const $=[...s],[v]=$.splice(B,1);$.splice(b,0,v),e($)}}},h=(x,I)=>{const k=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[f&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),j==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const b=[...s],$=p.find(O=>O.name===B);if(!$)return;const v=b.map(O=>O.id===x.id?{...$,name:{"en-US":B}}:O);c({...x,name:{"en-US":B}}),e([...v])},value:x.name,options:p.filter(B=>!s.find(b=>b.name===B.name)).map(B=>B.name)}),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[m&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>A(B,x)})}),y&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(B=>B.id!==x.id))})})]})]});return f?t.jsxRuntimeExports.jsx(Vt,{product:x,index:I,children:k},x.id):t.jsxRuntimeExports.jsx("div",{className:U.product,children:k},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(a||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:a}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:r}),f?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:V,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>h(x,I))})}):s.map((x,I)=>h(x,I)),P&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!(E&&E<=s.length||s.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(E&&E<=s.length||s.length===(p==null?void 0:p.length)),onClick:()=>{const x=[...s];let I=null;if(p){for(let k=0;k<p.length;k++)if(!s.find(B=>B.id===p[k].id)){I=p[k];break}}j==="select"&&p&&x.push({name:I?I.name:p[0].name,id:(I==null?void 0:I.id)||p[0].id,...l}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function Gt(u){const{product:n,children:o}=u,{attributes:s,listeners:e,setNodeRef:a,transform:r,transition:m,isDragging:f}=t.useSortable({id:n.id}),y={transform:t.CSS.Transform.toString(r),transition:m};return t.jsxRuntimeExports.jsx("div",{ref:a,style:y,className:`${t.styles.product} ${f?t.styles.dragging:""}`,...s,...e,children:o})}const Wt=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,other:a,title:r,subtitle:m,editable:f=!0,draggable:y=!1,deletable:P=!0,addable:j=!0,itemsType:p,itemsPlaceholder:l="",itemsOptions:E,hasRangeSelector:_=!1,rangeSelectorOptions:c,modalOptions:i,addableOptions:R={},limit:C}=u,[M,A]=g.useState(null),[V,h]=g.useState({top:0,left:0}),[x,I]=g.useState(null),k=g.useRef(null),[B,b]=g.useState(!1),$=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const d=()=>{A(null),b(!1)};return document.body.addEventListener("click",d),A(null),b(!1),()=>{A(null),b(!1),document.body.removeEventListener("click",d)}},[]),g.useEffect(()=>{if(M){const d=[...s].map(w=>w.id===M.id?M:w);e(d)}},[M]),g.useEffect(()=>{if(k.current&&x){const d=k.current.getBoundingClientRect().height,w=window.innerHeight;let S=x.top;S+d>w+window.scrollY-200&&(S=w+window.scrollY-d-200),S<0&&(S=10),h({top:S,left:x.left})}},[k.current,x]);const v=(d,w)=>{d.stopPropagation();const S=d.target.getBoundingClientRect();I({top:S.top+window.scrollY,left:S.left-30}),A(w),b(!0)},O=d=>{const{active:w,over:S}=d;if(S&&w.id!==S.id){const q=s.findIndex(D=>D.id===w.id),W=s.findIndex(D=>D.id===S.id);if(q!==-1&&W!==-1){const D=[...s],[Y]=D.splice(q,1);D.splice(W,0,Y),e(D)}}},z=d=>{var S;const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),p==="select"&&E&&t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const D=[...s].map(Y=>Y.id===d.id?{...d,name:{"en-US":q}}:Y);A({...d,name:{"en-US":q}}),e([...D])},value:d.name["en-US"],options:E.filter(q=>!s.find(W=>W.name["en-US"]===q))}),p==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:q=>{const D=[...s].map(Y=>Y.id===d.id?{...d,name:{"en-US":q}}:Y);e([...D])},value:d.name["en-US"],placeholder:l}),p==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:q=>{const D=[...s].map(Y=>Y.id===d.id?{...d,images:q}:Y);e([...D])},activeImage:(S=s.find(q=>q.id===d.id))==null?void 0:S.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:q=>v(q,d)})}),P&&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!==d.id))})})]})]});return y?t.jsxRuntimeExports.jsx(Gt,{product:d,children:w},d.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:w},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(r||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:r}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:d=>o==null?void 0:o(d)})]}),M&&f&&i&&B&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:k,activeItem:M,setActiveItem:A,popupPosition:V,modalOptions:i,setIsOpenModal:b}),_&&c&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...c}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:m}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:$,onDragEnd:O,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(d=>d.id),strategy:t.verticalListSortingStrategy,children:s.map(d=>z(d))})}):s.map(d=>z(d)),j&&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]:!!(C&&C<=s.length)}),size:"s",disabled:!!(C&&C<=s.length),onClick:()=>{const d=[...s];let w=null;if(E){for(let S=0;S<E.length;S++)if(!s.find(q=>q.name["en-US"]===E[S])){w=E[S];break}}p==="select"&&E?d.push({name:{"en-US":w||E[0]},id:t.v4(),...R,maxSymbols:100}):p==="input"?d.push({name:{"en-US":""},id:t.v4(),...R,maxSymbols:100}):d.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...R,maxSymbols:100}),e(d)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:a})]})},Xt="_subtitle_jql1y_1",Qt="_products_jql1y_10",Jt="_product_jql1y_10",Kt="_button_jql1y_11",Zt="_buttons_jql1y_11",te="_addButton_jql1y_150",ee="_deleteButton_jql1y_165",X={subtitle:Xt,products:Qt,product:Jt,button:Kt,buttons:Zt,addButton:te,deleteButton:ee},et=u=>{const{buttons:n,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:a=!0}=u,{pages:r}=t.usePagesStore(),[m,f]=g.useState(null),[y,P]=g.useState({top:0,left:0}),[j,p]=g.useState(null),l=g.useRef(null);g.useEffect(()=>{if(m){const c=[...n].map(i=>i.id===m.id?m:i);o(c)}},[m]),g.useEffect(()=>{if(l.current&&j){const c=l.current.getBoundingClientRect().height,i=window.innerHeight;let R=j.top;R+c>i+window.scrollY-200&&(R=i+window.scrollY-c-200),R<0&&(R=10),P({top:R,left:j.left})}},[l.current,j]);const E=(c,i)=>{c.stopPropagation();const R=c.target.getBoundingClientRect();p({top:R.top+window.scrollY-70,left:R.left-(e?30:65)}),f(i)},_=(c,i)=>{const R=[...n],C={...c,id:Math.random().toString(36).substr(2,9)};R.splice(i+1,0,C),o(R)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),n.map((c,i)=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const M=[...n].map(A=>A.id===c.id?{...c,type:R}:A);o(M)},value:c.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:()=>{_(c,i)}})}),t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>{E(R,c)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const R=n.filter(C=>C.id!==c.id);o(R)},width:20,height:20,fill:"#C12A2A"})})]})]},c.id)),m&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:l,activeButton:m,setActiveButton:f,popupPosition:y,editableLink:a}),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 c=[...n];a?c.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:r?Object.values(r)[0].path:"/",openInNewTab:!1}):c.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:r?Object.values(r)[0].path:"/",openInNewTab:!1}),o(c)},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})]})})})]})},se=u=>{const{isActiveButtons:n,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:a=!0,addable:r=!0,deletable:m=!0}=u;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:f=>o(f)})]}),n&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:a,addable:r,deletable:m})]})})};function ne(u){const{product:n,children:o}=u,{attributes:s,listeners:e,setNodeRef:a,transform:r,transition:m,isDragging:f}=t.useSortable({id:String(n.listingId)}),y={transform:t.CSS.Transform.toString(r),transition:m};return t.jsxRuntimeExports.jsx("div",{ref:a,style:y,className:`${t.styles$2.product} ${f?t.styles$2.dragging:""}`,...s,...e,children:o})}const ie=u=>{const{isActiveItems:n,setIsActiveItems:o,items:s,setItems:e,other:a,title:r,subtitle:m,editable:f=!0,draggable:y=!1,withImage:P=!1,deletable:j=!0,addable:p=!0,itemsType:l,itemsOptions:E,limit:_,aspectRatio:c,setAspectRatio:i}=u,[R,C]=g.useState(null),[M,A]=g.useState({top:0,left:0}),[V,h]=g.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const v=()=>{C(null),h(!1)};return document.body.addEventListener("click",v),C(null),h(!1),()=>{C(null),h(!1),document.body.removeEventListener("click",v)}},[]),g.useEffect(()=>{if(R){const v=[...s].map(O=>O.listingId===R.listingId?R:O);e(v)}},[R]);const I=(v,O)=>{v.stopPropagation();const z=v.target.getBoundingClientRect(),d=100,w=window.innerHeight;let S=z.top+window.scrollY;S+d>w&&(S=w-d-20),h(!0),A({top:S-80,left:z.left-30}),C(O)};function k(v){if(P)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const B=v=>{const{active:O,over:z}=v;if(z&&O.id!==z.id){const d=s.findIndex(S=>String(S.listingId)===O.id),w=s.findIndex(S=>String(S.listingId)===z.id);if(d!==-1&&w!==-1){const S=[...s],[q]=S.splice(d,1);S.splice(w,0,q),e(S)}}},b=v=>{const O=E.find(d=>v.listingId===d.id);if(!O)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),l==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:d=>{const w=[...s],S=E.find(D=>D.productData.name===d);if(!S)return;const q={listingId:S.id,image:S.productData.images.length>0?S.productData.images[0].cfId:""},W=w.map(D=>D.listingId===v.listingId?q:D);C(q),e([...W])},value:O.productData.name,options:[...E.filter(d=>!s.find(w=>w.listingId===d.id)).map(d=>d.productData.name)],leftAddonOptions:E.map(d=>{var w;return{value:d.productData.name,addon:k(((w=d.productData.images[0])==null?void 0:w.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:d=>I(d,v)})}),j&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(d=>d!==v))})})]})]});return y?t.jsxRuntimeExports.jsx(ne,{product:v,children:z},v.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},v.listingId)},$=g.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(r||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:r}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:v=>o==null?void 0:o(v)})]}),V&&R&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:$,activeItem:R,setActiveItem:C,setIsOpenModal:h,popupPosition:M,itemsOptions:E}),n&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[m&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:m}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:B,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>String(v.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(v=>b(v))})}):s.map(v=>b(v)),p&&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 v=[...s];for(let O=0;O<E.length;O++)if(!s.find(z=>z.listingId===E[O].id)){v.push({listingId:E[O].id,image:E[O].productData.images.length>0?E[O].productData.images[0].cfId:""});break}e(v)},disabled:s.length===(_||E.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),c&&i&&t.jsxRuntimeExports.jsx(t.Select,{value:c,options:Object.keys(t.aspectRatio),onChange:v=>i(v),leftAddonOptions:t.aspectRatioOptions}),n&&a!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:a})]})},oe="_options_s4lx3_1",re="_price_s4lx3_18",ae="_oldPrice_s4lx3_25",ce="_newPrice_s4lx3_34",le="_animate_s4lx3_42",de="_meta_s4lx3_60",ue="_info_s4lx3_66",xe="_infoRight_s4lx3_75",pe="_buttons_s4lx3_82",me="_variants_s4lx3_89",je="_variant_s4lx3_89",he="_stock_s4lx3_107",ge="_variantInfo_s4lx3_115",fe="_quantity_s4lx3_122",ye="_button_s4lx3_82",Ee="_activeVariant_s4lx3_168",_e="_chargeTypes_s4lx3_172",Re="_charge_s4lx3_172",ve="_chargeActive_s4lx3_197",be="_title_s4lx3_205",T={options:oe,price:re,oldPrice:ae,newPrice:ce,animate:le,meta:de,info:ue,infoRight:xe,buttons:pe,variants:me,variant:je,stock:he,variantInfo:ge,quantity:fe,button:ye,activeVariant:Ee,chargeTypes:_e,charge:Re,chargeActive:ve,title:be};var Z=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(Z||{});const st=u=>{var A,V;const{product:n,setIsOpen:o}=u,{variants:s}=n,[e,a]=g.useState(s[0]),[r,m]=g.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),{notifications:f,setNotifications:y}=t.useNotificationStore(),P=t.useNavigate(),[j,p]=g.useState(1),{cart:l,reset:E,addProductToCart:_}=t.useCart(),[c,i]=g.useState(!1);g.useEffect(()=>{i(!0);const h=setTimeout(()=>i(!1),600);return()=>clearTimeout(h)},[j]);async function R(){try{_({productId:n.id,productVariantId:e.id,chargeType:r,quantity:j}),y([...f,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(h){y([...f,{id:t.v4(),message:`Product failed to add to cart: ${h}`,status:"error"}])}o==null||o(!1)}function C(){E(),R(),P("/checkout")}function M(h){if(h>=864e5){const b=Math.floor(h/864e5);return`${b} ${b===1?"day":"days"}`}else if(h>=36e5){const b=Math.floor(h/36e5);return`${b} ${b===1?"hour":"hours"}`}else if(h>=6e4){const b=Math.floor(h/6e4);return`${b} ${b===1?"minute":"minutes"}`}else{const b=Math.floor(h/1e3);return`${b} ${b===1?"second":"seconds"}`}}return g.useEffect(()=>{e.quantity&&e.quantity.available===0?p(0):p(1)},[e.quantity.available]),g.useEffect(()=>{e.chargeTypes&&m(e.chargeTypes.includes(r)?r:e.chargeTypes[0])},[e.chargeTypes]),t.jsxRuntimeExports.jsxs("div",{className:T.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:T.chargeTypes,children:e.chargeTypes.map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(T.charge,{[T.chargeActive]:r===h}),onClick:()=>m(h),children:Z[h]},h))}),t.jsxRuntimeExports.jsx("div",{className:T.variants,children:s.filter(h=>{var x;return(x=h.chargeTypes)==null?void 0:x.includes(r)}).map(h=>{var x,I;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(T.variant,{[T.activeVariant]:e.id===h.id}),onClick:()=>{a(h),p(1)},children:[t.jsxRuntimeExports.jsxs("div",{className:T.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:T.title,id:"h4",children:t.splitTextIntoSpans(h.name)}),t.jsxRuntimeExports.jsxs("span",{id:"md",children:[t.formatPrice({amount:r==="ONE_TIME"?h.price.amount:h.subscriptionSettings?h.subscriptionSettings.price.amount:0,currency:r==="ONE_TIME"?h.price.currency:h.subscriptionSettings?h.subscriptionSettings.price.currency:"USD"})," ",r==="RECURRING"&&h.subscriptionSettings&&` / ${t.normalizeInterval(h.subscriptionSettings.recurringIntervalDays||0)}`]})]}),t.jsxRuntimeExports.jsx("div",{id:"md",children:r==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:T.stock,id:"md",children:[(x=h.quantity.restrictions)!=null&&x.max||h.quantity.available!==void 0?((I=h.quantity.restrictions)==null?void 0:I.max)||h.quantity.available:"∞"," ","in stock"]})})]},h.id)})}),r==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:T.quantity,id:"md",children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{j>1?p(h=>h-1):p(1)},className:T.button,disabled:e.quantity.available&&e.quantity.restrictions&&j<=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(j),onChange:h=>{e.quantity.available&&Number(h)>e.quantity.available?p(e.quantity.available):p(Number(h))},max:((A=e.quantity.restrictions)==null?void 0:A.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((V=e.quantity.restrictions)==null?void 0:V.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&j>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{p(h=>h+1)},className:T.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&j>=e.quantity.restrictions.max||e.quantity.available===0||e.quantity.available&&j>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:T.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:T.info,children:[t.jsxRuntimeExports.jsx("span",{id:"md",children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:T.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"var(--text-action)",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{id:"md",children:!e.deliveryTime||e.deliveryTime===0?"Instant":M(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:T.info,children:[t.jsxRuntimeExports.jsx("span",{id:"md",children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:T.infoRight,children:r==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:T.price,id:"md",children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(T.newPrice,{[T.animate]:c}),children:t.formatPrice({amount:e.price.amount*j,currency:e.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:T.oldPrice,id:"md",children:t.formatPrice({amount:e.compareAtPrice.amount*j,currency:e.compareAtPrice.currency})})]}):t.jsxRuntimeExports.jsx("span",{className:t.clx(T.newPrice,{[T.animate]:c}),id:"md",children:t.formatPrice({amount:e.price.amount*j,currency:e.price.currency})}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:T.price,id:"md",children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(T.newPrice,{[T.animate]:c}),id:"md",children:t.formatPrice({amount:e.subscriptionSettings.price.amount*j,currency:e.subscriptionSettings.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:T.oldPrice,id:"md",children:t.formatPrice({amount:e.subscriptionSettings.compareAtPrice.amount*j,currency:e.subscriptionSettings.compareAtPrice.currency})})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsx("span",{className:t.clx(T.newPrice,{[T.animate]:c}),id:"md",children:t.formatPrice({amount:e.subscriptionSettings.price.amount*j,currency:e.subscriptionSettings.price.currency})})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:T.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>C(),disabled:e.quantity&&e.quantity.available===0,children:r==="ONE_TIME"?"Buy Now":"Subscribe Now"}),r==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>R(),disabled:e.quantity&&e.quantity.available===0,children:l.parts.some(h=>h.productId===n.id&&h.productVariantId===e.id)?"Add More":"Add to Cart"})]})]})},Ie="_buttons_1uy6y_23",Se="_modal_1uy6y_32",Ne="_closing_1uy6y_65",Ce="_info_1uy6y_114",Pe="_top_1uy6y_121",ke="_title_1uy6y_132",Te="_clear_1uy6y_139",we="_activeClear_1uy6y_146",Be="_count_1uy6y_150",Me="_cart_1uy6y_165",$e="_empty_1uy6y_173",Oe="_product_1uy6y_199",qe="_products_1uy6y_208",Ae="_image_1uy6y_216",De="_productInfo_1uy6y_233",Le="_content_1uy6y_240",ze="_name_1uy6y_246",Ue="_price_1uy6y_252",Fe="_productButtons_1uy6y_258",He="_productButton_1uy6y_258",Ve="_productCount_1uy6y_275",Ye="_bottom_1uy6y_292",Ge="_subtotal_1uy6y_300",We="_block_1uy6y_308",Xe="_shoppingCount_1uy6y_315",Qe="_total_1uy6y_335",Je="_link_1uy6y_341",Ke="_userInfo_1uy6y_348",Ze="_pagesMobileModal_1uy6y_360",ts="_pagesMobileModalContent_1uy6y_374",es="_pagesMobileModalHeader_1uy6y_380",ss="_pagesMobileModalFooter_1uy6y_390",ns="_pageLink_1uy6y_397",is="_rightButtons_1uy6y_406",N={buttons:Ie,modal:Se,closing:Ne,info:Ce,top:Pe,title:ke,clear:Te,activeClear:we,count:Be,cart:Me,empty:$e,product:Oe,products:qe,image:Ae,productInfo:De,content:Le,name:ze,price:Ue,productButtons:Fe,productButton:He,productCount:Ve,bottom:Ye,subtotal:Ge,block:We,shoppingCount:Xe,total:Qe,link:Je,userInfo:Ke,pagesMobileModal:Ze,pagesMobileModalContent:ts,pagesMobileModalHeader:es,pagesMobileModalFooter:ss,pageLink:ns,rightButtons:is,delete:"_delete_1uy6y_413"},os=u=>{const{shopping:n,signUp:o,isShowUserInfo:s=!0}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:(n||s)&&t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[n&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})})},nt=()=>{const[u,n]=g.useState(!1),[o,s]=g.useState([]),[e,a]=g.useState(!1),{cart:r,products:m}=t.useCart();g.useEffect(()=>{(async()=>{const p=r.parts.map(_=>String(_.productId)),l=m.filter(_=>p.includes(String(_.id)))||[];console.log("Products",l);const E=r.parts.map(_=>{const c=l.find(i=>i.id===_.productId);return console.log(c),c?{...c,activeVariantId:_.productVariantId,quantity:_.quantity,chargeType:_.chargeType}:null}).filter(Boolean);console.log("Products with active variants",E),s(E)})()},[r.parts,m]);function f(j){return!j||!(j!=null&&j.variants)?!1:j.chargeType==="RECURRING"}const y=r.parts.length>0&&o.length>0&&!f(o[0]);function P(){a(!1),setTimeout(()=>{n(!1)},300)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:j=>{j.stopPropagation(),window.location.pathname.includes("/admin/builder")||(n(!0),a(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"}),y&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:r.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:P,withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:y,isOpen:e,close:P})})]})},it=u=>{var _,c;const{activeProducts:n,isCartNotEmpty:o,isOpen:s,close:e}=u,{cart:a,reset:r,getTotalAndDiscount:m,updateQuantityOfProduct:f,removeProduct:y}=t.useCart(),P=t.useNavigate();function j(i,R){P(i,{replace:R})}function p(i){i.quantity&&f({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity+1,chargeType:i.chargeType})}function l(i){i.quantity&&f({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity-1,chargeType:i.chargeType})}function E(i){y({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity||1,chargeType:i.chargeType})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:i=>i.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,id:"h4",children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,id:"md",children:a.parts.length})]}),t.jsxRuntimeExports.jsxs("div",{className:N.rightButtons,children:[o&&t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:r,id:"md",children:"Clear all"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:e,hoverable:!0,width:24,height:24,fill:"var(--text-primary)"})]})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:n.map(i=>{var R,C;return t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[i.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.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(((R=i.variants.find(M=>M.id===i.activeVariantId))==null?void 0:R.name)||i.name)}),t.jsxRuntimeExports.jsx("div",{className:N.price,children:t.formatPrice({amount:i.variants.find(M=>M.id===i.activeVariantId).price.amount*((i==null?void 0:i.quantity)||1),currency:i.variants.find(M=>M.id===i.activeVariantId).price.currency})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{i.quantity!==1&&l(i)},className:N.productButton,disabled:i.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("input",{className:N.productCount,type:"number",value:((C=i.quantity)==null?void 0:C.toString())||"",onChange:M=>{const A=Math.min(Number(M.target.value),i.variants.find(V=>V.id===i.activeVariantId).quantity.available||1/0);A<1||f({productId:i.id,productVariantId:i.activeVariantId,quantity:A,chargeType:i.chargeType})},min:1,max:i.variants.find(M=>M.id===i.activeVariantId).quantity.available||1/0}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>p(i),className:N.productButton,disabled:i.quantity===i.variants.find(M=>M.id===i.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.delete,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",fill:"var(--text-action)",width:20,height:20,onClick:()=>E(i),hoverable:!0})})]})]},i.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.jsx("div",{className:N.total,children:t.formatPrice({amount:m().total,currency:a.parts.length>0&&((c=(_=n.find(i=>i.id===a.parts[0].productId))==null?void 0:_.variants.find(i=>i.id===a.parts[0].productVariantId))==null?void 0:c.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>j("/checkout",!1),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",{id:"h5",children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{id:"md",children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,id:"md",children:"view products"})]})]}),tt=({signUp:u,close:n})=>{const{token:o}=t.useStorefrontStore(),s=t.useNavigate(),[e,a]=g.useState("test-email@gmail.com");g.useEffect(()=>{o&&(async()=>{if(!o)return;const f=t.jwtDecode(o);a(f.email)})()},[o]);function r(m){window.location.pathname.includes("/admin/builder")||s(m)}return o?t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:N.userInfo,onClick:()=>{r("/customer-dash"),n==null||n()},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:()=>{r("/customer-dash"),n==null||n()},type:"Secondary",style:{padding:10},children:"Login"}),u&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{r("/customer-dash"),n==null||n()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]})},rt=({logo:u,setIsOpen:n,signUp:o,pages:s})=>{const{setIsOpen:e}=t.useModalStore(),a=()=>{e(!1),setTimeout(()=>{n(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:r=>r.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:u}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:a,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:s.length>0&&s.map(r=>t.jsxRuntimeExports.jsx("div",{className:N.pageLink,onClick:a,children:t.jsxRuntimeExports.jsx(t.Link,{path:r.path,children:r.name["en-US"]},r.id)}))}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:o,close:a})})]})},rs=({logo:u,signUp:n,pages:o})=>{const[s,e]=g.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),hasPadding:!1,children:t.jsxRuntimeExports.jsx(rt,{logo:u,setIsOpen:e,signUp:n,pages:o})})]})},at=u=>{const{setIsOpenModal:n}=u;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||n(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List"})})},as="_share_onabp_1",cs="_modal_onabp_8",ls="_header_onabp_20",ds="_title_onabp_46",us="_copyWrapper_onabp_53",xs="_copyText_onabp_62",ps="_copyTextMobile_onabp_75",ms="_copyTextMiniMobile_onabp_94",Q={share:as,modal:cs,header:ls,title:ds,copyWrapper:us,copyText:xs,copyTextMobile:ps,copyTextMiniMobile:ms},js=({title:u="Copy Product Link"})=>{const{isOpenModal:n,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})}),n&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(hs,{title:u})})]})},hs=({title:u="Copy Product Link"})=>{const{setIsOpenModal:n}=t.useShareLinkStore(),{notifications:o,setNotifications:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),a=window.location.href;function r(){navigator.clipboard.writeText(a),s([...o,{id:t.v4(),message:"Link copied to clipboard",status:"success"}])}function m(){e(!1),setTimeout(()=>{n(!1),e(!0)},300)}function f(y,P){return y.length>P?y.slice(0,P)+"...":y}return t.jsxRuntimeExports.jsxs("div",{className:Q.modal,onClick:y=>y.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,children:[t.jsxRuntimeExports.jsx("div",{className:Q.title,id:"h4",children:u}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:m,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:Q.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:r,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:Q.copyText,id:"md",children:f(a,100)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMobile,id:"md",children:f(a,40)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMiniMobile,id:"md",children:f(a,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:r,children:o.find(y=>y.message==="Link copied to clipboard")?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},gs="_accordion_153d4_1",fs="_header_153d4_12",ys="_icon_153d4_21",Es="_open_153d4_24",_s="_content_153d4_28",Rs="_contentOpen_153d4_36",vs="_contentText_153d4_40",J={accordion:gs,header:fs,icon:ys,open:Es,content:_s,contentOpen:Rs,contentText:vs},bs=({title:u,content:n,defaultOpen:o=!1})=>{const[s,e]=g.useState(o),[a,r]=g.useState(0),m=g.useRef(null),f=()=>{e(!s)};return g.useEffect(()=>{m.current&&r(s?m.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:f,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.content,{[J.contentOpen]:s}),children:t.jsxRuntimeExports.jsx("p",{id:"md",className:J.contentText,ref:m,style:{height:`${a}px`,marginTop:`${a>0?"20px":"0px"}`},children:n})})]})},Is="_buttonsBlock_1b2rb_1",Ss={buttonsBlock:Is},Ns=u=>{var y,P;const{setIsOpen:n,setModalType:o,productId:s}=u,{cart:e}=t.useCart(),{pageContext:a}=t.usePagesStore(),r=(y=a==null?void 0:a.listings)==null?void 0:y.find(j=>j.id===s);if(!r)return null;const m=(P=a==null?void 0:a.products)==null?void 0:P.find(j=>j.uniquePath===r.productData.uniquePath);if(!m)return null;const f=e.parts.find(j=>j.productId===m.id);return t.jsxRuntimeExports.jsxs("div",{className:Ss.buttonsBlock,onClick:j=>j.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),n(!0)},children:f?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),n(!0)},children:"Buy"})]})},Cs="_wrapper_27wzz_1",Ps="_logo_27wzz_8",ks="_info_27wzz_12",K={wrapper:Cs,logo:Ps,info:ks},Ts=({date:u})=>{const{general:n}=t.useGeneralStore();if(!n)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),a={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",a)}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:K.logo,children:n.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.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:K.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:n.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(u)})]})]})},ws="_variants_1f6zq_82",Bs="_variant_1f6zq_82",Ms="_stock_1f6zq_100",$s="_variantInfo_1f6zq_108",Os="_title_1f6zq_202",qs="_modal_1f6zq_208",As="_header_1f6zq_228",Ds="_productOptions_1f6zq_236",Ls="_loading_1f6zq_240",G={variants:ws,variant:Bs,stock:Ms,variantInfo:$s,title:Os,modal:qs,header:As,productOptions:Ds,loading:Ls},zs=u=>{var p;const{pageContext:n}=t.usePagesStore(),o=(p=n==null?void 0:n.listings)==null?void 0:p.find(l=>l.id===u.productId),[s,e]=g.useState(!0),[a,r]=g.useState(null),m=(a==null?void 0:a.variants[0])||null,[f,y]=g.useState("ONE_TIME"),{addProducts:P}=t.useCart(),{setIsOpen:j}=t.useModalStore();return g.useEffect(()=>{(async()=>{e(!0);const E=await t.getDynamicPage(encodeURIComponent(`/product/${o.productData.uniquePath}`));P(E==null?void 0:E.data.products),r(E==null?void 0:E.data.products[0]),e(!1)})()},[]),g.useEffect(()=>{j(!0)},[]),t.jsxRuntimeExports.jsx(t.Modal,{close:u.setIsOpen,children:t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:l=>l.stopPropagation(),children:[s&&t.jsxRuntimeExports.jsx("div",{className:G.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})}),u.type==="Add To Cart"&&a&&m&&!s&&t.jsxRuntimeExports.jsx(Us,{variants:a.variants,activeVariant:m,activeChargeType:f,setActiveChargeType:y,productId:a.id,setIsOpen:u.setIsOpen}),u.type==="Buy Now"&&a&&!s&&t.jsxRuntimeExports.jsx(Fs,{product:a,setIsOpen:u.setIsOpen})]})})},Us=u=>{const{variants:n,activeChargeType:o,productId:s,setIsOpen:e}=u,{cart:a,addProductToCart:r,addProducts:m,updateQuantityOfProduct:f}=t.useCart(),{notifications:y,setNotifications:P}=t.useNotificationStore(),{pageContext:j}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),l=()=>{p(!1),setTimeout(()=>{e(!1)},300)};async function E(_){const c=n.find(C=>C.id===_),i=a.parts.find(C=>C.productId===u.productId&&C.productVariantId===_);if((c==null?void 0:c.quantity.available)&&(c==null?void 0:c.quantity.restrictions)&&((i==null?void 0:i.quantity)||0)+1>(c==null?void 0:c.quantity.restrictions.max)||(c==null?void 0:c.quantity.available)===0||(c==null?void 0:c.quantity.available)&&((i==null?void 0:i.quantity)||0)+1>(c==null?void 0:c.quantity.available)){P([...y,{id:t.v4(),message:"Product is out of stock",status:"error"}]);return}if(i)f({productId:s,productVariantId:_,quantity:i.quantity+1,chargeType:o});else{j!=null&&j.products&&m(j.products);try{r({productId:s,productVariantId:_,quantity:1,chargeType:o}),P([...y,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(C){P([...y,{id:t.v4(),message:`Product failed to add to cart: ${C}`,status:"error"}])}}}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.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:l})]}),t.jsxRuntimeExports.jsx("div",{className:G.variants,children:n.filter(_=>{var c;return(c=_.chargeTypes)==null?void 0:c.includes(o)}).map(_=>{var c,i,R;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(G.variant),onClick:()=>{E(_.id),e(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:G.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:G.title,id:"h4",children:_.name}),t.jsxRuntimeExports.jsx("span",{id:"md",children:t.formatPrice({amount:o==="ONE_TIME"?_.price.amount:_.subscriptionSettings?_.subscriptionSettings.price.amount:0,currency:o==="ONE_TIME"?_.price.currency:((c=_.subscriptionSettings)==null?void 0:c.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx("div",{id:"md",children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:G.stock,id:"md",children:[(i=_.quantity.restrictions)!=null&&i.max||_.quantity.available!==void 0?((R=_.quantity.restrictions)==null?void 0:R.max)||_.quantity.available:"∞"," ","in stock"]})})]},_.id)})})]})},Fs=u=>{const{product:n,setIsOpen:o}=u,{setIsOpen:s}=t.useModalStore(),e=()=>{s(!1),setTimeout(()=>{o(!1)},300)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(n.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:G.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:n,setIsOpen:o})})]})},Hs="_contentModal_1ptti_1",Vs="_modalTop_1ptti_13",Ys="_loading_1ptti_19",Gs="_modalCards_1ptti_27",Ws="_modalImage_1ptti_32",Xs="_card_1ptti_37",Qs="_cardInfo_1ptti_49",Js="_cardButtons_1ptti_56",Ks="_title_1ptti_62",Zs="_blockImage_1ptti_69",tn="_short_1ptti_78",en="_price_1ptti_82",sn="_oldPrice_1ptti_89",nn="_newPrice_1ptti_98",L={contentModal:Hs,modalTop:Vs,loading:Ys,modalCards:Gs,modalImage:Ws,card:Xs,cardInfo:Qs,cardButtons:Js,title:Ks,blockImage:Zs,short:tn,price:en,oldPrice:sn,newPrice:nn},on=u=>{const{setIsOpen:n,pageContext:o,groupData:s,setProductId:e,setIsProductModalOpen:a,setShowDropdown:r}=u,[m,f]=g.useState(null),[y,P]=g.useState(!0),{setIsOpen:j}=t.useModalStore();g.useEffect(()=>{var E;P(!0);const l=(E=o.listings)==null?void 0:E.filter(_=>s.listingIdList.includes(_.id));l&&f([...l]),P(!1)},[o]),g.useEffect(()=>{j(!0)},[]);const p=()=>{j(!1),setTimeout(()=>{n(!1)},300)};return t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsxs("div",{className:L.contentModal,onClick:l=>l.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:L.modalTop,children:[t.jsxRuntimeExports.jsx("span",{className:L.title,id:"h4",children:t.splitTextIntoSpans(s.name)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:p,fill:"var(--text-primary)"})]}),!y&&m&&t.jsxRuntimeExports.jsx("div",{className:L.modalCards,children:m.map(l=>t.jsxRuntimeExports.jsxs("div",{className:L.card,children:[t.jsxRuntimeExports.jsx("div",{children:l.productData.images[0]?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.productData.images[0].cfId}/w=500`,alt:"",width:64,height:64,className:L.modalImage}):t.jsxRuntimeExports.jsx("div",{className:t.clx(L.blockImage,L.modalImage),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})})}),t.jsxRuntimeExports.jsxs("div",{className:L.cardInfo,children:[t.jsxRuntimeExports.jsx("div",{className:L.name,id:"h5",children:l.productData.compareAtPrice&&(l.productData.compareAtPrice.amount||0)-(l.productData.minPrice.amount||0)>0?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.splitTextIntoSpans(l.productData.name),t.jsxRuntimeExports.jsxs("span",{className:L.price,id:"md",children:[t.jsxRuntimeExports.jsx("span",{className:L.newPrice,id:"md",children:t.formatPrice({amount:l.productData.minPrice.amount,currency:l.productData.minPrice.currency})}),t.jsxRuntimeExports.jsx("span",{className:L.oldPrice,id:"md",children:t.formatPrice({amount:l.productData.compareAtPrice.amount,currency:l.productData.compareAtPrice.currency})})]})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.splitTextIntoSpans(l.productData.name),t.jsxRuntimeExports.jsx("span",{className:L.newPrice,id:"md",children:t.formatPrice({amount:l.productData.minPrice.amount,currency:l.productData.minPrice.currency})})]})}),l.productData.shortDescription&&t.jsxRuntimeExports.jsx("span",{className:L.short,id:"md",children:t.splitTextIntoSpans(l.productData.shortDescription)})]}),t.jsxRuntimeExports.jsxs("div",{className:L.cardButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{e(l.id),n(!1),a(!0)},children:"Buy"}),t.jsxRuntimeExports.jsx(t.Link,{path:`/product/${l.productData.uniquePath}`,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{whiteSpace:"nowrap"},onClick:()=>{r(!1),p()},children:"View Details"})})]})]},l.id))}),y&&t.jsxRuntimeExports.jsx("div",{className:L.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]})})};exports.AlignText=t.AlignText;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.Link=t.Link;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.SelectTypeText=t.SelectTypeText;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.Wrapper=t.Wrapper;exports.Accordion=bs;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=se;exports.CategorySettings=Bt;exports.ChargeTypes=Z;exports.EmptyCart=ot;exports.FormSettings=Wt;exports.GroupCardModal=on;exports.HeaderButtons=os;exports.LayoutSettings=Et;exports.ListingSelector=ie;exports.MetaInfoPost=Ts;exports.PagesMobileMenu=rs;exports.PagesMobileModal=rt;exports.PagesSettings=Yt;exports.ProductCardButtons=Ns;exports.ProductCardModal=zs;exports.ProductOptions=st;exports.ShareLink=js;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.UserInfo=tt;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as t, I as b, c as H, d as Nt, e as pt, g as mt, P as gt, S as lt, h as Pt, D as ft, i as xt, v as _t, B as dt, k as ot, a as kt, l as wt, O as ht, m as J, n as yt, C as jt, o as V, p as qt, q as At, r as vt, t as Dt, w as bt, x as W, L as Et, y as St, z as Ct, A as ct, s as at, f as Q, E as Rt, F as L, G as Lt, M as ut, H as zt, J as rt, K as Tt, N as Ut, Q as Mt, T as Ft, U as Bt, V as Ht } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { j as t, I as b, c as H, d as Nt, e as pt, g as mt, P as gt, S as lt, h as Pt, D as ft, i as xt, v as _t, B as dt, k as ot, a as kt, l as wt, O as ht, m as J, n as yt, C as jt, o as V, p as qt, q as At, r as vt, t as Dt, w as bt, x as W, L as Et, y as St, z as Ct, A as ct, s as at, f as Q, E as Rt, F as L, G as Lt, M as ut, H as zt, J as rt, K as Tt, N as Ut, Q as Mt, T as Ft, U as Bt, V as Ht } from "./index-B144ufUm.js";
|
|
2
|
+
import { a1 as ei, a5 as si, $ as ni, Z as ii, a4 as ai, a3 as oi, Y as ci, _ as ri, W as li, X as di, a0 as ui, a2 as hi } from "./index-B144ufUm.js";
|
|
3
3
|
import x from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23", Wt = "_alignmentContent_kh9z8_30", Xt = "_alignments_kh9z8_39", Qt = "_alignment_kh9z8_30", Jt = "_circle_kh9z8_64", Kt = "_paddings_kh9z8_71", Zt = "_padding_kh9z8_71", te = "_active_kh9z8_97", G = {
|
|
@@ -2902,6 +2902,7 @@ const ns = (u) => {
|
|
|
2902
2902
|
};
|
|
2903
2903
|
export {
|
|
2904
2904
|
Wn as Accordion,
|
|
2905
|
+
ei as AlignText,
|
|
2905
2906
|
Us as BurgerMenuButton,
|
|
2906
2907
|
L as Button,
|
|
2907
2908
|
qe as ButtonTypeSettings,
|
|
@@ -2909,7 +2910,7 @@ export {
|
|
|
2909
2910
|
Ln as CategorySettings,
|
|
2910
2911
|
$t as ChargeTypes,
|
|
2911
2912
|
At as ChooseImage,
|
|
2912
|
-
|
|
2913
|
+
si as ChooseImageModal,
|
|
2913
2914
|
Ls as EmptyCart,
|
|
2914
2915
|
Un as FormSettings,
|
|
2915
2916
|
Kn as GroupCardModal,
|
|
@@ -2917,7 +2918,7 @@ export {
|
|
|
2917
2918
|
b as Icon,
|
|
2918
2919
|
Nt as InputSettings,
|
|
2919
2920
|
Lt as InputUI,
|
|
2920
|
-
|
|
2921
|
+
ni as ItemsSettings,
|
|
2921
2922
|
Rn as LayoutSettings,
|
|
2922
2923
|
Tt as Link,
|
|
2923
2924
|
Hn as ListingSelector,
|
|
@@ -2930,20 +2931,20 @@ export {
|
|
|
2930
2931
|
Xn as ProductCardButtons,
|
|
2931
2932
|
Jn as ProductCardModal,
|
|
2932
2933
|
ns as ProductOptions,
|
|
2933
|
-
|
|
2934
|
+
ii as RadioUI,
|
|
2934
2935
|
Pt as RangeSelector,
|
|
2935
2936
|
ot as Select,
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2937
|
+
ai as SelectInfiniteList,
|
|
2938
|
+
oi as SelectTypeText,
|
|
2939
|
+
ci as SelectUI,
|
|
2939
2940
|
Gn as ShareLink,
|
|
2940
2941
|
Es as ShoppingButton,
|
|
2941
2942
|
Rs as ShoppingModalCart,
|
|
2942
2943
|
lt as Switch,
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2944
|
+
ri as TextSettings,
|
|
2945
|
+
li as TextareaSettings,
|
|
2946
|
+
di as TextareaUI,
|
|
2947
|
+
ui as TypesText,
|
|
2947
2948
|
Ot as UserInfo,
|
|
2948
|
-
|
|
2949
|
+
hi as Wrapper
|
|
2949
2950
|
};
|