@billgangcom/theme-lib 1.78.2 → 1.78.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.
@@ -96,7 +96,7 @@
96
96
  `,n+=` --border-sm: var(--scale-1);
97
97
  `,n+=` --border-md: var(--scale-2);
98
98
  `,n+=` --border-lg: var(--scale-4);
99
- `,n+="}",n},pc=e=>{const t=document.getElementById("dynamic-styles");if(t)t.innerHTML=e;else{const n=document.createElement("style");n.id="dynamic-styles",n.innerHTML=e,document.head.appendChild(n)}},zr=new Set,mc=e=>{const t=new Map;return Object.entries(e).forEach(([n,r])=>{typeof r=="object"&&Object.entries(r).forEach(([o,i])=>{var a,u;if(i&&i.font){const c=i.font.replace(/\s+/g,"+");t.has(c)||t.set(c,new Set),(a=t.get(c))==null||a.add(i.weight),(u=t.get(c))==null||u.add(i.boldWeight)}})}),t},fc=e=>{const t=new Map;return Object.entries(e).forEach(([n,r])=>{typeof r=="object"&&Object.keys(r).forEach(o=>{var i;if(o==="font"&&r[o]){const a=r[o].replace(/\s+/g,"+");t.has(a)||t.set(a,new Set),(i=t.get(a))==null||i.add("400")}})}),t},gc=e=>{zr.forEach(t=>{if(!e.has(t)){const n=document.querySelector(`link[data-font="${t}"]`);n&&n.remove(),zr.delete(t)}})},xc=e=>{const t=new Set;e.forEach((n,r)=>{const o=Array.from(n).join(";"),i=`${r}:wght@${o}`;if(t.add(i),!zr.has(i)){const a=document.createElement("link");a.rel="stylesheet",a.href=`https://fonts.googleapis.com/css2?family=${i}&display=swap`,a.setAttribute("data-font",i),document.head.appendChild(a),zr.add(i)}}),gc(t)},Ec=e=>{if(e.fonts){const t=mc(e.fonts.desktop),n=fc(e.buttons),r=new Map(t);n.forEach((o,i)=>{if(r.has(i)){const a=r.get(i);o.forEach(u=>a==null?void 0:a.add(u))}else r.set(i,new Set(o))}),xc(r)}};function bc(){try{const{editBlock:e,currentBlock:t,blocks:n,setHeader:r,setFooter:o,setAnnouncement:i}=s.useLayersStore.getState(),{currentPage:a,pages:u}=s.usePagesStore.getState(),{currentInstance:c,settingsInstance:d}=s.useBlocksStore.getState(),{setSettings:p}=s.useSettingsStore.getState();if(t||p(d),c&&t){if(t==="header")r(c);else if(t==="footer")o(c);else if(t==="announcement")i(c);else if(t==="header"||t==="footer"||t==="announcement")throw new Error(`Missing ${t} data.`)}if(c&&u&&t&&!["header","footer","announcement"].includes(t)){const h={blockSettings:{}};if(!c.blockSettings)throw new Error("currentInstance.blockSettings is undefined.");if(Object.keys(c.blockSettings).filter(f=>!["displayName","isAddable"].includes(f)).forEach(f=>{h.blockSettings[f]=c.blockSettings[f]}),!u[a])throw new Error(`Page "${a}" does not exist.`);if(!n[u[a].path].data||!n[u[a].path].data[t])throw new Error(`Layer or block for page "${u[a].path}" and block "${t}" does not exist.`);e(u[a].path,t,{name:n[u[a].path].data[t].name,value:h})}}catch(e){console.error("Error in hotReload function:",e)}}const Ic=()=>{const e=s.useApiStore.getState().apiUrls,t=s.useNavigate(),{notifications:n,setNotifications:r}=s.useNotificationStore();return async(o,i,a,u,c)=>{const d=s.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,p=`${e.slApi}/v1/public/${d}/tickets`;try{const h=await s.request({method:"post",url:p,body:{title:o,firstMessage:i,email:u,recaptcha:a,tsId:c},withToken:!1});return r([...n,{id:s.v4(),message:"Ticket created successfully. We will contact you by mail",status:"success"}]),t(`/ticket/${h.data.id}/${h.data.accessToken}`),h}catch(h){r([...n,{id:s.v4(),message:`Error: ${h}. Please try again later.`,status:"error"}])}}},Tc=()=>{const{pages:e}=s.usePagesStore(),[t,n]=k.useState(e);return k.useEffect(()=>{n(e)},[e]),t},_c="_tooltip_4hruj_1",Cc={tooltip:_c},Tn=e=>{const{text:t}=e,{setShowTooltip:n}=s.useTooltipStore();return k.useEffect(()=>(n(!0),()=>{n(!1)}),[]),s.jsxRuntimeExports.jsx("div",{className:Cc.tooltip,children:t})},Sc=()=>{const{undo:e,redo:t,past:n,future:r}=s.useHistoryStore(),[o,i]=k.useState(!1),[a,u]=k.useState(!1),[c,d]=k.useState(!1),[p,h]=k.useState(!1),[f,m]=k.useState(null),{notifications:x,setNotifications:g}=s.useNotificationStore();return k.useEffect(()=>{i(n.length===0)},[n]),k.useEffect(()=>{u(r.length===0)},[r]),s.jsxRuntimeExports.jsxs("div",{className:Dn.buttons,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(Dn.button,{[Dn.disabled]:o}),onMouseEnter:()=>{const C=setTimeout(()=>{h(!0),d(!1)},200);m(C)},onMouseLeave:()=>{f&&clearTimeout(f),h(!1),d(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),g([...x,{id:s.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),p&&s.jsxRuntimeExports.jsx(Tn,{text:o?"Nothing to undo":"Click to undo changes"})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(Dn.button,{[Dn.disabled]:a}),onMouseEnter:()=>{const C=setTimeout(()=>{d(!0),h(!1)},200);m(C)},onMouseLeave:()=>{f&&clearTimeout(f),d(!1),h(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(t(),g([...x,{id:s.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),c&&s.jsxRuntimeExports.jsx(Tn,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},yc="_devices_ls6k9_1",kc="_device_ls6k9_1",Rc="_active_ls6k9_27",zs={devices:yc,device:kc,active:Rc},Ac=()=>s.jsxRuntimeExports.jsx("div",{className:zs.devices,children:Tl.map(e=>s.jsxRuntimeExports.jsx(Nc,{device:e}))}),Nc=e=>{const{device:t}=e,{currentDevice:n,setCurrentDevice:r}=s.useDeviceStore(),[o,i]=k.useState(!1),[a,u]=k.useState(null);return s.jsxRuntimeExports.jsxs("div",{className:s.clx(zs.device,{[zs.active]:n.value===t.value}),onClick:()=>r(t),onMouseEnter:()=>{const c=setTimeout(()=>{i(!0)},200);u(c)},onMouseLeave:()=>{a&&clearTimeout(a),i(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:t.icon,fill:n.value===t.value?"#252525":"#757575",width:20,height:20}),o&&s.jsxRuntimeExports.jsx(Tn,{text:`Switch to ${t.value} view`})]},t.value)},wc="_preview_1x3m8_2",Lc="_active_1x3m8_19",hs={preview:wc,active:Lc},jc=()=>{const{onPreview:e}=s.usePreviewStore(),[t,n]=k.useState(!1),[r,o]=k.useState(null);return s.jsxRuntimeExports.jsxs("a",{href:"/",className:s.clx(hs.preview,{[hs.active]:e}),target:"_blank",onMouseEnter:()=>{const i=setTimeout(()=>{n(!0)},200);o(i)},onMouseLeave:()=>{r&&clearTimeout(r),n(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUpRight",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:hs.text,children:"Preview"}),t&&s.jsxRuntimeExports.jsx(Tn,{text:"Open draft theme in new tab"})]})},vc="_settings_u4cv4_1",Pc={settings:vc},Dc="_pages_167qp_1",Oc="_text_167qp_21",Bc="_modal_167qp_27",Mc="_open_167qp_46",Fc="_page_167qp_1",Hc="_hoverable_167qp_61",Uc="_separator_167qp_65",$c="_button_167qp_70",zc="_items_167qp_85",it={pages:Dc,default:"_default_167qp_5",text:Oc,modal:Bc,open:Mc,page:Fc,hoverable:Hc,separator:Uc,button:$c,items:zc},ca=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/pages/${encodeURIComponent(e)}`;return await s.request({url:o,withToken:!0,method:"delete"})},Wc=()=>{const{currentPage:e,setCurrentPage:t,setIsOpenModal:n,pages:r,setIsEdit:o,setEditedPage:i,deletePage:a,setIsOpenSelectModal:u}=s.usePagesStore(),{deletePage:c,setCurrentBlock:d}=s.useLayersStore(),[p,h]=k.useState(null),{setTitle:f,setDescription:m,setOnConfirm:x}=s.useConfirmationModalStore(),[g,C]=k.useState(!1),b=k.useRef(null);s.useOnClickOutside(b,()=>{g&&C(!1)}),k.useEffect(()=>{g?u(!0):setTimeout(()=>{u(!1)},300)},[g]);const A=y=>y?y.replace(/_/g," ").split(" ").map(P=>P.charAt(0).toUpperCase()+P.slice(1)).join(" "):"";return s.jsxRuntimeExports.jsxs("div",{className:it.pages,ref:b,children:[s.jsxRuntimeExports.jsxs("div",{className:it.default,onClick:y=>{y.stopPropagation(),C(P=>!P)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:r&&r[e]&&r[e].icon||"File",fill:"#252525",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:it.text,children:r&&r[e]&&s.defaultPagePaths.includes(r[e].path)?`${A(r[e].name)} page`:r&&r[e]&&r[e].name}),s.jsxRuntimeExports.jsx("div",{style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretDown",width:20,height:20})})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(it.modal,{[it.open]:g}),onClick:y=>y.stopPropagation(),children:[r&&s.jsxRuntimeExports.jsx("div",{className:it.items,children:Object.keys(r).map(y=>{const P=r[y];return s.jsxRuntimeExports.jsxs("div",{className:s.clx(it.page,{[it.hoverable]:p===y}),onMouseEnter:()=>h(y),onMouseLeave:()=>h(null),onClick:()=>{h(null),o(!1),d(null),t(y),C(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:P.icon,fill:"#252525"}),s.jsxRuntimeExports.jsx("span",{className:it.text,children:s.defaultPagePaths.includes(P.path)?`${A(P.name)} page`:P.name}),p===y&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Gear",fill:"#757575",onClick:L=>{L.stopPropagation(),o(!0),i(y),n(!0)}}),!s.defaultPagePaths.includes(P.path)&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",onClick:L=>{L.stopPropagation(),f("Delete Page"),m(`Are you sure you want to delete ${P.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),x(()=>{L.stopPropagation(),r[e].path===P.path&&t(Object.keys(r)[0]),a(y),c(P.name),ca(P.path)})}})]}),r[e]&&r[e].name===P.name&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"#FF3F19"})]},y)})}),s.jsxRuntimeExports.jsx("div",{className:it.separator}),s.jsxRuntimeExports.jsxs(s.Button,{className:it.button,onClick:y=>{y.stopPropagation(),n(!0)},size:"l",children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#ff3f19"}),s.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},qc="_zoom_fu0hj_1",Po={zoom:qc},Vc=()=>{const{zoomLevel:e,setZoomLevel:t}=s.usePreviewStore();return s.jsxRuntimeExports.jsxs("label",{htmlFor:"zoom",className:Po.zoom,children:[s.jsxRuntimeExports.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:s.jsxRuntimeExports.jsx(s.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),s.jsxRuntimeExports.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:n=>{const r=Number(n.target.value);t(r/100)},className:Po.input}),s.jsxRuntimeExports.jsx("span",{children:"%"})]})},Gc=()=>s.jsxRuntimeExports.jsxs("div",{className:Pc.settings,children:[s.jsxRuntimeExports.jsx(Wc,{}),s.jsxRuntimeExports.jsx(Vc,{})]}),Yc="_theme_1e5wq_1",Xc="_text_1e5wq_13",Do={theme:Yc,text:Xc},Qc=()=>s.jsxRuntimeExports.jsx("div",{className:Do.theme,children:s.jsxRuntimeExports.jsx("div",{className:Do.text,children:"Live Theme"})}),Kc=async(e,t,n)=>{const r=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),a=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${r}/drafts/${o}/${t}`;return await s.request({url:a,withToken:!0,method:e,body:n})};function On(e,t){try{return t.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(i=>i&&i.type===e).map(i=>{if(i.value===void 0)throw new Error("item.value is undefined.");return i.value}).flat()}).flat().filter(r=>r).map(r=>e==="ListingIds"?r.listingId:r)}catch(n){return console.error("Error in getValues function:",n),[]}}function Zc(e,t,n){return Jc(e,t)?(n.reviews||[]).length*3:0}function Jc(e,t){return t.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(i=>i&&i.type===e).map(i=>{if(i.value===void 0)throw new Error("item.value is undefined.");return i.value}).flat()}).flat().filter(r=>r).length>0}function ed(e,t){if(t){const n=Object.keys(t).find(r=>t[r].path===e);if(n)return t[n]}return null}const td=({setIsLoading:e,isLoading:t})=>{const{themeSettings:n}=s.useThemeSettingsStore(),{settings:r}=s.useSettingsStore(),[o,i]=k.useState(null),[a,u]=k.useState(!1),{setNotifications:c,notifications:d}=s.useNotificationStore(),{header:p,footer:h,announcement:f,blocks:m}=s.useLayersStore(),{pageContext:x}=s.usePagesStore(),{pages:g}=s.usePagesStore(),C=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const A=Object.keys(m).map(L=>{const R=ed(L,g);return m[L]&&m[L].data&&(R!=null&&R.path)?{id:R?R.id:L,name:R?R.name:L,path:R.path,layout:{...m[L]},neededProductIds:[...On("ProductId",Object.values(m[L].data))],neededCategoryIds:[...On("CategoryId",Object.values(m[L].data))],neededAnnouncementIds:[...On("AnnouncementId",Object.values(m[L].data))],neededListingIds:[...On("ListingIds",Object.values(m[L].data))],neededFaqIds:[...On("FaqsIds",Object.values(m[L].data))],neededReviewCount:Zc("ReviewCount",Object.values(m[L].data),x),seo:{pageTitle:R&&R.seo&&R.seo.pageTitle?R.seo.pageTitle:"",pageDescription:R&&R.seo&&R.seo.pageDescription?R.seo.pageDescription:""},isPrivate:!!(R&&R.visibility==="private")}:null}).filter(L=>L),y={settings:{...r==null?void 0:r.blockSettings},header:p,footer:h,announcement:f},{status:P}=await Kc("post","save",{themeSettings:n,settings:y,updatedPages:A});c([...d,{id:s.v4(),message:P===200?"Settings saved":"Error",status:P===200?"success":"error"}]),e(!1)}u(!0);const b=setTimeout(()=>{u(!1)},2e3);i(b)};return s.jsxRuntimeExports.jsx(s.Button,{onClick:C,disabled:t,children:s.jsxRuntimeExports.jsx("span",{style:{userSelect:"none"},children:"Save"})})},nd=()=>{const{isOpenSelectModal:e}=s.usePagesStore(),[t,n]=k.useState(!1),{showTooltip:r}=s.useTooltipStore();return s.jsxRuntimeExports.jsxs("div",{className:br.header,style:{zIndex:e?5e4:r?501:50},children:[s.jsxRuntimeExports.jsxs("div",{className:br.left,children:[s.jsxRuntimeExports.jsx(Ac,{}),s.jsxRuntimeExports.jsx(jc,{})]}),s.jsxRuntimeExports.jsx("div",{className:br.center,children:s.jsxRuntimeExports.jsx(Gc,{})}),s.jsxRuntimeExports.jsxs("div",{className:br.right,children:[s.jsxRuntimeExports.jsx(Qc,{}),s.jsxRuntimeExports.jsx(Sc,{}),s.jsxRuntimeExports.jsx(td,{setIsLoading:n,isLoading:t}),t&&s.jsxRuntimeExports.jsx(Vt,{})]})]})},rd="_exit_ovvox_1",sd="_text_ovvox_11",od="_exitLink_ovvox_16",ps={exit:rd,text:sd,exitLink:od},id=()=>s.jsxRuntimeExports.jsx("div",{className:ps.exit,children:s.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:ps.exitLink,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"SignOut",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:ps.text,children:"Exit"})]})}),ad="_navbar_1podc_1",ud="_main_1podc_6",ld="_block_1podc_13",cd="_active_1podc_29",Tr={navbar:ad,main:ud,block:ld,active:cd},dd=()=>{const{activeBlock:e}=s.useNavbarStore(),{setActiveBlock:t}=s.useBlocksStore(),{setCurrentBlock:n}=s.useLayersStore(),{setActiveBlock:r}=s.useThemeSettingsStore(),{setActiveBlock:o}=s.usePreviewStore(),i=s.useNavigate();function a(u){switch(t(null),n(null),r(null),o({id:null,neededScroll:!1}),u.name){case"Layers":i("/admin/builder");break;case"Add":i("/admin/builder/add");break;case"Theme":i("/admin/builder/theme");break;case"Settings":i("/admin/builder/settings");break}}return s.jsxRuntimeExports.jsxs("div",{className:Tr.navbar,children:[s.jsxRuntimeExports.jsx(id,{}),s.jsxRuntimeExports.jsx("div",{className:Tr.main,children:s.navbarBlocks.map(u=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(Tr.block,{[Tr.active]:e.icon===u.icon}),onClick:()=>a(u),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:u.icon,fill:e.icon===u.icon?"#252525":"#757575"}),s.jsxRuntimeExports.jsx("span",{children:u.name})]},u.icon))})]})},hd="_preview_gb2ye_1",pd="_main_gb2ye_15",md="_content_gb2ye_25",fd="_loading_gb2ye_34",gd="_previewLoading_gb2ye_65",Bn={preview:hd,main:pd,content:md,loading:fd,previewLoading:gd},xd="_header_11zku_2",Ed="_circles_11zku_16",bd="_circle_11zku_16",Id="_red_11zku_32",Td="_green_11zku_36",_d="_yellow_11zku_40",Cd="_input_11zku_44",Sd="_main_11zku_55",yd="_text_11zku_63",kd="_copy_11zku_75",gt={header:xd,circles:Ed,circle:bd,red:Id,green:Td,yellow:_d,input:Cd,main:Sd,text:yd,copy:kd},Rd=["red","yellow","green"],Ad=()=>{const{currentDevice:e}=s.useDeviceStore(),t=(o,i)=>o.length>i?o.slice(0,i)+"...":o,{notifications:n,setNotifications:r}=s.useNotificationStore();return s.jsxRuntimeExports.jsxs("div",{className:gt.header,children:[s.jsxRuntimeExports.jsx("div",{className:gt.circles,children:Rd.map(o=>s.jsxRuntimeExports.jsx("div",{className:s.clx(gt.circle,{[gt.red]:o==="red",[gt.yellow]:o==="yellow",[gt.green]:o==="green"})},o))}),s.jsxRuntimeExports.jsx("div",{className:gt.input,children:s.jsxRuntimeExports.jsxs("div",{className:gt.main,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),s.jsxRuntimeExports.jsx("span",{className:gt.text,children:e.value==="mobile"?t(window.location.origin,35):e.value==="desktop"?t(window.location.origin,200):t(window.location.origin,100)})]})}),s.jsxRuntimeExports.jsx(s.Button,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),r([...n,{id:s.v4(),status:"success",message:"Domain copied to clipboard"}])},className:gt.copy,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Ct=e=>e?e.replace(/_/g," ").split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" and "):"",da=(e,t,n,r,o,i,a)=>{const u=e.currentTarget.getBoundingClientRect(),c=window.innerHeight-u.bottom,d=u.top,p=window.innerWidth-u.right,h=u.left;let f,m;return f=u.bottom+r+window.scrollY,m=u.left,(c<t||c<o)&&(d>=t+a?f=u.top-t-r+window.scrollY:f=window.scrollY+a),f-window.scrollY<a&&(f=window.scrollY+a),(p<n||p<i)&&(h>=n?m=u.right-n:m=(window.innerWidth-n)/2),m<u.right+i&&(m=u.right+i),m<u.right&&m+n>u.left&&f<u.bottom&&f+t>u.top&&(p>=n+i?m=u.right+r+i:c>=t?f=u.bottom+r+window.scrollY:(f=window.scrollY+a,m=(window.innerWidth-n)/2)),{top:f,left:m}},Nd="_results_1pahy_1",Oo={results:Nd};function wd(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Bo(e,t){return e?Object.keys(e||{}).reduce((n,r)=>(wd(r,t)&&n.push({name:r,displayName:s.getDisplayName(r,t)}),n),[]):[]}const Ld="_product_yggw5_1",jd="_name_yggw5_15",Mo={product:Ld,name:jd},vd=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:r,setActiveBlock:o}=s.useBlocksStore(),{hideModal:i,hoverBlockId:a,isModalVisible:u,showPreview:c,hidePreview:d,clearHideTimeout:p,startHideTimeout:h,setHoverBlockTopPosition:f}=s.useSubmodalStore();function m(C){n(""),o(C),i("keyBlock")}function x(C,b){const A=window.innerHeight,y=400,P=10;let L=b.clientY-120;L+y>A&&(L=A-y-P),L<P&&(L=P),a||i("keyBlock"),c(C,"keyBlock"),p(),f(L)}function g(){u?h("keyBlock"):d("keyBlock"),f(null)}return s.jsxRuntimeExports.jsxs("div",{className:Mo.product,onClick:()=>m(t),onMouseEnter:C=>x(t,C),onMouseLeave:g,children:[nr[t]?s.jsxRuntimeExports.jsx("img",{src:nr[t]}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Cards"}),s.jsxRuntimeExports.jsx("span",{className:Mo.name,children:s.getDisplayName(t,r)}),s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretRight",width:20,height:20})]},t)},ha=()=>{const{blocks:e,sourceBlocks:t}=s.useBlocksStore(),[n,r]=k.useState(""),[o,i]=k.useState([]),a=k.useMemo(()=>Bo(e,t),[e,t]),u=k.useMemo(()=>new s.Fuse(a,{keys:["displayName"],threshold:.4}),[a]);return k.useEffect(()=>{if(n.trim()==="")i(Bo(e,t));else{const c=u.search(n);i(c.map(d=>d.item))}},[n,u]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Input,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:r,value:n,style:{marginBottom:10}}),s.jsxRuntimeExports.jsx("div",{className:Oo.results,children:o.length>0?o.map(c=>s.jsxRuntimeExports.jsx(vd,{blockId:c.name,setSearchValue:r})):s.jsxRuntimeExports.jsx("div",{className:Oo.noResults,children:"No sections found"})})]})},Pd="_wrapper_1k1cr_1",Dd="_submodal_1k1cr_14",Ws={wrapper:Pd,submodal:Dd},Od=({children:e,positionTop:t,positionLeft:n})=>{const{keyBlock:r,startHideTimeout:o,clearHideTimeout:i,setMouseOverModal:a}=s.useSubmodalStore();return r?s.jsxRuntimeExports.jsx("div",{className:Ws.wrapper,style:t?{top:t,left:n||void 0}:{},onMouseEnter:()=>{i(),a(!0)},onMouseLeave:()=>{a(!1),o()},children:e}):null},Bd=({children:e})=>{const{hoverBlockId:t,startHideTimeout:n,clearHideTimeout:r,setMouseOverModal:o}=s.useSubmodalStore();return t?s.jsxRuntimeExports.jsx("div",{className:s.clx(Ws.wrapper,Ws.submodal),onMouseEnter:()=>{r(),o(!0)},onMouseLeave:()=>{o(!1),n()},children:e}):null},Md="_applyButton_1a9kh_2",Fd="_content_1a9kh_7",Hd="_title_1a9kh_14",Ud="_label_1a9kh_21",$d="_colorValue_1a9kh_40",zd="_colorMap_1a9kh_48",Wd="_indicator_1a9kh_57",qd="_hueSlider_1a9kh_66",Vd="_slider_1a9kh_97",Gd="_buttons_1a9kh_102",Yd="_name_1a9kh_109",Xd="_secondary_1a9kh_114",Qd="_input_1a9kh_122",Kd="_modal_1a9kh_160",Zd="_alphaSlider_1a9kh_249",Jd="_alphaBackground_1a9kh_257",e0="_alphaGradient_1a9kh_268",t0="_chargeTypes_1a9kh_297",n0="_charge_1a9kh_297",r0="_chargeActive_1a9kh_326",s0="_gradient_1a9kh_334",o0="_color_1a9kh_40",i0="_colorActive_1a9kh_355",a0="_gradientWrapper_1a9kh_362",u0="_subtitle_1a9kh_368",l0="_colorTypes_1a9kh_375",c0="_colorType_1a9kh_375",d0="_colorTypeActive_1a9kh_399",h0="_colorsWrapper_1a9kh_404",p0="_colors_1a9kh_404",le={applyButton:Md,content:Fd,title:Hd,label:Ud,colorValue:$d,colorMap:zd,indicator:Wd,hueSlider:qd,slider:Vd,buttons:Gd,name:Yd,secondary:Xd,input:Qd,modal:Kd,alphaSlider:Zd,alphaBackground:Jd,alphaGradient:e0,chargeTypes:t0,charge:n0,chargeActive:r0,gradient:s0,color:o0,colorActive:i0,gradientWrapper:a0,subtitle:u0,colorTypes:l0,colorType:c0,colorTypeActive:d0,colorsWrapper:h0,colors:p0},m0=()=>{const{modalPosition:e,color:t,initialColor:n,setShowModal:r,hue:o,saturation:i,brightness:a,alpha:u,dragging:c,setDragging:d,setHue:p,setSaturation:h,setBrightness:f,setAlpha:m,colorChange:x,setColor:g,update:C,isGradient:b,setIsGradient:A,gradientDirection:y,setGradientDirection:P,hue2:L,saturation2:R,brightness2:q,alpha2:Y,setHue2:K,setSaturation2:w,setBrightness2:$,setAlpha2:B,activeColorIndex:H,setActiveColorIndex:V,isGradientActive:z}=s.useColorPickerStore(),Z=(ie,te,Ee)=>{te/=100,Ee/=100;const re=ke=>(ke+ie/60)%6,pe=ke=>Ee*(1-te*Math.max(0,Math.min(re(ke),4-re(ke),1))),ue=Math.round(255*pe(5)),xe=Math.round(255*pe(3)),ge=Math.round(255*pe(1));return{r:ue,g:xe,b:ge}},G=ie=>ie.toString(16).padStart(2,"0"),W=(ie,te,Ee,re)=>{const{r:pe,g:ue,b:xe}=Z(ie,te,Ee),ge=Math.round(re/100*255);return`#${G(pe)}${G(ue)}${G(xe)}${G(ge)}`},J=(ie,te,Ee,re)=>{if(b)if(H===1){p(ie),h(te),f(Ee),m(re);const pe=W(ie,te,Ee,re),ue=W(L,R,q,Y),ge=`linear-gradient(${y==="vertical"?"0deg":"90deg"}, ${pe} 0%, ${ue} 100%)`;x(ge),g(ge)}else{K(ie),w(te),$(Ee),B(re);const pe=W(ie,te,Ee,re),ue=W(o,i,a,u),ge=`linear-gradient(${y==="vertical"?"0deg":"90deg"}, ${ue} 0%, ${pe} 100%)`;x(ge),g(ge)}else{const pe=W(ie,te,Ee,re);x(pe),g(pe)}},T=(ie,te,Ee)=>{const{width:re,height:pe}=Ee.getBoundingClientRect(),ue=Math.max(0,Math.min(ie/re*100,100)),xe=Math.max(0,Math.min(100-te/pe*100,100));b?H===1?(h(ue),f(xe),J(o,ue,xe,u)):(w(ue),$(xe),J(L,ue,xe,Y)):(h(ue),f(xe),J(o,ue,xe,u))},ce=ie=>{const{offsetX:te,offsetY:Ee}=ie.nativeEvent;d(!0),T(te,Ee,ie.currentTarget)},ye=ie=>{if(c){const te=document.querySelector(`.${le.colorMap}`),{left:Ee,top:re}=te.getBoundingClientRect(),pe=ie.clientX-Ee,ue=ie.clientY-re;T(pe,ue,te)}},S=()=>{d(!1)};k.useEffect(()=>{function ie(re){const pe=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,ue=re.match(pe);if(ue){const xe=ue[1],ge=ue[2],ke=ue[3];return{angle:xe,col1:ge,col2:ke}}return null}function te(re){const pe=parseInt(re.slice(1,3),16),ue=parseInt(re.slice(3,5),16),xe=parseInt(re.slice(5,7),16),ge=parseInt(re.slice(7,9),16)/255*100,{h:ke,s:Ot,b:v}=Ee(pe,ue,xe);return{h:ke,s:Ot,b:v,a:ge}}function Ee(re,pe,ue){re/=255,pe/=255,ue/=255;const xe=Math.max(re,pe,ue),ge=Math.min(re,pe,ue);let ke=0;const Ot=xe-ge,v=(xe===0?0:Ot/xe)*100,U=xe*100;if(xe===ge)ke=0;else switch(xe){case re:ke=((pe-ue)/Ot+(pe<ue?6:0))*60;break;case pe:ke=((ue-re)/Ot+2)*60;break;case ue:ke=((re-pe)/Ot+4)*60;break}return{h:ke,s:v,b:U}}if(n&&n.startsWith("linear-gradient")){const re=ie(n);if(re){const{angle:pe,col1:ue,col2:xe}=re,ge=te(ue),ke=te(xe);A(!0),P(pe==="0deg"?"vertical":"horizontal"),p(ge.h),h(ge.s),f(ge.b),m(ge.a),K(ke.h),w(ke.s),$(ke.b),B(ke.a),V(1)}}else if(n){const pe=function(xe){let ge=xe;return ge.length===7?ge+"ff":ge.length===9?ge:ge.length===4?ge[0]+ge[1].repeat(2)+ge[2].repeat(2)+ge[3].repeat(2)+"ff":"#000000ff"}(n),ue=te(pe);A(!1),p(ue.h),h(ue.s),f(ue.b),m(ue.a)}},[n,A,P,p,h,f,m,K,w,$,B,V]),k.useEffect(()=>{let ie,te,Ee,re;b?H===1?(ie=o,te=i,Ee=a,re=u):(ie=L,te=R,Ee=q,re=Y):(ie=o,te=i,Ee=a,re=u),J(ie,te,Ee,re)},[b,y,H,o,i,a,u,L,R,q,Y]),k.useEffect(()=>{const ie=Ee=>ye(Ee),te=()=>S();return c?(document.addEventListener("mousemove",ie),document.addEventListener("mouseup",te)):(document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",te)),()=>{document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",te)}},[c,b,y]);function ae(){if(!b)C(t);else{const ie=W(o,i,a,u),te=W(L,R,q,Y),re=`linear-gradient(${y==="vertical"?"0deg":"90deg"}, ${ie} 0%, ${te} 100%)`;C(re)}r(!1)}function Ae(){r(!1),x(n)}const ee=b?H===1?o:L:o,Oe=b?H===1?i:R:i,st=b?H===1?a:q:a,Dt=b?H===1?u:Y:u,{r:kt,g:Yt,b:xr}=Z(ee,Oe,st),us=`linear-gradient(to right, rgba(${kt}, ${Yt}, ${xr}, 0), rgba(${kt}, ${Yt}, ${xr}, 1))`,Er=W(o,i,a,u),jn=W(L,R,q,Y);return s.jsxRuntimeExports.jsxs("div",{className:le.modal,onClick:ie=>ie.stopPropagation(),style:{top:`${e.top}px`,left:`${e.left}px`},children:[s.jsxRuntimeExports.jsx("h2",{className:le.title,children:"Color"}),z&&s.jsxRuntimeExports.jsxs("div",{className:le.colorTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(le.colorType,{[le.colorTypeActive]:!b}),onClick:()=>A(!1),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(le.colorType,{[le.colorTypeActive]:b}),onClick:()=>A(!0),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),b&&z&&s.jsxRuntimeExports.jsxs("div",{className:le.colorsWrapper,children:[s.jsxRuntimeExports.jsx("div",{className:le.colors,style:{background:`linear-gradient(90deg, ${Er} 0%, ${jn} 100%)`}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(le.color,{[le.colorActive]:H===1}),onClick:()=>V(1),style:{background:Er}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(le.color,{[le.colorActive]:H===2}),onClick:()=>V(2),style:{background:jn}})]}),s.jsxRuntimeExports.jsx("div",{className:le.colorMap,onMouseDown:ce,style:{background:`
99
+ `,n+="}",n},pc=e=>{const t=document.getElementById("dynamic-styles");if(t)t.innerHTML=e;else{const n=document.createElement("style");n.id="dynamic-styles",n.innerHTML=e,document.head.appendChild(n)}},zr=new Set,mc=e=>{const t=new Map;return Object.entries(e).forEach(([n,r])=>{typeof r=="object"&&Object.entries(r).forEach(([o,i])=>{var a,u;if(i&&i.font){const c=i.font.replace(/\s+/g,"+");t.has(c)||t.set(c,new Set),(a=t.get(c))==null||a.add(i.weight),(u=t.get(c))==null||u.add(i.boldWeight)}})}),t},fc=e=>{const t=new Map;return Object.entries(e).forEach(([n,r])=>{typeof r=="object"&&Object.keys(r).forEach(o=>{var i;if(o==="font"&&r[o]){const a=r[o].replace(/\s+/g,"+");t.has(a)||t.set(a,new Set),(i=t.get(a))==null||i.add("400")}})}),t},gc=e=>{zr.forEach(t=>{if(!e.has(t)){const n=document.querySelector(`link[data-font="${t}"]`);n&&n.remove(),zr.delete(t)}})},xc=e=>{const t=new Set;e.forEach((n,r)=>{const o=Array.from(n).join(";"),i=`${r}:wght@${o}`;if(t.add(i),!zr.has(i)){const a=document.createElement("link");a.rel="stylesheet",a.href=`https://fonts.googleapis.com/css2?family=${i}&display=swap`,a.setAttribute("data-font",i),document.head.appendChild(a),zr.add(i)}}),gc(t)},Ec=e=>{if(e.fonts){const t=mc(e.fonts.desktop),n=fc(e.buttons),r=new Map(t);n.forEach((o,i)=>{if(r.has(i)){const a=r.get(i);o.forEach(u=>a==null?void 0:a.add(u))}else r.set(i,new Set(o))}),xc(r)}};function bc(){try{const{editBlock:e,currentBlock:t,blocks:n,setHeader:r,setFooter:o,setAnnouncement:i}=s.useLayersStore.getState(),{currentPage:a,pages:u}=s.usePagesStore.getState(),{currentInstance:c,settingsInstance:d}=s.useBlocksStore.getState(),{setSettings:p}=s.useSettingsStore.getState();if(t||p(d),c&&t){if(t==="header")r(c);else if(t==="footer")o(c);else if(t==="announcement")i(c);else if(t==="header"||t==="footer"||t==="announcement")throw new Error(`Missing ${t} data.`)}if(c&&u&&t&&!["header","footer","announcement"].includes(t)){const h={blockSettings:{}};if(!c.blockSettings)throw new Error("currentInstance.blockSettings is undefined.");if(Object.keys(c.blockSettings).filter(f=>!["displayName","isAddable"].includes(f)).forEach(f=>{h.blockSettings[f]=c.blockSettings[f]}),!u[a])throw new Error(`Page "${a}" does not exist.`);if(!n[u[a].path].data||!n[u[a].path].data[t])throw new Error(`Layer or block for page "${u[a].path}" and block "${t}" does not exist.`);e(u[a].path,t,{name:n[u[a].path].data[t].name,value:h})}}catch(e){console.error("Error in hotReload function:",e)}}const Ic=()=>{const e=s.useApiStore.getState().apiUrls,t=s.useNavigate(),{notifications:n,setNotifications:r}=s.useNotificationStore();return async(o,i,a,u)=>{const c=s.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,d=`${e.slApi}/v1/public/${c}/tickets`;try{const p=await s.request({method:"post",url:d,body:{title:o,firstMessage:i,email:u,recaptcha:a,tsId:s.getTsId()},withToken:!1});return r([...n,{id:s.v4(),message:"Ticket created successfully. We will contact you by mail",status:"success"}]),t(`/ticket/${p.data.id}/${p.data.accessToken}`),p}catch(p){r([...n,{id:s.v4(),message:`Error: ${p}. Please try again later.`,status:"error"}])}}},Tc=()=>{const{pages:e}=s.usePagesStore(),[t,n]=k.useState(e);return k.useEffect(()=>{n(e)},[e]),t},_c="_tooltip_4hruj_1",Cc={tooltip:_c},Tn=e=>{const{text:t}=e,{setShowTooltip:n}=s.useTooltipStore();return k.useEffect(()=>(n(!0),()=>{n(!1)}),[]),s.jsxRuntimeExports.jsx("div",{className:Cc.tooltip,children:t})},Sc=()=>{const{undo:e,redo:t,past:n,future:r}=s.useHistoryStore(),[o,i]=k.useState(!1),[a,u]=k.useState(!1),[c,d]=k.useState(!1),[p,h]=k.useState(!1),[f,m]=k.useState(null),{notifications:x,setNotifications:g}=s.useNotificationStore();return k.useEffect(()=>{i(n.length===0)},[n]),k.useEffect(()=>{u(r.length===0)},[r]),s.jsxRuntimeExports.jsxs("div",{className:Dn.buttons,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(Dn.button,{[Dn.disabled]:o}),onMouseEnter:()=>{const C=setTimeout(()=>{h(!0),d(!1)},200);m(C)},onMouseLeave:()=>{f&&clearTimeout(f),h(!1),d(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),g([...x,{id:s.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),p&&s.jsxRuntimeExports.jsx(Tn,{text:o?"Nothing to undo":"Click to undo changes"})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(Dn.button,{[Dn.disabled]:a}),onMouseEnter:()=>{const C=setTimeout(()=>{d(!0),h(!1)},200);m(C)},onMouseLeave:()=>{f&&clearTimeout(f),d(!1),h(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(t(),g([...x,{id:s.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),c&&s.jsxRuntimeExports.jsx(Tn,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},yc="_devices_ls6k9_1",kc="_device_ls6k9_1",Rc="_active_ls6k9_27",zs={devices:yc,device:kc,active:Rc},Ac=()=>s.jsxRuntimeExports.jsx("div",{className:zs.devices,children:Tl.map(e=>s.jsxRuntimeExports.jsx(Nc,{device:e}))}),Nc=e=>{const{device:t}=e,{currentDevice:n,setCurrentDevice:r}=s.useDeviceStore(),[o,i]=k.useState(!1),[a,u]=k.useState(null);return s.jsxRuntimeExports.jsxs("div",{className:s.clx(zs.device,{[zs.active]:n.value===t.value}),onClick:()=>r(t),onMouseEnter:()=>{const c=setTimeout(()=>{i(!0)},200);u(c)},onMouseLeave:()=>{a&&clearTimeout(a),i(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:t.icon,fill:n.value===t.value?"#252525":"#757575",width:20,height:20}),o&&s.jsxRuntimeExports.jsx(Tn,{text:`Switch to ${t.value} view`})]},t.value)},wc="_preview_1x3m8_2",Lc="_active_1x3m8_19",hs={preview:wc,active:Lc},jc=()=>{const{onPreview:e}=s.usePreviewStore(),[t,n]=k.useState(!1),[r,o]=k.useState(null);return s.jsxRuntimeExports.jsxs("a",{href:"/",className:s.clx(hs.preview,{[hs.active]:e}),target:"_blank",onMouseEnter:()=>{const i=setTimeout(()=>{n(!0)},200);o(i)},onMouseLeave:()=>{r&&clearTimeout(r),n(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUpRight",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:hs.text,children:"Preview"}),t&&s.jsxRuntimeExports.jsx(Tn,{text:"Open draft theme in new tab"})]})},vc="_settings_u4cv4_1",Pc={settings:vc},Dc="_pages_167qp_1",Oc="_text_167qp_21",Bc="_modal_167qp_27",Mc="_open_167qp_46",Fc="_page_167qp_1",Hc="_hoverable_167qp_61",Uc="_separator_167qp_65",$c="_button_167qp_70",zc="_items_167qp_85",it={pages:Dc,default:"_default_167qp_5",text:Oc,modal:Bc,open:Mc,page:Fc,hoverable:Hc,separator:Uc,button:$c,items:zc},ca=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/pages/${encodeURIComponent(e)}`;return await s.request({url:o,withToken:!0,method:"delete"})},Wc=()=>{const{currentPage:e,setCurrentPage:t,setIsOpenModal:n,pages:r,setIsEdit:o,setEditedPage:i,deletePage:a,setIsOpenSelectModal:u}=s.usePagesStore(),{deletePage:c,setCurrentBlock:d}=s.useLayersStore(),[p,h]=k.useState(null),{setTitle:f,setDescription:m,setOnConfirm:x}=s.useConfirmationModalStore(),[g,C]=k.useState(!1),b=k.useRef(null);s.useOnClickOutside(b,()=>{g&&C(!1)}),k.useEffect(()=>{g?u(!0):setTimeout(()=>{u(!1)},300)},[g]);const A=y=>y?y.replace(/_/g," ").split(" ").map(P=>P.charAt(0).toUpperCase()+P.slice(1)).join(" "):"";return s.jsxRuntimeExports.jsxs("div",{className:it.pages,ref:b,children:[s.jsxRuntimeExports.jsxs("div",{className:it.default,onClick:y=>{y.stopPropagation(),C(P=>!P)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:r&&r[e]&&r[e].icon||"File",fill:"#252525",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:it.text,children:r&&r[e]&&s.defaultPagePaths.includes(r[e].path)?`${A(r[e].name)} page`:r&&r[e]&&r[e].name}),s.jsxRuntimeExports.jsx("div",{style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretDown",width:20,height:20})})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(it.modal,{[it.open]:g}),onClick:y=>y.stopPropagation(),children:[r&&s.jsxRuntimeExports.jsx("div",{className:it.items,children:Object.keys(r).map(y=>{const P=r[y];return s.jsxRuntimeExports.jsxs("div",{className:s.clx(it.page,{[it.hoverable]:p===y}),onMouseEnter:()=>h(y),onMouseLeave:()=>h(null),onClick:()=>{h(null),o(!1),d(null),t(y),C(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:P.icon,fill:"#252525"}),s.jsxRuntimeExports.jsx("span",{className:it.text,children:s.defaultPagePaths.includes(P.path)?`${A(P.name)} page`:P.name}),p===y&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Gear",fill:"#757575",onClick:L=>{L.stopPropagation(),o(!0),i(y),n(!0)}}),!s.defaultPagePaths.includes(P.path)&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",onClick:L=>{L.stopPropagation(),f("Delete Page"),m(`Are you sure you want to delete ${P.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),x(()=>{L.stopPropagation(),r[e].path===P.path&&t(Object.keys(r)[0]),a(y),c(P.name),ca(P.path)})}})]}),r[e]&&r[e].name===P.name&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"#FF3F19"})]},y)})}),s.jsxRuntimeExports.jsx("div",{className:it.separator}),s.jsxRuntimeExports.jsxs(s.Button,{className:it.button,onClick:y=>{y.stopPropagation(),n(!0)},size:"l",children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#ff3f19"}),s.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},qc="_zoom_fu0hj_1",Po={zoom:qc},Vc=()=>{const{zoomLevel:e,setZoomLevel:t}=s.usePreviewStore();return s.jsxRuntimeExports.jsxs("label",{htmlFor:"zoom",className:Po.zoom,children:[s.jsxRuntimeExports.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:s.jsxRuntimeExports.jsx(s.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),s.jsxRuntimeExports.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:n=>{const r=Number(n.target.value);t(r/100)},className:Po.input}),s.jsxRuntimeExports.jsx("span",{children:"%"})]})},Gc=()=>s.jsxRuntimeExports.jsxs("div",{className:Pc.settings,children:[s.jsxRuntimeExports.jsx(Wc,{}),s.jsxRuntimeExports.jsx(Vc,{})]}),Yc="_theme_1e5wq_1",Xc="_text_1e5wq_13",Do={theme:Yc,text:Xc},Qc=()=>s.jsxRuntimeExports.jsx("div",{className:Do.theme,children:s.jsxRuntimeExports.jsx("div",{className:Do.text,children:"Live Theme"})}),Kc=async(e,t,n)=>{const r=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),a=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${r}/drafts/${o}/${t}`;return await s.request({url:a,withToken:!0,method:e,body:n})};function On(e,t){try{return t.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(i=>i&&i.type===e).map(i=>{if(i.value===void 0)throw new Error("item.value is undefined.");return i.value}).flat()}).flat().filter(r=>r).map(r=>e==="ListingIds"?r.listingId:r)}catch(n){return console.error("Error in getValues function:",n),[]}}function Zc(e,t,n){return Jc(e,t)?(n.reviews||[]).length*3:0}function Jc(e,t){return t.map(r=>{if(!r.value||!r.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(r.value.blockSettings).filter(i=>i&&i.type===e).map(i=>{if(i.value===void 0)throw new Error("item.value is undefined.");return i.value}).flat()}).flat().filter(r=>r).length>0}function ed(e,t){if(t){const n=Object.keys(t).find(r=>t[r].path===e);if(n)return t[n]}return null}const td=({setIsLoading:e,isLoading:t})=>{const{themeSettings:n}=s.useThemeSettingsStore(),{settings:r}=s.useSettingsStore(),[o,i]=k.useState(null),[a,u]=k.useState(!1),{setNotifications:c,notifications:d}=s.useNotificationStore(),{header:p,footer:h,announcement:f,blocks:m}=s.useLayersStore(),{pageContext:x}=s.usePagesStore(),{pages:g}=s.usePagesStore(),C=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const A=Object.keys(m).map(L=>{const R=ed(L,g);return m[L]&&m[L].data&&(R!=null&&R.path)?{id:R?R.id:L,name:R?R.name:L,path:R.path,layout:{...m[L]},neededProductIds:[...On("ProductId",Object.values(m[L].data))],neededCategoryIds:[...On("CategoryId",Object.values(m[L].data))],neededAnnouncementIds:[...On("AnnouncementId",Object.values(m[L].data))],neededListingIds:[...On("ListingIds",Object.values(m[L].data))],neededFaqIds:[...On("FaqsIds",Object.values(m[L].data))],neededReviewCount:Zc("ReviewCount",Object.values(m[L].data),x),seo:{pageTitle:R&&R.seo&&R.seo.pageTitle?R.seo.pageTitle:"",pageDescription:R&&R.seo&&R.seo.pageDescription?R.seo.pageDescription:""},isPrivate:!!(R&&R.visibility==="private")}:null}).filter(L=>L),y={settings:{...r==null?void 0:r.blockSettings},header:p,footer:h,announcement:f},{status:P}=await Kc("post","save",{themeSettings:n,settings:y,updatedPages:A});c([...d,{id:s.v4(),message:P===200?"Settings saved":"Error",status:P===200?"success":"error"}]),e(!1)}u(!0);const b=setTimeout(()=>{u(!1)},2e3);i(b)};return s.jsxRuntimeExports.jsx(s.Button,{onClick:C,disabled:t,children:s.jsxRuntimeExports.jsx("span",{style:{userSelect:"none"},children:"Save"})})},nd=()=>{const{isOpenSelectModal:e}=s.usePagesStore(),[t,n]=k.useState(!1),{showTooltip:r}=s.useTooltipStore();return s.jsxRuntimeExports.jsxs("div",{className:br.header,style:{zIndex:e?5e4:r?501:50},children:[s.jsxRuntimeExports.jsxs("div",{className:br.left,children:[s.jsxRuntimeExports.jsx(Ac,{}),s.jsxRuntimeExports.jsx(jc,{})]}),s.jsxRuntimeExports.jsx("div",{className:br.center,children:s.jsxRuntimeExports.jsx(Gc,{})}),s.jsxRuntimeExports.jsxs("div",{className:br.right,children:[s.jsxRuntimeExports.jsx(Qc,{}),s.jsxRuntimeExports.jsx(Sc,{}),s.jsxRuntimeExports.jsx(td,{setIsLoading:n,isLoading:t}),t&&s.jsxRuntimeExports.jsx(Vt,{})]})]})},rd="_exit_ovvox_1",sd="_text_ovvox_11",od="_exitLink_ovvox_16",ps={exit:rd,text:sd,exitLink:od},id=()=>s.jsxRuntimeExports.jsx("div",{className:ps.exit,children:s.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:ps.exitLink,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"SignOut",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:ps.text,children:"Exit"})]})}),ad="_navbar_1podc_1",ud="_main_1podc_6",ld="_block_1podc_13",cd="_active_1podc_29",Tr={navbar:ad,main:ud,block:ld,active:cd},dd=()=>{const{activeBlock:e}=s.useNavbarStore(),{setActiveBlock:t}=s.useBlocksStore(),{setCurrentBlock:n}=s.useLayersStore(),{setActiveBlock:r}=s.useThemeSettingsStore(),{setActiveBlock:o}=s.usePreviewStore(),i=s.useNavigate();function a(u){switch(t(null),n(null),r(null),o({id:null,neededScroll:!1}),u.name){case"Layers":i("/admin/builder");break;case"Add":i("/admin/builder/add");break;case"Theme":i("/admin/builder/theme");break;case"Settings":i("/admin/builder/settings");break}}return s.jsxRuntimeExports.jsxs("div",{className:Tr.navbar,children:[s.jsxRuntimeExports.jsx(id,{}),s.jsxRuntimeExports.jsx("div",{className:Tr.main,children:s.navbarBlocks.map(u=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(Tr.block,{[Tr.active]:e.icon===u.icon}),onClick:()=>a(u),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:u.icon,fill:e.icon===u.icon?"#252525":"#757575"}),s.jsxRuntimeExports.jsx("span",{children:u.name})]},u.icon))})]})},hd="_preview_gb2ye_1",pd="_main_gb2ye_15",md="_content_gb2ye_25",fd="_loading_gb2ye_34",gd="_previewLoading_gb2ye_65",Bn={preview:hd,main:pd,content:md,loading:fd,previewLoading:gd},xd="_header_11zku_2",Ed="_circles_11zku_16",bd="_circle_11zku_16",Id="_red_11zku_32",Td="_green_11zku_36",_d="_yellow_11zku_40",Cd="_input_11zku_44",Sd="_main_11zku_55",yd="_text_11zku_63",kd="_copy_11zku_75",gt={header:xd,circles:Ed,circle:bd,red:Id,green:Td,yellow:_d,input:Cd,main:Sd,text:yd,copy:kd},Rd=["red","yellow","green"],Ad=()=>{const{currentDevice:e}=s.useDeviceStore(),t=(o,i)=>o.length>i?o.slice(0,i)+"...":o,{notifications:n,setNotifications:r}=s.useNotificationStore();return s.jsxRuntimeExports.jsxs("div",{className:gt.header,children:[s.jsxRuntimeExports.jsx("div",{className:gt.circles,children:Rd.map(o=>s.jsxRuntimeExports.jsx("div",{className:s.clx(gt.circle,{[gt.red]:o==="red",[gt.yellow]:o==="yellow",[gt.green]:o==="green"})},o))}),s.jsxRuntimeExports.jsx("div",{className:gt.input,children:s.jsxRuntimeExports.jsxs("div",{className:gt.main,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),s.jsxRuntimeExports.jsx("span",{className:gt.text,children:e.value==="mobile"?t(window.location.origin,35):e.value==="desktop"?t(window.location.origin,200):t(window.location.origin,100)})]})}),s.jsxRuntimeExports.jsx(s.Button,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),r([...n,{id:s.v4(),status:"success",message:"Domain copied to clipboard"}])},className:gt.copy,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Ct=e=>e?e.replace(/_/g," ").split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" and "):"",da=(e,t,n,r,o,i,a)=>{const u=e.currentTarget.getBoundingClientRect(),c=window.innerHeight-u.bottom,d=u.top,p=window.innerWidth-u.right,h=u.left;let f,m;return f=u.bottom+r+window.scrollY,m=u.left,(c<t||c<o)&&(d>=t+a?f=u.top-t-r+window.scrollY:f=window.scrollY+a),f-window.scrollY<a&&(f=window.scrollY+a),(p<n||p<i)&&(h>=n?m=u.right-n:m=(window.innerWidth-n)/2),m<u.right+i&&(m=u.right+i),m<u.right&&m+n>u.left&&f<u.bottom&&f+t>u.top&&(p>=n+i?m=u.right+r+i:c>=t?f=u.bottom+r+window.scrollY:(f=window.scrollY+a,m=(window.innerWidth-n)/2)),{top:f,left:m}},Nd="_results_1pahy_1",Oo={results:Nd};function wd(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Bo(e,t){return e?Object.keys(e||{}).reduce((n,r)=>(wd(r,t)&&n.push({name:r,displayName:s.getDisplayName(r,t)}),n),[]):[]}const Ld="_product_yggw5_1",jd="_name_yggw5_15",Mo={product:Ld,name:jd},vd=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:r,setActiveBlock:o}=s.useBlocksStore(),{hideModal:i,hoverBlockId:a,isModalVisible:u,showPreview:c,hidePreview:d,clearHideTimeout:p,startHideTimeout:h,setHoverBlockTopPosition:f}=s.useSubmodalStore();function m(C){n(""),o(C),i("keyBlock")}function x(C,b){const A=window.innerHeight,y=400,P=10;let L=b.clientY-120;L+y>A&&(L=A-y-P),L<P&&(L=P),a||i("keyBlock"),c(C,"keyBlock"),p(),f(L)}function g(){u?h("keyBlock"):d("keyBlock"),f(null)}return s.jsxRuntimeExports.jsxs("div",{className:Mo.product,onClick:()=>m(t),onMouseEnter:C=>x(t,C),onMouseLeave:g,children:[nr[t]?s.jsxRuntimeExports.jsx("img",{src:nr[t]}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Cards"}),s.jsxRuntimeExports.jsx("span",{className:Mo.name,children:s.getDisplayName(t,r)}),s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretRight",width:20,height:20})]},t)},ha=()=>{const{blocks:e,sourceBlocks:t}=s.useBlocksStore(),[n,r]=k.useState(""),[o,i]=k.useState([]),a=k.useMemo(()=>Bo(e,t),[e,t]),u=k.useMemo(()=>new s.Fuse(a,{keys:["displayName"],threshold:.4}),[a]);return k.useEffect(()=>{if(n.trim()==="")i(Bo(e,t));else{const c=u.search(n);i(c.map(d=>d.item))}},[n,u]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Input,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:r,value:n,style:{marginBottom:10}}),s.jsxRuntimeExports.jsx("div",{className:Oo.results,children:o.length>0?o.map(c=>s.jsxRuntimeExports.jsx(vd,{blockId:c.name,setSearchValue:r})):s.jsxRuntimeExports.jsx("div",{className:Oo.noResults,children:"No sections found"})})]})},Pd="_wrapper_1k1cr_1",Dd="_submodal_1k1cr_14",Ws={wrapper:Pd,submodal:Dd},Od=({children:e,positionTop:t,positionLeft:n})=>{const{keyBlock:r,startHideTimeout:o,clearHideTimeout:i,setMouseOverModal:a}=s.useSubmodalStore();return r?s.jsxRuntimeExports.jsx("div",{className:Ws.wrapper,style:t?{top:t,left:n||void 0}:{},onMouseEnter:()=>{i(),a(!0)},onMouseLeave:()=>{a(!1),o()},children:e}):null},Bd=({children:e})=>{const{hoverBlockId:t,startHideTimeout:n,clearHideTimeout:r,setMouseOverModal:o}=s.useSubmodalStore();return t?s.jsxRuntimeExports.jsx("div",{className:s.clx(Ws.wrapper,Ws.submodal),onMouseEnter:()=>{r(),o(!0)},onMouseLeave:()=>{o(!1),n()},children:e}):null},Md="_applyButton_1a9kh_2",Fd="_content_1a9kh_7",Hd="_title_1a9kh_14",Ud="_label_1a9kh_21",$d="_colorValue_1a9kh_40",zd="_colorMap_1a9kh_48",Wd="_indicator_1a9kh_57",qd="_hueSlider_1a9kh_66",Vd="_slider_1a9kh_97",Gd="_buttons_1a9kh_102",Yd="_name_1a9kh_109",Xd="_secondary_1a9kh_114",Qd="_input_1a9kh_122",Kd="_modal_1a9kh_160",Zd="_alphaSlider_1a9kh_249",Jd="_alphaBackground_1a9kh_257",e0="_alphaGradient_1a9kh_268",t0="_chargeTypes_1a9kh_297",n0="_charge_1a9kh_297",r0="_chargeActive_1a9kh_326",s0="_gradient_1a9kh_334",o0="_color_1a9kh_40",i0="_colorActive_1a9kh_355",a0="_gradientWrapper_1a9kh_362",u0="_subtitle_1a9kh_368",l0="_colorTypes_1a9kh_375",c0="_colorType_1a9kh_375",d0="_colorTypeActive_1a9kh_399",h0="_colorsWrapper_1a9kh_404",p0="_colors_1a9kh_404",le={applyButton:Md,content:Fd,title:Hd,label:Ud,colorValue:$d,colorMap:zd,indicator:Wd,hueSlider:qd,slider:Vd,buttons:Gd,name:Yd,secondary:Xd,input:Qd,modal:Kd,alphaSlider:Zd,alphaBackground:Jd,alphaGradient:e0,chargeTypes:t0,charge:n0,chargeActive:r0,gradient:s0,color:o0,colorActive:i0,gradientWrapper:a0,subtitle:u0,colorTypes:l0,colorType:c0,colorTypeActive:d0,colorsWrapper:h0,colors:p0},m0=()=>{const{modalPosition:e,color:t,initialColor:n,setShowModal:r,hue:o,saturation:i,brightness:a,alpha:u,dragging:c,setDragging:d,setHue:p,setSaturation:h,setBrightness:f,setAlpha:m,colorChange:x,setColor:g,update:C,isGradient:b,setIsGradient:A,gradientDirection:y,setGradientDirection:P,hue2:L,saturation2:R,brightness2:q,alpha2:Y,setHue2:K,setSaturation2:w,setBrightness2:$,setAlpha2:B,activeColorIndex:H,setActiveColorIndex:V,isGradientActive:z}=s.useColorPickerStore(),Z=(ie,te,Ee)=>{te/=100,Ee/=100;const re=ke=>(ke+ie/60)%6,pe=ke=>Ee*(1-te*Math.max(0,Math.min(re(ke),4-re(ke),1))),ue=Math.round(255*pe(5)),xe=Math.round(255*pe(3)),ge=Math.round(255*pe(1));return{r:ue,g:xe,b:ge}},G=ie=>ie.toString(16).padStart(2,"0"),W=(ie,te,Ee,re)=>{const{r:pe,g:ue,b:xe}=Z(ie,te,Ee),ge=Math.round(re/100*255);return`#${G(pe)}${G(ue)}${G(xe)}${G(ge)}`},J=(ie,te,Ee,re)=>{if(b)if(H===1){p(ie),h(te),f(Ee),m(re);const pe=W(ie,te,Ee,re),ue=W(L,R,q,Y),ge=`linear-gradient(${y==="vertical"?"0deg":"90deg"}, ${pe} 0%, ${ue} 100%)`;x(ge),g(ge)}else{K(ie),w(te),$(Ee),B(re);const pe=W(ie,te,Ee,re),ue=W(o,i,a,u),ge=`linear-gradient(${y==="vertical"?"0deg":"90deg"}, ${ue} 0%, ${pe} 100%)`;x(ge),g(ge)}else{const pe=W(ie,te,Ee,re);x(pe),g(pe)}},T=(ie,te,Ee)=>{const{width:re,height:pe}=Ee.getBoundingClientRect(),ue=Math.max(0,Math.min(ie/re*100,100)),xe=Math.max(0,Math.min(100-te/pe*100,100));b?H===1?(h(ue),f(xe),J(o,ue,xe,u)):(w(ue),$(xe),J(L,ue,xe,Y)):(h(ue),f(xe),J(o,ue,xe,u))},ce=ie=>{const{offsetX:te,offsetY:Ee}=ie.nativeEvent;d(!0),T(te,Ee,ie.currentTarget)},ye=ie=>{if(c){const te=document.querySelector(`.${le.colorMap}`),{left:Ee,top:re}=te.getBoundingClientRect(),pe=ie.clientX-Ee,ue=ie.clientY-re;T(pe,ue,te)}},S=()=>{d(!1)};k.useEffect(()=>{function ie(re){const pe=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,ue=re.match(pe);if(ue){const xe=ue[1],ge=ue[2],ke=ue[3];return{angle:xe,col1:ge,col2:ke}}return null}function te(re){const pe=parseInt(re.slice(1,3),16),ue=parseInt(re.slice(3,5),16),xe=parseInt(re.slice(5,7),16),ge=parseInt(re.slice(7,9),16)/255*100,{h:ke,s:Ot,b:v}=Ee(pe,ue,xe);return{h:ke,s:Ot,b:v,a:ge}}function Ee(re,pe,ue){re/=255,pe/=255,ue/=255;const xe=Math.max(re,pe,ue),ge=Math.min(re,pe,ue);let ke=0;const Ot=xe-ge,v=(xe===0?0:Ot/xe)*100,U=xe*100;if(xe===ge)ke=0;else switch(xe){case re:ke=((pe-ue)/Ot+(pe<ue?6:0))*60;break;case pe:ke=((ue-re)/Ot+2)*60;break;case ue:ke=((re-pe)/Ot+4)*60;break}return{h:ke,s:v,b:U}}if(n&&n.startsWith("linear-gradient")){const re=ie(n);if(re){const{angle:pe,col1:ue,col2:xe}=re,ge=te(ue),ke=te(xe);A(!0),P(pe==="0deg"?"vertical":"horizontal"),p(ge.h),h(ge.s),f(ge.b),m(ge.a),K(ke.h),w(ke.s),$(ke.b),B(ke.a),V(1)}}else if(n){const pe=function(xe){let ge=xe;return ge.length===7?ge+"ff":ge.length===9?ge:ge.length===4?ge[0]+ge[1].repeat(2)+ge[2].repeat(2)+ge[3].repeat(2)+"ff":"#000000ff"}(n),ue=te(pe);A(!1),p(ue.h),h(ue.s),f(ue.b),m(ue.a)}},[n,A,P,p,h,f,m,K,w,$,B,V]),k.useEffect(()=>{let ie,te,Ee,re;b?H===1?(ie=o,te=i,Ee=a,re=u):(ie=L,te=R,Ee=q,re=Y):(ie=o,te=i,Ee=a,re=u),J(ie,te,Ee,re)},[b,y,H,o,i,a,u,L,R,q,Y]),k.useEffect(()=>{const ie=Ee=>ye(Ee),te=()=>S();return c?(document.addEventListener("mousemove",ie),document.addEventListener("mouseup",te)):(document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",te)),()=>{document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",te)}},[c,b,y]);function ae(){if(!b)C(t);else{const ie=W(o,i,a,u),te=W(L,R,q,Y),re=`linear-gradient(${y==="vertical"?"0deg":"90deg"}, ${ie} 0%, ${te} 100%)`;C(re)}r(!1)}function Ae(){r(!1),x(n)}const ee=b?H===1?o:L:o,Oe=b?H===1?i:R:i,st=b?H===1?a:q:a,Dt=b?H===1?u:Y:u,{r:kt,g:Yt,b:xr}=Z(ee,Oe,st),us=`linear-gradient(to right, rgba(${kt}, ${Yt}, ${xr}, 0), rgba(${kt}, ${Yt}, ${xr}, 1))`,Er=W(o,i,a,u),jn=W(L,R,q,Y);return s.jsxRuntimeExports.jsxs("div",{className:le.modal,onClick:ie=>ie.stopPropagation(),style:{top:`${e.top}px`,left:`${e.left}px`},children:[s.jsxRuntimeExports.jsx("h2",{className:le.title,children:"Color"}),z&&s.jsxRuntimeExports.jsxs("div",{className:le.colorTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(le.colorType,{[le.colorTypeActive]:!b}),onClick:()=>A(!1),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(le.colorType,{[le.colorTypeActive]:b}),onClick:()=>A(!0),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),b&&z&&s.jsxRuntimeExports.jsxs("div",{className:le.colorsWrapper,children:[s.jsxRuntimeExports.jsx("div",{className:le.colors,style:{background:`linear-gradient(90deg, ${Er} 0%, ${jn} 100%)`}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(le.color,{[le.colorActive]:H===1}),onClick:()=>V(1),style:{background:Er}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(le.color,{[le.colorActive]:H===2}),onClick:()=>V(2),style:{background:jn}})]}),s.jsxRuntimeExports.jsx("div",{className:le.colorMap,onMouseDown:ce,style:{background:`
100
100
  linear-gradient(to top, black, transparent),
