@billgangcom/theme-lib 1.44.1 → 1.44.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +2 -1
- package/dist/builder/components/Preview/Render/index.d.ts +16 -2
- package/dist/builder/components/Sidebar/Layers/AnnouncementLayer/index.d.ts +1 -0
- package/dist/builder/components/Sidebar/Layers/index.d.ts +1 -0
- package/dist/builder/constants/block-icons.d.ts +1 -0
- package/dist/builder/constants/blocks.d.ts +24 -0
- package/dist/builder/index.d.ts +1 -0
- package/dist/builder/store/useLayersStore.d.ts +2 -0
- package/dist/builder/ui/Select/index.d.ts +4 -0
- package/dist/builder/utils/index.d.ts +1 -0
- package/dist/builder/utils/splitTextIntoSpans.d.ts +1 -0
- package/dist/builder.cjs.js +49 -49
- package/dist/builder.es.js +1991 -1927
- package/dist/{index-BkqkB6IP.cjs → index-DFHUslAr.cjs} +31 -31
- package/dist/{index-Dg3e7rFo.js → index-FNbiNtjB.js} +5749 -5690
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -4
- package/dist/pages/builder/index.d.ts +1 -0
- package/dist/ui/ButtonTypeSettings/index.d.ts +1 -0
- package/dist/ui/ButtonsSettings/index.d.ts +4 -1
- package/dist/ui/FormSettings/index.d.ts +7 -3
- package/dist/ui/FormSettings/popup.d.ts +1 -0
- package/dist/ui/ItemsSettings/index.d.ts +7 -4
- package/dist/ui/ItemsSettings/popup.d.ts +4 -0
- package/dist/ui/PagesSettings/index.d.ts +26 -0
- package/dist/ui/ProductCardButtons/index.d.ts +1 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1835 -1519
- 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");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-DFHUslAr.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.splitTextIntoSpans=o.splitTextIntoSpans;
|
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { App as e, ColorVariables as
|
|
1
|
+
import { App as e, ColorVariables as p, hotReload as r, iconNames as s } from "./builder.es.js";
|
|
2
|
+
import { s as l } from "./index-FNbiNtjB.js";
|
|
2
3
|
export {
|
|
3
4
|
e as App,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
p as ColorVariables,
|
|
6
|
+
r as hotReload,
|
|
7
|
+
s as iconNames,
|
|
8
|
+
l as splitTextIntoSpans
|
|
7
9
|
};
|
|
@@ -9,7 +9,9 @@ export interface ButtonType {
|
|
|
9
9
|
typesText: TextType[];
|
|
10
10
|
destination: Destination;
|
|
11
11
|
link?: string;
|
|
12
|
-
text:
|
|
12
|
+
text: {
|
|
13
|
+
'en-US': string;
|
|
14
|
+
};
|
|
13
15
|
page: string;
|
|
14
16
|
openInNewTab: boolean;
|
|
15
17
|
}
|
|
@@ -18,6 +20,7 @@ interface Props {
|
|
|
18
20
|
setIsActiveButtons: (value: boolean) => void;
|
|
19
21
|
buttons: ButtonType[];
|
|
20
22
|
setButtons: (value: ButtonType[]) => void;
|
|
23
|
+
editable?: boolean;
|
|
21
24
|
}
|
|
22
25
|
export declare const ButtonsSettings: React.FC<Props>;
|
|
23
26
|
export {};
|
|
@@ -48,9 +48,13 @@ interface ImageProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
|
48
48
|
itemsOptions?: never;
|
|
49
49
|
}
|
|
50
50
|
type Props<T extends ItemBase> = SelectProps<T> | InputProps<T> | ImageProps<T>;
|
|
51
|
-
interface FormItem extends ItemBase {
|
|
52
|
-
placeholder?:
|
|
53
|
-
|
|
51
|
+
export interface FormItem extends ItemBase {
|
|
52
|
+
placeholder?: {
|
|
53
|
+
'en-US': string;
|
|
54
|
+
};
|
|
55
|
+
title?: {
|
|
56
|
+
'en-US': string;
|
|
57
|
+
};
|
|
54
58
|
type?: 'String' | 'Number';
|
|
55
59
|
maxSymbols: number;
|
|
56
60
|
withTitle?: boolean;
|
|
@@ -43,6 +43,7 @@ interface SelectOption<T> {
|
|
|
43
43
|
field: keyof T;
|
|
44
44
|
itemsOptions: string[];
|
|
45
45
|
leftAddon?: string;
|
|
46
|
+
switcher?: string;
|
|
46
47
|
}
|
|
47
48
|
export type ModalOption<T> = ImageOption<T> | TextOption<T> | InputOption<T> | InputSwitchOption<T> | ListOption<T> | SelectOption<T>;
|
|
48
49
|
interface Props<T extends ItemBase> {
|
|
@@ -3,7 +3,9 @@ import { ModalOption } from './popup';
|
|
|
3
3
|
import { Other } from '../OtherSettings';
|
|
4
4
|
export interface ItemBase {
|
|
5
5
|
images: string[];
|
|
6
|
-
name:
|
|
6
|
+
name: {
|
|
7
|
+
'en-US': string;
|
|
8
|
+
};
|
|
7
9
|
id: string;
|
|
8
10
|
}
|
|
9
11
|
interface CommomPropsBase<T extends ItemBase> {
|
|
@@ -31,9 +33,10 @@ interface CommomPropsBase<T extends ItemBase> {
|
|
|
31
33
|
};
|
|
32
34
|
limit?: number;
|
|
33
35
|
modalOptions?: ModalOption<T>[];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
autoInterval?: {
|
|
37
|
+
setAutoInterval: React.Dispatch<React.SetStateAction<number>>;
|
|
38
|
+
autoInterval: number;
|
|
39
|
+
title?: string;
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
42
|
interface SelectProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
@@ -11,6 +11,7 @@ interface TextOption<T> {
|
|
|
11
11
|
field: {
|
|
12
12
|
type: keyof T;
|
|
13
13
|
text: keyof T;
|
|
14
|
+
typeFont: keyof T;
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
interface InputOption<T> {
|
|
@@ -35,8 +36,10 @@ interface ListOption<T> {
|
|
|
35
36
|
field: keyof T;
|
|
36
37
|
draggable?: boolean;
|
|
37
38
|
deletable?: boolean;
|
|
39
|
+
editable?: boolean;
|
|
38
40
|
itemsOptions: T[];
|
|
39
41
|
addableOptions?: Record<string, any>;
|
|
42
|
+
modalOptions?: ModalOption<any>[];
|
|
40
43
|
}
|
|
41
44
|
interface SelectOption<T> {
|
|
42
45
|
type: 'select';
|
|
@@ -44,6 +47,7 @@ interface SelectOption<T> {
|
|
|
44
47
|
field: keyof T;
|
|
45
48
|
itemsOptions: string[];
|
|
46
49
|
leftAddon?: string;
|
|
50
|
+
switcher?: keyof T;
|
|
47
51
|
}
|
|
48
52
|
export type ModalOption<T> = ImageOption<T> | TextOption<T> | InputOption<T> | InputSwitchOption<T> | ListOption<T> | SelectOption<T>;
|
|
49
53
|
interface Props<T extends ItemBase> {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface PageBase {
|
|
2
|
+
name: string;
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
interface CommomPropsBase<T extends PageBase> {
|
|
6
|
+
isActiveItems?: boolean;
|
|
7
|
+
setIsActiveItems?: (value: boolean) => void;
|
|
8
|
+
items: T[];
|
|
9
|
+
setItems: (value: T[]) => void;
|
|
10
|
+
title?: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
editable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
deletable?: boolean;
|
|
15
|
+
addable?: boolean;
|
|
16
|
+
addableOptions?: Record<string, any>;
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
19
|
+
interface SelectProps<T extends PageBase> extends CommomPropsBase<T> {
|
|
20
|
+
itemsType: 'select';
|
|
21
|
+
itemsPlaceholder?: never;
|
|
22
|
+
itemsOptions: T[];
|
|
23
|
+
}
|
|
24
|
+
type Props<T extends PageBase> = SelectProps<T>;
|
|
25
|
+
export declare const PagesSettings: <T extends PageBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProductCardButtons: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './LayoutSettings';
|
|
|
2
2
|
export * from './TextSettings';
|
|
3
3
|
export * from './ItemsSettings';
|
|
4
4
|
export * from './CategorySettings';
|
|
5
|
+
export * from './PagesSettings';
|
|
5
6
|
export * from './FormSettings';
|
|
6
7
|
export * from './ButtonsSettings';
|
|
7
8
|
export * from './TypesText';
|
|
@@ -14,6 +15,7 @@ export * from './ShareLink';
|
|
|
14
15
|
export * from './Accordion';
|
|
15
16
|
export * from './Button';
|
|
16
17
|
export * from './Link';
|
|
18
|
+
export * from './ProductCardButtons';
|
|
17
19
|
export * from '../builder/ui';
|
|
18
20
|
export { Input as InputSettings } from '../builder/ui/Input';
|
|
19
21
|
export { Input as InputUI } from './Input';
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BkqkB6IP.cjs"),g=require("react");require("@phosphor-icons/react");const wt="_wrapper_1ibay_2",St="_alignmentBlock_1ibay_8",Ct="_title_1ibay_15",Bt="_subtitle_1ibay_22",Tt="_alignmentContent_1ibay_29",Pt="_alignments_1ibay_37",Mt="_alignment_1ibay_8",At="_circle_1ibay_60",Ot="_paddings_1ibay_67",qt="_padding_1ibay_67",Lt="_active_1ibay_91",Dt="_input_1ibay_98",X={wrapper:wt,alignmentBlock:St,title:Ct,subtitle:Bt,alignmentContent:Tt,alignments:Pt,alignment:Mt,circle:At,paddings:Ot,padding:qt,active:Lt,input:Dt},Ht=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],zt=["left","top","right","bottom"],Ft=d=>{const{alignment:i,padding:e,setPadding:s,setAlignment:o}=d;function a(p){switch(p){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 c(p){switch(p){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[l,n]=g.useState(null),[r,h]=g.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:X.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:X.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:X.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:X.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:X.alignments,children:Ht.map(p=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{o(p)},className:X.alignment,onMouseEnter:()=>{n(p)},onMouseLeave:()=>{n(null)},children:[p!==i&&l!==p&&t.jsxRuntimeExports.jsx("div",{className:X.circle}),p!==i&&l===p&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(l),fill:"#c2c2c2",width:22,height:22}),p===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(i),fill:"#FF3F19",width:22,height:22})]},p))}),t.jsxRuntimeExports.jsx("div",{className:X.paddings,children:zt.map(p=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(X.padding,{[X.active]:r===p}),onFocus:()=>{h(p)},onBlur:()=>{h(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(p),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[p]),onChange:_=>s({...e,[p]:Number(_)}),paddingless:!0,borderless:!0})]},p))})]})]})]})},Vt="_title_1jkiw_1",Ut="_subtitle_1jkiw_5",Yt="_header_1jkiw_12",Gt="_text_1jkiw_13",Xt="_top_1jkiw_20",Wt="_itemsBlock_1jkiw_29",rt={title:Vt,subtitle:Ut,header:Yt,text:Gt,top:Xt,itemsBlock:Wt},Jt="_typeTexts_167ez_1",Qt="_block_167ez_8",Kt="_active_167ez_25",_t={typeTexts:Jt,block:Qt,active:Kt},Zt=["bold","italic","underline","strike-through","code"],jt=d=>{const{typesText:i,setTypesText:e}=d;function s(o){switch(o){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:_t.typeTexts,children:Zt.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(_t.block,{[_t.active]:i.includes(o)}),onClick:()=>{const a=[...i];if(a.includes(o)){const c=a.filter(l=>l!==o);e(c)}else a.push(o),e(a)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(o),fill:i.includes(o)?"#252525":"#757575",width:20,height:20})},String(o)))})},ct={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Paragraph"},gt=d=>{const{typesText:i,isActiveText:e,setIsActiveText:s,text:o,setText:a,setTypesText:c,title:l,subtitle:n="Items",typeFont:r,setTypeFont:h}=d;return t.jsxRuntimeExports.jsxs("div",{className:rt.text,children:[(l||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:rt.top,children:[l&&t.jsxRuntimeExports.jsx("h3",{className:rt.title,children:l}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:p=>s(p)})]}),t.jsxRuntimeExports.jsxs("div",{className:rt.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:rt.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:p=>a(p),value:o,maxLength:150}),t.jsxRuntimeExports.jsx(jt,{typesText:i,setTypesText:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Type Text",options:Object.values(ct).filter(p=>p!==ct[r]),onChange:p=>h(Object.keys(ct).find(_=>ct[_]===p)),value:ct[r]})]})]})},te="_title_xma5o_1",ee="_subtitle_xma5o_5",se="_header_xma5o_12",ne="_text_xma5o_13",oe="_productsBlock_xma5o_14",ie="_top_xma5o_26",ae="_itemsBlock_xma5o_35",re="_typeTexts_xma5o_41",ce="_block_xma5o_48",le="_active_xma5o_61",de="_products_xma5o_14",ue="_product_xma5o_14",xe="_button_xma5o_80",me="_disabled_xma5o_91",pe="_image_xma5o_95",_e="_info_xma5o_102",he="_name_xma5o_114",je="_buttons_xma5o_118",ge="_modal_xma5o_125",fe="_link_xma5o_145",be="_modalOptions_xma5o_151",ve="_addButton_xma5o_165",Ee="_deleteButton_xma5o_180",Re="_closeIcon_xma5o_192",q={title:te,subtitle:ee,header:se,text:ne,productsBlock:oe,top:ie,itemsBlock:ae,typeTexts:re,block:ce,active:le,products:de,product:ue,button:xe,disabled:me,image:pe,info:_e,name:he,buttons:je,modal:ge,link:fe,modalOptions:be,addButton:ve,deleteButton:Ee,closeIcon:Re},ye=g.forwardRef((d,i)=>{const{activeItem:e,setActiveItem:s,popupPosition:o,modalOptions:a,setIsOpenModal:c}=d;function l(n,r){return n.length>r?`${n.slice(0,r)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:i,className:q.modal,onClick:n=>{n.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{className:q.title,children:l(e.name,20)}),t.jsxRuntimeExports.jsx("div",{className:q.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:q.modalOptions,children:a.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:r=>{const h={...e,[n.field]:r};s(h)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(gt,{typesText:e[n.field.type],setTypesText:r=>{const h={...e,[n.field.type]:r};s(h)},text:e[n.field.text]||"",setText:r=>{const h={...e,[n.field.text]:r};s(h)},typeFont:e[n.field.type],setTypeFont:r=>{const h={...e,[n.field.type]:r};s(h)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const h={...e,[n.field]:r};s(h)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:q.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const h={...e,[n.field.text]:r};s(h)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:r=>{const h={...e,[n.field.switch]:r};s(h)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(bt,{items:e[n.field]||[],setItems:r=>{const h={...e,[n.field]:r};s(h)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:!1,subtitle:n.label,addableOptions:n.addableOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:r=>{const h={...e,[n.field]:r};s(h)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),Ie="_other_g74jx_1",ke="_subtitle_g74jx_7",Ne="_items_g74jx_14",ht={other:Ie,subtitle:ke,items:Ne},mt=d=>{const{items:i,title:e="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:ht.other,children:[t.jsxRuntimeExports.jsx("h5",{className:ht.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:ht.items,children:i.map((s,o)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:a=>s.setIsItem(a),label:s.label,hasBackground:!0,paddingless:!1},o))})]})};function $e({product:d,children:i}){const{attributes:e,listeners:s,setNodeRef:o,transform:a,transition:c,isDragging:l}=t.useSortable({id:d.id}),n={transform:t.CSS.Transform.toString(a),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:o,style:n,className:`${q.product} ${l?q.dragging:""}`,...e,...s,children:i})}const bt=d=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:l,editable:n=!0,draggable:r=!1,withImage:h=!1,deletable:p=!0,addable:_=!0,itemsType:m,itemsPlaceholder:f="",itemsOptions:u,hasRangeSelector:$=!1,rangeSelectorOptions:L,modalOptions:R,addableOptions:I={},limit:j,autoScrollInterval:N}=d,[z,w]=g.useState(null),[V,A]=g.useState({top:0,left:0}),[v,T]=g.useState(null),S=g.useRef(null),[G,P]=g.useState(!1),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const x=()=>{w(null),P(!1)};return document.body.addEventListener("click",x),w(null),P(!1),()=>{w(null),P(!1),document.body.removeEventListener("click",x)}},[]),g.useEffect(()=>{if(z){const x=[...s].map(E=>E.id===z.id?z:E);o(x)}},[z]),g.useEffect(()=>{if(S.current&&v){const x=S.current.getBoundingClientRect().height,E=window.innerHeight;let C=v.top;C+x>E+window.scrollY-200&&(C=E+window.scrollY-x-200),C<0&&(C=10),A({top:C,left:v.left})}},[S.current,v]);const Q=(x,E)=>{x.stopPropagation();const C=x.target.getBoundingClientRect();T({top:C.top+window.scrollY,left:C.left-30}),w(E),P(!0)};function nt(x){if(h)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 b=x=>{const{active:E,over:C}=x;if(C&&E.id!==C.id){const O=s.findIndex(B=>B.id===E.id),U=s.findIndex(B=>B.id===C.id);if(O!==-1&&U!==-1){const B=[...s],[ot]=B.splice(O,1);B.splice(U,0,ot),o(B)}}},M=(x,E)=>{var O,U;const C=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const ot=[...s],at=u.find(ut=>ut.name===B);if(!at)return;const it=ot.map(ut=>ut.id===x.id?{...at,name:B}:ut);w({...x,name:B}),o([...it])},value:x.name,options:u.filter(B=>!s.find(ot=>ot.name===B.name)).map(B=>B.name),leftAddon:nt(x.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:B=>{const at=[...s].map(it=>it.id===x.id?{...x,name:B}:it);o([...at])},value:x.name,placeholder:f}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:B=>{const at=[...s].map(it=>it.id===x.id?{...x,images:B}:it);o([...at])},activeImage:(O=s.find(B=>B.id===x.id))!=null&&O.images?(U=s.find(B=>B.id===x.id))==null?void 0:U.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:q.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>Q(B,x)})}),p&&t.jsxRuntimeExports.jsx("div",{className:q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(B=>B.id!==x.id))})})]})]});return r?t.jsxRuntimeExports.jsx($e,{product:x,index:E,children:C},x.id):t.jsxRuntimeExports.jsx("div",{className:q.product,children:C},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:q.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:q.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>e==null?void 0:e(x)})]}),z&&n&&R&&G&&t.jsxRuntimeExports.jsx(ye,{ref:S,activeItem:z,setActiveItem:w,popupPosition:V,modalOptions:R,setIsOpenModal:P}),$&&L&&t.jsxRuntimeExports.jsx(pt,{...L}),t.jsxRuntimeExports.jsxs("div",{className:q.products,children:[l&&t.jsxRuntimeExports.jsx("h5",{className:q.subtitle,children:l}),r?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:b,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,E)=>M(x,E))})}):s.map((x,E)=>M(x,E)),_&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(q.button,{[q.disabled]:!!(j&&j<=s.length||s.length===(u==null?void 0:u.length))}),size:"s",disabled:!!(j&&j<=s.length||s.length===(u==null?void 0:u.length)),onClick:()=>{const x=[...s];let E=null;if(u){for(let C=0;C<u.length;C++)if(!s.find(O=>O.id===u[C].id)){E=u[C];break}}m==="select"&&u?x.push({name:E?E.name:u[0].name,id:(E==null?void 0:E.id)||u[0].id,...I}):m==="input"?x.push({name:"",id:t.v4(),...I}):x.push({name:`Image ${s.length+1}`,id:t.v4(),...I}),o(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:q.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(mt,{items:a}),N!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(N.scrollInterval),onChange:x=>N.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},we="_title_82zux_1",Se="_subtitle_82zux_5",Ce="_header_82zux_12",Be="_text_82zux_13",Te="_productsBlock_82zux_14",Pe="_top_82zux_26",Me="_itemsBlock_82zux_35",Ae="_typeTexts_82zux_41",Oe="_block_82zux_48",qe="_active_82zux_61",Le="_products_82zux_14",De="_product_82zux_14",He="_button_82zux_80",ze="_disabled_82zux_91",Fe="_image_82zux_95",Ve="_info_82zux_102",Ue="_name_82zux_114",Ye="_buttons_82zux_118",Ge="_modal_82zux_125",Xe="_link_82zux_145",We="_modalOptions_82zux_151",Je="_addButton_82zux_157",Qe="_deleteButton_82zux_179",W={title:we,subtitle:Se,header:Ce,text:Be,productsBlock:Te,top:Pe,itemsBlock:Me,typeTexts:Ae,block:Oe,active:qe,products:Le,product:De,button:He,disabled:ze,image:Fe,info:Ve,name:Ue,buttons:Ye,modal:Ge,link:Xe,modalOptions:We,addButton:Je,deleteButton:Qe},Ke=d=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:l,draggable:n=!1,withImage:r=!1,addable:h=!0,itemsOptions:p,hasRangeSelector:_=!1,rangeSelectorOptions:m,limit:f,autoScrollInterval:u,deletable:$}=d;function L(I){if(r)return I?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${I[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const R=(I,j=!1)=>{const N=p.find(w=>w.id===I);if(!N)return;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:w=>{const V=[...s],A=p.find(S=>S.name===w);if(!A)return;const v=A.id,T=V.map(S=>S===I?v:S);o([...T])},value:N.name,options:p.filter(w=>!s.find(V=>V===w.id)).map(w=>w.name),leftAddon:L(N.images)}),j&&t.jsxRuntimeExports.jsx("div",{className:W.buttons,children:t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(w=>w!==I))})})})]});return t.jsxRuntimeExports.jsx("div",{className:W.product,children:z},I)};return t.jsxRuntimeExports.jsxs("div",{className:W.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:I=>e==null?void 0:e(I)})]}),_&&m&&t.jsxRuntimeExports.jsx(pt,{...m}),t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[l&&t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:l}),s.map(I=>R(I,$)),h&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(W.button,{[W.disabled]:!!(f&&f<=s.length||s.length===p.length)}),size:"s",disabled:!!(f&&f<=s.length||s.length===p.length),onClick:()=>{const I=[...s];let j=null;if(p){for(let N=0;N<p.length;N++)if(!s.find(z=>z===p[N].id)){j=p[N];break}}I.push((j==null?void 0:j.id)||p[0].id),o(I)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(mt,{items:a}),u!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(u.scrollInterval),onChange:I=>u.setScrollInterval(Number(I)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Ze="_title_1vfw9_1",ts="_subtitle_1vfw9_5",es="_header_1vfw9_12",ss="_text_1vfw9_13",ns="_productsBlock_1vfw9_14",os="_top_1vfw9_26",is="_itemsBlock_1vfw9_35",as="_typeTexts_1vfw9_41",rs="_block_1vfw9_48",cs="_active_1vfw9_61",ls="_products_1vfw9_14",ds="_product_1vfw9_14",us="_button_1vfw9_80",xs="_disabled_1vfw9_91",ms="_image_1vfw9_95",ps="_info_1vfw9_102",_s="_name_1vfw9_114",hs="_buttons_1vfw9_118",js="_modal_1vfw9_125",gs="_link_1vfw9_145",fs="_modalOptions_1vfw9_151",bs="_addButton_1vfw9_164",vs="_deleteButton_1vfw9_179",Es="_closeIcon_1vfw9_191",H={title:Ze,subtitle:ts,header:es,text:ss,productsBlock:ns,top:os,itemsBlock:is,typeTexts:as,block:rs,active:cs,products:ls,product:ds,button:us,disabled:xs,image:ms,info:ps,name:_s,buttons:hs,modal:js,link:gs,modalOptions:fs,addButton:bs,deleteButton:vs,closeIcon:Es},Rs=g.forwardRef((d,i)=>{const{activeItem:e,setActiveItem:s,popupPosition:o,modalOptions:a,setIsOpenModal:c}=d;function l(n,r){return n.length>r?`${n.slice(0,r)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:i,className:H.modal,onClick:n=>{n.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:l(e.name,20)}),t.jsxRuntimeExports.jsx("div",{className:H.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:a.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:r=>{const h={...e,[n.field]:r};s(h)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(gt,{typesText:e[n.field.type],setTypesText:r=>{const h={...e,[n.field.type]:r};s(h)},text:e[n.field.text]||"",setText:r=>{const h={...e,[n.field.text]:r};s(h)},typeFont:e[n.field.type],setTypeFont:r=>{const h={...e,[n.field.type]:r};s(h)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const h={...e,[n.field]:r};s(h)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const h={...e,[n.field.text]:r};s(h)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:r=>{const h={...e,[n.field.switch]:r};s(h)}})]});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:r=>{const h={...e,[n.field]:r};s(h)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})});function ys(d){const{product:i,children:e}=d,{attributes:s,listeners:o,setNodeRef:a,transform:c,transition:l,isDragging:n}=t.useSortable({id:i.id}),r={transform:t.CSS.Transform.toString(c),transition:l};return t.jsxRuntimeExports.jsx("div",{ref:a,style:r,className:`${H.product} ${n?H.dragging:""}`,...s,...o,children:e})}const Is=d=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:l,editable:n=!0,draggable:r=!1,withImage:h=!1,deletable:p=!0,addable:_=!0,itemsType:m,itemsPlaceholder:f="",itemsOptions:u,hasRangeSelector:$=!1,rangeSelectorOptions:L,modalOptions:R,addableOptions:I={}}=d,[j,N]=g.useState(null),[z,w]=g.useState({top:0,left:0}),[V,A]=g.useState(null),v=g.useRef(null),[T,S]=g.useState(!1),G=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const b=()=>{N(null),S(!1)};return document.body.addEventListener("click",b),N(null),S(!1),()=>{N(null),S(!1),document.body.removeEventListener("click",b)}},[]),g.useEffect(()=>{if(j){const b=[...s].map(M=>M.id===j.id?j:M);o(b)}},[j]),g.useEffect(()=>{if(v.current&&V){const b=v.current.getBoundingClientRect().height,M=window.innerHeight;let x=V.top;x+b>M+window.scrollY-200&&(x=M+window.scrollY-b-200),x<0&&(x=10),w({top:x,left:V.left})}},[v.current,V]);const P=(b,M)=>{b.stopPropagation();const x=b.target.getBoundingClientRect();A({top:x.top+window.scrollY,left:x.left-30}),N(M),S(!0)};function D(b){if(h)return b?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${b[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Q=b=>{const{active:M,over:x}=b;if(x&&M.id!==x.id){const E=s.findIndex(O=>O.id===M.id),C=s.findIndex(O=>O.id===x.id);if(E!==-1&&C!==-1){const O=[...s],[U]=O.splice(E,1);O.splice(C,0,U),o(O)}}},nt=b=>{var x;const M=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:E=>{const O=[...s].map(U=>U.id===b.id?{...b,name:E}:U);N({...b,name:E}),o([...O])},value:b.name,options:u.filter(E=>!s.find(C=>C.name===E)),leftAddon:D(b.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:E=>{const O=[...s].map(U=>U.id===b.id?{...b,name:E}:U);o([...O])},value:b.name,placeholder:f}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:E=>{const O=[...s].map(U=>U.id===b.id?{...b,images:E}:U);o([...O])},activeImage:(x=s.find(E=>E.id===b.id))==null?void 0:x.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:E=>P(E,b)})}),p&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(E=>E.id!==b.id))})})]})]});return r?t.jsxRuntimeExports.jsx(ys,{product:b,children:M},b.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:M},b.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:b=>e==null?void 0:e(b)})]}),j&&n&&R&&T&&t.jsxRuntimeExports.jsx(Rs,{ref:v,activeItem:j,setActiveItem:N,popupPosition:z,modalOptions:R,setIsOpenModal:S}),$&&L&&t.jsxRuntimeExports.jsx(pt,{...L}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[l&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:l}),r?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:G,onDragEnd:Q,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>b.id),strategy:t.verticalListSortingStrategy,children:s.map(b=>nt(b))})}):s.map(b=>nt(b)),_&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:H.button,size:"s",onClick:()=>{const b=[...s];let M=null;if(u){for(let x=0;x<u.length;x++)if(!s.find(E=>E.name===u[x])){M=u[x];break}}m==="select"&&u?b.push({name:M||u[0],id:t.v4(),...I,maxSymbols:100}):m==="input"?b.push({name:"",id:t.v4(),...I,maxSymbols:100}):b.push({name:`Image ${s.length+1}`,id:t.v4(),...I,maxSymbols:100}),o(b)},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})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(mt,{items:a})]})},ks="_title_bn7sv_1",Ns="_subtitle_bn7sv_5",$s="_header_bn7sv_12",ws="_text_bn7sv_13",Ss="_productsBlock_bn7sv_14",Cs="_buttonsBlock_bn7sv_15",Bs="_top_bn7sv_26",Ts="_itemsBlock_bn7sv_35",Ps="_typeTexts_bn7sv_41",Ms="_block_bn7sv_48",As="_active_bn7sv_60",Os="_products_bn7sv_14",qs="_product_bn7sv_14",Ls="_button_bn7sv_15",Ds="_image_bn7sv_90",Hs="_info_bn7sv_97",zs="_name_bn7sv_109",Fs="_buttons_bn7sv_15",Vs="_modal_bn7sv_120",Us="_other_bn7sv_139",Ys="_options_bn7sv_145",Gs="_closeIcon_bn7sv_153",st={title:ks,subtitle:Ns,header:$s,text:ws,productsBlock:Ss,buttonsBlock:Cs,top:Bs,itemsBlock:Ts,typeTexts:Ps,block:Ms,active:As,products:Os,product:qs,button:Ls,image:Ds,info:Hs,name:zs,buttons:Fs,modal:Vs,other:Us,options:Ys,closeIcon:Gs},Xs=g.forwardRef((d,i)=>{const{activeButton:e,setActiveButton:s,popupPosition:o}=d,[a,c]=g.useState(e.typesText),[l,n]=g.useState(e.destination),[r,h]=g.useState(e.page),[p,_]=g.useState(e.link||""),[m,f]=g.useState(e.text||""),[u,$]=g.useState(e.openInNewTab),{pages:L}=t.usePagesStore();return g.useEffect(()=>{s({...e,...{text:m,link:p,destination:l,typesText:a,page:r,openInNewTab:u}})},[a,l,p,m,r,u]),t.jsxRuntimeExports.jsxs("div",{className:st.modal,onClick:R=>{R.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},ref:i,children:[t.jsxRuntimeExports.jsxs("div",{className:st.top,children:[t.jsxRuntimeExports.jsx("h3",{className:st.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:st.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:st.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:R=>n(R),options:["Go to Page","Open Link"].filter(R=>R!==l),value:l}),l==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:R=>h(R),options:L?Object.values(L).filter(R=>R.name!==r).map(R=>R.name):[],value:r}):t.jsxRuntimeExports.jsx(t.Input,{onChange:R=>_(R),value:p,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:R=>$(R)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>f(R),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(jt,{typesText:a,setTypesText:c})]})]})}),Ws="_subtitle_jql1y_1",Js="_header_jql1y_8",Qs="_text_jql1y_9",Ks="_productsBlock_jql1y_10",Zs="_buttonsBlock_jql1y_11",tn="_top_jql1y_23",en="_itemsBlock_jql1y_32",sn="_typeTexts_jql1y_38",nn="_block_jql1y_45",on="_active_jql1y_58",an="_products_jql1y_10",rn="_product_jql1y_10",cn="_button_jql1y_11",ln="_image_jql1y_88",dn="_info_jql1y_95",un="_name_jql1y_107",xn="_buttons_jql1y_11",mn="_modal_jql1y_118",pn="_other_jql1y_138",_n="_options_jql1y_144",hn="_addButton_jql1y_150",jn="_deleteButton_jql1y_165",Z={subtitle:Ws,header:Js,text:Qs,productsBlock:Ks,buttonsBlock:Zs,top:tn,itemsBlock:en,typeTexts:sn,block:nn,active:on,products:an,product:rn,button:cn,image:ln,info:dn,name:un,buttons:xn,modal:mn,other:pn,options:_n,addButton:hn,deleteButton:jn},vt=d=>{const{buttons:i,setButtons:e,deletable:s=!0,addable:o=!0}=d,[a,c]=g.useState(null),[l,n]=g.useState({top:0,left:0}),[r,h]=g.useState(null),p=g.useRef(null);g.useEffect(()=>{const m=()=>{c(null)};return document.body.addEventListener("click",m),c(null),()=>{c(null),document.body.removeEventListener("click",m)}},[]),g.useEffect(()=>{if(a){const m=[...i].map(f=>f.id===a.id?a:f);e(m)}},[a]),g.useEffect(()=>{if(p.current&&r){const m=p.current.getBoundingClientRect().height,f=window.innerHeight;let u=r.top;u+m>f+window.scrollY-200&&(u=f+window.scrollY-m-200),u<0&&(u=10),n({top:u,left:r.left})}},[p.current,r]);const _=(m,f)=>{m.stopPropagation();const u=m.target.getBoundingClientRect();h({top:u.top+window.scrollY,left:u.left-30}),c(f)};return t.jsxRuntimeExports.jsxs("div",{className:Z.products,children:[t.jsxRuntimeExports.jsx("h5",{className:Z.subtitle,children:"Button Type"}),i.map(m=>t.jsxRuntimeExports.jsxs("div",{className:Z.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:f=>{const $=[...i].map(L=>L.id===m.id?{...m,type:f}:L);e($)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:Z.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:Z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:f=>{_(f,m)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:Z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const f=i.filter(u=>u.id!==m.id);e(f)},width:20,height:20,fill:"#C12A2A"})})]})]},m.id)),a&&t.jsxRuntimeExports.jsx(Xs,{ref:p,activeButton:a,setActiveButton:c,popupPosition:l}),o&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:Z.button,size:"s",onClick:()=>{const m=[...i];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:Z.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},gn=d=>{const{isActiveButtons:i,setIsActiveButtons:e,buttons:s,setButtons:o}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:st.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:st.top,children:[t.jsxRuntimeExports.jsx("h3",{className:st.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(vt,{buttons:s,setButtons:o})]})})},fn="_wrapper_m18qi_1",bn="_subtitle_m18qi_7",vn="_content_m18qi_14",En="_range_m18qi_22",Rn="_track_m18qi_27",yn="_progress_m18qi_36",In="_dots_m18qi_46",kn="_dot_m18qi_46",Nn="_active_m18qi_65",$n="_input_m18qi_77",wn="_countBlock_m18qi_91",Sn="_count_m18qi_91",Cn="_controls_m18qi_107",Bn="_button_m18qi_113",Y={wrapper:fn,subtitle:bn,content:vn,range:En,track:Rn,progress:yn,dots:In,dot:kn,active:Nn,input:$n,countBlock:wn,count:Sn,controls:Cn,button:Bn},pt=d=>{const{label:i,min:e=1,max:s=4,step:o=1,count:a,setCount:c}=d,[l,n]=g.useState(!1),r=Array.from({length:(s-e)/o+1}),h=(a-e)/(s-e)*100,p=()=>{a<s&&c(a+o)},_=()=>{a>e&&c(a-o)},m=f=>{const u=e+f*o;c(u)};return t.jsxRuntimeExports.jsxs("div",{className:Y.wrapper,children:[i&&t.jsxRuntimeExports.jsx("h5",{className:Y.subtitle,children:i}),t.jsxRuntimeExports.jsxs("div",{className:Y.content,children:[t.jsxRuntimeExports.jsxs("div",{className:Y.range,children:[t.jsxRuntimeExports.jsx("div",{className:Y.track}),t.jsxRuntimeExports.jsx("div",{className:Y.progress,style:{width:`${h}%`}}),t.jsxRuntimeExports.jsx("div",{className:Y.dots,children:r.map((f,u)=>{const $=u<=(a-e)/o;return t.jsxRuntimeExports.jsx("button",{onClick:()=>m(u),className:t.clx(Y.dot,{[Y.active]:$,[Y.inactive]:!$,[Y.dragging]:l}),"aria-label":`Set value to ${e+u*o}`},u)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:o,value:a,onChange:f=>c(Number(f.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:Y.input})]}),t.jsxRuntimeExports.jsxs("div",{className:Y.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:f=>{const u=Number(f);u>s?c(s):u<e?c(e):c(u)},value:String(a)}),t.jsxRuntimeExports.jsxs("div",{className:Y.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:p,disabled:a>=s,className:Y.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:_,disabled:a<=e,className:Y.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},Tn="_title_ix5ax_1",Pn="_subtitle_ix5ax_5",Mn="_header_ix5ax_12",An="_text_ix5ax_13",On="_productsBlock_ix5ax_14",qn="_top_ix5ax_26",Ln="_itemsBlock_ix5ax_35",Dn="_typeTexts_ix5ax_41",Hn="_block_ix5ax_48",zn="_active_ix5ax_61",Fn="_products_ix5ax_14",Vn="_product_ix5ax_14",Un="_button_ix5ax_80",Yn="_image_ix5ax_91",Gn="_info_ix5ax_98",Xn="_name_ix5ax_110",Wn="_buttons_ix5ax_114",Jn="_modal_ix5ax_121",Qn="_link_ix5ax_141",Kn="_modalOptions_ix5ax_147",Zn="_addButton_ix5ax_160",to="_deleteButton_ix5ax_175",eo="_closeIcon_ix5ax_187",F={title:Tn,subtitle:Pn,header:Mn,text:An,productsBlock:On,top:qn,itemsBlock:Ln,typeTexts:Dn,block:Hn,active:zn,products:Fn,product:Vn,button:Un,image:Yn,info:Gn,name:Xn,buttons:Wn,modal:Jn,link:Qn,modalOptions:Kn,addButton:Zn,deleteButton:to,closeIcon:eo},so=d=>{const{activeItem:i,setActiveItem:e,popupPosition:s,setIsOpenModal:o,itemsOptions:a}=d,c=a.find(n=>n.id===i.listingId);if(!c)return null;function l(n,r){return n.length>r?`${n.slice(0,r)}...`:n}return t.jsxRuntimeExports.jsxs("div",{className:F.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[t.jsxRuntimeExports.jsx("h3",{children:l(c.productData.name,20)}),t.jsxRuntimeExports.jsx("div",{className:F.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{o(!1),e(null)}})})]}),t.jsxRuntimeExports.jsx("div",{className:F.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:c.productData.images.length>0?c.productData.images[0].cfId:void 0,onChange:n=>{const r={...i,image:n[0]};e(r)}})})]})};function no(d){const{product:i,children:e}=d,{attributes:s,listeners:o,setNodeRef:a,transform:c,transition:l,isDragging:n}=t.useSortable({id:String(i.listingId)}),r={transform:t.CSS.Transform.toString(c),transition:l};return t.jsxRuntimeExports.jsx("div",{ref:a,style:r,className:`${F.product} ${n?F.dragging:""}`,...s,...o,children:e})}const oo=d=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:l,editable:n=!0,draggable:r=!1,withImage:h=!1,deletable:p=!0,addable:_=!0,itemsType:m,itemsOptions:f}=d,[u,$]=g.useState(null),[L,R]=g.useState({top:0,left:0}),[I,j]=g.useState(!1),N=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));g.useEffect(()=>{const v=()=>{$(null),j(!1)};return document.body.addEventListener("click",v),$(null),j(!1),()=>{$(null),j(!1),document.body.removeEventListener("click",v)}},[]),g.useEffect(()=>{if(u){const v=[...s].map(T=>T.listingId===u.listingId?u:T);o(v)}},[u]);const z=(v,T)=>{v.stopPropagation();const S=v.target.getBoundingClientRect(),G=100,P=window.innerHeight;let D=S.top+window.scrollY;D+G>P&&(D=P-G-20),j(!0),R({top:D-80,left:S.left-30}),$(T)};function w(v){if(h)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 V=v=>{const{active:T,over:S}=v;if(S&&T.id!==S.id){const G=s.findIndex(D=>String(D.listingId)===T.id),P=s.findIndex(D=>String(D.listingId)===S.id);if(G!==-1&&P!==-1){const D=[...s],[Q]=D.splice(G,1);D.splice(P,0,Q),o(D)}}},A=(v,T)=>{const S=f.find(P=>v.listingId===P.id);if(!S)return null;const G=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:P=>{const D=[...s],Q=f.find(M=>M.productData.name===P);if(!Q)return;const nt={listingId:Q.id,image:Q.productData.images.length>0?Q.productData.images[0].cfId:""},b=D.map(M=>M.listingId===v.listingId?nt:M);$(nt),o([...b])},value:S.productData.name,options:[...f.filter(P=>!s.find(D=>D.listingId===P.id)).map(P=>P.productData.name)],leftAddon:w(v.image||S.productData.images.length>0&&S.productData.images[0].cfId||"")},T),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:P=>z(P,v)})}),p&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(P=>P!==v))})})]})]});return r?t.jsxRuntimeExports.jsx(no,{product:v,children:G},v.listingId):t.jsxRuntimeExports.jsx("div",{className:F.product,children:G},v.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:v=>e==null?void 0:e(v)})]}),I&&u&&t.jsxRuntimeExports.jsx(so,{activeItem:u,setActiveItem:$,setIsOpenModal:j,popupPosition:L,itemsOptions:f}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[l&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:l}),r?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:N,onDragEnd:V,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>String(v.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((v,T)=>A(v,T))})}):s.map((v,T)=>A(v,T)),_&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:F.button,size:"s",onClick:()=>{const v=[...s];for(let T=0;T<f.length;T++)if(!s.find(S=>S.listingId===f[T].id)){v.push({listingId:f[T].id,image:f[T].productData.images.length>0?f[T].productData.images[0].cfId:""});break}o(v)},disabled:s.length===f.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(mt,{items:a})]})},io="_options_6cemk_1",ao="_price_6cemk_12",ro="_oldPrice_6cemk_19",co="_newPrice_6cemk_27",lo="_animate_6cemk_34",uo="_appearAndBounce_6cemk_1",xo="_meta_6cemk_52",mo="_info_6cemk_58",po="_infoRight_6cemk_66",_o="_buttons_6cemk_73",ho="_variants_6cemk_80",jo="_variant_6cemk_80",go="_stock_6cemk_98",fo="_variantInfo_6cemk_105",bo="_quantity_6cemk_111",vo="_count_6cemk_118",Eo="_focused_6cemk_135",Ro="_button_6cemk_73",yo="_activeVariant_6cemk_161",Io="_chargeTypes_6cemk_165",ko="_charge_6cemk_165",No="_chargeActive_6cemk_190",$o="_title_6cemk_198",k={options:io,price:ao,oldPrice:ro,newPrice:co,animate:lo,appearAndBounce:uo,meta:xo,info:mo,infoRight:po,buttons:_o,variants:ho,variant:jo,stock:go,variantInfo:fo,quantity:bo,count:vo,focused:Eo,button:Ro,activeVariant:yo,chargeTypes:Io,charge:ko,chargeActive:No,title:$o},wo="_wrapper_c1dht_1",So="_label_c1dht_9",Co="_input_c1dht_18",Bo="_paddingless_c1dht_31",To="_content_c1dht_35",Po="_contentBorder_c1dht_47",Mo="_borderless_c1dht_52",Ao="_rightIcon_c1dht_57",K={wrapper:wo,label:So,input:Co,paddingless:Bo,content:To,contentBorder:Po,borderless:Mo,rightIcon:Ao},Et=d=>{const{onChange:i,style:e,label:s,value:o,type:a,min:c,max:l,placeholder:n,disabled:r=!1,required:h=!1,regex:p,paddingless:_=!1,borderless:m=!1,editable:f=!1,isSearch:u=!1,centered:$=!1}=d,{themeSettings:L}=t.useThemeSettingsStore(),{inputs:R}=L,[I,j]=g.useState(!1);function N(w){return Number(w)<0?String(c):w}function z(w){return!h||!p?!0:new RegExp(p).test(w)}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:K.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(K.content,{[K.contentBorder]:R.border.active}),style:{...e,background:R.field.active?R.field.color:"transparent",padding:u?`7px ${Number(R.general.size)+20}px 7px 11px`:"7px 11px"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:a||"text",onChange:w=>{if(a==="text")i(w.target.value);else{const V=N(w.target.value);i(V)}},value:o,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(K.input,{[K.required]:I&&h&&!z(o),[K.paddingless]:_,[K.borderless]:m}),min:a==="number"?c:void 0,max:a==="number"?l:void 0,disabled:r,onFocus:()=>j(!0),style:{textAlign:$?"center":"left"}}),u&&t.jsxRuntimeExports.jsx("div",{className:K.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:R.general.size,height:R.general.size})}),f&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},Oo="_button_85085_1",qo="_primary_85085_20",Lo="_primaryHovered_85085_30",Do="_secondary_85085_34",Ho="_secondaryHovered_85085_44",zo="_tertiary_85085_48",Fo="_tertiaryHovered_85085_58",Vo="_content_85085_62",tt={button:Oo,primary:qo,primaryHovered:Lo,secondary:Do,secondaryHovered:Ho,tertiary:zo,tertiaryHovered:Fo,content:Vo},J=d=>{const{children:i,onClick:e,style:s,className:o,disabled:a=!1,type:c="Primary"}=d,{themeSettings:l}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(tt.button,o,{[tt.primary]:c==="Primary",[tt.secondary]:c==="Secondary",[tt.tertiary]:c==="Tertiary",[tt.primaryHovered]:c==="Primary"&&!a&&l.buttons.primary.hover,[tt.secondaryHovered]:c==="Secondary"&&!a&&l.buttons.secondary.hover,[tt.tertiaryHovered]:c==="Tertiary"&&!a&&l.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:a,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:tt.content,children:[i,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"var(--icon-tertiary)",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:i})})};var Rt=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(Rt||{});const Uo=d=>{var R,I;const{variants:i}=d,[e,s]=g.useState(i[0]),[o,a]=g.useState(e.chargeTypes[0]),c=t.useNavigate(),[l,n]=g.useState(1),{reset:r,addProductToCart:h,getProducts:p}=t.useCart(),[_,m]=g.useState(!1);g.useEffect(()=>{m(!0);const j=setTimeout(()=>m(!1),600);return()=>clearTimeout(j)},[l]);async function f(){await p(),await h({productId:d.id,productVariantId:e.id,quantity:l})}function u(){r(),f(),c("/checkout")}function $(j){if(j>=864e5){const A=Math.floor(j/864e5);return`${A} ${A===1?"day":"days"}`}else if(j>=36e5){const A=Math.floor(j/36e5);return`${A} ${A===1?"hour":"hours"}`}else if(j>=6e4){const A=Math.floor(j/6e4);return`${A} ${A===1?"minute":"minutes"}`}else{const A=Math.floor(j/1e3);return`${A} ${A===1?"second":"seconds"}`}}function L(j,N){return j.length>N?j.slice(0,N)+"...":j}return t.jsxRuntimeExports.jsxs("div",{className:k.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:k.chargeTypes,children:e.chargeTypes.map(j=>t.jsxRuntimeExports.jsx("div",{className:t.clx(k.charge,{[k.chargeActive]:o===j}),onClick:()=>a(j),children:Rt[j]},j))}),t.jsxRuntimeExports.jsx("div",{className:k.variants,children:i.map(j=>{var N;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(k.variant,{[k.activeVariant]:e.id===j.id}),onClick:()=>s(j),children:[t.jsxRuntimeExports.jsxs("div",{className:k.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:k.title,children:L(j.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?j.price.amount:j.subscriptionSettings?j.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:k.stock,children:[((N=j.quantity.restrictions)==null?void 0:N.max)||j.quantity.available||0," in stock"]})})]},j.id)})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:k.quantity,children:[t.jsxRuntimeExports.jsx(J,{type:"Secondary",onClick:()=>{l>1?n(j=>j-1):n(1)},className:k.button,disabled:e.quantity.restrictions&&l<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(Et,{type:"number",value:String(l),onChange:j=>n(Number(j)),max:((R=e.quantity.restrictions)==null?void 0:R.max)||e.quantity.available||1/0,min:((I=e.quantity.restrictions)==null?void 0:I.min)||0,centered:!0}),t.jsxRuntimeExports.jsx(J,{type:"Secondary",onClick:()=>{n(j=>j+1)},className:k.button,disabled:!!(e.quantity.restrictions&&l>=e.quantity.restrictions.max||e.quantity.available&&l>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:k.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:k.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":$(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:k.infoRight,children:o==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:_}),children:["$ ",(e.price.amount||0)*l]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*l]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:_}),children:["$ ",(e.price.amount||0)*l]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:_}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:_}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[t.jsxRuntimeExports.jsx(J,{type:"Primary",onClick:()=>u(),children:o==="ONE_TIME"?"Buy Now":"Subscribe Now"}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsx(J,{type:"Secondary",onClick:()=>f(),children:"Add to Cart"})]})]})},Yo="_button_1tdo3_1",Go="_login_1tdo3_14",Xo="_signUp_1tdo3_18",Wo="_buttons_1tdo3_23",Jo="_modal_1tdo3_32",Qo="_closing_1tdo3_64",Ko="_info_1tdo3_113",Zo="_top_1tdo3_120",ti="_title_1tdo3_131",ei="_clear_1tdo3_138",si="_activeClear_1tdo3_145",ni="_count_1tdo3_149",oi="_cart_1tdo3_164",ii="_empty_1tdo3_172",ai="_product_1tdo3_198",ri="_products_1tdo3_207",ci="_image_1tdo3_215",li="_productInfo_1tdo3_221",di="_content_1tdo3_228",ui="_name_1tdo3_234",xi="_price_1tdo3_240",mi="_productButtons_1tdo3_246",pi="_productButton_1tdo3_246",_i="_productCount_1tdo3_266",hi="_bottom_1tdo3_282",ji="_subtotal_1tdo3_290",gi="_block_1tdo3_298",fi="_shoppingCount_1tdo3_305",bi="_total_1tdo3_325",vi="_link_1tdo3_331",Ei="_userInfo_1tdo3_338",Ri="_pagesMobileModal_1tdo3_349",yi="_pagesMobileModalContent_1tdo3_363",Ii="_pagesMobileModalHeader_1tdo3_369",ki="_pagesMobileModalFooter_1tdo3_379",y={button:Yo,login:Go,signUp:Xo,buttons:Wo,modal:Jo,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:Qo,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Ko,top:Zo,title:ti,clear:ei,activeClear:si,count:ni,cart:oi,empty:ii,product:ai,products:ri,image:ci,productInfo:li,content:di,name:ui,price:xi,productButtons:mi,productButton:pi,productCount:_i,bottom:hi,subtotal:ji,block:gi,shoppingCount:fi,total:bi,link:vi,userInfo:Ei,pagesMobileModal:Ri,pagesMobileModalContent:yi,pagesMobileModalHeader:Ii,pagesMobileModalFooter:ki};class dt extends Error{}dt.prototype.name="InvalidTokenError";function Ni(d){return decodeURIComponent(atob(d).replace(/(.)/g,(i,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function $i(d){let i=d.replace(/-/g,"+").replace(/_/g,"/");switch(i.length%4){case 0:break;case 2:i+="==";break;case 3:i+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Ni(i)}catch{return atob(i)}}function wi(d,i){if(typeof d!="string")throw new dt("Invalid token specified: must be a string");i||(i={});const e=i.header===!0?0:1,s=d.split(".")[e];if(typeof s!="string")throw new dt(`Invalid token specified: missing part #${e+1}`);let o;try{o=$i(s)}catch(a){throw new dt(`Invalid token specified: invalid base64 for part #${e+1} (${a.message})`)}try{return JSON.parse(o)}catch(a){throw new dt(`Invalid token specified: invalid json for part #${e+1} (${a.message})`)}}const Si=d=>{const{shopping:i,signUp:e,isShowUserInfo:s=!0}=d;return t.jsxRuntimeExports.jsxs("div",{className:y.buttons,children:[i&&t.jsxRuntimeExports.jsx(yt,{}),s&&t.jsxRuntimeExports.jsx(ft,{signUp:e})]})},yt=()=>{const[d,i]=g.useState(!1),[e,s]=g.useState([]),{cart:o,getProducts:a}=t.useCart();function c(_){for(let m=0;m<o.parts.length;m++)for(let f=0;f<_.variants.length;f++)if(o.parts[m].productVariantId===_.variants[m].id)return o.parts[m].productVariantId}function l(_){for(let m=0;m<o.parts.length;m++)for(let f=0;f<_.variants.length;f++)if(o.parts[m].productVariantId===_.variants[m].id)return o.parts[m].quantity}g.useEffect(()=>{(async()=>{const m=o.parts.map($=>String($.productId)),u=(await a([...m])).map($=>({...$,activeVariantId:c($),quantity:l($)}));s(u)})()},[o.parts.length]);function n(_){var m;return!_||!(_!=null&&_.variants)?!1:(m=_.variants.find(f=>f.id===_.activeVariantId))==null?void 0:m.subscriptionSettings}const r=o.parts.length>0&&e.length>0&&!n(e[0]),[h,p]=g.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(J,{type:"Secondary",style:{padding:10},onClick:_=>{_.stopPropagation(),window.location.pathname!=="/admin/builder"&&(i(!0),p(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),r&&t.jsxRuntimeExports.jsx("div",{className:y.shoppingCount,children:o.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{p(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(It,{activeProducts:e,isCartNotEmpty:r,isOpen:h})})]})},It=d=>{const{activeProducts:i,isCartNotEmpty:e,isOpen:s}=d,{cart:o,reset:a,getTotalAndDiscount:c,updateQuantityOfProduct:l}=t.useCart(),n=t.useNavigate();function r(_){n(_)}function h(_){l({productId:_.id,productVariantId:_.activeVariantId,quantity:_.quantity+1})}function p(_){l({productId:_.id,productVariantId:_.activeVariantId,quantity:_.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(y.modal,{[y.closing]:!s}),onClick:_=>_.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:y.top,children:[t.jsxRuntimeExports.jsxs("div",{className:y.info,children:[t.jsxRuntimeExports.jsx("span",{className:y.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:y.count,children:o.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(y.clear,{[y.activeClear]:e}),disabled:!e,onClick:a,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:y.cart,children:[t.jsxRuntimeExports.jsx("div",{className:y.products,children:i.map(_=>t.jsxRuntimeExports.jsxs("div",{className:y.product,children:[t.jsxRuntimeExports.jsxs("div",{className:y.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${_.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:y.image}),t.jsxRuntimeExports.jsxs("div",{className:y.content,children:[t.jsxRuntimeExports.jsx("div",{className:y.name,children:_.name}),t.jsxRuntimeExports.jsxs("div",{className:y.price,children:["$",_.variants.find(m=>m.id===_.activeVariantId).price.amount*((_==null?void 0:_.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:y.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{_.quantity!==1&&p(_)},className:y.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:y.productCount,children:_.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>h(_),className:y.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},_.id))}),t.jsxRuntimeExports.jsxs("div",{className:y.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:y.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:y.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:y.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(J,{onClick:()=>r("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(kt,{})]})},kt=()=>t.jsxRuntimeExports.jsxs("div",{className:y.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:y.link,children:"view products"})]})]}),ft=({signUp:d})=>{const i=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=i,s=t.useNavigate();function o(l){s(l)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(J,{onClick:()=>o("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),d&&t.jsxRuntimeExports.jsx(J,{onClick:()=>o("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[a,c]=g.useState("test-email@gmail.com");return g.useEffect(()=>{(async()=>{const n=wi(e);c(n.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:y.userInfo,onClick:()=>o("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:a||"test-email@gmail.com"})})},Nt=({children:d,logo:i,setIsOpen:e,signUp:s})=>{const{setIsOpen:o}=t.useModalStore(),a=()=>{o(!1),setTimeout(()=>{e(!1),o(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:y.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:y.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(J,{type:"Secondary",onClick:a,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:y.pagesMobileModalContent,children:d}),t.jsxRuntimeExports.jsx("div",{className:y.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(ft,{signUp:s})})]})},Ci=({children:d,logo:i,signUp:e})=>{const[s,o]=g.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx($t,{setIsOpenModal:o}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>o(!1),children:t.jsxRuntimeExports.jsx(Nt,{logo:i,setIsOpen:o,signUp:e,children:d})})]})},$t=d=>{const{setIsOpenModal:i}=d;return t.jsxRuntimeExports.jsx(J,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Bi="_share_xddz7_1",Ti="_modal_xddz7_8",Pi="_header_xddz7_20",Mi="_socials_xddz7_30",Ai="_social_xddz7_30",Oi="_copy_xddz7_40",qi="_title_xddz7_47",Li="_copyWrapper_xddz7_53",Di="_copyText_xddz7_62",Hi="_copyTextMobile_xddz7_75",zi="_copyTextMiniMobile_xddz7_94",et={share:Bi,modal:Ti,header:Pi,socials:Mi,social:Ai,copy:Oi,title:qi,copyWrapper:Li,copyText:Di,copyTextMobile:Hi,copyTextMiniMobile:zi},Fi=()=>{const{isOpenModal:d,setIsOpenModal:i}=t.useShareLinkStore();function e(){i(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:et.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:i,children:t.jsxRuntimeExports.jsx(Vi,{})})]})},Vi=()=>{const{setIsOpenModal:d}=t.useShareLinkStore(),{notification:i,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),o=window.location.href;function a(){navigator.clipboard.writeText(o),e({message:"Link copied to clipboard",status:"success"})}function c(){s(!1),setTimeout(()=>{d(!1),s(!0)},300)}function l(n,r){return n.length>r?n.slice(0,r)+"...":n}return t.jsxRuntimeExports.jsxs("div",{className:et.modal,onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:et.header,children:[t.jsxRuntimeExports.jsx("div",{className:et.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:c,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:et.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:a,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:et.copyText,children:l(o,100)}),t.jsxRuntimeExports.jsx("div",{className:et.copyTextMobile,children:l(o,40)}),t.jsxRuntimeExports.jsx("div",{className:et.copyTextMiniMobile,children:l(o,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:a,children:i?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},Ui="_accordion_1s1lq_1",Yi="_header_1s1lq_9",Gi="_icon_1s1lq_18",Xi="_open_1s1lq_21",Wi="_content_1s1lq_25",lt={accordion:Ui,header:Yi,icon:Gi,open:Xi,content:Wi},Ji=({title:d,content:i,defaultOpen:e=!1})=>{const[s,o]=g.useState(e),[a,c]=g.useState(0),l=g.useRef(null),n=()=>{o(!s)};return g.useEffect(()=>{l.current&&c(s?l.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:lt.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:lt.header,onClick:n,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(lt.icon,{[lt.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:l,className:lt.content,style:{height:`${a}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},Qi=({children:d,path:i,className:e,target:s="_self",id:o})=>{const a=t.useNavigate(),c=/^https?:\/\//.test(i),l=n=>{c||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.location.href=i:(n.preventDefault(),a(i,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:l,className:e,role:"link",style:{cursor:"pointer"},id:o,children:d})},Ki="_wrapper_st58d_1",Zi="_label_st58d_10",ta="_textarea_st58d_18",ea="_length_st58d_33",xt={wrapper:Ki,label:Zi,textarea:ta,length:ea},sa=d=>{const{onChange:i,label:e,value:s,maxLength:o,placeholder:a="Type something..."}=d,[c,l]=g.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:xt.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:xt.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{l(n.target.value.length),i(n.target.value)},placeholder:a,className:xt.textarea,maxLength:o}),o&&t.jsxRuntimeExports.jsxs("div",{className:xt.length,children:[c,"/",o]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=Ji;exports.BurgerMenuButton=$t;exports.Button=J;exports.ButtonTypeSettings=vt;exports.ButtonsSettings=gn;exports.CategorySettings=Ke;exports.EmptyCart=kt;exports.FormSettings=Is;exports.HeaderButtons=Si;exports.InputUI=Et;exports.ItemsSettings=bt;exports.LayoutSettings=Ft;exports.Link=Qi;exports.ListingSelector=oo;exports.PagesMobileMenu=Ci;exports.PagesMobileModal=Nt;exports.ProductOptions=Uo;exports.RangeSelector=pt;exports.ShareLink=Fi;exports.ShoppingButton=yt;exports.ShoppingModalCart=It;exports.TextSettings=gt;exports.TextareaUI=sa;exports.TypesText=jt;exports.UserInfo=ft;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DFHUslAr.cjs"),h=require("react");require("@phosphor-icons/react");const wt="_wrapper_1ibay_2",Ct="_alignmentBlock_1ibay_8",Bt="_title_1ibay_15",Tt="_subtitle_1ibay_22",Pt="_alignmentContent_1ibay_29",At="_alignments_1ibay_37",Mt="_alignment_1ibay_8",Ot="_circle_1ibay_60",qt="_paddings_1ibay_67",Dt="_padding_1ibay_67",Ut="_active_1ibay_91",Lt="_input_1ibay_98",J={wrapper:wt,alignmentBlock:Ct,title:Bt,subtitle:Tt,alignmentContent:Pt,alignments:At,alignment:Mt,circle:Ot,paddings:qt,padding:Dt,active:Ut,input:Lt},Ht=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],zt=["left","top","right","bottom"],Ft=u=>{const{alignment:a,padding:e,setPadding:s,setAlignment:i}=u;function r(_){switch(_){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 c(_){switch(_){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,n]=h.useState(null),[d,b]=h.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:J.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:J.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:J.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:J.alignments,children:Ht.map(_=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(_)},className:J.alignment,onMouseEnter:()=>{n(_)},onMouseLeave:()=>{n(null)},children:[_!==a&&o!==_&&t.jsxRuntimeExports.jsx("div",{className:J.circle}),_!==a&&o===_&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(o),fill:"#c2c2c2",width:22,height:22}),_===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(a),fill:"#FF3F19",width:22,height:22})]},_))}),t.jsxRuntimeExports.jsx("div",{className:J.paddings,children:zt.map(_=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(J.padding,{[J.active]:d===_}),onFocus:()=>{b(_)},onBlur:()=>{b(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(_),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[_]),onChange:l=>s({...e,[_]:Number(l)}),paddingless:!0,borderless:!0})]},_))})]})]})]})},Vt="_title_1jkiw_1",Yt="_subtitle_1jkiw_5",Gt="_header_1jkiw_12",Xt="_text_1jkiw_13",Wt="_top_1jkiw_20",Jt="_itemsBlock_1jkiw_29",ct={title:Vt,subtitle:Yt,header:Gt,text:Xt,top:Wt,itemsBlock:Jt},Qt="_typeTexts_167ez_1",Kt="_block_167ez_8",Zt="_active_167ez_25",ht={typeTexts:Qt,block:Kt,active:Zt},te=["bold","italic","underline","strike-through","code"],gt=u=>{const{typesText:a,setTypesText:e}=u;function s(i){switch(i){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:ht.typeTexts,children:te.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(ht.block,{[ht.active]:a.includes(i)}),onClick:()=>{const r=[...a];if(r.includes(i)){const c=r.filter(o=>o!==i);e(c)}else r.push(i),e(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(i),fill:a.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},lt={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Paragraph"},ft=u=>{const{typesText:a,isActiveText:e,setIsActiveText:s,text:i,setText:r,setTypesText:c,title:o,subtitle:n="Items",typeFont:d,setTypeFont:b}=u;return t.jsxRuntimeExports.jsxs("div",{className:ct.text,children:[(o||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:ct.top,children:[o&&t.jsxRuntimeExports.jsx("h3",{className:ct.title,children:o}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:_=>s(_)})]}),t.jsxRuntimeExports.jsxs("div",{className:ct.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:ct.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:_=>r(_),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:a,setTypesText:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Type Text",options:Object.values(lt).filter(_=>_!==lt[d]),onChange:_=>b(Object.keys(lt).find(l=>lt[l]===_)),value:lt[d]})]})]})},ee="_title_pef24_1",se="_subtitle_pef24_5",ne="_header_pef24_12",ie="_text_pef24_13",oe="_productsBlock_pef24_14",ae="_top_pef24_26",re="_itemsBlock_pef24_35",ce="_typeTexts_pef24_41",le="_block_pef24_48",de="_active_pef24_61",ue="_products_pef24_14",xe="_product_pef24_14",me="_button_pef24_80",pe="_disabled_pef24_91",_e="_image_pef24_95",he="_info_pef24_102",je="_name_pef24_114",ge="_buttons_pef24_118",fe="_modal_pef24_125",be="_link_pef24_145",ve="_modalOptions_pef24_151",Ee="_addButton_pef24_164",Re="_deleteButton_pef24_179",ye="_closeIcon_pef24_191",H={title:ee,subtitle:se,header:ne,text:ie,productsBlock:oe,top:ae,itemsBlock:re,typeTexts:ce,block:le,active:de,products:ue,product:xe,button:me,disabled:pe,image:_e,info:he,name:je,buttons:ge,modal:fe,link:be,modalOptions:ve,addButton:Ee,deleteButton:Re,closeIcon:ye},Ie=h.forwardRef((u,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=u;function o(n,d){return n.length>d?`${n.slice(0,d)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:a,className:H.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:o(e.name["en-US"],20)}),t.jsxRuntimeExports.jsx("div",{className:H.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:r.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:d=>{const b={...e,[n.field]:d};s(b)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[n.field.type],setTypesText:d=>{const b={...e,[n.field.type]:d};s(b)},text:e[n.field.text]["en-US"]||"",setText:d=>{const b={...e,[n.field.text]:{"en-US":d}};s(b)},typeFont:e[n.field.typeFont],setTypeFont:d=>{const b={...e,[n.field.typeFont]:d};s(b)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:d=>{const b={...e,[n.field]:d};s(b)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:d=>{const b={...e,[n.field.text]:d};s(b)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:d=>{const b={...e,[n.field.switch]:d};s(b)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(vt,{items:e[n.field]||[],setItems:d=>{const b={...e,[n.field]:d};s(b)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:n.editable||!1,subtitle:n.label,addableOptions:n.addableOptions,modalOptions:n.modalOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:d=>{const b={...e,[n.field]:d};s(b)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]}),switcher:n.switcher?{value:!!e[n.switcher],onChange:d=>{if(n.switcher==="isActive"){const b={...e,[n.switcher]:d};s(b)}}}:void 0})})})]})}),ke="_other_g74jx_1",Se="_subtitle_g74jx_7",$e="_items_g74jx_14",jt={other:ke,subtitle:Se,items:$e},pt=u=>{const{items:a,title:e="Other"}=u;return t.jsxRuntimeExports.jsxs("div",{className:jt.other,children:[t.jsxRuntimeExports.jsx("h5",{className:jt.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:jt.items,children:a.map((s,i)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:r=>s.setIsItem(r),label:s.label,hasBackground:!0,paddingless:!1},i))})]})};function Ne({product:u,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:u.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${H.product} ${o?H.dragging:""}`,...e,...s,children:a})}const vt=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:d=!1,withImage:b=!1,deletable:_=!0,addable:l=!0,itemsType:v,itemsPlaceholder:p="",itemsOptions:x,hasRangeSelector:k=!1,rangeSelectorOptions:D,modalOptions:R,addableOptions:j={},limit:N,autoInterval:M}=u,[z,w]=h.useState(null),[f,B]=h.useState({top:0,left:0}),[g,y]=h.useState(null),S=h.useRef(null),[U,T]=h.useState(!1),q=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const m=()=>{w(null),T(!1)};return document.body.addEventListener("click",m),w(null),T(!1),()=>{w(null),T(!1),document.body.removeEventListener("click",m)}},[]),h.useEffect(()=>{if(z){const m=[...s].map(I=>I.id===z.id?z:I);i(m)}},[z]),h.useEffect(()=>{if(S.current&&g){const m=S.current.getBoundingClientRect().height,I=window.innerHeight;let P=g.top;P+m>I+window.scrollY-200&&(P=I+window.scrollY-m-200),P<0&&(P=10),B({top:P,left:g.left})}},[S.current,g]);const K=(m,I)=>{m.stopPropagation();const P=m.target.getBoundingClientRect();y({top:P.top+window.scrollY-70,left:P.left-(l?30:65)}),w(I),T(!0)};function it(m){if(b)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const E=m=>{const{active:I,over:P}=m;if(P&&I.id!==P.id){const L=s.findIndex(A=>A.id===I.id),Y=s.findIndex(A=>A.id===P.id);if(L!==-1&&Y!==-1){const A=[...s],[ot]=A.splice(L,1);A.splice(Y,0,ot),i(A)}}},O=(m,I)=>{var L,Y;const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&x&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const ot=[...s],rt=x.find(xt=>xt.name["en-US"]===A);if(!rt)return;const at=ot.map(xt=>xt.id===m.id?{...rt,name:{"en-US":A}}:xt);w({...m,name:{"en-US":A}}),i([...at])},value:m.name["en-US"],options:x.filter(A=>!s.find(ot=>ot.name["en-US"]===A.name["en-US"])).map(A=>A.name["en-US"]),leftAddon:it(m.images)}),v==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const rt=[...s].map(at=>at.id===m.id?{...m,name:{"en-US":A}}:at);i([...rt])},value:m.name["en-US"],placeholder:p}),v==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const rt=[...s].map(at=>at.id===m.id?{...m,images:A}:at);i([...rt])},activeImage:(L=s.find(A=>A.id===m.id))!=null&&L.images?(Y=s.find(A=>A.id===m.id))==null?void 0:Y.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>{console.log(A,m),K(A,m)}})}),_&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(A=>A.id!==m.id))})})]})]});return d?t.jsxRuntimeExports.jsx(Ne,{product:m,index:I,children:P},m.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:P},m.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:m=>e==null?void 0:e(m)})]}),z&&n&&R&&U&&t.jsxRuntimeExports.jsx(Ie,{ref:S,activeItem:z,setActiveItem:w,popupPosition:f,modalOptions:R,setIsOpenModal:T}),k&&D&&t.jsxRuntimeExports.jsx(_t,{...D}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:o}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:q,onDragEnd:E,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(m=>m.id),strategy:t.verticalListSortingStrategy,children:s.map((m,I)=>O(m,I))})}):s.map((m,I)=>O(m,I)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(N&&N<=s.length||s.length===(x==null?void 0:x.length))}),size:"s",disabled:!!(N&&N<=s.length||s.length===(x==null?void 0:x.length)),onClick:()=>{const m=[...s];let I=null;if(x){for(let P=0;P<x.length;P++)if(!s.find(L=>L.id===x[P].id)){I=x[P];break}}v==="select"&&x?m.push({name:I?I.name:x[0].name,id:(I==null?void 0:I.id)||x[0].id,...j}):v==="input"?m.push({name:{"en-US":""},id:t.v4(),...j}):m.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...j}),i(m)},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!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r}),M!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:M.title||"Auto scroll interval",type:"number",value:String(M.autoInterval),onChange:m=>M.setAutoInterval(Number(m)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},we="_title_82zux_1",Ce="_subtitle_82zux_5",Be="_header_82zux_12",Te="_text_82zux_13",Pe="_productsBlock_82zux_14",Ae="_top_82zux_26",Me="_itemsBlock_82zux_35",Oe="_typeTexts_82zux_41",qe="_block_82zux_48",De="_active_82zux_61",Ue="_products_82zux_14",Le="_product_82zux_14",He="_button_82zux_80",ze="_disabled_82zux_91",Fe="_image_82zux_95",Ve="_info_82zux_102",Ye="_name_82zux_114",Ge="_buttons_82zux_118",Xe="_modal_82zux_125",We="_link_82zux_145",Je="_modalOptions_82zux_151",Qe="_addButton_82zux_157",Ke="_deleteButton_82zux_179",Q={title:we,subtitle:Ce,header:Be,text:Te,productsBlock:Pe,top:Ae,itemsBlock:Me,typeTexts:Oe,block:qe,active:De,products:Ue,product:Le,button:He,disabled:ze,image:Fe,info:Ve,name:Ye,buttons:Ge,modal:Xe,link:We,modalOptions:Je,addButton:Qe,deleteButton:Ke},Ze=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,draggable:n=!1,withImage:d=!1,addable:b=!0,itemsOptions:_,hasRangeSelector:l=!1,rangeSelectorOptions:v,limit:p,autoScrollInterval:x,deletable:k}=u;function D(j){if(d)return j?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${j[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const R=(j,N=!1)=>{const M=_.find(w=>w.id===j);if(!M)return;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:w=>{const f=[...s],B=_.find(S=>S.name===w);if(!B)return;const g=B.id,y=f.map(S=>S===j?g:S);i([...y])},value:M.name,options:_.filter(w=>!s.find(f=>f===w.id)).map(w=>w.name),leftAddon:D(M.images)}),N&&t.jsxRuntimeExports.jsx("div",{className:Q.buttons,children:t.jsxRuntimeExports.jsx("div",{className:Q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(w=>w!==j))})})})]});return t.jsxRuntimeExports.jsx("div",{className:Q.product,children:z},j)};return t.jsxRuntimeExports.jsxs("div",{className:Q.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:Q.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:Q.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:j=>e==null?void 0:e(j)})]}),l&&v&&t.jsxRuntimeExports.jsx(_t,{...v}),t.jsxRuntimeExports.jsxs("div",{className:Q.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:Q.subtitle,children:o}),s.map(j=>R(j,k)),b&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(Q.button,{[Q.disabled]:!!(p&&p<=s.length||s.length===_.length)}),size:"s",disabled:!!(p&&p<=s.length||s.length===_.length),onClick:()=>{const j=[...s];let N=null;if(_){for(let M=0;M<_.length;M++)if(!s.find(z=>z===_[M].id)){N=_[M];break}}j.push((N==null?void 0:N.id)||_[0].id),i(j)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:Q.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r}),x!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(x.scrollInterval),onChange:j=>x.setScrollInterval(Number(j)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},ts="_title_roi3a_1",es="_subtitle_roi3a_5",ss="_header_roi3a_12",ns="_text_roi3a_13",is="_productsBlock_roi3a_14",os="_top_roi3a_26",as="_itemsBlock_roi3a_35",rs="_typeTexts_roi3a_41",cs="_block_roi3a_48",ls="_active_roi3a_61",ds="_products_roi3a_14",us="_product_roi3a_14",xs="_button_roi3a_80",ms="_disabled_roi3a_91",ps="_image_roi3a_95",_s="_info_roi3a_102",hs="_name_roi3a_114",js="_buttons_roi3a_118",gs="_modal_roi3a_125",fs="_link_roi3a_145",bs="_modalOptions_roi3a_151",vs="_addButton_roi3a_164",Es="_deleteButton_roi3a_179",Rs="_closeIcon_roi3a_191",X={title:ts,subtitle:es,header:ss,text:ns,productsBlock:is,top:os,itemsBlock:as,typeTexts:rs,block:cs,active:ls,products:ds,product:us,button:xs,disabled:ms,image:ps,info:_s,name:hs,buttons:js,modal:gs,link:fs,modalOptions:bs,addButton:vs,deleteButton:Es,closeIcon:Rs};function ys({product:u,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:u.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${X.product} ${o?X.dragging:""}`,...e,...s,children:a})}const Is=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,title:r,subtitle:c,editable:o=!0,draggable:n=!1,deletable:d=!0,addable:b=!0,itemsType:_,itemsOptions:l,addableOptions:v={},limit:p}=u,[x,k]=h.useState(null),[D,R]=h.useState(null),j=h.useRef(null),N=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{if(x){const f=[...s].map(B=>B.id===x.id?x:B);i(f)}},[x]),h.useEffect(()=>{j.current&&D&&(j.current.getBoundingClientRect().height,D.top)},[j.current,D]);const M=(f,B)=>{f.stopPropagation();const g=f.target.getBoundingClientRect();R({top:g.top+window.scrollY,left:g.left-30}),k(B)},z=f=>{const{active:B,over:g}=f;if(g&&B.id!==g.id){const y=s.findIndex(U=>U.id===B.id),S=s.findIndex(U=>U.id===g.id);if(y!==-1&&S!==-1){const U=[...s],[T]=U.splice(y,1);U.splice(S,0,T),i(U)}}},w=(f,B)=>{const g=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),_==="select"&&l&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const S=[...s],U=l.find(q=>q.name===y);if(!U)return;const T=S.map(q=>q.id===f.id?{...U,name:{"en-US":y}}:q);k({...f,name:{"en-US":y}}),i([...T])},value:f.name,options:l.filter(y=>!s.find(S=>S.name===y.name)).map(y=>y.name)}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>M(y,f)})}),d&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(y=>y.id!==f.id))})})]})]});return n?t.jsxRuntimeExports.jsx(ys,{product:f,index:B,children:g},f.id):t.jsxRuntimeExports.jsx("div",{className:X.product,children:g},f.id)};return t.jsxRuntimeExports.jsxs("div",{className:X.productsBlock,children:[(r||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:X.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:X.title,children:r}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:f=>e==null?void 0:e(f)})]}),t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:c}),n?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:N,onDragEnd:z,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(f=>f.id),strategy:t.verticalListSortingStrategy,children:s.map((f,B)=>w(f,B))})}):s.map((f,B)=>w(f,B)),b&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(X.button,{[X.disabled]:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length))}),size:"s",disabled:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length)),onClick:()=>{const f=[...s];let B=null;if(l){for(let g=0;g<l.length;g++)if(!s.find(y=>y.id===l[g].id)){B=l[g];break}}_==="select"&&l&&f.push({name:B?B.name:l[0].name,id:(B==null?void 0:B.id)||l[0].id,...v}),i(f)},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})]})})})]})]})},ks="_title_1vfw9_1",Ss="_subtitle_1vfw9_5",$s="_header_1vfw9_12",Ns="_text_1vfw9_13",ws="_productsBlock_1vfw9_14",Cs="_top_1vfw9_26",Bs="_itemsBlock_1vfw9_35",Ts="_typeTexts_1vfw9_41",Ps="_block_1vfw9_48",As="_active_1vfw9_61",Ms="_products_1vfw9_14",Os="_product_1vfw9_14",qs="_button_1vfw9_80",Ds="_disabled_1vfw9_91",Us="_image_1vfw9_95",Ls="_info_1vfw9_102",Hs="_name_1vfw9_114",zs="_buttons_1vfw9_118",Fs="_modal_1vfw9_125",Vs="_link_1vfw9_145",Ys="_modalOptions_1vfw9_151",Gs="_addButton_1vfw9_164",Xs="_deleteButton_1vfw9_179",Ws="_closeIcon_1vfw9_191",F={title:ks,subtitle:Ss,header:$s,text:Ns,productsBlock:ws,top:Cs,itemsBlock:Bs,typeTexts:Ts,block:Ps,active:As,products:Ms,product:Os,button:qs,disabled:Ds,image:Us,info:Ls,name:Hs,buttons:zs,modal:Fs,link:Vs,modalOptions:Ys,addButton:Gs,deleteButton:Xs,closeIcon:Ws},Js=h.forwardRef((u,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=u;return t.jsxRuntimeExports.jsxs("div",{ref:a,className:F.modal,onClick:o=>{o.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:e.name["en-US"]}),t.jsxRuntimeExports.jsx("div",{className:F.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:F.modalOptions,children:r.map(o=>{if(o.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[o.field],onChange:n=>{const d={...e,[o.field]:n};s(d)}},String(o.field));if(o.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[o.field.type],setTypesText:n=>{const d={...e,[o.field.type]:n};s(d)},text:e[o.field.text]["en-US"]||"",setText:n=>{const d={...e,[o.field.text]:{"en-US":n}};s(d)},typeFont:e[o.field.type],setTypeFont:n=>{const d={...e,[o.field.type]:n};s(d)},subtitle:o.label});if(o.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const d={...e,[o.field]:n};s(d)},value:e[o.field]||"",label:o.label,placeholder:o.placeholder});if(o.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:F.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const d={...e,[o.field.text]:n};s(d)},value:e[o.field.text]||"",label:o.inputLabel,placeholder:o.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[o.field.switch]||!1,label:o.switchLabel,onChange:n=>{const d={...e,[o.field.switch]:n};s(d)}})]});if(o.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:o.itemsOptions,onChange:n=>{const d={...e,[o.field]:n};s(d)},label:o.label,value:e[o.field]||"String",leftAddon:o.leftAddon&&o.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[o.field]})})})})]})});function Qs(u){const{product:a,children:e}=u,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:a.id}),d={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:d,className:`${F.product} ${n?F.dragging:""}`,...s,...i,children:e})}const Ks=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:d=!1,withImage:b=!1,deletable:_=!0,addable:l=!0,itemsType:v,itemsPlaceholder:p="",itemsOptions:x,hasRangeSelector:k=!1,rangeSelectorOptions:D,modalOptions:R,addableOptions:j={}}=u,[N,M]=h.useState(null),[z,w]=h.useState({top:0,left:0}),[f,B]=h.useState(null),g=h.useRef(null),[y,S]=h.useState(!1),U=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const E=()=>{M(null),S(!1)};return document.body.addEventListener("click",E),M(null),S(!1),()=>{M(null),S(!1),document.body.removeEventListener("click",E)}},[]),h.useEffect(()=>{if(N){const E=[...s].map(O=>O.id===N.id?N:O);i(E)}},[N]),h.useEffect(()=>{if(g.current&&f){const E=g.current.getBoundingClientRect().height,O=window.innerHeight;let m=f.top;m+E>O+window.scrollY-200&&(m=O+window.scrollY-E-200),m<0&&(m=10),w({top:m,left:f.left})}},[g.current,f]);const T=(E,O)=>{E.stopPropagation();const m=E.target.getBoundingClientRect();B({top:m.top+window.scrollY,left:m.left-30}),M(O),S(!0)};function q(E){if(b)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const K=E=>{const{active:O,over:m}=E;if(m&&O.id!==m.id){const I=s.findIndex(L=>L.id===O.id),P=s.findIndex(L=>L.id===m.id);if(I!==-1&&P!==-1){const L=[...s],[Y]=L.splice(I,1);L.splice(P,0,Y),i(L)}}},it=E=>{var m;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&x&&t.jsxRuntimeExports.jsx(t.Select,{onChange:I=>{const L=[...s].map(Y=>Y.id===E.id?{...E,name:{"en-US":I}}:Y);M({...E,name:{"en-US":I}}),i([...L])},value:E.name["en-US"],options:x.filter(I=>!s.find(P=>P.name["en-US"]===I)),leftAddon:q(E.images)}),v==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:I=>{const L=[...s].map(Y=>Y.id===E.id?{...E,name:{"en-US":I}}:Y);i([...L])},value:E.name["en-US"],placeholder:p}),v==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:I=>{const L=[...s].map(Y=>Y.id===E.id?{...E,images:I}:Y);i([...L])},activeImage:(m=s.find(I=>I.id===E.id))==null?void 0:m.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:I=>T(I,E)})}),_&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(I=>I.id!==E.id))})})]})]});return d?t.jsxRuntimeExports.jsx(Qs,{product:E,children:O},E.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:O},E.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:E=>e==null?void 0:e(E)})]}),N&&n&&R&&y&&t.jsxRuntimeExports.jsx(Js,{ref:g,activeItem:N,setActiveItem:M,popupPosition:z,modalOptions:R,setIsOpenModal:S}),k&&D&&t.jsxRuntimeExports.jsx(_t,{...D}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:o}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:U,onDragEnd:K,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(E=>E.id),strategy:t.verticalListSortingStrategy,children:s.map(E=>it(E))})}):s.map(E=>it(E)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:F.button,size:"s",onClick:()=>{const E=[...s];let O=null;if(x){for(let m=0;m<x.length;m++)if(!s.find(I=>I.name["en-US"]===x[m])){O=x[m];break}}v==="select"&&x?E.push({name:{"en-US":O||x[0]},id:t.v4(),...j,maxSymbols:100}):v==="input"?E.push({name:{"en-US":""},id:t.v4(),...j,maxSymbols:100}):E.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...j,maxSymbols:100}),i(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r})]})},Zs="_title_bn7sv_1",tn="_subtitle_bn7sv_5",en="_header_bn7sv_12",sn="_text_bn7sv_13",nn="_productsBlock_bn7sv_14",on="_buttonsBlock_bn7sv_15",an="_top_bn7sv_26",rn="_itemsBlock_bn7sv_35",cn="_typeTexts_bn7sv_41",ln="_block_bn7sv_48",dn="_active_bn7sv_60",un="_products_bn7sv_14",xn="_product_bn7sv_14",mn="_button_bn7sv_15",pn="_image_bn7sv_90",_n="_info_bn7sv_97",hn="_name_bn7sv_109",jn="_buttons_bn7sv_15",gn="_modal_bn7sv_120",fn="_other_bn7sv_139",bn="_options_bn7sv_145",vn="_closeIcon_bn7sv_153",nt={title:Zs,subtitle:tn,header:en,text:sn,productsBlock:nn,buttonsBlock:on,top:an,itemsBlock:rn,typeTexts:cn,block:ln,active:dn,products:un,product:xn,button:mn,image:pn,info:_n,name:hn,buttons:jn,modal:gn,other:fn,options:bn,closeIcon:vn},En=h.forwardRef((u,a)=>{const{activeButton:e,setActiveButton:s,popupPosition:i}=u,[r,c]=h.useState(e.typesText),[o,n]=h.useState(e.destination),[d,b]=h.useState(e.page),[_,l]=h.useState(e.link||""),[v,p]=h.useState(e.text||{"en-US":""}),[x,k]=h.useState(e.openInNewTab),{pages:D}=t.usePagesStore();return h.useEffect(()=>{s({...e,...{text:v,link:_,destination:o,typesText:r,page:d,openInNewTab:x}})},[r,o,_,v,d,x]),console.log(v),t.jsxRuntimeExports.jsxs("div",{className:nt.modal,onClick:R=>{R.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:a,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:nt.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:R=>n(R),options:["Go to Page","Open Link"].filter(R=>R!==o),value:o}),o==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:R=>b(R),options:D?Object.values(D).filter(R=>R.name!==d).map(R=>R.name):[],value:d}):t.jsxRuntimeExports.jsx(t.Input,{onChange:R=>l(R),value:_,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:R=>k(R)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>p({"en-US":R}),value:v["en-US"],label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:r,setTypesText:c})]})]})}),Rn="_subtitle_jql1y_1",yn="_header_jql1y_8",In="_text_jql1y_9",kn="_productsBlock_jql1y_10",Sn="_buttonsBlock_jql1y_11",$n="_top_jql1y_23",Nn="_itemsBlock_jql1y_32",wn="_typeTexts_jql1y_38",Cn="_block_jql1y_45",Bn="_active_jql1y_58",Tn="_products_jql1y_10",Pn="_product_jql1y_10",An="_button_jql1y_11",Mn="_image_jql1y_88",On="_info_jql1y_95",qn="_name_jql1y_107",Dn="_buttons_jql1y_11",Un="_modal_jql1y_118",Ln="_other_jql1y_138",Hn="_options_jql1y_144",zn="_addButton_jql1y_150",Fn="_deleteButton_jql1y_165",tt={subtitle:Rn,header:yn,text:In,productsBlock:kn,buttonsBlock:Sn,top:$n,itemsBlock:Nn,typeTexts:wn,block:Cn,active:Bn,products:Tn,product:Pn,button:An,image:Mn,info:On,name:qn,buttons:Dn,modal:Un,other:Ln,options:Hn,addButton:zn,deleteButton:Fn},Et=u=>{const{buttons:a,setButtons:e,deletable:s=!0,addable:i=!0,editable:r=!0}=u,[c,o]=h.useState(null),[n,d]=h.useState({top:0,left:0}),[b,_]=h.useState(null),l=h.useRef(null);h.useEffect(()=>{const p=()=>{o(null)};return document.body.addEventListener("click",p),o(null),()=>{o(null),document.body.removeEventListener("click",p)}},[]),h.useEffect(()=>{if(c){const p=[...a].map(x=>x.id===c.id?c:x);e(p)}},[c]),h.useEffect(()=>{if(l.current&&b){const p=l.current.getBoundingClientRect().height,x=window.innerHeight;let k=b.top;k+p>x+window.scrollY-200&&(k=x+window.scrollY-p-200),k<0&&(k=10),d({top:k,left:b.left})}},[l.current,b]);const v=(p,x)=>{p.stopPropagation();const k=p.target.getBoundingClientRect();_({top:k.top+window.scrollY-70,left:k.left-(i?30:65)}),o(x)};return t.jsxRuntimeExports.jsxs("div",{className:tt.products,children:[t.jsxRuntimeExports.jsx("h5",{className:tt.subtitle,children:"Button Type"}),a.map(p=>t.jsxRuntimeExports.jsxs("div",{className:tt.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:x=>{const D=[...a].map(R=>R.id===p.id?{...p,type:x}:R);e(D)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:tt.buttons,children:[r&&t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:x=>{v(x,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const x=a.filter(k=>k.id!==p.id);e(x)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),c&&t.jsxRuntimeExports.jsx(En,{ref:l,activeButton:c,setActiveButton:o,popupPosition:n}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:tt.button,size:"s",onClick:()=>{const p=[...a];p.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:{"en-US":"Button Name"},page:"home",openInNewTab:!0}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:tt.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Vn=u=>{const{isActiveButtons:a,setIsActiveButtons:e,buttons:s,setButtons:i,editable:r=!0}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:nt.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:c=>e(c)})]}),t.jsxRuntimeExports.jsx(Et,{buttons:s,setButtons:i,editable:r})]})})},Yn="_wrapper_m18qi_1",Gn="_subtitle_m18qi_7",Xn="_content_m18qi_14",Wn="_range_m18qi_22",Jn="_track_m18qi_27",Qn="_progress_m18qi_36",Kn="_dots_m18qi_46",Zn="_dot_m18qi_46",ti="_active_m18qi_65",ei="_input_m18qi_77",si="_countBlock_m18qi_91",ni="_count_m18qi_91",ii="_controls_m18qi_107",oi="_button_m18qi_113",G={wrapper:Yn,subtitle:Gn,content:Xn,range:Wn,track:Jn,progress:Qn,dots:Kn,dot:Zn,active:ti,input:ei,countBlock:si,count:ni,controls:ii,button:oi},_t=u=>{const{label:a,min:e=1,max:s=4,step:i=1,count:r,setCount:c}=u,[o,n]=h.useState(!1),d=Array.from({length:(s-e)/i+1}),b=(r-e)/(s-e)*100,_=()=>{r<s&&c(r+i)},l=()=>{r>e&&c(r-i)},v=p=>{const x=e+p*i;c(x)};return t.jsxRuntimeExports.jsxs("div",{className:G.wrapper,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:a}),t.jsxRuntimeExports.jsxs("div",{className:G.content,children:[t.jsxRuntimeExports.jsxs("div",{className:G.range,children:[t.jsxRuntimeExports.jsx("div",{className:G.track}),t.jsxRuntimeExports.jsx("div",{className:G.progress,style:{width:`${b}%`}}),t.jsxRuntimeExports.jsx("div",{className:G.dots,children:d.map((p,x)=>{const k=x<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>v(x),className:t.clx(G.dot,{[G.active]:k,[G.inactive]:!k,[G.dragging]:o}),"aria-label":`Set value to ${e+x*i}`},x)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:r,onChange:p=>c(Number(p.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:G.input})]}),t.jsxRuntimeExports.jsxs("div",{className:G.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:p=>{const x=Number(p);x>s?c(s):x<e?c(e):c(x)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:G.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:_,disabled:r>=s,className:G.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:l,disabled:r<=e,className:G.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ai="_title_ix5ax_1",ri="_subtitle_ix5ax_5",ci="_header_ix5ax_12",li="_text_ix5ax_13",di="_productsBlock_ix5ax_14",ui="_top_ix5ax_26",xi="_itemsBlock_ix5ax_35",mi="_typeTexts_ix5ax_41",pi="_block_ix5ax_48",_i="_active_ix5ax_61",hi="_products_ix5ax_14",ji="_product_ix5ax_14",gi="_button_ix5ax_80",fi="_image_ix5ax_91",bi="_info_ix5ax_98",vi="_name_ix5ax_110",Ei="_buttons_ix5ax_114",Ri="_modal_ix5ax_121",yi="_link_ix5ax_141",Ii="_modalOptions_ix5ax_147",ki="_addButton_ix5ax_160",Si="_deleteButton_ix5ax_175",$i="_closeIcon_ix5ax_187",V={title:ai,subtitle:ri,header:ci,text:li,productsBlock:di,top:ui,itemsBlock:xi,typeTexts:mi,block:pi,active:_i,products:hi,product:ji,button:gi,image:fi,info:bi,name:vi,buttons:Ei,modal:Ri,link:yi,modalOptions:Ii,addButton:ki,deleteButton:Si,closeIcon:$i},Ni=u=>{const{activeItem:a,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:r}=u,c=r.find(o=>o.id===a.listingId);return c?t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:o=>{o.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:t.splitTextIntoSpans(c.productData.name)}),t.jsxRuntimeExports.jsx("div",{className:V.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{i(!1),e(null)}})})]}),t.jsxRuntimeExports.jsx("div",{className:V.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:c.productData.images.length>0?c.productData.images[0].cfId:void 0,onChange:o=>{const n={...a,image:o[0]};e(n)}})})]}):null};function wi(u){const{product:a,children:e}=u,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:String(a.listingId)}),d={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:d,className:`${V.product} ${n?V.dragging:""}`,...s,...i,children:e})}const Ci=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:d=!1,withImage:b=!1,deletable:_=!0,addable:l=!0,itemsType:v,itemsOptions:p}=u,[x,k]=h.useState(null),[D,R]=h.useState({top:0,left:0}),[j,N]=h.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const g=()=>{k(null),N(!1)};return document.body.addEventListener("click",g),k(null),N(!1),()=>{k(null),N(!1),document.body.removeEventListener("click",g)}},[]),h.useEffect(()=>{if(x){const g=[...s].map(y=>y.listingId===x.listingId?x:y);i(g)}},[x]);const z=(g,y)=>{g.stopPropagation();const S=g.target.getBoundingClientRect(),U=100,T=window.innerHeight;let q=S.top+window.scrollY;q+U>T&&(q=T-U-20),N(!0),R({top:q-80,left:S.left-30}),k(y)};function w(g){if(b)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const f=g=>{const{active:y,over:S}=g;if(S&&y.id!==S.id){const U=s.findIndex(q=>String(q.listingId)===y.id),T=s.findIndex(q=>String(q.listingId)===S.id);if(U!==-1&&T!==-1){const q=[...s],[K]=q.splice(U,1);q.splice(T,0,K),i(q)}}},B=(g,y)=>{const S=p.find(T=>g.listingId===T.id);if(!S)return null;const U=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:T=>{const q=[...s],K=p.find(O=>O.productData.name===T);if(!K)return;const it={listingId:K.id,image:K.productData.images.length>0?K.productData.images[0].cfId:""},E=q.map(O=>O.listingId===g.listingId?it:O);k(it),i([...E])},value:S.productData.name,options:[...p.filter(T=>!s.find(q=>q.listingId===T.id)).map(T=>T.productData.name)],leftAddon:w(g.image||S.productData.images.length>0&&S.productData.images[0].cfId||"")},y),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:T=>z(T,g)})}),_&&t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(T=>T!==g))})})]})]});return d?t.jsxRuntimeExports.jsx(wi,{product:g,children:U},g.listingId):t.jsxRuntimeExports.jsx("div",{className:V.product,children:U},g.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:g=>e==null?void 0:e(g)})]}),j&&x&&t.jsxRuntimeExports.jsx(Ni,{activeItem:x,setActiveItem:k,setIsOpenModal:N,popupPosition:D,itemsOptions:p}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:o}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:f,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((g,y)=>B(g,y))})}):s.map((g,y)=>B(g,y)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:V.button,size:"s",onClick:()=>{const g=[...s];for(let y=0;y<p.length;y++)if(!s.find(S=>S.listingId===p[y].id)){g.push({listingId:p[y].id,image:p[y].productData.images.length>0?p[y].productData.images[0].cfId:""});break}i(g)},disabled:s.length===p.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r})]})},Bi="_options_6cemk_1",Ti="_price_6cemk_12",Pi="_oldPrice_6cemk_19",Ai="_newPrice_6cemk_27",Mi="_animate_6cemk_34",Oi="_appearAndBounce_6cemk_1",qi="_meta_6cemk_52",Di="_info_6cemk_58",Ui="_infoRight_6cemk_66",Li="_buttons_6cemk_73",Hi="_variants_6cemk_80",zi="_variant_6cemk_80",Fi="_stock_6cemk_98",Vi="_variantInfo_6cemk_105",Yi="_quantity_6cemk_111",Gi="_count_6cemk_118",Xi="_focused_6cemk_135",Wi="_button_6cemk_73",Ji="_activeVariant_6cemk_161",Qi="_chargeTypes_6cemk_165",Ki="_charge_6cemk_165",Zi="_chargeActive_6cemk_190",to="_title_6cemk_198",C={options:Bi,price:Ti,oldPrice:Pi,newPrice:Ai,animate:Mi,appearAndBounce:Oi,meta:qi,info:Di,infoRight:Ui,buttons:Li,variants:Hi,variant:zi,stock:Fi,variantInfo:Vi,quantity:Yi,count:Gi,focused:Xi,button:Wi,activeVariant:Ji,chargeTypes:Qi,charge:Ki,chargeActive:Zi,title:to},eo="_wrapper_c1dht_1",so="_label_c1dht_9",no="_input_c1dht_18",io="_paddingless_c1dht_31",oo="_content_c1dht_35",ao="_contentBorder_c1dht_47",ro="_borderless_c1dht_52",co="_rightIcon_c1dht_57",Z={wrapper:eo,label:so,input:no,paddingless:io,content:oo,contentBorder:ao,borderless:ro,rightIcon:co},Rt=u=>{const{onChange:a,style:e,label:s,value:i,type:r,min:c,max:o,placeholder:n,disabled:d=!1,required:b=!1,regex:_,paddingless:l=!1,borderless:v=!1,editable:p=!1,isSearch:x=!1,centered:k=!1}=u,{themeSettings:D}=t.useThemeSettingsStore(),{inputs:R}=D,[j,N]=h.useState(!1);function M(w){return Number(w)<0?String(c):w}function z(w){return!b||!_?!0:new RegExp(_).test(w)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:Z.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Z.content,{[Z.contentBorder]:R.border.active}),style:{...e,background:R.field.active?R.field.color:"transparent",padding:x?`7px ${Number(R.general.size)+20}px 7px 11px`:"7px 11px"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:r||"text",onChange:w=>{if(r==="text")a(w.target.value);else{const f=M(w.target.value);a(f)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Z.input,{[Z.required]:j&&b&&!z(i),[Z.paddingless]:l,[Z.borderless]:v}),min:r==="number"?c:void 0,max:r==="number"?o:void 0,disabled:d,onFocus:()=>N(!0),style:{textAlign:k?"center":"left"}}),x&&t.jsxRuntimeExports.jsx("div",{className:Z.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:R.general.size,height:R.general.size})}),p&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},lo="_button_85085_1",uo="_primary_85085_20",xo="_primaryHovered_85085_30",mo="_secondary_85085_34",po="_secondaryHovered_85085_44",_o="_tertiary_85085_48",ho="_tertiaryHovered_85085_58",jo="_content_85085_62",et={button:lo,primary:uo,primaryHovered:xo,secondary:mo,secondaryHovered:po,tertiary:_o,tertiaryHovered:ho,content:jo},W=u=>{const{children:a,onClick:e,style:s,className:i,disabled:r=!1,type:c="Primary"}=u,{themeSettings:o}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(et.button,i,{[et.primary]:c==="Primary",[et.secondary]:c==="Secondary",[et.tertiary]:c==="Tertiary",[et.primaryHovered]:c==="Primary"&&!r&&o.buttons.primary.hover,[et.secondaryHovered]:c==="Secondary"&&!r&&o.buttons.secondary.hover,[et.tertiaryHovered]:c==="Tertiary"&&!r&&o.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:r,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:et.content,children:[a,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"var(--icon-tertiary)",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a})})};var yt=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(yt||{});const go=u=>{var D,R;const{variants:a}=u,[e,s]=h.useState(a[0]),[i,r]=h.useState(e.chargeTypes[0]),c=t.useNavigate(),[o,n]=h.useState(1),{reset:d,addProductToCart:b,getProducts:_}=t.useCart(),[l,v]=h.useState(!1);h.useEffect(()=>{v(!0);const j=setTimeout(()=>v(!1),600);return()=>clearTimeout(j)},[o]);async function p(){await _(),await b({productId:u.id,productVariantId:e.id,quantity:o})}function x(){d(),p(),c("/checkout")}function k(j){if(j>=864e5){const f=Math.floor(j/864e5);return`${f} ${f===1?"day":"days"}`}else if(j>=36e5){const f=Math.floor(j/36e5);return`${f} ${f===1?"hour":"hours"}`}else if(j>=6e4){const f=Math.floor(j/6e4);return`${f} ${f===1?"minute":"minutes"}`}else{const f=Math.floor(j/1e3);return`${f} ${f===1?"second":"seconds"}`}}return h.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&n(0)},[e.quantity.available]),console.log(e.quantity),t.jsxRuntimeExports.jsxs("div",{className:C.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:C.chargeTypes,children:e.chargeTypes.map(j=>t.jsxRuntimeExports.jsx("div",{className:t.clx(C.charge,{[C.chargeActive]:i===j}),onClick:()=>r(j),children:yt[j]},j))}),t.jsxRuntimeExports.jsx("div",{className:C.variants,children:a.map(j=>{var N;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(C.variant,{[C.activeVariant]:e.id===j.id}),onClick:()=>s(j),children:[t.jsxRuntimeExports.jsxs("div",{className:C.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:j.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?j.price.amount:j.subscriptionSettings?j.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:C.stock,children:[((N=j.quantity.restrictions)==null?void 0:N.max)||j.quantity.available||0," in stock"]})})]},j.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:C.quantity,children:[t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{o>1?n(j=>j-1):n(1)},className:C.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(Rt,{type:"number",value:String(o),onChange:j=>n(Number(j)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||1/0,min:((R=e.quantity.restrictions)==null?void 0:R.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{n(j=>j+1)},className:C.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:C.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:C.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":k(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:C.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",onClick:()=>x(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>p(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},fo="_button_1tdo3_1",bo="_login_1tdo3_14",vo="_signUp_1tdo3_18",Eo="_buttons_1tdo3_23",Ro="_modal_1tdo3_32",yo="_closing_1tdo3_64",Io="_info_1tdo3_113",ko="_top_1tdo3_120",So="_title_1tdo3_131",$o="_clear_1tdo3_138",No="_activeClear_1tdo3_145",wo="_count_1tdo3_149",Co="_cart_1tdo3_164",Bo="_empty_1tdo3_172",To="_product_1tdo3_198",Po="_products_1tdo3_207",Ao="_image_1tdo3_215",Mo="_productInfo_1tdo3_221",Oo="_content_1tdo3_228",qo="_name_1tdo3_234",Do="_price_1tdo3_240",Uo="_productButtons_1tdo3_246",Lo="_productButton_1tdo3_246",Ho="_productCount_1tdo3_266",zo="_bottom_1tdo3_282",Fo="_subtotal_1tdo3_290",Vo="_block_1tdo3_298",Yo="_shoppingCount_1tdo3_305",Go="_total_1tdo3_325",Xo="_link_1tdo3_331",Wo="_userInfo_1tdo3_338",Jo="_pagesMobileModal_1tdo3_349",Qo="_pagesMobileModalContent_1tdo3_363",Ko="_pagesMobileModalHeader_1tdo3_369",Zo="_pagesMobileModalFooter_1tdo3_379",$={button:fo,login:bo,signUp:vo,buttons:Eo,modal:Ro,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:yo,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Io,top:ko,title:So,clear:$o,activeClear:No,count:wo,cart:Co,empty:Bo,product:To,products:Po,image:Ao,productInfo:Mo,content:Oo,name:qo,price:Do,productButtons:Uo,productButton:Lo,productCount:Ho,bottom:zo,subtotal:Fo,block:Vo,shoppingCount:Yo,total:Go,link:Xo,userInfo:Wo,pagesMobileModal:Jo,pagesMobileModalContent:Qo,pagesMobileModalHeader:Ko,pagesMobileModalFooter:Zo};class ut extends Error{}ut.prototype.name="InvalidTokenError";function ta(u){return decodeURIComponent(atob(u).replace(/(.)/g,(a,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ea(u){let a=u.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ta(a)}catch{return atob(a)}}function sa(u,a){if(typeof u!="string")throw new ut("Invalid token specified: must be a string");a||(a={});const e=a.header===!0?0:1,s=u.split(".")[e];if(typeof s!="string")throw new ut(`Invalid token specified: missing part #${e+1}`);let i;try{i=ea(s)}catch(r){throw new ut(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new ut(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const na=u=>{const{shopping:a,signUp:e,isShowUserInfo:s=!0}=u;return t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[a&&t.jsxRuntimeExports.jsx(It,{}),s&&t.jsxRuntimeExports.jsx(bt,{signUp:e})]})},It=()=>{const[u,a]=h.useState(!1),[e,s]=h.useState([]),{cart:i,getProducts:r}=t.useCart();function c(l){for(let v=0;v<i.parts.length;v++)for(let p=0;p<l.variants.length;p++)if(i.parts[v].productVariantId===l.variants[v].id)return i.parts[v].productVariantId}function o(l){for(let v=0;v<i.parts.length;v++)for(let p=0;p<l.variants.length;p++)if(i.parts[v].productVariantId===l.variants[v].id)return i.parts[v].quantity}h.useEffect(()=>{(async()=>{const v=i.parts.map(k=>String(k.productId)),x=(await r([...v])).map(k=>({...k,activeVariantId:c(k),quantity:o(k)}));s(x)})()},[i.parts.length]);function n(l){var v;return!l||!(l!=null&&l.variants)?!1:(v=l.variants.find(p=>p.id===l.activeVariantId))==null?void 0:v.subscriptionSettings}const d=i.parts.length>0&&e.length>0&&!n(e[0]),[b,_]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(W,{type:"Secondary",style:{padding:10},onClick:l=>{l.stopPropagation(),window.location.pathname!=="/admin/builder"&&(a(!0),_(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),d&&t.jsxRuntimeExports.jsx("div",{className:$.shoppingCount,children:i.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{_(!1),setTimeout(()=>{a(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(kt,{activeProducts:e,isCartNotEmpty:d,isOpen:b})})]})},kt=u=>{const{activeProducts:a,isCartNotEmpty:e,isOpen:s}=u,{cart:i,reset:r,getTotalAndDiscount:c,updateQuantityOfProduct:o}=t.useCart(),n=t.useNavigate();function d(l){n(l)}function b(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity+1})}function _(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx($.modal,{[$.closing]:!s}),onClick:l=>l.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[t.jsxRuntimeExports.jsxs("div",{className:$.info,children:[t.jsxRuntimeExports.jsx("span",{className:$.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:$.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx($.clear,{[$.activeClear]:e}),disabled:!e,onClick:r,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:$.cart,children:[t.jsxRuntimeExports.jsx("div",{className:$.products,children:a.map(l=>t.jsxRuntimeExports.jsxs("div",{className:$.product,children:[t.jsxRuntimeExports.jsxs("div",{className:$.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:$.image}),t.jsxRuntimeExports.jsxs("div",{className:$.content,children:[t.jsxRuntimeExports.jsx("div",{className:$.name,children:l.name}),t.jsxRuntimeExports.jsxs("div",{className:$.price,children:["$",l.variants.find(v=>v.id===l.activeVariantId).price.amount*((l==null?void 0:l.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:$.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{l.quantity!==1&&_(l)},className:$.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:$.productCount,children:l.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>b(l),className:$.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},l.id))}),t.jsxRuntimeExports.jsxs("div",{className:$.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:$.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:$.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:$.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(W,{onClick:()=>d("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(St,{})]})},St=()=>t.jsxRuntimeExports.jsxs("div",{className:$.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:$.link,children:"view products"})]})]}),bt=({signUp:u})=>{const a=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=a,s=t.useNavigate();function i(o){s(o)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),u&&t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[r,c]=h.useState("test-email@gmail.com");return h.useEffect(()=>{(async()=>{const n=sa(e);c(n.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:$.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:r||"test-email@gmail.com"})})},$t=({children:u,logo:a,setIsOpen:e,signUp:s})=>{const{setIsOpen:i}=t.useModalStore(),r=()=>{i(!1),setTimeout(()=>{e(!1),i(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:$.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:$.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:a}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:r,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:$.pagesMobileModalContent,children:u}),t.jsxRuntimeExports.jsx("div",{className:$.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(bt,{signUp:s})})]})},ia=({children:u,logo:a,signUp:e})=>{const[s,i]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Nt,{setIsOpenModal:i}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx($t,{logo:a,setIsOpen:i,signUp:e,children:u})})]})},Nt=u=>{const{setIsOpenModal:a}=u;return t.jsxRuntimeExports.jsx(W,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),a(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},oa="_share_xddz7_1",aa="_modal_xddz7_8",ra="_header_xddz7_20",ca="_socials_xddz7_30",la="_social_xddz7_30",da="_copy_xddz7_40",ua="_title_xddz7_47",xa="_copyWrapper_xddz7_53",ma="_copyText_xddz7_62",pa="_copyTextMobile_xddz7_75",_a="_copyTextMiniMobile_xddz7_94",st={share:oa,modal:aa,header:ra,socials:ca,social:la,copy:da,title:ua,copyWrapper:xa,copyText:ma,copyTextMobile:pa,copyTextMiniMobile:_a},ha=()=>{const{isOpenModal:u,setIsOpenModal:a}=t.useShareLinkStore();function e(){a(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:st.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:a,children:t.jsxRuntimeExports.jsx(ja,{})})]})},ja=()=>{const{setIsOpenModal:u}=t.useShareLinkStore(),{notification:a,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),i=window.location.href;function r(){navigator.clipboard.writeText(i),e({message:"Link copied to clipboard",status:"success"})}function c(){s(!1),setTimeout(()=>{u(!1),s(!0)},300)}function o(n,d){return n.length>d?n.slice(0,d)+"...":n}return t.jsxRuntimeExports.jsxs("div",{className:st.modal,onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:st.header,children:[t.jsxRuntimeExports.jsx("div",{className:st.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:c,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:st.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:r,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:st.copyText,children:o(i,100)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMobile,children:o(i,40)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMiniMobile,children:o(i,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:r,children:a?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},ga="_accordion_1s1lq_1",fa="_header_1s1lq_9",ba="_icon_1s1lq_18",va="_open_1s1lq_21",Ea="_content_1s1lq_25",dt={accordion:ga,header:fa,icon:ba,open:va,content:Ea},Ra=({title:u,content:a,defaultOpen:e=!1})=>{const[s,i]=h.useState(e),[r,c]=h.useState(0),o=h.useRef(null),n=()=>{i(!s)};return h.useEffect(()=>{o.current&&c(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:dt.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:dt.header,onClick:n,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(dt.icon,{[dt.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:dt.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:a})})]})},ya=({children:u,path:a,className:e,target:s="_self",id:i})=>{const r=t.useNavigate(),c=/^https?:\/\//.test(a),o=n=>{c||s==="_blank"?s==="_blank"?window.open(a,"_blank"):window.location.href=a:(n.preventDefault(),r(a,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:i,children:u})},Ia="_buttonsBlock_1b2rb_1",ka="_slideUp_1b2rb_1",Sa={buttonsBlock:Ia,slideUp:ka},$a=()=>t.jsxRuntimeExports.jsxs("div",{className:Sa.buttonsBlock,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",style:{width:"100%"},onClick:()=>{console.log("add to cart")},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",children:"Buy"})]}),Na="_wrapper_st58d_1",wa="_label_st58d_10",Ca="_textarea_st58d_18",Ba="_length_st58d_33",mt={wrapper:Na,label:wa,textarea:Ca,length:Ba},Ta=u=>{const{onChange:a,label:e,value:s,maxLength:i,placeholder:r="Type something..."}=u,[c,o]=h.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:mt.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:mt.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{o(n.target.value.length),a(n.target.value)},placeholder:r,className:mt.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:mt.length,children:[c,"/",i]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=Ra;exports.BurgerMenuButton=Nt;exports.Button=W;exports.ButtonTypeSettings=Et;exports.ButtonsSettings=Vn;exports.CategorySettings=Ze;exports.EmptyCart=St;exports.FormSettings=Ks;exports.HeaderButtons=na;exports.InputUI=Rt;exports.ItemsSettings=vt;exports.LayoutSettings=Ft;exports.Link=ya;exports.ListingSelector=Ci;exports.PagesMobileMenu=ia;exports.PagesMobileModal=$t;exports.PagesSettings=Is;exports.ProductCardButtons=$a;exports.ProductOptions=go;exports.RangeSelector=_t;exports.ShareLink=ha;exports.ShoppingButton=It;exports.ShoppingModalCart=kt;exports.TextSettings=ft;exports.TextareaUI=Ta;exports.TypesText=gt;exports.UserInfo=bt;
|