@billgangcom/theme-lib 1.15.1 → 1.16.0
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 -0
- package/dist/builder/index.d.ts +0 -1
- package/dist/builder.cjs.js +3 -34
- package/dist/builder.es.js +1359 -4643
- package/dist/root-CLYS1Wm7.cjs +146 -0
- package/dist/root-CW3Zha5t.js +29404 -0
- package/dist/shared/lib/clearQueryParams.d.ts +1 -0
- package/dist/shared/lib/index.d.ts +1 -0
- package/dist/ui/HeaderButtons/index.d.ts +6 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +754 -689
- package/package.json +2 -1
- package/dist/index-Cr8kurIY.cjs +0 -40
- package/dist/index-D4jHAwqq.js +0 -6251
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clearQueryParams: () => void;
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-Cr8kurIY.cjs"),p=require("react"),nt="_accordion_2tiiw_1",ot="_header_2tiiw_9",it="_icon_2tiiw_16",ct="_open_2tiiw_19",rt="_content_2tiiw_23",z={accordion:nt,header:ot,icon:it,open:ct,content:rt},at=({title:d,content:o})=>{const[n,i]=p.useState(!1),[c,r]=p.useState(0),e=p.useRef(null),s=()=>{i(!n)};return p.useEffect(()=>{e.current&&r(n?e.current.scrollHeight:0)},[n]),t.jsxRuntimeExports.jsxs("div",{className:z.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:z.header,onClick:s,children:[t.jsxRuntimeExports.jsx("h3",{children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(z.icon,{[z.open]:n}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:e,className:z.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{children:o})})]})},lt="_wrapper_1g82c_2",xt="_alignmentBlock_1g82c_8",ut="_title_1g82c_15",dt="_subtitle_1g82c_22",mt="_alignmentContent_1g82c_29",pt="_alignments_1g82c_35",_t="_alignment_1g82c_8",ht="_circle_1g82c_54",jt="_paddings_1g82c_61",gt="_padding_1g82c_61",bt="_input_1g82c_79",T={wrapper:lt,alignmentBlock:xt,title:ut,subtitle:dt,alignmentContent:mt,alignments:pt,alignment:_t,circle:ht,paddings:jt,padding:gt,input:bt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],vt=d=>{const{alignment:o,padding:n,setPadding:i,setAlignment:c}=d;function r(){switch(o){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 e(s){switch(s){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:T.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:T.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:T.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:T.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:T.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:T.alignments,children:ft.map(s=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{c(s)},className:T.alignment,children:[s!==o&&t.jsxRuntimeExports.jsx("div",{className:T.circle}),s===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},s))}),t.jsxRuntimeExports.jsx("div",{className:T.paddings,children:Rt.map(s=>t.jsxRuntimeExports.jsxs("label",{className:T.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:e(s),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(n[s]),onChange:l=>i({...n,[s]:Number(l)}),paddingless:!0,borderless:!0})]}))})]})]})]})},Et="_subtitle_2zbxx_1",kt="_header_2zbxx_8",yt="_text_2zbxx_9",$t="_top_2zbxx_16",It="_itemsBlock_2zbxx_23",F={subtitle:Et,header:kt,text:yt,top:$t,itemsBlock:It},wt="_typeTexts_3zlec_1",Nt="_block_3zlec_7",Ct="_active_3zlec_18",J={typeTexts:wt,block:Nt,active:Ct},Bt=["bold","italic","underline","strike-through","code"],Q=d=>{const{typesText:o,setTypesText:n}=d;function i(c){switch(c){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:J.typeTexts,children:Bt.map(c=>t.jsxRuntimeExports.jsx("div",{className:t.clx(J.block,{[J.active]:o.includes(c)}),onClick:()=>{const r=[...o];if(r.includes(c)){const e=r.filter(s=>s!==c);n(e)}else r.push(c),n(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:i(c),fill:o.includes(c)?"#252525":"#757575",width:20,height:20})},String(c)))})},W=d=>{const{typesText:o,isActiveText:n,setIsActiveText:i,text:c,setText:r,setTypesText:e,title:s,subtitle:l="Items"}=d;return t.jsxRuntimeExports.jsxs("div",{className:F.text,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:s}),n!==void 0&&i&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:R=>i(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:l}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>r(R),value:c,maxLength:150}),t.jsxRuntimeExports.jsx(Q,{typesText:o,setTypesText:e})]})]})},Pt="_subtitle_11qr1_1",Tt="_header_11qr1_8",St="_text_11qr1_9",At="_productsBlock_11qr1_10",Ot="_top_11qr1_22",Dt="_itemsBlock_11qr1_29",Lt="_typeTexts_11qr1_35",qt="_block_11qr1_41",Mt="_active_11qr1_52",Ht="_products_11qr1_10",zt="_product_11qr1_10",Ft="_button_11qr1_70",Vt="_disabled_11qr1_80",Gt="_image_11qr1_84",Ut="_info_11qr1_91",Xt="_name_11qr1_102",Yt="_buttons_11qr1_106",Jt="_modal_11qr1_112",Kt="_link_11qr1_130",Qt="_modalOptions_11qr1_136",k={subtitle:Pt,header:Tt,text:St,productsBlock:At,top:Ot,itemsBlock:Dt,typeTexts:Lt,block:qt,active:Mt,products:Ht,product:zt,button:Ft,disabled:Vt,image:Gt,info:Ut,name:Xt,buttons:Yt,modal:Jt,link:Kt,modalOptions:Qt},Wt=d=>{const{activeItem:o,setActiveItem:n,popupPosition:i,modalOptions:c,setIsOpenModal:r}=d;return t.jsxRuntimeExports.jsxs("div",{className:k.modal,onClick:e=>{e.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{n(null),r(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:k.modalOptions,children:c.map(e=>{if(e.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:s=>{const l={...o,[e.field]:s};n(l)}});if(e.type==="text")return t.jsxRuntimeExports.jsx(W,{typesText:o[e.field.type],setTypesText:s=>{const l={...o,[e.field.type]:s};n(l)},text:o[e.field.text]||"",setText:s=>{const l={...o,[e.field.text]:s};n(l)},subtitle:e.label});if(e.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>{const l={...o,[e.field]:s};n(l)},value:o[e.field]||"",label:e.label,placeholder:e.placeholder});if(e.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:k.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>{const l={...o,[e.field.text]:s};n(l)},value:o[e.field.text]||"",label:e.inputLabel,placeholder:e.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!o[e.field.switch]||!1,label:e.switchLabel,onChange:s=>{const l={...o,[e.field.switch]:s};n(l)}})]});if(e.type==="list")return t.jsxRuntimeExports.jsx(tt,{items:o[e.field]||[],setItems:s=>{const l={...o,[e.field]:s};n(l)},itemsType:"select",draggable:e.draggable||!1,itemsOptions:e.itemsOptions,deletable:e.deletable||!1,editable:!1,subtitle:e.label});if(e.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:e.itemsOptions,onChange:s=>{const l={...o,[e.field]:s};n(l)},label:e.label,value:o[e.field]||"String",leftAddon:e.leftAddon&&e.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:o[e.field]})})})})]})},Zt="_other_1wtgi_1",te="_subtitle_1wtgi_7",ee="_items_1wtgi_14",K={other:Zt,subtitle:te,items:ee},Z=d=>{const{items:o,title:n="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:K.other,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:n}),t.jsxRuntimeExports.jsx("div",{className:K.items,children:o.map(i=>t.jsxRuntimeExports.jsx(t.Switch,{current:i.isItem,onChange:c=>i.setIsItem(c),label:i.label,hasBackground:!0,paddingless:!1}))})]})},se=d=>{const{index:o,moveProduct:n,children:i}=d,[,c]=t.useDrop({accept:"product",hover(s){s.index!==o&&(n(s.index,o),s.index=o)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:o},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>e(c(s)),className:`${k.product} ${r?k.dragging:""}`,children:i})},tt=d=>{const{isActiveItems:o,setIsActiveItems:n,items:i,setItems:c,other:r,title:e,subtitle:s,editable:l=!0,draggable:R=!1,withImage:m=!1,deletable:f=!0,addable:u=!0,itemsType:y,itemsPlaceholder:j="",itemsOptions:_,hasRangeSelector:w=!1,rangeSelectorOptions:G,modalOptions:U,addableOptions:M={},limit:B}=d,[A,O]=p.useState(null),[Y,X]=p.useState({top:0,left:0}),[x,g]=p.useState(!1),N=(a,$)=>{const C=[...i],[b]=C.splice(a,1);C.splice($,0,b),c(C)};p.useEffect(()=>{const a=()=>{O(null),g(!1)};return document.body.addEventListener("click",a),O(null),g(!1),()=>{O(null),g(!1),document.body.removeEventListener("click",a)}},[]),p.useEffect(()=>{if(A){const a=[...i].map($=>$.id===A.id?A:$);c(a)}},[A]);const v=(a,$)=>{a.stopPropagation(),g(!0);const C=a.target.getBoundingClientRect(),b=500,H=window.innerHeight;let S=C.top+window.scrollY;S+b>H&&(S=H-b-20),X({top:S-80,left:C.left-30}),O($)};function L(a){if(m)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=(a,$)=>{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})}),y==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,name:b}:D);O({...a,name:b}),c([...S])},value:a.name,options:_,leftAddon:L(a.images)}),y==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,name:b}:D);c([...S])},value:a.name,placeholder:j}),y==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,images:b}:D);c([...S])}}),t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:b=>v(b,a)}),f&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(i.filter(b=>b.id!==a.id))})]})]});return R?t.jsxRuntimeExports.jsx(se,{product:a,index:$,moveProduct:N,children:C},a.id):t.jsxRuntimeExports.jsx("div",{className:k.product,children:C},a.id)};return t.jsxRuntimeExports.jsxs("div",{className:k.productsBlock,children:[(e||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:k.title,children:e}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:a=>n==null?void 0:n(a)})]}),A&&l&&U&&x&&t.jsxRuntimeExports.jsx(Wt,{activeItem:A,setActiveItem:O,popupPosition:Y,modalOptions:U,setIsOpenModal:g}),w&&G&&t.jsxRuntimeExports.jsx(st,{...G}),t.jsxRuntimeExports.jsxs("div",{className:k.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:k.subtitle,children:s}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((a,$)=>P(a,$))}):i.map((a,$)=>P(a,$)),u&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx(k.button,{[k.disabled]:!!(B&&B<=i.length)}),size:"s",disabled:!!(B&&B<=i.length),onClick:()=>{const a=[...i];y==="select"?a.push({name:_[0]||`Product ${i.length+1}`,id:t.v4(),...M}):y==="input"?a.push({name:"",id:t.v4(),...M}):a.push({name:`Image ${i.length+1}`,id:t.v4(),...M}),c(a)},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(Z,{items:r})]})},ne="_subtitle_41klp_1",oe="_header_41klp_8",ie="_text_41klp_9",ce="_productsBlock_41klp_10",re="_buttonsBlock_41klp_11",ae="_top_41klp_21",le="_itemsBlock_41klp_28",xe="_typeTexts_41klp_34",ue="_block_41klp_40",de="_active_41klp_51",me="_products_41klp_10",pe="_product_41klp_10",_e="_button_41klp_11",he="_image_41klp_79",je="_info_41klp_86",ge="_name_41klp_97",be="_buttons_41klp_11",fe="_modal_41klp_107",Re="_other_41klp_124",ve="_options_41klp_130",q={subtitle:ne,header:oe,text:ie,productsBlock:ce,buttonsBlock:re,top:ae,itemsBlock:le,typeTexts:xe,block:ue,active:de,products:me,product:pe,button:_e,image:he,info:je,name:ge,buttons:be,modal:fe,other:Re,options:ve},Ee=d=>{const{activeButton:o,setActiveButton:n,popupPosition:i}=d,[c,r]=p.useState(o.typesText),[e,s]=p.useState(o.destination),[l,R]=p.useState(o.link||""),[m,f]=p.useState(o.text||"");return p.useEffect(()=>{n({...o,...{text:m,link:l,destination:e,typesText:c}})},[c,e,l,m]),t.jsxRuntimeExports.jsxs("div",{className:q.modal,onClick:u=>{u.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>n(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:q.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:u=>s(u),options:["Go to Page","Open Link"],value:e}),e==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:u=>R(u),value:l,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:u=>f(u),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(Q,{typesText:c,setTypesText:r})]})]})},ke="_subtitle_1y5sw_1",ye="_header_1y5sw_8",$e="_text_1y5sw_9",Ie="_productsBlock_1y5sw_10",we="_buttonsBlock_1y5sw_11",Ne="_top_1y5sw_22",Ce="_itemsBlock_1y5sw_29",Be="_typeTexts_1y5sw_35",Pe="_block_1y5sw_41",Te="_active_1y5sw_52",Se="_products_1y5sw_10",Ae="_product_1y5sw_10",Oe="_button_1y5sw_11",De="_image_1y5sw_80",Le="_info_1y5sw_87",qe="_name_1y5sw_98",Me="_buttons_1y5sw_11",He="_modal_1y5sw_108",ze="_other_1y5sw_125",Fe="_options_1y5sw_131",V={subtitle:ke,header:ye,text:$e,productsBlock:Ie,buttonsBlock:we,top:Ne,itemsBlock:Ce,typeTexts:Be,block:Pe,active:Te,products:Se,product:Ae,button:Oe,image:De,info:Le,name:qe,buttons:Me,modal:He,other:ze,options:Fe},et=d=>{const{buttons:o,setButtons:n,deletable:i=!0,addable:c=!0}=d,[r,e]=p.useState(null),[s,l]=p.useState({top:0,left:0});p.useEffect(()=>{const m=()=>{e(null)};return document.body.addEventListener("click",m),e(null),()=>{e(null),document.body.removeEventListener("click",m)}},[]),p.useEffect(()=>{if(r){const m=[...o].map(f=>f.id===r.id?r:f);n(m)}},[r]);const R=(m,f)=>{m.stopPropagation();const u=m.target.getBoundingClientRect(),y=490,j=window.innerHeight;let _=u.top+window.scrollY;_+y>j&&(_=j-y-20),l({top:_,left:u.left-30}),e(f)};return t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Button Type"}),o.map(m=>t.jsxRuntimeExports.jsxs("div",{className:V.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:f=>{const y=[...o].map(j=>j.id===m.id?{...m,type:f}:j);n(y)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:f=>{R(f,m)}}),i&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const f=o.filter(u=>u.id!==m.id);n(f)},width:20,height:20,fill:"#C12A2A"})]})]},m.id)),r&&t.jsxRuntimeExports.jsx(Ee,{activeButton:r,setActiveButton:e,popupPosition:s}),c&&t.jsxRuntimeExports.jsxs(t.Button,{className:V.button,size:"s",onClick:()=>{const m=[...o];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:""}),n(m)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Ve=d=>{const{isActiveButtons:o,setIsActiveButtons:n,buttons:i,setButtons:c}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:q.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{className:q.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:r=>n(r)})]}),t.jsxRuntimeExports.jsx(et,{buttons:i,setButtons:c})]})})},Ge="_wrapper_tn7gb_1",Ue="_subtitle_tn7gb_7",Xe="_content_tn7gb_14",Ye="_range_tn7gb_21",Je="_track_tn7gb_26",Ke="_progress_tn7gb_35",Qe="_dots_tn7gb_45",We="_dot_tn7gb_45",Ze="_active_tn7gb_62",ts="_input_tn7gb_74",es="_countBlock_tn7gb_88",ss="_count_tn7gb_88",ns="_controls_tn7gb_103",os="_button_tn7gb_108",E={wrapper:Ge,subtitle:Ue,content:Xe,range:Ye,track:Je,progress:Ke,dots:Qe,dot:We,active:Ze,input:ts,countBlock:es,count:ss,controls:ns,button:os},st=d=>{const{label:o,min:n=1,max:i=4,step:c=1,count:r,setCount:e}=d,[s,l]=p.useState(!1),R=Array.from({length:(i-n)/c+1}),m=(r-n)/(i-n)*100,f=()=>{r<i&&e(r+c)},u=()=>{r>n&&e(r-c)},y=j=>{const _=n+j*c;e(_)};return t.jsxRuntimeExports.jsxs("div",{className:E.wrapper,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:E.subtitle,children:o}),t.jsxRuntimeExports.jsxs("div",{className:E.content,children:[t.jsxRuntimeExports.jsxs("div",{className:E.range,children:[t.jsxRuntimeExports.jsx("div",{className:E.track}),t.jsxRuntimeExports.jsx("div",{className:E.progress,style:{width:`${m}%`}}),t.jsxRuntimeExports.jsx("div",{className:E.dots,children:R.map((j,_)=>{const w=_<=(r-n)/c;return t.jsxRuntimeExports.jsx("button",{onClick:()=>y(_),className:t.clx(E.dot,{[E.active]:w,[E.inactive]:!w,[E.dragging]:s}),"aria-label":`Set value to ${n+_*c}`},_)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:n,max:i,step:c,value:r,onChange:j=>e(Number(j.target.value)),onMouseDown:()=>l(!0),onMouseUp:()=>l(!1),onTouchStart:()=>l(!0),onTouchEnd:()=>l(!1),className:E.input})]}),t.jsxRuntimeExports.jsxs("div",{className:E.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:n,max:i,paddingless:!0,onChange:j=>{const _=Number(j);_>i?e(i):_<n?e(n):e(_)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:E.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:f,disabled:r>=i,className:E.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:u,disabled:r<=n,className:E.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},is="_subtitle_1nl8x_1",cs="_header_1nl8x_8",rs="_text_1nl8x_9",as="_productsBlock_1nl8x_10",ls="_top_1nl8x_22",xs="_itemsBlock_1nl8x_29",us="_typeTexts_1nl8x_35",ds="_block_1nl8x_41",ms="_active_1nl8x_52",ps="_products_1nl8x_10",_s="_product_1nl8x_10",hs="_button_1nl8x_70",js="_image_1nl8x_80",gs="_info_1nl8x_87",bs="_name_1nl8x_98",fs="_buttons_1nl8x_102",Rs="_modal_1nl8x_108",vs="_link_1nl8x_126",Es="_modalOptions_1nl8x_132",I={subtitle:is,header:cs,text:rs,productsBlock:as,top:ls,itemsBlock:xs,typeTexts:us,block:ds,active:ms,products:ps,product:_s,button:hs,image:js,info:gs,name:bs,buttons:fs,modal:Rs,link:vs,modalOptions:Es},ks=d=>{const{activeItem:o,setActiveItem:n,popupPosition:i,setIsOpenModal:c}=d;return t.jsxRuntimeExports.jsxs("div",{className:I.modal,onClick:r=>{r.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:I.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{c(!1),n(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:I.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:r=>{const e={...o,images:r,imagePath:r[0]};n(e)}})})]})},ys=d=>{const{index:o,moveProduct:n,children:i}=d,[,c]=t.useDrop({accept:"product",hover(s){s.index!==o&&(n(s.index,o),s.index=o)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:o},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>e(c(s)),className:`${I.product} ${r?I.dragging:""}`,children:i})},$s=d=>{const{isActiveItems:o,setIsActiveItems:n,items:i,setItems:c,other:r,title:e,subtitle:s,editable:l=!0,draggable:R=!1,withImage:m=!1,deletable:f=!0,addable:u=!0,itemsType:y,itemsOptions:j}=d,[_,w]=p.useState(null),[G,U]=p.useState({top:0,left:0}),[M,B]=p.useState(!1),A=(x,g)=>{const N=[...i],[v]=N.splice(x,1);N.splice(g,0,v),c(N)};p.useEffect(()=>{const x=()=>{w(null),B(!1)};return document.body.addEventListener("click",x),w(null),B(!1),()=>{w(null),B(!1),document.body.removeEventListener("click",x)}},[]),p.useEffect(()=>{if(_){const x=[...i].map(g=>g.id===_.id?_:g);c(x)}},[_]);const O=(x,g)=>{x.stopPropagation();const N=x.target.getBoundingClientRect(),v=100,L=window.innerHeight;let P=N.top+window.scrollY;P+v>L&&(P=L-v-20),B(!0),U({top:P-80,left:N.left-30}),w(g)};function Y(x){if(m)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=(x,g)=>{const N=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})}),y==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const L=[...i],P=Number(v.split(" ")[1]),a=j.find(b=>b.id===P);if(!a)return;const $={...a.productData.stats,newPrice:a.productData.minPrice.amount,oldPrice:a.productData.compareAtPrice.amount},C=L.map(b=>b.id===x.id?{...x,name:v,listingId:P,stats:$}:b);w({...x,name:v,listingId:P}),c([...C])},value:x.name,options:[...j.map(v=>`Product ${v.id}`)],leftAddon:Y(x.images[0])}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>O(v,x)}),f&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(i.filter(v=>v.id!==x.id))})]})]});return R?t.jsxRuntimeExports.jsx(ys,{product:x,index:g,moveProduct:A,children:N},x.id):t.jsxRuntimeExports.jsx("div",{className:I.product,children:N},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:I.productsBlock,children:[(e||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:I.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:I.title,children:e}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:x=>n==null?void 0:n(x)})]}),M&&_&&t.jsxRuntimeExports.jsx(ks,{activeItem:_,setActiveItem:w,setIsOpenModal:B,popupPosition:G}),t.jsxRuntimeExports.jsxs("div",{className:I.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:s}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((x,g)=>X(x,g))}):i.map((x,g)=>X(x,g)),u&&t.jsxRuntimeExports.jsxs(t.Button,{className:I.button,size:"s",onClick:()=>{const x=[...i],g=j[0].id;x.push({name:`Product ${g}`,id:t.v4(),listingId:g,imagePath:"",images:[],stats:{...j[0].productData.stats,newPrice:j[0].productData.minPrice.amount,oldPrice:j[0].productData.compareAtPrice.amount}}),c(x)},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(Z,{items:r})]})},Is="_options_163bj_1",ws="_price_163bj_12",Ns="_oldPrice_163bj_18",Cs="_newPrice_163bj_26",Bs="_meta_163bj_33",Ps="_info_163bj_39",Ts="_infoRight_163bj_46",Ss="_buttons_163bj_52",As="_variants_163bj_59",Os="_variant_163bj_59",Ds="_stock_163bj_74",Ls="_variantInfo_163bj_81",qs="_quantity_163bj_87",Ms="_count_163bj_93",Hs="_button_163bj_52",zs="_activeVariant_163bj_110",Fs="_chargeTypes_163bj_114",Vs="_charge_163bj_114",Gs="_chargeActive_163bj_131",h={options:Is,price:ws,oldPrice:Ns,newPrice:Cs,meta:Bs,info:Ps,infoRight:Ts,buttons:Ss,variants:As,variant:Os,stock:Ds,variantInfo:Ls,quantity:qs,count:Ms,button:Hs,activeVariant:zs,chargeTypes:Fs,charge:Vs,chargeActive:Gs},Us=d=>{const{variants:o}=d,[n,i]=p.useState(o[0]),[c,r]=p.useState(1);function e(s){if(s>=864e5){const u=Math.floor(s/864e5);return`${u} ${u===1?"day":"days"}`}else if(s>=36e5){const u=Math.floor(s/36e5);return`${u} ${u===1?"hour":"hours"}`}else if(s>=6e4){const u=Math.floor(s/6e4);return`${u} ${u===1?"minute":"minutes"}`}else{const u=Math.floor(s/1e3);return`${u} ${u===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:h.options,children:[t.jsxRuntimeExports.jsx("div",{className:h.chargeTypes,children:n.chargeTypes?n.chargeTypes.map(s=>t.jsxRuntimeExports.jsx("div",{children:s})):t.jsxRuntimeExports.jsx("div",{className:t.clx(h.charge,h.chargeActive),children:"One-Time"})}),t.jsxRuntimeExports.jsx("div",{className:h.variants,children:o.map(s=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(h.variant,{[h.activeVariant]:n.id===s.id}),onClick:()=>i(s),children:[t.jsxRuntimeExports.jsxs("div",{className:h.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:h.title,children:s.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",s.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs("span",{className:h.stock,children:[s.quantity.restrictions.max||0," in stock"]})})]}))}),t.jsxRuntimeExports.jsxs("div",{className:h.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c>0?r(s=>s-1):r(0)},className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:h.count,children:c}),t.jsxRuntimeExports.jsx("div",{onClick:()=>r(s=>s+1),className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:h.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:h.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:n.deliveryTime===0?"Instant":e(n.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:h.infoRight,children:n.compareAtPrice&&(n.compareAtPrice.amount||0)-(n.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:h.price,children:[t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(n.price.amount||0)*c]}),t.jsxRuntimeExports.jsxs("span",{className:h.oldPrice,children:["$ ",(n.compareAtPrice.amount||0)*c]})]}):t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(n.price.amount||0)*c]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",children:"Buy Now"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",children:"Add to Cart"})]})]})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ve;exports.ItemsSettings=tt;exports.LayoutSettings=vt;exports.ListingSelector=$s;exports.ProductOptions=Us;exports.RangeSelector=st;exports.TextSettings=W;exports.TypesText=Q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./root-CLYS1Wm7.cjs"),m=require("react"),ot="_accordion_2tiiw_1",it="_header_2tiiw_9",ct="_icon_2tiiw_16",rt="_open_2tiiw_19",at="_content_2tiiw_23",V={accordion:ot,header:it,icon:ct,open:rt,content:at},lt=({title:x,content:n})=>{const[s,o]=m.useState(!1),[c,r]=m.useState(0),e=m.useRef(null),i=()=>{o(!s)};return m.useEffect(()=>{e.current&&r(s?e.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:V.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:V.header,onClick:i,children:[t.jsxRuntimeExports.jsx("h3",{children:x}),t.jsxRuntimeExports.jsx("div",{className:t.clx(V.icon,{[V.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:e,className:V.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{children:n})})]})},ut="_wrapper_1g82c_2",xt="_alignmentBlock_1g82c_8",dt="_title_1g82c_15",pt="_subtitle_1g82c_22",mt="_alignmentContent_1g82c_29",_t="_alignments_1g82c_35",ht="_alignment_1g82c_8",jt="_circle_1g82c_54",gt="_paddings_1g82c_61",bt="_padding_1g82c_61",ft="_input_1g82c_79",S={wrapper:ut,alignmentBlock:xt,title:dt,subtitle:pt,alignmentContent:mt,alignments:_t,alignment:ht,circle:jt,paddings:gt,padding:bt,input:ft},Rt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],vt=["left","top","right","bottom"],Et=x=>{const{alignment:n,padding:s,setPadding:o,setAlignment:c}=x;function r(){switch(n){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 e(i){switch(i){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:S.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:S.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:S.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:S.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:S.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:S.alignments,children:Rt.map(i=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{c(i)},className:S.alignment,children:[i!==n&&t.jsxRuntimeExports.jsx("div",{className:S.circle}),i===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},i))}),t.jsxRuntimeExports.jsx("div",{className:S.paddings,children:vt.map(i=>t.jsxRuntimeExports.jsxs("label",{className:S.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:e(i),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(s[i]),onChange:u=>o({...s,[i]:Number(u)}),paddingless:!0,borderless:!0})]}))})]})]})]})},kt="_subtitle_2zbxx_1",yt="_header_2zbxx_8",$t="_text_2zbxx_9",It="_top_2zbxx_16",Nt="_itemsBlock_2zbxx_23",G={subtitle:kt,header:yt,text:$t,top:It,itemsBlock:Nt},wt="_typeTexts_3zlec_1",Ct="_block_3zlec_7",Bt="_active_3zlec_18",K={typeTexts:wt,block:Ct,active:Bt},Pt=["bold","italic","underline","strike-through","code"],W=x=>{const{typesText:n,setTypesText:s}=x;function o(c){switch(c){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:K.typeTexts,children:Pt.map(c=>t.jsxRuntimeExports.jsx("div",{className:t.clx(K.block,{[K.active]:n.includes(c)}),onClick:()=>{const r=[...n];if(r.includes(c)){const e=r.filter(i=>i!==c);s(e)}else r.push(c),s(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:o(c),fill:n.includes(c)?"#252525":"#757575",width:20,height:20})},String(c)))})},Z=x=>{const{typesText:n,isActiveText:s,setIsActiveText:o,text:c,setText:r,setTypesText:e,title:i,subtitle:u="Items"}=x;return t.jsxRuntimeExports.jsxs("div",{className:G.text,children:[(i||s!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:G.top,children:[i&&t.jsxRuntimeExports.jsx("h3",{className:G.title,children:i}),s!==void 0&&o&&t.jsxRuntimeExports.jsx(t.Switch,{current:s,onChange:R=>o(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:G.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:u}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>r(R),value:c,maxLength:150}),t.jsxRuntimeExports.jsx(W,{typesText:n,setTypesText:e})]})]})},Tt="_subtitle_11qr1_1",St="_header_11qr1_8",At="_text_11qr1_9",Ot="_productsBlock_11qr1_10",Dt="_top_11qr1_22",Lt="_itemsBlock_11qr1_29",qt="_typeTexts_11qr1_35",Mt="_block_11qr1_41",Ht="_active_11qr1_52",zt="_products_11qr1_10",Ut="_product_11qr1_10",Ft="_button_11qr1_70",Vt="_disabled_11qr1_80",Gt="_image_11qr1_84",Xt="_info_11qr1_91",Yt="_name_11qr1_102",Jt="_buttons_11qr1_106",Kt="_modal_11qr1_112",Qt="_link_11qr1_130",Wt="_modalOptions_11qr1_136",$={subtitle:Tt,header:St,text:At,productsBlock:Ot,top:Dt,itemsBlock:Lt,typeTexts:qt,block:Mt,active:Ht,products:zt,product:Ut,button:Ft,disabled:Vt,image:Gt,info:Xt,name:Yt,buttons:Jt,modal:Kt,link:Qt,modalOptions:Wt},Zt=x=>{const{activeItem:n,setActiveItem:s,popupPosition:o,modalOptions:c,setIsOpenModal:r}=x;return t.jsxRuntimeExports.jsxs("div",{className:$.modal,onClick:e=>{e.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),r(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:$.modalOptions,children:c.map(e=>{if(e.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:i=>{const u={...n,[e.field]:i};s(u)}});if(e.type==="text")return t.jsxRuntimeExports.jsx(Z,{typesText:n[e.field.type],setTypesText:i=>{const u={...n,[e.field.type]:i};s(u)},text:n[e.field.text]||"",setText:i=>{const u={...n,[e.field.text]:i};s(u)},subtitle:e.label});if(e.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:i=>{const u={...n,[e.field]:i};s(u)},value:n[e.field]||"",label:e.label,placeholder:e.placeholder});if(e.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:$.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:i=>{const u={...n,[e.field.text]:i};s(u)},value:n[e.field.text]||"",label:e.inputLabel,placeholder:e.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!n[e.field.switch]||!1,label:e.switchLabel,onChange:i=>{const u={...n,[e.field.switch]:i};s(u)}})]});if(e.type==="list")return t.jsxRuntimeExports.jsx(et,{items:n[e.field]||[],setItems:i=>{const u={...n,[e.field]:i};s(u)},itemsType:"select",draggable:e.draggable||!1,itemsOptions:e.itemsOptions,deletable:e.deletable||!1,editable:!1,subtitle:e.label});if(e.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:e.itemsOptions,onChange:i=>{const u={...n,[e.field]:i};s(u)},label:e.label,value:n[e.field]||"String",leftAddon:e.leftAddon&&e.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:n[e.field]})})})})]})},te="_other_1wtgi_1",ee="_subtitle_1wtgi_7",se="_items_1wtgi_14",Q={other:te,subtitle:ee,items:se},tt=x=>{const{items:n,title:s="Other"}=x;return t.jsxRuntimeExports.jsxs("div",{className:Q.other,children:[t.jsxRuntimeExports.jsx("h5",{className:Q.subtitle,children:s}),t.jsxRuntimeExports.jsx("div",{className:Q.items,children:n.map(o=>t.jsxRuntimeExports.jsx(t.Switch,{current:o.isItem,onChange:c=>o.setIsItem(c),label:o.label,hasBackground:!0,paddingless:!1}))})]})},ne=x=>{const{index:n,moveProduct:s,children:o}=x,[,c]=t.useDrop({accept:"product",hover(i){i.index!==n&&(s(i.index,n),i.index=n)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:n},collect:i=>({isDragging:i.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:i=>e(c(i)),className:`${$.product} ${r?$.dragging:""}`,children:o})},et=x=>{const{isActiveItems:n,setIsActiveItems:s,items:o,setItems:c,other:r,title:e,subtitle:i,editable:u=!0,draggable:R=!1,withImage:p=!1,deletable:g=!0,addable:j=!0,itemsType:E,itemsPlaceholder:l="",itemsOptions:_,hasRangeSelector:w=!1,rangeSelectorOptions:z,modalOptions:U,addableOptions:v={},limit:P}=x,[O,D]=m.useState(null),[J,Y]=m.useState({top:0,left:0}),[d,b]=m.useState(!1),C=(a,I)=>{const B=[...o],[f]=B.splice(a,1);B.splice(I,0,f),c(B)};m.useEffect(()=>{const a=()=>{D(null),b(!1)};return document.body.addEventListener("click",a),D(null),b(!1),()=>{D(null),b(!1),document.body.removeEventListener("click",a)}},[]),m.useEffect(()=>{if(O){const a=[...o].map(I=>I.id===O.id?O:I);c(a)}},[O]);const k=(a,I)=>{a.stopPropagation(),b(!0);const B=a.target.getBoundingClientRect(),f=500,F=window.innerHeight;let A=B.top+window.scrollY;A+f>F&&(A=F-f-20),Y({top:A-80,left:B.left-30}),D(I)};function M(a){if(p)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const T=(a,I)=>{const B=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})}),E==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:f=>{const A=[...o].map(L=>L.id===a.id?{...a,name:f}:L);D({...a,name:f}),c([...A])},value:a.name,options:_,leftAddon:M(a.images)}),E==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:f=>{const A=[...o].map(L=>L.id===a.id?{...a,name:f}:L);c([...A])},value:a.name,placeholder:l}),E==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:f=>{const A=[...o].map(L=>L.id===a.id?{...a,images:f}:L);c([...A])}}),t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[u&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:f=>k(f,a)}),g&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(o.filter(f=>f.id!==a.id))})]})]});return R?t.jsxRuntimeExports.jsx(ne,{product:a,index:I,moveProduct:C,children:B},a.id):t.jsxRuntimeExports.jsx("div",{className:$.product,children:B},a.id)};return t.jsxRuntimeExports.jsxs("div",{className:$.productsBlock,children:[(e||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:$.title,children:e}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:a=>s==null?void 0:s(a)})]}),O&&u&&U&&d&&t.jsxRuntimeExports.jsx(Zt,{activeItem:O,setActiveItem:D,popupPosition:J,modalOptions:U,setIsOpenModal:b}),w&&z&&t.jsxRuntimeExports.jsx(nt,{...z}),t.jsxRuntimeExports.jsxs("div",{className:$.products,children:[i&&t.jsxRuntimeExports.jsx("h5",{className:$.subtitle,children:i}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:o.map((a,I)=>T(a,I))}):o.map((a,I)=>T(a,I)),j&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx($.button,{[$.disabled]:!!(P&&P<=o.length)}),size:"s",disabled:!!(P&&P<=o.length),onClick:()=>{const a=[...o];E==="select"?a.push({name:_[0]||`Product ${o.length+1}`,id:t.v4(),...v}):E==="input"?a.push({name:"",id:t.v4(),...v}):a.push({name:`Image ${o.length+1}`,id:t.v4(),...v}),c(a)},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(tt,{items:r})]})},oe="_subtitle_41klp_1",ie="_header_41klp_8",ce="_text_41klp_9",re="_productsBlock_41klp_10",ae="_buttonsBlock_41klp_11",le="_top_41klp_21",ue="_itemsBlock_41klp_28",xe="_typeTexts_41klp_34",de="_block_41klp_40",pe="_active_41klp_51",me="_products_41klp_10",_e="_product_41klp_10",he="_button_41klp_11",je="_image_41klp_79",ge="_info_41klp_86",be="_name_41klp_97",fe="_buttons_41klp_11",Re="_modal_41klp_107",ve="_other_41klp_124",Ee="_options_41klp_130",H={subtitle:oe,header:ie,text:ce,productsBlock:re,buttonsBlock:ae,top:le,itemsBlock:ue,typeTexts:xe,block:de,active:pe,products:me,product:_e,button:he,image:je,info:ge,name:be,buttons:fe,modal:Re,other:ve,options:Ee},ke=x=>{const{activeButton:n,setActiveButton:s,popupPosition:o}=x,[c,r]=m.useState(n.typesText),[e,i]=m.useState(n.destination),[u,R]=m.useState(n.link||""),[p,g]=m.useState(n.text||"");return m.useEffect(()=>{s({...n,...{text:p,link:u,destination:e,typesText:c}})},[c,e,u,p]),t.jsxRuntimeExports.jsxs("div",{className:H.modal,onClick:j=>{j.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:H.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:j=>i(j),options:["Go to Page","Open Link"],value:e}),e==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:j=>R(j),value:u,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:j=>g(j),value:p,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(W,{typesText:c,setTypesText:r})]})]})},ye="_subtitle_1y5sw_1",$e="_header_1y5sw_8",Ie="_text_1y5sw_9",Ne="_productsBlock_1y5sw_10",we="_buttonsBlock_1y5sw_11",Ce="_top_1y5sw_22",Be="_itemsBlock_1y5sw_29",Pe="_typeTexts_1y5sw_35",Te="_block_1y5sw_41",Se="_active_1y5sw_52",Ae="_products_1y5sw_10",Oe="_product_1y5sw_10",De="_button_1y5sw_11",Le="_image_1y5sw_80",qe="_info_1y5sw_87",Me="_name_1y5sw_98",He="_buttons_1y5sw_11",ze="_modal_1y5sw_108",Ue="_other_1y5sw_125",Fe="_options_1y5sw_131",X={subtitle:ye,header:$e,text:Ie,productsBlock:Ne,buttonsBlock:we,top:Ce,itemsBlock:Be,typeTexts:Pe,block:Te,active:Se,products:Ae,product:Oe,button:De,image:Le,info:qe,name:Me,buttons:He,modal:ze,other:Ue,options:Fe},st=x=>{const{buttons:n,setButtons:s,deletable:o=!0,addable:c=!0}=x,[r,e]=m.useState(null),[i,u]=m.useState({top:0,left:0});m.useEffect(()=>{const p=()=>{e(null)};return document.body.addEventListener("click",p),e(null),()=>{e(null),document.body.removeEventListener("click",p)}},[]),m.useEffect(()=>{if(r){const p=[...n].map(g=>g.id===r.id?r:g);s(p)}},[r]);const R=(p,g)=>{p.stopPropagation();const j=p.target.getBoundingClientRect(),E=490,l=window.innerHeight;let _=j.top+window.scrollY;_+E>l&&(_=l-E-20),u({top:_,left:j.left-30}),e(g)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),n.map(p=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:g=>{const E=[...n].map(l=>l.id===p.id?{...p,type:g}:l);s(E)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:g=>{R(g,p)}}),o&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const g=n.filter(j=>j.id!==p.id);s(g)},width:20,height:20,fill:"#C12A2A"})]})]},p.id)),r&&t.jsxRuntimeExports.jsx(ke,{activeButton:r,setActiveButton:e,popupPosition:i}),c&&t.jsxRuntimeExports.jsxs(t.Button,{className:X.button,size:"s",onClick:()=>{const p=[...n];p.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:""}),s(p)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Ve=x=>{const{isActiveButtons:n,setIsActiveButtons:s,buttons:o,setButtons:c}=x;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:H.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:r=>s(r)})]}),t.jsxRuntimeExports.jsx(st,{buttons:o,setButtons:c})]})})},Ge="_wrapper_tn7gb_1",Xe="_subtitle_tn7gb_7",Ye="_content_tn7gb_14",Je="_range_tn7gb_21",Ke="_track_tn7gb_26",Qe="_progress_tn7gb_35",We="_dots_tn7gb_45",Ze="_dot_tn7gb_45",ts="_active_tn7gb_62",es="_input_tn7gb_74",ss="_countBlock_tn7gb_88",ns="_count_tn7gb_88",os="_controls_tn7gb_103",is="_button_tn7gb_108",y={wrapper:Ge,subtitle:Xe,content:Ye,range:Je,track:Ke,progress:Qe,dots:We,dot:Ze,active:ts,input:es,countBlock:ss,count:ns,controls:os,button:is},nt=x=>{const{label:n,min:s=1,max:o=4,step:c=1,count:r,setCount:e}=x,[i,u]=m.useState(!1),R=Array.from({length:(o-s)/c+1}),p=(r-s)/(o-s)*100,g=()=>{r<o&&e(r+c)},j=()=>{r>s&&e(r-c)},E=l=>{const _=s+l*c;e(_)};return t.jsxRuntimeExports.jsxs("div",{className:y.wrapper,children:[n&&t.jsxRuntimeExports.jsx("h5",{className:y.subtitle,children:n}),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:`${p}%`}}),t.jsxRuntimeExports.jsx("div",{className:y.dots,children:R.map((l,_)=>{const w=_<=(r-s)/c;return t.jsxRuntimeExports.jsx("button",{onClick:()=>E(_),className:t.clx(y.dot,{[y.active]:w,[y.inactive]:!w,[y.dragging]:i}),"aria-label":`Set value to ${s+_*c}`},_)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:s,max:o,step:c,value:r,onChange:l=>e(Number(l.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:y.input})]}),t.jsxRuntimeExports.jsxs("div",{className:y.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:s,max:o,paddingless:!0,onChange:l=>{const _=Number(l);_>o?e(o):_<s?e(s):e(_)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:y.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:g,disabled:r>=o,className:y.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:j,disabled:r<=s,className:y.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},cs="_subtitle_1nl8x_1",rs="_header_1nl8x_8",as="_text_1nl8x_9",ls="_productsBlock_1nl8x_10",us="_top_1nl8x_22",xs="_itemsBlock_1nl8x_29",ds="_typeTexts_1nl8x_35",ps="_block_1nl8x_41",ms="_active_1nl8x_52",_s="_products_1nl8x_10",hs="_product_1nl8x_10",js="_button_1nl8x_70",gs="_image_1nl8x_80",bs="_info_1nl8x_87",fs="_name_1nl8x_98",Rs="_buttons_1nl8x_102",vs="_modal_1nl8x_108",Es="_link_1nl8x_126",ks="_modalOptions_1nl8x_132",N={subtitle:cs,header:rs,text:as,productsBlock:ls,top:us,itemsBlock:xs,typeTexts:ds,block:ps,active:ms,products:_s,product:hs,button:js,image:gs,info:bs,name:fs,buttons:Rs,modal:vs,link:Es,modalOptions:ks},ys=x=>{const{activeItem:n,setActiveItem:s,popupPosition:o,setIsOpenModal:c}=x;return t.jsxRuntimeExports.jsxs("div",{className:N.modal,onClick:r=>{r.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{c(!1),s(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:N.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:r=>{const e={...n,images:r,imagePath:r[0]};s(e)}})})]})},$s=x=>{const{index:n,moveProduct:s,children:o}=x,[,c]=t.useDrop({accept:"product",hover(i){i.index!==n&&(s(i.index,n),i.index=n)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:n},collect:i=>({isDragging:i.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:i=>e(c(i)),className:`${N.product} ${r?N.dragging:""}`,children:o})},Is=x=>{const{isActiveItems:n,setIsActiveItems:s,items:o,setItems:c,other:r,title:e,subtitle:i,editable:u=!0,draggable:R=!1,withImage:p=!1,deletable:g=!0,addable:j=!0,itemsType:E,itemsOptions:l}=x,[_,w]=m.useState(null),[z,U]=m.useState({top:0,left:0}),[v,P]=m.useState(!1),O=(d,b)=>{const C=[...o],[k]=C.splice(d,1);C.splice(b,0,k),c(C)};m.useEffect(()=>{const d=()=>{w(null),P(!1)};return document.body.addEventListener("click",d),w(null),P(!1),()=>{w(null),P(!1),document.body.removeEventListener("click",d)}},[]),m.useEffect(()=>{if(_){const d=[...o].map(b=>b.id===_.id?_:b);c(d)}},[_]);const D=(d,b)=>{d.stopPropagation();const C=d.target.getBoundingClientRect(),k=100,M=window.innerHeight;let T=C.top+window.scrollY;T+k>M&&(T=M-k-20),P(!0),U({top:T-80,left:C.left-30}),w(b)};function J(d){if(p)return d?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${d}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=(d,b)=>{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})}),E==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:k=>{const M=[...o],T=Number(k.split(" ")[1]),a=l.find(f=>f.id===T);if(!a)return;const I={...a.productData.stats,newPrice:a.productData.minPrice.amount,oldPrice:a.productData.compareAtPrice.amount},B=M.map(f=>f.id===d.id?{...d,name:k,listingId:T,stats:I}:f);w({...d,name:k,listingId:T}),c([...B])},value:d.name,options:[...l.map(k=>`Product ${k.id}`)],leftAddon:J(d.images[0])}),t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[u&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:k=>D(k,d)}),g&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(o.filter(k=>k.id!==d.id))})]})]});return R?t.jsxRuntimeExports.jsx($s,{product:d,index:b,moveProduct:O,children:C},d.id):t.jsxRuntimeExports.jsx("div",{className:N.product,children:C},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:N.productsBlock,children:[(e||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:N.title,children:e}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:d=>s==null?void 0:s(d)})]}),v&&_&&t.jsxRuntimeExports.jsx(ys,{activeItem:_,setActiveItem:w,setIsOpenModal:P,popupPosition:z}),t.jsxRuntimeExports.jsxs("div",{className:N.products,children:[i&&t.jsxRuntimeExports.jsx("h5",{className:N.subtitle,children:i}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:o.map((d,b)=>Y(d,b))}):o.map((d,b)=>Y(d,b)),j&&t.jsxRuntimeExports.jsxs(t.Button,{className:N.button,size:"s",onClick:()=>{const d=[...o],b=l[0].id;d.push({name:`Product ${b}`,id:t.v4(),listingId:b,imagePath:"",images:[],stats:{...l[0].productData.stats,newPrice:l[0].productData.minPrice.amount,oldPrice:l[0].productData.compareAtPrice.amount}}),c(d)},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(tt,{items:r})]})},Ns="_options_163bj_1",ws="_price_163bj_12",Cs="_oldPrice_163bj_18",Bs="_newPrice_163bj_26",Ps="_meta_163bj_33",Ts="_info_163bj_39",Ss="_infoRight_163bj_46",As="_buttons_163bj_52",Os="_variants_163bj_59",Ds="_variant_163bj_59",Ls="_stock_163bj_74",qs="_variantInfo_163bj_81",Ms="_quantity_163bj_87",Hs="_count_163bj_93",zs="_button_163bj_52",Us="_activeVariant_163bj_110",Fs="_chargeTypes_163bj_114",Vs="_charge_163bj_114",Gs="_chargeActive_163bj_131",h={options:Ns,price:ws,oldPrice:Cs,newPrice:Bs,meta:Ps,info:Ts,infoRight:Ss,buttons:As,variants:Os,variant:Ds,stock:Ls,variantInfo:qs,quantity:Ms,count:Hs,button:zs,activeVariant:Us,chargeTypes:Fs,charge:Vs,chargeActive:Gs},Xs=x=>{const{variants:n}=x,[s,o]=m.useState(n[0]),c=t.useNavigate(),[r,e]=m.useState(1),{reset:i,addProductToCart:u,cart:R,getPages:p}=t.useCart();function g(){if(R.parts.length===0){const l=encodeURIComponent("product/subscription-test");p(l).then(()=>{console.log(x.id,s.id,r),u({productId:x.id,productVariantId:s.id,quantity:r})})}}function j(){i(),g(),c("/checkout")}function E(l){if(l>=864e5){const v=Math.floor(l/864e5);return`${v} ${v===1?"day":"days"}`}else if(l>=36e5){const v=Math.floor(l/36e5);return`${v} ${v===1?"hour":"hours"}`}else if(l>=6e4){const v=Math.floor(l/6e4);return`${v} ${v===1?"minute":"minutes"}`}else{const v=Math.floor(l/1e3);return`${v} ${v===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:h.options,children:[t.jsxRuntimeExports.jsx("div",{className:h.chargeTypes,children:s.chargeTypes?s.chargeTypes.map(l=>t.jsxRuntimeExports.jsx("div",{children:l})):t.jsxRuntimeExports.jsx("div",{className:t.clx(h.charge,h.chargeActive),children:"One-Time"})}),t.jsxRuntimeExports.jsx("div",{className:h.variants,children:n.map(l=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(h.variant,{[h.activeVariant]:s.id===l.id}),onClick:()=>o(l),children:[t.jsxRuntimeExports.jsxs("div",{className:h.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:h.title,children:l.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",l.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs("span",{className:h.stock,children:[l.quantity.restrictions.max||0," in stock"]})})]}))}),t.jsxRuntimeExports.jsxs("div",{className:h.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{r>1?e(l=>l-1):e(1)},className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:h.count,children:r}),t.jsxRuntimeExports.jsx("div",{onClick:()=>e(l=>l+1),className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:h.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:h.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:s.deliveryTime===0?"Instant":E(s.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:h.infoRight,children:s.compareAtPrice&&(s.compareAtPrice.amount||0)-(s.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:h.price,children:[t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(s.price.amount||0)*r]}),t.jsxRuntimeExports.jsxs("span",{className:h.oldPrice,children:["$ ",(s.compareAtPrice.amount||0)*r]})]}):t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(s.price.amount||0)*r]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>j(),children:"Buy Now"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>g(),children:"Add to Cart"})]})]})},Ys="_button_pstfl_1",Js="_login_pstfl_11",Ks="_signUp_pstfl_15",Qs="_buttons_pstfl_20",q={button:Ys,login:Js,signUp:Ks,buttons:Qs},Ws=x=>{const{shopping:n,signUp:s}=x,o=t.useNavigate();function c(r){o(r)}return t.jsxRuntimeExports.jsxs("div",{className:q.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:q.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"#252525"})}),t.jsxRuntimeExports.jsx("div",{className:t.clx(q.button,q.login),onClick:()=>c("/customer-dash"),children:"Login"}),s&&t.jsxRuntimeExports.jsx("div",{className:t.clx(q.button,q.login,q.signUp),onClick:()=>c("/customer-dash"),children:"Sign Up"})]})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=lt;exports.ButtonTypeSettings=st;exports.ButtonsSettings=Ve;exports.HeaderButtons=Ws;exports.ItemsSettings=et;exports.LayoutSettings=Et;exports.ListingSelector=Is;exports.ProductOptions=Xs;exports.RangeSelector=nt;exports.TextSettings=Z;exports.TypesText=W;
|