101
101
  linear-gradient(to right, hsl(${ee}, 100%, 100%), hsl(${ee}, 100%, 50%))
102
102
  `},children:s.jsxRuntimeExports.jsx("div",{className:le.indicator,style:{position:"absolute",left:`${Oe}%`,top:`${100-st}%`,transform:"translate(-50%, -50%)"}})}),s.jsxRuntimeExports.jsx("div",{className:le.hueSlider,style:{bottom:b?"175px":"100px"},children:s.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:ee,onChange:ie=>{const te=Number(ie.target.value);b?H===1?J(te,i,a,u):J(te,R,q,Y):(p(te),J(te,i,a,u))},className:le.slider})}),s.jsxRuntimeExports.jsxs("div",{className:le.alphaSlider,style:{bottom:b?"150px":"75px"},children:[s.jsxRuntimeExports.jsx("div",{className:le.alphaBackground}),s.jsxRuntimeExports.jsx("div",{className:le.alphaGradient,style:{background:us}}),s.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:Dt,onChange:ie=>{const te=Number(ie.target.value);b?H===1?J(o,i,a,te):J(L,R,q,te):(m(te),J(o,i,a,te))},className:le.slider})]}),b&&z&&s.jsxRuntimeExports.jsxs("div",{className:le.gradientWrapper,children:[s.jsxRuntimeExports.jsx("h3",{className:le.subtitle,children:"Rotation"}),s.jsxRuntimeExports.jsx("div",{className:le.gradient,children:s.jsxRuntimeExports.jsxs("div",{className:le.chargeTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(le.charge,{[le.chargeActive]:y==="horizontal"}),onClick:()=>P("horizontal"),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(le.charge,{[le.chargeActive]:y==="vertical"}),onClick:()=>P("vertical"),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),s.jsxRuntimeExports.jsxs("div",{className:le.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:Ae,className:s.clx(le.applyButton,le.cancelButton),type:"Secondary",children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:ae,className:le.applyButton,children:"Apply"})]})]})},f0=()=>{const{onPreview:e,zoomLevel:t}=s.usePreviewStore(),{keyBlock:n,hoverBlockId:r,isModalVisible:o,hoverBlockTopPosition:i}=s.useSubmodalStore(),{settings:a}=s.useSettingsStore(),{sourceBlocks:u}=s.useBlocksStore(),{pageContext:c}=s.usePagesStore(),{showModal:d}=s.useColorPickerStore(),{currentDevice:p}=s.useDeviceStore(),{isLoadingThemeSettings:h}=s.useThemeSettingsStore(),{isLoadingLayers:f}=s.useLayersStore(),m=y=>y?!u||!u[y]?s.jsxRuntimeExports.jsx(s.ErrorableBlock,{error:`Block "${y}" does not exist in blocks.`}):new u[y]().renderPreview(a,c):s.jsxRuntimeExports.jsx(s.ErrorableBlock,{error:"Block or block.name is undefined."});function x(){if(p.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const y=p.value==="tablet"?768:425;return t>=1?`${y}px`:`${(y*t).toFixed(2)}px`}}function g(){switch(p.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:C}=s.usePagesStore(),b=k.useRef(null),A=y=>{b.current&&(b.current.scrollTop+=y.deltaY)};return s.jsxRuntimeExports.jsxs("div",{className:Bn.preview,style:{zIndex:d&&!C?5e3:500},onWheel:y=>{y.stopPropagation(),A(y)},children:[o&&s.jsxRuntimeExports.jsx(Bd,{children:s.jsxRuntimeExports.jsx(ha,{})}),s.jsxRuntimeExports.jsxs(Od,{positionTop:i,positionLeft:!r&&n?void 0:250,children:[!h&&!f&&s.jsxRuntimeExports.jsx(s.RenderBlock,{render:m,block:n},n),(h||!n||f)&&s.jsxRuntimeExports.jsx("div",{className:Bn.previewLoading,children:s.jsxRuntimeExports.jsx(Vt,{})})]}),d&&s.jsxRuntimeExports.jsx(m0,{}),e&&s.jsxRuntimeExports.jsxs("div",{className:Bn.main,style:{width:g()},children:[s.jsxRuntimeExports.jsx(Ad,{}),s.jsxRuntimeExports.jsx("div",{style:{borderLeft:x()==="100%"?"none":"var(--default-border)",borderRight:x()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:y=>{y.stopPropagation()},onWheel:y=>{y.stopPropagation()},children:!h&&!f?s.jsxRuntimeExports.jsx("div",{className:Bn.content,style:{width:x()},children:s.jsxRuntimeExports.jsx(s.PreviewContent,{scrollableRef:b})}):s.jsxRuntimeExports.jsx("div",{className:Bn.loading,children:s.jsxRuntimeExports.jsx(Vt,{})})})]})]})},g0="_sidebar_1xtkj_1",x0="_title_1xtkj_11",Fo={sidebar:g0,title:x0},E0="_layers_1jhzw_1",b0="_wrapper_1jhzw_9",I0="_draggingWrapper_1jhzw_17",T0="_block_1jhzw_21",_0="_dragging_1jhzw_17",C0="_active_1jhzw_56",S0="_add_1jhzw_63",y0="_addTop_1jhzw_79",k0="_visible_1jhzw_95",R0="_button_1jhzw_99",A0="_nameBlock_1jhzw_158",N0="_loader_1jhzw_162",w0="_actions_1jhzw_171",L0="_deleteButton_1jhzw_179",Be={layers:E0,wrapper:b0,draggingWrapper:I0,block:T0,dragging:_0,active:C0,add:S0,addTop:y0,visible:k0,button:R0,nameBlock:A0,loader:N0,actions:w0,deleteButton:L0},j0="_block_sj4cc_1",v0="_title_sj4cc_17",P0="_actions_sj4cc_21",Qt={block:j0,title:v0,actions:P0},ms={header:"Header",footer:"Footer",announcement:"Announcement"},fs=({id:e})=>{const{setCurrentBlock:t}=s.useLayersStore(),{activeBlock:n}=s.usePreviewStore(),[r,o]=k.useState(!1);function i(a){t(a)}return s.jsxRuntimeExports.jsxs("div",{className:s.clx(Qt.block,{[Qt.active]:n.id===e,[Qt.header]:e==="header",[Qt.footer]:e==="footer",[Qt.announcement]:e==="announcement"}),onClick:()=>i(e),onMouseOver:()=>o(!0),onMouseLeave:()=>o(!1),children:[nr[ms[e]]?s.jsxRuntimeExports.jsx("img",{src:nr[ms[e]],width:20,height:20}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Cards",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:Qt.title,children:ms[e]}),s.jsxRuntimeExports.jsx("div",{className:Qt.actions,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},D0=({id:e,name:t,onClick:n,isDragging:r,icon:o})=>{const{activeBlock:i,setActiveBlock:a}=s.usePreviewStore(),{showPreview:u,hidePreview:c,showModal:d,hideModal:p,clearHideTimeout:h,startHideTimeout:f,hoverBlockId:m,isModalVisible:x}=s.useSubmodalStore(),{setPositionBlock:g}=s.useLayersStore(),[C,b]=k.useState(!1),[A,y]=k.useState(!1),[P,L]=k.useState(!1),[R,q]=k.useState(!1),[Y,K]=k.useState(null),w=k.useRef(null),{attributes:$,listeners:B,setNodeRef:H,transform:V,transition:z}=s.useSortable({id:e}),Z={transform:s.CSS.Transform.toString(V),transition:z},{setTitle:G,setDescription:W,setOnConfirm:J}=s.useConfirmationModalStore(),{pages:T,currentPage:ce}=s.usePagesStore(),{removeBlock:ye}=s.useLayersStore(),S=ee=>{ee.stopPropagation(),w.current&&clearTimeout(w.current),a({id:e,neededScroll:!0}),x&&p(),u(e),h()},ae=(ee,Oe=!0)=>{ee.stopPropagation(),c(),d(e),h(),g(e,Oe)},Ae=ee=>{ee.stopPropagation(),a({id:null,neededScroll:!1}),x?f():c()};return k.useEffect(()=>{L(!1),b(!1),y(!1),q(!1)},[r]),k.useEffect(()=>{x||(y(!1),b(!1))},[x]),s.jsxRuntimeExports.jsxs("div",{ref:H,style:Z,className:s.clx(Be.wrapper,{[Be.draggingWrapper]:r&&i.id===e}),onClick:ee=>{ee.stopPropagation(),n(e)},onMouseEnter:S,onMouseLeave:Ae,...$,...B,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(Be.block,{[Be.dragging]:r&&i.id===e,[Be.active]:!r&&i.id===e}),children:[o?s.jsxRuntimeExports.jsx("img",{src:o,width:20,height:20}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Cards",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:Be.nameBlock,children:t}),m===e&&!r&&s.jsxRuntimeExports.jsx("div",{className:s.clx(Be.addTop,{[Be.visible]:A}),onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},children:s.jsxRuntimeExports.jsxs("button",{className:Be.button,onClick:ee=>ae(ee,!1),onMouseEnter:()=>{const ee=setTimeout(()=>{r||q(!0)},200);K(ee)},onMouseLeave:()=>{Y&&clearTimeout(Y),q(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#fff"}),R&&s.jsxRuntimeExports.jsx(Tn,{text:"Click to add a section"})]})}),m===e&&!r&&s.jsxRuntimeExports.jsx("div",{className:s.clx(Be.add,{[Be.visible]:C}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},children:s.jsxRuntimeExports.jsxs("button",{className:Be.button,onClick:ee=>ae(ee),onMouseEnter:()=>{const ee=setTimeout(()=>{r||L(!0)},200);K(ee)},onMouseLeave:()=>{Y&&clearTimeout(Y),L(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#fff"}),P&&s.jsxRuntimeExports.jsx(Tn,{text:"Click to add a section"})]})})]}),m===e&&!r&&s.jsxRuntimeExports.jsxs("div",{className:Be.actions,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),s.jsxRuntimeExports.jsx("div",{className:Be.deleteButton,onClick:ee=>{ee.stopPropagation(),G("Remove Block"),W(`Are you sure you want to delete ${t||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),J(()=>{T&&ye(T[ce].path,e)})},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},O0=()=>{const{blocks:e,setCurrentBlock:t,currentBlock:n,moveBlock:r,isLoadingLayers:o,announcement:i}=s.useLayersStore(),{currentPage:a,pages:u}=s.usePagesStore(),{setMouseOverModal:c,setHoverBlockId:d}=s.useSubmodalStore(),{sourceBlocks:p}=s.useBlocksStore();function h(b){t(b),c(!1),d(null)}const f=s.useSensors(s.useSensor(s.PointerSensor,{activationConstraint:{distance:5}})),[m,x]=k.useState(!1),g=()=>{x(!0)},C=b=>{x(!1);const{active:A,over:y}=b;if(y&&A.id!==y.id&&u&&u[a]){const P=u[a].path,L=e[P].order,R=L.indexOf(A.id),q=L.indexOf(y.id);R!==-1&&q!==-1&&r(P,R,q)}};return s.jsxRuntimeExports.jsx("div",{className:Be.layers,children:o?s.jsxRuntimeExports.jsx("div",{className:Be.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[i&&s.jsxRuntimeExports.jsx(fs,{id:"announcement"}),s.jsxRuntimeExports.jsx(fs,{id:"header"}),!n&&s.jsxRuntimeExports.jsx(s.DndContext,{sensors:f,onDragEnd:C,onDragStart:g,children:u&&u[a]&&e[u[a].path]&&s.jsxRuntimeExports.jsx(s.SortableContext,{items:e[u[a].path].order,strategy:s.verticalListSortingStrategy,children:e[u[a].path].order.map((b,A)=>s.jsxRuntimeExports.jsx(D0,{id:b,name:s.getDisplayName(e[u[a].path].data[b].name,p),index:A,onClick:h,isDragging:m,icon:nr[e[u[a].path].data[b].name]},b))})}),s.jsxRuntimeExports.jsx(fs,{id:"footer"})]})})},B0="_loader_eyvkk_1",M0={loader:B0},F0=()=>{const{isLoadingSettings:e}=s.useSettingsStore();return e?s.jsxRuntimeExports.jsx("div",{className:M0.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):s.jsxRuntimeExports.jsx(H0,{})},H0=()=>{const{settings:e}=s.useSettingsStore(),{settings:t,setSettingsInstance:n}=s.useBlocksStore();if(!e)return null;const{setError:r}=s.useErrorStore(),o=new t(e.blockSettings);k.useEffect(()=>{n(o)},[e]);try{return o.renderSettings()}catch(i){throw console.error("Error rendering settings:",i),r({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),i}},U0="_theme_a1one_1",$0="_block_a1one_8",z0="_name_a1one_23",W0="_loader_a1one_27",_r={theme:U0,block:$0,name:z0,loader:W0},q0=()=>{const e=s.useNavigate(),{isLoadingThemeSettings:t,setActiveBlock:n}=s.useThemeSettingsStore();function r(o){switch(o==null?void 0:o.name){case"Colors":e("/admin/builder/theme/colors"),n(dt[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),n(dt[1]);break;case"Borders":e("/admin/builder/theme/borders"),n(dt[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),n(dt[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),n(dt[4]);break}}return s.jsxRuntimeExports.jsx("div",{className:_r.theme,children:t?s.jsxRuntimeExports.jsx("div",{className:_r.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):dt.map(o=>s.jsxRuntimeExports.jsxs("div",{onClick:()=>r(o),className:s.clx(_r.block),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:o.icon}),s.jsxRuntimeExports.jsx("span",{className:_r.name,children:o.name}),s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretRight"})]},o.icon))})},V0="_render_7e826_9",G0="_open_7e826_24",Y0="_close_7e826_51",X0="_clicked_7e826_55",Q0="_loading_7e826_72",K0="_settings_7e826_76",dn={render:V0,open:G0,close:Y0,clicked:X0,loading:Q0,settings:K0},Z0=({block:e})=>{const{pageContext:t}=s.usePagesStore(),{setError:n}=s.useErrorStore();try{return e.renderSettings(t)}catch(r){throw console.error("Error rendering settings:",r),n({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),r}},J0="_wrapper_15ju8_1",eh="_header_15ju8_8",th="_title_15ju8_15",nh="_colorWrapper_15ju8_21",rh="_name_15ju8_35",sh="_color_15ju8_21",oh="_value_15ju8_47",ih="_length_15ju8_51",et={wrapper:J0,header:eh,title:th,colorWrapper:nh,name:rh,color:sh,value:oh,length:ih},ah=e=>{const{colors:t}=e,{themeSettings:n}=s.useThemeSettingsStore(),[r,o]=k.useState(!0);k.useEffect(()=>{t.length<=3&&o(!0)},[]);function i(a){const u=a.replace("--",""),[c,d]=u.split("-"),p=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c.charAt(0).toUpperCase()+c.slice(1)}`,[h,f]=u.split("-");return{name:p,field:h,variable:f}}return s.jsxRuntimeExports.jsxs("div",{className:et.wrapper,children:[s.jsxRuntimeExports.jsxs("div",{className:et.header,children:[s.jsxRuntimeExports.jsx("div",{className:et.title,children:"Section Colors"}),!r&&s.jsxRuntimeExports.jsxs("div",{className:s.clx(et.value,et.length),onClick:()=>o(!0),children:["+",t.length]})]}),r&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("div",{className:et.colors,children:t.map(a=>{const u=i(a),{variable:c,name:d,field:p}=u;return s.jsxRuntimeExports.jsx(uh,{color:n.colors[p][c],name:d})})}),t.length>3&&s.jsxRuntimeExports.jsxs("div",{className:s.clx(et.value,et.length),onClick:()=>o(!1),children:["Hide ",t.length," colors"]})]})]})},uh=e=>{const{name:t,color:n}=e,{setActiveLabel:r,setModalPosition:o,setInitialColor:i,setShowModal:a,setUpdate:u,setColor:c,setColorChange:d,colorChange:p,setIsGradientActive:h}=s.useColorPickerStore(),{updateColor:f}=s.useThemeSettingsStore(),m=(C,b)=>A=>{f(C,b,A)};k.useEffect(()=>{const C=()=>{a(!1),r(null),i(n),u(()=>{}),c(n),d(()=>{})};return document.body.addEventListener("click",C),()=>{document.body.removeEventListener("click",C)}},[]);const x=C=>{const b=t.split("/")[0],A=b.split(" ")[0].toLowerCase(),y=b.split(" ")[1].toLowerCase();C.stopPropagation(),a(!0),d(p),u(R=>m(y,A)(R)),i(n),c(n),h(y==="surface");const{top:P,left:L}=da(C,550,288,10,20,230,80);o({top:y==="surface"?P:P+125,left:L-200})};function g(C){return C.length>15?C.slice(0,15)+"...":C}return s.jsxRuntimeExports.jsxs("div",{className:et.colorWrapper,onClick:x,children:[s.jsxRuntimeExports.jsx("div",{className:et.color,style:{background:n}}),s.jsxRuntimeExports.jsx("div",{className:et.name,children:t}),s.jsxRuntimeExports.jsx("div",{className:et.value,children:g(n)})]})},lh="_back_1sznl_1",ch="_title_1sznl_9",dh="_deleteButton_1sznl_17",hh="_backIcon_1sznl_30",Cr={back:lh,title:ch,deleteButton:dh,backIcon:hh},ph=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var f,m;const{activeBlock:r}=s.useBlocksStore(),{setTitle:o,setDescription:i,setOnConfirm:a}=s.useConfirmationModalStore(),{blocks:u,currentBlock:c,removeBlock:d}=s.useLayersStore(),{currentPage:p,pages:h}=s.usePagesStore();return s.jsxRuntimeExports.jsxs("div",{className:Cr.back,children:[s.jsxRuntimeExports.jsx("div",{className:Cr.backIcon,onClick:()=>e(),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),s.jsxRuntimeExports.jsx("h3",{className:Cr.title,children:r&&n(r)||h&&h[p]&&u[h[p].path]&&c&&n((f=u[h[p].path].data[c])==null?void 0:f.name)||c&&Ct(c)||"Loading"}),c&&h&&!["header","footer","announcement"].includes(c)&&u[h[p].path].data[c]&&n((m=u[h[p].path].data[c])==null?void 0:m.name)!=="unknown name"&&s.jsxRuntimeExports.jsx("button",{onClick:x=>{var g;x.stopPropagation(),o("Remove Block"),i(`Are you sure you want to delete ${n((g=u[h[p].path].data[c])==null?void 0:g.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),a(()=>{t(!0),d(h[p].path,c),e(!0)})},className:Cr.deleteButton,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},mh=()=>{const e=s.useNavigate(),[t,n]=k.useState(!1),{header:r,footer:o,announcement:i,sourceBlocks:a,activeBlock:u,setActiveBlock:c,currentInstance:d,setCurrentInstance:p}=s.useBlocksStore(),{setActiveBlock:h}=s.usePreviewStore(),{blocks:f,addBlock:m,editBlock:x,currentBlock:g,setCurrentBlock:C,header:b,footer:A,announcement:y,isLoadingLayers:P}=s.useLayersStore(),{currentPage:L,pages:R}=s.usePagesStore(),{past:q,future:Y}=s.useHistoryStore();function K(B=!1){if(R&&d&&g&&!["header","footer","announcement"].includes(g)&&!B){const H={blockSettings:{}};Object.keys(d.blockSettings).filter(V=>!["displayName","isAddable"].includes(V)).map(V=>{H.blockSettings[V]=d.blockSettings[V]}),x(R[L].path,g,{name:f[R[L].path].data[g].name,value:H})}c(null),C(null),h({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),p(null)}function w(B){var Z;if(!R||!L||!B)return null;if(B==="header"){const G=new r;return Object.keys(G.blockSettings).forEach(W=>{G.blockSettings[W]=b==null?void 0:b.blockSettings[W]}),Object.keys(G.blockColors).forEach(W=>{G.blockColors[W]=b==null?void 0:b.blockColors[W]}),G}if(B==="footer"){const G=new o;return Object.keys(G.blockSettings).forEach(W=>{G.blockSettings[W]=A==null?void 0:A.blockSettings[W]}),Object.keys(G.blockColors).forEach(W=>{G.blockColors[W]=A==null?void 0:A.blockColors[W]}),G}if(B==="announcement"){const G=new i;return Object.keys(G.blockSettings).forEach(W=>{G.blockSettings[W]=y==null?void 0:y.blockSettings[W]}),Object.keys(G.blockColors).forEach(W=>{G.blockColors[W]=y==null?void 0:y.blockColors[W]}),G}const H=f[R[L].path];if(!H||!H.data[B])return null;const V=H.data[B];return!V||!a[V.name]?null:new a[V.name]((Z=V.value)==null?void 0:Z.blockSettings)}k.useEffect(()=>{if(g){const B=w(g);p(B)}else p(null)},[g,q,Y,u]),k.useEffect(()=>{if(u&&R&&!g){const B={blockSettings:{},blockColors:{}},H=new a[u];p(H),Object.keys(H.blockSettings).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{B.blockSettings[z]=H.blockSettings[z]}),Object.keys(H.blockColors).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{B.blockColors[z]=H.blockColors[z]});const V=m(R[L].path,{name:u,value:B});h({id:V,neededScroll:!0}),C(V),e("/admin/builder")}},[u,q,Y]);function $(B){if(!a)return"unknown name";if(!a[B])return g==="header"?b==null?void 0:b.blockSettings.displayName:g==="footer"?A==null?void 0:A.blockSettings.displayName:g==="announcement"?y==null?void 0:y.blockSettings.displayName:"unknown name";const H=new a[B];return!H.blockSettings||!H.blockSettings.displayName?"unknown name":H.blockSettings.displayName}return s.jsxRuntimeExports.jsxs("div",{className:s.clx(dn.render,{[dn.open]:g,[dn.close]:!g,[dn.clicked]:t}),onClick:B=>B.stopPropagation(),style:{opacity:P?0:1},children:[s.jsxRuntimeExports.jsx(ph,{onClick:K,setIsClicked:n,getDisplayName:$}),s.jsxRuntimeExports.jsxs("div",{className:dn.settings,children:[d&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(Z0,{block:d}),s.jsxRuntimeExports.jsx(ah,{colors:d.blockColors})]}),!u&&!g&&s.jsxRuntimeExports.jsx("div",{className:dn.loading,children:"Loading"})]})]})},fh="_header_9rrfr_1",gh="_title_9rrfr_9",xh="_backIcon_9rrfr_15",gs={header:fh,title:gh,backIcon:xh},ar=({onClick:e,title:t})=>s.jsxRuntimeExports.jsxs("div",{className:gs.header,children:[s.jsxRuntimeExports.jsx("div",{className:gs.backIcon,onClick:e,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),s.jsxRuntimeExports.jsx("span",{className:gs.title,children:t})]}),Eh="_options_ymds7_1",bh={options:Eh},Ih="_wrapper_kzokw_1",Th="_open_kzokw_16",_h="_close_kzokw_20",xs={wrapper:Ih,open:Th,close:_h},ur=e=>{const{isOpen:t,isClose:n,children:r}=e;return s.jsxRuntimeExports.jsx("div",{className:s.clx(xs.wrapper,{[xs.open]:t,[xs.close]:n}),children:r})},Ch=()=>{var d,p;const{activeBlock:e,themeSettings:t,updateBorder:n,setActiveBlock:r}=s.useThemeSettingsStore();function o(h,f){n(f,h)}const i=s.useNavigate();function a(){r(null),i("/admin/builder/theme")}const u=k.useMemo(()=>t.borders,[t]),c=(e==null?void 0:e.name)==="Borders";return s.jsxRuntimeExports.jsxs(ur,{isOpen:c,isClose:!c,children:[s.jsxRuntimeExports.jsx(ar,{onClick:a,title:"Borders Style"}),s.jsxRuntimeExports.jsxs("div",{className:bh.options,children:[s.jsxRuntimeExports.jsx(s.Select,{label:"Border Radius (px)",options:Object.keys(ls),value:((d=Object.entries(ls).find(([h,f])=>f===u.radius))==null?void 0:d[0])||"None",onChange:h=>o(ls[h],"radius")}),s.jsxRuntimeExports.jsx(s.Select,{label:"Border Thickness (px)",options:Object.keys(cs),value:((p=Object.entries(cs).find(([h,f])=>f===u.thickness))==null?void 0:p[0])||"None",onChange:h=>o(cs[h],"thickness")})]})]})},Sh="_options_jo38w_1",yh="_alignments_jo38w_9",kh="_blocks_jo38w_15",Rh="_alignment_jo38w_9",Ah="_active_jo38w_34",Nh="_chargeTypes_jo38w_41",wh="_charge_jo38w_41",Lh="_chargeActive_jo38w_69",jh="_sliderContainer_jo38w_83",vh="_shadowInputs_jo38w_91",Ph="_label_jo38w_102",Dh="_shadowInputsRow_jo38w_111",Oh="_shadowInputsOpen_jo38w_119",We={options:Sh,alignments:yh,blocks:kh,alignment:Rh,active:Ah,chargeTypes:Nh,charge:wh,chargeActive:Lh,sliderContainer:jh,shadowInputs:vh,label:Ph,shadowInputsRow:Dh,shadowInputsOpen:Oh};function Es(e){return(e.includes("linear-gradient")||e.includes("radial-gradient"))&&/^linear-gradient\(\d+deg,\s*#[A-Fa-f0-9]{8}\s+\d+%,\s*#[A-Fa-f0-9]{8}\s+\d+%\)$/.test(e)?!0:/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const ht=e=>{const{initialColor:t,onChange:n,title:r,labelStyle:o="primary",isGradientActive:i=!0}=e,[a,u]=k.useState(t);k.useEffect(()=>{u(t)},[t]);const{setActiveLabel:c,setModalPosition:d,setInitialColor:p,setShowModal:h,setUpdate:f,setColor:m,setColorChange:x,setIsGradientActive:g,colorChange:C}=s.useColorPickerStore();k.useEffect(()=>{const P=()=>{h(!1),c(null),p(t),f(()=>{}),m(t),x(()=>{})};return document.body.addEventListener("click",P),()=>{document.body.removeEventListener("click",P)}},[t]);const b=P=>{P.stopPropagation(),h(!0),x(u),f(n),p(t),m(a),g(i);const{top:L,left:R}=da(P,600,288,10,20,230,80);d({top:L,left:R})},A=P=>{const L=P.target.value;u(L),Es(L)&&(n(L),m(L),x(C))},y=()=>{Es(a)||u(t)};return s.jsxRuntimeExports.jsxs("div",{className:le.content,children:[s.jsxRuntimeExports.jsx("span",{className:s.clx(le.name,{[le.secondary]:o==="secondary"}),children:r}),s.jsxRuntimeExports.jsxs("label",{className:le.label,onClick:P=>P.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:le.colorValue,style:{background:Es(a)?a:t},onClick:b}),s.jsxRuntimeExports.jsx("input",{type:"text",value:a.includes("linear-gradient")?a:a.toUpperCase(),onChange:A,onBlur:y,className:le.input,style:{textTransform:a.includes("linear-gradient")?"none":"uppercase"}})]})]})},Bh=["left","center","right"],Mh=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:r}=s.useThemeSettingsStore(),{fonts:o}=s.useFontsStore(),[i,a]=k.useState("primary");function u(g,C){n(i,C,g)}const[c,d]=k.useState(!1),p=t.buttons[i],h=s.useNavigate();function f(){r(null),h("/admin/builder/theme")}const m=(e==null?void 0:e.name)==="Buttons";function x(g,C){u({...p.boxShadow,[g]:C},"boxShadow")}return s.jsxRuntimeExports.jsxs(ur,{isOpen:m,isClose:!m,children:[s.jsxRuntimeExports.jsx(ar,{onClick:f,title:"Buttons Style"}),s.jsxRuntimeExports.jsx("div",{className:We.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(g=>s.jsxRuntimeExports.jsx("div",{className:s.clx(We.charge,{[We.chargeActive]:i===g}),onClick:()=>a(g),children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),p&&s.jsxRuntimeExports.jsxs("div",{className:We.options,children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Height (px)",value:String(p.height),onChange:g=>u(Number(g),"height"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font Size (px)",value:String(p.size),onChange:g=>u(Number(g),"size"),options:$r}),s.jsxRuntimeExports.jsx(s.Input,{label:"Border Radius (px)",value:String(p.radius),onChange:g=>u(Number(g),"radius"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font",value:p.font,onChange:g=>u(g,"font"),options:[...o.filter(g=>g.name!==p.font).map(g=>g.name)]}),s.jsxRuntimeExports.jsx(ht,{initialColor:p.color,onChange:g=>u(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsx(ht,{initialColor:p.background,onChange:g=>u(g,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),s.jsxRuntimeExports.jsxs("div",{className:We.sliderContainer,children:[s.jsxRuntimeExports.jsx("h4",{className:We.label,children:"Shadow"}),s.jsxRuntimeExports.jsx(s.Button,{type:"Secondary",onClick:()=>d(!c),style:{padding:5,display:"flex"},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretUp",style:{rotate:c?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(We.shadowInputs,{[We.shadowInputsOpen]:c}),children:[s.jsxRuntimeExports.jsxs("div",{className:We.shadowInputsRow,children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Left (px)",value:String(p.boxShadow.left),onChange:g=>x("left",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Top (px)",value:String(p.boxShadow.top),onChange:g=>x("top",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Blur (px)",value:String(p.boxShadow.blur),onChange:g=>x("blur",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:s.jsxRuntimeExports.jsx(s.Input,{label:"Spread (px)",value:String(p.boxShadow.spread),onChange:g=>x("spread",Number(g)),type:"number"})})]}),s.jsxRuntimeExports.jsx(ht,{initialColor:p.boxShadow.color,onChange:g=>x("color",g),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),s.jsxRuntimeExports.jsxs("div",{className:We.alignments,children:[s.jsxRuntimeExports.jsx("h4",{className:We.label,children:"Alignment Type"}),s.jsxRuntimeExports.jsx("div",{className:We.blocks,children:Bh.map(g=>s.jsxRuntimeExports.jsx("div",{className:s.clx(We.alignment,{[We.active]:p.alignment===g}),onClick:()=>{u(g,"alignment")},children:s.jsxRuntimeExports.jsx(s.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:p.alignment===g?"#252525":"#757575"})},g))})]}),s.jsxRuntimeExports.jsx(s.Switch,{label:"Enable Hover",onChange:g=>u(g,"hover"),current:p.hover}),p.hover&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(ht,{initialColor:p.colorHover,onChange:g=>u(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsx(ht,{initialColor:p.backgroundHover,onChange:g=>u(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},Fh="_category_hxy9u_1",Hh="_categoryTitle_hxy9u_19",bs={category:Fh,categoryTitle:Hh},Uh=()=>{const{themeSettings:e,setActiveColorCategory:t}=s.useThemeSettingsStore();function n(r){t(r)}return s.jsxRuntimeExports.jsx("div",{className:bs.wrapper,children:Object.keys(e.colors).map(r=>r==="icon"?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{}):s.jsxRuntimeExports.jsxs("div",{className:bs.category,onClick:()=>n(r),children:[s.jsxRuntimeExports.jsxs("h2",{className:bs.categoryTitle,children:[r==="text"?"Text & Icon":Ct(r)," Colors"]}),s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretRight",width:24,height:24})]},r))})},$h="_options_ikvjo_38",zh={options:$h},Wh=()=>{const{activeBlock:e,setActiveFont:t,activeFont:n,themeSettings:r,updateFont:o}=s.useThemeSettingsStore(),{fonts:i}=s.useFontsStore(),[a,u]=k.useState(null);function c(){t(null)}function d(g,C){a&&n&&o("desktop",a,n,C,g)}const[p,h]=k.useState([]),f=k.useMemo(()=>n?r.fonts.desktop.heading[n]?(u("heading"),r.fonts.desktop.heading[n]):r.fonts.desktop.body[n]?(u("body"),r.fonts.desktop.body[n]):(u(null),null):null,[n,r]);k.useEffect(()=>{if(f){const g=i.find(C=>C.name===f.font);g&&(h(g.weights),g.weights.includes(f.boldWeight)||d("400","boldWeight"),g.weights.includes(f.weight)||d("400","weight"))}},[f,n]);const m=!!((e==null?void 0:e.name)==="Fonts"&&n),x=(e==null?void 0:e.name)!=="Fonts"||!n;return s.jsxRuntimeExports.jsxs(ur,{isOpen:m,isClose:x,children:[s.jsxRuntimeExports.jsx(ar,{onClick:c,title:"Font Style"}),n&&f&&s.jsxRuntimeExports.jsxs("div",{className:zh.options,children:[s.jsxRuntimeExports.jsx(s.Select,{label:"Font",value:f.font,onChange:g=>d(g,"font"),options:[...i.filter(g=>g.name!==f.font).map(g=>g.name)]}),s.jsxRuntimeExports.jsx(s.Select,{label:"Size",value:String(f.size),onChange:g=>d(g,"size"),options:$r}),s.jsxRuntimeExports.jsx(s.Select,{label:"Default Weight",value:String(f.weight),onChange:g=>d(g,"weight"),options:p}),s.jsxRuntimeExports.jsx(s.Select,{label:"Bold Weight",value:String(f.boldWeight),onChange:g=>d(g,"boldWeight"),options:p}),s.jsxRuntimeExports.jsx(s.Select,{label:"Case",value:String(f.case).charAt(0).toUpperCase()+String(f.case).slice(1),onChange:g=>d(g.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(g=>g.toLowerCase()!==String(f.case))})]})]})},qh="_wrapper_mkmxa_1",Vh="_category_mkmxa_5",Gh="_categoryTitle_mkmxa_11",Yh="_font_mkmxa_17",Xh="_content_mkmxa_32",Qh="_icon_mkmxa_39",Kh="_paragraph_mkmxa_50",Lt={wrapper:qh,category:Vh,categoryTitle:Gh,font:Yh,content:Xh,icon:Qh,paragraph:Kh},Zh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},Jh=e=>{const{font:t,size:n,id:r,category:o}=e,{setActiveFont:i}=s.useThemeSettingsStore();return s.jsxRuntimeExports.jsxs("div",{className:Lt.font,onClick:()=>i(r),children:[s.jsxRuntimeExports.jsx("div",{className:s.clx(Lt.icon,{[Lt.paragraph]:o==="paragraph"}),children:s.jsxRuntimeExports.jsx(s.Icon,{name:o==="paragraph"?"TextB":"TextH"})}),s.jsxRuntimeExports.jsxs("div",{className:Lt.content,children:[s.jsxRuntimeExports.jsx("h2",{className:Lt.categoryTitle,children:Ct(Zh[r])}),s.jsxRuntimeExports.jsx("span",{className:Lt.value,children:`${t}, ${n}px`})]})]})},ep=()=>{const{themeSettings:e,setActiveFont:t,activeBlock:n}=s.useThemeSettingsStore();k.useEffect(()=>(r(),()=>{r()}),[]);function r(){t(null)}if(n!=null&&n.name)return s.jsxRuntimeExports.jsx("div",{className:Lt.wrapper,children:Object.entries(e.fonts.desktop).sort(([o],[i])=>o==="heading"?-1:i==="heading"?1:0).map(([o,i])=>s.jsxRuntimeExports.jsxs("div",{className:Lt.category,children:[s.jsxRuntimeExports.jsx("h2",{className:Lt.categoryTitle,children:Ct(o)}),Object.entries(i).map(([a,u])=>s.jsxRuntimeExports.jsx(Jh,{id:a,category:o,...u},a))]},o))})},tp="_wrapper_16ym0_2",np="_categoryTitle_16ym0_12",rp="_title_16ym0_74",sp="_field_16ym0_82",op="_alignments_16ym0_92",ip="_lineField_16ym0_98",ap="_style_16ym0_106",up="_header_16ym0_113",ct={wrapper:tp,categoryTitle:np,title:rp,field:sp,alignments:op,lineField:ip,style:ap,header:up},lp="_blocks_emecf_1",cp="_block_emecf_1",dp="_active_emecf_21",Is={blocks:lp,block:cp,active:dp},Ho=e=>{const{items:t,selectedItem:n,onSelect:r,getIconName:o}=e;return s.jsxRuntimeExports.jsx("div",{className:Is.blocks,children:t.map(i=>s.jsxRuntimeExports.jsx("div",{className:s.clx(Is.block,{[Is.active]:n===i}),onClick:()=>r(i),children:s.jsxRuntimeExports.jsx(s.Icon,{name:o(i),fill:n===i?"#252525":"#757575"})},String(i)))})},hp=["left","center","right"],pp=["solid","dashed"],Mn=e=>{const{title:t,children:n,rightAddon:r}=e;return s.jsxRuntimeExports.jsxs("div",{className:ct.field,children:[s.jsxRuntimeExports.jsxs("div",{className:ct.header,children:[s.jsxRuntimeExports.jsx("h4",{className:ct.categoryTitle,children:t}),r]}),n]})},mp=()=>{const{themeSettings:e,updateInput:t}=s.useThemeSettingsStore(),n=k.useMemo(()=>e.inputs,[e]),r=(i,a,u)=>{t(i,a,u)},o=i=>a=>{t(i,a,"color")};return s.jsxRuntimeExports.jsxs("div",{className:ct.wrapper,children:[s.jsxRuntimeExports.jsxs(Mn,{title:"General",children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Height (px)",value:String(n.general.height),onChange:i=>r("general",i,"height"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font Size (px)",onChange:i=>r("general",i,"size"),value:String(n.general.size),options:$r}),s.jsxRuntimeExports.jsx(ht,{initialColor:Ct(n.general.color),onChange:o("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),s.jsxRuntimeExports.jsx(Mn,{title:"Field Fill",rightAddon:s.jsxRuntimeExports.jsx("div",{className:ct.switch,children:s.jsxRuntimeExports.jsx(s.Switch,{onChange:i=>r("field",i,"active"),current:n.field.active})}),children:s.jsxRuntimeExports.jsx(ht,{initialColor:n.field.color,onChange:o("field"),title:"Color",labelStyle:"secondary"})}),s.jsxRuntimeExports.jsx(Mn,{title:"Placeholder",children:s.jsxRuntimeExports.jsx(ht,{initialColor:Ct(n.placeholder.color),onChange:o("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),s.jsxRuntimeExports.jsxs(Mn,{title:"Border",rightAddon:s.jsxRuntimeExports.jsx("div",{className:ct.switch,children:s.jsxRuntimeExports.jsx(s.Switch,{onChange:i=>r("border",i,"active"),current:n.border.active})}),children:[s.jsxRuntimeExports.jsxs("div",{className:ct.lineField,children:[s.jsxRuntimeExports.jsxs("div",{className:ct.style,children:[s.jsxRuntimeExports.jsx("span",{className:ct.title,children:"Style"}),s.jsxRuntimeExports.jsx(Ho,{items:pp,selectedItem:n.border.style,onSelect:i=>r("border",i,"style"),getIconName:i=>i==="solid"?"Minus":"Selection"})]}),s.jsxRuntimeExports.jsx(s.Input,{label:"Radius (px)",value:String(n.border.radius),onChange:i=>r("border",i,"radius"),type:"number",min:0})]}),s.jsxRuntimeExports.jsx(s.Input,{label:"Thickness (px)",value:String(n.border.thickness),onChange:i=>r("border",i,"thickness"),type:"number",min:0}),s.jsxRuntimeExports.jsx(ht,{initialColor:Ct(n.border.color),onChange:o("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),s.jsxRuntimeExports.jsxs(Mn,{title:"Label",children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Line Height (px)",value:String(n.label.height),onChange:i=>r("label",i,"height"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font Size (px)",onChange:i=>r("label",i,"size"),value:String(n.label.size),options:$r}),s.jsxRuntimeExports.jsx(ht,{initialColor:Ct(n.label.color),onChange:o("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsxs("div",{className:ct.alignments,children:[s.jsxRuntimeExports.jsx("h4",{className:ct.title,children:"Alignment Type"}),s.jsxRuntimeExports.jsx(Ho,{items:hp,selectedItem:n.label.alignment,onSelect:i=>r("label",i,"alignment"),getIconName:i=>i==="center"?"AlignCenterHorizontal":i==="left"?"AlignLeft":"AlignRight"})]})]})]})},fp="_wrapper_1yw63_2",gp="_color_1yw63_24",xp="_content_1yw63_33",Ep="_preview_1yw63_42",bp="_container_1yw63_52",Ip="_buttonWrapper_1yw63_62",Tp="_button_1yw63_62",_p="_buttonBorder_1yw63_80",Cp="_buttonBackground_1yw63_83",Sp="_text_1yw63_87",yp="_textText_1yw63_93",kp="_icon_1yw63_97",Rp="_iconIcon_1yw63_100",Ap="_annotation_1yw63_104",Np="_annotationText_1yw63_111",wp="_label_1yw63_116",Lp="_circle_1yw63_127",jp="_line_1yw63_140",vp="_circle1_1yw63_154",Pp="_circle2_1yw63_159",Dp="_annotationIcon_1yw63_164",Op="_annotationBorder_1yw63_192",Bp="_line1_1yw63_203",Mp="_line2_1yw63_210",Fp="_circle3_1yw63_227",Hp="_circle4_1yw63_232",Up="_annotationSurface_1yw63_237",X={wrapper:fp,color:gp,content:xp,preview:Ep,container:bp,buttonWrapper:Ip,button:Tp,buttonBorder:_p,buttonBackground:Cp,text:Sp,textText:yp,icon:kp,iconIcon:Rp,annotation:Ap,annotationText:Np,label:wp,circle:Lp,line:jp,circle1:vp,circle2:Pp,annotationIcon:Dp,annotationBorder:Op,line1:Bp,line2:Mp,circle3:Fp,circle4:Hp,annotationSurface:Up},$p=()=>{const{activeColorCategory:e}=s.useThemeSettingsStore();return s.jsxRuntimeExports.jsx("div",{className:X.container,children:s.jsxRuntimeExports.jsxs("div",{className:X.buttonWrapper,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(X.button,{[X.buttonBorder]:e==="border",[X.buttonBackground]:e==="surface"}),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Smiley",className:s.clx(X.icon,{[X.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),s.jsxRuntimeExports.jsx("span",{className:s.clx(X.text,{[X.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&s.jsxRuntimeExports.jsxs("div",{className:s.clx(X.annotation,X.annotationText),children:[s.jsxRuntimeExports.jsx("div",{className:X.label,children:"Text Color"}),s.jsxRuntimeExports.jsx("div",{className:X.line}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle1)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle2)})]}),e==="text"&&s.jsxRuntimeExports.jsxs("div",{className:s.clx(X.annotation,X.annotationIcon),children:[s.jsxRuntimeExports.jsx("div",{className:X.label,children:"Icon Color"}),s.jsxRuntimeExports.jsx("div",{className:X.line}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle1)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle2)})]}),e==="border"&&s.jsxRuntimeExports.jsxs("div",{className:s.clx(X.annotation,X.annotationBorder),children:[s.jsxRuntimeExports.jsx("div",{className:X.label,children:"Border Color"}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.line,X.line1)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.line,X.line2)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle1)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle2)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle3)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle4)})]}),e==="surface"&&s.jsxRuntimeExports.jsxs("div",{className:s.clx(X.annotation,X.annotationSurface),children:[s.jsxRuntimeExports.jsx("div",{className:X.label,children:"Surface Color"}),s.jsxRuntimeExports.jsx("div",{className:X.line}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle1)}),s.jsxRuntimeExports.jsx("div",{className:s.clx(X.circle,X.circle2)})]})]})})},zp={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],border:["primary","secondary","action","actionHover","disabled","warning","error","success","information","focus"],surface:["primary","secondary","action1","action1Hover","action2","action2Hover","disabled","warning","error","success","information","modal"]},Wp=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:r,updateColor:o}=s.useThemeSettingsStore();function i(){t(null)}function a(p,h,f){o(p,h,f)}const u=!!((e==null?void 0:e.name)==="Colors"&&n),c=(e==null?void 0:e.name)!=="Colors"||!n,d=n?zp[n]:[];return s.jsxRuntimeExports.jsxs(ur,{isOpen:u,isClose:c,children:[s.jsxRuntimeExports.jsx(ar,{onClick:i,title:n==="text"?"Text & Icon Colors":`${Ct(n)} Colors`}),n&&s.jsxRuntimeExports.jsxs("div",{className:X.wrapper,children:[s.jsxRuntimeExports.jsx($p,{}),d.map(p=>{const h=r.colors[n][p];return typeof h!="string"?null:s.jsxRuntimeExports.jsx("div",{className:X.color,children:s.jsxRuntimeExports.jsxs("div",{className:X.content,children:[s.jsxRuntimeExports.jsx("div",{className:X.preview,style:{background:h}}),s.jsxRuntimeExports.jsx(ht,{title:Ct(p),initialColor:h,onChange:f=>a(n,p,f),isGradientActive:n==="surface"})]})},p)})]})]})},qp="_loader_1p5lr_1",Vp={loader:qp},Gp=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=s.useThemeSettingsStore();return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:n?s.jsxRuntimeExports.jsx("div",{className:Vp.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&t.fonts&&s.jsxRuntimeExports.jsx(ep,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&s.jsxRuntimeExports.jsx(Wh,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&s.jsxRuntimeExports.jsx(Uh,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&s.jsxRuntimeExports.jsx(Wp,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&s.jsxRuntimeExports.jsx(mp,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&s.jsxRuntimeExports.jsx(Ch,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&s.jsxRuntimeExports.jsx(Mh,{})]})})},Yp=()=>{const{activeBlock:e,setActiveBlock:t}=s.useThemeSettingsStore(),{activeBlock:n}=s.useNavbarStore(),r=s.useNavigate();function o(){t(null),r("/admin/builder/theme")}const i=!!e,a=!e||n.name!=="Theme";return s.jsxRuntimeExports.jsxs(ur,{isOpen:i,isClose:a,children:[s.jsxRuntimeExports.jsx(ar,{onClick:o,title:(e==null?void 0:e.name)||""}),s.jsxRuntimeExports.jsx(Gp,{})]})},Xp=()=>{const{activeBlock:e}=s.useNavbarStore(),{showTooltip:t}=s.useTooltipStore();function n(){switch(e.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return s.jsxRuntimeExports.jsxs("div",{className:Fo.sidebar,style:{zIndex:t?50:"auto"},children:[s.jsxRuntimeExports.jsx("h3",{className:Fo.title,children:n()}),e.name==="Layers"&&s.jsxRuntimeExports.jsx(O0,{}),e.name==="Add"&&s.jsxRuntimeExports.jsx(ha,{}),s.jsxRuntimeExports.jsx(mh,{}),s.jsxRuntimeExports.jsx(Yp,{}),e.name==="Theme"&&s.jsxRuntimeExports.jsx(q0,{}),e.name==="Settings"&&s.jsxRuntimeExports.jsx(F0,{})]})},Qp="_wrapper_no6if_1",Kp="_header_no6if_12",Zp="_content_no6if_23",Jp="_buttons_no6if_44",em="_label_no6if_51",tm="_description_no6if_52",nm="_preview_no6if_60",rm="_block_no6if_66",sm="_slug_no6if_75",om="_title_no6if_81",im="_closeIcon_no6if_87",at={wrapper:Qp,header:Kp,content:Zp,buttons:Jp,label:em,description:tm,preview:nm,block:rm,slug:sm,title:om,closeIcon:im},am=()=>{var K,w,$,B,H,V,z;const{setIsOpenModal:e,pages:t,createPage:n,updatePage:r,isEdit:o,setIsEdit:i,editedPage:a,setEditedPage:u,pageContext:c}=s.usePagesStore(),{setIsOpen:d}=s.useModalStore(),{createPage:p,updatePage:h}=s.useLayersStore(),[f,m]=k.useState(a?t&&((K=t[a])==null?void 0:K.path):""),[x,g]=k.useState(a?t&&((w=t[a])==null?void 0:w.name):""),[C,b]=k.useState(a?t&&(($=t[a])==null?void 0:$.seo)&&((H=(B=t[a])==null?void 0:B.seo)==null?void 0:H.pageDescription)||"":`${c.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[A,y]=k.useState(a&&t&&(V=t[a])!=null&&V.isPrivate?"private":"public");function P(){m(""),g(""),b(""),y("public"),i(!1),u(null)}function L(){d(!1),setTimeout(()=>{P(),e(!1),d(!0)},300)}k.useEffect(()=>()=>{L()},[]);function R(Z){return Z[0]==="/"?Z:"/"+Z}function q(){n({path:R(f),name:x||f||"",icon:"File",seo:{pageTitle:x||"",pageDescription:C||""},visibility:A||"public"}),p(R(f)),L()}function Y(){t&&(s.defaultPagePaths.includes(t[a].path)||ca(t[a].path),h(t[a].path||"",f||""),r(a,{path:R(f),name:x||f,icon:t[a].icon||"File",seo:{pageTitle:x||"",pageDescription:C||""},visibility:A||"public"})),L()}return s.jsxRuntimeExports.jsxs("div",{className:at.wrapper,onClick:Z=>Z.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:at.header,children:[s.jsxRuntimeExports.jsx("h2",{children:o?"Edit Page":"Create New Page"}),s.jsxRuntimeExports.jsx("div",{className:at.closeIcon,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:L})})]}),s.jsxRuntimeExports.jsxs("div",{className:at.content,children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Page Slug",onChange:Z=>m(Z),value:f,placeholder:"path-to-page",disabled:!!(a&&t&&((z=t[a])!=null&&z.name)&&s.defaultPagePaths.includes(t[a].path)),required:!0,regex:"^.+$"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Page Title",onChange:Z=>{g(Z)},value:x.charAt(0).toUpperCase()+x.slice(1),placeholder:"Contact us"}),s.jsxRuntimeExports.jsx(s.Textarea,{label:"Description",onChange:Z=>b(Z),value:C,placeholder:`${c.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`,maxLength:150}),s.jsxRuntimeExports.jsxs("div",{className:at.preview,children:[s.jsxRuntimeExports.jsx("span",{className:at.label,children:"Preview"}),s.jsxRuntimeExports.jsxs("div",{className:at.block,children:[s.jsxRuntimeExports.jsx("span",{className:at.slug,children:f||"yoursite.url"}),s.jsxRuntimeExports.jsx("span",{className:at.title,children:x||"My Blank Page"}),s.jsxRuntimeExports.jsx("span",{className:at.description,children:C||"It is My Description"})]})]})]}),s.jsxRuntimeExports.jsxs("div",{className:at.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:L,type:"Secondary",children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:o?Y:q,disabled:f.length===0,children:o?"Update":"Create"})]})]})},um="_layout_1pjho_1",lm="_main_1pjho_10",cm="_content_1pjho_18",dm="_notifications_1pjho_26",Sr={layout:um,main:lm,content:cm,notifications:dm},hm="_notification_2jmah_1",pm="_text_2jmah_22",mm="_timer_2jmah_27",fm="_warning_2jmah_32",gm="_error_2jmah_37",xm="_success_2jmah_42",hn={notification:hm,text:pm,timer:mm,warning:fm,error:gm,success:xm},Uo={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},pa=e=>{const{type:t,message:n,style:r,padding:o,timer:i,id:a,element:u}=e,[c,d]=k.useState(i),{setNotifications:p}=s.useNotificationStore();function h(){const m=s.useNotificationStore.getState().notifications.filter(x=>x.id!==a);p([...m])}return k.useEffect(()=>{const f=setTimeout(()=>{h()},i*1e3);return()=>clearTimeout(f)},[i]),k.useEffect(()=>{const f=setInterval(()=>d(m=>m-1),1e3);return()=>clearInterval(f)},[c]),u?u({type:t,message:n,style:r,padding:o,timer:i,id:a}):s.jsxRuntimeExports.jsx("div",{style:{padding:o,position:"relative"},children:s.jsxRuntimeExports.jsxs("div",{className:s.clx(hn.notification,{[hn.warning]:t==="warning",[hn.error]:t==="error",[hn.success]:t==="success"}),style:r,children:[s.jsxRuntimeExports.jsx("div",{children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Info",fill:Uo[t],width:20,height:20})}),s.jsxRuntimeExports.jsx("div",{className:hn.text,children:n}),i&&s.jsxRuntimeExports.jsx("div",{className:hn.timer,children:c}),s.jsxRuntimeExports.jsx("div",{style:{display:"flex"},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"X",fill:Uo[t],width:20,height:20,hoverable:!0,onClick:()=>h()})})]})})},Em="_modal_1h74q_1",bm="_title_1h74q_14",Im="_buttons_1h74q_20",yr={modal:Em,title:bm,buttons:Im},ma=()=>{const{title:e,description:t,onConfirm:n,setTitle:r,setDescription:o,setOnConfirm:i}=s.useConfirmationModalStore(),{setIsOpen:a}=s.useModalStore();function u(){a(!1),setTimeout(()=>{r(null),o(null),i(null),a(!0)},300)}return e&&t&&n&&s.jsxRuntimeExports.jsxs("div",{className:yr.modal,onClick:c=>c.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:yr.title,children:e}),s.jsxRuntimeExports.jsx("div",{className:yr.description,children:t}),s.jsxRuntimeExports.jsxs("div",{className:yr.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:u,children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{n(),u()},type:"Secondary",children:"Confirm"})]})]})},Tm="_modal_270ti_1",_m="_padding_270ti_17",Cm="_content_270ti_21",Sm="_close_270ti_42",kr={modal:Tm,padding:_m,content:Cm,close:Sm},Br=e=>{const{close:t,children:n,withAnimation:r=!0,hasPadding:o=!0}=e,{isOpen:i,setIsOpen:a}=s.useModalStore();return k.useEffect(()=>{const u=()=>{a(!1),r?setTimeout(()=>{t(!1),a(!0)},300):(t(!1),a(!0))};return document.body.addEventListener("click",u),()=>{document.body.removeEventListener("click",u)}},[]),s.jsxRuntimeExports.jsx("div",{className:s.clx(kr.modal,{[kr.padding]:o}),children:r?s.jsxRuntimeExports.jsx("div",{className:s.clx(kr.content,{[kr.close]:!i}),children:n}):s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:n})})},ym=()=>{const{isOpenModal:e,setIsOpenModal:t}=s.usePagesStore(),{openModal:n,setOpenModal:r}=s.useChooseImageStore(),{notifications:o}=s.useNotificationStore(),{title:i,description:a,setTitle:u,setDescription:c,setOnConfirm:d}=s.useConfirmationModalStore();return s.jsxRuntimeExports.jsxs("div",{id:"builder",children:[s.jsxRuntimeExports.jsxs("div",{className:Sr.layout,children:[s.jsxRuntimeExports.jsx(dd,{}),s.jsxRuntimeExports.jsxs("main",{className:Sr.main,children:[s.jsxRuntimeExports.jsx(nd,{}),s.jsxRuntimeExports.jsxs("div",{className:Sr.content,children:[s.jsxRuntimeExports.jsx(Xp,{}),s.jsxRuntimeExports.jsx(f0,{})]})]})]}),i&&a&&s.jsxRuntimeExports.jsx(Br,{close:()=>{u(null),c(null),d(null)},children:s.jsxRuntimeExports.jsx(ma,{})}),e&&s.jsxRuntimeExports.jsx(Br,{close:t,children:s.jsxRuntimeExports.jsx(am,{})}),n&&s.jsxRuntimeExports.jsx(Br,{close:r,children:s.jsxRuntimeExports.jsx(s.ChooseImageModal,{})}),o.length>0&&s.jsxRuntimeExports.jsx("div",{className:Sr.notifications,children:o.map(p=>s.jsxRuntimeExports.jsx(pa,{type:p.status,message:p.message,timer:p.timer||10,id:p.id,element:p.component},p.id))})]})};async function pn(e,t){const n=localStorage.getItem("shopId")||void 0,o=`${s.useApiStore.getState().apiUrls.api}/${e}/builder/shops/${n}/${t}`;return(await s.request({url:o,withToken:!0,method:"get"})).data}async function km(){try{const[e,t,n,r,o,i,a,u]=await Promise.allSettled([pn("v1","general"),pn("v1","faqs"),pn("v1","listings"),pn("v1","products"),pn("v1","reviews"),pn("v1","categories"),{data:null},{data:null}]);return{general:e,faqs:t,listings:n,products:r,reviews:o,categories:i,fullPosts:a,posts:u}}catch(e){throw console.error("Error fetching page data:",e),e}}async function Rm(){const e=s.useApiStore.getState().apiUrls;try{const{data:t}=await s.axios.get(`${e.googleFonts}?key=AIzaSyAEsTbjAPUz_TeuFCq4z4LPK9w_vst0Pfw`);return t.items}catch(t){throw console.error("Error fetching page data:",t),t}}async function Am(){var o;const e=localStorage.getItem("shopId"),t=localStorage.getItem("draftId"),r=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${e}/drafts/${t}/pages`;try{return(await s.request({url:r,withToken:!0,method:"get"})).data}catch(i){return{data:[],status:(o=i.response)==null?void 0:o.status}}}async function Nm(){const e=localStorage.getItem("shopId")||void 0,t=localStorage.getItem("draftId")||void 0,r=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${e}/drafts/${t}/all`;return(await s.request({url:r,withToken:!0,method:"get"})).data}const wm=e=>{const{blocks:t,settings:n,header:r,footer:o,announcement:i}=e,{setBlocks:a,setSourceBlocks:u,setHeader:c,setFooter:d,setAnnouncement:p,setSettings:h}=s.useBlocksStore(),{fonts:f,setFonts:m}=s.useFontsStore(),{setSettings:x}=s.useSettingsStore(),{setPageContext:g}=s.usePagesStore(),{setThemeSettings:C,setIsLoadingThemeSettings:b}=s.useThemeSettingsStore(),{setIsLoadingSettings:A}=s.useSettingsStore(),{notifications:y,setNotifications:P}=s.useNotificationStore(),{setBlocks:L,blocks:R,createPage:q,setIsLoadingLayers:Y,setHeader:K,setAnnouncement:w,setFooter:$}=s.useLayersStore(),{setPages:B,setCurrentPage:H}=s.usePagesStore();return k.useEffect(()=>{b(!0),Y(!0),A(!0);const V={};Object.keys(t).forEach(Z=>{V[Z]=t[Z]}),u(V),a(V),c(r),d(o),p(i),h(n),(async()=>{const Z={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},G=await km();Object.keys(G).map(ae=>{const Ae=ae;Z[Ae]=G[Ae].value.data}),g(Z);const{data:W}=await Nm(),{themeSettings:J,layers:T,settings:ce}=W||{};if(ce){if(ce.settings){const ae=new n;ae.blockSettings={displayName:"Settings",isAddable:!1,...ce.settings},x(ae)}ce.header&&K(ce.header),ce.footer&&$(ce.footer),ce.announcement&&w(ce.announcement)}else{const ae=new n;x(ae)}J&&C(J);const ye=await Am(),S={};if(ye.status>=400&&P([...y,{id:s.v4(),message:"Error fetching pages",status:"error"}]),ye.data.length>0?(ye.data.forEach(ae=>{var Ae,ee;R[ae.path]||q(ae.path),S[ae.id||ae.path]={...ae,icon:s.pages[ae.path]?s.pages[ae.path].icon:"File",name:ae.name||((Ae=ae.seo)==null?void 0:Ae.pageTitle)||((ee=s.pages[ae.path])==null?void 0:ee.name)||ae.path}}),B(S),H(Object.keys(S)[0])):(B(s.pages),H(Object.keys(s.pages)[0])),f.length===0){const ae=await Rm();m([...ae.map(Ae=>{const ee=Ae.variants.map(Oe=>{if(!Oe.includes("italic"))return Oe==="regular"?"400":Oe}).filter(Oe=>Oe!==void 0);return{name:Ae.family,weights:ee}})])}L(T),b(!1),Y(!1),A(!1)})()},[]),s.jsxRuntimeExports.jsx(ym,{})};function Lm(){const e=new URL(window.location.href);window.history.replaceState(null,"",e.pathname+e.hash)}function jm(){const e=new URLSearchParams(document.location.search),t=e.get("shopId")||localStorage.getItem("shopId"),n=e.get("sellerAccessToken")||localStorage.getItem("sellerAccessToken"),r=e.get("draftId")||localStorage.getItem("draftId");return Lm(),n&&localStorage.setItem("sellerAccessToken",n),t&&localStorage.setItem("shopId",t),r&&localStorage.setItem("draftId",r),!!(n&&t&&r)}const vm="data:image/svg+xml,%3csvg%20width='204'%20height='241'%20viewBox='0%200%20204%20241'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M204%200V118.282L154.174%20134.707V69.0074L49.7111%20102.77V43.5716L204%200Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M154.174%20134.694V191.155L0%20241V117.471L49.7114%20102.757V169.597L154.174%20134.694Z'%20fill='%23FF3F19'/%3e%3c/svg%3e",Pm=e=>{const{blocks:t,settings:n,header:r,footer:o,announcement:i}=e,[a,u]=k.useState(!0),c=s.useNavigate(),d=s.useLocation();return k.useEffect(()=>{const p=d.pathname;if(p.startsWith("/admin/builder")){p==="/admin/builder/add"?document.title="Add Section | Builder":p==="/admin/builder/theme"?document.title="Theme Settings | Builder":p==="/admin/builder/settings"?document.title="Settings | Builder":document.title="Builder | Billgang";let h=document.querySelector("link[rel~='icon']");h||(h=document.createElement("link"),h.rel="icon",document.head.appendChild(h)),h&&(h.href=vm)}},[d]),k.useEffect(()=>{u(!0),jm()?u(!1):c("/")},[]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:a?s.jsxRuntimeExports.jsx(Vt,{}):s.jsxRuntimeExports.jsx(wm,{blocks:t,settings:n,header:r,footer:o,announcement:i})})},Dm="_wrapper_1yd2j_1",Om="_error_1yd2j_11",Bm="_title_1yd2j_21",Mm="_buttons_1yd2j_29",Fn={wrapper:Dm,error:Om,title:Bm,buttons:Mm},$o=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/reset`;return await s.request({url:o,withToken:!0,method:"post",body:e})},Fm=()=>{const{error:e,setError:t}=s.useErrorStore(),{pages:n}=s.usePagesStore(),{setIsOpen:r}=s.useModalStore(),{title:o,description:i,setOnConfirm:a,setTitle:u,setDescription:c}=s.useConfirmationModalStore(),{setBlocks:d}=s.useLayersStore();async function p(){await $o({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),t(null),d({}),window.location.reload()}async function h(){const f=[];n&&Object.keys(n).map(m=>n[m].id).filter(m=>m!==void 0).map(m=>f.push(m)),await $o({resetSettings:!0,resetThemeSettings:!0,resetPageIds:f}),t(null)}return s.jsxRuntimeExports.jsxs("div",{className:Fn.wrapper,children:[s.jsxRuntimeExports.jsxs("div",{className:Fn.error,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:Fn.title,children:"Oops! Something went wrong"}),s.jsxRuntimeExports.jsx("span",{className:Fn.message,children:(e==null?void 0:e.message)||""})]}),s.jsxRuntimeExports.jsxs("div",{className:Fn.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{type:"Primary",onClick:p,children:"Reset Settings"}),s.jsxRuntimeExports.jsx(s.Button,{type:"Secondary",onClick:f=>{f.stopPropagation(),u("Reset All Settings"),c("Are you sure you want to reset all settings? This is irreversible."),a(async()=>{await h()})},children:"Reset All Settings"})]})]}),o&&i&&s.jsxRuntimeExports.jsx(Br,{close:()=>{r(!1),setTimeout(()=>{u(null),c(null),a(null),r(!0)},300)},children:s.jsxRuntimeExports.jsx(ma,{})})]})},Hm=e=>{const{children:t}=e,{pathname:n}=s.useLocation(),{setActiveBlock:r}=s.useNavbarStore(),{setActiveBlock:o}=s.useThemeSettingsStore(),{setActiveBlock:i}=s.usePreviewStore();return k.useEffect(()=>{switch(i({id:null,neededScroll:!1}),n){case"/admin/builder":r(s.navbarBlocks[0]);break;case"/admin/builder/add":r(s.navbarBlocks[1]);break;case"/admin/builder/theme":r(s.navbarBlocks[2]);break;case"/admin/builder/settings":r(s.navbarBlocks[3]);break;case"/admin/builder/theme/colors":r(s.navbarBlocks[2]),o(dt[0]);break;case"/admin/builder/theme/fonts":r(s.navbarBlocks[2]),o(dt[1]);break;case"/admin/builder/theme/borders":r(s.navbarBlocks[2]),o(dt[2]);break;case"/admin/builder/theme/buttons":r(s.navbarBlocks[2]),o(dt[3]);break;case"/admin/builder/theme/inputs":r(s.navbarBlocks[2]),o(dt[4]);break}},[n]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:t})},Um="_lock_1mxa7_1",$m="_wrapper_1mxa7_12",zm="_content_1mxa7_22",Wm="_info_1mxa7_31",qm="_buttons_1mxa7_38",Vm="_button_1mxa7_38",Gm="_input_1mxa7_50",Ym="_error_1mxa7_57",ut={lock:Um,wrapper:$m,content:zm,info:Wm,buttons:qm,button:Vm,input:Gm,error:Ym},Xm=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(!1),[o,i]=k.useState(""),{general:a,setGeneral:u}=s.useGeneralStore(),{setShopPassword:c}=s.useStorefrontStore(),d=s.useLocation(),p=s.useNavigate();k.useEffect(()=>{if(a&&(!a.info.passwordProtected||a.isPasswordValid)){const f=d.state.from==="/validation"?"/":d.state.from;p(f)}},[a]),k.useEffect(()=>{a||(async()=>{var g;t(!0);const m=localStorage.getItem("shopPassword")||"",x=await $s(m);if(x.isPasswordValid){const C=((g=d.state)==null?void 0:g.from)||"/";p(C)}u(x),t(!1)})()},[a]);async function h(){var m;t(!0);const f=await $s(o);if(!f.isPasswordValid)r(!0);else{localStorage.setItem("shopPassword",o),c(o);const x=((m=d.state)==null?void 0:m.from)||"/";p(x),u(f)}t(!1)}return s.jsxRuntimeExports.jsxs("div",{className:ut.wrapper,children:[!e&&s.jsxRuntimeExports.jsxs("div",{className:ut.content,children:[s.jsxRuntimeExports.jsx("div",{className:ut.lock,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),s.jsxRuntimeExports.jsxs("div",{className:ut.info,children:[s.jsxRuntimeExports.jsx("h2",{id:"h2",className:ut.title,children:"The store is password protected"}),s.jsxRuntimeExports.jsx("p",{id:"p",className:ut.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),s.jsxRuntimeExports.jsxs("div",{className:ut.input,children:[s.jsxRuntimeExports.jsx(s.Input$1,{type:"password",onChange:f=>{r(!1),i(f)},value:o,placeholder:"Password",required:!0}),s.jsxRuntimeExports.jsx("span",{className:ut.error,children:n&&"Incorrect password"})]}),s.jsxRuntimeExports.jsxs("div",{className:ut.buttons,children:[s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",className:ut.button,onClick:()=>p("/contact"),children:"Contact Support"}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",className:ut.button,disabled:n,onClick:h,children:"Submit"})]})]}),e&&s.jsxRuntimeExports.jsx(s.Loader,{})]})},Qm="_notifications_2ywhg_1",Km={notifications:Qm},Zm=({children:e})=>{const t=s.useLocation(),{token:n,setToken:r}=s.useStorefrontStore(),{dashInfo:o,setDashInfo:i}=s.useCustomerDashboardStore(),{shopPassword:a}=s.useStorefrontStore(),u=s.useNavigate(),[c,d]=s.useSearchParams(),{notifications:p}=s.useNotificationStore(),[h,f]=k.useState(!0),{setCustomerEmail:m}=s.useCartStore(),{setThemeSettings:x,themeSettings:g}=s.useThemeSettingsStore(),{settings:C,setSettings:b}=s.useSettingsStore(),{setHeader:A,setFooter:y,setAnnouncement:P,header:L,footer:R,announcement:q}=s.useLayersStore(),{general:Y,setGeneral:K}=s.useGeneralStore(),{pageContext:w,setPageContext:$}=s.usePagesStore();s.useTrackingAnalytics((Y==null?void 0:Y.info.id)||localStorage.getItem("shopId")||"");const B=async()=>{const H=await s.getDynamicPage(encodeURIComponent("/products"));if(H){const{data:V}=H;$({...w,listings:V.listings})}};return k.useEffect(()=>{const H=localStorage.getItem("token");if(H&&(!n||!o))try{const V=s.jwtDecode(H);i(V),r(H),m(V.email)}catch(V){console.error("Failed to decode token:",V),localStorage.removeItem("token"),r(""),i(null)}},[n,o]),k.useEffect(()=>{const H=c.get("r");H&&(localStorage.setItem("referralCode",H),c.delete("r"),d(c),u({pathname:t.pathname,search:c.toString()},{replace:!0}))},[c,t]),k.useEffect(()=>{!t.pathname.startsWith("/products")&&!t.pathname.startsWith("/admin/builder")&&Y&&(Y.info.passwordProtected&&a||Y.isPasswordValid)&&B()},[Y,a]),k.useEffect(()=>{f(!0);const H=async()=>{if(!Y){const z=await $s(a);z.isPasswordValid||t.pathname.includes("/admin/builder")||u("/validation",{state:{from:t.pathname}}),K(z)}},V=async()=>{const{settings:z,theme:Z}=(await tc()).data;if(z&&C){const G=C;if(z.settings?(Object.keys(z.settings).map(W=>{G.blockSettings[W]=z.settings[W]}),b(G)):b(C),z.header&&L){const W=L;Object.keys(z.header).map(J=>{W[J]=z.header[J]}),A(W)}if(z.footer&&R){const W=R;Object.keys(z.footer).map(J=>{W[J]=z.footer[J]}),y(W)}if(z.announcement&&q){const W=q;Object.keys(z.announcement).map(J=>{W[J]=z.announcement[J]}),P(W)}}else b(C);x(g),x(Z||g),f(!1)};t.pathname.startsWith("/validation")||H(),V()},[]),t.pathname.startsWith("/admin/builder")?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:e}):s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:h?s.jsxRuntimeExports.jsx("div",{style:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsxRuntimeExports.jsx(s.Loader,{})}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[e,p.length>0&&s.jsxRuntimeExports.jsx("div",{className:Km.notifications,children:p.map(H=>s.jsxRuntimeExports.jsx(pa,{type:H.status,message:H.message,timer:H.timer||10,id:H.id,element:H.component},H.id))})]})})},Jm=()=>(k.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),s.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsxRuntimeExports.jsx(s.Loader,{})})),ef="_wrapper_rccv2_1",tf="_content_rccv2_11",nf="_title_rccv2_21",Ts={wrapper:ef,content:tf,title:nf},Nt=()=>{const e=s.useNavigate();return s.jsxRuntimeExports.jsx("div",{className:Ts.wrapper,children:s.jsxRuntimeExports.jsxs("div",{className:Ts.content,children:[s.jsxRuntimeExports.jsx("h1",{className:Ts.title,children:"Something went wrong"}),s.jsxRuntimeExports.jsx(s.Button,{type:"Primary",onClick:()=>{e("/")},children:"Go to Home"})]})})},rf=({children:e,shopDomain:t,shopId:n,shopPassword:r,shopLogo:o})=>{const{setShopDomain:i,setShopId:a,setShopPassword:u,setShopTerms:c,setShopPrivacyPolicy:d,setShopRefundPolicy:p,setShopLogo:h}=s.useStorefrontStore();return k.useLayoutEffect(()=>{const f=async()=>{const{data:g}=await rc();c(g)},m=async()=>{const{data:g}=await oc();d(g)},x=async()=>{const{data:g}=await sc();p(g)};i(t),a(n),r&&u(r),o&&h(o),f(),m(),x()},[t,n,r]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:e})},sf="_checkoutItemsContainer_1kn61_2",of="_innerContainer_1kn61_16",af="_headerSection_1kn61_22",uf="_header_1kn61_22",lf="_productsContainer_1kn61_47",cf="_couponContainer_1kn61_54",df="_checkoutFooter_1kn61_58",Kt={checkoutItemsContainer:sf,innerContainer:of,headerSection:af,header:uf,productsContainer:lf,couponContainer:cf,checkoutFooter:df},hf="_checkoutFooter_1dzvc_1",pf="_footerBranding_1dzvc_9",mf="_poweredText_1dzvc_14",ff="_footerNav_1dzvc_19",Rr={checkoutFooter:hf,footerBranding:pf,poweredText:mf,footerNav:ff},gf="data:image/svg+xml,%3csvg%20width='100'%20height='26'%20viewBox='0%200%20100%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20.3996%203.39999V12.8228L16.2964%2014.1313V8.89738L7.69363%2011.587V6.87107L20.3996%203.39999Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M16.2964%2014.1313L16.2962%2018.6292L3.59961%2022.6V12.7592L7.69363%2011.587L7.69344%2016.9118L16.2964%2014.1313Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M95.6308%2022C93.4931%2022%2091.8804%2020.882%2091.4678%2019.1776L93.118%2019.0676C93.4181%2019.984%2094.0931%2020.5338%2095.6308%2020.5338C97.4311%2020.5338%2098.4249%2019.8373%2098.4249%2018.4078V16.8316C97.9374%2017.858%2096.8122%2018.5178%2095.5183%2018.5178C92.9868%2018.5178%2091.1865%2016.575%2091.1865%2013.8076C91.1865%2011.0401%2092.9492%209.09737%2095.4433%209.09737C96.831%209.09737%2098.0499%209.77549%2098.5%2010.8568V9.3173H100V18.3711C100%2020.6438%2098.3687%2022%2095.6308%2022ZM95.5933%2017.0515C97.2998%2017.0515%2098.4062%2015.8053%2098.4249%2013.8076C98.4624%2011.8099%2097.3186%2010.5636%2095.5933%2010.5636C93.8494%2010.5636%2092.8367%2011.8099%2092.8367%2013.8076C92.8367%2015.8053%2093.8869%2017.0515%2095.5933%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M81.1836%2019.0309V9.3173H82.6275L82.665%2011.0584C83.1901%209.72051%2084.3527%209.09737%2085.7217%209.09737C87.9907%209.09737%2089.0783%2010.7285%2089.0783%2012.7812V19.0309H87.5031V13.2211C87.5031%2011.425%2086.8843%2010.4536%2085.3841%2010.4536C83.8464%2010.4536%2082.7588%2011.425%2082.7588%2013.2211V19.0309H81.1836Z'%20fill='%23252525'/%3e%3cpath%20d='M73.3176%2019.2509C71.2549%2019.2509%2069.9609%2018.2795%2069.9609%2016.6117C69.9609%2014.9622%2070.9173%2014.0458%2073.0926%2013.6426L76.618%2013.0011C76.618%2011.37%2075.8304%2010.5636%2074.2552%2010.5636C72.8676%2010.5636%2072.0987%2011.1867%2071.7987%2012.3047L70.1297%2012.1764C70.5048%2010.3436%2072.0049%209.09737%2074.2552%209.09737C76.8056%209.09737%2078.1932%2010.6002%2078.1932%2013.0561V17.0699C78.1932%2017.5097%2078.3433%2017.6747%2078.7183%2017.6747H79.1121V19.0309C78.9996%2019.0493%2078.7558%2019.0676%2078.512%2019.0676C77.3119%2019.0676%2076.7681%2018.6094%2076.6368%2017.5281C76.1492%2018.5361%2074.7803%2019.2509%2073.3176%2019.2509ZM73.4676%2017.8946C75.4554%2017.8946%2076.618%2016.6483%2076.618%2015.0355V14.3391L73.3926%2014.9255C72.0425%2015.1638%2071.6111%2015.6586%2071.6111%2016.4651C71.6111%2017.3814%2072.305%2017.8946%2073.4676%2017.8946Z'%20fill='%23252525'/%3e%3cpath%20d='M63.2168%2022C61.079%2022%2059.4663%2020.882%2059.0537%2019.1776L60.704%2019.0676C61.004%2019.984%2061.6791%2020.5338%2063.2168%2020.5338C65.017%2020.5338%2066.0109%2019.8373%2066.0109%2018.4078V16.8316C65.5233%2017.858%2064.3982%2018.5178%2063.1043%2018.5178C60.5727%2018.5178%2058.7725%2016.575%2058.7725%2013.8076C58.7725%2011.0401%2060.5352%209.09737%2063.0293%209.09737C64.4169%209.09737%2065.6358%209.77549%2066.0859%2010.8568V9.3173H67.5861V18.3711C67.5861%2020.6438%2065.9546%2022%2063.2168%2022ZM63.1793%2017.0515C64.8857%2017.0515%2065.9921%2015.8053%2066.0109%2013.8076C66.0484%2011.8099%2064.9045%2010.5636%2063.1793%2010.5636C61.4353%2010.5636%2060.4227%2011.8099%2060.4227%2013.8076C60.4227%2015.8053%2061.4728%2017.0515%2063.1793%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M56.2141%2019.0309C55.0515%2019.0309%2054.2451%2018.4811%2054.2451%2017.1982L54.2639%206.01834H55.8391V17.0699C55.8391%2017.4731%2056.0453%2017.6747%2056.4579%2017.6747H57.3205V19.0309H56.2141Z'%20fill='%23252525'/%3e%3cpath%20d='M51.0686%2019.0309C49.906%2019.0309%2049.0996%2018.4811%2049.0996%2017.1982L49.1184%206.01834H50.6936V17.0699C50.6936%2017.4731%2050.8998%2017.6747%2051.3124%2017.6747H52.175V19.0309H51.0686Z'%20fill='%23252525'/%3e%3cpath%20d='M44.5209%2019.0309V9.3173H46.0961V19.0309H44.5209ZM44.4834%207.79611V6H46.1336V7.79611H44.4834Z'%20fill='%23252525'/%3e%3cpath%20d='M32%2019.0309V6.01834H36.5756C39.726%206.01834%2041.3012%207.09967%2041.3012%209.51891C41.3012%2010.9851%2040.4198%2012.0481%2038.9384%2012.3047C40.7574%2012.5613%2041.8638%2013.7709%2041.8638%2015.4571C41.8638%2017.8213%2040.2323%2019.0309%2037.3257%2019.0309H32ZM37.3257%2017.4914C39.1447%2017.4914%2040.176%2016.74%2040.176%2015.3654C40.176%2013.9908%2039.1447%2013.1844%2037.3257%2013.1844H33.6127V17.4914H37.3257ZM36.5756%2011.6449C38.5258%2011.6449%2039.6135%2010.8935%2039.6135%209.59222C39.6135%208.21765%2038.6008%207.55786%2036.5756%207.55786H33.6127V11.6449H36.5756Z'%20fill='%23252525'/%3e%3c/svg%3e",vt=({className:e})=>{const{shopTerms:t,shopPrivacyPolicy:n,shopRefundPolicy:r,shopLogo:o}=s.useStorefrontStore();return s.jsxRuntimeExports.jsxs("footer",{className:`${Rr.checkoutFooter} ${e}`,children:[s.jsxRuntimeExports.jsxs("div",{className:Rr.footerBranding,children:[s.jsxRuntimeExports.jsx("p",{className:Rr.poweredText,id:"md",children:"Powered by"}),o||s.jsxRuntimeExports.jsx("img",{src:gf,alt:"Billgang"})]}),s.jsxRuntimeExports.jsx("nav",{children:s.jsxRuntimeExports.jsxs("ul",{className:Rr.footerNav,children:[(t==null?void 0:t.showTermsOfServiceOnProduct)&&s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:t.termsOfService,target:"_blank",rel:"noopener noreferrer",children:"Terms"})}),(n==null?void 0:n.showPrivacyPolicyOnProduct)&&s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:n.privacyPolicy,target:"_blank",rel:"noopener noreferrer",children:"Privacy"})}),(r==null?void 0:r.showRefundPolicyOnProduct)&&s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:r.refundPolicy,target:"_blank",rel:"noopener noreferrer",children:"Refund"})})]})})]})},xf="_checkoutHeader_d2mbf_1",Ef="_leftContainer_d2mbf_20",bf="_backArrow_d2mbf_26",If="_logoContainer_d2mbf_38",Tf="_logo_d2mbf_38",Hn={checkoutHeader:xf,leftContainer:Ef,backArrow:bf,logoContainer:If,logo:Tf},_f="_activeBadge_1yb5i_1",Cf="_activeBadgeText_1yb5i_12",zo={activeBadge:_f,activeBadgeText:Cf},Sf=({className:e})=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(zo.activeBadge,e),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",width:20,height:20}),s.jsxRuntimeExports.jsx("p",{className:zo.activeBadgeText,children:"Active"})]}),yf="_timerContainer_105jf_2",kf="_timerText_105jf_12",Wo={timerContainer:yf,timerText:kf},Rf=({expiresAt:e})=>{const[t,n]=k.useState(r());function r(){const o=new Date,i=new Date(e).getTime()-o.getTime();if(i<=0)return{hours:"00",minutes:"00",seconds:"00"};const a=Math.floor(i/(1e3*60*60)),u=Math.floor(i%(1e3*60*60)/(1e3*60)),c=Math.floor(i%(1e3*60)/1e3);return{hours:String(a).padStart(2,"0"),minutes:String(u).padStart(2,"0"),seconds:String(c).padStart(2,"0")}}return k.useEffect(()=>{const o=setInterval(()=>{n(r())},1e3);return()=>clearInterval(o)},[e]),t.hours==="00"&&t.minutes==="00"&&t.seconds==="00"?null:s.jsxRuntimeExports.jsxs("div",{className:Wo.timerContainer,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Clock"}),s.jsxRuntimeExports.jsxs("p",{className:Wo.timerText,id:"md",children:[t.hours,":",t.minutes,":",t.seconds]})]})},Af="_progressBar_mcabf_4",Nf="_progressBarLabel_mcabf_12",wf="_progressBarTrack_mcabf_17",Lf="_progressBarFill_mcabf_28",Ar={progressBar:Af,progressBarLabel:Nf,progressBarTrack:wf,progressBarFill:Lf},fa=({color:e,percent:t,disablePercentLabel:n})=>s.jsxRuntimeExports.jsxs("div",{className:Ar.progressBar,children:[!n&&s.jsxRuntimeExports.jsxs("p",{className:Ar.progressBarLabel,children:[t,"%"]}),s.jsxRuntimeExports.jsx("div",{className:Ar.progressBarTrack,children:s.jsxRuntimeExports.jsx("div",{style:{width:`${t}%`,background:e||void 0},className:Ar.progressBarFill})})]}),jf="_rating_1bpps_4",vf="_disabled_1bpps_9",Pf="_ratingStar_1bpps_14",Df="_inactive_1bpps_22",Nr={rating:jf,disabled:vf,ratingStar:Pf,inactive:Df},Of=({setRating:e,rating:t,disabled:n})=>{const[r,o]=k.useState(0),i=u=>{n||o(+u.currentTarget.id)},a=u=>{n||e(u)};return s.jsxRuntimeExports.jsx("div",{className:s.clx(Nr.rating,{[Nr.disabled]:n}),onMouseLeave:()=>o(0),children:[1,2,3,4,5].map(u=>s.jsxRuntimeExports.jsx("div",{id:u.toString(),className:s.clx(Nr.ratingStar,{[Nr.inactive]:!(t>=u||r>=u)}),onMouseEnter:i,onClick:()=>a(u),children:t>=u||r>=u?s.jsxRuntimeExports.jsx(s.FilledStar,{}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Star",fill:"var(--text-secondary)",width:22,height:21})},u))})},Bf="_inputRange_iv6ow_4",Mf="_inputRangeLabel_iv6ow_14",Ff="_progressBar_iv6ow_22",Hf="_progressBarFill_iv6ow_29",Uf="_stepsContainer_iv6ow_40",$f="_step_iv6ow_40",zf="_stepDot_iv6ow_57",Wf="_current_iv6ow_61",qf="_active_iv6ow_69",Vf="_inactive_iv6ow_72",Gf="_tooltip_iv6ow_77",Ze={inputRange:Bf,inputRangeLabel:Mf,progressBar:Ff,progressBarFill:Hf,stepsContainer:Uf,step:$f,stepDot:zf,current:Wf,default:"_default_iv6ow_65",active:qf,inactive:Vf,tooltip:Gf},Yf=({totalSteps:e,step:t,onStepChange:n,label:r})=>{const[o,i]=k.useState(t),a=o===1?0:(o-1)/(e-1)*100,u=c=>{i(c),n(c)};return s.jsxRuntimeExports.jsxs("div",{className:Ze.inputRange,children:[r&&s.jsxRuntimeExports.jsx("div",{className:Ze.inputRangeLabel,children:r}),s.jsxRuntimeExports.jsxs("div",{className:Ze.progressBar,children:[s.jsxRuntimeExports.jsx("div",{className:Ze.progressBarFill,style:{width:`${Math.ceil(a)}%`}}),s.jsxRuntimeExports.jsx("div",{className:Ze.stepsContainer,children:[...Array(e)].map((c,d)=>{const p=d+1,h=p<=o,f=p===o;return s.jsxRuntimeExports.jsxs("div",{className:Ze.step,onClick:()=>u(p),children:[s.jsxRuntimeExports.jsx("div",{className:s.clx(Ze.stepDot,f?Ze.current:Ze.default,h?Ze.active:Ze.inactive)}),f&&s.jsxRuntimeExports.jsxs("div",{className:Ze.tooltip,style:{transform:`translateX(calc(50% - ${a<99?"40px":"70px"}))`},children:[s.jsxRuntimeExports.jsx("span",{children:o}),s.jsxRuntimeExports.jsx("span",{children:o===1?"month":"months"})]})]},p)})})]})]})},lr=({className:e,expiresAt:t})=>{const{shopGeneral:n}=s.useStorefrontStore(),r=s.useNavigate();return s.jsxRuntimeExports.jsxs("header",{className:`${Hn.checkoutHeader} ${e}`,children:[s.jsxRuntimeExports.jsxs("div",{className:Hn.leftContainer,children:[s.jsxRuntimeExports.jsx("div",{className:Hn.backArrow,onClick:()=>{window.history.length>2?r(-1):r("/")},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowUp"})}),(n==null?void 0:n.info.logo)&&s.jsxRuntimeExports.jsx("div",{className:Hn.logoContainer,children:s.jsxRuntimeExports.jsx("img",{className:Hn.logo,src:s.convertCfImageIdToUrl(n.info.logo.cfId)})})]}),t&&s.jsxRuntimeExports.jsx(Rf,{expiresAt:t})]})},Xf="_checkoutPrices_vp75r_1",Qf="_priceRow_vp75r_12",Kf="_label_vp75r_22",Zf="_totalRow_vp75r_26",Jf="_totalLabel_vp75r_37",e1="_totalValue_vp75r_42",xt={checkoutPrices:Xf,priceRow:Qf,label:Kf,totalRow:Zf,totalLabel:Jf,totalValue:e1},cr=({formatter:e,coupon:t,discount:n,totalWithDiscount:r,total:o,className:i,isShowSubtotal:a=!0,feeOrDiscount:u})=>{const c=Math.max(0,n),{priceAdjusment:d}=s.useCartStore(),h=(()=>{const f=r!==void 0?r:o-c;return!d||u===null||u===void 0?Math.max(f,0):d.isDiscount?Math.max(f-u,0):Math.max(f+u,0)})();return s.jsxRuntimeExports.jsxs("div",{className:`${xt.checkoutPrices} ${i||""}`,children:[a&&s.jsxRuntimeExports.jsxs("div",{className:xt.priceRow,children:[s.jsxRuntimeExports.jsx("p",{className:xt.label,id:"md",children:"Subtotal"}),s.jsxRuntimeExports.jsx("p",{id:"md",children:e.format(o)})]}),(t||c>0)&&s.jsxRuntimeExports.jsxs("div",{className:xt.priceRow,children:[s.jsxRuntimeExports.jsxs("p",{className:xt.label,id:"md",children:["Discount ",t&&!(t!=null&&t.isFixed)&&`(${t==null?void 0:t.discount}%)`]}),s.jsxRuntimeExports.jsx("p",{id:"md",children:t&&!(t!=null&&t.isFixed)&&(t==null?void 0:t.discount)===100?`-${e.format(o)}`:`-${e.format(c)}`})]}),u!=null&&u!==0&&d&&(d.fixedAmount!==0||d.percentage!==0)&&s.jsxRuntimeExports.jsxs("div",{className:xt.priceRow,children:[s.jsxRuntimeExports.jsxs("p",{className:xt.label,id:"md-bold",children:[d.isDiscount?"Discount: ":"Fee: ",d.percentage!==0&&d.fixedAmount===0&&`(${d.percentage}%)`,d.fixedAmount!==0&&d.percentage===0&&`(${e.format(d.fixedAmount)})`,d.percentage!==0&&d.fixedAmount!==0&&`(${d.percentage}% + ${e.format(d.fixedAmount)})`]}),s.jsxRuntimeExports.jsx("p",{id:"md-bold",children:e.format(u)})]}),s.jsxRuntimeExports.jsxs("div",{className:xt.totalRow,children:[s.jsxRuntimeExports.jsx("p",{className:xt.totalLabel,id:"md-bold",children:"Total Due"}),s.jsxRuntimeExports.jsx("p",{className:xt.totalValue,id:"md-bold",children:e.format(h)})]})]})},t1="_checkoutProduct_1nxq7_1",n1="_isOrder_1nxq7_1",r1="_productDetails_1nxq7_10",s1="_productImage_1nxq7_16",o1="_isOrderImage_1nxq7_26",i1="_image_1nxq7_30",a1="_productInfo_1nxq7_35",u1="_productHeader_1nxq7_40",l1="_quantityBadge_1nxq7_46",c1="_productDescription_1nxq7_57",d1="_productPrice_1nxq7_64",h1="_deliveryCategories_1nxq7_73",p1="_customerNote_1nxq7_81",m1="_noteHeader_1nxq7_88",f1="_logoContainer_1nxq7_94",g1="_shopName_1nxq7_106",x1="_noteContent_1nxq7_110",E1="_productName_1nxq7_116",b1="_link_1nxq7_121",Ne={checkoutProduct:t1,isOrder:n1,productDetails:r1,productImage:s1,isOrderImage:o1,image:i1,productInfo:a1,productHeader:u1,quantityBadge:l1,productDescription:c1,productPrice:d1,deliveryCategories:h1,customerNote:p1,noteHeader:m1,logoContainer:f1,shopName:g1,noteContent:x1,productName:E1,link:b1};function qo(e){const t=[],n=String(e||"");let r=n.indexOf(","),o=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(o,r).trim();(a||!i)&&t.push(a),o=r+1,r=n.indexOf(",",o)}return t}function ga(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const I1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_1={};function Vo(e,t){return(_1.jsx?T1:I1).test(e)}const C1=/[ \t\n\f\r]/g;function S1(e){return typeof e=="object"?e.type==="text"?Go(e.value):!1:Go(e)}function Go(e){return e.replace(C1,"")===""}let dr=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};dr.prototype.normal={};dr.prototype.property={};dr.prototype.space=void 0;function xa(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new dr(n,r,t)}function rr(e){return e.toLowerCase()}let Ge=class{constructor(t,n){this.attribute=n,this.property=t}};Ge.prototype.attribute="";Ge.prototype.booleanish=!1;Ge.prototype.boolean=!1;Ge.prototype.commaOrSpaceSeparated=!1;Ge.prototype.commaSeparated=!1;Ge.prototype.defined=!1;Ge.prototype.mustUseProperty=!1;Ge.prototype.number=!1;Ge.prototype.overloadedBoolean=!1;Ge.prototype.property="";Ge.prototype.spaceSeparated=!1;Ge.prototype.space=void 0;let y1=0;const se=an(),we=an(),Ea=an(),M=an(),Te=an(),bn=an(),Xe=an();function an(){return 2**++y1}const qs=Object.freeze(Object.defineProperty({__proto__:null,boolean:se,booleanish:we,commaOrSpaceSeparated:Xe,commaSeparated:bn,number:M,overloadedBoolean:Ea,spaceSeparated:Te},Symbol.toStringTag,{value:"Module"})),_s=Object.keys(qs);let uo=class extends Ge{constructor(t,n,r,o){let i=-1;if(super(t,n),Yo(this,"space",o),typeof r=="number")for(;++i<_s.length;){const a=_s[i];Yo(this,_s[i],(r&qs[a])===qs[a])}}};uo.prototype.defined=!0;function Yo(e,t,n){n&&(e[t]=n)}function yn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new uo(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[rr(r)]=r,n[rr(i.attribute)]=r}return new dr(t,n,e.space)}const ba=yn({properties:{ariaActiveDescendant:null,ariaAtomic:we,ariaAutoComplete:null,ariaBusy:we,ariaChecked:we,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:Te,ariaCurrent:null,ariaDescribedBy:Te,ariaDetails:null,ariaDisabled:we,ariaDropEffect:Te,ariaErrorMessage:null,ariaExpanded:we,ariaFlowTo:Te,ariaGrabbed:we,ariaHasPopup:null,ariaHidden:we,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Te,ariaLevel:M,ariaLive:null,ariaModal:we,ariaMultiLine:we,ariaMultiSelectable:we,ariaOrientation:null,ariaOwns:Te,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:we,ariaReadOnly:we,ariaRelevant:null,ariaRequired:we,ariaRoleDescription:Te,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:we,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ia(e,t){return t in e?e[t]:t}function Ta(e,t){return Ia(e,t.toLowerCase())}const k1=yn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bn,acceptCharset:Te,accessKey:Te,action:null,allow:null,allowFullScreen:se,allowPaymentRequest:se,allowUserMedia:se,alt:null,as:null,async:se,autoCapitalize:null,autoComplete:Te,autoFocus:se,autoPlay:se,blocking:Te,capture:null,charSet:null,checked:se,cite:null,className:Te,cols:M,colSpan:null,content:null,contentEditable:we,controls:se,controlsList:Te,coords:M|bn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:se,defer:se,dir:null,dirName:null,disabled:se,download:Ea,draggable:we,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:se,formTarget:null,headers:Te,height:M,hidden:se,high:M,href:null,hrefLang:null,htmlFor:Te,httpEquiv:Te,id:null,imageSizes:null,imageSrcSet:null,inert:se,inputMode:null,integrity:null,is:null,isMap:se,itemId:null,itemProp:Te,itemRef:Te,itemScope:se,itemType:Te,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:se,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:se,muted:se,name:null,nonce:null,noModule:se,noValidate:se,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:se,optimum:M,pattern:null,ping:Te,placeholder:null,playsInline:se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:se,referrerPolicy:null,rel:Te,required:se,reversed:se,rows:M,rowSpan:M,sandbox:Te,scope:null,scoped:se,seamless:se,selected:se,shadowRootClonable:se,shadowRootDelegatesFocus:se,shadowRootMode:null,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:we,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:se,useMap:null,value:we,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Te,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:se,declare:se,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:se,noHref:se,noShade:se,noWrap:se,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:we,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:se,disableRemotePlayback:se,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Ta}),R1=yn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xe,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:Te,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:se,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:bn,g2:bn,glyphName:bn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:Xe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:M,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Te,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xe,rev:Xe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xe,requiredFeatures:Xe,requiredFonts:Xe,requiredFormats:Xe,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:Xe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xe,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ia}),_a=yn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ca=yn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ta}),Sa=yn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),A1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},N1=/[A-Z]/g,Xo=/-[a-z]/g,w1=/^data[-\w.:]+$/i;function lo(e,t){const n=rr(t);let r=t,o=Ge;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&w1.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Xo,j1);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Xo.test(i)){let a=i.replace(N1,L1);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=uo}return new o(r,t)}function L1(e){return"-"+e.toLowerCase()}function j1(e){return e.charAt(1).toUpperCase()}const Qr=xa([ba,k1,_a,Ca,Sa],"html"),kn=xa([ba,R1,_a,Ca,Sa],"svg");function Qo(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ya(e){return e.join(" ").trim()}var ka={},Ko=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,v1=/\n/g,P1=/^\s*/,D1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,O1=/^:\s*/,B1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,M1=/^[;\s]*/,F1=/^\s+|\s+$/g,H1=`