@billgangcom/theme-lib 1.81.1 → 1.81.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +6 -6
- package/dist/builder.es.js +229 -228
- package/package.json +1 -1
package/dist/builder.cjs.js
CHANGED
|
@@ -96,13 +96,13 @@
|
|
|
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,fc=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},gc=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},xc=e=>{zr.forEach(t=>{if(!e.has(t)){const n=document.querySelector(`link[data-font="${t}"]`);n&&n.remove(),zr.delete(t)}})},Ec=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)}}),xc(t)},bc=e=>{if(e.fonts){const t=fc(e.fonts.desktop),n=gc(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))}),Ec(r)}};function Ic(){if(window.location.pathname.includes("/admin/builder"))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:m}=s.useSettingsStore.getState();if(t||m(d.blockSettings),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 Tc=()=>{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 m=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/${m.data.id}/${m.data.accessToken}`),m}catch(m){r([...n,{id:s.v4(),message:`Error: ${m}. Please try again later.`,status:"error"}])}}},_c=()=>{const{pages:e}=s.usePagesStore(),[t,n]=k.useState(e);return k.useEffect(()=>{n(e)},[e]),t},Cc="_tooltip_4hruj_1",Sc={tooltip:Cc},_n=e=>{const{text:t}=e,{setShowTooltip:n}=s.useTooltipStore();return k.useEffect(()=>(n(!0),()=>{n(!1)}),[]),s.jsxRuntimeExports.jsx("div",{className:Sc.tooltip,children:t})},yc=()=>{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),[m,h]=k.useState(!1),[f,p]=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:On.buttons,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(On.button,{[On.disabled]:o}),onMouseEnter:()=>{const y=setTimeout(()=>{h(!0),d(!1)},200);p(y)},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"}),m&&s.jsxRuntimeExports.jsx(_n,{text:o?"Nothing to undo":"Click to undo changes"})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(On.button,{[On.disabled]:a}),onMouseEnter:()=>{const y=setTimeout(()=>{d(!0),h(!1)},200);p(y)},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(_n,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},kc="_devices_ls6k9_1",Rc="_device_ls6k9_1",Ac="_active_ls6k9_27",zs={devices:kc,device:Rc,active:Ac},Nc=()=>s.jsxRuntimeExports.jsx("div",{className:zs.devices,children:_l.map(e=>s.jsxRuntimeExports.jsx(wc,{device:e}))}),wc=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(_n,{text:`Switch to ${t.value} view`})]},t.value)},Lc="_preview_1x3m8_2",jc="_active_1x3m8_19",hs={preview:Lc,active:jc},vc=()=>{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(_n,{text:"Open draft theme in new tab"})]})},Pc="_settings_u4cv4_1",Dc={settings:Pc},Oc="_pages_167qp_1",Bc="_text_167qp_21",Mc="_modal_167qp_27",Fc="_open_167qp_46",Hc="_page_167qp_1",Uc="_hoverable_167qp_61",$c="_separator_167qp_65",zc="_button_167qp_70",Wc="_items_167qp_85",it={pages:Oc,default:"_default_167qp_5",text:Bc,modal:Mc,open:Fc,page:Hc,hoverable:Uc,separator:$c,button:zc,items:Wc},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"})},qc=()=>{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(),[m,h]=k.useState(null),{setTitle:f,setDescription:p,setOnConfirm:x}=s.useConfirmationModalStore(),[g,y]=k.useState(!1),E=k.useRef(null);s.useOnClickOutside(E,()=>{g&&y(!1)}),k.useEffect(()=>{g?u(!0):setTimeout(()=>{u(!1)},300)},[g]);const R=C=>C?C.replace(/_/g," ").split(" ").map(P=>P.charAt(0).toUpperCase()+P.slice(1)).join(" "):"";return s.jsxRuntimeExports.jsxs("div",{className:it.pages,ref:E,children:[s.jsxRuntimeExports.jsxs("div",{className:it.default,onClick:C=>{C.stopPropagation(),y(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)?`${R(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:C=>C.stopPropagation(),children:[r&&s.jsxRuntimeExports.jsx("div",{className:it.items,children:Object.keys(r).map(C=>{const P=r[C];return s.jsxRuntimeExports.jsxs("div",{className:s.clx(it.page,{[it.hoverable]:m===C}),onMouseEnter:()=>h(C),onMouseLeave:()=>h(null),onClick:()=>{h(null),o(!1),d(null),t(C),y(!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)?`${R(P.name)} page`:P.name}),m===C&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Gear",fill:"#757575",onClick:L=>{L.stopPropagation(),o(!0),i(C),n(!0)}}),!s.defaultPagePaths.includes(P.path)&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",onClick:L=>{L.stopPropagation(),f("Delete Page"),p(`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(C),c(P.name),ca(P.path)})}})]}),r[e]&&r[e].name===P.name&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"#FF3F19"})]},C)})}),s.jsxRuntimeExports.jsx("div",{className:it.separator}),s.jsxRuntimeExports.jsxs(s.Button,{className:it.button,onClick:C=>{C.stopPropagation(),n(!0)},size:"l",children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#ff3f19"}),s.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},Vc="_zoom_fu0hj_1",Po={zoom:Vc},Gc=()=>{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:"%"})]})},Yc=()=>s.jsxRuntimeExports.jsxs("div",{className:Dc.settings,children:[s.jsxRuntimeExports.jsx(qc,{}),s.jsxRuntimeExports.jsx(Gc,{})]}),Xc="_theme_1e5wq_1",Qc="_text_1e5wq_13",Do={theme:Xc,text:Qc},Kc=()=>s.jsxRuntimeExports.jsx("div",{className:Do.theme,children:s.jsxRuntimeExports.jsx("div",{className:Do.text,children:"Live Theme"})}),Zc=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 Bn(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 Jc(e,t,n){return ed(e,t)?(n.reviews||[]).length*3:0}function ed(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 td(e,t){if(t){const n=Object.keys(t).find(r=>t[r].path===e);if(n)return t[n]}return null}const nd=({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:m,footer:h,announcement:f,blocks:p}=s.useLayersStore(),{pageContext:x}=s.usePagesStore(),{pages:g}=s.usePagesStore(),y=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const R=Object.keys(p).map(L=>{const A=td(L,g);return p[L]&&p[L].data&&(A!=null&&A.path)?{id:A?A.id:L,name:A?A.name:L,path:A.path,layout:{...p[L]},neededProductIds:[...Bn("ProductId",Object.values(p[L].data))],neededCategoryIds:[...Bn("CategoryId",Object.values(p[L].data))],neededAnnouncementIds:[...Bn("AnnouncementId",Object.values(p[L].data))],neededListingIds:[...Bn("ListingIds",Object.values(p[L].data))],neededFaqIds:[...Bn("FaqsIds",Object.values(p[L].data))],neededReviewCount:Jc("ReviewCount",Object.values(p[L].data),x),seo:{pageTitle:A&&A.seo&&A.seo.pageTitle?A.seo.pageTitle:"",pageDescription:A&&A.seo&&A.seo.pageDescription?A.seo.pageDescription:""},isPrivate:!!(A&&A.visibility==="private")}:null}).filter(L=>L),C={settings:{...r},header:m,footer:h,announcement:f},{status:P}=await Zc("post","save",{themeSettings:n,settings:C,updatedPages:R});c([...d,{id:s.v4(),message:P===200?"Settings saved":"Error",status:P===200?"success":"error"}]),e(!1)}u(!0);const E=setTimeout(()=>{u(!1)},2e3);i(E)};return s.jsxRuntimeExports.jsx(s.Button,{onClick:y,disabled:t,children:s.jsxRuntimeExports.jsx("span",{style:{userSelect:"none"},children:"Save"})})},rd=()=>{const{isOpenSelectModal:e}=s.usePagesStore(),[t,n]=k.useState(!1),{showTooltip:r}=s.useTooltipStore();return s.jsxRuntimeExports.jsxs("div",{className:Ir.header,style:{zIndex:e?5e4:r?501:50},children:[s.jsxRuntimeExports.jsxs("div",{className:Ir.left,children:[s.jsxRuntimeExports.jsx(Nc,{}),s.jsxRuntimeExports.jsx(vc,{})]}),s.jsxRuntimeExports.jsx("div",{className:Ir.center,children:s.jsxRuntimeExports.jsx(Yc,{})}),s.jsxRuntimeExports.jsxs("div",{className:Ir.right,children:[s.jsxRuntimeExports.jsx(Kc,{}),s.jsxRuntimeExports.jsx(yc,{}),s.jsxRuntimeExports.jsx(nd,{setIsLoading:n,isLoading:t}),t&&s.jsxRuntimeExports.jsx(Vt,{})]})]})},sd="_exit_ovvox_1",od="_text_ovvox_11",id="_exitLink_ovvox_16",ms={exit:sd,text:od,exitLink:id},ad=()=>s.jsxRuntimeExports.jsx("div",{className:ms.exit,children:s.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:ms.exitLink,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"SignOut",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:ms.text,children:"Exit"})]})}),ud="_navbar_1podc_1",ld="_main_1podc_6",cd="_block_1podc_13",dd="_active_1podc_29",_r={navbar:ud,main:ld,block:cd,active:dd},hd=()=>{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:_r.navbar,children:[s.jsxRuntimeExports.jsx(ad,{}),s.jsxRuntimeExports.jsx("div",{className:_r.main,children:s.navbarBlocks.map(u=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(_r.block,{[_r.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))})]})},md="_preview_gb2ye_1",pd="_main_gb2ye_15",fd="_content_gb2ye_25",gd="_loading_gb2ye_34",xd="_previewLoading_gb2ye_65",Mn={preview:md,main:pd,content:fd,loading:gd,previewLoading:xd},Ed="_header_11zku_2",bd="_circles_11zku_16",Id="_circle_11zku_16",Td="_red_11zku_32",_d="_green_11zku_36",Cd="_yellow_11zku_40",Sd="_input_11zku_44",yd="_main_11zku_55",kd="_text_11zku_63",Rd="_copy_11zku_75",gt={header:Ed,circles:bd,circle:Id,red:Td,green:_d,yellow:Cd,input:Sd,main:yd,text:kd,copy:Rd},Ad=["red","yellow","green"],Nd=()=>{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:Ad.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,m=window.innerWidth-u.right,h=u.left;let f,p;return f=u.bottom+r+window.scrollY,p=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),(m<n||m<i)&&(h>=n?p=u.right-n:p=(window.innerWidth-n)/2),p<u.right+i&&(p=u.right+i),p<u.right&&p+n>u.left&&f<u.bottom&&f+t>u.top&&(m>=n+i?p=u.right+r+i:c>=t?f=u.bottom+r+window.scrollY:(f=window.scrollY+a,p=(window.innerWidth-n)/2)),{top:f,left:p}},wd="_results_1pahy_1",Oo={results:wd};function Ld(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Bo(e,t){return e?Object.keys(e||{}).reduce((n,r)=>(Ld(r,t)&&n.push({name:r,displayName:s.getDisplayName(r,t)}),n),[]):[]}const jd="_product_yggw5_1",vd="_name_yggw5_15",Mo={product:jd,name:vd},Pd=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:r,setActiveBlock:o}=s.useBlocksStore(),{hideModal:i,hoverBlockId:a,isModalVisible:u,showPreview:c,hidePreview:d,clearHideTimeout:m,startHideTimeout:h,setHoverBlockTopPosition:f}=s.useSubmodalStore();function p(y){n(""),o(y),i("keyBlock")}function x(y,E){const R=window.innerHeight,C=400,P=10;let L=E.clientY-120;L+C>R&&(L=R-C-P),L<P&&(L=P),a||i("keyBlock"),c(y,"keyBlock"),m(),f(L)}function g(){u?h("keyBlock"):d("keyBlock"),f(null)}return s.jsxRuntimeExports.jsxs("div",{className:Mo.product,onClick:()=>p(t),onMouseEnter:y=>x(t,y),onMouseLeave:g,children:[rr[t]?s.jsxRuntimeExports.jsx("img",{src:rr[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(Pd,{blockId:c.name,setSearchValue:r})):s.jsxRuntimeExports.jsx("div",{className:Oo.noResults,children:"No sections found"})})]})},Dd="_wrapper_1k1cr_1",Od="_submodal_1k1cr_14",Ws={wrapper:Dd,submodal:Od},Bd=({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},Md=({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},Fd="_applyButton_1a9kh_2",Hd="_content_1a9kh_7",Ud="_title_1a9kh_14",$d="_label_1a9kh_21",zd="_colorValue_1a9kh_40",Wd="_colorMap_1a9kh_48",qd="_indicator_1a9kh_57",Vd="_hueSlider_1a9kh_66",Gd="_slider_1a9kh_97",Yd="_buttons_1a9kh_102",Xd="_name_1a9kh_109",Qd="_secondary_1a9kh_114",Kd="_input_1a9kh_122",Zd="_modal_1a9kh_160",Jd="_alphaSlider_1a9kh_249",e0="_alphaBackground_1a9kh_257",t0="_alphaGradient_1a9kh_268",n0="_chargeTypes_1a9kh_297",r0="_charge_1a9kh_297",s0="_chargeActive_1a9kh_326",o0="_gradient_1a9kh_334",i0="_color_1a9kh_40",a0="_colorActive_1a9kh_355",u0="_gradientWrapper_1a9kh_362",l0="_subtitle_1a9kh_368",c0="_colorTypes_1a9kh_375",d0="_colorType_1a9kh_375",h0="_colorTypeActive_1a9kh_399",m0="_colorsWrapper_1a9kh_404",p0="_colors_1a9kh_404",ae={applyButton:Fd,content:Hd,title:Ud,label:$d,colorValue:zd,colorMap:Wd,indicator:qd,hueSlider:Vd,slider:Gd,buttons:Yd,name:Xd,secondary:Qd,input:Kd,modal:Zd,alphaSlider:Jd,alphaBackground:e0,alphaGradient:t0,chargeTypes:n0,charge:r0,chargeActive:s0,gradient:o0,color:i0,colorActive:a0,gradientWrapper:u0,subtitle:l0,colorTypes:c0,colorType:d0,colorTypeActive:h0,colorsWrapper:m0,colors:p0},f0=()=>{const{modalPosition:e,color:t,initialColor:n,setShowModal:r,hue:o,saturation:i,brightness:a,alpha:u,dragging:c,setDragging:d,setHue:m,setSaturation:h,setBrightness:f,setAlpha:p,colorChange:x,setColor:g,update:y,isGradient:E,setIsGradient:R,gradientDirection:C,setGradientDirection:P,hue2:L,saturation2:A,brightness2:z,alpha2:G,setHue2:K,setSaturation2:N,setBrightness2:H,setAlpha2:D,activeColorIndex:$,setActiveColorIndex:Y,isGradientActive:q}=s.useColorPickerStore(),Z=(oe,ee,Ee)=>{ee/=100,Ee/=100;const ne=ye=>(ye+oe/60)%6,me=ye=>Ee*(1-ee*Math.max(0,Math.min(ne(ye),4-ne(ye),1))),ie=Math.round(255*me(5)),xe=Math.round(255*me(3)),ge=Math.round(255*me(1));return{r:ie,g:xe,b:ge}},W=oe=>oe.toString(16).padStart(2,"0"),V=(oe,ee,Ee,ne)=>{const{r:me,g:ie,b:xe}=Z(oe,ee,Ee),ge=Math.round(ne/100*255);return`#${W(me)}${W(ie)}${W(xe)}${W(ge)}`},ue=(oe,ee,Ee,ne)=>{if(E)if($===1){m(oe),h(ee),f(Ee),p(ne);const me=V(oe,ee,Ee,ne),ie=V(L,A,z,G),ge=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${me} 0%, ${ie} 100%)`;x(ge),g(ge)}else{K(oe),N(ee),H(Ee),D(ne);const me=V(oe,ee,Ee,ne),ie=V(o,i,a,u),ge=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${ie} 0%, ${me} 100%)`;x(ge),g(ge)}else{const me=V(oe,ee,Ee,ne);x(me),g(me)}},T=(oe,ee,Ee)=>{const{width:ne,height:me}=Ee.getBoundingClientRect(),ie=Math.max(0,Math.min(oe/ne*100,100)),xe=Math.max(0,Math.min(100-ee/me*100,100));E?$===1?(h(ie),f(xe),ue(o,ie,xe,u)):(N(ie),H(xe),ue(L,ie,xe,G)):(h(ie),f(xe),ue(o,ie,xe,u))},ce=oe=>{const{offsetX:ee,offsetY:Ee}=oe.nativeEvent;d(!0),T(ee,Ee,oe.currentTarget)},je=oe=>{if(c){const ee=document.querySelector(`.${ae.colorMap}`),{left:Ee,top:ne}=ee.getBoundingClientRect(),me=oe.clientX-Ee,ie=oe.clientY-ne;T(me,ie,ee)}},S=()=>{d(!1)};k.useEffect(()=>{function oe(ne){const me=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,ie=ne.match(me);if(ie){const xe=ie[1],ge=ie[2],ye=ie[3];return{angle:xe,col1:ge,col2:ye}}return null}function ee(ne){const me=parseInt(ne.slice(1,3),16),ie=parseInt(ne.slice(3,5),16),xe=parseInt(ne.slice(5,7),16),ge=parseInt(ne.slice(7,9),16)/255*100,{h:ye,s:Ot,b:v}=Ee(me,ie,xe);return{h:ye,s:Ot,b:v,a:ge}}function Ee(ne,me,ie){ne/=255,me/=255,ie/=255;const xe=Math.max(ne,me,ie),ge=Math.min(ne,me,ie);let ye=0;const Ot=xe-ge,v=(xe===0?0:Ot/xe)*100,U=xe*100;if(xe===ge)ye=0;else switch(xe){case ne:ye=((me-ie)/Ot+(me<ie?6:0))*60;break;case me:ye=((ie-ne)/Ot+2)*60;break;case ie:ye=((ne-me)/Ot+4)*60;break}return{h:ye,s:v,b:U}}if(n&&n.startsWith("linear-gradient")){const ne=oe(n);if(ne){const{angle:me,col1:ie,col2:xe}=ne,ge=ee(ie),ye=ee(xe);R(!0),P(me==="0deg"?"vertical":"horizontal"),m(ge.h),h(ge.s),f(ge.b),p(ge.a),K(ye.h),N(ye.s),H(ye.b),D(ye.a),Y(1)}}else if(n){const me=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),ie=ee(me);R(!1),m(ie.h),h(ie.s),f(ie.b),p(ie.a)}},[n,R,P,m,h,f,p,K,N,H,D,Y]),k.useEffect(()=>{let oe,ee,Ee,ne;E?$===1?(oe=o,ee=i,Ee=a,ne=u):(oe=L,ee=A,Ee=z,ne=G):(oe=o,ee=i,Ee=a,ne=u),ue(oe,ee,Ee,ne)},[E,C,$,o,i,a,u,L,A,z,G]),k.useEffect(()=>{const oe=Ee=>je(Ee),ee=()=>S();return c?(document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ee)):(document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ee)),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ee)}},[c,E,C]);function de(){if(!E)y(t);else{const oe=V(o,i,a,u),ee=V(L,A,z,G),ne=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${oe} 0%, ${ee} 100%)`;y(ne)}r(!1)}function Ae(){r(!1),x(n)}const J=E?$===1?o:L:o,Be=E?$===1?i:A:i,st=E?$===1?a:z:a,Dt=E?$===1?u:G:u,{r:kt,g:Yt,b:Er}=Z(J,Be,st),us=`linear-gradient(to right, rgba(${kt}, ${Yt}, ${Er}, 0), rgba(${kt}, ${Yt}, ${Er}, 1))`,br=V(o,i,a,u),vn=V(L,A,z,G);return s.jsxRuntimeExports.jsxs("div",{className:ae.modal,onClick:oe=>oe.stopPropagation(),style:{top:`${e.top}px`,left:`${e.left}px`},children:[s.jsxRuntimeExports.jsx("h2",{className:ae.title,children:"Color"}),q&&s.jsxRuntimeExports.jsxs("div",{className:ae.colorTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.colorType,{[ae.colorTypeActive]:!E}),onClick:()=>R(!1),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.colorType,{[ae.colorTypeActive]:E}),onClick:()=>R(!0),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),E&&q&&s.jsxRuntimeExports.jsxs("div",{className:ae.colorsWrapper,children:[s.jsxRuntimeExports.jsx("div",{className:ae.colors,style:{background:`linear-gradient(90deg, ${br} 0%, ${vn} 100%)`}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(ae.color,{[ae.colorActive]:$===1}),onClick:()=>Y(1),style:{background:br}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(ae.color,{[ae.colorActive]:$===2}),onClick:()=>Y(2),style:{background:vn}})]}),s.jsxRuntimeExports.jsx("div",{className:ae.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,fc=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},gc=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},xc=e=>{zr.forEach(t=>{if(!e.has(t)){const n=document.querySelector(`link[data-font="${t}"]`);n&&n.remove(),zr.delete(t)}})},Ec=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)}}),xc(t)},bc=e=>{if(e.fonts){const t=fc(e.fonts.desktop),n=gc(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))}),Ec(r)}};function Ic(){if(window.location.pathname.includes("/admin/builder"))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:m}=s.useSettingsStore.getState();if(t||m(d.blockSettings),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 Tc=()=>{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 m=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/${m.data.id}/${m.data.accessToken}`),m}catch(m){r([...n,{id:s.v4(),message:`Error: ${m}. Please try again later.`,status:"error"}])}}},_c=()=>{const{pages:e}=s.usePagesStore(),[t,n]=k.useState(e);return k.useEffect(()=>{n(e)},[e]),t},Cc="_tooltip_4hruj_1",Sc={tooltip:Cc},_n=e=>{const{text:t}=e,{setShowTooltip:n}=s.useTooltipStore();return k.useEffect(()=>(n(!0),()=>{n(!1)}),[]),s.jsxRuntimeExports.jsx("div",{className:Sc.tooltip,children:t})},yc=()=>{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),[m,h]=k.useState(!1),[f,p]=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:On.buttons,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(On.button,{[On.disabled]:o}),onMouseEnter:()=>{const y=setTimeout(()=>{h(!0),d(!1)},200);p(y)},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"}),m&&s.jsxRuntimeExports.jsx(_n,{text:o?"Nothing to undo":"Click to undo changes"})]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(On.button,{[On.disabled]:a}),onMouseEnter:()=>{const y=setTimeout(()=>{d(!0),h(!1)},200);p(y)},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(_n,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},kc="_devices_ls6k9_1",Rc="_device_ls6k9_1",Ac="_active_ls6k9_27",zs={devices:kc,device:Rc,active:Ac},Nc=()=>s.jsxRuntimeExports.jsx("div",{className:zs.devices,children:_l.map(e=>s.jsxRuntimeExports.jsx(wc,{device:e}))}),wc=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(_n,{text:`Switch to ${t.value} view`})]},t.value)},Lc="_preview_1x3m8_2",jc="_active_1x3m8_19",hs={preview:Lc,active:jc},vc=()=>{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(_n,{text:"Open draft theme in new tab"})]})},Pc="_settings_u4cv4_1",Dc={settings:Pc},Oc="_pages_167qp_1",Bc="_text_167qp_21",Mc="_modal_167qp_27",Fc="_open_167qp_46",Hc="_page_167qp_1",Uc="_hoverable_167qp_61",$c="_separator_167qp_65",zc="_button_167qp_70",Wc="_items_167qp_85",it={pages:Oc,default:"_default_167qp_5",text:Bc,modal:Mc,open:Fc,page:Hc,hoverable:Uc,separator:$c,button:zc,items:Wc},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"})},qc=()=>{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(),[m,h]=k.useState(null),{setTitle:f,setDescription:p,setOnConfirm:x}=s.useConfirmationModalStore(),[g,y]=k.useState(!1),E=k.useRef(null);s.useOnClickOutside(E,()=>{g&&y(!1)}),k.useEffect(()=>{g?u(!0):setTimeout(()=>{u(!1)},300)},[g]);const R=C=>C?C.replace(/_/g," ").split(" ").map(P=>P.charAt(0).toUpperCase()+P.slice(1)).join(" "):"";return s.jsxRuntimeExports.jsxs("div",{className:it.pages,ref:E,children:[s.jsxRuntimeExports.jsxs("div",{className:it.default,onClick:C=>{C.stopPropagation(),y(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)?`${R(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:C=>C.stopPropagation(),children:[r&&s.jsxRuntimeExports.jsx("div",{className:it.items,children:Object.keys(r).map(C=>{const P=r[C];return s.jsxRuntimeExports.jsxs("div",{className:s.clx(it.page,{[it.hoverable]:m===C}),onMouseEnter:()=>h(C),onMouseLeave:()=>h(null),onClick:()=>{h(null),o(!1),d(null),t(C),y(!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)?`${R(P.name)} page`:P.name}),m===C&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Gear",fill:"#757575",onClick:L=>{L.stopPropagation(),o(!0),i(C),n(!0)}}),!s.defaultPagePaths.includes(P.path)&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",onClick:L=>{L.stopPropagation(),f("Delete Page"),p(`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(C),c(P.name),ca(P.path)})}})]}),r[e]&&r[e].name===P.name&&s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"#FF3F19"})]},C)})}),s.jsxRuntimeExports.jsx("div",{className:it.separator}),s.jsxRuntimeExports.jsxs(s.Button,{className:it.button,onClick:C=>{C.stopPropagation(),n(!0)},size:"l",children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#ff3f19"}),s.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},Vc="_zoom_fu0hj_1",Po={zoom:Vc},Gc=()=>{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:"%"})]})},Yc=()=>s.jsxRuntimeExports.jsxs("div",{className:Dc.settings,children:[s.jsxRuntimeExports.jsx(qc,{}),s.jsxRuntimeExports.jsx(Gc,{})]}),Xc="_theme_1e5wq_1",Qc="_text_1e5wq_13",Do={theme:Xc,text:Qc},Kc=()=>s.jsxRuntimeExports.jsx("div",{className:Do.theme,children:s.jsxRuntimeExports.jsx("div",{className:Do.text,children:"Live Theme"})}),Zc=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 Bn(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 Jc(e,t,n){return ed(e,t)?(n.reviews||[]).length*3:0}function ed(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 td(e,t){if(t){const n=Object.keys(t).find(r=>t[r].path===e);if(n)return t[n]}return null}const nd=({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:m,footer:h,announcement:f,blocks:p}=s.useLayersStore(),{pageContext:x}=s.usePagesStore(),{pages:g}=s.usePagesStore(),y=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const R=Object.keys(p).map(L=>{const A=td(L,g);return p[L]&&p[L].data&&(A!=null&&A.path)?{id:A?A.id:L,name:A?A.name:L,path:A.path,layout:{...p[L]},neededProductIds:[...Bn("ProductId",Object.values(p[L].data))],neededCategoryIds:[...Bn("CategoryId",Object.values(p[L].data))],neededAnnouncementIds:[...Bn("AnnouncementId",Object.values(p[L].data))],neededListingIds:[...Bn("ListingIds",Object.values(p[L].data))],neededFaqIds:[...Bn("FaqsIds",Object.values(p[L].data))],neededReviewCount:Jc("ReviewCount",Object.values(p[L].data),x),seo:{pageTitle:A&&A.seo&&A.seo.pageTitle?A.seo.pageTitle:"",pageDescription:A&&A.seo&&A.seo.pageDescription?A.seo.pageDescription:""},isPrivate:!!(A&&A.visibility==="private")}:null}).filter(L=>L),C={settings:{...r},header:m,footer:h,announcement:f},{status:P}=await Zc("post","save",{themeSettings:n,settings:C,updatedPages:R});c([...d,{id:s.v4(),message:P===200?"Settings saved":"Error",status:P===200?"success":"error"}]),e(!1)}u(!0);const E=setTimeout(()=>{u(!1)},2e3);i(E)};return s.jsxRuntimeExports.jsx(s.Button,{onClick:y,disabled:t,children:s.jsxRuntimeExports.jsx("span",{style:{userSelect:"none"},children:"Save"})})},rd=()=>{const{isOpenSelectModal:e}=s.usePagesStore(),[t,n]=k.useState(!1),{showTooltip:r}=s.useTooltipStore();return s.jsxRuntimeExports.jsxs("div",{className:Ir.header,style:{zIndex:e?5e4:r?501:50},children:[s.jsxRuntimeExports.jsxs("div",{className:Ir.left,children:[s.jsxRuntimeExports.jsx(Nc,{}),s.jsxRuntimeExports.jsx(vc,{})]}),s.jsxRuntimeExports.jsx("div",{className:Ir.center,children:s.jsxRuntimeExports.jsx(Yc,{})}),s.jsxRuntimeExports.jsxs("div",{className:Ir.right,children:[s.jsxRuntimeExports.jsx(Kc,{}),s.jsxRuntimeExports.jsx(yc,{}),s.jsxRuntimeExports.jsx(nd,{setIsLoading:n,isLoading:t}),t&&s.jsxRuntimeExports.jsx(Vt,{})]})]})},sd="_exit_ovvox_1",od="_text_ovvox_11",id="_exitLink_ovvox_16",ms={exit:sd,text:od,exitLink:id},ad=()=>s.jsxRuntimeExports.jsx("div",{className:ms.exit,children:s.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:ms.exitLink,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"SignOut",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:ms.text,children:"Exit"})]})}),ud="_navbar_1podc_1",ld="_main_1podc_6",cd="_block_1podc_13",dd="_active_1podc_29",_r={navbar:ud,main:ld,block:cd,active:dd},hd=()=>{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:_r.navbar,children:[s.jsxRuntimeExports.jsx(ad,{}),s.jsxRuntimeExports.jsx("div",{className:_r.main,children:s.navbarBlocks.map(u=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(_r.block,{[_r.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))})]})},md="_preview_gb2ye_1",pd="_main_gb2ye_15",fd="_content_gb2ye_25",gd="_loading_gb2ye_34",xd="_previewLoading_gb2ye_65",Mn={preview:md,main:pd,content:fd,loading:gd,previewLoading:xd},Ed="_header_11zku_2",bd="_circles_11zku_16",Id="_circle_11zku_16",Td="_red_11zku_32",_d="_green_11zku_36",Cd="_yellow_11zku_40",Sd="_input_11zku_44",yd="_main_11zku_55",kd="_text_11zku_63",Rd="_copy_11zku_75",gt={header:Ed,circles:bd,circle:Id,red:Td,green:_d,yellow:Cd,input:Sd,main:yd,text:kd,copy:Rd},Ad=["red","yellow","green"],Nd=()=>{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:Ad.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,m=window.innerWidth-u.right,h=u.left;let f,p;return f=u.bottom+r+window.scrollY,p=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),(m<n||m<i)&&(h>=n?p=u.right-n:p=(window.innerWidth-n)/2),p<u.right+i&&(p=u.right+i),p<u.right&&p+n>u.left&&f<u.bottom&&f+t>u.top&&(m>=n+i?p=u.right+r+i:c>=t?f=u.bottom+r+window.scrollY:(f=window.scrollY+a,p=(window.innerWidth-n)/2)),{top:f,left:p}},wd="_results_1pahy_1",Oo={results:wd};function Ld(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Bo(e,t){return e?Object.keys(e||{}).reduce((n,r)=>(Ld(r,t)&&n.push({name:r,displayName:s.getDisplayName(r,t)}),n),[]):[]}const jd="_product_yggw5_1",vd="_name_yggw5_15",Mo={product:jd,name:vd},Pd=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:r,setActiveBlock:o}=s.useBlocksStore(),{hideModal:i,hoverBlockId:a,isModalVisible:u,showPreview:c,hidePreview:d,clearHideTimeout:m,startHideTimeout:h,setHoverBlockTopPosition:f}=s.useSubmodalStore();function p(y){n(""),o(y),i("keyBlock")}function x(y,E){const R=window.innerHeight,C=400,P=10;let L=E.clientY-120;L+C>R&&(L=R-C-P),L<P&&(L=P),a||i("keyBlock"),c(y,"keyBlock"),m(),f(L)}function g(){u?h("keyBlock"):d("keyBlock"),f(null)}return s.jsxRuntimeExports.jsxs("div",{className:Mo.product,onClick:()=>p(t),onMouseEnter:y=>x(t,y),onMouseLeave:g,children:[rr[t]?s.jsxRuntimeExports.jsx("img",{src:rr[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(Pd,{blockId:c.name,setSearchValue:r})):s.jsxRuntimeExports.jsx("div",{className:Oo.noResults,children:"No sections found"})})]})},Dd="_wrapper_1k1cr_1",Od="_submodal_1k1cr_14",Ws={wrapper:Dd,submodal:Od},Bd=({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},Md=({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},Fd="_applyButton_1a9kh_2",Hd="_content_1a9kh_7",Ud="_title_1a9kh_14",$d="_label_1a9kh_21",zd="_colorValue_1a9kh_40",Wd="_colorMap_1a9kh_48",qd="_indicator_1a9kh_57",Vd="_hueSlider_1a9kh_66",Gd="_slider_1a9kh_97",Yd="_buttons_1a9kh_102",Xd="_name_1a9kh_109",Qd="_secondary_1a9kh_114",Kd="_input_1a9kh_122",Zd="_modal_1a9kh_160",Jd="_alphaSlider_1a9kh_249",e0="_alphaBackground_1a9kh_257",t0="_alphaGradient_1a9kh_268",n0="_chargeTypes_1a9kh_297",r0="_charge_1a9kh_297",s0="_chargeActive_1a9kh_326",o0="_gradient_1a9kh_334",i0="_color_1a9kh_40",a0="_colorActive_1a9kh_355",u0="_gradientWrapper_1a9kh_362",l0="_subtitle_1a9kh_368",c0="_colorTypes_1a9kh_375",d0="_colorType_1a9kh_375",h0="_colorTypeActive_1a9kh_399",m0="_colorsWrapper_1a9kh_404",p0="_colors_1a9kh_404",ae={applyButton:Fd,content:Hd,title:Ud,label:$d,colorValue:zd,colorMap:Wd,indicator:qd,hueSlider:Vd,slider:Gd,buttons:Yd,name:Xd,secondary:Qd,input:Kd,modal:Zd,alphaSlider:Jd,alphaBackground:e0,alphaGradient:t0,chargeTypes:n0,charge:r0,chargeActive:s0,gradient:o0,color:i0,colorActive:a0,gradientWrapper:u0,subtitle:l0,colorTypes:c0,colorType:d0,colorTypeActive:h0,colorsWrapper:m0,colors:p0},f0=()=>{const{modalPosition:e,color:t,initialColor:n,setShowModal:r,hue:o,saturation:i,brightness:a,alpha:u,dragging:c,setDragging:d,setHue:m,setSaturation:h,setBrightness:f,setAlpha:p,colorChange:x,setColor:g,update:y,isGradient:E,setIsGradient:R,gradientDirection:C,setGradientDirection:P,hue2:L,saturation2:A,brightness2:z,alpha2:G,setHue2:K,setSaturation2:N,setBrightness2:H,setAlpha2:D,activeColorIndex:$,setActiveColorIndex:Y,isGradientActive:q}=s.useColorPickerStore(),ee=(oe,J,Ee)=>{J/=100,Ee/=100;const ne=ye=>(ye+oe/60)%6,me=ye=>Ee*(1-J*Math.max(0,Math.min(ne(ye),4-ne(ye),1))),ie=Math.round(255*me(5)),xe=Math.round(255*me(3)),ge=Math.round(255*me(1));return{r:ie,g:xe,b:ge}},W=oe=>oe.toString(16).padStart(2,"0"),V=(oe,J,Ee,ne)=>{const{r:me,g:ie,b:xe}=ee(oe,J,Ee),ge=Math.round(ne/100*255);return`#${W(me)}${W(ie)}${W(xe)}${W(ge)}`},ue=(oe,J,Ee,ne)=>{if(E)if($===1){m(oe),h(J),f(Ee),p(ne);const me=V(oe,J,Ee,ne),ie=V(L,A,z,G),ge=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${me} 0%, ${ie} 100%)`;x(ge),g(ge)}else{K(oe),N(J),H(Ee),D(ne);const me=V(oe,J,Ee,ne),ie=V(o,i,a,u),ge=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${ie} 0%, ${me} 100%)`;x(ge),g(ge)}else{const me=V(oe,J,Ee,ne);x(me),g(me)}},T=(oe,J,Ee)=>{const{width:ne,height:me}=Ee.getBoundingClientRect(),ie=Math.max(0,Math.min(oe/ne*100,100)),xe=Math.max(0,Math.min(100-J/me*100,100));E?$===1?(h(ie),f(xe),ue(o,ie,xe,u)):(N(ie),H(xe),ue(L,ie,xe,G)):(h(ie),f(xe),ue(o,ie,xe,u))},ce=oe=>{const{offsetX:J,offsetY:Ee}=oe.nativeEvent;d(!0),T(J,Ee,oe.currentTarget)},je=oe=>{if(c){const J=document.querySelector(`.${ae.colorMap}`),{left:Ee,top:ne}=J.getBoundingClientRect(),me=oe.clientX-Ee,ie=oe.clientY-ne;T(me,ie,J)}},S=()=>{d(!1)};k.useEffect(()=>{function oe(ne){const me=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,ie=ne.match(me);if(ie){const xe=ie[1],ge=ie[2],ye=ie[3];return{angle:xe,col1:ge,col2:ye}}return null}function J(ne){const me=parseInt(ne.slice(1,3),16),ie=parseInt(ne.slice(3,5),16),xe=parseInt(ne.slice(5,7),16),ge=parseInt(ne.slice(7,9),16)/255*100,{h:ye,s:Ot,b:v}=Ee(me,ie,xe);return{h:ye,s:Ot,b:v,a:ge}}function Ee(ne,me,ie){ne/=255,me/=255,ie/=255;const xe=Math.max(ne,me,ie),ge=Math.min(ne,me,ie);let ye=0;const Ot=xe-ge,v=(xe===0?0:Ot/xe)*100,U=xe*100;if(xe===ge)ye=0;else switch(xe){case ne:ye=((me-ie)/Ot+(me<ie?6:0))*60;break;case me:ye=((ie-ne)/Ot+2)*60;break;case ie:ye=((ne-me)/Ot+4)*60;break}return{h:ye,s:v,b:U}}if(n&&n.startsWith("linear-gradient")){const ne=oe(n);if(ne){const{angle:me,col1:ie,col2:xe}=ne,ge=J(ie),ye=J(xe);R(!0),P(me==="0deg"?"vertical":"horizontal"),m(ge.h),h(ge.s),f(ge.b),p(ge.a),K(ye.h),N(ye.s),H(ye.b),D(ye.a),Y(1)}}else if(n){const me=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),ie=J(me);R(!1),m(ie.h),h(ie.s),f(ie.b),p(ie.a)}},[n,R,P,m,h,f,p,K,N,H,D,Y]),k.useEffect(()=>{let oe,J,Ee,ne;E?$===1?(oe=o,J=i,Ee=a,ne=u):(oe=L,J=A,Ee=z,ne=G):(oe=o,J=i,Ee=a,ne=u),ue(oe,J,Ee,ne)},[E,C,$,o,i,a,u,L,A,z,G]),k.useEffect(()=>{const oe=Ee=>je(Ee),J=()=>S();return c?(document.addEventListener("mousemove",oe),document.addEventListener("mouseup",J)):(document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",J)),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",J)}},[c,E,C]);function de(){if(!E)y(t);else{const oe=V(o,i,a,u),J=V(L,A,z,G),ne=`linear-gradient(${C==="vertical"?"0deg":"90deg"}, ${oe} 0%, ${J} 100%)`;y(ne)}r(!1)}function Ae(){r(!1),x(n)}const Z=E?$===1?o:L:o,Be=E?$===1?i:A:i,st=E?$===1?a:z:a,Dt=E?$===1?u:G:u,{r:kt,g:Yt,b:Er}=ee(Z,Be,st),us=`linear-gradient(to right, rgba(${kt}, ${Yt}, ${Er}, 0), rgba(${kt}, ${Yt}, ${Er}, 1))`,br=V(o,i,a,u),vn=V(L,A,z,G);return s.jsxRuntimeExports.jsxs("div",{className:ae.modal,onClick:oe=>oe.stopPropagation(),style:{top:`${e.top}px`,left:`${e.left}px`},children:[s.jsxRuntimeExports.jsx("h2",{className:ae.title,children:"Color"}),q&&s.jsxRuntimeExports.jsxs("div",{className:ae.colorTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.colorType,{[ae.colorTypeActive]:!E}),onClick:()=>R(!1),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.colorType,{[ae.colorTypeActive]:E}),onClick:()=>R(!0),children:[s.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),E&&q&&s.jsxRuntimeExports.jsxs("div",{className:ae.colorsWrapper,children:[s.jsxRuntimeExports.jsx("div",{className:ae.colors,style:{background:`linear-gradient(90deg, ${br} 0%, ${vn} 100%)`}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(ae.color,{[ae.colorActive]:$===1}),onClick:()=>Y(1),style:{background:br}}),s.jsxRuntimeExports.jsx("div",{className:s.clx(ae.color,{[ae.colorActive]:$===2}),onClick:()=>Y(2),style:{background:vn}})]}),s.jsxRuntimeExports.jsx("div",{className:ae.colorMap,onMouseDown:ce,style:{background:`
|
|
100
100
|
linear-gradient(to top, black, transparent),
|
|
101
|
-
linear-gradient(to right, hsl(${
|
|
102
|
-
`},children:s.jsxRuntimeExports.jsx("div",{className:ae.indicator,style:{position:"absolute",left:`${Be}%`,top:`${100-st}%`,transform:"translate(-50%, -50%)"}})}),s.jsxRuntimeExports.jsx("div",{className:ae.hueSlider,style:{bottom:E?"175px":"100px"},children:s.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:J,onChange:oe=>{const ee=Number(oe.target.value);E?$===1?ue(ee,i,a,u):ue(ee,A,z,G):(m(ee),ue(ee,i,a,u))},className:ae.slider})}),s.jsxRuntimeExports.jsxs("div",{className:ae.alphaSlider,style:{bottom:E?"150px":"75px"},children:[s.jsxRuntimeExports.jsx("div",{className:ae.alphaBackground}),s.jsxRuntimeExports.jsx("div",{className:ae.alphaGradient,style:{background:us}}),s.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:Dt,onChange:oe=>{const ee=Number(oe.target.value);E?$===1?ue(o,i,a,ee):ue(L,A,z,ee):(p(ee),ue(o,i,a,ee))},className:ae.slider})]}),E&&q&&s.jsxRuntimeExports.jsxs("div",{className:ae.gradientWrapper,children:[s.jsxRuntimeExports.jsx("h3",{className:ae.subtitle,children:"Rotation"}),s.jsxRuntimeExports.jsx("div",{className:ae.gradient,children:s.jsxRuntimeExports.jsxs("div",{className:ae.chargeTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.charge,{[ae.chargeActive]:C==="horizontal"}),onClick:()=>P("horizontal"),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.charge,{[ae.chargeActive]:C==="vertical"}),onClick:()=>P("vertical"),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),s.jsxRuntimeExports.jsxs("div",{className:ae.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:Ae,className:s.clx(ae.applyButton,ae.cancelButton),type:"Secondary",children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:de,className:ae.applyButton,children:"Apply"})]})]})},g0=()=>{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:m}=s.useDeviceStore(),{isLoadingThemeSettings:h}=s.useThemeSettingsStore(),{isLoadingLayers:f}=s.useLayersStore(),p=C=>C?!u||!u[C]?s.jsxRuntimeExports.jsx(s.ErrorableBlock,{error:`Block "${C}" does not exist in blocks.`}):new u[C]().renderPreview(a,c):s.jsxRuntimeExports.jsx(s.ErrorableBlock,{error:"Block or block.name is undefined."});function x(){if(m.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const C=m.value==="tablet"?768:425;return t>=1?`${C}px`:`${(C*t).toFixed(2)}px`}}function g(){switch(m.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:y}=s.usePagesStore(),E=k.useRef(null),R=C=>{E.current&&(E.current.scrollTop+=C.deltaY)};return s.jsxRuntimeExports.jsxs("div",{className:Mn.preview,style:{zIndex:d&&!y?5e3:500},onWheel:C=>{C.stopPropagation(),R(C)},children:[o&&s.jsxRuntimeExports.jsx(Md,{children:s.jsxRuntimeExports.jsx(ha,{})}),s.jsxRuntimeExports.jsxs(Bd,{positionTop:i,positionLeft:!r&&n?void 0:250,children:[!h&&!f&&s.jsxRuntimeExports.jsx(s.RenderBlock,{render:p,block:n},n),(h||!n||f)&&s.jsxRuntimeExports.jsx("div",{className:Mn.previewLoading,children:s.jsxRuntimeExports.jsx(Vt,{})})]}),d&&s.jsxRuntimeExports.jsx(f0,{}),e&&s.jsxRuntimeExports.jsxs("div",{className:Mn.main,style:{width:g()},children:[s.jsxRuntimeExports.jsx(Nd,{}),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:C=>{C.stopPropagation()},onWheel:C=>{C.stopPropagation()},children:!h&&!f?s.jsxRuntimeExports.jsx("div",{className:Mn.content,style:{width:x()},children:s.jsxRuntimeExports.jsx(s.PreviewContent,{scrollableRef:E})}):s.jsxRuntimeExports.jsx("div",{className:Mn.loading,children:s.jsxRuntimeExports.jsx(Vt,{})})})]})]})},x0="_sidebar_1xtkj_1",E0="_title_1xtkj_11",Fo={sidebar:x0,title:E0},b0="_layers_1jhzw_1",I0="_wrapper_1jhzw_9",T0="_draggingWrapper_1jhzw_17",_0="_block_1jhzw_21",C0="_dragging_1jhzw_17",S0="_active_1jhzw_56",y0="_add_1jhzw_63",k0="_addTop_1jhzw_79",R0="_visible_1jhzw_95",A0="_button_1jhzw_99",N0="_nameBlock_1jhzw_158",w0="_loader_1jhzw_162",L0="_actions_1jhzw_171",j0="_deleteButton_1jhzw_179",Me={layers:b0,wrapper:I0,draggingWrapper:T0,block:_0,dragging:C0,active:S0,add:y0,addTop:k0,visible:R0,button:A0,nameBlock:N0,loader:w0,actions:L0,deleteButton:j0},v0="_block_sj4cc_1",P0="_title_sj4cc_17",D0="_actions_sj4cc_21",Qt={block:v0,title:P0,actions:D0},ps={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:[rr[ps[e]]?s.jsxRuntimeExports.jsx("img",{src:rr[ps[e]],width:20,height:20}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Cards",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:Qt.title,children:ps[e]}),s.jsxRuntimeExports.jsx("div",{className:Qt.actions,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},O0=({id:e,name:t,onClick:n,isDragging:r,icon:o})=>{const{activeBlock:i,setActiveBlock:a}=s.usePreviewStore(),{showPreview:u,hidePreview:c,showModal:d,hideModal:m,clearHideTimeout:h,startHideTimeout:f,hoverBlockId:p,isModalVisible:x}=s.useSubmodalStore(),{setPositionBlock:g}=s.useLayersStore(),[y,E]=k.useState(!1),[R,C]=k.useState(!1),[P,L]=k.useState(!1),[A,z]=k.useState(!1),[G,K]=k.useState(null),N=k.useRef(null),{attributes:H,listeners:D,setNodeRef:$,transform:Y,transition:q}=s.useSortable({id:e}),Z={transform:s.CSS.Transform.toString(Y),transition:q},{setTitle:W,setDescription:V,setOnConfirm:ue}=s.useConfirmationModalStore(),{pages:T,currentPage:ce}=s.usePagesStore(),{removeBlock:je}=s.useLayersStore(),S=J=>{J.stopPropagation(),N.current&&clearTimeout(N.current),a({id:e,neededScroll:!0}),x&&m(),u(e),h()},de=(J,Be=!0)=>{J.stopPropagation(),c(),d(e),h(),g(e,Be)},Ae=J=>{J.stopPropagation(),a({id:null,neededScroll:!1}),x?f():c()};return k.useEffect(()=>{L(!1),E(!1),C(!1),z(!1)},[r]),k.useEffect(()=>{x||(C(!1),E(!1))},[x]),s.jsxRuntimeExports.jsxs("div",{ref:$,style:Z,className:s.clx(Me.wrapper,{[Me.draggingWrapper]:r&&i.id===e}),onClick:J=>{J.stopPropagation(),n(e)},onMouseEnter:S,onMouseLeave:Ae,...H,...D,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(Me.block,{[Me.dragging]:r&&i.id===e,[Me.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:Me.nameBlock,children:t}),p===e&&!r&&s.jsxRuntimeExports.jsx("div",{className:s.clx(Me.addTop,{[Me.visible]:R}),onMouseEnter:()=>{C(!0)},onMouseLeave:()=>{C(!1)},children:s.jsxRuntimeExports.jsxs("button",{className:Me.button,onClick:J=>de(J,!1),onMouseEnter:()=>{const J=setTimeout(()=>{r||z(!0)},200);K(J)},onMouseLeave:()=>{G&&clearTimeout(G),z(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#fff"}),A&&s.jsxRuntimeExports.jsx(_n,{text:"Click to add a section"})]})}),p===e&&!r&&s.jsxRuntimeExports.jsx("div",{className:s.clx(Me.add,{[Me.visible]:y}),onMouseEnter:()=>{E(!0)},onMouseLeave:()=>{E(!1)},children:s.jsxRuntimeExports.jsxs("button",{className:Me.button,onClick:J=>de(J),onMouseEnter:()=>{const J=setTimeout(()=>{r||L(!0)},200);K(J)},onMouseLeave:()=>{G&&clearTimeout(G),L(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#fff"}),P&&s.jsxRuntimeExports.jsx(_n,{text:"Click to add a section"})]})})]}),p===e&&!r&&s.jsxRuntimeExports.jsxs("div",{className:Me.actions,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),s.jsxRuntimeExports.jsx("div",{className:Me.deleteButton,onClick:J=>{J.stopPropagation(),W("Remove Block"),V(`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.`),ue(()=>{T&&je(T[ce].path,e)})},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},B0=()=>{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:m}=s.useBlocksStore();function h(E){t(E),c(!1),d(null)}const f=s.useSensors(s.useSensor(s.PointerSensor,{activationConstraint:{distance:5}})),[p,x]=k.useState(!1),g=()=>{x(!0)},y=E=>{x(!1);const{active:R,over:C}=E;if(C&&R.id!==C.id&&u&&u[a]){const P=u[a].path,L=e[P].order,A=L.indexOf(R.id),z=L.indexOf(C.id);A!==-1&&z!==-1&&r(P,A,z)}};return s.jsxRuntimeExports.jsx("div",{className:Me.layers,children:o?s.jsxRuntimeExports.jsx("div",{className:Me.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:y,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((E,R)=>s.jsxRuntimeExports.jsx(O0,{id:E,name:s.getDisplayName(e[u[a].path].data[E].name,m),index:R,onClick:h,isDragging:p,icon:rr[e[u[a].path].data[E].name]},E))})}),s.jsxRuntimeExports.jsx(fs,{id:"footer"})]})})},M0="_loader_eyvkk_1",F0={loader:M0},H0=()=>{const{isLoadingSettings:e}=s.useSettingsStore();return e?s.jsxRuntimeExports.jsx("div",{className:F0.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):s.jsxRuntimeExports.jsx(U0,{})},U0=()=>{const{settings:e}=s.useSettingsStore(),{settings:t,setSettingsInstance:n}=s.useBlocksStore();if(!e)return null;const{setError:r}=s.useErrorStore(),o=new t(e);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}},$0="_theme_a1one_1",z0="_block_a1one_8",W0="_name_a1one_23",q0="_loader_a1one_27",Cr={theme:$0,block:z0,name:W0,loader:q0},V0=()=>{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:Cr.theme,children:t?s.jsxRuntimeExports.jsx("div",{className:Cr.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):dt.map(o=>s.jsxRuntimeExports.jsxs("div",{onClick:()=>r(o),className:s.clx(Cr.block),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:o.icon}),s.jsxRuntimeExports.jsx("span",{className:Cr.name,children:o.name}),s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretRight"})]},o.icon))})},G0="_render_7e826_9",Y0="_open_7e826_24",X0="_close_7e826_51",Q0="_clicked_7e826_55",K0="_loading_7e826_72",Z0="_settings_7e826_76",dn={render:G0,open:Y0,close:X0,clicked:Q0,loading:K0,settings:Z0},J0=({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}},eh="_wrapper_15ju8_1",th="_header_15ju8_8",nh="_title_15ju8_15",rh="_colorWrapper_15ju8_21",sh="_name_15ju8_35",oh="_color_15ju8_21",ih="_value_15ju8_47",ah="_length_15ju8_51",et={wrapper:eh,header:th,title:nh,colorWrapper:rh,name:sh,color:oh,value:ih,length:ah},uh=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("-"),m=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c.charAt(0).toUpperCase()+c.slice(1)}`,[h,f]=u.split("-");return{name:m,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:m}=u;return s.jsxRuntimeExports.jsx(lh,{color:n.colors[m][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"]})]})]})},lh=e=>{const{name:t,color:n}=e,{setActiveLabel:r,setModalPosition:o,setInitialColor:i,setShowModal:a,setUpdate:u,setColor:c,setColorChange:d,colorChange:m,setIsGradientActive:h}=s.useColorPickerStore(),{updateColor:f}=s.useThemeSettingsStore(),p=(y,E)=>R=>{f(y,E,R)};k.useEffect(()=>{const y=()=>{a(!1),r(null),i(n),u(()=>{}),c(n),d(()=>{})};return document.body.addEventListener("click",y),()=>{document.body.removeEventListener("click",y)}},[]);const x=y=>{const E=t.split("/")[0],R=E.split(" ")[0].toLowerCase(),C=E.split(" ")[1].toLowerCase();y.stopPropagation(),a(!0),d(m),u(A=>p(C,R)(A)),i(n),c(n),h(C==="surface");const{top:P,left:L}=da(y,550,288,10,20,230,80);o({top:C==="surface"?P:P+125,left:L-200})};function g(y){return y.length>15?y.slice(0,15)+"...":y}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)})]})},ch="_back_1sznl_1",dh="_title_1sznl_9",hh="_deleteButton_1sznl_17",mh="_backIcon_1sznl_30",Sr={back:ch,title:dh,deleteButton:hh,backIcon:mh},ph=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var f,p;const{activeBlock:r}=s.useBlocksStore(),{setTitle:o,setDescription:i,setOnConfirm:a}=s.useConfirmationModalStore(),{blocks:u,currentBlock:c,removeBlock:d}=s.useLayersStore(),{currentPage:m,pages:h}=s.usePagesStore();return s.jsxRuntimeExports.jsxs("div",{className:Sr.back,children:[s.jsxRuntimeExports.jsx("div",{className:Sr.backIcon,onClick:()=>e(),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),s.jsxRuntimeExports.jsx("h3",{className:Sr.title,children:r&&n(r)||h&&h[m]&&u[h[m].path]&&c&&n((f=u[h[m].path].data[c])==null?void 0:f.name)||c&&Ct(c)||"Loading"}),c&&h&&!["header","footer","announcement"].includes(c)&&u[h[m].path].data[c]&&n((p=u[h[m].path].data[c])==null?void 0:p.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[m].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[m].path,c),e(!0)})},className:Sr.deleteButton,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},fh=()=>{const e=s.useNavigate(),[t,n]=k.useState(!1),{header:r,footer:o,announcement:i,sourceBlocks:a,activeBlock:u,setActiveBlock:c,currentInstance:d,setCurrentInstance:m}=s.useBlocksStore(),{setActiveBlock:h}=s.usePreviewStore(),{blocks:f,addBlock:p,editBlock:x,currentBlock:g,setCurrentBlock:y,header:E,footer:R,announcement:C,isLoadingLayers:P}=s.useLayersStore(),{currentPage:L,pages:A}=s.usePagesStore(),{past:z,future:G}=s.useHistoryStore();function K(D=!1){if(A&&d&&g&&!["header","footer","announcement"].includes(g)&&!D){const $={blockSettings:{}};Object.keys(d.blockSettings).filter(Y=>!["displayName","isAddable"].includes(Y)).map(Y=>{$.blockSettings[Y]=d.blockSettings[Y]}),x(A[L].path,g,{name:f[A[L].path].data[g].name,value:$})}c(null),y(null),h({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),m(null)}function N(D){var Z;if(!A||!L||!D)return null;if(D==="header"){const W=new r;return Object.keys(W.blockSettings).forEach(V=>{W.blockSettings[V]=E==null?void 0:E.blockSettings[V]}),Object.keys(W.blockColors).forEach(V=>{W.blockColors[V]=E==null?void 0:E.blockColors[V]}),W}if(D==="footer"){const W=new o;return Object.keys(W.blockSettings).forEach(V=>{W.blockSettings[V]=R==null?void 0:R.blockSettings[V]}),Object.keys(W.blockColors).forEach(V=>{W.blockColors[V]=R==null?void 0:R.blockColors[V]}),W}if(D==="announcement"){const W=new i;return Object.keys(W.blockSettings).forEach(V=>{W.blockSettings[V]=C==null?void 0:C.blockSettings[V]}),Object.keys(W.blockColors).forEach(V=>{W.blockColors[V]=C==null?void 0:C.blockColors[V]}),W}const $=f[A[L].path];if(!$||!$.data[D])return null;const Y=$.data[D];return!Y||!a[Y.name]?null:new a[Y.name]((Z=Y.value)==null?void 0:Z.blockSettings)}k.useEffect(()=>{if(g){const D=N(g);m(D)}else m(null)},[g,z,G,u]),k.useEffect(()=>{if(u&&A&&!g){const D={blockSettings:{},blockColors:{}},$=new a[u];m($),Object.keys($.blockSettings).filter(q=>!["displayName","isAddable"].includes(q)).map(q=>{D.blockSettings[q]=$.blockSettings[q]}),Object.keys($.blockColors).filter(q=>!["displayName","isAddable"].includes(q)).map(q=>{D.blockColors[q]=$.blockColors[q]});const Y=p(A[L].path,{name:u,value:D});h({id:Y,neededScroll:!0}),y(Y),e("/admin/builder")}},[u,z,G]);function H(D){if(!a)return"unknown name";if(!a[D])return g==="header"?E==null?void 0:E.blockSettings.displayName:g==="footer"?R==null?void 0:R.blockSettings.displayName:g==="announcement"?C==null?void 0:C.blockSettings.displayName:"unknown name";const $=new a[D];return!$.blockSettings||!$.blockSettings.displayName?"unknown name":$.blockSettings.displayName}return s.jsxRuntimeExports.jsxs("div",{className:s.clx(dn.render,{[dn.open]:g,[dn.close]:!g,[dn.clicked]:t}),onClick:D=>D.stopPropagation(),style:{opacity:P?0:1},children:[s.jsxRuntimeExports.jsx(ph,{onClick:K,setIsClicked:n,getDisplayName:H}),s.jsxRuntimeExports.jsxs("div",{className:dn.settings,children:[d&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(J0,{block:d}),s.jsxRuntimeExports.jsx(uh,{colors:d.blockColors})]}),!u&&!g&&s.jsxRuntimeExports.jsx("div",{className:dn.loading,children:"Loading"})]})]})},gh="_header_9rrfr_1",xh="_title_9rrfr_9",Eh="_backIcon_9rrfr_15",gs={header:gh,title:xh,backIcon:Eh},ur=({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})]}),bh="_options_ymds7_1",Ih={options:bh},Th="_wrapper_kzokw_1",_h="_open_kzokw_16",Ch="_close_kzokw_20",xs={wrapper:Th,open:_h,close:Ch},lr=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})},Sh=()=>{var d,m;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(lr,{isOpen:c,isClose:!c,children:[s.jsxRuntimeExports.jsx(ur,{onClick:a,title:"Borders Style"}),s.jsxRuntimeExports.jsxs("div",{className:Ih.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:((m=Object.entries(cs).find(([h,f])=>f===u.thickness))==null?void 0:m[0])||"None",onChange:h=>o(cs[h],"thickness")})]})]})},yh="_options_jo38w_1",kh="_alignments_jo38w_9",Rh="_blocks_jo38w_15",Ah="_alignment_jo38w_9",Nh="_active_jo38w_34",wh="_chargeTypes_jo38w_41",Lh="_charge_jo38w_41",jh="_chargeActive_jo38w_69",vh="_sliderContainer_jo38w_83",Ph="_shadowInputs_jo38w_91",Dh="_label_jo38w_102",Oh="_shadowInputsRow_jo38w_111",Bh="_shadowInputsOpen_jo38w_119",We={options:yh,alignments:kh,blocks:Rh,alignment:Ah,active:Nh,chargeTypes:wh,charge:Lh,chargeActive:jh,sliderContainer:vh,shadowInputs:Ph,label:Dh,shadowInputsRow:Oh,shadowInputsOpen:Bh};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:m,setShowModal:h,setUpdate:f,setColor:p,setColorChange:x,setIsGradientActive:g,colorChange:y}=s.useColorPickerStore();k.useEffect(()=>{const P=()=>{h(!1),c(null),m(t),f(()=>{}),p(t),x(()=>{})};return document.body.addEventListener("click",P),()=>{document.body.removeEventListener("click",P)}},[t]);const E=P=>{P.stopPropagation(),h(!0),x(u),f(n),m(t),p(a),g(i);const{top:L,left:A}=da(P,600,288,10,20,230,80);d({top:L,left:A})},R=P=>{const L=P.target.value;u(L),Es(L)&&(n(L),p(L),x(y))},C=()=>{Es(a)||u(t)};return s.jsxRuntimeExports.jsxs("div",{className:ae.content,children:[s.jsxRuntimeExports.jsx("span",{className:s.clx(ae.name,{[ae.secondary]:o==="secondary"}),children:r}),s.jsxRuntimeExports.jsxs("label",{className:ae.label,onClick:P=>P.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:ae.colorValue,style:{background:Es(a)?a:t},onClick:E}),s.jsxRuntimeExports.jsx("input",{type:"text",value:a.includes("linear-gradient")?a:a.toUpperCase(),onChange:R,onBlur:C,className:ae.input,style:{textTransform:a.includes("linear-gradient")?"none":"uppercase"}})]})]})},Mh=["left","center","right"],Fh=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:r}=s.useThemeSettingsStore(),{fonts:o}=s.useFontsStore(),[i,a]=k.useState("primary");function u(g,y){n(i,y,g)}const[c,d]=k.useState(!1),m=t.buttons[i],h=s.useNavigate();function f(){r(null),h("/admin/builder/theme")}const p=(e==null?void 0:e.name)==="Buttons";function x(g,y){u({...m.boxShadow,[g]:y},"boxShadow")}return s.jsxRuntimeExports.jsxs(lr,{isOpen:p,isClose:!p,children:[s.jsxRuntimeExports.jsx(ur,{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))}),m&&s.jsxRuntimeExports.jsxs("div",{className:We.options,children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Height (px)",value:String(m.height),onChange:g=>u(Number(g),"height"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font Size (px)",value:String(m.size),onChange:g=>u(Number(g),"size"),options:$r}),s.jsxRuntimeExports.jsx(s.Input,{label:"Border Radius (px)",value:String(m.radius),onChange:g=>u(Number(g),"radius"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font",value:m.font,onChange:g=>u(g,"font"),options:[...o.filter(g=>g.name!==m.font).map(g=>g.name)]}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.color,onChange:g=>u(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.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(m.boxShadow.left),onChange:g=>x("left",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Top (px)",value:String(m.boxShadow.top),onChange:g=>x("top",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Blur (px)",value:String(m.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(m.boxShadow.spread),onChange:g=>x("spread",Number(g)),type:"number"})})]}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.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:Mh.map(g=>s.jsxRuntimeExports.jsx("div",{className:s.clx(We.alignment,{[We.active]:m.alignment===g}),onClick:()=>{u(g,"alignment")},children:s.jsxRuntimeExports.jsx(s.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:m.alignment===g?"#252525":"#757575"})},g))})]}),s.jsxRuntimeExports.jsx(s.Switch,{label:"Enable Hover",onChange:g=>u(g,"hover"),current:m.hover}),m.hover&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(ht,{initialColor:m.colorHover,onChange:g=>u(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.backgroundHover,onChange:g=>u(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},Hh="_category_hxy9u_1",Uh="_categoryTitle_hxy9u_19",bs={category:Hh,categoryTitle:Uh},$h=()=>{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))})},zh="_options_ikvjo_38",Wh={options:zh},qh=()=>{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,y){a&&n&&o("desktop",a,n,y,g)}const[m,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(y=>y.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 p=!!((e==null?void 0:e.name)==="Fonts"&&n),x=(e==null?void 0:e.name)!=="Fonts"||!n;return s.jsxRuntimeExports.jsxs(lr,{isOpen:p,isClose:x,children:[s.jsxRuntimeExports.jsx(ur,{onClick:c,title:"Font Style"}),n&&f&&s.jsxRuntimeExports.jsxs("div",{className:Wh.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:m}),s.jsxRuntimeExports.jsx(s.Select,{label:"Bold Weight",value:String(f.boldWeight),onChange:g=>d(g,"boldWeight"),options:m}),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))})]})]})},Vh="_wrapper_mkmxa_1",Gh="_category_mkmxa_5",Yh="_categoryTitle_mkmxa_11",Xh="_font_mkmxa_17",Qh="_content_mkmxa_32",Kh="_icon_mkmxa_39",Zh="_paragraph_mkmxa_50",Lt={wrapper:Vh,category:Gh,categoryTitle:Yh,font:Xh,content:Qh,icon:Kh,paragraph:Zh},Jh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},em=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(Jh[r])}),s.jsxRuntimeExports.jsx("span",{className:Lt.value,children:`${t}, ${n}px`})]})]})},tm=()=>{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(em,{id:a,category:o,...u},a))]},o))})},nm="_wrapper_16ym0_2",rm="_categoryTitle_16ym0_12",sm="_title_16ym0_74",om="_field_16ym0_82",im="_alignments_16ym0_92",am="_lineField_16ym0_98",um="_style_16ym0_106",lm="_header_16ym0_113",ct={wrapper:nm,categoryTitle:rm,title:sm,field:om,alignments:im,lineField:am,style:um,header:lm},cm="_blocks_emecf_1",dm="_block_emecf_1",hm="_active_emecf_21",Is={blocks:cm,block:dm,active:hm},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)))})},mm=["left","center","right"],pm=["solid","dashed"],Fn=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]})},fm=()=>{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(Fn,{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(Fn,{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(Fn,{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(Fn,{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:pm,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(Fn,{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:mm,selectedItem:n.label.alignment,onSelect:i=>r("label",i,"alignment"),getIconName:i=>i==="center"?"AlignCenterHorizontal":i==="left"?"AlignLeft":"AlignRight"})]})]})]})},gm="_wrapper_1yw63_2",xm="_color_1yw63_24",Em="_content_1yw63_33",bm="_preview_1yw63_42",Im="_container_1yw63_52",Tm="_buttonWrapper_1yw63_62",_m="_button_1yw63_62",Cm="_buttonBorder_1yw63_80",Sm="_buttonBackground_1yw63_83",ym="_text_1yw63_87",km="_textText_1yw63_93",Rm="_icon_1yw63_97",Am="_iconIcon_1yw63_100",Nm="_annotation_1yw63_104",wm="_annotationText_1yw63_111",Lm="_label_1yw63_116",jm="_circle_1yw63_127",vm="_line_1yw63_140",Pm="_circle1_1yw63_154",Dm="_circle2_1yw63_159",Om="_annotationIcon_1yw63_164",Bm="_annotationBorder_1yw63_192",Mm="_line1_1yw63_203",Fm="_line2_1yw63_210",Hm="_circle3_1yw63_227",Um="_circle4_1yw63_232",$m="_annotationSurface_1yw63_237",X={wrapper:gm,color:xm,content:Em,preview:bm,container:Im,buttonWrapper:Tm,button:_m,buttonBorder:Cm,buttonBackground:Sm,text:ym,textText:km,icon:Rm,iconIcon:Am,annotation:Nm,annotationText:wm,label:Lm,circle:jm,line:vm,circle1:Pm,circle2:Dm,annotationIcon:Om,annotationBorder:Bm,line1:Mm,line2:Fm,circle3:Hm,circle4:Um,annotationSurface:$m},zm=()=>{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)})]})]})})},Wm={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"]},qm=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:r,updateColor:o}=s.useThemeSettingsStore();function i(){t(null)}function a(m,h,f){o(m,h,f)}const u=!!((e==null?void 0:e.name)==="Colors"&&n),c=(e==null?void 0:e.name)!=="Colors"||!n,d=n?Wm[n]:[];return s.jsxRuntimeExports.jsxs(lr,{isOpen:u,isClose:c,children:[s.jsxRuntimeExports.jsx(ur,{onClick:i,title:n==="text"?"Text & Icon Colors":`${Ct(n)} Colors`}),n&&s.jsxRuntimeExports.jsxs("div",{className:X.wrapper,children:[s.jsxRuntimeExports.jsx(zm,{}),d.map(m=>{const h=r.colors[n][m];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(m),initialColor:h,onChange:f=>a(n,m,f),isGradientActive:n==="surface"})]})},m)})]})]})},Vm="_loader_1p5lr_1",Gm={loader:Vm},Ym=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=s.useThemeSettingsStore();return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:n?s.jsxRuntimeExports.jsx("div",{className:Gm.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(tm,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&s.jsxRuntimeExports.jsx(qh,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&s.jsxRuntimeExports.jsx($h,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&s.jsxRuntimeExports.jsx(qm,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&s.jsxRuntimeExports.jsx(fm,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&s.jsxRuntimeExports.jsx(Sh,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&s.jsxRuntimeExports.jsx(Fh,{})]})})},Xm=()=>{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(lr,{isOpen:i,isClose:a,children:[s.jsxRuntimeExports.jsx(ur,{onClick:o,title:(e==null?void 0:e.name)||""}),s.jsxRuntimeExports.jsx(Ym,{})]})},Qm=()=>{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(B0,{}),e.name==="Add"&&s.jsxRuntimeExports.jsx(ha,{}),s.jsxRuntimeExports.jsx(fh,{}),s.jsxRuntimeExports.jsx(Xm,{}),e.name==="Theme"&&s.jsxRuntimeExports.jsx(V0,{}),e.name==="Settings"&&s.jsxRuntimeExports.jsx(H0,{})]})},Km="_wrapper_no6if_1",Zm="_header_no6if_12",Jm="_content_no6if_23",ep="_buttons_no6if_44",tp="_label_no6if_51",np="_description_no6if_52",rp="_preview_no6if_60",sp="_block_no6if_66",op="_slug_no6if_75",ip="_title_no6if_81",ap="_closeIcon_no6if_87",at={wrapper:Km,header:Zm,content:Jm,buttons:ep,label:tp,description:np,preview:rp,block:sp,slug:op,title:ip,closeIcon:ap},up=()=>{var K,N,H,D,$,Y,q;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:m,updatePage:h}=s.useLayersStore(),[f,p]=k.useState(a?t&&((K=t[a])==null?void 0:K.path):""),[x,g]=k.useState(a?t&&((N=t[a])==null?void 0:N.name):""),[y,E]=k.useState(a?t&&((H=t[a])==null?void 0:H.seo)&&(($=(D=t[a])==null?void 0:D.seo)==null?void 0:$.pageDescription)||"":`${c.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[R,C]=k.useState(a&&t&&(Y=t[a])!=null&&Y.isPrivate?"private":"public");function P(){p(""),g(""),E(""),C("public"),i(!1),u(null)}function L(){d(!1),setTimeout(()=>{P(),e(!1),d(!0)},300)}k.useEffect(()=>()=>{L()},[]);function A(Z){return Z[0]==="/"?Z:"/"+Z}function z(){n({path:A(f),name:x||f||"",icon:"File",seo:{pageTitle:x||"",pageDescription:y||""},visibility:R||"public"}),m(A(f)),L()}function G(){t&&(s.defaultPagePaths.includes(t[a].path)||ca(t[a].path),h(t[a].path||"",f||""),r(a,{path:A(f),name:x||f,icon:t[a].icon||"File",seo:{pageTitle:x||"",pageDescription:y||""},visibility:R||"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=>p(Z),value:f,placeholder:"path-to-page",disabled:!!(a&&t&&((q=t[a])!=null&&q.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=>E(Z),value:y,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:y||"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?G:z,disabled:f.length===0,children:o?"Update":"Create"})]})]})},lp="_layout_1pjho_1",cp="_main_1pjho_10",dp="_content_1pjho_18",hp="_notifications_1pjho_26",yr={layout:lp,main:cp,content:dp,notifications:hp},mp="_notification_2jmah_1",pp="_text_2jmah_22",fp="_timer_2jmah_27",gp="_warning_2jmah_32",xp="_error_2jmah_37",Ep="_success_2jmah_42",hn={notification:mp,text:pp,timer:fp,warning:gp,error:xp,success:Ep},Uo={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},ma=e=>{const{type:t,message:n,style:r,padding:o,timer:i,id:a,element:u}=e,[c,d]=k.useState(i),{setNotifications:m}=s.useNotificationStore();function h(){const p=s.useNotificationStore.getState().notifications.filter(x=>x.id!==a);m([...p])}return k.useEffect(()=>{const f=setTimeout(()=>{h()},i*1e3);return()=>clearTimeout(f)},[i]),k.useEffect(()=>{const f=setInterval(()=>d(p=>p-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()})})]})})},bp="_modal_1h74q_1",Ip="_title_1h74q_14",Tp="_buttons_1h74q_20",kr={modal:bp,title:Ip,buttons:Tp},pa=()=>{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:kr.modal,onClick:c=>c.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:kr.title,children:e}),s.jsxRuntimeExports.jsx("div",{className:kr.description,children:t}),s.jsxRuntimeExports.jsxs("div",{className:kr.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:u,children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{n(),u()},type:"Secondary",children:"Confirm"})]})]})},_p="_modal_270ti_1",Cp="_padding_270ti_17",Sp="_content_270ti_21",yp="_close_270ti_42",Rr={modal:_p,padding:Cp,content:Sp,close:yp},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(Rr.modal,{[Rr.padding]:o}),children:r?s.jsxRuntimeExports.jsx("div",{className:s.clx(Rr.content,{[Rr.close]:!i}),children:n}):s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:n})})},kp=()=>{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:yr.layout,children:[s.jsxRuntimeExports.jsx(hd,{}),s.jsxRuntimeExports.jsxs("main",{className:yr.main,children:[s.jsxRuntimeExports.jsx(rd,{}),s.jsxRuntimeExports.jsxs("div",{className:yr.content,children:[s.jsxRuntimeExports.jsx(Qm,{}),s.jsxRuntimeExports.jsx(g0,{})]})]})]}),i&&a&&s.jsxRuntimeExports.jsx(Br,{close:()=>{u(null),c(null),d(null)},children:s.jsxRuntimeExports.jsx(pa,{})}),e&&s.jsxRuntimeExports.jsx(Br,{close:t,children:s.jsxRuntimeExports.jsx(up,{})}),n&&s.jsxRuntimeExports.jsx(Br,{close:r,children:s.jsxRuntimeExports.jsx(s.ChooseImageModal,{})}),o.length>0&&s.jsxRuntimeExports.jsx("div",{className:yr.notifications,children:o.map(m=>s.jsxRuntimeExports.jsx(ma,{type:m.status,message:m.message,timer:m.timer||10,id:m.id,element:m.component},m.id))})]})};async function mn(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 Rp(){try{const[e,t,n,r,o,i,a,u]=await Promise.allSettled([mn("v1","general"),mn("v1","faqs"),mn("v1","listings"),mn("v1","products"),mn("v1","reviews"),mn("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 Ap(){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 Np(){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 wp(){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 Lp=e=>{const{blocks:t,settings:n,header:r,footer:o,announcement:i}=e,{setBlocks:a,setSourceBlocks:u,setHeader:c,setFooter:d,setAnnouncement:m,setSettings:h}=s.useBlocksStore(),{fonts:f,setFonts:p}=s.useFontsStore(),{setSettings:x}=s.useSettingsStore(),{setPageContext:g}=s.usePagesStore(),{setThemeSettings:y,setIsLoadingThemeSettings:E}=s.useThemeSettingsStore(),{setIsLoadingSettings:R}=s.useSettingsStore(),{notifications:C,setNotifications:P}=s.useNotificationStore(),{setBlocks:L,blocks:A,createPage:z,setIsLoadingLayers:G,setHeader:K,setAnnouncement:N,setFooter:H}=s.useLayersStore(),{setPages:D,setCurrentPage:$}=s.usePagesStore();return k.useEffect(()=>{E(!0),G(!0),R(!0);const Y={};Object.keys(t).forEach(Z=>{Y[Z]=t[Z]}),u(Y),a(Y),c(r),d(o),m(i),h(n),(async()=>{const Z={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},W=await Rp();Object.keys(W).map(de=>{const Ae=de;Z[Ae]=W[Ae].value.data}),g(Z);const{data:V}=await wp(),{themeSettings:ue,layers:T,settings:ce}=V||{};if(ce){if(ce.settings){const de=new n;de.blockSettings={displayName:"Settings",isAddable:!1,...ce.settings},x(de.blockSettings)}ce.header&&K(ce.header),ce.footer&&H(ce.footer),ce.announcement&&N(ce.announcement)}else{const de=new n;x(de.blockSettings)}ue&&y(ue);const je=await Np(),S={};if(je.status>=400&&P([...C,{id:s.v4(),message:"Error fetching pages",status:"error"}]),je.data.length>0?(je.data.forEach(de=>{var Ae,J;A[de.path]||z(de.path),S[de.id||de.path]={...de,icon:s.pages[de.path]?s.pages[de.path].icon:"File",name:de.name||((Ae=de.seo)==null?void 0:Ae.pageTitle)||((J=s.pages[de.path])==null?void 0:J.name)||de.path}}),D(S),$(Object.keys(S)[0])):(D(s.pages),$(Object.keys(s.pages)[0])),f.length===0){const de=await Ap();p([...de.map(Ae=>{const J=Ae.variants.map(Be=>{if(!Be.includes("italic"))return Be==="regular"?"400":Be}).filter(Be=>Be!==void 0);return{name:Ae.family,weights:J}})])}L(T),E(!1),G(!1),R(!1)})()},[]),s.jsxRuntimeExports.jsx(kp,{})};function jp(){const e=new URL(window.location.href);window.history.replaceState(null,"",e.pathname+e.hash)}function vp(){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 jp(),n&&localStorage.setItem("sellerAccessToken",n),t&&localStorage.setItem("shopId",t),r&&localStorage.setItem("draftId",r),!!(n&&t&&r)}const Pp="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",Dp=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 m=d.pathname;if(m.startsWith("/admin/builder")){m==="/admin/builder/add"?document.title="Add Section | Builder":m==="/admin/builder/theme"?document.title="Theme Settings | Builder":m==="/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=Pp)}},[d]),k.useEffect(()=>{u(!0),vp()?u(!1):c("/")},[]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:a?s.jsxRuntimeExports.jsx(Vt,{}):s.jsxRuntimeExports.jsx(Lp,{blocks:t,settings:n,header:r,footer:o,announcement:i})})},Op="_wrapper_1yd2j_1",Bp="_error_1yd2j_11",Mp="_title_1yd2j_21",Fp="_buttons_1yd2j_29",Hn={wrapper:Op,error:Bp,title:Mp,buttons:Fp},$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})},Hp=()=>{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 m(){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(p=>n[p].id).filter(p=>p!==void 0).map(p=>f.push(p)),await $o({resetSettings:!0,resetThemeSettings:!0,resetPageIds:f}),t(null)}return s.jsxRuntimeExports.jsxs("div",{className:Hn.wrapper,children:[s.jsxRuntimeExports.jsxs("div",{className:Hn.error,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:Hn.title,children:"Oops! Something went wrong"}),s.jsxRuntimeExports.jsx("span",{className:Hn.message,children:(e==null?void 0:e.message)||""})]}),s.jsxRuntimeExports.jsxs("div",{className:Hn.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{type:"Primary",onClick:m,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(pa,{})})]})},Up=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})},$p="_lock_1mxa7_1",zp="_wrapper_1mxa7_12",Wp="_content_1mxa7_22",qp="_info_1mxa7_31",Vp="_buttons_1mxa7_38",Gp="_button_1mxa7_38",Yp="_input_1mxa7_50",Xp="_error_1mxa7_57",ut={lock:$p,wrapper:zp,content:Wp,info:qp,buttons:Vp,button:Gp,input:Yp,error:Xp},Qp=()=>{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(),m=s.useNavigate();k.useEffect(()=>{if(a&&(!a.info.passwordProtected||a.isPasswordValid)){const f=d.state.from==="/validation"?"/":d.state.from;m(f)}},[a]),k.useEffect(()=>{a||(async()=>{var g;t(!0);const p=localStorage.getItem("shopPassword")||"",x=await $s(p);if(x.isPasswordValid){const y=((g=d.state)==null?void 0:g.from)||"/";m(y)}u(x),t(!1)})()},[a]);async function h(){var p;t(!0);const f=await $s(o);if(!f.isPasswordValid)r(!0);else{localStorage.setItem("shopPassword",o),c(o);const x=((p=d.state)==null?void 0:p.from)||"/";m(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:()=>m("/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,{})]})},Kp="_notifications_2ywhg_1",Zp={notifications:Kp},Jp=({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:m}=s.useNotificationStore(),[h,f]=k.useState(!0),{setCustomerEmail:p}=s.useCartStore(),{setThemeSettings:x,themeSettings:g}=s.useThemeSettingsStore(),{settings:y,setSettings:E}=s.useSettingsStore(),{setHeader:R,setFooter:C,setAnnouncement:P}=s.useLayersStore(),{general:L,setGeneral:A}=s.useGeneralStore(),{pageContext:z,setPageContext:G}=s.usePagesStore();s.useTrackingAnalytics((L==null?void 0:L.info.id)||localStorage.getItem("shopId")||"");const K=async()=>{const N=await s.getDynamicPage(encodeURIComponent("/products"));if(N){const{data:H}=N;G({...z,listings:H.listings})}};return k.useEffect(()=>{const N=localStorage.getItem("token");if(N&&(!n||!o))try{const H=s.jwtDecode(N);i(H),r(N),p(H.email)}catch(H){console.error("Failed to decode token:",H),localStorage.removeItem("token"),r(""),i(null)}},[n,o]),k.useEffect(()=>{const N=c.get("r");N&&(localStorage.setItem("referralCode",N),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")&&L&&(L.info.passwordProtected&&a||L.isPasswordValid)&&K()},[L,a]),k.useEffect(()=>{f(!0);const N=async()=>{if(!L){const D=await $s(a);D.isPasswordValid||t.pathname.includes("/admin/builder")||u("/validation",{state:{from:t.pathname}}),A(D)}},H=async()=>{const{settings:D,theme:$}=(await nc()).data;D&&y?(D.settings?E(D.settings):E(y),D.header&&R(JSON.parse(JSON.stringify(D.header))),D.footer&&C(JSON.parse(JSON.stringify(D.footer))),D.announcement&&P(JSON.parse(JSON.stringify(D.announcement)))):E(y),x(g),x($||g),f(!1)};t.pathname.startsWith("/validation")||N(),H()},[]),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,m.length>0&&s.jsxRuntimeExports.jsx("div",{className:Zp.notifications,children:m.map(N=>s.jsxRuntimeExports.jsx(ma,{type:N.status,message:N.message,timer:N.timer||10,id:N.id,element:N.component},N.id))})]})})},ef=()=>(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,{})})),tf="_wrapper_rccv2_1",nf="_content_rccv2_11",rf="_title_rccv2_21",Ts={wrapper:tf,content:nf,title:rf},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"})]})})},sf=({children:e,shopDomain:t,shopId:n,shopPassword:r,shopLogo:o})=>{const{setShopDomain:i,setShopId:a,setShopPassword:u,setShopTerms:c,setShopPrivacyPolicy:d,setShopRefundPolicy:m,setShopLogo:h}=s.useStorefrontStore();return k.useLayoutEffect(()=>{const f=async()=>{const{data:g}=await sc();c(g)},p=async()=>{const{data:g}=await ic();d(g)},x=async()=>{const{data:g}=await oc();m(g)};i(t),a(n),r&&u(r),o&&h(o),f(),p(),x()},[t,n,r]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:e})},of="_checkoutItemsContainer_1kn61_2",af="_innerContainer_1kn61_16",uf="_headerSection_1kn61_22",lf="_header_1kn61_22",cf="_productsContainer_1kn61_47",df="_couponContainer_1kn61_54",hf="_checkoutFooter_1kn61_58",Kt={checkoutItemsContainer:of,innerContainer:af,headerSection:uf,header:lf,productsContainer:cf,couponContainer:df,checkoutFooter:hf},mf="_checkoutFooter_1o2h8_1",pf="_footerBranding_1o2h8_10",ff="_poweredText_1o2h8_15",gf="_antistockLink_1o2h8_19",xf="_footerNav_1o2h8_23",Un={checkoutFooter:mf,footerBranding:pf,poweredText:ff,antistockLink:gf,footerNav:xf},Ef="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(),{isAntistock:i}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("footer",{className:`${Un.checkoutFooter} ${e}`,children:[s.jsxRuntimeExports.jsxs("div",{className:Un.footerBranding,children:[s.jsxRuntimeExports.jsx("p",{className:Un.poweredText,id:"md",children:"Powered by"}),i?s.jsxRuntimeExports.jsx("a",{className:Un.antistockLink,href:"https://antistock.io",target:"_blank",rel:"noopener noreferrer",children:"Antistock"}):o||s.jsxRuntimeExports.jsx("img",{src:Ef,alt:"Billgang"})]}),s.jsxRuntimeExports.jsx("nav",{children:s.jsxRuntimeExports.jsxs("ul",{className:Un.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"})})]})})]})},bf="_checkoutHeader_1stm3_1",If="_leftContainer_1stm3_20",Tf="_backArrow_1stm3_26",_f="_logoContainer_1stm3_38",Cf="_logo_1stm3_38",Sf="_antistockLink_1stm3_48",pn={checkoutHeader:bf,leftContainer:If,backArrow:Tf,logoContainer:_f,logo:Cf,antistockLink:Sf},yf="_activeBadge_1yb5i_1",kf="_activeBadgeText_1yb5i_12",zo={activeBadge:yf,activeBadgeText:kf},Rf=({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"})]}),Af="_timerContainer_105jf_2",Nf="_timerText_105jf_12",Wo={timerContainer:Af,timerText:Nf},wf=({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]})]})},Lf="_progressBar_mcabf_4",jf="_progressBarLabel_mcabf_12",vf="_progressBarTrack_mcabf_17",Pf="_progressBarFill_mcabf_28",Ar={progressBar:Lf,progressBarLabel:jf,progressBarTrack:vf,progressBarFill:Pf},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})})]}),Df="_rating_1bpps_4",Of="_disabled_1bpps_9",Bf="_ratingStar_1bpps_14",Mf="_inactive_1bpps_22",Nr={rating:Df,disabled:Of,ratingStar:Bf,inactive:Mf},Ff=({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))})},Hf="_inputRange_iv6ow_4",Uf="_inputRangeLabel_iv6ow_14",$f="_progressBar_iv6ow_22",zf="_progressBarFill_iv6ow_29",Wf="_stepsContainer_iv6ow_40",qf="_step_iv6ow_40",Vf="_stepDot_iv6ow_57",Gf="_current_iv6ow_61",Yf="_active_iv6ow_69",Xf="_inactive_iv6ow_72",Qf="_tooltip_iv6ow_77",Ze={inputRange:Hf,inputRangeLabel:Uf,progressBar:$f,progressBarFill:zf,stepsContainer:Wf,step:qf,stepDot:Vf,current:Gf,default:"_default_iv6ow_65",active:Yf,inactive:Xf,tooltip:Qf},Kf=({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 m=d+1,h=m<=o,f=m===o;return s.jsxRuntimeExports.jsxs("div",{className:Ze.step,onClick:()=>u(m),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"})]})]},m)})})]})]})},cr=({className:e,expiresAt:t})=>{const{shopGeneral:n}=s.useStorefrontStore(),r=s.useNavigate(),{isAntistock:o}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("header",{className:`${pn.checkoutHeader} ${e}`,children:[s.jsxRuntimeExports.jsxs("div",{className:pn.leftContainer,children:[s.jsxRuntimeExports.jsx("div",{className:pn.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:pn.logoContainer,children:o?s.jsxRuntimeExports.jsx("a",{className:pn.antistockLink,href:"https://antistock.io",target:"_blank",rel:"noopener noreferrer",children:"Antistock"}):s.jsxRuntimeExports.jsx("img",{className:pn.logo,src:s.convertCfImageIdToUrl(n.info.logo.cfId)})})]}),t&&s.jsxRuntimeExports.jsx(wf,{expiresAt:t})]})},Zf="_checkoutPrices_vp75r_1",Jf="_priceRow_vp75r_12",e1="_label_vp75r_22",t1="_totalRow_vp75r_26",n1="_totalLabel_vp75r_37",r1="_totalValue_vp75r_42",xt={checkoutPrices:Zf,priceRow:Jf,label:e1,totalRow:t1,totalLabel:n1,totalValue:r1},dr=({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)})]})]})},s1="_checkoutProduct_13ajx_1",o1="_isOrder_13ajx_1",i1="_productDetails_13ajx_10",a1="_productImage_13ajx_16",u1="_isOrderImage_13ajx_26",l1="_productImageAntistock_13ajx_30",c1="_image_13ajx_34",d1="_productInfo_13ajx_39",h1="_productHeader_13ajx_44",m1="_quantityBadge_13ajx_50",p1="_productDescription_13ajx_61",f1="_productPrice_13ajx_68",g1="_deliveryCategories_13ajx_77",x1="_customerNote_13ajx_85",E1="_noteHeader_13ajx_92",b1="_logoContainer_13ajx_98",I1="_shopName_13ajx_110",T1="_noteContent_13ajx_114",_1="_productName_13ajx_120",C1="_link_13ajx_125",ke={checkoutProduct:s1,isOrder:o1,productDetails:i1,productImage:a1,isOrderImage:u1,productImageAntistock:l1,image:c1,productInfo:d1,productHeader:h1,quantityBadge:m1,productDescription:p1,productPrice:f1,deliveryCategories:g1,customerNote:x1,noteHeader:E1,logoContainer:b1,shopName:I1,noteContent:T1,productName:_1,link:C1};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 S1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k1={};function Vo(e,t){return(k1.jsx?y1:S1).test(e)}const R1=/[ \t\n\f\r]/g;function A1(e){return typeof e=="object"?e.type==="text"?Go(e.value):!1:Go(e)}function Go(e){return e.replace(R1,"")===""}let hr=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};hr.prototype.normal={};hr.prototype.property={};hr.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 hr(n,r,t)}function sr(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 N1=0;const re=an(),we=an(),Ea=an(),M=an(),Te=an(),In=an(),Xe=an();function an(){return 2**++N1}const qs=Object.freeze(Object.defineProperty({__proto__:null,boolean:re,booleanish:we,commaOrSpaceSeparated:Xe,commaSeparated:In,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 kn(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[sr(r)]=r,n[sr(i.attribute)]=r}return new hr(t,n,e.space)}const ba=kn({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 w1=kn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:In,acceptCharset:Te,accessKey:Te,action:null,allow:null,allowFullScreen:re,allowPaymentRequest:re,allowUserMedia:re,alt:null,as:null,async:re,autoCapitalize:null,autoComplete:Te,autoFocus:re,autoPlay:re,blocking:Te,capture:null,charSet:null,checked:re,cite:null,className:Te,cols:M,colSpan:null,content:null,contentEditable:we,controls:re,controlsList:Te,coords:M|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:re,defer:re,dir:null,dirName:null,disabled:re,download:Ea,draggable:we,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:re,formTarget:null,headers:Te,height:M,hidden:re,high:M,href:null,hrefLang:null,htmlFor:Te,httpEquiv:Te,id:null,imageSizes:null,imageSrcSet:null,inert:re,inputMode:null,integrity:null,is:null,isMap:re,itemId:null,itemProp:Te,itemRef:Te,itemScope:re,itemType:Te,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:re,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:re,muted:re,name:null,nonce:null,noModule:re,noValidate:re,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:re,optimum:M,pattern:null,ping:Te,placeholder:null,playsInline:re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:re,referrerPolicy:null,rel:Te,required:re,reversed:re,rows:M,rowSpan:M,sandbox:Te,scope:null,scoped:re,seamless:re,selected:re,shadowRootClonable:re,shadowRootDelegatesFocus:re,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:re,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:re,declare:re,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:re,noHref:re,noShade:re,noWrap:re,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:re,disableRemotePlayback:re,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Ta}),L1=kn({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:re,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:In,g2:In,glyphName:In,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=kn({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=kn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ta}),Sa=kn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),j1={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"},v1=/[A-Z]/g,Xo=/-[a-z]/g,P1=/^data[-\w.:]+$/i;function lo(e,t){const n=sr(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"&&P1.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Xo,O1);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Xo.test(i)){let a=i.replace(v1,D1);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=uo}return new o(r,t)}function D1(e){return"-"+e.toLowerCase()}function O1(e){return e.charAt(1).toUpperCase()}const Qr=xa([ba,w1,_a,Ca,Sa],"html"),Rn=xa([ba,L1,_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,B1=/\n/g,M1=/^\s*/,F1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H1=/^:\s*/,U1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$1=/^[;\s]*/,z1=/^\s+|\s+$/g,W1=`
|
|
103
|
-
`,Zo="/",Jo="*",nn="",q1="comment",V1="declaration",G1=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(x){var g=x.match(B1);g&&(n+=g.length);var y=x.lastIndexOf(W1);r=~y?x.length-y:r+x.length}function i(){var x={line:n,column:r};return function(g){return g.position=new a(x),d(),g}}function a(x){this.start=x,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function u(x){var g=new Error(t.source+":"+n+":"+r+": "+x);if(g.reason=x,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(x){var g=x.exec(e);if(g){var y=g[0];return o(y),e=e.slice(y.length),g}}function d(){c(M1)}function m(x){var g;for(x=x||[];g=h();)g!==!1&&x.push(g);return x}function h(){var x=i();if(!(Zo!=e.charAt(0)||Jo!=e.charAt(1))){for(var g=2;nn!=e.charAt(g)&&(Jo!=e.charAt(g)||Zo!=e.charAt(g+1));)++g;if(g+=2,nn===e.charAt(g-1))return u("End of comment missing");var y=e.slice(2,g-2);return r+=2,o(y),e=e.slice(g),r+=2,x({type:q1,comment:y})}}function f(){var x=i(),g=c(F1);if(g){if(h(),!c(H1))return u("property missing ':'");var y=c(U1),E=x({type:V1,property:ei(g[0].replace(Ko,nn)),value:y?ei(y[0].replace(Ko,nn)):nn});return c($1),E}}function p(){var x=[];m(x);for(var g;g=f();)g!==!1&&(x.push(g),m(x));return x}return d(),p()};function ei(e){return e?e.replace(z1,nn):nn}var Y1=s.commonjsGlobal&&s.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ka,"__esModule",{value:!0});var ti=ka.default=Q1,X1=Y1(G1);function Q1(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,X1.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var a=i.property,u=i.value;o?t(a,u,i):u&&(n=n||{},n[a]=u)}}),n}const K1=ti.default||ti,Kr=Ra("end"),St=Ra("start");function Ra(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Z1(e){const t=St(e),n=Kr(e);if(t&&n)return{start:t,end:n}}function Xn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ni(e.position):"start"in e||"end"in e?ni(e):"line"in e||"column"in e?Vs(e):""}function Vs(e){return ri(e&&e.line)+":"+ri(e&&e.column)}function ni(e){return Vs(e&&e.start)+"-"+Vs(e&&e.end)}function ri(e){return e&&typeof e=="number"?e:1}class He extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=u?u.line:void 0,this.name=Xn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}He.prototype.file="";He.prototype.name="";He.prototype.reason="";He.prototype.message="";He.prototype.stack="";He.prototype.column=void 0;He.prototype.line=void 0;He.prototype.ancestors=void 0;He.prototype.cause=void 0;He.prototype.fatal=void 0;He.prototype.place=void 0;He.prototype.ruleId=void 0;He.prototype.source=void 0;const co={}.hasOwnProperty,J1=new Map,eg=/[A-Z]/g,tg=/-([a-z])/g,ng=new Set(["table","tbody","thead","tfoot","tr"]),rg=new Set(["td","th"]),Aa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sg(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hg(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=dg(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Rn:Qr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Na(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Na(e,t,n){if(t.type==="element")return og(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ig(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ug(e,t,n);if(t.type==="mdxjsEsm")return ag(e,t);if(t.type==="root")return lg(e,t,n);if(t.type==="text")return cg(e,t)}function og(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Rn,e.schema=o),e.ancestors.push(t);const i=La(e,t.tagName,!1),a=mg(e,t);let u=mo(e,t);return ng.has(t.tagName)&&(u=u.filter(function(c){return typeof c=="string"?!A1(c):!0})),wa(e,a,i,t),ho(a,u),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function ig(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}or(e,t.position)}function ag(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);or(e,t.position)}function ug(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Rn,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:La(e,t.name,!0),a=pg(e,t),u=mo(e,t);return wa(e,a,i,t),ho(a,u),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function lg(e,t,n){const r={};return ho(r,mo(e,t)),e.create(t,e.Fragment,r,n)}function cg(e,t){return t.value}function wa(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ho(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dg(e,t,n){return r;function r(o,i,a,u){const d=Array.isArray(a.children)?n:t;return u?d(i,a,u):d(i,a)}}function hg(e,t){return n;function n(r,o,i,a){const u=Array.isArray(i.children),c=St(r);return t(o,i,a,u,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function mg(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&co.call(t.properties,o)){const i=fg(e,o,t.properties[o]);if(i){const[a,u]=i;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&rg.has(t.tagName)?r=u:n[a]=u}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pg(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else or(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,i=e.evaluater.evaluateExpression(u.expression)}else or(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function mo(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:J1;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const d=o.get(c)||0;a=c+"-"+d,o.set(c,d+1)}}const u=Na(e,i,a);u!==void 0&&n.push(u)}return n}function fg(e,t,n){const r=lo(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ga(n):ya(n)),r.property==="style"){let o=typeof n=="object"?n:gg(e,String(n));return e.stylePropertyNameCase==="css"&&(o=xg(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?j1[r.property]||r.property:r.attribute,n]}}function gg(e,t){const n={};try{K1(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,a=new He("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Aa+"#cannot-parse-style-attribute",a}}return n;function r(o,i){let a=o;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(tg,bg)),n[a]=i}}function La(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,a;for(;++i<o.length;){const u=Vo(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=a}else r=Vo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return co.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);or(e)}function or(e,t){const n=new He("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Aa+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xg(e){const t={};let n;for(n in e)co.call(e,n)&&(t[Eg(n)]=e[n]);return t}function Eg(e){let t=e.replace(eg,Ig);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function bg(e,t){return t.toUpperCase()}function Ig(e){return"-"+e.toLowerCase()}const Cs={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Tg={};function po(e,t){const n=Tg,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ja(e,r,o)}function ja(e,t,n){if(_g(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return si(e.children,t,n)}return Array.isArray(e)?si(e,t,n):""}function si(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ja(e[o],t,n);return r.join("")}function _g(e){return!!(e&&typeof e=="object")}const oi=document.createElement("i");function fo(e){const t="&"+e+";";oi.innerHTML=t;const n=oi.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ke(e,t,n,r){const o=e.length;let i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function tt(e,t){return e.length>0?(Ke(e,e.length,0,t),e):t}const ii={}.hasOwnProperty;function va(e){const t={};let n=-1;for(;++n<e.length;)Cg(t,e[n]);return t}function Cg(e,t){let n;for(n in t){const o=(ii.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){ii.call(o,a)||(o[a]=[]);const u=i[a];Sg(o[a],Array.isArray(u)?u:u?[u]:[])}}}function Sg(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ke(e,0,0,r)}function Pa(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ze=Gt(/[A-Za-z]/),Fe=Gt(/[\dA-Za-z]/),yg=Gt(/[#-'*+\--9=?A-Z^-~]/);function Wr(e){return e!==null&&(e<32||e===127)}const Gs=Gt(/\d/),kg=Gt(/[\dA-Fa-f]/),Rg=Gt(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function Ie(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Zr=Gt(new RegExp("\\p{P}|\\p{S}","u")),on=Gt(/\s/);function Gt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function An(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&Fe(e.charCodeAt(n+1))&&Fe(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const u=e.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(a=String.fromCharCode(i,u),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function fe(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return he(c)?(e.enter(n),u(c)):t(c)}function u(c){return he(c)&&i++<o?(e.consume(c),u):(e.exit(n),t(c))}}const Ag={tokenize:Ng};function Ng(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),fe(e,t,"linePrefix")}function o(u){return e.enter("paragraph"),i(u)}function i(u){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Q(u)?(e.consume(u),e.exit("chunkText"),i):(e.consume(u),a)}}const wg={tokenize:Lg},ai={tokenize:jg};function Lg(e){const t=this,n=[];let r=0,o,i,a;return u;function u(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,c,d)(C)}return d(C)}function c(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&R();const P=t.events.length;let L=P,A;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){A=t.events[L][1].end;break}E(r);let z=P;for(;z<t.events.length;)t.events[z][1].end={...A},z++;return Ke(t.events,L+1,0,t.events.slice(P)),t.events.length=z,d(C)}return u(C)}function d(C){if(r===n.length){if(!o)return f(C);if(o.currentConstruct&&o.currentConstruct.concrete)return x(C);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ai,m,h)(C)}function m(C){return o&&R(),E(r),f(C)}function h(C){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(C)}function f(C){return t.containerState={},e.attempt(ai,p,x)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),f(C)}function x(C){if(C===null){o&&R(),E(0),e.consume(C);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),g(C)}function g(C){if(C===null){y(e.exit("chunkFlow"),!0),E(0),e.consume(C);return}return Q(C)?(e.consume(C),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(C),g)}function y(C,P){const L=t.sliceStream(C);if(P&&L.push(null),C.previous=i,i&&(i.next=C),i=C,o.defineSkip(C.start),o.write(L),t.parser.lazy[C.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<a&&(!o.events[A][1].end||o.events[A][1].end.offset>a))return;const z=t.events.length;let G=z,K,N;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(K){N=t.events[G][1].end;break}K=!0}for(E(r),A=z;A<t.events.length;)t.events[A][1].end={...N},A++;Ke(t.events,G+1,0,t.events.slice(z)),t.events.length=A}}function E(C){let P=n.length;for(;P-- >C;){const L=n[P];t.containerState=L[1],L[0].exit.call(t,e)}n.length=C}function R(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function jg(e,t,n){return fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cn(e){if(e===null||Ie(e)||on(e))return 1;if(Zr(e))return 2}function Jr(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Ys={name:"attention",resolveAll:vg,tokenize:Pg};function vg(e,t){let n=-1,r,o,i,a,u,c,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};ui(h,-c),ui(f,c),a={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:c>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=tt(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=tt(d,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),d=tt(d,Jr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=tt(d,[["exit",i,t],["enter",u,t],["exit",u,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=tt(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Ke(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Pg(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Cn(r);let i;return a;function a(c){return i=c,e.enter("attentionSequence"),u(c)}function u(c){if(c===i)return e.consume(c),u;const d=e.exit("attentionSequence"),m=Cn(c),h=!m||m===2&&o||n.includes(c),f=!o||o===2&&m||n.includes(r);return d._open=!!(i===42?h:h&&(o||!f)),d._close=!!(i===42?f:f&&(m||!h)),t(c)}}function ui(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Dg={name:"autolink",tokenize:Og};function Og(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return ze(p)?(e.consume(p),a):p===64?n(p):d(p)}function a(p){return p===43||p===45||p===46||Fe(p)?(r=1,u(p)):d(p)}function u(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Fe(p))&&r++<32?(e.consume(p),u):(r=0,d(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Wr(p)?n(p):(e.consume(p),c)}function d(p){return p===64?(e.consume(p),m):yg(p)?(e.consume(p),d):n(p)}function m(p){return Fe(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,m):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Fe(p))&&r++<63){const x=p===45?f:h;return e.consume(p),x}return n(p)}}const mr={partial:!0,tokenize:Bg};function Bg(e,t,n){return r;function r(i){return he(i)?fe(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Q(i)?t(i):n(i)}}const Da={continuation:{tokenize:Fg},exit:Hg,name:"blockQuote",tokenize:Mg};function Mg(e,t,n){const r=this;return o;function o(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return he(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Fg(e,t,n){const r=this;return o;function o(a){return he(a)?fe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(Da,t,n)(a)}}function Hg(e){e.exit("blockQuote")}const Oa={name:"characterEscape",tokenize:Ug};function Ug(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return Rg(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Ba={name:"characterReference",tokenize:$g};function $g(e,t,n){const r=this;let o=0,i,a;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),i=31,a=Fe,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=kg,m):(e.enter("characterReferenceValue"),i=7,a=Gs,m(h))}function m(h){if(h===59&&o){const f=e.exit("characterReferenceValue");return a===Fe&&!fo(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&o++<i?(e.consume(h),m):n(h)}}const li={partial:!0,tokenize:Wg},ci={concrete:!0,name:"codeFenced",tokenize:zg};function zg(e,t,n){const r=this,o={partial:!0,tokenize:L};let i=0,a=0,u;return c;function c(A){return d(A)}function d(A){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===u?(a++,e.consume(A),m):a<3?n(A):(e.exit("codeFencedFenceSequence"),he(A)?fe(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Q(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(li,g,P)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(A))}function f(A){return A===null||Q(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):he(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),fe(e,p,"whitespace")(A)):A===96&&A===u?n(A):(e.consume(A),f)}function p(A){return A===null||Q(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Q(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===u?n(A):(e.consume(A),x)}function g(A){return e.attempt(o,P,y)(A)}function y(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),E}function E(A){return i>0&&he(A)?fe(e,R,"linePrefix",i+1)(A):R(A)}function R(A){return A===null||Q(A)?e.check(li,g,P)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Q(A)?(e.exit("codeFlowValue"),R(A)):(e.consume(A),C)}function P(A){return e.exit("codeFenced"),t(A)}function L(A,z,G){let K=0;return N;function N(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),H}function H(q){return A.enter("codeFencedFence"),he(q)?fe(A,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):D(q)}function D(q){return q===u?(A.enter("codeFencedFenceSequence"),$(q)):G(q)}function $(q){return q===u?(K++,A.consume(q),$):K>=a?(A.exit("codeFencedFenceSequence"),he(q)?fe(A,Y,"whitespace")(q):Y(q)):G(q)}function Y(q){return q===null||Q(q)?(A.exit("codeFencedFence"),z(q)):G(q)}}}function Wg(e,t,n){const r=this;return o;function o(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ss={name:"codeIndented",tokenize:Vg},qg={partial:!0,tokenize:Gg};function Vg(e,t,n){const r=this;return o;function o(d){return e.enter("codeIndented"),fe(e,i,"linePrefix",5)(d)}function i(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):Q(d)?e.attempt(qg,a,c)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Q(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function c(d){return e.exit("codeIndented"),t(d)}}function Gg(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):Q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):fe(e,i,"linePrefix",5)(a)}function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):Q(a)?o(a):n(a)}}const Yg={name:"codeText",previous:Qg,resolve:Xg,tokenize:Kg};function Xg(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Qg(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Kg(e,t,n){let r=0,o,i;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(i=e.enter("codeTextSequence"),o=0,m(h)):Q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||Q(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),o++,m):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",d(h))}}class Zg{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&$n(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$n(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$n(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$n(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$n(this.left,n.reverse())}}}function $n(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ma(e){const t={};let n=-1,r,o,i,a,u,c,d;const m=new Zg(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Jg(m,n)),n=t[n],d=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(a=m.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(r[1].end={...m.get(o)[1].start},u=m.slice(o,n),u.unshift(r),m.splice(o,n-o+1,u))}}return Ke(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function Jg(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,c=[],d={};let m,h,f=-1,p=n,x=0,g=0;const y=[g];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(m=r.sliceStream(p),p.next||m.push(null),h&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++f<u.length;)u[f][0]==="exit"&&u[f-1][0]==="enter"&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(g=f+1,y.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const E=u.slice(y[f],y[f+1]),R=i.pop();c.push([R,R+E.length-1]),e.splice(R,2,E)}for(c.reverse(),f=-1;++f<c.length;)d[x+c[f][0]]=x+c[f][1],x+=c[f][1]-c[f][0]-1;return d}const e2={resolve:n2,tokenize:r2},t2={partial:!0,tokenize:s2};function n2(e){return Ma(e),e}function r2(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(u)}function o(u){return u===null?i(u):Q(u)?e.check(t2,a,i)(u):(e.consume(u),o)}function i(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function s2(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),fe(e,i,"linePrefix")}function i(a){if(a===null||Q(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Fa(e,t,n,r,o,i,a,u,c){const d=c||Number.POSITIVE_INFINITY;let m=0;return h;function h(E){return E===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(E),e.exit(i),f):E===null||E===32||E===41||Wr(E)?n(E):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),g(E))}function f(E){return E===62?(e.enter(i),e.consume(E),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===62?(e.exit("chunkString"),e.exit(u),f(E)):E===null||E===60||Q(E)?n(E):(e.consume(E),E===92?x:p)}function x(E){return E===60||E===62||E===92?(e.consume(E),p):p(E)}function g(E){return!m&&(E===null||E===41||Ie(E))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(E)):m<d&&E===40?(e.consume(E),m++,g):E===41?(e.consume(E),m--,g):E===null||E===32||E===40||Wr(E)?n(E):(e.consume(E),E===92?y:g)}function y(E){return E===40||E===41||E===92?(e.consume(E),g):g(E)}}function Ha(e,t,n,r,o,i){const a=this;let u=0,c;return d;function d(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),m}function m(p){return u>999||p===null||p===91||p===93&&!c||p===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):Q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||Q(p)||u++>999?(e.exit("chunkString"),m(p)):(e.consume(p),c||(c=!he(p)),p===92?f:h)}function f(p){return p===91||p===92||p===93?(e.consume(p),u++,h):h(p)}}function Ua(e,t,n,r,o,i){let a;return u;function u(f){return f===34||f===39||f===40?(e.enter(r),e.enter(o),e.consume(f),e.exit(o),a=f===40?41:f,c):n(f)}function c(f){return f===a?(e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):(e.enter(i),d(f))}function d(f){return f===a?(e.exit(i),c(a)):f===null?n(f):Q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),fe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(f))}function m(f){return f===a||f===null||Q(f)?(e.exit("chunkString"),d(f)):(e.consume(f),f===92?h:m)}function h(f){return f===a||f===92?(e.consume(f),m):m(f)}}function Qn(e,t){let n;return r;function r(o){return Q(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):he(o)?fe(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const o2={name:"definition",tokenize:a2},i2={partial:!0,tokenize:u2};function a2(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return Ha.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function u(p){return o=mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Ie(p)?Qn(e,d)(p):d(p)}function d(p){return Fa(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function m(p){return e.attempt(i2,h,h)(p)}function h(p){return he(p)?fe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Q(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function u2(e,t,n){return r;function r(u){return Ie(u)?Qn(e,o)(u):n(u)}function o(u){return Ua(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return he(u)?fe(e,a,"whitespace")(u):a(u)}function a(u){return u===null||Q(u)?t(u):n(u)}}const l2={name:"hardBreakEscape",tokenize:c2};function c2(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Q(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const d2={name:"headingAtx",resolve:h2,tokenize:m2};function h2(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ke(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function m2(e,t,n){let r=0;return o;function o(m){return e.enter("atxHeading"),i(m)}function i(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||Ie(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||Q(m)?(e.exit("atxHeading"),t(m)):he(m)?fe(e,u,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),u(m))}function d(m){return m===null||m===35||Ie(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),d)}}const p2=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],di=["pre","script","style","textarea"],f2={concrete:!0,name:"htmlFlow",resolveTo:E2,tokenize:b2},g2={partial:!0,tokenize:T2},x2={partial:!0,tokenize:I2};function E2(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function b2(e,t,n){const r=this;let o,i,a,u,c;return d;function d(S){return m(S)}function m(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),h}function h(S){return S===33?(e.consume(S),f):S===47?(e.consume(S),i=!0,g):S===63?(e.consume(S),o=3,r.interrupt?t:T):ze(S)?(e.consume(S),a=String.fromCharCode(S),y):n(S)}function f(S){return S===45?(e.consume(S),o=2,p):S===91?(e.consume(S),o=5,u=0,x):ze(S)?(e.consume(S),o=4,r.interrupt?t:T):n(S)}function p(S){return S===45?(e.consume(S),r.interrupt?t:T):n(S)}function x(S){const de="CDATA[";return S===de.charCodeAt(u++)?(e.consume(S),u===de.length?r.interrupt?t:D:x):n(S)}function g(S){return ze(S)?(e.consume(S),a=String.fromCharCode(S),y):n(S)}function y(S){if(S===null||S===47||S===62||Ie(S)){const de=S===47,Ae=a.toLowerCase();return!de&&!i&&di.includes(Ae)?(o=1,r.interrupt?t(S):D(S)):p2.includes(a.toLowerCase())?(o=6,de?(e.consume(S),E):r.interrupt?t(S):D(S)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):i?R(S):C(S))}return S===45||Fe(S)?(e.consume(S),a+=String.fromCharCode(S),y):n(S)}function E(S){return S===62?(e.consume(S),r.interrupt?t:D):n(S)}function R(S){return he(S)?(e.consume(S),R):N(S)}function C(S){return S===47?(e.consume(S),N):S===58||S===95||ze(S)?(e.consume(S),P):he(S)?(e.consume(S),C):N(S)}function P(S){return S===45||S===46||S===58||S===95||Fe(S)?(e.consume(S),P):L(S)}function L(S){return S===61?(e.consume(S),A):he(S)?(e.consume(S),L):C(S)}function A(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),c=S,z):he(S)?(e.consume(S),A):G(S)}function z(S){return S===c?(e.consume(S),c=null,K):S===null||Q(S)?n(S):(e.consume(S),z)}function G(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Ie(S)?L(S):(e.consume(S),G)}function K(S){return S===47||S===62||he(S)?C(S):n(S)}function N(S){return S===62?(e.consume(S),H):n(S)}function H(S){return S===null||Q(S)?D(S):he(S)?(e.consume(S),H):n(S)}function D(S){return S===45&&o===2?(e.consume(S),Z):S===60&&o===1?(e.consume(S),W):S===62&&o===4?(e.consume(S),ce):S===63&&o===3?(e.consume(S),T):S===93&&o===5?(e.consume(S),ue):Q(S)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(g2,je,$)(S)):S===null||Q(S)?(e.exit("htmlFlowData"),$(S)):(e.consume(S),D)}function $(S){return e.check(x2,Y,je)(S)}function Y(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),q}function q(S){return S===null||Q(S)?$(S):(e.enter("htmlFlowData"),D(S))}function Z(S){return S===45?(e.consume(S),T):D(S)}function W(S){return S===47?(e.consume(S),a="",V):D(S)}function V(S){if(S===62){const de=a.toLowerCase();return di.includes(de)?(e.consume(S),ce):D(S)}return ze(S)&&a.length<8?(e.consume(S),a+=String.fromCharCode(S),V):D(S)}function ue(S){return S===93?(e.consume(S),T):D(S)}function T(S){return S===62?(e.consume(S),ce):S===45&&o===2?(e.consume(S),T):D(S)}function ce(S){return S===null||Q(S)?(e.exit("htmlFlowData"),je(S)):(e.consume(S),ce)}function je(S){return e.exit("htmlFlow"),t(S)}}function I2(e,t,n){const r=this;return o;function o(a){return Q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function T2(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(mr,t,n)}}const _2={name:"htmlText",tokenize:C2};function C2(e,t,n){const r=this;let o,i,a;return u;function u(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),L):T===63?(e.consume(T),C):ze(T)?(e.consume(T),G):n(T)}function d(T){return T===45?(e.consume(T),m):T===91?(e.consume(T),i=0,x):ze(T)?(e.consume(T),R):n(T)}function m(T){return T===45?(e.consume(T),p):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),f):Q(T)?(a=h,W(T)):(e.consume(T),h)}function f(T){return T===45?(e.consume(T),p):h(T)}function p(T){return T===62?Z(T):T===45?f(T):h(T)}function x(T){const ce="CDATA[";return T===ce.charCodeAt(i++)?(e.consume(T),i===ce.length?g:x):n(T)}function g(T){return T===null?n(T):T===93?(e.consume(T),y):Q(T)?(a=g,W(T)):(e.consume(T),g)}function y(T){return T===93?(e.consume(T),E):g(T)}function E(T){return T===62?Z(T):T===93?(e.consume(T),E):g(T)}function R(T){return T===null||T===62?Z(T):Q(T)?(a=R,W(T)):(e.consume(T),R)}function C(T){return T===null?n(T):T===63?(e.consume(T),P):Q(T)?(a=C,W(T)):(e.consume(T),C)}function P(T){return T===62?Z(T):C(T)}function L(T){return ze(T)?(e.consume(T),A):n(T)}function A(T){return T===45||Fe(T)?(e.consume(T),A):z(T)}function z(T){return Q(T)?(a=z,W(T)):he(T)?(e.consume(T),z):Z(T)}function G(T){return T===45||Fe(T)?(e.consume(T),G):T===47||T===62||Ie(T)?K(T):n(T)}function K(T){return T===47?(e.consume(T),Z):T===58||T===95||ze(T)?(e.consume(T),N):Q(T)?(a=K,W(T)):he(T)?(e.consume(T),K):Z(T)}function N(T){return T===45||T===46||T===58||T===95||Fe(T)?(e.consume(T),N):H(T)}function H(T){return T===61?(e.consume(T),D):Q(T)?(a=H,W(T)):he(T)?(e.consume(T),H):K(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,$):Q(T)?(a=D,W(T)):he(T)?(e.consume(T),D):(e.consume(T),Y)}function $(T){return T===o?(e.consume(T),o=void 0,q):T===null?n(T):Q(T)?(a=$,W(T)):(e.consume(T),$)}function Y(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Ie(T)?K(T):(e.consume(T),Y)}function q(T){return T===47||T===62||Ie(T)?K(T):n(T)}function Z(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function W(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),V}function V(T){return he(T)?fe(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ue(T)}function ue(T){return e.enter("htmlTextData"),a(T)}}const go={name:"labelEnd",resolveAll:R2,resolveTo:A2,tokenize:N2},S2={tokenize:w2},y2={tokenize:L2},k2={tokenize:j2};function R2(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Ke(e,0,e.length,n),e}function A2(e,t){let n=e.length,r=0,o,i,a,u;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const c={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",c,t],["enter",d,t]],u=tt(u,e.slice(i+1,i+r+3)),u=tt(u,[["enter",m,t]]),u=tt(u,Jr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),u=tt(u,[["exit",m,t],e[a-2],e[a-1],["exit",d,t]]),u=tt(u,e.slice(a+1)),u=tt(u,[["exit",c,t]]),Ke(e,i,e.length,u),e}function N2(e,t,n){const r=this;let o=r.events.length,i,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return u;function u(f){return i?i._inactive?h(f):(a=r.parser.defined.includes(mt(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(S2,m,a?m:h)(f):f===91?e.attempt(y2,m,a?d:h)(f):a?m(f):h(f)}function d(f){return e.attempt(k2,m,h)(f)}function m(f){return t(f)}function h(f){return i._balanced=!0,n(f)}}function w2(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Ie(h)?Qn(e,i)(h):i(h)}function i(h){return h===41?m(h):Fa(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Ie(h)?Qn(e,c)(h):m(h)}function u(h){return n(h)}function c(h){return h===34||h===39||h===40?Ua(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return Ie(h)?Qn(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function L2(e,t,n){const r=this;return o;function o(u){return Ha.call(r,e,i,a,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function j2(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const v2={name:"labelStartImage",resolveAll:go.resolveAll,tokenize:P2};function P2(e,t,n){const r=this;return o;function o(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),i}function i(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const D2={name:"labelStartLink",resolveAll:go.resolveAll,tokenize:O2};function O2(e,t,n){const r=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ys={name:"lineEnding",tokenize:B2};function B2(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),fe(e,t,"linePrefix")}}const Mr={name:"thematicBreak",tokenize:M2};function M2(e,t,n){let r=0,o;return i;function i(d){return e.enter("thematicBreak"),a(d)}function a(d){return o=d,u(d)}function u(d){return d===o?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||Q(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===o?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),he(d)?fe(e,u,"whitespace")(d):u(d))}}const Ve={continuation:{tokenize:$2},exit:W2,name:"list",tokenize:U2},F2={partial:!0,tokenize:q2},H2={partial:!0,tokenize:z2};function U2(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return u;function u(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Gs(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Mr,n,d)(p):d(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Gs(p)&&++a<10?(e.consume(p),c):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),d(p)):n(p)}function d(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(mr,r.interrupt?n:m,e.attempt(F2,f,h))}function m(p){return r.containerState.initialBlankLine=!0,i++,f(p)}function h(p){return he(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function $2(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mr,o,i);function o(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,fe(e,t,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!he(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(H2,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,fe(e,e.attempt(Ve,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function z2(e,t,n){const r=this;return fe(e,o,"listItemIndent",r.containerState.size+1);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function W2(e){e.exit(this.containerState.type)}function q2(e,t,n){const r=this;return fe(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const a=r.events[r.events.length-1];return!he(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const hi={name:"setextUnderline",resolveTo:V2,tokenize:G2};function V2(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function G2(e,t,n){const r=this;let o;return i;function i(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===o?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),he(d)?fe(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||Q(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Y2={tokenize:X2};function X2(e){const t=this,n=e.attempt(mr,r,e.attempt(this.parser.constructs.flowInitial,o,fe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(e2,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Q2={resolveAll:za()},K2=$a("string"),Z2=$a("text");function $a(e){return{resolveAll:za(e==="text"?J2:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,a,u);return a;function a(m){return d(m)?i(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),c}function c(m){return d(m)?(n.exit("data"),i(m)):(n.consume(m),c)}function d(m){if(m===null)return!0;const h=o[m];let f=-1;if(h)for(;++f<h.length;){const p=h[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function za(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function J2(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,a=-1,u=0,c;for(;i--;){const d=o[i];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)c=!0,u++;else if(d!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const ex={42:Ve,43:Ve,45:Ve,48:Ve,49:Ve,50:Ve,51:Ve,52:Ve,53:Ve,54:Ve,55:Ve,56:Ve,57:Ve,62:Da},tx={91:o2},nx={[-2]:Ss,[-1]:Ss,32:Ss},rx={35:d2,42:Mr,45:[hi,Mr],60:f2,61:hi,95:Mr,96:ci,126:ci},sx={38:Ba,92:Oa},ox={[-5]:ys,[-4]:ys,[-3]:ys,33:v2,38:Ba,42:Ys,60:[Dg,_2],91:D2,92:[l2,Oa],93:go,95:Ys,96:Yg},ix={null:[Ys,Q2]},ax={null:[42,95]},ux={null:[]},lx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ax,contentInitial:tx,disable:ux,document:ex,flow:rx,flowInitial:nx,insideSpan:ix,string:sx,text:ox},Symbol.toStringTag,{value:"Module"}));function cx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],u=[];const c={attempt:z(L),check:z(A),consume:R,enter:C,exit:P,interrupt:z(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:g,events:[],now:x,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:h};let m=t.tokenize.call(d,c);return t.resolveAll&&i.push(t),d;function h(H){return a=tt(a,H),y(),a[a.length-1]!==null?[]:(G(t,0),d.events=Jr(i,d.events,d),d.events)}function f(H,D){return hx(p(H),D)}function p(H){return dx(a,H)}function x(){const{_bufferIndex:H,_index:D,line:$,column:Y,offset:q}=r;return{_bufferIndex:H,_index:D,line:$,column:Y,offset:q}}function g(H){o[H.line]=H.column,N()}function y(){let H;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<D.length;)E(D.charCodeAt(r._bufferIndex));else E(D)}}function E(H){m=m(H)}function R(H){Q(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,N()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function C(H,D){const $=D||{};return $.type=H,$.start=x(),d.events.push(["enter",$,d]),u.push($),$}function P(H){const D=u.pop();return D.end=x(),d.events.push(["exit",D,d]),D}function L(H,D){G(H,D.from)}function A(H,D){D.restore()}function z(H,D){return $;function $(Y,q,Z){let W,V,ue,T;return Array.isArray(Y)?je(Y):"tokenize"in Y?je([Y]):ce(Y);function ce(J){return Be;function Be(st){const Dt=st!==null&&J[st],kt=st!==null&&J.null,Yt=[...Array.isArray(Dt)?Dt:Dt?[Dt]:[],...Array.isArray(kt)?kt:kt?[kt]:[]];return je(Yt)(st)}}function je(J){return W=J,V=0,J.length===0?Z:S(J[V])}function S(J){return Be;function Be(st){return T=K(),ue=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?Ae():J.tokenize.call(D?Object.assign(Object.create(d),D):d,c,de,Ae)(st)}}function de(J){return H(ue,T),q}function Ae(J){return T.restore(),++V<W.length?S(W[V]):Z}}}function G(H,D){H.resolveAll&&!i.includes(H)&&i.push(H),H.resolve&&Ke(d.events,D,d.events.length-D,H.resolve(d.events.slice(D),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function K(){const H=x(),D=d.previous,$=d.currentConstruct,Y=d.events.length,q=Array.from(u);return{from:Y,restore:Z};function Z(){r=H,d.previous=D,d.currentConstruct=$,d.events.length=Y,u=q,N()}}function N(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function dx(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function hx(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
101
|
+
linear-gradient(to right, hsl(${Z}, 100%, 100%), hsl(${Z}, 100%, 50%))
|
|
102
|
+
`},children:s.jsxRuntimeExports.jsx("div",{className:ae.indicator,style:{position:"absolute",left:`${Be}%`,top:`${100-st}%`,transform:"translate(-50%, -50%)"}})}),s.jsxRuntimeExports.jsx("div",{className:ae.hueSlider,style:{bottom:E?"175px":"100px"},children:s.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:Z,onChange:oe=>{const J=Number(oe.target.value);E?$===1?ue(J,i,a,u):ue(J,A,z,G):(m(J),ue(J,i,a,u))},className:ae.slider})}),s.jsxRuntimeExports.jsxs("div",{className:ae.alphaSlider,style:{bottom:E?"150px":"75px"},children:[s.jsxRuntimeExports.jsx("div",{className:ae.alphaBackground}),s.jsxRuntimeExports.jsx("div",{className:ae.alphaGradient,style:{background:us}}),s.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:Dt,onChange:oe=>{const J=Number(oe.target.value);E?$===1?ue(o,i,a,J):ue(L,A,z,J):(p(J),ue(o,i,a,J))},className:ae.slider})]}),E&&q&&s.jsxRuntimeExports.jsxs("div",{className:ae.gradientWrapper,children:[s.jsxRuntimeExports.jsx("h3",{className:ae.subtitle,children:"Rotation"}),s.jsxRuntimeExports.jsx("div",{className:ae.gradient,children:s.jsxRuntimeExports.jsxs("div",{className:ae.chargeTypes,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.charge,{[ae.chargeActive]:C==="horizontal"}),onClick:()=>P("horizontal"),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),s.jsxRuntimeExports.jsxs("div",{className:s.clx(ae.charge,{[ae.chargeActive]:C==="vertical"}),onClick:()=>P("vertical"),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),s.jsxRuntimeExports.jsxs("div",{className:ae.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:Ae,className:s.clx(ae.applyButton,ae.cancelButton),type:"Secondary",children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:de,className:ae.applyButton,children:"Apply"})]})]})},g0=()=>{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:m}=s.useDeviceStore(),{isLoadingThemeSettings:h}=s.useThemeSettingsStore(),{isLoadingLayers:f}=s.useLayersStore(),p=C=>C?!u||!u[C]?s.jsxRuntimeExports.jsx(s.ErrorableBlock,{error:`Block "${C}" does not exist in blocks.`}):new u[C]().renderPreview(a,c):s.jsxRuntimeExports.jsx(s.ErrorableBlock,{error:"Block or block.name is undefined."});function x(){if(m.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const C=m.value==="tablet"?768:425;return t>=1?`${C}px`:`${(C*t).toFixed(2)}px`}}function g(){switch(m.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:y}=s.usePagesStore(),E=k.useRef(null),R=C=>{E.current&&(E.current.scrollTop+=C.deltaY)};return s.jsxRuntimeExports.jsxs("div",{className:Mn.preview,style:{zIndex:d&&!y?5e3:500},onWheel:C=>{C.stopPropagation(),R(C)},children:[o&&s.jsxRuntimeExports.jsx(Md,{children:s.jsxRuntimeExports.jsx(ha,{})}),s.jsxRuntimeExports.jsxs(Bd,{positionTop:i,positionLeft:!r&&n?void 0:250,children:[!h&&!f&&s.jsxRuntimeExports.jsx(s.RenderBlock,{render:p,block:n},n),(h||!n||f)&&s.jsxRuntimeExports.jsx("div",{className:Mn.previewLoading,children:s.jsxRuntimeExports.jsx(Vt,{})})]}),d&&s.jsxRuntimeExports.jsx(f0,{}),e&&s.jsxRuntimeExports.jsxs("div",{className:Mn.main,style:{width:g()},children:[s.jsxRuntimeExports.jsx(Nd,{}),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:C=>{C.stopPropagation()},onWheel:C=>{C.stopPropagation()},children:!h&&!f?s.jsxRuntimeExports.jsx("div",{className:Mn.content,style:{width:x()},children:s.jsxRuntimeExports.jsx(s.PreviewContent,{scrollableRef:E})}):s.jsxRuntimeExports.jsx("div",{className:Mn.loading,children:s.jsxRuntimeExports.jsx(Vt,{})})})]})]})},x0="_sidebar_1xtkj_1",E0="_title_1xtkj_11",Fo={sidebar:x0,title:E0},b0="_layers_1jhzw_1",I0="_wrapper_1jhzw_9",T0="_draggingWrapper_1jhzw_17",_0="_block_1jhzw_21",C0="_dragging_1jhzw_17",S0="_active_1jhzw_56",y0="_add_1jhzw_63",k0="_addTop_1jhzw_79",R0="_visible_1jhzw_95",A0="_button_1jhzw_99",N0="_nameBlock_1jhzw_158",w0="_loader_1jhzw_162",L0="_actions_1jhzw_171",j0="_deleteButton_1jhzw_179",Me={layers:b0,wrapper:I0,draggingWrapper:T0,block:_0,dragging:C0,active:S0,add:y0,addTop:k0,visible:R0,button:A0,nameBlock:N0,loader:w0,actions:L0,deleteButton:j0},v0="_block_sj4cc_1",P0="_title_sj4cc_17",D0="_actions_sj4cc_21",Qt={block:v0,title:P0,actions:D0},ps={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:[rr[ps[e]]?s.jsxRuntimeExports.jsx("img",{src:rr[ps[e]],width:20,height:20}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Cards",width:20,height:20}),s.jsxRuntimeExports.jsx("span",{className:Qt.title,children:ps[e]}),s.jsxRuntimeExports.jsx("div",{className:Qt.actions,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},O0=({id:e,name:t,onClick:n,isDragging:r,icon:o})=>{const{activeBlock:i,setActiveBlock:a}=s.usePreviewStore(),{showPreview:u,hidePreview:c,showModal:d,hideModal:m,clearHideTimeout:h,startHideTimeout:f,hoverBlockId:p,isModalVisible:x}=s.useSubmodalStore(),{setPositionBlock:g}=s.useLayersStore(),[y,E]=k.useState(!1),[R,C]=k.useState(!1),[P,L]=k.useState(!1),[A,z]=k.useState(!1),[G,K]=k.useState(null),N=k.useRef(null),{attributes:H,listeners:D,setNodeRef:$,transform:Y,transition:q}=s.useSortable({id:e}),ee={transform:s.CSS.Transform.toString(Y),transition:q},{setTitle:W,setDescription:V,setOnConfirm:ue}=s.useConfirmationModalStore(),{pages:T,currentPage:ce}=s.usePagesStore(),{removeBlock:je}=s.useLayersStore(),S=Z=>{Z.stopPropagation(),N.current&&clearTimeout(N.current),a({id:e,neededScroll:!0}),x&&m(),u(e),h()},de=(Z,Be=!0)=>{Z.stopPropagation(),c(),d(e),h(),g(e,Be)},Ae=Z=>{Z.stopPropagation(),a({id:null,neededScroll:!1}),x?f():c()};return k.useEffect(()=>{L(!1),E(!1),C(!1),z(!1)},[r]),k.useEffect(()=>{x||(C(!1),E(!1))},[x]),s.jsxRuntimeExports.jsxs("div",{ref:$,style:ee,className:s.clx(Me.wrapper,{[Me.draggingWrapper]:r&&i.id===e}),onClick:Z=>{Z.stopPropagation(),n(e)},onMouseEnter:S,onMouseLeave:Ae,...H,...D,children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(Me.block,{[Me.dragging]:r&&i.id===e,[Me.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:Me.nameBlock,children:t}),p===e&&!r&&s.jsxRuntimeExports.jsx("div",{className:s.clx(Me.addTop,{[Me.visible]:R}),onMouseEnter:()=>{C(!0)},onMouseLeave:()=>{C(!1)},children:s.jsxRuntimeExports.jsxs("button",{className:Me.button,onClick:Z=>de(Z,!1),onMouseEnter:()=>{const Z=setTimeout(()=>{r||z(!0)},200);K(Z)},onMouseLeave:()=>{G&&clearTimeout(G),z(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#fff"}),A&&s.jsxRuntimeExports.jsx(_n,{text:"Click to add a section"})]})}),p===e&&!r&&s.jsxRuntimeExports.jsx("div",{className:s.clx(Me.add,{[Me.visible]:y}),onMouseEnter:()=>{E(!0)},onMouseLeave:()=>{E(!1)},children:s.jsxRuntimeExports.jsxs("button",{className:Me.button,onClick:Z=>de(Z),onMouseEnter:()=>{const Z=setTimeout(()=>{r||L(!0)},200);K(Z)},onMouseLeave:()=>{G&&clearTimeout(G),L(!1)},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Plus",fill:"#fff"}),P&&s.jsxRuntimeExports.jsx(_n,{text:"Click to add a section"})]})})]}),p===e&&!r&&s.jsxRuntimeExports.jsxs("div",{className:Me.actions,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),s.jsxRuntimeExports.jsx("div",{className:Me.deleteButton,onClick:Z=>{Z.stopPropagation(),W("Remove Block"),V(`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.`),ue(()=>{T&&je(T[ce].path,e)})},children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},B0=()=>{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:m}=s.useBlocksStore();function h(E){t(E),c(!1),d(null)}const f=s.useSensors(s.useSensor(s.PointerSensor,{activationConstraint:{distance:5}})),[p,x]=k.useState(!1),g=()=>{x(!0)},y=E=>{x(!1);const{active:R,over:C}=E;if(C&&R.id!==C.id&&u&&u[a]){const P=u[a].path,L=e[P].order,A=L.indexOf(R.id),z=L.indexOf(C.id);A!==-1&&z!==-1&&r(P,A,z)}};return s.jsxRuntimeExports.jsx("div",{className:Me.layers,children:o?s.jsxRuntimeExports.jsx("div",{className:Me.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:y,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((E,R)=>s.jsxRuntimeExports.jsx(O0,{id:E,name:s.getDisplayName(e[u[a].path].data[E].name,m),index:R,onClick:h,isDragging:p,icon:rr[e[u[a].path].data[E].name]},E))})}),s.jsxRuntimeExports.jsx(fs,{id:"footer"})]})})},M0="_loader_eyvkk_1",F0={loader:M0},H0=()=>{const{isLoadingSettings:e}=s.useSettingsStore();return e?s.jsxRuntimeExports.jsx("div",{className:F0.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):s.jsxRuntimeExports.jsx(U0,{})},U0=()=>{const{settings:e}=s.useSettingsStore(),{settings:t,setSettingsInstance:n}=s.useBlocksStore();if(!e)return null;const{setError:r}=s.useErrorStore(),o=new t(e);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}},$0="_theme_a1one_1",z0="_block_a1one_8",W0="_name_a1one_23",q0="_loader_a1one_27",Cr={theme:$0,block:z0,name:W0,loader:q0},V0=()=>{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:Cr.theme,children:t?s.jsxRuntimeExports.jsx("div",{className:Cr.loader,children:s.jsxRuntimeExports.jsx(Vt,{})}):dt.map(o=>s.jsxRuntimeExports.jsxs("div",{onClick:()=>r(o),className:s.clx(Cr.block),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:o.icon}),s.jsxRuntimeExports.jsx("span",{className:Cr.name,children:o.name}),s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretRight"})]},o.icon))})},G0="_render_7e826_9",Y0="_open_7e826_24",X0="_close_7e826_51",Q0="_clicked_7e826_55",K0="_loading_7e826_72",Z0="_settings_7e826_76",dn={render:G0,open:Y0,close:X0,clicked:Q0,loading:K0,settings:Z0},J0=({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}},eh="_wrapper_15ju8_1",th="_header_15ju8_8",nh="_title_15ju8_15",rh="_colorWrapper_15ju8_21",sh="_name_15ju8_35",oh="_color_15ju8_21",ih="_value_15ju8_47",ah="_length_15ju8_51",et={wrapper:eh,header:th,title:nh,colorWrapper:rh,name:sh,color:oh,value:ih,length:ah},uh=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("-"),m=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c.charAt(0).toUpperCase()+c.slice(1)}`,[h,f]=u.split("-");return{name:m,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:m}=u;return s.jsxRuntimeExports.jsx(lh,{color:n.colors[m][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"]})]})]})},lh=e=>{const{name:t,color:n}=e,{setActiveLabel:r,setModalPosition:o,setInitialColor:i,setShowModal:a,setUpdate:u,setColor:c,setColorChange:d,colorChange:m,setIsGradientActive:h}=s.useColorPickerStore(),{updateColor:f}=s.useThemeSettingsStore(),p=(y,E)=>R=>{f(y,E,R)};k.useEffect(()=>{const y=()=>{a(!1),r(null),i(n),u(()=>{}),c(n),d(()=>{})};return document.body.addEventListener("click",y),()=>{document.body.removeEventListener("click",y)}},[]);const x=y=>{const E=t.split("/")[0],R=E.split(" ")[0].toLowerCase(),C=E.split(" ")[1].toLowerCase();y.stopPropagation(),a(!0),d(m),u(A=>p(C,R)(A)),i(n),c(n),h(C==="surface");const{top:P,left:L}=da(y,550,288,10,20,230,80);o({top:C==="surface"?P:P+125,left:L-200})};function g(y){return y.length>15?y.slice(0,15)+"...":y}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)})]})},ch="_back_1sznl_1",dh="_title_1sznl_9",hh="_deleteButton_1sznl_17",mh="_backIcon_1sznl_30",Sr={back:ch,title:dh,deleteButton:hh,backIcon:mh},ph=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var f,p;const{activeBlock:r}=s.useBlocksStore(),{setTitle:o,setDescription:i,setOnConfirm:a}=s.useConfirmationModalStore(),{blocks:u,currentBlock:c,removeBlock:d}=s.useLayersStore(),{currentPage:m,pages:h}=s.usePagesStore();return s.jsxRuntimeExports.jsxs("div",{className:Sr.back,children:[s.jsxRuntimeExports.jsx("div",{className:Sr.backIcon,onClick:()=>e(),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),s.jsxRuntimeExports.jsx("h3",{className:Sr.title,children:r&&n(r)||h&&h[m]&&u[h[m].path]&&c&&n((f=u[h[m].path].data[c])==null?void 0:f.name)||c&&Ct(c)||"Loading"}),c&&h&&!["header","footer","announcement"].includes(c)&&u[h[m].path].data[c]&&n((p=u[h[m].path].data[c])==null?void 0:p.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[m].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[m].path,c),e(!0)})},className:Sr.deleteButton,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},fh=()=>{const e=s.useNavigate(),[t,n]=k.useState(!1),{header:r,footer:o,announcement:i,sourceBlocks:a,activeBlock:u,setActiveBlock:c,currentInstance:d,setCurrentInstance:m}=s.useBlocksStore(),{setActiveBlock:h}=s.usePreviewStore(),{blocks:f,addBlock:p,editBlock:x,currentBlock:g,setCurrentBlock:y,header:E,footer:R,announcement:C,isLoadingLayers:P}=s.useLayersStore(),{currentPage:L,pages:A}=s.usePagesStore(),{past:z,future:G}=s.useHistoryStore();function K(D=!1){if(A&&d&&g&&!["header","footer","announcement"].includes(g)&&!D){const $={blockSettings:{}};Object.keys(d.blockSettings).filter(Y=>!["displayName","isAddable"].includes(Y)).map(Y=>{$.blockSettings[Y]=d.blockSettings[Y]}),x(A[L].path,g,{name:f[A[L].path].data[g].name,value:$})}c(null),y(null),h({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),m(null)}function N(D){var ee;if(!A||!L||!D)return null;if(D==="header"){const W=new r;return Object.keys(W.blockSettings).forEach(V=>{W.blockSettings[V]=E==null?void 0:E.blockSettings[V]}),Object.keys(W.blockColors).forEach(V=>{W.blockColors[V]=E==null?void 0:E.blockColors[V]}),W}if(D==="footer"){const W=new o;return Object.keys(W.blockSettings).forEach(V=>{W.blockSettings[V]=R==null?void 0:R.blockSettings[V]}),Object.keys(W.blockColors).forEach(V=>{W.blockColors[V]=R==null?void 0:R.blockColors[V]}),W}if(D==="announcement"){const W=new i;return Object.keys(W.blockSettings).forEach(V=>{W.blockSettings[V]=C==null?void 0:C.blockSettings[V]}),Object.keys(W.blockColors).forEach(V=>{W.blockColors[V]=C==null?void 0:C.blockColors[V]}),W}const $=f[A[L].path];if(!$||!$.data[D])return null;const Y=$.data[D];return!Y||!a[Y.name]?null:new a[Y.name]((ee=Y.value)==null?void 0:ee.blockSettings)}k.useEffect(()=>{if(g){const D=N(g);m(D)}else m(null)},[g,z,G,u]),k.useEffect(()=>{if(u&&A&&!g){const D={blockSettings:{},blockColors:{}},$=new a[u];m($),Object.keys($.blockSettings).filter(q=>!["displayName","isAddable"].includes(q)).map(q=>{D.blockSettings[q]=$.blockSettings[q]}),Object.keys($.blockColors).filter(q=>!["displayName","isAddable"].includes(q)).map(q=>{D.blockColors[q]=$.blockColors[q]});const Y=p(A[L].path,{name:u,value:D});h({id:Y,neededScroll:!0}),y(Y),e("/admin/builder")}},[u,z,G]);function H(D){if(!a)return"unknown name";if(!a[D])return g==="header"?E==null?void 0:E.blockSettings.displayName:g==="footer"?R==null?void 0:R.blockSettings.displayName:g==="announcement"?C==null?void 0:C.blockSettings.displayName:"unknown name";const $=new a[D];return!$.blockSettings||!$.blockSettings.displayName?"unknown name":$.blockSettings.displayName}return s.jsxRuntimeExports.jsxs("div",{className:s.clx(dn.render,{[dn.open]:g,[dn.close]:!g,[dn.clicked]:t}),onClick:D=>D.stopPropagation(),style:{opacity:P?0:1},children:[s.jsxRuntimeExports.jsx(ph,{onClick:K,setIsClicked:n,getDisplayName:H}),s.jsxRuntimeExports.jsxs("div",{className:dn.settings,children:[d&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(J0,{block:d}),s.jsxRuntimeExports.jsx(uh,{colors:d.blockColors})]}),!u&&!g&&s.jsxRuntimeExports.jsx("div",{className:dn.loading,children:"Loading"})]})]})},gh="_header_9rrfr_1",xh="_title_9rrfr_9",Eh="_backIcon_9rrfr_15",gs={header:gh,title:xh,backIcon:Eh},ur=({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})]}),bh="_options_ymds7_1",Ih={options:bh},Th="_wrapper_kzokw_1",_h="_open_kzokw_16",Ch="_close_kzokw_20",xs={wrapper:Th,open:_h,close:Ch},lr=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})},Sh=()=>{var d,m;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(lr,{isOpen:c,isClose:!c,children:[s.jsxRuntimeExports.jsx(ur,{onClick:a,title:"Borders Style"}),s.jsxRuntimeExports.jsxs("div",{className:Ih.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:((m=Object.entries(cs).find(([h,f])=>f===u.thickness))==null?void 0:m[0])||"None",onChange:h=>o(cs[h],"thickness")})]})]})},yh="_options_jo38w_1",kh="_alignments_jo38w_9",Rh="_blocks_jo38w_15",Ah="_alignment_jo38w_9",Nh="_active_jo38w_34",wh="_chargeTypes_jo38w_41",Lh="_charge_jo38w_41",jh="_chargeActive_jo38w_69",vh="_sliderContainer_jo38w_83",Ph="_shadowInputs_jo38w_91",Dh="_label_jo38w_102",Oh="_shadowInputsRow_jo38w_111",Bh="_shadowInputsOpen_jo38w_119",We={options:yh,alignments:kh,blocks:Rh,alignment:Ah,active:Nh,chargeTypes:wh,charge:Lh,chargeActive:jh,sliderContainer:vh,shadowInputs:Ph,label:Dh,shadowInputsRow:Oh,shadowInputsOpen:Bh};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:m,setShowModal:h,setUpdate:f,setColor:p,setColorChange:x,setIsGradientActive:g,colorChange:y}=s.useColorPickerStore();k.useEffect(()=>{const P=()=>{h(!1),c(null),m(t),f(()=>{}),p(t),x(()=>{})};return document.body.addEventListener("click",P),()=>{document.body.removeEventListener("click",P)}},[t]);const E=P=>{P.stopPropagation(),h(!0),x(u),f(n),m(t),p(a),g(i);const{top:L,left:A}=da(P,600,288,10,20,230,80);d({top:L,left:A})},R=P=>{const L=P.target.value;u(L),Es(L)&&(n(L),p(L),x(y))},C=()=>{Es(a)||u(t)};return s.jsxRuntimeExports.jsxs("div",{className:ae.content,children:[s.jsxRuntimeExports.jsx("span",{className:s.clx(ae.name,{[ae.secondary]:o==="secondary"}),children:r}),s.jsxRuntimeExports.jsxs("label",{className:ae.label,onClick:P=>P.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:ae.colorValue,style:{background:Es(a)?a:t},onClick:E}),s.jsxRuntimeExports.jsx("input",{type:"text",value:a.includes("linear-gradient")?a:a.toUpperCase(),onChange:R,onBlur:C,className:ae.input,style:{textTransform:a.includes("linear-gradient")?"none":"uppercase"}})]})]})},Mh=["left","center","right"],Fh=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:r}=s.useThemeSettingsStore(),{fonts:o}=s.useFontsStore(),[i,a]=k.useState("primary");function u(g,y){n(i,y,g)}const[c,d]=k.useState(!1),m=t.buttons[i],h=s.useNavigate();function f(){r(null),h("/admin/builder/theme")}const p=(e==null?void 0:e.name)==="Buttons";function x(g,y){u({...m.boxShadow,[g]:y},"boxShadow")}return s.jsxRuntimeExports.jsxs(lr,{isOpen:p,isClose:!p,children:[s.jsxRuntimeExports.jsx(ur,{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))}),m&&s.jsxRuntimeExports.jsxs("div",{className:We.options,children:[s.jsxRuntimeExports.jsx(s.Input,{label:"Height (px)",value:String(m.height),onChange:g=>u(Number(g),"height"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font Size (px)",value:String(m.size),onChange:g=>u(Number(g),"size"),options:$r}),s.jsxRuntimeExports.jsx(s.Input,{label:"Border Radius (px)",value:String(m.radius),onChange:g=>u(Number(g),"radius"),type:"number",min:0}),s.jsxRuntimeExports.jsx(s.Select,{label:"Font",value:m.font,onChange:g=>u(g,"font"),options:[...o.filter(g=>g.name!==m.font).map(g=>g.name)]}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.color,onChange:g=>u(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.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(m.boxShadow.left),onChange:g=>x("left",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Top (px)",value:String(m.boxShadow.top),onChange:g=>x("top",Number(g)),type:"number"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Blur (px)",value:String(m.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(m.boxShadow.spread),onChange:g=>x("spread",Number(g)),type:"number"})})]}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.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:Mh.map(g=>s.jsxRuntimeExports.jsx("div",{className:s.clx(We.alignment,{[We.active]:m.alignment===g}),onClick:()=>{u(g,"alignment")},children:s.jsxRuntimeExports.jsx(s.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:m.alignment===g?"#252525":"#757575"})},g))})]}),s.jsxRuntimeExports.jsx(s.Switch,{label:"Enable Hover",onChange:g=>u(g,"hover"),current:m.hover}),m.hover&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(ht,{initialColor:m.colorHover,onChange:g=>u(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),s.jsxRuntimeExports.jsx(ht,{initialColor:m.backgroundHover,onChange:g=>u(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},Hh="_category_hxy9u_1",Uh="_categoryTitle_hxy9u_19",bs={category:Hh,categoryTitle:Uh},$h=()=>{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))})},zh="_options_ikvjo_38",Wh={options:zh},qh=()=>{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,y){a&&n&&o("desktop",a,n,y,g)}const[m,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(y=>y.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 p=!!((e==null?void 0:e.name)==="Fonts"&&n),x=(e==null?void 0:e.name)!=="Fonts"||!n;return s.jsxRuntimeExports.jsxs(lr,{isOpen:p,isClose:x,children:[s.jsxRuntimeExports.jsx(ur,{onClick:c,title:"Font Style"}),n&&f&&s.jsxRuntimeExports.jsxs("div",{className:Wh.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:m}),s.jsxRuntimeExports.jsx(s.Select,{label:"Bold Weight",value:String(f.boldWeight),onChange:g=>d(g,"boldWeight"),options:m}),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))})]})]})},Vh="_wrapper_mkmxa_1",Gh="_category_mkmxa_5",Yh="_categoryTitle_mkmxa_11",Xh="_font_mkmxa_17",Qh="_content_mkmxa_32",Kh="_icon_mkmxa_39",Zh="_paragraph_mkmxa_50",Lt={wrapper:Vh,category:Gh,categoryTitle:Yh,font:Xh,content:Qh,icon:Kh,paragraph:Zh},Jh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},em=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(Jh[r])}),s.jsxRuntimeExports.jsx("span",{className:Lt.value,children:`${t}, ${n}px`})]})]})},tm=()=>{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(em,{id:a,category:o,...u},a))]},o))})},nm="_wrapper_16ym0_2",rm="_categoryTitle_16ym0_12",sm="_title_16ym0_74",om="_field_16ym0_82",im="_alignments_16ym0_92",am="_lineField_16ym0_98",um="_style_16ym0_106",lm="_header_16ym0_113",ct={wrapper:nm,categoryTitle:rm,title:sm,field:om,alignments:im,lineField:am,style:um,header:lm},cm="_blocks_emecf_1",dm="_block_emecf_1",hm="_active_emecf_21",Is={blocks:cm,block:dm,active:hm},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)))})},mm=["left","center","right"],pm=["solid","dashed"],Fn=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]})},fm=()=>{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(Fn,{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(Fn,{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(Fn,{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(Fn,{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:pm,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(Fn,{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:mm,selectedItem:n.label.alignment,onSelect:i=>r("label",i,"alignment"),getIconName:i=>i==="center"?"AlignCenterHorizontal":i==="left"?"AlignLeft":"AlignRight"})]})]})]})},gm="_wrapper_1yw63_2",xm="_color_1yw63_24",Em="_content_1yw63_33",bm="_preview_1yw63_42",Im="_container_1yw63_52",Tm="_buttonWrapper_1yw63_62",_m="_button_1yw63_62",Cm="_buttonBorder_1yw63_80",Sm="_buttonBackground_1yw63_83",ym="_text_1yw63_87",km="_textText_1yw63_93",Rm="_icon_1yw63_97",Am="_iconIcon_1yw63_100",Nm="_annotation_1yw63_104",wm="_annotationText_1yw63_111",Lm="_label_1yw63_116",jm="_circle_1yw63_127",vm="_line_1yw63_140",Pm="_circle1_1yw63_154",Dm="_circle2_1yw63_159",Om="_annotationIcon_1yw63_164",Bm="_annotationBorder_1yw63_192",Mm="_line1_1yw63_203",Fm="_line2_1yw63_210",Hm="_circle3_1yw63_227",Um="_circle4_1yw63_232",$m="_annotationSurface_1yw63_237",X={wrapper:gm,color:xm,content:Em,preview:bm,container:Im,buttonWrapper:Tm,button:_m,buttonBorder:Cm,buttonBackground:Sm,text:ym,textText:km,icon:Rm,iconIcon:Am,annotation:Nm,annotationText:wm,label:Lm,circle:jm,line:vm,circle1:Pm,circle2:Dm,annotationIcon:Om,annotationBorder:Bm,line1:Mm,line2:Fm,circle3:Hm,circle4:Um,annotationSurface:$m},zm=()=>{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)})]})]})})},Wm={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"]},qm=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:r,updateColor:o}=s.useThemeSettingsStore();function i(){t(null)}function a(m,h,f){o(m,h,f)}const u=!!((e==null?void 0:e.name)==="Colors"&&n),c=(e==null?void 0:e.name)!=="Colors"||!n,d=n?Wm[n]:[];return s.jsxRuntimeExports.jsxs(lr,{isOpen:u,isClose:c,children:[s.jsxRuntimeExports.jsx(ur,{onClick:i,title:n==="text"?"Text & Icon Colors":`${Ct(n)} Colors`}),n&&s.jsxRuntimeExports.jsxs("div",{className:X.wrapper,children:[s.jsxRuntimeExports.jsx(zm,{}),d.map(m=>{const h=r.colors[n][m];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(m),initialColor:h,onChange:f=>a(n,m,f),isGradientActive:n==="surface"})]})},m)})]})]})},Vm="_loader_1p5lr_1",Gm={loader:Vm},Ym=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=s.useThemeSettingsStore();return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:n?s.jsxRuntimeExports.jsx("div",{className:Gm.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(tm,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&s.jsxRuntimeExports.jsx(qh,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&s.jsxRuntimeExports.jsx($h,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&s.jsxRuntimeExports.jsx(qm,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&s.jsxRuntimeExports.jsx(fm,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&s.jsxRuntimeExports.jsx(Sh,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&s.jsxRuntimeExports.jsx(Fh,{})]})})},Xm=()=>{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(lr,{isOpen:i,isClose:a,children:[s.jsxRuntimeExports.jsx(ur,{onClick:o,title:(e==null?void 0:e.name)||""}),s.jsxRuntimeExports.jsx(Ym,{})]})},Qm=()=>{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(B0,{}),e.name==="Add"&&s.jsxRuntimeExports.jsx(ha,{}),s.jsxRuntimeExports.jsx(fh,{}),s.jsxRuntimeExports.jsx(Xm,{}),e.name==="Theme"&&s.jsxRuntimeExports.jsx(V0,{}),e.name==="Settings"&&s.jsxRuntimeExports.jsx(H0,{})]})},Km="_wrapper_no6if_1",Zm="_header_no6if_12",Jm="_content_no6if_23",ep="_buttons_no6if_44",tp="_label_no6if_51",np="_description_no6if_52",rp="_preview_no6if_60",sp="_block_no6if_66",op="_slug_no6if_75",ip="_title_no6if_81",ap="_closeIcon_no6if_87",at={wrapper:Km,header:Zm,content:Jm,buttons:ep,label:tp,description:np,preview:rp,block:sp,slug:op,title:ip,closeIcon:ap},up=()=>{var K,N,H,D,$,Y,q;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:m,updatePage:h}=s.useLayersStore(),[f,p]=k.useState(a?t&&((K=t[a])==null?void 0:K.path):""),[x,g]=k.useState(a?t&&((N=t[a])==null?void 0:N.name):""),[y,E]=k.useState(a?t&&((H=t[a])==null?void 0:H.seo)&&(($=(D=t[a])==null?void 0:D.seo)==null?void 0:$.pageDescription)||"":`${c.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[R,C]=k.useState(a&&t&&(Y=t[a])!=null&&Y.isPrivate?"private":"public");function P(){p(""),g(""),E(""),C("public"),i(!1),u(null)}function L(){d(!1),setTimeout(()=>{P(),e(!1),d(!0)},300)}k.useEffect(()=>()=>{L()},[]);function A(ee){return ee[0]==="/"?ee:"/"+ee}function z(){n({path:A(f),name:x||f||"",icon:"File",seo:{pageTitle:x||"",pageDescription:y||""},visibility:R||"public"}),m(A(f)),L()}function G(){t&&(s.defaultPagePaths.includes(t[a].path)||ca(t[a].path),h(t[a].path||"",f||""),r(a,{path:A(f),name:x||f,icon:t[a].icon||"File",seo:{pageTitle:x||"",pageDescription:y||""},visibility:R||"public"})),L()}return s.jsxRuntimeExports.jsxs("div",{className:at.wrapper,onClick:ee=>ee.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:ee=>p(ee),value:f,placeholder:"path-to-page",disabled:!!(a&&t&&((q=t[a])!=null&&q.name)&&s.defaultPagePaths.includes(t[a].path)),required:!0,regex:"^.+$"}),s.jsxRuntimeExports.jsx(s.Input,{label:"Page Title",onChange:ee=>{g(ee)},value:x.charAt(0).toUpperCase()+x.slice(1),placeholder:"Contact us"}),s.jsxRuntimeExports.jsx(s.Textarea,{label:"Description",onChange:ee=>E(ee),value:y,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:y||"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?G:z,disabled:f.length===0,children:o?"Update":"Create"})]})]})},lp="_layout_1pjho_1",cp="_main_1pjho_10",dp="_content_1pjho_18",hp="_notifications_1pjho_26",yr={layout:lp,main:cp,content:dp,notifications:hp},mp="_notification_2jmah_1",pp="_text_2jmah_22",fp="_timer_2jmah_27",gp="_warning_2jmah_32",xp="_error_2jmah_37",Ep="_success_2jmah_42",hn={notification:mp,text:pp,timer:fp,warning:gp,error:xp,success:Ep},Uo={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},ma=e=>{const{type:t,message:n,style:r,padding:o,timer:i,id:a,element:u}=e,[c,d]=k.useState(i),{setNotifications:m}=s.useNotificationStore();function h(){const p=s.useNotificationStore.getState().notifications.filter(x=>x.id!==a);m([...p])}return k.useEffect(()=>{const f=setTimeout(()=>{h()},i*1e3);return()=>clearTimeout(f)},[i]),k.useEffect(()=>{const f=setInterval(()=>d(p=>p-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()})})]})})},bp="_modal_1h74q_1",Ip="_title_1h74q_14",Tp="_buttons_1h74q_20",kr={modal:bp,title:Ip,buttons:Tp},pa=()=>{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:kr.modal,onClick:c=>c.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:kr.title,children:e}),s.jsxRuntimeExports.jsx("div",{className:kr.description,children:t}),s.jsxRuntimeExports.jsxs("div",{className:kr.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{onClick:u,children:"Cancel"}),s.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{n(),u()},type:"Secondary",children:"Confirm"})]})]})},_p="_modal_270ti_1",Cp="_padding_270ti_17",Sp="_content_270ti_21",yp="_close_270ti_42",Rr={modal:_p,padding:Cp,content:Sp,close:yp},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(Rr.modal,{[Rr.padding]:o}),children:r?s.jsxRuntimeExports.jsx("div",{className:s.clx(Rr.content,{[Rr.close]:!i}),children:n}):s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:n})})},kp=()=>{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:yr.layout,children:[s.jsxRuntimeExports.jsx(hd,{}),s.jsxRuntimeExports.jsxs("main",{className:yr.main,children:[s.jsxRuntimeExports.jsx(rd,{}),s.jsxRuntimeExports.jsxs("div",{className:yr.content,children:[s.jsxRuntimeExports.jsx(Qm,{}),s.jsxRuntimeExports.jsx(g0,{})]})]})]}),i&&a&&s.jsxRuntimeExports.jsx(Br,{close:()=>{u(null),c(null),d(null)},children:s.jsxRuntimeExports.jsx(pa,{})}),e&&s.jsxRuntimeExports.jsx(Br,{close:t,children:s.jsxRuntimeExports.jsx(up,{})}),n&&s.jsxRuntimeExports.jsx(Br,{close:r,children:s.jsxRuntimeExports.jsx(s.ChooseImageModal,{})}),o.length>0&&s.jsxRuntimeExports.jsx("div",{className:yr.notifications,children:o.map(m=>s.jsxRuntimeExports.jsx(ma,{type:m.status,message:m.message,timer:m.timer||10,id:m.id,element:m.component},m.id))})]})};async function mn(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 Rp(){try{const[e,t,n,r,o,i,a,u]=await Promise.allSettled([mn("v1","general"),mn("v1","faqs"),mn("v1","listings"),mn("v1","products"),mn("v1","reviews"),mn("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 Ap(){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 Np(){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 wp(){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 Lp=e=>{const{blocks:t,settings:n,header:r,footer:o,announcement:i}=e,{setBlocks:a,setSourceBlocks:u,setHeader:c,setFooter:d,setAnnouncement:m,setSettings:h}=s.useBlocksStore(),{fonts:f,setFonts:p}=s.useFontsStore(),{setSettings:x}=s.useSettingsStore(),{setPageContext:g}=s.usePagesStore(),{setThemeSettings:y,setIsLoadingThemeSettings:E}=s.useThemeSettingsStore(),{setIsLoadingSettings:R}=s.useSettingsStore(),{notifications:C,setNotifications:P}=s.useNotificationStore(),{setBlocks:L,blocks:A,createPage:z,setIsLoadingLayers:G,setHeader:K,setAnnouncement:N,setFooter:H}=s.useLayersStore(),{setPages:D,setCurrentPage:$}=s.usePagesStore();return k.useEffect(()=>{E(!0),G(!0),R(!0);const Y={};Object.keys(t).forEach(ee=>{Y[ee]=t[ee]}),u(Y),a(Y),c(r),d(o),m(i),h(n),(async()=>{const ee={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},W=await Rp();Object.keys(W).map(de=>{const Ae=de;ee[Ae]=W[Ae].value.data}),g(ee);const{data:V}=await wp(),{themeSettings:ue,layers:T,settings:ce}=V||{};if(ce){if(ce.settings){const de=new n;de.blockSettings={displayName:"Settings",isAddable:!1,...ce.settings},x(de.blockSettings)}ce.header&&K(ce.header),ce.footer&&H(ce.footer),ce.announcement&&N(ce.announcement)}else{const de=new n;x(de.blockSettings)}ue&&y(ue);const je=await Np(),S={};if(je.status>=400&&P([...C,{id:s.v4(),message:"Error fetching pages",status:"error"}]),je.data.length>0?(je.data.forEach(de=>{var Ae,Z;A[de.path]||z(de.path),S[de.id||de.path]={...de,icon:s.pages[de.path]?s.pages[de.path].icon:"File",name:de.name||((Ae=de.seo)==null?void 0:Ae.pageTitle)||((Z=s.pages[de.path])==null?void 0:Z.name)||de.path}}),D(S),$(Object.keys(S)[0])):(D(s.pages),$(Object.keys(s.pages)[0])),f.length===0){const de=await Ap();p([...de.map(Ae=>{const Z=Ae.variants.map(Be=>{if(!Be.includes("italic"))return Be==="regular"?"400":Be}).filter(Be=>Be!==void 0);return{name:Ae.family,weights:Z}})])}L(T),E(!1),G(!1),R(!1)})()},[]),s.jsxRuntimeExports.jsx(kp,{})};function jp(){const e=new URL(window.location.href);window.history.replaceState(null,"",e.pathname+e.hash)}function vp(){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 jp(),n&&localStorage.setItem("sellerAccessToken",n),t&&localStorage.setItem("shopId",t),r&&localStorage.setItem("draftId",r),!!(n&&t&&r)}const Pp="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",Dp=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 m=d.pathname;if(m.startsWith("/admin/builder")){m==="/admin/builder/add"?document.title="Add Section | Builder":m==="/admin/builder/theme"?document.title="Theme Settings | Builder":m==="/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=Pp)}},[d]),k.useEffect(()=>{u(!0),vp()?u(!1):c("/")},[]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:a?s.jsxRuntimeExports.jsx(Vt,{}):s.jsxRuntimeExports.jsx(Lp,{blocks:t,settings:n,header:r,footer:o,announcement:i})})},Op="_wrapper_1yd2j_1",Bp="_error_1yd2j_11",Mp="_title_1yd2j_21",Fp="_buttons_1yd2j_29",Hn={wrapper:Op,error:Bp,title:Mp,buttons:Fp},$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})},Hp=()=>{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 m(){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(p=>n[p].id).filter(p=>p!==void 0).map(p=>f.push(p)),await $o({resetSettings:!0,resetThemeSettings:!0,resetPageIds:f}),t(null)}return s.jsxRuntimeExports.jsxs("div",{className:Hn.wrapper,children:[s.jsxRuntimeExports.jsxs("div",{className:Hn.error,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:Hn.title,children:"Oops! Something went wrong"}),s.jsxRuntimeExports.jsx("span",{className:Hn.message,children:(e==null?void 0:e.message)||""})]}),s.jsxRuntimeExports.jsxs("div",{className:Hn.buttons,children:[s.jsxRuntimeExports.jsx(s.Button,{type:"Primary",onClick:m,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(pa,{})})]})},Up=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})},$p="_lock_1mxa7_1",zp="_wrapper_1mxa7_12",Wp="_content_1mxa7_22",qp="_info_1mxa7_31",Vp="_buttons_1mxa7_38",Gp="_button_1mxa7_38",Yp="_input_1mxa7_50",Xp="_error_1mxa7_57",ut={lock:$p,wrapper:zp,content:Wp,info:qp,buttons:Vp,button:Gp,input:Yp,error:Xp},Qp=()=>{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(),m=s.useNavigate();k.useEffect(()=>{if(a&&(!a.info.passwordProtected||a.isPasswordValid)){const f=d.state.from==="/validation"?"/":d.state.from;m(f)}},[a]),k.useEffect(()=>{a||(async()=>{var g;t(!0);const p=localStorage.getItem("shopPassword")||"",x=await $s(p);if(x.isPasswordValid){const y=((g=d.state)==null?void 0:g.from)||"/";m(y)}u(x),t(!1)})()},[a]);async function h(){var p;t(!0);const f=await $s(o);if(!f.isPasswordValid)r(!0);else{localStorage.setItem("shopPassword",o),c(o);const x=((p=d.state)==null?void 0:p.from)||"/";m(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:()=>m("/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,{})]})},Kp="_notifications_2ywhg_1",Zp={notifications:Kp},Jp=({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:m}=s.useNotificationStore(),[h,f]=k.useState(!0),{setCustomerEmail:p}=s.useCartStore(),{setThemeSettings:x,themeSettings:g}=s.useThemeSettingsStore(),{settings:y,setSettings:E}=s.useSettingsStore(),{setHeader:R,setFooter:C,setAnnouncement:P}=s.useLayersStore(),{general:L,setGeneral:A}=s.useGeneralStore(),{pageContext:z,setPageContext:G}=s.usePagesStore();s.useTrackingAnalytics((L==null?void 0:L.info.id)||localStorage.getItem("shopId")||"");const K=async()=>{const N=await s.getDynamicPage(encodeURIComponent("/products"));if(N){const{data:H}=N;G({...z,listings:H.listings})}};return k.useEffect(()=>{const N=localStorage.getItem("token");if(N&&(!n||!o))try{const H=s.jwtDecode(N);i(H),r(N),p(H.email)}catch(H){console.error("Failed to decode token:",H),localStorage.removeItem("token"),r(""),i(null)}},[n,o]),k.useEffect(()=>{const N=c.get("r");N&&(localStorage.setItem("referralCode",N),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")&&L&&(L.info.passwordProtected&&a||L.isPasswordValid)&&K()},[L,a]),k.useLayoutEffect(()=>{f(!0);const N=async()=>{if(!L){const D=await $s(a);D.isPasswordValid||t.pathname.includes("/admin/builder")||u("/validation",{state:{from:t.pathname}}),A(D)}},H=async()=>{const{settings:D,theme:$}=(await nc()).data;D?(D.settings&&E(D.settings),D.header&&R(JSON.parse(JSON.stringify(D.header))),D.footer&&C(JSON.parse(JSON.stringify(D.footer))),D.announcement&&P(JSON.parse(JSON.stringify(D.announcement)))):E(y),x($||g),f(!1)};t.pathname.startsWith("/validation")||N(),H()},[]),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,m.length>0&&s.jsxRuntimeExports.jsx("div",{className:Zp.notifications,children:m.map(N=>s.jsxRuntimeExports.jsx(ma,{type:N.status,message:N.message,timer:N.timer||10,id:N.id,element:N.component},N.id))})]})})},ef=()=>(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,{})})),tf="_wrapper_rccv2_1",nf="_content_rccv2_11",rf="_title_rccv2_21",Ts={wrapper:tf,content:nf,title:rf},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"})]})})},sf=({children:e,shopDomain:t,shopId:n,shopPassword:r,shopLogo:o})=>{const{setShopDomain:i,setShopId:a,setShopPassword:u,setShopTerms:c,setShopPrivacyPolicy:d,setShopRefundPolicy:m,setShopLogo:h}=s.useStorefrontStore();return k.useLayoutEffect(()=>{const f=async()=>{const{data:g}=await sc();c(g)},p=async()=>{const{data:g}=await ic();d(g)},x=async()=>{const{data:g}=await oc();m(g)};i(t),a(n),r&&u(r),o&&h(o),f(),p(),x()},[t,n,r]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:e})},of="_checkoutItemsContainer_1kn61_2",af="_innerContainer_1kn61_16",uf="_headerSection_1kn61_22",lf="_header_1kn61_22",cf="_productsContainer_1kn61_47",df="_couponContainer_1kn61_54",hf="_checkoutFooter_1kn61_58",Kt={checkoutItemsContainer:of,innerContainer:af,headerSection:uf,header:lf,productsContainer:cf,couponContainer:df,checkoutFooter:hf},mf="_checkoutFooter_1o2h8_1",pf="_footerBranding_1o2h8_10",ff="_poweredText_1o2h8_15",gf="_antistockLink_1o2h8_19",xf="_footerNav_1o2h8_23",Un={checkoutFooter:mf,footerBranding:pf,poweredText:ff,antistockLink:gf,footerNav:xf},Ef="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(),{isAntistock:i}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("footer",{className:`${Un.checkoutFooter} ${e}`,children:[s.jsxRuntimeExports.jsxs("div",{className:Un.footerBranding,children:[s.jsxRuntimeExports.jsx("p",{className:Un.poweredText,id:"md",children:"Powered by"}),i?s.jsxRuntimeExports.jsx("a",{className:Un.antistockLink,href:"https://antistock.io",target:"_blank",rel:"noopener noreferrer",children:"Antistock"}):o||s.jsxRuntimeExports.jsx("img",{src:Ef,alt:"Billgang"})]}),s.jsxRuntimeExports.jsx("nav",{children:s.jsxRuntimeExports.jsxs("ul",{className:Un.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"})})]})})]})},bf="_checkoutHeader_1stm3_1",If="_leftContainer_1stm3_20",Tf="_backArrow_1stm3_26",_f="_logoContainer_1stm3_38",Cf="_logo_1stm3_38",Sf="_antistockLink_1stm3_48",pn={checkoutHeader:bf,leftContainer:If,backArrow:Tf,logoContainer:_f,logo:Cf,antistockLink:Sf},yf="_activeBadge_1yb5i_1",kf="_activeBadgeText_1yb5i_12",zo={activeBadge:yf,activeBadgeText:kf},Rf=({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"})]}),Af="_timerContainer_105jf_2",Nf="_timerText_105jf_12",Wo={timerContainer:Af,timerText:Nf},wf=({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]})]})},Lf="_progressBar_mcabf_4",jf="_progressBarLabel_mcabf_12",vf="_progressBarTrack_mcabf_17",Pf="_progressBarFill_mcabf_28",Ar={progressBar:Lf,progressBarLabel:jf,progressBarTrack:vf,progressBarFill:Pf},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})})]}),Df="_rating_1bpps_4",Of="_disabled_1bpps_9",Bf="_ratingStar_1bpps_14",Mf="_inactive_1bpps_22",Nr={rating:Df,disabled:Of,ratingStar:Bf,inactive:Mf},Ff=({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))})},Hf="_inputRange_iv6ow_4",Uf="_inputRangeLabel_iv6ow_14",$f="_progressBar_iv6ow_22",zf="_progressBarFill_iv6ow_29",Wf="_stepsContainer_iv6ow_40",qf="_step_iv6ow_40",Vf="_stepDot_iv6ow_57",Gf="_current_iv6ow_61",Yf="_active_iv6ow_69",Xf="_inactive_iv6ow_72",Qf="_tooltip_iv6ow_77",Ze={inputRange:Hf,inputRangeLabel:Uf,progressBar:$f,progressBarFill:zf,stepsContainer:Wf,step:qf,stepDot:Vf,current:Gf,default:"_default_iv6ow_65",active:Yf,inactive:Xf,tooltip:Qf},Kf=({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 m=d+1,h=m<=o,f=m===o;return s.jsxRuntimeExports.jsxs("div",{className:Ze.step,onClick:()=>u(m),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"})]})]},m)})})]})]})},cr=({className:e,expiresAt:t})=>{const{shopGeneral:n}=s.useStorefrontStore(),r=s.useNavigate(),{isAntistock:o}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("header",{className:`${pn.checkoutHeader} ${e}`,children:[s.jsxRuntimeExports.jsxs("div",{className:pn.leftContainer,children:[s.jsxRuntimeExports.jsx("div",{className:pn.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:pn.logoContainer,children:o?s.jsxRuntimeExports.jsx("a",{className:pn.antistockLink,href:"https://antistock.io",target:"_blank",rel:"noopener noreferrer",children:"Antistock"}):s.jsxRuntimeExports.jsx("img",{className:pn.logo,src:s.convertCfImageIdToUrl(n.info.logo.cfId)})})]}),t&&s.jsxRuntimeExports.jsx(wf,{expiresAt:t})]})},Zf="_checkoutPrices_vp75r_1",Jf="_priceRow_vp75r_12",e1="_label_vp75r_22",t1="_totalRow_vp75r_26",n1="_totalLabel_vp75r_37",r1="_totalValue_vp75r_42",xt={checkoutPrices:Zf,priceRow:Jf,label:e1,totalRow:t1,totalLabel:n1,totalValue:r1},dr=({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)})]})]})},s1="_checkoutProduct_13ajx_1",o1="_isOrder_13ajx_1",i1="_productDetails_13ajx_10",a1="_productImage_13ajx_16",u1="_isOrderImage_13ajx_26",l1="_productImageAntistock_13ajx_30",c1="_image_13ajx_34",d1="_productInfo_13ajx_39",h1="_productHeader_13ajx_44",m1="_quantityBadge_13ajx_50",p1="_productDescription_13ajx_61",f1="_productPrice_13ajx_68",g1="_deliveryCategories_13ajx_77",x1="_customerNote_13ajx_85",E1="_noteHeader_13ajx_92",b1="_logoContainer_13ajx_98",I1="_shopName_13ajx_110",T1="_noteContent_13ajx_114",_1="_productName_13ajx_120",C1="_link_13ajx_125",ke={checkoutProduct:s1,isOrder:o1,productDetails:i1,productImage:a1,isOrderImage:u1,productImageAntistock:l1,image:c1,productInfo:d1,productHeader:h1,quantityBadge:m1,productDescription:p1,productPrice:f1,deliveryCategories:g1,customerNote:x1,noteHeader:E1,logoContainer:b1,shopName:I1,noteContent:T1,productName:_1,link:C1};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 S1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k1={};function Vo(e,t){return(k1.jsx?y1:S1).test(e)}const R1=/[ \t\n\f\r]/g;function A1(e){return typeof e=="object"?e.type==="text"?Go(e.value):!1:Go(e)}function Go(e){return e.replace(R1,"")===""}let hr=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};hr.prototype.normal={};hr.prototype.property={};hr.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 hr(n,r,t)}function sr(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 N1=0;const re=an(),we=an(),Ea=an(),M=an(),Te=an(),In=an(),Xe=an();function an(){return 2**++N1}const qs=Object.freeze(Object.defineProperty({__proto__:null,boolean:re,booleanish:we,commaOrSpaceSeparated:Xe,commaSeparated:In,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 kn(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[sr(r)]=r,n[sr(i.attribute)]=r}return new hr(t,n,e.space)}const ba=kn({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 w1=kn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:In,acceptCharset:Te,accessKey:Te,action:null,allow:null,allowFullScreen:re,allowPaymentRequest:re,allowUserMedia:re,alt:null,as:null,async:re,autoCapitalize:null,autoComplete:Te,autoFocus:re,autoPlay:re,blocking:Te,capture:null,charSet:null,checked:re,cite:null,className:Te,cols:M,colSpan:null,content:null,contentEditable:we,controls:re,controlsList:Te,coords:M|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:re,defer:re,dir:null,dirName:null,disabled:re,download:Ea,draggable:we,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:re,formTarget:null,headers:Te,height:M,hidden:re,high:M,href:null,hrefLang:null,htmlFor:Te,httpEquiv:Te,id:null,imageSizes:null,imageSrcSet:null,inert:re,inputMode:null,integrity:null,is:null,isMap:re,itemId:null,itemProp:Te,itemRef:Te,itemScope:re,itemType:Te,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:re,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:re,muted:re,name:null,nonce:null,noModule:re,noValidate:re,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:re,optimum:M,pattern:null,ping:Te,placeholder:null,playsInline:re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:re,referrerPolicy:null,rel:Te,required:re,reversed:re,rows:M,rowSpan:M,sandbox:Te,scope:null,scoped:re,seamless:re,selected:re,shadowRootClonable:re,shadowRootDelegatesFocus:re,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:re,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:re,declare:re,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:re,noHref:re,noShade:re,noWrap:re,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:re,disableRemotePlayback:re,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Ta}),L1=kn({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:re,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:In,g2:In,glyphName:In,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=kn({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=kn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ta}),Sa=kn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),j1={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"},v1=/[A-Z]/g,Xo=/-[a-z]/g,P1=/^data[-\w.:]+$/i;function lo(e,t){const n=sr(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"&&P1.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Xo,O1);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Xo.test(i)){let a=i.replace(v1,D1);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=uo}return new o(r,t)}function D1(e){return"-"+e.toLowerCase()}function O1(e){return e.charAt(1).toUpperCase()}const Qr=xa([ba,w1,_a,Ca,Sa],"html"),Rn=xa([ba,L1,_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,B1=/\n/g,M1=/^\s*/,F1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H1=/^:\s*/,U1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$1=/^[;\s]*/,z1=/^\s+|\s+$/g,W1=`
|
|
103
|
+
`,Zo="/",Jo="*",nn="",q1="comment",V1="declaration",G1=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(x){var g=x.match(B1);g&&(n+=g.length);var y=x.lastIndexOf(W1);r=~y?x.length-y:r+x.length}function i(){var x={line:n,column:r};return function(g){return g.position=new a(x),d(),g}}function a(x){this.start=x,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function u(x){var g=new Error(t.source+":"+n+":"+r+": "+x);if(g.reason=x,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(x){var g=x.exec(e);if(g){var y=g[0];return o(y),e=e.slice(y.length),g}}function d(){c(M1)}function m(x){var g;for(x=x||[];g=h();)g!==!1&&x.push(g);return x}function h(){var x=i();if(!(Zo!=e.charAt(0)||Jo!=e.charAt(1))){for(var g=2;nn!=e.charAt(g)&&(Jo!=e.charAt(g)||Zo!=e.charAt(g+1));)++g;if(g+=2,nn===e.charAt(g-1))return u("End of comment missing");var y=e.slice(2,g-2);return r+=2,o(y),e=e.slice(g),r+=2,x({type:q1,comment:y})}}function f(){var x=i(),g=c(F1);if(g){if(h(),!c(H1))return u("property missing ':'");var y=c(U1),E=x({type:V1,property:ei(g[0].replace(Ko,nn)),value:y?ei(y[0].replace(Ko,nn)):nn});return c($1),E}}function p(){var x=[];m(x);for(var g;g=f();)g!==!1&&(x.push(g),m(x));return x}return d(),p()};function ei(e){return e?e.replace(z1,nn):nn}var Y1=s.commonjsGlobal&&s.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ka,"__esModule",{value:!0});var ti=ka.default=Q1,X1=Y1(G1);function Q1(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,X1.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var a=i.property,u=i.value;o?t(a,u,i):u&&(n=n||{},n[a]=u)}}),n}const K1=ti.default||ti,Kr=Ra("end"),St=Ra("start");function Ra(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Z1(e){const t=St(e),n=Kr(e);if(t&&n)return{start:t,end:n}}function Xn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ni(e.position):"start"in e||"end"in e?ni(e):"line"in e||"column"in e?Vs(e):""}function Vs(e){return ri(e&&e.line)+":"+ri(e&&e.column)}function ni(e){return Vs(e&&e.start)+"-"+Vs(e&&e.end)}function ri(e){return e&&typeof e=="number"?e:1}class He extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=u?u.line:void 0,this.name=Xn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}He.prototype.file="";He.prototype.name="";He.prototype.reason="";He.prototype.message="";He.prototype.stack="";He.prototype.column=void 0;He.prototype.line=void 0;He.prototype.ancestors=void 0;He.prototype.cause=void 0;He.prototype.fatal=void 0;He.prototype.place=void 0;He.prototype.ruleId=void 0;He.prototype.source=void 0;const co={}.hasOwnProperty,J1=new Map,eg=/[A-Z]/g,tg=/-([a-z])/g,ng=new Set(["table","tbody","thead","tfoot","tr"]),rg=new Set(["td","th"]),Aa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sg(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hg(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=dg(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Rn:Qr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Na(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Na(e,t,n){if(t.type==="element")return og(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ig(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ug(e,t,n);if(t.type==="mdxjsEsm")return ag(e,t);if(t.type==="root")return lg(e,t,n);if(t.type==="text")return cg(e,t)}function og(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Rn,e.schema=o),e.ancestors.push(t);const i=La(e,t.tagName,!1),a=mg(e,t);let u=mo(e,t);return ng.has(t.tagName)&&(u=u.filter(function(c){return typeof c=="string"?!A1(c):!0})),wa(e,a,i,t),ho(a,u),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function ig(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}or(e,t.position)}function ag(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);or(e,t.position)}function ug(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Rn,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:La(e,t.name,!0),a=pg(e,t),u=mo(e,t);return wa(e,a,i,t),ho(a,u),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function lg(e,t,n){const r={};return ho(r,mo(e,t)),e.create(t,e.Fragment,r,n)}function cg(e,t){return t.value}function wa(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ho(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dg(e,t,n){return r;function r(o,i,a,u){const d=Array.isArray(a.children)?n:t;return u?d(i,a,u):d(i,a)}}function hg(e,t){return n;function n(r,o,i,a){const u=Array.isArray(i.children),c=St(r);return t(o,i,a,u,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function mg(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&co.call(t.properties,o)){const i=fg(e,o,t.properties[o]);if(i){const[a,u]=i;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&rg.has(t.tagName)?r=u:n[a]=u}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pg(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else or(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,i=e.evaluater.evaluateExpression(u.expression)}else or(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function mo(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:J1;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const d=o.get(c)||0;a=c+"-"+d,o.set(c,d+1)}}const u=Na(e,i,a);u!==void 0&&n.push(u)}return n}function fg(e,t,n){const r=lo(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ga(n):ya(n)),r.property==="style"){let o=typeof n=="object"?n:gg(e,String(n));return e.stylePropertyNameCase==="css"&&(o=xg(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?j1[r.property]||r.property:r.attribute,n]}}function gg(e,t){const n={};try{K1(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,a=new He("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Aa+"#cannot-parse-style-attribute",a}}return n;function r(o,i){let a=o;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(tg,bg)),n[a]=i}}function La(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,a;for(;++i<o.length;){const u=Vo(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=a}else r=Vo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return co.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);or(e)}function or(e,t){const n=new He("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Aa+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xg(e){const t={};let n;for(n in e)co.call(e,n)&&(t[Eg(n)]=e[n]);return t}function Eg(e){let t=e.replace(eg,Ig);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function bg(e,t){return t.toUpperCase()}function Ig(e){return"-"+e.toLowerCase()}const Cs={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Tg={};function po(e,t){const n=Tg,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ja(e,r,o)}function ja(e,t,n){if(_g(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return si(e.children,t,n)}return Array.isArray(e)?si(e,t,n):""}function si(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ja(e[o],t,n);return r.join("")}function _g(e){return!!(e&&typeof e=="object")}const oi=document.createElement("i");function fo(e){const t="&"+e+";";oi.innerHTML=t;const n=oi.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ke(e,t,n,r){const o=e.length;let i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function tt(e,t){return e.length>0?(Ke(e,e.length,0,t),e):t}const ii={}.hasOwnProperty;function va(e){const t={};let n=-1;for(;++n<e.length;)Cg(t,e[n]);return t}function Cg(e,t){let n;for(n in t){const o=(ii.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){ii.call(o,a)||(o[a]=[]);const u=i[a];Sg(o[a],Array.isArray(u)?u:u?[u]:[])}}}function Sg(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ke(e,0,0,r)}function Pa(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ze=Gt(/[A-Za-z]/),Fe=Gt(/[\dA-Za-z]/),yg=Gt(/[#-'*+\--9=?A-Z^-~]/);function Wr(e){return e!==null&&(e<32||e===127)}const Gs=Gt(/\d/),kg=Gt(/[\dA-Fa-f]/),Rg=Gt(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function Ie(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Zr=Gt(new RegExp("\\p{P}|\\p{S}","u")),on=Gt(/\s/);function Gt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function An(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&Fe(e.charCodeAt(n+1))&&Fe(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const u=e.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(a=String.fromCharCode(i,u),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function fe(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return he(c)?(e.enter(n),u(c)):t(c)}function u(c){return he(c)&&i++<o?(e.consume(c),u):(e.exit(n),t(c))}}const Ag={tokenize:Ng};function Ng(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),fe(e,t,"linePrefix")}function o(u){return e.enter("paragraph"),i(u)}function i(u){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Q(u)?(e.consume(u),e.exit("chunkText"),i):(e.consume(u),a)}}const wg={tokenize:Lg},ai={tokenize:jg};function Lg(e){const t=this,n=[];let r=0,o,i,a;return u;function u(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,c,d)(C)}return d(C)}function c(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&R();const P=t.events.length;let L=P,A;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){A=t.events[L][1].end;break}E(r);let z=P;for(;z<t.events.length;)t.events[z][1].end={...A},z++;return Ke(t.events,L+1,0,t.events.slice(P)),t.events.length=z,d(C)}return u(C)}function d(C){if(r===n.length){if(!o)return f(C);if(o.currentConstruct&&o.currentConstruct.concrete)return x(C);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ai,m,h)(C)}function m(C){return o&&R(),E(r),f(C)}function h(C){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(C)}function f(C){return t.containerState={},e.attempt(ai,p,x)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),f(C)}function x(C){if(C===null){o&&R(),E(0),e.consume(C);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),g(C)}function g(C){if(C===null){y(e.exit("chunkFlow"),!0),E(0),e.consume(C);return}return Q(C)?(e.consume(C),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(C),g)}function y(C,P){const L=t.sliceStream(C);if(P&&L.push(null),C.previous=i,i&&(i.next=C),i=C,o.defineSkip(C.start),o.write(L),t.parser.lazy[C.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<a&&(!o.events[A][1].end||o.events[A][1].end.offset>a))return;const z=t.events.length;let G=z,K,N;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(K){N=t.events[G][1].end;break}K=!0}for(E(r),A=z;A<t.events.length;)t.events[A][1].end={...N},A++;Ke(t.events,G+1,0,t.events.slice(z)),t.events.length=A}}function E(C){let P=n.length;for(;P-- >C;){const L=n[P];t.containerState=L[1],L[0].exit.call(t,e)}n.length=C}function R(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function jg(e,t,n){return fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cn(e){if(e===null||Ie(e)||on(e))return 1;if(Zr(e))return 2}function Jr(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Ys={name:"attention",resolveAll:vg,tokenize:Pg};function vg(e,t){let n=-1,r,o,i,a,u,c,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};ui(h,-c),ui(f,c),a={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:c>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=tt(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=tt(d,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),d=tt(d,Jr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=tt(d,[["exit",i,t],["enter",u,t],["exit",u,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=tt(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Ke(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Pg(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Cn(r);let i;return a;function a(c){return i=c,e.enter("attentionSequence"),u(c)}function u(c){if(c===i)return e.consume(c),u;const d=e.exit("attentionSequence"),m=Cn(c),h=!m||m===2&&o||n.includes(c),f=!o||o===2&&m||n.includes(r);return d._open=!!(i===42?h:h&&(o||!f)),d._close=!!(i===42?f:f&&(m||!h)),t(c)}}function ui(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Dg={name:"autolink",tokenize:Og};function Og(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return ze(p)?(e.consume(p),a):p===64?n(p):d(p)}function a(p){return p===43||p===45||p===46||Fe(p)?(r=1,u(p)):d(p)}function u(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Fe(p))&&r++<32?(e.consume(p),u):(r=0,d(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Wr(p)?n(p):(e.consume(p),c)}function d(p){return p===64?(e.consume(p),m):yg(p)?(e.consume(p),d):n(p)}function m(p){return Fe(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,m):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Fe(p))&&r++<63){const x=p===45?f:h;return e.consume(p),x}return n(p)}}const mr={partial:!0,tokenize:Bg};function Bg(e,t,n){return r;function r(i){return he(i)?fe(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Q(i)?t(i):n(i)}}const Da={continuation:{tokenize:Fg},exit:Hg,name:"blockQuote",tokenize:Mg};function Mg(e,t,n){const r=this;return o;function o(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return he(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Fg(e,t,n){const r=this;return o;function o(a){return he(a)?fe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(Da,t,n)(a)}}function Hg(e){e.exit("blockQuote")}const Oa={name:"characterEscape",tokenize:Ug};function Ug(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return Rg(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Ba={name:"characterReference",tokenize:$g};function $g(e,t,n){const r=this;let o=0,i,a;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),i=31,a=Fe,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=kg,m):(e.enter("characterReferenceValue"),i=7,a=Gs,m(h))}function m(h){if(h===59&&o){const f=e.exit("characterReferenceValue");return a===Fe&&!fo(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&o++<i?(e.consume(h),m):n(h)}}const li={partial:!0,tokenize:Wg},ci={concrete:!0,name:"codeFenced",tokenize:zg};function zg(e,t,n){const r=this,o={partial:!0,tokenize:L};let i=0,a=0,u;return c;function c(A){return d(A)}function d(A){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===u?(a++,e.consume(A),m):a<3?n(A):(e.exit("codeFencedFenceSequence"),he(A)?fe(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Q(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(li,g,P)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(A))}function f(A){return A===null||Q(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):he(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),fe(e,p,"whitespace")(A)):A===96&&A===u?n(A):(e.consume(A),f)}function p(A){return A===null||Q(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Q(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===u?n(A):(e.consume(A),x)}function g(A){return e.attempt(o,P,y)(A)}function y(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),E}function E(A){return i>0&&he(A)?fe(e,R,"linePrefix",i+1)(A):R(A)}function R(A){return A===null||Q(A)?e.check(li,g,P)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Q(A)?(e.exit("codeFlowValue"),R(A)):(e.consume(A),C)}function P(A){return e.exit("codeFenced"),t(A)}function L(A,z,G){let K=0;return N;function N(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),H}function H(q){return A.enter("codeFencedFence"),he(q)?fe(A,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):D(q)}function D(q){return q===u?(A.enter("codeFencedFenceSequence"),$(q)):G(q)}function $(q){return q===u?(K++,A.consume(q),$):K>=a?(A.exit("codeFencedFenceSequence"),he(q)?fe(A,Y,"whitespace")(q):Y(q)):G(q)}function Y(q){return q===null||Q(q)?(A.exit("codeFencedFence"),z(q)):G(q)}}}function Wg(e,t,n){const r=this;return o;function o(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ss={name:"codeIndented",tokenize:Vg},qg={partial:!0,tokenize:Gg};function Vg(e,t,n){const r=this;return o;function o(d){return e.enter("codeIndented"),fe(e,i,"linePrefix",5)(d)}function i(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):Q(d)?e.attempt(qg,a,c)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Q(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function c(d){return e.exit("codeIndented"),t(d)}}function Gg(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):Q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):fe(e,i,"linePrefix",5)(a)}function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):Q(a)?o(a):n(a)}}const Yg={name:"codeText",previous:Qg,resolve:Xg,tokenize:Kg};function Xg(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Qg(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Kg(e,t,n){let r=0,o,i;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(i=e.enter("codeTextSequence"),o=0,m(h)):Q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||Q(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),o++,m):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",d(h))}}class Zg{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&$n(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$n(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$n(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$n(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$n(this.left,n.reverse())}}}function $n(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ma(e){const t={};let n=-1,r,o,i,a,u,c,d;const m=new Zg(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Jg(m,n)),n=t[n],d=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(a=m.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(r[1].end={...m.get(o)[1].start},u=m.slice(o,n),u.unshift(r),m.splice(o,n-o+1,u))}}return Ke(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function Jg(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,c=[],d={};let m,h,f=-1,p=n,x=0,g=0;const y=[g];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(m=r.sliceStream(p),p.next||m.push(null),h&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++f<u.length;)u[f][0]==="exit"&&u[f-1][0]==="enter"&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(g=f+1,y.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const E=u.slice(y[f],y[f+1]),R=i.pop();c.push([R,R+E.length-1]),e.splice(R,2,E)}for(c.reverse(),f=-1;++f<c.length;)d[x+c[f][0]]=x+c[f][1],x+=c[f][1]-c[f][0]-1;return d}const e2={resolve:n2,tokenize:r2},t2={partial:!0,tokenize:s2};function n2(e){return Ma(e),e}function r2(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(u)}function o(u){return u===null?i(u):Q(u)?e.check(t2,a,i)(u):(e.consume(u),o)}function i(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function s2(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),fe(e,i,"linePrefix")}function i(a){if(a===null||Q(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Fa(e,t,n,r,o,i,a,u,c){const d=c||Number.POSITIVE_INFINITY;let m=0;return h;function h(E){return E===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(E),e.exit(i),f):E===null||E===32||E===41||Wr(E)?n(E):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),g(E))}function f(E){return E===62?(e.enter(i),e.consume(E),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===62?(e.exit("chunkString"),e.exit(u),f(E)):E===null||E===60||Q(E)?n(E):(e.consume(E),E===92?x:p)}function x(E){return E===60||E===62||E===92?(e.consume(E),p):p(E)}function g(E){return!m&&(E===null||E===41||Ie(E))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(E)):m<d&&E===40?(e.consume(E),m++,g):E===41?(e.consume(E),m--,g):E===null||E===32||E===40||Wr(E)?n(E):(e.consume(E),E===92?y:g)}function y(E){return E===40||E===41||E===92?(e.consume(E),g):g(E)}}function Ha(e,t,n,r,o,i){const a=this;let u=0,c;return d;function d(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),m}function m(p){return u>999||p===null||p===91||p===93&&!c||p===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):Q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||Q(p)||u++>999?(e.exit("chunkString"),m(p)):(e.consume(p),c||(c=!he(p)),p===92?f:h)}function f(p){return p===91||p===92||p===93?(e.consume(p),u++,h):h(p)}}function Ua(e,t,n,r,o,i){let a;return u;function u(f){return f===34||f===39||f===40?(e.enter(r),e.enter(o),e.consume(f),e.exit(o),a=f===40?41:f,c):n(f)}function c(f){return f===a?(e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):(e.enter(i),d(f))}function d(f){return f===a?(e.exit(i),c(a)):f===null?n(f):Q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),fe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(f))}function m(f){return f===a||f===null||Q(f)?(e.exit("chunkString"),d(f)):(e.consume(f),f===92?h:m)}function h(f){return f===a||f===92?(e.consume(f),m):m(f)}}function Qn(e,t){let n;return r;function r(o){return Q(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):he(o)?fe(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const o2={name:"definition",tokenize:a2},i2={partial:!0,tokenize:u2};function a2(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return Ha.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function u(p){return o=mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Ie(p)?Qn(e,d)(p):d(p)}function d(p){return Fa(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function m(p){return e.attempt(i2,h,h)(p)}function h(p){return he(p)?fe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Q(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function u2(e,t,n){return r;function r(u){return Ie(u)?Qn(e,o)(u):n(u)}function o(u){return Ua(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return he(u)?fe(e,a,"whitespace")(u):a(u)}function a(u){return u===null||Q(u)?t(u):n(u)}}const l2={name:"hardBreakEscape",tokenize:c2};function c2(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Q(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const d2={name:"headingAtx",resolve:h2,tokenize:m2};function h2(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ke(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function m2(e,t,n){let r=0;return o;function o(m){return e.enter("atxHeading"),i(m)}function i(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||Ie(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||Q(m)?(e.exit("atxHeading"),t(m)):he(m)?fe(e,u,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),u(m))}function d(m){return m===null||m===35||Ie(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),d)}}const p2=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],di=["pre","script","style","textarea"],f2={concrete:!0,name:"htmlFlow",resolveTo:E2,tokenize:b2},g2={partial:!0,tokenize:T2},x2={partial:!0,tokenize:I2};function E2(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function b2(e,t,n){const r=this;let o,i,a,u,c;return d;function d(S){return m(S)}function m(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),h}function h(S){return S===33?(e.consume(S),f):S===47?(e.consume(S),i=!0,g):S===63?(e.consume(S),o=3,r.interrupt?t:T):ze(S)?(e.consume(S),a=String.fromCharCode(S),y):n(S)}function f(S){return S===45?(e.consume(S),o=2,p):S===91?(e.consume(S),o=5,u=0,x):ze(S)?(e.consume(S),o=4,r.interrupt?t:T):n(S)}function p(S){return S===45?(e.consume(S),r.interrupt?t:T):n(S)}function x(S){const de="CDATA[";return S===de.charCodeAt(u++)?(e.consume(S),u===de.length?r.interrupt?t:D:x):n(S)}function g(S){return ze(S)?(e.consume(S),a=String.fromCharCode(S),y):n(S)}function y(S){if(S===null||S===47||S===62||Ie(S)){const de=S===47,Ae=a.toLowerCase();return!de&&!i&&di.includes(Ae)?(o=1,r.interrupt?t(S):D(S)):p2.includes(a.toLowerCase())?(o=6,de?(e.consume(S),E):r.interrupt?t(S):D(S)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):i?R(S):C(S))}return S===45||Fe(S)?(e.consume(S),a+=String.fromCharCode(S),y):n(S)}function E(S){return S===62?(e.consume(S),r.interrupt?t:D):n(S)}function R(S){return he(S)?(e.consume(S),R):N(S)}function C(S){return S===47?(e.consume(S),N):S===58||S===95||ze(S)?(e.consume(S),P):he(S)?(e.consume(S),C):N(S)}function P(S){return S===45||S===46||S===58||S===95||Fe(S)?(e.consume(S),P):L(S)}function L(S){return S===61?(e.consume(S),A):he(S)?(e.consume(S),L):C(S)}function A(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),c=S,z):he(S)?(e.consume(S),A):G(S)}function z(S){return S===c?(e.consume(S),c=null,K):S===null||Q(S)?n(S):(e.consume(S),z)}function G(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Ie(S)?L(S):(e.consume(S),G)}function K(S){return S===47||S===62||he(S)?C(S):n(S)}function N(S){return S===62?(e.consume(S),H):n(S)}function H(S){return S===null||Q(S)?D(S):he(S)?(e.consume(S),H):n(S)}function D(S){return S===45&&o===2?(e.consume(S),ee):S===60&&o===1?(e.consume(S),W):S===62&&o===4?(e.consume(S),ce):S===63&&o===3?(e.consume(S),T):S===93&&o===5?(e.consume(S),ue):Q(S)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(g2,je,$)(S)):S===null||Q(S)?(e.exit("htmlFlowData"),$(S)):(e.consume(S),D)}function $(S){return e.check(x2,Y,je)(S)}function Y(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),q}function q(S){return S===null||Q(S)?$(S):(e.enter("htmlFlowData"),D(S))}function ee(S){return S===45?(e.consume(S),T):D(S)}function W(S){return S===47?(e.consume(S),a="",V):D(S)}function V(S){if(S===62){const de=a.toLowerCase();return di.includes(de)?(e.consume(S),ce):D(S)}return ze(S)&&a.length<8?(e.consume(S),a+=String.fromCharCode(S),V):D(S)}function ue(S){return S===93?(e.consume(S),T):D(S)}function T(S){return S===62?(e.consume(S),ce):S===45&&o===2?(e.consume(S),T):D(S)}function ce(S){return S===null||Q(S)?(e.exit("htmlFlowData"),je(S)):(e.consume(S),ce)}function je(S){return e.exit("htmlFlow"),t(S)}}function I2(e,t,n){const r=this;return o;function o(a){return Q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function T2(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(mr,t,n)}}const _2={name:"htmlText",tokenize:C2};function C2(e,t,n){const r=this;let o,i,a;return u;function u(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),L):T===63?(e.consume(T),C):ze(T)?(e.consume(T),G):n(T)}function d(T){return T===45?(e.consume(T),m):T===91?(e.consume(T),i=0,x):ze(T)?(e.consume(T),R):n(T)}function m(T){return T===45?(e.consume(T),p):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),f):Q(T)?(a=h,W(T)):(e.consume(T),h)}function f(T){return T===45?(e.consume(T),p):h(T)}function p(T){return T===62?ee(T):T===45?f(T):h(T)}function x(T){const ce="CDATA[";return T===ce.charCodeAt(i++)?(e.consume(T),i===ce.length?g:x):n(T)}function g(T){return T===null?n(T):T===93?(e.consume(T),y):Q(T)?(a=g,W(T)):(e.consume(T),g)}function y(T){return T===93?(e.consume(T),E):g(T)}function E(T){return T===62?ee(T):T===93?(e.consume(T),E):g(T)}function R(T){return T===null||T===62?ee(T):Q(T)?(a=R,W(T)):(e.consume(T),R)}function C(T){return T===null?n(T):T===63?(e.consume(T),P):Q(T)?(a=C,W(T)):(e.consume(T),C)}function P(T){return T===62?ee(T):C(T)}function L(T){return ze(T)?(e.consume(T),A):n(T)}function A(T){return T===45||Fe(T)?(e.consume(T),A):z(T)}function z(T){return Q(T)?(a=z,W(T)):he(T)?(e.consume(T),z):ee(T)}function G(T){return T===45||Fe(T)?(e.consume(T),G):T===47||T===62||Ie(T)?K(T):n(T)}function K(T){return T===47?(e.consume(T),ee):T===58||T===95||ze(T)?(e.consume(T),N):Q(T)?(a=K,W(T)):he(T)?(e.consume(T),K):ee(T)}function N(T){return T===45||T===46||T===58||T===95||Fe(T)?(e.consume(T),N):H(T)}function H(T){return T===61?(e.consume(T),D):Q(T)?(a=H,W(T)):he(T)?(e.consume(T),H):K(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,$):Q(T)?(a=D,W(T)):he(T)?(e.consume(T),D):(e.consume(T),Y)}function $(T){return T===o?(e.consume(T),o=void 0,q):T===null?n(T):Q(T)?(a=$,W(T)):(e.consume(T),$)}function Y(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Ie(T)?K(T):(e.consume(T),Y)}function q(T){return T===47||T===62||Ie(T)?K(T):n(T)}function ee(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function W(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),V}function V(T){return he(T)?fe(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ue(T)}function ue(T){return e.enter("htmlTextData"),a(T)}}const go={name:"labelEnd",resolveAll:R2,resolveTo:A2,tokenize:N2},S2={tokenize:w2},y2={tokenize:L2},k2={tokenize:j2};function R2(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Ke(e,0,e.length,n),e}function A2(e,t){let n=e.length,r=0,o,i,a,u;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const c={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",c,t],["enter",d,t]],u=tt(u,e.slice(i+1,i+r+3)),u=tt(u,[["enter",m,t]]),u=tt(u,Jr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),u=tt(u,[["exit",m,t],e[a-2],e[a-1],["exit",d,t]]),u=tt(u,e.slice(a+1)),u=tt(u,[["exit",c,t]]),Ke(e,i,e.length,u),e}function N2(e,t,n){const r=this;let o=r.events.length,i,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return u;function u(f){return i?i._inactive?h(f):(a=r.parser.defined.includes(mt(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(S2,m,a?m:h)(f):f===91?e.attempt(y2,m,a?d:h)(f):a?m(f):h(f)}function d(f){return e.attempt(k2,m,h)(f)}function m(f){return t(f)}function h(f){return i._balanced=!0,n(f)}}function w2(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Ie(h)?Qn(e,i)(h):i(h)}function i(h){return h===41?m(h):Fa(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Ie(h)?Qn(e,c)(h):m(h)}function u(h){return n(h)}function c(h){return h===34||h===39||h===40?Ua(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return Ie(h)?Qn(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function L2(e,t,n){const r=this;return o;function o(u){return Ha.call(r,e,i,a,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function j2(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const v2={name:"labelStartImage",resolveAll:go.resolveAll,tokenize:P2};function P2(e,t,n){const r=this;return o;function o(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),i}function i(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const D2={name:"labelStartLink",resolveAll:go.resolveAll,tokenize:O2};function O2(e,t,n){const r=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ys={name:"lineEnding",tokenize:B2};function B2(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),fe(e,t,"linePrefix")}}const Mr={name:"thematicBreak",tokenize:M2};function M2(e,t,n){let r=0,o;return i;function i(d){return e.enter("thematicBreak"),a(d)}function a(d){return o=d,u(d)}function u(d){return d===o?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||Q(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===o?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),he(d)?fe(e,u,"whitespace")(d):u(d))}}const Ve={continuation:{tokenize:$2},exit:W2,name:"list",tokenize:U2},F2={partial:!0,tokenize:q2},H2={partial:!0,tokenize:z2};function U2(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return u;function u(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Gs(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Mr,n,d)(p):d(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Gs(p)&&++a<10?(e.consume(p),c):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),d(p)):n(p)}function d(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(mr,r.interrupt?n:m,e.attempt(F2,f,h))}function m(p){return r.containerState.initialBlankLine=!0,i++,f(p)}function h(p){return he(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function $2(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mr,o,i);function o(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,fe(e,t,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!he(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(H2,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,fe(e,e.attempt(Ve,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function z2(e,t,n){const r=this;return fe(e,o,"listItemIndent",r.containerState.size+1);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function W2(e){e.exit(this.containerState.type)}function q2(e,t,n){const r=this;return fe(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const a=r.events[r.events.length-1];return!he(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const hi={name:"setextUnderline",resolveTo:V2,tokenize:G2};function V2(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function G2(e,t,n){const r=this;let o;return i;function i(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===o?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),he(d)?fe(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||Q(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Y2={tokenize:X2};function X2(e){const t=this,n=e.attempt(mr,r,e.attempt(this.parser.constructs.flowInitial,o,fe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(e2,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Q2={resolveAll:za()},K2=$a("string"),Z2=$a("text");function $a(e){return{resolveAll:za(e==="text"?J2:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,a,u);return a;function a(m){return d(m)?i(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),c}function c(m){return d(m)?(n.exit("data"),i(m)):(n.consume(m),c)}function d(m){if(m===null)return!0;const h=o[m];let f=-1;if(h)for(;++f<h.length;){const p=h[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function za(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function J2(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,a=-1,u=0,c;for(;i--;){const d=o[i];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)c=!0,u++;else if(d!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const ex={42:Ve,43:Ve,45:Ve,48:Ve,49:Ve,50:Ve,51:Ve,52:Ve,53:Ve,54:Ve,55:Ve,56:Ve,57:Ve,62:Da},tx={91:o2},nx={[-2]:Ss,[-1]:Ss,32:Ss},rx={35:d2,42:Mr,45:[hi,Mr],60:f2,61:hi,95:Mr,96:ci,126:ci},sx={38:Ba,92:Oa},ox={[-5]:ys,[-4]:ys,[-3]:ys,33:v2,38:Ba,42:Ys,60:[Dg,_2],91:D2,92:[l2,Oa],93:go,95:Ys,96:Yg},ix={null:[Ys,Q2]},ax={null:[42,95]},ux={null:[]},lx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ax,contentInitial:tx,disable:ux,document:ex,flow:rx,flowInitial:nx,insideSpan:ix,string:sx,text:ox},Symbol.toStringTag,{value:"Module"}));function cx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],u=[];const c={attempt:z(L),check:z(A),consume:R,enter:C,exit:P,interrupt:z(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:g,events:[],now:x,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:h};let m=t.tokenize.call(d,c);return t.resolveAll&&i.push(t),d;function h(H){return a=tt(a,H),y(),a[a.length-1]!==null?[]:(G(t,0),d.events=Jr(i,d.events,d),d.events)}function f(H,D){return hx(p(H),D)}function p(H){return dx(a,H)}function x(){const{_bufferIndex:H,_index:D,line:$,column:Y,offset:q}=r;return{_bufferIndex:H,_index:D,line:$,column:Y,offset:q}}function g(H){o[H.line]=H.column,N()}function y(){let H;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<D.length;)E(D.charCodeAt(r._bufferIndex));else E(D)}}function E(H){m=m(H)}function R(H){Q(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,N()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function C(H,D){const $=D||{};return $.type=H,$.start=x(),d.events.push(["enter",$,d]),u.push($),$}function P(H){const D=u.pop();return D.end=x(),d.events.push(["exit",D,d]),D}function L(H,D){G(H,D.from)}function A(H,D){D.restore()}function z(H,D){return $;function $(Y,q,ee){let W,V,ue,T;return Array.isArray(Y)?je(Y):"tokenize"in Y?je([Y]):ce(Y);function ce(Z){return Be;function Be(st){const Dt=st!==null&&Z[st],kt=st!==null&&Z.null,Yt=[...Array.isArray(Dt)?Dt:Dt?[Dt]:[],...Array.isArray(kt)?kt:kt?[kt]:[]];return je(Yt)(st)}}function je(Z){return W=Z,V=0,Z.length===0?ee:S(Z[V])}function S(Z){return Be;function Be(st){return T=K(),ue=Z,Z.partial||(d.currentConstruct=Z),Z.name&&d.parser.constructs.disable.null.includes(Z.name)?Ae():Z.tokenize.call(D?Object.assign(Object.create(d),D):d,c,de,Ae)(st)}}function de(Z){return H(ue,T),q}function Ae(Z){return T.restore(),++V<W.length?S(W[V]):ee}}}function G(H,D){H.resolveAll&&!i.includes(H)&&i.push(H),H.resolve&&Ke(d.events,D,d.events.length-D,H.resolve(d.events.slice(D),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function K(){const H=x(),D=d.previous,$=d.currentConstruct,Y=d.events.length,q=Array.from(u);return{from:Y,restore:ee};function ee(){r=H,d.previous=D,d.currentConstruct=$,d.events.length=Y,u=q,N()}}function N(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function dx(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function hx(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
104
104
|
`;break}case-3:{a=`\r
|
|
105
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,r.push(a)}return r.join("")}function mx(e){const r={constructs:va([lx,...(e||{}).extensions||[]]),content:o(Ag),defined:[],document:o(wg),flow:o(Y2),lazy:{},string:o(K2),text:o(Z2)};return r;function o(i){return a;function a(u){return cx(r,i,u)}}}function px(e){for(;!Ma(e););return e}const mi=/[\0\t\n\r]/g;function fx(){let e=1,t="",n=!0,r;return o;function o(i,a,u){const c=[];let d,m,h,f,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(mi.lastIndex=h,d=mi.exec(i),f=d&&d.index!==void 0?d.index:i.length,p=i.charCodeAt(f),!d){t=i.slice(h);break}if(p===10&&h===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<f&&(c.push(i.slice(h,f)),e+=f-h),p){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return u&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const gx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xx(e){return e.replace(gx,Ex)}function Ex(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Pa(n.slice(i?2:1),i?16:10)}return fo(n)||e}const Wa={}.hasOwnProperty;function bx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ix(n)(px(mx(n).document().write(fx()(e,t,!0))))}function Ix(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ne),autolinkProtocol:K,autolinkEmail:K,atxHeading:i(vn),blockQuote:i(kt),characterEscape:K,characterReference:K,codeFenced:i(Yt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Yt,a),codeText:i(Er,a),codeTextData:K,data:K,codeFlowValue:K,definition:i(us),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(br),hardBreakEscape:i(oe),hardBreakTrailing:i(oe),htmlFlow:i(ee,a),htmlFlowData:K,htmlText:i(ee,a),htmlTextData:K,image:i(Ee),label:a,link:i(ne),listItem:i(ie),listItemValue:f,listOrdered:i(me,h),listUnordered:i(me),paragraph:i(xe),reference:S,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(vn),strong:i(ge),thematicBreak:i(Ot)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:Dt,autolinkProtocol:st,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:J,characterReference:Be,codeFenced:c(y),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:N,codeIndented:c(E),codeText:c(q),codeTextData:N,data:N,definition:c(),definitionDestinationString:P,definitionLabelString:R,definitionTitleString:C,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c($),htmlFlowData:N,htmlText:c(Y),htmlTextData:N,image:c(W),label:ue,labelText:V,lineEnding:H,link:c(Z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:T,resourceTitleString:ce,resource:je,setextHeading:c(G),setextHeadingLineSequence:z,setextHeadingText:A,strong:c(),thematicBreak:c()}};qa(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(v){let U={type:"root",children:[]};const te={stack:[U],tokenStack:[],config:t,enter:u,exit:d,buffer:a,resume:m,data:n},pe=[];let be=-1;for(;++be<v.length;)if(v[be][1].type==="listOrdered"||v[be][1].type==="listUnordered")if(v[be][0]==="enter")pe.push(be);else{const ot=pe.pop();be=o(v,ot,be)}for(be=-1;++be<v.length;){const ot=t[v[be][0]];Wa.call(ot,v[be][1].type)&&ot[v[be][1].type].call(Object.assign({sliceSerialize:v[be][2].sliceSerialize},te),v[be][1])}if(te.tokenStack.length>0){const ot=te.tokenStack[te.tokenStack.length-1];(ot[1]||pi).call(te,void 0,ot[0])}for(U.position={start:Bt(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:Bt(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be<t.transforms.length;)U=t.transforms[be](U)||U;return U}function o(v,U,te){let pe=U-1,be=-1,ot=!1,Xt,Rt,Pn,Dn;for(;++pe<=te;){const Ye=v[pe];switch(Ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ye[0]==="enter"?be++:be--,Dn=void 0;break}case"lineEndingBlank":{Ye[0]==="enter"&&(Xt&&!Dn&&!be&&!Pn&&(Pn=pe),Dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dn=void 0}if(!be&&Ye[0]==="enter"&&Ye[1].type==="listItemPrefix"||be===-1&&Ye[0]==="exit"&&(Ye[1].type==="listUnordered"||Ye[1].type==="listOrdered")){if(Xt){let cn=pe;for(Rt=void 0;cn--;){const At=v[cn];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;Rt&&(v[Rt][1].type="lineEndingBlank",ot=!0),At[1].type="lineEnding",Rt=cn}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}Pn&&(!Rt||Pn<Rt)&&(Xt._spread=!0),Xt.end=Object.assign({},Rt?v[Rt][1].start:Ye[1].end),v.splice(Rt||pe,0,["exit",Xt,Ye[2]]),pe++,te++}if(Ye[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},Ye[1].start),end:void 0};Xt=cn,v.splice(pe,0,["enter",cn,Ye[2]]),pe++,te++,Pn=void 0,Dn=!0}}}return v[U][1]._spread=ot,te}function i(v,U){return te;function te(pe){u.call(this,v(pe),pe),U&&U.call(this,pe)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(v,U,te){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([U,te||void 0]),v.position={start:Bt(U.start),end:void 0}}function c(v){return U;function U(te){v&&v.call(this,te),d.call(this,te)}}function d(v,U){const te=this.stack.pop(),pe=this.tokenStack.pop();if(pe)pe[0].type!==v.type&&(U?U.call(this,v,pe[0]):(pe[1]||pi).call(this,v,pe[0]));else throw new Error("Cannot close `"+v.type+"` ("+Xn({start:v.start,end:v.end})+"): it’s not open");te.position.end=Bt(v.end)}function m(){return po(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(v){if(this.data.expectingFirstListItemValue){const U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function p(){const v=this.resume(),U=this.stack[this.stack.length-1];U.lang=v}function x(){const v=this.resume(),U=this.stack[this.stack.length-1];U.meta=v}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v.replace(/(\r?\n|\r)$/g,"")}function R(v){const U=this.resume(),te=this.stack[this.stack.length-1];te.label=U,te.identifier=mt(this.sliceSerialize(v)).toLowerCase()}function C(){const v=this.resume(),U=this.stack[this.stack.length-1];U.title=v}function P(){const v=this.resume(),U=this.stack[this.stack.length-1];U.url=v}function L(v){const U=this.stack[this.stack.length-1];if(!U.depth){const te=this.sliceSerialize(v).length;U.depth=te}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function z(v){const U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function K(v){const te=this.stack[this.stack.length-1].children;let pe=te[te.length-1];(!pe||pe.type!=="text")&&(pe=ye(),pe.position={start:Bt(v.start),end:void 0},te.push(pe)),this.stack.push(pe)}function N(v){const U=this.stack.pop();U.value+=this.sliceSerialize(v),U.position.end=Bt(v.end)}function H(v){const U=this.stack[this.stack.length-1];if(this.data.atHardBreak){const te=U.children[U.children.length-1];te.position.end=Bt(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(K.call(this,v),N.call(this,v))}function D(){this.data.atHardBreak=!0}function $(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v}function Y(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v}function q(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v}function Z(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=U,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function W(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=U,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function V(v){const U=this.sliceSerialize(v),te=this.stack[this.stack.length-2];te.label=xx(U),te.identifier=mt(U).toLowerCase()}function ue(){const v=this.stack[this.stack.length-1],U=this.resume(),te=this.stack[this.stack.length-1];if(this.data.inReference=!0,te.type==="link"){const pe=v.children;te.children=pe}else te.alt=U}function T(){const v=this.resume(),U=this.stack[this.stack.length-1];U.url=v}function ce(){const v=this.resume(),U=this.stack[this.stack.length-1];U.title=v}function je(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function de(v){const U=this.resume(),te=this.stack[this.stack.length-1];te.label=U,te.identifier=mt(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function Ae(v){this.data.characterReferenceType=v.type}function J(v){const U=this.sliceSerialize(v),te=this.data.characterReferenceType;let pe;te?(pe=Pa(U,te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=fo(U);const be=this.stack[this.stack.length-1];be.value+=pe}function Be(v){const U=this.stack.pop();U.position.end=Bt(v.end)}function st(v){N.call(this,v);const U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(v)}function Dt(v){N.call(this,v);const U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(v)}function kt(){return{type:"blockquote",children:[]}}function Yt(){return{type:"code",lang:null,meta:null,value:""}}function Er(){return{type:"inlineCode",value:""}}function us(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function br(){return{type:"emphasis",children:[]}}function vn(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function ee(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function ne(){return{type:"link",title:null,url:"",children:[]}}function me(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[]}}function ie(v){return{type:"listItem",spread:v._spread,checked:null,children:[]}}function xe(){return{type:"paragraph",children:[]}}function ge(){return{type:"strong",children:[]}}function ye(){return{type:"text",value:""}}function Ot(){return{type:"thematicBreak"}}}function Bt(e){return{line:e.line,column:e.column,offset:e.offset}}function qa(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qa(e,r):Tx(e,r)}}function Tx(e,t){let n;for(n in t)if(Wa.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function pi(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xn({start:t.start,end:t.end})+") is still open")}function _x(e){const t=this;t.parser=n;function n(r){return bx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Cx(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Sx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
105
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,r.push(a)}return r.join("")}function mx(e){const r={constructs:va([lx,...(e||{}).extensions||[]]),content:o(Ag),defined:[],document:o(wg),flow:o(Y2),lazy:{},string:o(K2),text:o(Z2)};return r;function o(i){return a;function a(u){return cx(r,i,u)}}}function px(e){for(;!Ma(e););return e}const mi=/[\0\t\n\r]/g;function fx(){let e=1,t="",n=!0,r;return o;function o(i,a,u){const c=[];let d,m,h,f,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(mi.lastIndex=h,d=mi.exec(i),f=d&&d.index!==void 0?d.index:i.length,p=i.charCodeAt(f),!d){t=i.slice(h);break}if(p===10&&h===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<f&&(c.push(i.slice(h,f)),e+=f-h),p){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return u&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const gx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xx(e){return e.replace(gx,Ex)}function Ex(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Pa(n.slice(i?2:1),i?16:10)}return fo(n)||e}const Wa={}.hasOwnProperty;function bx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ix(n)(px(mx(n).document().write(fx()(e,t,!0))))}function Ix(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ne),autolinkProtocol:K,autolinkEmail:K,atxHeading:i(vn),blockQuote:i(kt),characterEscape:K,characterReference:K,codeFenced:i(Yt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Yt,a),codeText:i(Er,a),codeTextData:K,data:K,codeFlowValue:K,definition:i(us),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(br),hardBreakEscape:i(oe),hardBreakTrailing:i(oe),htmlFlow:i(J,a),htmlFlowData:K,htmlText:i(J,a),htmlTextData:K,image:i(Ee),label:a,link:i(ne),listItem:i(ie),listItemValue:f,listOrdered:i(me,h),listUnordered:i(me),paragraph:i(xe),reference:S,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(vn),strong:i(ge),thematicBreak:i(Ot)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:Dt,autolinkProtocol:st,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:Z,characterReference:Be,codeFenced:c(y),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:N,codeIndented:c(E),codeText:c(q),codeTextData:N,data:N,definition:c(),definitionDestinationString:P,definitionLabelString:R,definitionTitleString:C,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c($),htmlFlowData:N,htmlText:c(Y),htmlTextData:N,image:c(W),label:ue,labelText:V,lineEnding:H,link:c(ee),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:T,resourceTitleString:ce,resource:je,setextHeading:c(G),setextHeadingLineSequence:z,setextHeadingText:A,strong:c(),thematicBreak:c()}};qa(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(v){let U={type:"root",children:[]};const te={stack:[U],tokenStack:[],config:t,enter:u,exit:d,buffer:a,resume:m,data:n},pe=[];let be=-1;for(;++be<v.length;)if(v[be][1].type==="listOrdered"||v[be][1].type==="listUnordered")if(v[be][0]==="enter")pe.push(be);else{const ot=pe.pop();be=o(v,ot,be)}for(be=-1;++be<v.length;){const ot=t[v[be][0]];Wa.call(ot,v[be][1].type)&&ot[v[be][1].type].call(Object.assign({sliceSerialize:v[be][2].sliceSerialize},te),v[be][1])}if(te.tokenStack.length>0){const ot=te.tokenStack[te.tokenStack.length-1];(ot[1]||pi).call(te,void 0,ot[0])}for(U.position={start:Bt(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:Bt(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be<t.transforms.length;)U=t.transforms[be](U)||U;return U}function o(v,U,te){let pe=U-1,be=-1,ot=!1,Xt,Rt,Pn,Dn;for(;++pe<=te;){const Ye=v[pe];switch(Ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ye[0]==="enter"?be++:be--,Dn=void 0;break}case"lineEndingBlank":{Ye[0]==="enter"&&(Xt&&!Dn&&!be&&!Pn&&(Pn=pe),Dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dn=void 0}if(!be&&Ye[0]==="enter"&&Ye[1].type==="listItemPrefix"||be===-1&&Ye[0]==="exit"&&(Ye[1].type==="listUnordered"||Ye[1].type==="listOrdered")){if(Xt){let cn=pe;for(Rt=void 0;cn--;){const At=v[cn];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;Rt&&(v[Rt][1].type="lineEndingBlank",ot=!0),At[1].type="lineEnding",Rt=cn}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}Pn&&(!Rt||Pn<Rt)&&(Xt._spread=!0),Xt.end=Object.assign({},Rt?v[Rt][1].start:Ye[1].end),v.splice(Rt||pe,0,["exit",Xt,Ye[2]]),pe++,te++}if(Ye[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},Ye[1].start),end:void 0};Xt=cn,v.splice(pe,0,["enter",cn,Ye[2]]),pe++,te++,Pn=void 0,Dn=!0}}}return v[U][1]._spread=ot,te}function i(v,U){return te;function te(pe){u.call(this,v(pe),pe),U&&U.call(this,pe)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(v,U,te){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([U,te||void 0]),v.position={start:Bt(U.start),end:void 0}}function c(v){return U;function U(te){v&&v.call(this,te),d.call(this,te)}}function d(v,U){const te=this.stack.pop(),pe=this.tokenStack.pop();if(pe)pe[0].type!==v.type&&(U?U.call(this,v,pe[0]):(pe[1]||pi).call(this,v,pe[0]));else throw new Error("Cannot close `"+v.type+"` ("+Xn({start:v.start,end:v.end})+"): it’s not open");te.position.end=Bt(v.end)}function m(){return po(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(v){if(this.data.expectingFirstListItemValue){const U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function p(){const v=this.resume(),U=this.stack[this.stack.length-1];U.lang=v}function x(){const v=this.resume(),U=this.stack[this.stack.length-1];U.meta=v}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v.replace(/(\r?\n|\r)$/g,"")}function R(v){const U=this.resume(),te=this.stack[this.stack.length-1];te.label=U,te.identifier=mt(this.sliceSerialize(v)).toLowerCase()}function C(){const v=this.resume(),U=this.stack[this.stack.length-1];U.title=v}function P(){const v=this.resume(),U=this.stack[this.stack.length-1];U.url=v}function L(v){const U=this.stack[this.stack.length-1];if(!U.depth){const te=this.sliceSerialize(v).length;U.depth=te}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function z(v){const U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function K(v){const te=this.stack[this.stack.length-1].children;let pe=te[te.length-1];(!pe||pe.type!=="text")&&(pe=ye(),pe.position={start:Bt(v.start),end:void 0},te.push(pe)),this.stack.push(pe)}function N(v){const U=this.stack.pop();U.value+=this.sliceSerialize(v),U.position.end=Bt(v.end)}function H(v){const U=this.stack[this.stack.length-1];if(this.data.atHardBreak){const te=U.children[U.children.length-1];te.position.end=Bt(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(K.call(this,v),N.call(this,v))}function D(){this.data.atHardBreak=!0}function $(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v}function Y(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v}function q(){const v=this.resume(),U=this.stack[this.stack.length-1];U.value=v}function ee(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=U,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function W(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=U,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function V(v){const U=this.sliceSerialize(v),te=this.stack[this.stack.length-2];te.label=xx(U),te.identifier=mt(U).toLowerCase()}function ue(){const v=this.stack[this.stack.length-1],U=this.resume(),te=this.stack[this.stack.length-1];if(this.data.inReference=!0,te.type==="link"){const pe=v.children;te.children=pe}else te.alt=U}function T(){const v=this.resume(),U=this.stack[this.stack.length-1];U.url=v}function ce(){const v=this.resume(),U=this.stack[this.stack.length-1];U.title=v}function je(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function de(v){const U=this.resume(),te=this.stack[this.stack.length-1];te.label=U,te.identifier=mt(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function Ae(v){this.data.characterReferenceType=v.type}function Z(v){const U=this.sliceSerialize(v),te=this.data.characterReferenceType;let pe;te?(pe=Pa(U,te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=fo(U);const be=this.stack[this.stack.length-1];be.value+=pe}function Be(v){const U=this.stack.pop();U.position.end=Bt(v.end)}function st(v){N.call(this,v);const U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(v)}function Dt(v){N.call(this,v);const U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(v)}function kt(){return{type:"blockquote",children:[]}}function Yt(){return{type:"code",lang:null,meta:null,value:""}}function Er(){return{type:"inlineCode",value:""}}function us(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function br(){return{type:"emphasis",children:[]}}function vn(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function J(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function ne(){return{type:"link",title:null,url:"",children:[]}}function me(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[]}}function ie(v){return{type:"listItem",spread:v._spread,checked:null,children:[]}}function xe(){return{type:"paragraph",children:[]}}function ge(){return{type:"strong",children:[]}}function ye(){return{type:"text",value:""}}function Ot(){return{type:"thematicBreak"}}}function Bt(e){return{line:e.line,column:e.column,offset:e.offset}}function qa(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qa(e,r):Tx(e,r)}}function Tx(e,t){let n;for(n in t)if(Wa.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function pi(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xn({start:t.start,end:t.end})+") is still open")}function _x(e){const t=this;t.parser=n;function n(r){return bx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Cx(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Sx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
106
106
|
`}]}function yx(e,t){const n=t.value?t.value+`
|
|
107
107
|
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function kx(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rx(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ax(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=An(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,u+=1,e.footnoteCounts.set(r,u);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function Nx(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wx(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Va(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=r:o.push({type:"text",value:r}),o}function Lx(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Va(e,t);const o={src:An(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function jx(e,t){const n={src:An(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function vx(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Px(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Va(e,t);const o={href:An(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Dx(e,t){const n={href:An(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ox(e,t,n){const r=e.all(t),o=n?Bx(n):Ga(t),i={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const m=r[u];(o||u!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
|
|
108
108
|
`}),m.type==="element"&&m.tagName==="p"&&!o?a.push(...m.children):a.push(m)}const c=r[r.length-1];c&&(o||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
@@ -128,4 +128,4 @@
|
|
|
128
128
|
`))+1))}const a="#".repeat(o),u=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
129
129
|
`,...i.current()});return/^[\t ]/.test(d)&&(d=ar(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),c(),u(),d}Zu.peek=lC;function Zu(e){return e.value||""}function lC(){return"<"}Ju.peek=cC;function Ju(e,t,n,r){const o=No(n),i=o==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(u=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),u(),e.title&&(u=n.enter(`title${i}`),d+=c.move(" "+o),d+=c.move(n.safe(e.title,{before:d,after:o,...c.current()})),d+=c.move(o),u()),d+=c.move(")"),a(),d}function cC(){return"!"}el.peek=dC;function el(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("![");const d=n.safe(e.alt,{before:c,after:"]",...u.current()});c+=u.move(d+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...u.current()});return a(),n.stack=m,i(),o==="full"||!d||d!==h?c+=u.move(h+"]"):o==="shortcut"?c=c.slice(0,-1):c+=u.move("]"),c}function dC(){return"!"}tl.peek=hC;function tl(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],u=n.compilePattern(a);let c;if(a.atBreak)for(;c=u.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return o+r+o}function hC(){return"`"}function nl(e,t){const n=po(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}rl.peek=mC;function rl(e,t,n,r){const o=No(n),i=o==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,c;if(nl(e,n)){const m=n.stack;n.stack=[],u=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),u(),n.stack=m,h}u=n.enter("link"),c=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(e,{before:d,after:"](",...a.current()})),d+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(e.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(c=n.enter("destinationRaw"),d+=a.move(n.safe(e.url,{before:d,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${i}`),d+=a.move(" "+o),d+=a.move(n.safe(e.title,{before:d,after:o,...a.current()})),d+=a.move(o),c()),d+=a.move(")"),u(),d}function mC(e,t,n){return nl(e,n)?"<":"["}sl.peek=pC;function sl(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...u.current()});c+=u.move(d+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...u.current()});return a(),n.stack=m,i(),o==="full"||!d||d!==h?c+=u.move(h+"]"):o==="shortcut"?c=c.slice(0,-1):c+=u.move("]"),c}function pC(){return"["}function wo(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fC(e){const t=wo(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ol(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function xC(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?gC(n):wo(n);const u=e.ordered?a==="."?")":".":fC(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ol(n)===a&&m){let h=-1;for(;++h<e.children.length;){const f=e.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=u),n.bulletCurrent=a;const d=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),d}function EC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function bC(e,t,n,r){const o=EC(n);let i=n.bulletCurrent||wo(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(i+" ".repeat(a-i.length)),u.shift(a);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),m);return c(),d;function m(h,f,p){return f?(p?"":" ".repeat(a))+h:(p?i:i+" ".repeat(a-i.length))+h}}function IC(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a}const TC=ts(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function _C(e,t,n,r){return(e.children.some(function(a){return TC(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function CC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}il.peek=SC;function il(e,t,n,r){const o=CC(n),i=n.enter("strong"),a=n.createTracker(r),u=a.move(o+o);let c=a.move(n.containerPhrasing(e,{after:o,before:u,...a.current()}));const d=c.charCodeAt(0),m=Xr(r.before.charCodeAt(r.before.length-1),d,o);m.inside&&(c=ar(d)+c.slice(1));const h=c.charCodeAt(c.length-1),f=Xr(r.after.charCodeAt(0),h,o);f.inside&&(c=c.slice(0,-1)+ar(h));const p=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:m.outside},u+c+p}function SC(e,t,n){return n.options.strong||"*"}function yC(e,t,n,r){return n.safe(e.value,r)}function kC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function RC(e,t,n){const r=(ol(n)+(n.options.ruleSpaces?" ":"")).repeat(kC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const al={blockquote:Q_,break:sa,code:nC,definition:sC,emphasis:Ku,hardBreak:sa,heading:uC,html:Zu,image:Ju,imageReference:el,inlineCode:tl,link:rl,linkReference:sl,list:xC,listItem:bC,paragraph:IC,root:_C,strong:il,text:yC,thematicBreak:RC};function AC(){return{enter:{table:NC,tableData:oa,tableHeader:oa,tableRow:LC},exit:{codeText:jC,table:wC,tableData:Fs,tableHeader:Fs,tableRow:Fs}}}function NC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function wC(e){this.exit(e),this.data.inTable=void 0}function LC(e){this.enter({type:"tableRow",children:[]},e)}function Fs(e){this.exit(e)}function oa(e){this.enter({type:"tableCell",children:[]},e)}function jC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vC(e,t){return t==="|"?t:e}function PC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
130
130
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:c,tableRow:u}};function a(p,x,g,y){return d(m(p,g,y),p.align)}function u(p,x,g,y){const E=h(p,g,y),R=d([E]);return R.slice(0,R.indexOf(`
|
|
131
|
-
`))}function c(p,x,g,y){const E=g.enter("tableCell"),R=g.enter("phrasing"),C=g.containerPhrasing(p,{...y,before:i,after:i});return R(),E(),C}function d(p,x){return Y_(p,{align:x,alignDelimiters:r,padding:n,stringLength:o})}function m(p,x,g){const y=p.children;let E=-1;const R=[],C=x.enter("table");for(;++E<y.length;)R[E]=h(y[E],x,g);return C(),R}function h(p,x,g){const y=p.children;let E=-1;const R=[],C=x.enter("tableRow");for(;++E<y.length;)R[E]=c(y[E],p,x,g);return C(),R}function f(p,x,g){let y=al.inlineCode(p,x,g);return g.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function DC(){return{exit:{taskListCheckValueChecked:ia,taskListCheckValueUnchecked:ia,paragraph:BC}}}function OC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:MC}}}function ia(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function BC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,a;for(;++i<o.length;){const u=o[i];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function MC(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let c=al.listItem(e,t,n,{...r,...u.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(m){return m+a}}function FC(){return[x_(),M_(),$_(),AC(),DC()]}function HC(e){return{extensions:[E_(),F_(e),z_(),PC(e),OC()]}}const UC={tokenize:GC,partial:!0},ul={tokenize:YC,partial:!0},ll={tokenize:XC,partial:!0},cl={tokenize:QC,partial:!0},$C={tokenize:KC,partial:!0},dl={name:"wwwAutolink",tokenize:qC,previous:ml},hl={name:"protocolAutolink",tokenize:VC,previous:pl},Pt={name:"emailAutolink",tokenize:WC,previous:fl},yt={};function zC(){return{text:yt}}let Zt=48;for(;Zt<123;)yt[Zt]=Pt,Zt++,Zt===58?Zt=65:Zt===91&&(Zt=97);yt[43]=Pt;yt[45]=Pt;yt[46]=Pt;yt[95]=Pt;yt[72]=[Pt,hl];yt[104]=[Pt,hl];yt[87]=[Pt,dl];yt[119]=[Pt,dl];function WC(e,t,n){const r=this;let o,i;return a;function a(h){return!io(h)||!fl.call(r,r.previous)||Lo(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(h))}function u(h){return io(h)?(e.consume(h),u):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check($C,m,d)(h):h===45||h===95||Fe(h)?(i=!0,e.consume(h),c):m(h)}function d(h){return e.consume(h),o=!0,c}function m(h){return i&&o&&ze(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function qC(e,t,n){const r=this;return o;function o(a){return a!==87&&a!==119||!ml.call(r,r.previous)||Lo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UC,e.attempt(ul,e.attempt(ll,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function VC(e,t,n){const r=this;let o="",i=!1;return a;function a(h){return(h===72||h===104)&&pl.call(r,r.previous)&&!Lo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(h),e.consume(h),u):n(h)}function u(h){if(ze(h)&&o.length<5)return o+=String.fromCodePoint(h),e.consume(h),u;if(h===58){const f=o.toLowerCase();if(f==="http"||f==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),i?d:(i=!0,c)):n(h)}function d(h){return h===null||Wr(h)||Ie(h)||on(h)||Zr(h)?n(h):e.attempt(ul,e.attempt(ll,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function GC(e,t,n){let r=0;return o;function o(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),o):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function YC(e,t,n){let r,o,i;return a;function a(d){return d===46||d===95?e.check(cl,c,u)(d):d===null||Ie(d)||on(d)||d!==45&&Zr(d)?c(d):(i=!0,e.consume(d),a)}function u(d){return d===95?r=!0:(o=r,r=void 0),e.consume(d),a}function c(d){return o||r||!i?n(d):t(d)}}function XC(e,t){let n=0,r=0;return o;function o(a){return a===40?(n++,e.consume(a),o):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(cl,t,i)(a):a===null||Ie(a)||on(a)?t(a):(e.consume(a),o)}function i(a){return a===41&&r++,e.consume(a),o}}function QC(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),i):u===93?(e.consume(u),o):u===60||u===null||Ie(u)||on(u)?t(u):n(u)}function o(u){return u===null||u===40||u===91||Ie(u)||on(u)?t(u):r(u)}function i(u){return ze(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):ze(u)?(e.consume(u),a):n(u)}}function KC(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return Fe(i)?n(i):t(i)}}function ml(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function pl(e){return!ze(e)}function fl(e){return!(e===47||io(e))}function io(e){return e===43||e===45||e===46||e===95||Fe(e)}function Lo(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ZC={tokenize:iS,partial:!0};function JC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rS,continuation:{tokenize:sS},exit:oS}},text:{91:{name:"gfmFootnoteCall",tokenize:nS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eS,resolveTo:tS}}}}function eS(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const c=r.events[o][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return u;function u(c){if(!a||!a._balanced)return n(c);const d=mt(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function tS(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function nS(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(i>999||h===93&&!a||h===null||h===91||Ie(h))return n(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return o.includes(mt(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Ie(h)||(a=!0),i++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),i++,d):d(h)}}function rS(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(x)}function m(x){if(a>999||x===93&&!u||x===null||x===91||Ie(x))return n(x);if(x===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=mt(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Ie(x)||(u=!0),a++,e.consume(x),x===92?h:m}function h(x){return x===91||x===92||x===93?(e.consume(x),a++,m):m(x)}function f(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),o.includes(i)||o.push(i),fe(e,p,"gfmFootnoteDefinitionWhitespace")):n(x)}function p(x){return t(x)}}function sS(e,t,n){return e.check(mr,t,e.attempt(ZC,t,n))}function oS(e){e.exit("gfmFootnoteDefinition")}function iS(e,t,n){const r=this;return fe(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function aS(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(a,u){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let d=c;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},h={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},f=[["enter",m,u],["enter",a[d][1],u],["exit",a[d][1],u],["enter",h,u]],p=u.parser.constructs.insideSpan.null;p&&Ke(f,f.length,0,Jr(p,a.slice(d+1,c),u)),Ke(f,f.length,0,[["exit",h,u],["enter",a[c][1],u],["exit",a[c][1],u],["exit",m,u]]),Ke(a,d-1,c-d+3,f),c=d+f.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function i(a,u,c){const d=this.previous,m=this.events;let h=0;return f;function f(x){return d===126&&m[m.length-1][1].type!=="characterEscape"?c(x):(a.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const g=Cn(d);if(x===126)return h>1?c(x):(a.consume(x),h++,p);if(h<2&&!n)return c(x);const y=a.exit("strikethroughSequenceTemporary"),E=Cn(x);return y._open=!E||E===2&&!!g,y._close=!g||g===2&&!!E,u(x)}}}class uS{constructor(){this.map=[]}add(t,n,r){lS(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const i of o)t.push(i);o=r.pop()}this.map.length=0}}function lS(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function cS(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dS(){return{flow:{null:{name:"table",tokenize:hS,resolveAll:mS}}}}function hS(e,t,n){const r=this;let o=0,i=0,a;return u;function u(N){let H=r.events.length-1;for(;H>-1;){const Y=r.events[H][1].type;if(Y==="lineEnding"||Y==="linePrefix")H--;else break}const D=H>-1?r.events[H][1].type:null,$=D==="tableHead"||D==="tableRow"?A:c;return $===A&&r.parser.lazy[r.now().line]?n(N):$(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),d(N)}function d(N){return N===124||(a=!0,i+=1),m(N)}function m(N){return N===null?n(N):Q(N)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):he(N)?fe(e,m,"whitespace")(N):(i+=1,a&&(a=!1,o+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),h(N)))}function h(N){return N===null||N===124||Ie(N)?(e.exit("data"),m(N)):(e.consume(N),N===92?f:h)}function f(N){return N===92||N===124?(e.consume(N),h):h(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,he(N)?fe(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):x(N))}function x(N){return N===45||N===58?y(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),g):L(N)}function g(N){return he(N)?fe(e,y,"whitespace")(N):y(N)}function y(N){return N===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),E):N===45?(i+=1,E(N)):N===null||Q(N)?P(N):L(N)}function E(N){return N===45?(e.enter("tableDelimiterFiller"),R(N)):L(N)}function R(N){return N===45?(e.consume(N),R):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(N))}function C(N){return he(N)?fe(e,P,"whitespace")(N):P(N)}function P(N){return N===124?x(N):N===null||Q(N)?!a||o!==i?L(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):L(N)}function L(N){return n(N)}function A(N){return e.enter("tableRow"),z(N)}function z(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),z):N===null||Q(N)?(e.exit("tableRow"),t(N)):he(N)?fe(e,z,"whitespace")(N):(e.enter("data"),G(N))}function G(N){return N===null||N===124||Ie(N)?(e.exit("data"),z(N)):(e.consume(N),N===92?K:G)}function K(N){return N===92||N===124?(e.consume(N),G):G(N)}}function mS(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,c=0,d,m,h;const f=new uS;for(;++n<e.length;){const p=e[n],x=p[1];p[0]==="enter"?x.type==="tableHead"?(u=!1,c!==0&&(aa(f,t,c,d,m),m=void 0,c=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},f.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},f.add(n,0,[["enter",m,t]])),o=x.type==="tableDelimiterRow"?2:m?3:1):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],h=Pr(f,t,i,o,void 0,h),i=[0,0,0,0]),a[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],h=Pr(f,t,i,o,void 0,h)),i=a,a=[i[1],n,0,0])):x.type==="tableHead"?(u=!0,c=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(c=n,i[1]!==0?(a[0]=a[1],h=Pr(f,t,i,o,n,h)):a[1]!==0&&(h=Pr(f,t,a,o,n,h)),o=0):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&aa(f,t,c,d,m),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=cS(t.events,n))}return e}function Pr(e,t,n,r,o,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},xn(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const c=xn(t.events,n[1]);if(i={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const d=xn(t.events,n[2]),m=xn(t.events,n[3]),h={type:u,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,g=n[3]-n[2]-1;e.add(x,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return o!==void 0&&(i.end=Object.assign({},xn(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function aa(e,t,n,r,o){const i=[],a=xn(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function xn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pS={name:"tasklistCheck",tokenize:gS};function fS(){return{text:{91:pS}}}function gS(e,t,n){const r=this;return o;function o(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Ie(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(c)}function u(c){return Q(c)?t(c):he(c)?e.check({tokenize:xS},t,n)(c):n(c)}}function xS(e,t,n){return fe(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function ES(e){return va([zC(),JC(),aS(e),dS(),fS()])}const bS={};function IS(e){const t=this,n=e||bS,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(ES(n)),i.push(FC()),a.push(HC(n))}const jo=({isOrder:e,product:t})=>{var a;const{shopGeneral:n}=s.useStorefrontStore(),r=t.subscriptionSettings,{cart:o}=s.useCart();console.log(t.description);const{isAntistock:i}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("div",{className:`${ke.checkoutProduct} ${e?ke.isOrder:""}`,children:[s.jsxRuntimeExports.jsxs("div",{className:ke.productDetails,children:[s.jsxRuntimeExports.jsx("div",{className:`${ke.productImage} ${e?ke.isOrderImage:""} ${i?ke.productImageAntistock:""}`,children:t!=null&&t.image?s.jsxRuntimeExports.jsx("img",{className:ke.image,src:s.convertCfImageIdToUrl(t.image.cfId)}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Image",fill:"var(--text-secondary)"})}),s.jsxRuntimeExports.jsx("div",{className:ke.productInfo,children:s.jsxRuntimeExports.jsxs("div",{className:ke.productHeader,children:[s.jsxRuntimeExports.jsx("h2",{className:ke.productName,id:"h5",children:t.name}),s.jsxRuntimeExports.jsxs("span",{className:ke.quantityBadge,id:"md",children:[t.price.quantity,"x"]})]})}),t.chargeType==="RECURRING"&&s.jsxRuntimeExports.jsx("p",{className:ke.productPrice,id:"md",children:r&&`${s.formatPrice(r.price)} / ${s.normalizeInterval(r.recurringIntervalDays||0)}${r.entryFee?" + "+s.formatPrice(r.entryFee):""}`}),t.chargeType==="ONE_TIME"&&s.jsxRuntimeExports.jsx("p",{className:ke.productPrice,id:"md",children:t.variantsGateways&&o.gateway&&t.variantsGateways.some(u=>u.name===o.gateway&&u.overrodePrice)?s.formatPrice(((a=t.variantsGateways.find(u=>u.name===o.gateway))==null?void 0:a.overrodePrice)||t.price):s.formatPrice(t.price)})]}),t.description&&s.jsxRuntimeExports.jsx("p",{className:ke.productDescription,children:s.jsxRuntimeExports.jsx(tu,{remarkPlugins:[IS],rehypePlugins:[d_],components:{a:({node:u,...c})=>s.jsxRuntimeExports.jsx("a",{...c,target:"_blank",rel:"noopener noreferrer",className:ke.link})},children:t.description})}),t.deliveryCategories&&s.jsxRuntimeExports.jsx("div",{className:ke.deliveryCategories,children:t.deliveryCategories.map(u=>s.jsxRuntimeExports.jsx(s.DeliveryItem,{deliveryConfiguration:u},u.id))}),t.customerNote&&s.jsxRuntimeExports.jsxs("div",{className:ke.customerNote,children:[s.jsxRuntimeExports.jsxs("div",{className:ke.noteHeader,children:[(n==null?void 0:n.info.logo)&&s.jsxRuntimeExports.jsx("div",{className:ke.logoContainer,children:s.jsxRuntimeExports.jsx("img",{src:s.convertCfImageIdToUrl(n==null?void 0:n.info.logo.cfId)})}),s.jsxRuntimeExports.jsx("p",{className:ke.shopName,id:"md",children:n==null?void 0:n.info.name})]}),s.jsxRuntimeExports.jsx("p",{className:ke.noteContent,id:"md",children:t.customerNote})]})]})},TS="_coupon_dkjzv_1",_S="_couponApplied_dkjzv_7",CS="_discount_dkjzv_17",SS="_removeButton_dkjzv_23",yS="_removeButtonText_dkjzv_27",kS="_couponInput_dkjzv_31",RS="_couponInputContainer_dkjzv_37",Mt={coupon:TS,couponApplied:_S,discount:CS,removeButton:SS,removeButtonText:yS,couponInput:kS,couponInputContainer:RS},AS=({applyCoupon:e,couponData:t,discount:n,removeCoupon:r,gateway:o})=>{const[i,a]=k.useState(null),[u,c]=k.useState(!1),{isAntistock:d}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("div",{className:Mt.coupon,children:[u&&s.jsxRuntimeExports.jsx(s.ContentLoader,{speed:2,width:500,height:48,viewBox:"0 0 500 48",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:Mt.skeleton,children:s.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"100%",height:"48"})}),!u&&(t?s.jsxRuntimeExports.jsxs("div",{className:Mt.couponApplied,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"var(--text-success)"}),s.jsxRuntimeExports.jsxs("p",{id:"md",children:[i," is applied"," ",s.jsxRuntimeExports.jsxs("span",{className:Mt.discount,children:["-",n," ",!t.isFixed&&`(${t.discount}%)`]})]}),s.jsxRuntimeExports.jsx("button",{className:Mt.removeButton,onClick:r,children:s.jsxRuntimeExports.jsx("span",{className:Mt.removeButtonText,children:"Remove"})})]}):s.jsxRuntimeExports.jsxs("div",{className:Mt.couponInput,children:[s.jsxRuntimeExports.jsxs("div",{className:Mt.couponInputContainer,children:[s.jsxRuntimeExports.jsx(s.Input$1,{placeholder:"Enter a discount code",value:i||"",onChange:m=>{a(m===""?null:m)}}),s.jsxRuntimeExports.jsx(s.Button$1,{onClick:async()=>{c(!0),i&&await e(i),c(!1)},disabled:!o||!i,type:"Primary",children:"Apply"})]}),!o&&s.jsxRuntimeExports.jsx(s.Tip,{type:"warning",message:d?"Select a payment type to enter a discount or coupon code.":"The discount is related to the method of payment. Select to enter.",id:"md"})]}))]})},NS=({cart:e,products:t,applyCoupon:n,applyCouponPending:r,coupon:o,totalAndDiscount:i,removeCoupon:a})=>{var g;const{priceAdjusment:u}=s.useCartStore(),[c,d]=k.useState(!1),m=k.useMemo(()=>e.parts.map(y=>{const E=t.find(C=>C.id===y.productId),R=E==null?void 0:E.variants.find(C=>C.id===y.productVariantId);return y.chargeType==="RECURRING"&&d(!0),{id:(E==null?void 0:E.id)||0,image:E==null?void 0:E.images[0],name:(R==null?void 0:R.name)||"",description:(R==null?void 0:R.description)||"",price:{quantity:y.quantity,amount:(R==null?void 0:R.price.amount)||0,currency:R==null?void 0:R.price.currency},subscriptionSettings:R==null?void 0:R.subscriptionSettings,chargeType:y.chargeType,variantsGateways:R==null?void 0:R.gateways}}),[e,t]),h=((g=m[0])==null?void 0:g.price.currency)||"USD",f=new Intl.NumberFormat("en-US",{style:"currency",currency:h}),p=k.useMemo(()=>o&&!o.isFixed&&o.discount===100?i.total:i.totalWithDiscount?i.total-i.totalWithDiscount:0,[i,o]),x=u?(u==null?void 0:u.fixedAmount)+Math.round((i.totalWithDiscount!==void 0?i.totalWithDiscount:i.total-p)*((u==null?void 0:u.percentage)/100)):null;return s.jsxRuntimeExports.jsx("div",{className:Kt.checkoutItemsContainer,children:s.jsxRuntimeExports.jsxs("div",{className:Kt.innerContainer,children:[s.jsxRuntimeExports.jsx(cr,{}),s.jsxRuntimeExports.jsxs("div",{className:Kt.headerSection,children:[s.jsxRuntimeExports.jsx("header",{className:Kt.header,children:s.jsxRuntimeExports.jsx("h1",{id:"h3",children:"Checkout"})}),s.jsxRuntimeExports.jsx("div",{className:Kt.productsContainer,children:m.map(y=>s.jsxRuntimeExports.jsx(jo,{product:y},y.id))}),s.jsxRuntimeExports.jsx("div",{className:Kt.couponContainer,children:s.jsxRuntimeExports.jsx(AS,{applyCoupon:n,applyCouponPending:r,couponData:o,discount:f.format(p),removeCoupon:a,gateway:e.gateway})}),s.jsxRuntimeExports.jsx(dr,{formatter:f,coupon:o,total:i.total,discount:p,totalWithDiscount:i.totalWithDiscount,feeOrDiscount:c?null:x})]}),s.jsxRuntimeExports.jsx("div",{className:Kt.checkoutFooter,children:s.jsxRuntimeExports.jsx(vt,{})})]})})},wS="_checkoutOperational_1gpn5_1",LS="_innerContainer_1gpn5_16",jS="_antistock_1gpn5_25",vS="_paymentMethodsSection_1gpn5_30",PS="_socialConnectSection_1gpn5_36",DS="_socialConnectLabel_1gpn5_39",OS="_socialConnectContent_1gpn5_43",BS="_continueButton_1gpn5_47",MS="_button_1gpn5_51",FS="_checkoutFooter_1gpn5_55",Et={checkoutOperational:wS,innerContainer:LS,antistock:jS,paymentMethodsSection:vS,socialConnectSection:PS,socialConnectLabel:DS,socialConnectContent:OS,continueButton:BS,button:MS,checkoutFooter:FS},HS="_customFields_uhcib_2",US="_checkboxWrapper_uhcib_9",$S="_textareaWrapper_uhcib_16",zS="_inputWrapper_uhcib_17",WS="_requiredStar_uhcib_27",En={customFields:HS,checkboxWrapper:US,textareaWrapper:$S,inputWrapper:zS,requiredStar:WS},qS=({customFields:e,setCustomFields:t})=>{if(e.length===0)return null;const n=e.map(r=>s.jsxRuntimeExports.jsx(VS,{customField:r,setCustomFields:t},r.name));return s.jsxRuntimeExports.jsx("div",{className:En.customFields,children:n})},VS=({customField:e,setCustomFields:t})=>{const n=r=>{t(o=>o.map(i=>i.name===e.name?{...i,value:r}:i))};return s.jsxRuntimeExports.jsx(GS,{value:e.value??"",placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:n,label:e.name,regex:e.regex})},GS=({label:e,type:t,defaultValue:n,value:r,placeholder:o,regex:i,required:a,onValueChange:u})=>{if(k.useEffect(()=>{r===""&&n!==void 0&&u(String(n))},[]),t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox)return s.jsxRuntimeExports.jsxs("label",{className:En.checkboxWrapper,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:r==="true",onChange:d=>u(d?"true":"false")}),s.jsxRuntimeExports.jsxs("p",{className:En.checkboxLabel,children:[e,a&&s.jsxRuntimeExports.jsx("span",{className:En.requiredStar,children:"*"})]})]});if(t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Hidden)return s.jsxRuntimeExports.jsx("input",{type:"hidden",value:String(n??""),required:a});const c=d=>{(t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number?/^\d*$/:i?new RegExp(i):/.*/).test(d)&&u(d)};return t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Textarea?s.jsxRuntimeExports.jsx("div",{className:En.textareaWrapper,children:s.jsxRuntimeExports.jsx(s.Textarea$1,{label:e,value:r,placeholder:o,onChange:c,required:a})}):s.jsxRuntimeExports.jsx("div",{className:En.inputWrapper,children:s.jsxRuntimeExports.jsx(s.Input$1,{type:t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number?"number":"text",placeholder:t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number?"Type something number...":o,label:e,value:r,required:a,onChange:c})})},YS="_connectedContainer_1rxr8_1",XS="_userInfo_1rxr8_10",QS="_avatar_1rxr8_16",KS="_avatarImage_1rxr8_26",Dr={connectedContainer:YS,userInfo:XS,avatar:QS,avatarImage:KS},ZS=({customerEmail:e})=>{const{discordInfo:t,setDiscordInfo:n}=s.useDiscordStore(),{notifications:r,setNotifications:o}=s.useNotificationStore(),[i,a]=k.useState(!1),[u,c]=k.useState(0),[d,m]=k.useState(null),h=20,f=g=>{var y,E,R,C;return(E=(y=g==null?void 0:g.response)==null?void 0:y.data)!=null&&E.error?g.response.data.error:(C=(R=g==null?void 0:g.response)==null?void 0:R.data)!=null&&C.message?g.response.data.message:g!=null&&g.message?g.message:"Failed to connect to Discord. Please try again later."},p=(g,y)=>{o([...r,{id:s.v4(),message:g,status:y}])};k.useEffect(()=>{if(d&&i){const g=setInterval(()=>{d.closed&&(clearInterval(g),a(!1),m(null))},1e3);return()=>clearInterval(g)}},[d,i]);const x=()=>{e.trim()!==""&&(a(!0),c(0),lc({customerEmail:e,tsId:s.getTsId()}).then(({data:g})=>{const y=window.open(g.redirectUrl);m(y),(!y||y.closed||typeof y.closed>"u")&&setTimeout(()=>{const C=document.createElement("a");C.href=g.redirectUrl,C.target="_blank",C.click()});let E;const R=()=>{if(c(C=>C+1),u>=h||y&&y.closed){u>=h&&p("Authorization timeout. Please try again.","error"),a(!1),clearTimeout(E);return}cc({id:g.id,customerEmail:e}).then(({data:C})=>{n({authorized:!0,id:g.id,avatar:C.avatar,username:C.username}),y&&y.close(),a(!1),m(null),p("Discord successfully connected!","success"),clearTimeout(E)}).catch(C=>{var P;if(console.log("Waiting for authorization...",C,{newWindow:y}),y&&y.closed){a(!1),clearTimeout(E);return}if((P=C==null?void 0:C.response)!=null&&P.status&&C.response.status!==404&&C.response.status>=400){p(f(C),"error"),a(!1),clearTimeout(E);return}clearTimeout(E),E=setTimeout(R,1500)})};R()}).catch(g=>{console.log("Could not initiate Discord authorization",g),p(f(g),"error"),a(!1)}))};return t!=null&&t.authorized?s.jsxRuntimeExports.jsxs("div",{className:Dr.connectedContainer,children:[s.jsxRuntimeExports.jsxs("div",{className:Dr.userInfo,children:[s.jsxRuntimeExports.jsx("div",{className:Dr.avatar,children:t.avatar?s.jsxRuntimeExports.jsx("img",{className:Dr.avatarImage,src:`https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=256`}):s.jsxRuntimeExports.jsx(s.Icon,{name:"UserCircle"})}),s.jsxRuntimeExports.jsx("p",{children:t.username}),s.jsxRuntimeExports.jsx(Rf,{})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Reconnect"})]}):s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},disabled:i,children:i?s.jsxRuntimeExports.jsx(s.Loader,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"DiscordLogo"}),s.jsxRuntimeExports.jsx(s.StableText,{children:"Connect Your Discord"})]})})},JS="_paymentMethodsContainer_1pfqr_2",e3="_antistock_1pfqr_15",ua={paymentMethodsContainer:JS,antistock:e3},t3="_bottomSheet_1x8kc_1",n3="_content_1x8kc_8",r3="_description_1x8kc_11",s3="_title_1x8kc_15",o3="_buttonGroup_1x8kc_19",i3="_buttonWrapper_1x8kc_29",a3="_fullWidthButton_1x8kc_32",u3="_modal_1x8kc_36",l3="_header_1x8kc_43",wt={bottomSheet:t3,content:n3,description:r3,title:s3,buttonGroup:o3,buttonWrapper:i3,fullWidthButton:a3,modal:u3,header:l3},c3=({setIsOpen:e,balance:t})=>{const n=s.useNavigate(),{setIsOpen:r}=s.useModalStore(),o=()=>{n("/top-up?redirectRoute=checkout")};function i(){r(!1),setTimeout(()=>{e(!1)},300)}return s.jsxRuntimeExports.jsxs("div",{className:wt.modal,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:wt.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:wt.title,children:"Insufficient Customer Balance"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:i,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:wt.bottomSheet,children:[s.jsxRuntimeExports.jsx("div",{className:wt.content,children:s.jsxRuntimeExports.jsxs("p",{className:wt.description,children:["You currently have ",t&&s.formatPrice(t)," in your balance. After topping up the required amount, you can continue to checkout."]})}),s.jsxRuntimeExports.jsxs("div",{className:wt.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:wt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:i,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:wt.fullWidthButton,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:o,children:"Add Balance"})})]})]})]})},gl=({align:e,gateway:t,gatewayDisplayName:n,selected:r,onSelect:o,total:i,onSignInClick:a,reversed:u})=>{const{token:c}=s.useStorefrontStore(),{balance:d}=s.useCustomerDashboardStore(),[m,h]=k.useState(!1),{setIsOpen:f}=s.useModalStore(),p=x=>{x.stopPropagation(),o&&o(t),d&&d.amount<i&&(h(!0),f(!0))};return k.useEffect(()=>{},[d,i]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(s.styles$3.paymentMethod,{[s.styles$3.selected]:r,[s.styles$3.alignColumn]:e==="column",[s.styles$3.reversed]:u}),onClick:p,children:[s.jsxRuntimeExports.jsxs("p",{className:s.styles$3.paymentText,id:"md",children:[n," ",s.jsxRuntimeExports.jsxs("span",{className:s.styles$3.balanceText,id:"md",children:["(",c?d&&s.formatPrice(d):s.jsxRuntimeExports.jsx("a",{className:s.styles$3.signInLink,onClick:a,id:"md",children:"Sign in"}),")"]})]}),s.jsxRuntimeExports.jsx("div",{className:s.styles$3.iconContainer,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]}),m&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>h(!1),children:s.jsxRuntimeExports.jsx(c3,{setIsOpen:h,balance:d})})]})},xl=({possibleGateways:e,setGateway:t,totalAndDiscount:n,onSignInClick:r,setPaymentMethod:o,isAntistock:i=!1})=>{const[a,u]=k.useState(),[c,d]=k.useState(),{setPriceAdjustment:m}=s.useCartStore(),[h,f]=k.useState(null),p=(x,g)=>{var y;c!==g&&(t(g),m(((y=h==null?void 0:h.find(E=>E.name===g))==null?void 0:y.priceAdjustment)||null)),o(x),u(x),d(g)};return k.useEffect(()=>{if(h&&h.length>0){const x=h[0];if(x.name==="Balance")d(x.name),t(x.name),m(x.priceAdjustment||null);else if(x.paymentMethods&&x.paymentMethods.length>0){const g=x.paymentMethods[0];u(g),d(x.name),t(x.name),o(g),m(x.priceAdjustment||null)}}},[h]),k.useEffect(()=>{const x=async()=>{const{data:g}=await s.fetchGatewaysDetail([...e.availableGateways,...e.requiresSignInGateways]);f(g)};e.availableGateways.length&&x()},[]),k.useLayoutEffect(()=>{m(null)},[]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[h&&s.jsxRuntimeExports.jsx("div",{className:s.clx(ua.paymentMethodsContainer,{[ua.antistock]:i}),children:h==null?void 0:h.map(x=>x.name==="Balance"?s.jsxRuntimeExports.jsx(gl,{gateway:x.name,gatewayDisplayName:x.displayName,onSelect:g=>{d(g),c!==g&&t(g)},selected:x.name===c,total:n.total,onSignInClick:r,reversed:!0},x.name):x.paymentMethods.map(g=>s.jsxRuntimeExports.jsx(s.CheckoutPaymentMethod,{paymentMethod:g,gateway:x.name,gatewayDisplayName:x.displayName,gatewayLogoCfId:x.logoCfImageId,poweredByLogoCfId:x.poweredByImageCfImageId,onSelect:y=>p(y,x.name),selected:a===g&&c===x.name},`${x.name}-${g}`)))}),!h&&s.jsxRuntimeExports.jsx(s.ContentLoader,{speed:2,width:"100%",height:"220px",viewBox:"0 0 600 220",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",children:s.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"100%",height:"100%"})})]})},d3="_modal_14r0b_1",h3={modal:d3},m3=({setIsOpen:e})=>{const{token:t}=s.useStorefrontStore(),{setIsOpen:n}=s.useModalStore();k.useEffect(()=>{t&&r()},[t]);const r=()=>{n(!1),setTimeout(()=>{e(!1)},300)};return s.jsxRuntimeExports.jsx("div",{className:h3.modal,onClick:o=>o.stopPropagation(),children:s.jsxRuntimeExports.jsx(s.Auth,{inModal:!0})})},p3=({getPossibleGateways:e,setGateway:t,getDiscordSettings:n,cart:r,products:o,submitCart:i,reset:a,setCustomFieldsToCart:u,totalAndDiscount:c,setDiscordSocialConnectId:d,setPaymentMethod:m,isAntistock:h})=>{const f=k.useMemo(()=>n(),[]),[p,x]=k.useState([]),{balance:g,setBalance:y}=s.useCustomerDashboardStore(),{token:E}=s.useStorefrontStore(),{executeRecaptcha:R}=s.useReCaptcha(),{discordInfo:C}=s.useDiscordStore(),{customerEmail:P,setCustomerEmail:L}=s.useCartStore(),A=C!=null&&C.authorized?C.id:void 0,z=s.useNavigate(),G=k.useMemo(()=>e(),[r.parts]),[K,N]=k.useState(!1),{setIsOpen:H}=s.useModalStore(),{notifications:D,setNotifications:$}=s.useNotificationStore();k.useEffect(()=>{const V=s.getCommonCustomFields(r.parts,o).map(ue=>ue.type===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox?{...ue,value:String(ue.defaultValue)}:ue);x([...V])},[]),k.useEffect(()=>{const W=s.getCommonCustomFields(r.parts,o);x(V=>{const ue=new Map(V.map(T=>[T.name,T]));return W.map(T=>{const ce=ue.get(T.name);return ce&&ce.value?{...T,value:ce.value}:T.type===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox?{...T,value:String(T.defaultValue)}:T})})},[r.parts,o]),k.useEffect(()=>{E&&(async()=>{const V=await s.getBalance();y(V)})()},[E]);function Y(W){return W&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(W)}const q=()=>{const W=[];return p.forEach(V=>{var ue;V.required&&!((ue=V.value)!=null&&ue.toString().trim())&&W.push({message:`Field "${V.name}" is required.`,status:"error",id:s.v4()})}),W.length>0?($([...D,...W]),!1):!0},Z=async W=>{if(W.stopPropagation(),r.gateway==="Balance"&&!E){H(!0),N(!0);return}if(!q())return;const V=Object.fromEntries(p.map(T=>[T.name,T.value||""]));u({...V}),A&&f.isEnabled&&d(A);const ue=await R();if(ue){const T=await i(ue),ce=JSON.parse(localStorage.getItem("orders")||"{}");if(Object.keys(ce).length>10){const je=Date.now()-864e5;Object.keys(ce).forEach(S=>{ce[S].createdAt<=je&&delete ce[S]})}"order"in T?ce[T.order.id]={createdAt:Date.now(),fullAccessToken:T.order.fullAccessToken}:ce[T.id]={createdAt:Date.now(),fullAccessToken:T.fullAccessToken},localStorage.setItem("orders",JSON.stringify(ce)),z(`/orders/${"order"in T?T.order.id:T.id}/${"order"in T?T.order.fullAccessToken:T.fullAccessToken}`),setTimeout(()=>a(),0)}};return s.jsxRuntimeExports.jsxs("div",{className:Et.checkoutOperational,children:[s.jsxRuntimeExports.jsxs("div",{className:Et.innerContainer,children:[r.parts.length>0&&s.jsxRuntimeExports.jsx(xl,{possibleGateways:G,setGateway:t,setPaymentMethod:m,balance:g,totalAndDiscount:c,onSignInClick:()=>{N(!0),H(!0)},isAntistock:h}),s.jsxRuntimeExports.jsx("div",{className:s.clx(Et.paymentMethodsSection,{[Et.antistock]:h}),children:s.jsxRuntimeExports.jsx(s.Input$1,{placeholder:"mail@mail.com",value:P||"",onChange:W=>L(W),disabled:!!E,label:"Email Address"})}),s.jsxRuntimeExports.jsx(qS,{customFields:p,setCustomFields:x}),f.isEnabled&&s.jsxRuntimeExports.jsxs("div",{className:Et.socialConnectSection,children:[s.jsxRuntimeExports.jsx("p",{className:Et.socialConnectLabel,id:"md",children:"Social Connect"}),s.jsxRuntimeExports.jsx("div",{className:Et.socialConnectContent,children:s.jsxRuntimeExports.jsx(ZS,{customerEmail:P||""})})]}),s.jsxRuntimeExports.jsxs("div",{className:Et.continueButton,children:[s.jsxRuntimeExports.jsx(s.Button$1,{onClick:Z,disabled:!r.gateway||!Y(P||"")||f.isRequired&&!(C!=null&&C.authorized),className:Et.button,children:"Continue to Checkout"}),!h&&s.jsxRuntimeExports.jsx(s.TermsOfService,{}),s.jsxRuntimeExports.jsx(s.SecuredBySsl,{})]}),s.jsxRuntimeExports.jsx(vt,{className:Et.checkoutFooter})]}),K&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>N(!1),children:s.jsxRuntimeExports.jsx(m3,{setIsOpen:N})})]})},f3="_mt1_1t7v2_1",g3="_notifyBlock_1t7v2_13",x3="_notifyHeader_1t7v2_19",E3="_notifyContent_1t7v2_25",b3="_buttonBlock_1t7v2_30",I3="_imageBlock_1t7v2_34",T3="_imageContainer_1t7v2_42",_3="_sectionBlock_1t7v2_54",C3="_sectionTitle_1t7v2_61",S3="_sectionSubtitle_1t7v2_64",y3="_inputContainer_1t7v2_69",pt={mt1:f3,notifyBlock:g3,notifyHeader:x3,notifyContent:E3,buttonBlock:b3,imageBlock:I3,imageContainer:T3,sectionBlock:_3,sectionTitle:C3,sectionSubtitle:S3,inputContainer:y3},k3=({props:e})=>{const t=s.useCopy();return s.jsxRuntimeExports.jsx("div",{className:pt.mt1,children:s.jsxRuntimeExports.jsxs("div",{className:pt.inputContainer,children:[s.jsxRuntimeExports.jsx(s.Input$1,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:()=>t(e.text),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"})})]})})},R3=({props:e})=>s.jsxRuntimeExports.jsx(s.Button$1,{className:pt.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),A3=({props:e})=>s.jsxRuntimeExports.jsx("div",{className:pt.imageBlock,children:s.jsxRuntimeExports.jsx("div",{className:pt.imageContainer,children:s.jsxRuntimeExports.jsx("img",{src:e.src,alt:""})})}),N3=({props:e})=>s.jsxRuntimeExports.jsxs("div",{className:pt.notifyBlock,children:[s.jsxRuntimeExports.jsxs("div",{className:pt.notifyHeader,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),s.jsxRuntimeExports.jsx("p",{children:e.heading})]}),s.jsxRuntimeExports.jsx("p",{className:pt.notifyContent,children:e.content})]}),w3=({props:e})=>{var t;return s.jsxRuntimeExports.jsxs("div",{className:pt.sectionBlock,children:[s.jsxRuntimeExports.jsx("p",{className:pt.sectionTitle,children:e.title}),s.jsxRuntimeExports.jsx("span",{className:pt.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>s.jsxRuntimeExports.jsx(El,{block:n},r))]})},El=({block:e})=>{switch(e.type){case"Section":return s.jsxRuntimeExports.jsx(w3,{...e});case"ReadOnlyTextInput":return s.jsxRuntimeExports.jsx(k3,{...e});case"Notify":return s.jsxRuntimeExports.jsx(N3,{...e});case"Button":return s.jsxRuntimeExports.jsx(R3,{...e});case"Image":return s.jsxRuntimeExports.jsx(A3,{...e});default:return null}},L3="_bottomSheet_1x4sq_1",j3="_content_1x4sq_8",v3="_agreementList_1x4sq_11",P3="_agreementItem_1x4sq_16",D3="_warning_1x4sq_23",O3="_buttonGroup_1x4sq_31",B3="_buttonWrapper_1x4sq_41",M3="_fullWidthButton_1x4sq_44",F3="_modal_1x4sq_48",H3="_header_1x4sq_55",Je={bottomSheet:L3,content:j3,agreementList:v3,agreementItem:P3,warning:D3,buttonGroup:O3,buttonWrapper:B3,fullWidthButton:M3,modal:F3,header:H3},U3=({setIsOpen:e,price:t})=>{const[n,r]=k.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:o}=s.useModalStore(),i=()=>{o(!1),setTimeout(()=>{e(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:Je.modal,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:Je.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Note"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:i,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:Je.bottomSheet,children:[s.jsxRuntimeExports.jsxs("div",{className:Je.content,children:[s.jsxRuntimeExports.jsxs("div",{className:Je.agreementList,children:[s.jsxRuntimeExports.jsxs("label",{className:Je.agreementItem,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:n.agreeToSendAsFF,onChange:a=>r({...n,agreeToSendAsFF:a})}),s.jsxRuntimeExports.jsx("p",{children:"I agree to send the payment as friends & family"})]}),s.jsxRuntimeExports.jsxs("label",{className:Je.agreementItem,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:n.agreeToSend,onChange:a=>r({...n,agreeToSend:a})}),s.jsxRuntimeExports.jsxs("p",{children:["I agree to send the payment of ",s.formatPrice(t)," ",t.currency]})]}),s.jsxRuntimeExports.jsxs("label",{className:Je.agreementItem,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:n.agreeToNotAddNote,onChange:a=>r({...n,agreeToNotAddNote:a})}),s.jsxRuntimeExports.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),s.jsxRuntimeExports.jsx("div",{className:Je.warning,children:s.jsxRuntimeExports.jsxs("p",{children:["Please note that you are required to send the exact payment of ",s.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),s.jsxRuntimeExports.jsxs("div",{className:Je.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:Je.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",children:s.jsxRuntimeExports.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),s.jsxRuntimeExports.jsx("div",{className:Je.fullWidthButton,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:i,children:"Continue to Payment"})})]})]})]})},$3="_chargeItemsContainer_qmv3w_4",z3="_chargeItemsInner_qmv3w_20",W3="_productsContainer_qmv3w_27",q3="_chargeHeader_qmv3w_41",V3="_chargeTitle_qmv3w_49",G3="_chargeDescription_qmv3w_55",Y3="_copyButton_qmv3w_61",X3="_productsList_qmv3w_73",Q3="_trackingContainer_qmv3w_81",K3="_footerContainer_qmv3w_91",bt={chargeItemsContainer:$3,chargeItemsInner:z3,productsContainer:W3,chargeHeader:q3,chargeTitle:V3,chargeDescription:G3,copyButton:Y3,productsList:X3,trackingContainer:Q3,footerContainer:K3},Z3=({charge:e})=>{var i;const t=s.useCopy(),n=(e==null?void 0:e.price.currency)||"USD",r=new Intl.NumberFormat("en-US",{style:"currency",currency:n}),o=k.useMemo(()=>{var a;return((a=e==null?void 0:e.order)==null?void 0:a.partOrders.map(u=>{var c,d,m,h,f,p;return{id:(u==null?void 0:u.id)||0,image:u.productWithVariant.image,name:((c=u.productWithVariant)==null?void 0:c.variantName)||"",description:((d=u.productWithVariant)==null?void 0:d.description)||"",price:{quantity:u.quantity,amount:((m=u.productWithVariant)==null?void 0:m.price.amount)||0,currency:(h=u.productWithVariant)==null?void 0:h.price.currency},subscriptionSettings:(f=e.order)!=null&&f.subscriptionOrderId?(p=u.productWithVariant)==null?void 0:p.subscriptionSettings:null}}))||[]},[e]);return s.jsxRuntimeExports.jsx("div",{className:bt.chargeItemsContainer,children:s.jsxRuntimeExports.jsxs("div",{className:bt.chargeItemsInner,children:[s.jsxRuntimeExports.jsx(cr,{expiresAt:e==null?void 0:e.expiresAt}),s.jsxRuntimeExports.jsxs("div",{className:bt.productsContainer,children:[(e==null?void 0:e.name)&&s.jsxRuntimeExports.jsxs("header",{className:bt.chargeHeader,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("h1",{className:bt.chargeTitle,id:"h5",children:e.name}),e.description&&s.jsxRuntimeExports.jsx("p",{className:bt.chargeDescription,id:"md",children:e.description})]}),((i=e.order)==null?void 0:i.id)&&s.jsxRuntimeExports.jsxs(s.Button$1,{type:"Secondary",className:bt.copyButton,onClick:()=>{var a;return t(((a=e.order)==null?void 0:a.id)||"")},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"}),"Copy Order ID"]})]}),s.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[!!o.length&&s.jsxRuntimeExports.jsx("div",{className:bt.productsList,children:o.map(a=>s.jsxRuntimeExports.jsx(jo,{product:a},a.id))}),s.jsxRuntimeExports.jsx(dr,{formatter:r,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1})]}),s.jsxRuntimeExports.jsxs("div",{children:[e&&s.jsxRuntimeExports.jsx("div",{className:bt.trackingContainer,children:s.jsxRuntimeExports.jsx(s.TrackPayment,{timeline:e.timeline})}),s.jsxRuntimeExports.jsx(vt,{className:bt.footerContainer})]})]})]})})},J3="_checkoutOrderMainData_hqf60_1",ey="_orderDetailRow_hqf60_6",ty="_chargeIdRow_hqf60_16",ny="_detailLabel_hqf60_25",ry="_detailValue_hqf60_29",sy="_chargeIdContainer_hqf60_33",oy="_chargeId_hqf60_16",iy="_copyIcon_hqf60_51",$e={checkoutOrderMainData:J3,orderDetailRow:ey,chargeIdRow:ty,detailLabel:ny,detailValue:ry,chargeIdContainer:sy,chargeId:oy,copyIcon:iy},bl=({lastUpdate:e,invoiceId:t,email:n,paymentType:r})=>{const o=s.useCopy(),[i,a]=k.useState(null),u=i==null?void 0:i.find(d=>d.name===r);k.useEffect(()=>{i||(async()=>{const m=[r],h=await s.getGatewaysDetail(m);a(h)})()},[r,i]);const c=d=>{const m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h=d.getDate().toString().padStart(2,"0"),f=m[d.getMonth()],p=d.getFullYear(),x=d.getHours(),g=d.getMinutes().toString().padStart(2,"0"),y=d.getSeconds().toString().padStart(2,"0"),E=x>=12?"PM":"AM",R=(x%12||12).toString().padStart(2,"0");return`${f} ${h}, ${p} at ${R}:${g}:${y} ${E}`};return s.jsxRuntimeExports.jsxs("div",{className:$e.checkoutOrderMainData,children:[s.jsxRuntimeExports.jsxs("div",{className:$e.orderDetailRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Last Updated"}),s.jsxRuntimeExports.jsx("p",{className:$e.detailValue,id:"md",children:c(new Date(e))})]}),s.jsxRuntimeExports.jsxs("div",{className:$e.orderDetailRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Payment Type"}),s.jsxRuntimeExports.jsx("p",{className:$e.detailValue,id:"md",children:u==null?void 0:u.displayName})]}),s.jsxRuntimeExports.jsxs("div",{className:$e.orderDetailRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Email"}),s.jsxRuntimeExports.jsx("p",{className:$e.detailValue,id:"md",children:n})]}),s.jsxRuntimeExports.jsxs("div",{className:$e.chargeIdRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Charge ID"}),s.jsxRuntimeExports.jsxs("div",{className:$e.chargeIdContainer,children:[s.jsxRuntimeExports.jsx("p",{className:$e.chargeId,id:"md",children:t}),s.jsxRuntimeExports.jsx("div",{className:$e.copyIcon,onClick:()=>o(t),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"})})]})]})]})},ay="_bottomSheet_1yai1_1",uy="_formContainer_1yai1_8",ly="_error_1yai1_14",cy="_buttonGroup_1yai1_18",dy="_buttonWrapper_1yai1_28",hy="_fullWidthButton_1yai1_31",my="_modal_1yai1_41",py="_header_1yai1_48",Ft={bottomSheet:ay,formContainer:uy,error:ly,buttonGroup:cy,buttonWrapper:dy,fullWidthButton:hy,modal:my,header:py},fy=({chargeId:e,setIsOpen:t})=>{const[n,r]=k.useState(""),[o,i]=k.useState(""),{setIsOpen:a}=s.useModalStore(),u=m=>{try{return new URL(m),!0}catch{return!1}},c=async m=>{if(m.preventDefault(),!n){i("The link field cannot be empty.");return}if(!u(n)){i("Please enter a valid URL");return}await rc({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},d=()=>{a(!1),setTimeout(()=>{t(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:Ft.modal,onClick:m=>m.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:Ft.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"CashApp Verify"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:d,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsx("form",{onSubmit:c,children:s.jsxRuntimeExports.jsxs("div",{className:Ft.bottomSheet,children:[s.jsxRuntimeExports.jsx("div",{className:Ft.formContainer,children:s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx(s.Input$1,{value:n,onChange:m=>{r(m),i("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),o&&s.jsxRuntimeExports.jsx("p",{className:Ft.error,children:o})]})}),s.jsxRuntimeExports.jsxs("div",{className:Ft.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:Ft.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:d,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:Ft.fullWidthButton,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",children:"Verify"})})]})]})})]})},gy="_container_1opbn_1",xy="_productDetails_1opbn_8",Ey="_imageContainer_1opbn_14",by="_image_1opbn_14",Iy="_textContainer_1opbn_32",Ty="_header_1opbn_40",_y="_title_1opbn_46",Cy="_price_1opbn_53",Sy="_badgeContainer_1opbn_57",yy="_description_1opbn_61",It={container:gy,productDetails:xy,imageContainer:Ey,image:by,textContainer:Iy,header:Ty,title:_y,price:Cy,badgeContainer:Sy,description:yy},ky=({subscription:e})=>s.jsxRuntimeExports.jsxs("div",{className:It.container,children:[s.jsxRuntimeExports.jsxs("div",{className:It.productDetails,children:[s.jsxRuntimeExports.jsx("div",{className:It.imageContainer,children:e!=null&&e.image?s.jsxRuntimeExports.jsx("img",{className:It.image,src:s.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Image"})}),s.jsxRuntimeExports.jsxs("div",{className:It.textContainer,children:[s.jsxRuntimeExports.jsx("div",{className:It.header,children:s.jsxRuntimeExports.jsx("h2",{className:It.title,children:e.name})}),s.jsxRuntimeExports.jsxs("p",{className:It.price,children:[s.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsxRuntimeExports.jsx("div",{className:It.badgeContainer,children:s.jsxRuntimeExports.jsx(s.SubscriptionStatusBadge,{status:e.status})})]}),e.description&&s.jsxRuntimeExports.jsx(tu,{className:It.description,children:e.description})]}),Ry="_card_69liy_1",Ay="_price_69liy_10",Ny="_interval_69liy_17",wy="_name_69liy_22",Ly="_description_69liy_28",jy="_currentPlan_69liy_32",vy="_selectButton_69liy_45",Py="_progressSection_69liy_50",Dy="_progressLabel_69liy_54",Oy="_bottomSheet_69liy_60",By="_title_69liy_69",My="_typeSelector_69liy_80",Fy="_typeOption_69liy_90",Hy="_active_69liy_100",Uy="_saveTag_69liy_108",$y="_planSelector_69liy_117",zy="_modal_69liy_127",Wy="_inactive_69liy_148",qy="_notMounted_69liy_151",Vy="_closeButton_69liy_157",Se={card:Ry,price:Ay,interval:Ny,name:wy,description:Ly,currentPlan:jy,selectButton:vy,progressSection:Py,progressLabel:Dy,bottomSheet:Oy,title:By,typeSelector:My,typeOption:Fy,active:Hy,saveTag:Uy,planSelector:$y,modal:zy,inactive:Wy,notMounted:qy,closeButton:Vy},Gy=({variant:e,onSelect:t,isCurrent:n})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",o=e.subscriptionSettings.price.amount.toFixed(2),i=e.subscriptionSettings.recurringIntervalDays,a=10;return s.jsxRuntimeExports.jsxs("div",{className:Se.card,onClick:t,children:[s.jsxRuntimeExports.jsxs("h2",{className:Se.price,children:["$",o," ",s.jsxRuntimeExports.jsxs("span",{className:Se.interval,children:["/ ",r]})]}),s.jsxRuntimeExports.jsx("h3",{className:Se.name,children:e.name}),e.description&&s.jsxRuntimeExports.jsx("p",{className:Se.description,children:e.description}),n?s.jsxRuntimeExports.jsxs("div",{className:Se.currentPlan,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Check"}),"Your current Plan"]}):s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",className:Se.selectButton,children:"Select"}),n&&s.jsxRuntimeExports.jsxs("div",{className:Se.progressSection,children:[s.jsxRuntimeExports.jsx(fa,{percent:a/i*100,disablePercentLabel:!0}),s.jsxRuntimeExports.jsxs("p",{className:Se.progressLabel,children:["Used: ",a," of ",i," days"]})]})]})},Yy=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,o]=k.useState(null),[i,a]=k.useState(null),[u,c]=k.useState(null),{id:d,accessToken:m}=s.useParams(),[h,f]=k.useState(!1),[p,x]=k.useState(!1),{setIsOpen:g}=s.useModalStore();k.useEffect(()=>{e&&f(!0)},[e]);const y=()=>{t(!1)},[E,R]=k.useState(null);k.useEffect(()=>{d&&m&&(async()=>{if(d&&m){const{data:A}=await s.getSubscriptionUpgradePlans({id:d,accessToken:m});R(A)}})()},[d,m]),k.useEffect(()=>{var L;if(E!=null&&E.data.types[0]){const A=(L=E.data.types.flatMap(z=>z.productVariants).find(z=>z.data.id===(n==null?void 0:n.variantId)))==null?void 0:L.data;A&&(c(A),a(A))}},[E,n]),k.useEffect(()=>{E!=null&&E.data.types[0]&&o(E==null?void 0:E.data.types[0])},[E==null?void 0:E.data.types]);const C=L=>{o(L),a(null)},P=L=>{a(L),g(!0),x(!0)};return s.jsxRuntimeExports.jsxs("div",{className:s.clx(Se.modal,{[Se.active]:e,[Se.inactive]:!e&&h,[Se.notMounted]:!h}),onClick:L=>L.stopPropagation(),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:y,hoverable:!0,className:Se.closeButton,fill:"var(--text-primary)"}),s.jsxRuntimeExports.jsxs("div",{className:Se.bottomSheet,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:Se.title,children:"Change Plan"}),s.jsxRuntimeExports.jsx("p",{className:Se.description,children:E==null?void 0:E.data.description}),s.jsxRuntimeExports.jsx("div",{className:Se.typeSelector,children:E==null?void 0:E.data.types.map(L=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(Se.typeOption,{[Se.active]:(r==null?void 0:r.id)===L.id}),onClick:()=>C(L),children:[L.name,L.name==="Yearly"&&s.jsxRuntimeExports.jsx("span",{className:Se.saveTag,children:"Save %"})]},L.id))}),r&&s.jsxRuntimeExports.jsx("div",{className:Se.planSelector,children:r.productVariants.map(L=>s.jsxRuntimeExports.jsx(Gy,{variant:L.data,isSelected:(i==null?void 0:i.id)===L.data.id,isCurrent:(u==null?void 0:u.id)===L.data.id,onSelect:()=>P(L.data)},L.data.id))})]}),p&&i&&n&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>{x(!1)},children:s.jsxRuntimeExports.jsx(Mk,{setIsOpen:x,selectedVariant:i,subscription:n})})]})},Xy="_container_nb625_1",Qy="_title_nb625_11",Ky="_subtitle_nb625_16",Zy="_info_nb625_20",Or={container:Xy,title:Qy,subtitle:Ky,info:Zy},Jy=()=>{const{subscription:e}=s.useSubscriptionStore(),[t,n]=s.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,o]=k.useState(!1),{setIsOpen:i}=s.useModalStore();return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:Or.container,children:[s.jsxRuntimeExports.jsxs("div",{className:Or.info,children:[s.jsxRuntimeExports.jsx("p",{className:Or.title,children:"Expiration Date"}),s.jsxRuntimeExports.jsxs("p",{className:Or.subtitle,children:[t," at ",n]})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Special",onClick:a=>{a.stopPropagation(),i(!0),o(!0)},children:"Extend"})]}),r&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>o(!1),children:s.jsxRuntimeExports.jsx(nR,{setIsOpen:o})})]})},ek="_couponContainer_1sspa_1",tk="_iconWrapper_1sspa_10",nk="_details_1sspa_21",rk="_title_1sspa_25",sk="_progress_1sspa_29",ok="_foreverText_1sspa_34",gn={couponContainer:ek,iconWrapper:tk,details:nk,title:rk,progress:sk,foreverText:ok},ik=({coupon:e,currency:t})=>{const n=e.isFixed?s.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?s.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return s.jsxRuntimeExports.jsxs("div",{className:gn.couponContainer,children:[s.jsxRuntimeExports.jsx("div",{className:gn.iconWrapper,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CheckCircle"})}),s.jsxRuntimeExports.jsxs("div",{className:gn.details,children:[s.jsxRuntimeExports.jsxs("p",{className:gn.title,children:[e.name,", ",n," discount"]}),s.jsxRuntimeExports.jsx("div",{className:gn.progress,children:s.jsxRuntimeExports.jsx(fa,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),s.jsxRuntimeExports.jsx("p",{className:gn.foreverText,children:"Forever discount code"})]})]})},ak="_paymentMethodContainer_1g0da_4",uk="_paymentMethodTitle_1g0da_15",lk="_activeMethod_1g0da_20",ck="_noMethod_1g0da_28",dk="_activeMethodPaymentMethod_1g0da_37",hk="_paymentMethodLogo_1g0da_47",mk="_paymentMethodNumber_1g0da_57",pk="_method_1g0da_61",Wt={paymentMethodContainer:ak,paymentMethodTitle:uk,activeMethod:lk,noMethod:ck,activeMethodPaymentMethod:dk,paymentMethodLogo:hk,paymentMethodNumber:mk,method:pk},fk="_paymentMethods_1gev0_1",gk="_modal_1gev0_14",xk="_header_1gev0_28",Ek="_content_1gev0_37",Jt={paymentMethods:fk,modal:gk,header:xk,content:Ek},bk=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:o}=s.useSubscriptionStore();if(!r)return null;const{id:i}=s.useParams(),a=s.useNavigate(),{notifications:u,setNotifications:c}=s.useNotificationStore(),{setPaymentMethod:d,setGateway:m,cart:h}=s.useCart(),{setIsOpen:f}=s.useModalStore();async function p(){if(x(),t(!0),i&&r){const{data:g}=await s.changeSubscriptionGateway(i,h.gateway);g.isReconnectPaymentNeeded?a(`/charges/${g.chargeId}`):(c([...u,{status:"success",id:s.v4(),message:"Your action has been successfully completed"}]),o({...r,gatewayName:h.gateway}))}else c([...u,{status:"error",id:s.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function x(){f(!1),setTimeout(()=>{n(!1)},300)}return s.jsxRuntimeExports.jsxs("div",{className:Jt.modal,onClick:g=>{g.stopPropagation()},children:[s.jsxRuntimeExports.jsxs("div",{className:Jt.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:Jt.title,children:"Choose Payment Method"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:x,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:Jt.content,children:[(r==null?void 0:r.availableGateways)&&s.jsxRuntimeExports.jsx(xl,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:m,setPaymentMethod:d,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>a("/customer-dash")}),s.jsxRuntimeExports.jsxs("div",{className:Jt.paymentMethods,children:[s.jsxRuntimeExports.jsx("div",{className:Jt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:Jt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",disabled:!h.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},Ik="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20131.39%2086.9'%3e%3cdefs%3e%3cstyle%3e.a{opacity:0;}.b{fill:%23fff;}.c{fill:%23ff5f00;}.d{fill:%23eb001b;}.e{fill:%23f79e1b;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20class='a'%3e%3crect%20class='b'%20width='131.39'%20height='86.9'/%3e%3c/g%3e%3crect%20class='c'%20x='48.37'%20y='15.14'%20width='34.66'%20height='56.61'/%3e%3cpath%20class='d'%20d='M51.94,43.45a35.94,35.94,0,0,1,13.75-28.3,36,36,0,1,0,0,56.61A35.94,35.94,0,0,1,51.94,43.45Z'/%3e%3cpath%20class='e'%20d='M120.5,65.76V64.6H121v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.36v1.4h.26V64.7l.39.91h.27l.39-.91v1.06Z'/%3e%3cpath%20class='e'%20d='M123.94,43.45a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z'/%3e%3c/svg%3e",Tk=()=>{var x,g,y;const{subscription:e}=s.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=s.useCart(),r=s.useNavigate(),[o,i]=k.useState(null),[a,u]=k.useState(!1),[c,d]=k.useState(!1),{setIsOpen:m}=s.useModalStore();if(!e)return null;const[h,f]=k.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return k.useEffect(()=>{(async()=>{const R=await s.getGatewaysDetail(e.availableGateways);i(R)})()},[]),k.useEffect(()=>{t.gateway!==h&&f(t.gateway)},[t.gateway]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:Wt.paymentMethodContainer,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("p",{className:Wt.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&s.jsxRuntimeExports.jsx(_k,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&h==="Balance"&&s.jsxRuntimeExports.jsx(gl,{gateway:h,gatewayDisplayName:h,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!h&&s.jsxRuntimeExports.jsx("span",{className:Wt.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&h&&s.jsxRuntimeExports.jsx("div",{className:Wt.activeMethod,children:o&&s.jsxRuntimeExports.jsx(s.CheckoutPaymentMethod,{align:"row",gatewayLogoCfId:(x=o.find(E=>E.name===h))==null?void 0:x.logoCfImageId,gatewayDisplayName:(g=o.find(E=>E.name===h))==null?void 0:g.displayName,gateway:h,poweredByLogoCfId:(y=o.find(E=>E.name===h))==null?void 0:y.poweredByImageCfImageId,className:Wt.activeMethodPaymentMethod,selected:p===h,onSelect:E=>{n(E)}},h)})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Special",onClick:E=>{E.stopPropagation(),m(!0),d(!0)},children:t.gateway?"Change":"Manage"})]}),c&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>d(!1),children:s.jsxRuntimeExports.jsx(bk,{setIsLoading:u,setIsOpen:d})})]})},_k=({gatewayInfo:e})=>{var t,n,r,o,i;return s.jsxRuntimeExports.jsxs("div",{className:Wt.method,children:[s.jsxRuntimeExports.jsxs("div",{className:Wt.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&s.jsxRuntimeExports.jsx(s.Visa,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&s.jsxRuntimeExports.jsx("img",{src:Ik,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((o=e.card)==null?void 0:o.brand.toLowerCase())!=="mastercard"&&s.jsxRuntimeExports.jsx(s.Icon,{name:"CreditCard",width:22})]}),s.jsxRuntimeExports.jsxs("p",{className:Wt.paymentMethodNumber,children:["•••• •••• •••• ",(i=e.card)==null?void 0:i.last4]})]})},Ck="_subscriptionProductContainer_83ibx_4",Sk="_subscriptionProductImage_83ibx_15",yk="_subscriptionProductInfo_83ibx_32",kk="_name_83ibx_37",Rk="_price_83ibx_40",Vn={subscriptionProductContainer:Ck,subscriptionProductImage:Sk,subscriptionProductInfo:yk,name:kk,price:Rk},Ak=({subscription:e,id:t,accessToken:n})=>{const[r,o]=k.useState(!1),{setIsOpen:i}=s.useModalStore();return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:Vn.subscriptionProductContainer,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:Vn.subscriptionProductImage,children:e!=null&&e.image?s.jsxRuntimeExports.jsx("img",{src:s.convertCfImageIdToUrl(e.image.cfId)}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Image"})}),s.jsxRuntimeExports.jsxs("div",{className:Vn.subscriptionProductInfo,children:[s.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:s.jsxRuntimeExports.jsx("h2",{className:Vn.name,children:e.name})}),s.jsxRuntimeExports.jsxs("p",{className:Vn.price,children:[s.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Special",onClick:a=>{a.preventDefault(),o(!0),i(!0)},children:"Cancel"})]}),r&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>o(!1),children:s.jsxRuntimeExports.jsx(fR,{accessToken:n,id:t,isOpen:r,setIsOpen:o})})]})},Nk="_content_5ctxw_1",wk="_selectedPlan_5ctxw_37",Lk="_planName_5ctxw_44",jk="_description_5ctxw_48",vk="_price_5ctxw_51",Pk="_buttonGroup_5ctxw_79",Dk="_buttonWrapper_5ctxw_84",Ok="_modal_5ctxw_88",Bk="_header_5ctxw_95",lt={content:Nk,selectedPlan:wk,planName:Lk,description:jk,price:vk,buttonGroup:Pk,buttonWrapper:Dk,modal:Ok,header:Bk},Mk=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=s.useModalStore(),o=()=>{i()},i=()=>{r(!1),setTimeout(()=>{e(!1)},300)},a=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,u=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=a-u,d=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return s.jsxRuntimeExports.jsxs("div",{className:lt.modal,children:[s.jsxRuntimeExports.jsxs("div",{className:lt.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Choose upgrade method"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:()=>i(),fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:lt.bottomSheet,children:[s.jsxRuntimeExports.jsxs("div",{className:lt.content,children:[s.jsxRuntimeExports.jsxs("div",{className:lt.selectedPlan,children:[s.jsxRuntimeExports.jsx("h2",{className:lt.planName,children:t.name}),s.jsxRuntimeExports.jsx("p",{className:lt.description,children:t.description}),s.jsxRuntimeExports.jsxs("p",{className:lt.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),s.jsxRuntimeExports.jsx(dr,{formatter:d,coupon:null,total:c,discount:u})]}),s.jsxRuntimeExports.jsxs("div",{className:lt.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:lt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:()=>i(),children:"Stay with us"})}),s.jsxRuntimeExports.jsx("div",{className:lt.buttonWrapper,children:s.jsxRuntimeExports.jsxs(s.Button$1,{type:"Primary",onClick:o,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},Fk="_reviewMessage_1t8u4_1",Hk="_leaveReviewContainer_1t8u4_11",Uk="_leaveReviewTitle_1t8u4_20",Hs={reviewMessage:Fk,leaveReviewContainer:Hk,leaveReviewTitle:Uk},$k=({review:e,orderId:t,className:n})=>{const[r,o]=k.useState((e==null?void 0:e.rating)||0),[i,a]=k.useState(!1),{setIsOpen:u}=s.useModalStore(),{notifications:c,setNotifications:d}=s.useNotificationStore(),m=async h=>{e&&"accessToken"in e&&(await ac({comment:h,rating:r,tsId:s.getTsId()},t,e.accessToken),d([...c,{status:"success",id:s.v4(),message:"Review left successfully"}]),a(!1))};return k.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(u(!0),a(!0))},[r]),e?e.rating&&"accessToken"in e?s.jsxRuntimeExports.jsxs("div",{className:Hs.reviewMessage,children:["You left a ",e.rating," star rating"]}):s.jsxRuntimeExports.jsxs("div",{className:s.clx(Hs.leaveReviewContainer,n),children:[s.jsxRuntimeExports.jsx("p",{className:Hs.leaveReviewTitle,children:"Leave a review"}),s.jsxRuntimeExports.jsx(Ff,{rating:r,setRating:o,disabled:!!e.rating||!("accessToken"in e)}),i&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>a(!1),children:s.jsxRuntimeExports.jsx(Qk,{setIsOpen:a,onSubmit:m})})]}):null},zk="_bottomSheet_1bcyj_1",Wk="_content_1bcyj_7",qk="_title_1bcyj_18",Vk="_buttonGroup_1bcyj_22",Gk="_buttonWrapper_1bcyj_33",Yk="_modal_1bcyj_37",Xk="_header_1bcyj_44",Ht={bottomSheet:zk,content:Wk,title:qk,buttonGroup:Vk,buttonWrapper:Gk,modal:Yk,header:Xk},Qk=({setIsOpen:e,onSubmit:t})=>{const[n,r]=k.useState(""),{setIsOpen:o}=s.useModalStore(),i=()=>{o(!1),setTimeout(()=>{e(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:Ht.modal,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:Ht.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:Ht.title,children:"Review Description"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:i,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:Ht.bottomSheet,children:[s.jsxRuntimeExports.jsx("div",{className:Ht.content,children:s.jsxRuntimeExports.jsx(s.Textarea$1,{placeholder:"Great product and fast checkout...",value:n,onChange:a=>r(a),label:"Describe your review in detail below"})}),s.jsxRuntimeExports.jsxs("div",{className:Ht.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:Ht.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:i,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:Ht.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",disabled:!n,onClick:()=>{i(),t(n)},children:"Submit"})})]})]})]})},Kk="_container_1idhv_1",Zk="_buttonGroup_1idhv_8",Jk="_buttonWrapper_1idhv_15",eR="_header_1idhv_19",tR="_content_1idhv_28",en={container:Kk,buttonGroup:Zk,buttonWrapper:Jk,header:eR,content:tR},nR=({setIsOpen:e})=>{const{subscription:t}=s.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:o}=s.useCart(),[i,a]=k.useState(1),u=s.useNavigate(),{setIsOpen:c}=s.useModalStore(),{setNotifications:d,notifications:m}=s.useNotificationStore(),[h,f]=k.useState(!1),p=k.useMemo(()=>n(),[o,r]),x=k.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(h)return s.jsxRuntimeExports.jsx(s.ProcessingPaymentModal,{});const g=(t==null?void 0:t.price.currency)||"USD",y=new Intl.NumberFormat("en-US",{style:"currency",currency:g});async function E(){var C;f(!0);try{const{data:P}=await s.extendSubscription((t==null?void 0:t.id)||"",{});d([{id:s.v4(),message:"Order created successfully",status:"success"}]),u(`/orders/${(C=P.data)==null?void 0:C.id}/${P.data.fullAccessToken}`)}catch(P){const L=P;d([...m,{id:s.v4(),message:`Order creation failed: ${L.message}`,status:"error"}]),R()}finally{f(!1)}}function R(){c(!1),setTimeout(()=>{e(!1)},300)}return s.jsxRuntimeExports.jsxs("div",{className:en.container,onClick:C=>C.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:en.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:en.title,children:"Extend Subscription"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:R,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:en.content,children:[s.jsxRuntimeExports.jsx(Kf,{step:i,totalSteps:12,onStepChange:a,label:"How long would you like to extend your subscription for?"}),s.jsxRuntimeExports.jsx(dr,{formatter:y,coupon:o,total:p.total,discount:x,totalWithDiscount:p.totalWithDiscount}),s.jsxRuntimeExports.jsxs("div",{className:en.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:en.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:R,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:en.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:E,children:"Extend"})})]})]})]})},rR="_bottomSheet_uw5jb_1",sR="_content_uw5jb_7",oR="_radioGroup_uw5jb_11",iR="_confirmation_uw5jb_26",aR="_iconWrapper_uw5jb_33",uR="_title_uw5jb_42",lR="_message_uw5jb_48",cR="_buttonGroup_uw5jb_54",dR="_buttonWrapper_uw5jb_64",hR="_modal_uw5jb_68",mR="_header_uw5jb_77",ve={bottomSheet:rR,content:sR,radioGroup:oR,confirmation:iR,iconWrapper:aR,title:uR,message:lR,buttonGroup:cR,buttonWrapper:dR,modal:hR,header:mR},pR={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},fR=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[o,i]=k.useState(0),[a,u]=k.useState(!1),[c,d]=k.useState(""),[m,h]=k.useState(""),{setIsOpen:f}=s.useModalStore(),p=async()=>{if(!c)return;u(!0);const g=await s.cancelSubscription(n,r,{reason:c==="Other reason"?m:c});u(!1),g&&i(2)};k.useEffect(()=>{e||(i(0),d(""),h(""))},[e]);const x=()=>{f(!1),setTimeout(()=>{t(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:ve.modal,onClick:g=>g.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:ve.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:pR[o]||""}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:x,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:ve.content,children:[o===0&&s.jsxRuntimeExports.jsxs("div",{className:ve.bottomSheet,children:[s.jsxRuntimeExports.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),s.jsxRuntimeExports.jsxs("div",{className:ve.radioGroup,children:[s.jsxRuntimeExports.jsx(s.Radio,{defaultValue:c,onChange:g=>d(g),options:[{value:"Found another company",label:"Found another company"},{value:"Expensive",label:"Expensive"},{value:"Technical problems",label:"Technical problems"},{value:"Support problems",label:"Support problems"},{value:"Other reason",label:"Other reason"}],flexDirection:"column"}),c==="Other reason"&&s.jsxRuntimeExports.jsx(s.Textarea$1,{value:m,onChange:g=>h(g),placeholder:"Describe the reason..."})]}),s.jsxRuntimeExports.jsxs("div",{className:ve.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Stay with us"})}),s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:()=>c&&i(1),disabled:!c,children:"Continue"})})]})]}),o===1&&s.jsxRuntimeExports.jsxs("div",{className:ve.bottomSheet,children:[s.jsxRuntimeExports.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),s.jsxRuntimeExports.jsxs("div",{className:ve.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Stay with us"})}),s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:p,disabled:a,children:"Cancel it anyway"})})]})]}),o===2&&s.jsxRuntimeExports.jsxs("div",{className:ve.bottomSheet,children:[s.jsxRuntimeExports.jsxs("div",{className:`${ve.confirmation}`,children:[s.jsxRuntimeExports.jsx("div",{className:ve.iconWrapper,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"var(--text-success)"})}),s.jsxRuntimeExports.jsx("p",{className:ve.title,children:"Subscription Cancelled"}),s.jsxRuntimeExports.jsx("p",{className:ve.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),s.jsxRuntimeExports.jsx("div",{className:ve.buttonGroup,children:s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Close"})})})]})]})]})},gR="_checkoutContainer_wkomn_1",xR="_loaderContainer_wkomn_20",Us={checkoutContainer:gR,loaderContainer:xR},Il=()=>{const{isAntistock:e}=s.useGeneralStore(),{cart:t,products:n,pending:r,getTotalAndDiscount:o,getPossibleGateways:i,submitCart:a,setGateway:u,applyCoupon:c,setDiscordSocialConnectId:d,setCustomFields:m,applyCouponPending:h,coupon:f,removeCoupon:p,getDiscordSettings:x,setPaymentMethod:g,reset:y}=s.useCart(),E=k.useMemo(()=>o(),[f,t]),R=s.useNavigate();return k.useEffect(()=>{if(t.parts.length===0)try{R(-1)}catch{R("/")}},[t.parts]),r?s.jsxRuntimeExports.jsx("div",{className:Us.checkoutContainer,children:s.jsxRuntimeExports.jsx("div",{className:Us.loaderContainer,children:s.jsxRuntimeExports.jsx(s.Loader,{})})}):s.jsxRuntimeExports.jsxs("div",{className:Us.checkoutContainer,children:[s.jsxRuntimeExports.jsx(NS,{cart:t,products:n,applyCoupon:c,applyCouponPending:h,coupon:f,removeCoupon:p,totalAndDiscount:E}),s.jsxRuntimeExports.jsx(p3,{cart:t,getPossibleGateways:i,setGateway:u,getDiscordSettings:x,products:n,submitCart:a,totalAndDiscount:E,setCustomFieldsToCart:m,setDiscordSocialConnectId:d,setPaymentMethod:g,reset:y,isAntistock:e})]})},ER="_chargePageContainer_1a200_1",bR="_chargeItems_1a200_14",IR="_mainContent_1a200_25",TR="_contentWrapper_1a200_36",_R="_statusBlock_1a200_41",CR="_notPaidSection_1a200_45",SR="_footer_1a200_53",yR="_loaderContainer_1a200_63",Ut={chargePageContainer:ER,chargeItems:bR,mainContent:IR,contentWrapper:TR,statusBlock:_R,notPaidSection:CR,footer:SR,loaderContainer:yR},kR=()=>{const{id:e}=s.useParams(),[t,n]=s.useSearchParams(),[r,o]=k.useState(!1),[i,a]=k.useState(),[u,c]=k.useState(!0),d=s.useNavigate(),m=k.useRef(),{setIsOpen:h}=s.useModalStore();return k.useEffect(()=>{const f=async(x,g=!1)=>{g||o(!0);const{data:y}=await uc(x);o(!1),a(y)},p=setInterval(()=>{e&&f(e,!0)},5e3);return e&&f(e),()=>{clearInterval(p)}},[]),k.useEffect(()=>{const f=setTimeout(()=>{console.log("charge timeout",i);const p=t.get("redirectRoute");(i==null?void 0:i.status)===s.ChargeStatus.Paid&&i.redirectUrl&&!m.current&&window.open(i.redirectUrl,"_self"),(i==null?void 0:i.status)===s.ChargeStatus.Paid&&m.current&&d(m.current,{replace:!0}),p&&m&&(m.current=p,t.delete("redirectRoute"),n(t))},1e3);return()=>clearTimeout(f)},[i]),k.useEffect(()=>{((i==null?void 0:i.gateway)==="PayPalFF"||(i==null?void 0:i.gateway)==="Сashapp")&&h(!0)},[i]),r?s.jsxRuntimeExports.jsx("div",{className:Ut.loaderContainer,children:s.jsxRuntimeExports.jsx(s.Loader,{})}):s.jsxRuntimeExports.jsxs("div",{className:Ut.chargePageContainer,children:[s.jsxRuntimeExports.jsx("div",{className:Ut.chargeItems,children:s.jsxRuntimeExports.jsx(Z3,{charge:i})}),s.jsxRuntimeExports.jsx("div",{className:Ut.mainContent,children:s.jsxRuntimeExports.jsxs("div",{className:Ut.contentWrapper,children:[i&&(i==null?void 0:i.status)!==s.ChargeStatus.NotPaid&&s.jsxRuntimeExports.jsx(s.ChargeStatusBlock,{charge:i}),i&&s.jsxRuntimeExports.jsx("div",{className:`${Ut.statusBlock}`,children:s.jsxRuntimeExports.jsx(bl,{lastUpdate:i.expiresAt,email:i.customerForCharge.email,invoiceId:i.id,paymentType:i.gateway})}),(i==null?void 0:i.status)===s.ChargeStatus.NotPaid&&s.jsxRuntimeExports.jsx("div",{className:Ut.notPaidSection,children:i==null?void 0:i.displayPaymentInfo.map((f,p)=>s.jsxRuntimeExports.jsx(El,{block:f},p))}),s.jsxRuntimeExports.jsx(vt,{className:Ut.footer})]})}),(i==null?void 0:i.gateway)==="PayPalFF"&&u&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>c(!1),children:s.jsxRuntimeExports.jsx(U3,{price:i.price,setIsOpen:c})}),(i==null?void 0:i.gateway)==="Сashapp"&&u&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>o(!1),children:s.jsxRuntimeExports.jsx(fy,{setIsOpen:c,chargeId:i.id})})]})};var Tl=(e=>(e.NEW="NEW",e.ANSWERED="ANSWERED",e.NOT_ANSWERED="NOT_ANSWERED",e.CLOSED="CLOSED",e))(Tl||{});const RR="_wrapper_esta4_1",AR="_ticketContainer_esta4_23",NR="_title_esta4_28",wR="_subtext_esta4_35",LR="_container_esta4_41",jR="_content_esta4_52",vR="_messages_esta4_63",PR="_input_esta4_81",DR="_textarea_esta4_94",OR="_message_esta4_63",BR="_messageDate_esta4_139",MR="_messageAntistock_esta4_145",FR="_myMessage_esta4_149",HR="_otherMessage_esta4_156",UR="_button_esta4_163",$R="_disabled_esta4_163",zR="_loadingMessage_esta4_189",Ne={wrapper:RR,ticketContainer:AR,title:NR,subtext:wR,container:LR,content:jR,messages:vR,input:PR,textarea:DR,message:OR,messageDate:BR,messageAntistock:MR,myMessage:FR,otherMessage:HR,button:UR,disabled:$R,loadingMessage:zR},WR=()=>{const e=window.location.pathname.split("/"),t=e[e.length-1],n=e[e.length-2],[r,o]=k.useState(!0),[i,a]=k.useState(null),[u,c]=k.useState(""),[d,m]=k.useState(null),{executeRecaptcha:h}=s.useReCaptcha(),{isAntistock:f}=s.useGeneralStore(),p=(i==null?void 0:i.status)===Tl.CLOSED,x=async()=>{if(n&&t){const{data:E}=await s.fetchTicket(n,t);a(E),o(!1)}};k.useEffect(()=>{x();const E=setInterval(()=>{x()},5e3);return()=>clearInterval(E)},[]);const g=async()=>{const E=await h();if(!n||!t||!E||!u.trim())return;const R={content:u,createdAt:new Date().toISOString(),id:Date.now(),isSellerReply:!1};a(C=>C?{...C,messages:[...C.messages,R]}:null),m(R.id),c("");try{await s.sendTicketMessage(n,t,u,E,s.getTsId()),await x()}finally{setTimeout(()=>{m(null)},1e4)}},y=E=>{const R=new Date,C=new Date(E),P=Math.floor((R.getTime()-C.getTime())/1e3);if(P<60)return"right now";if(P<3600){const L=Math.floor(P/60);return`${L} minute${L>1?"s":""} ago`}else if(P<10800){const L=Math.floor(P/3600);return`${L} hour${L>1?"s":""} ago`}else return C.getFullYear()===R.getFullYear()?C.toLocaleDateString("en-US",{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):C.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return s.jsxRuntimeExports.jsx("div",{className:Ne.wrapper,children:r&&!i?s.jsxRuntimeExports.jsx(s.Loader,{}):s.jsxRuntimeExports.jsxs("div",{className:Ne.container,children:[f?s.jsxRuntimeExports.jsxs("div",{className:Ne.ticketContainer,children:[s.jsxRuntimeExports.jsx("div",{className:Ne.title,children:i==null?void 0:i.title}),s.jsxRuntimeExports.jsx("div",{className:Ne.subtext,children:"We’re going to respond to your ticket shortly. You’ll receive updates in your email inbox. Feel free to close this page."})]}):s.jsxRuntimeExports.jsx("div",{className:Ne.title,children:`#${n} (${i==null?void 0:i.title})`}),s.jsxRuntimeExports.jsxs("div",{className:Ne.content,children:[s.jsxRuntimeExports.jsx("div",{className:Ne.messages,children:i==null?void 0:i.messages.sort((E,R)=>new Date(E.createdAt).getTime()-new Date(R.createdAt).getTime()).map(E=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(Ne.message,{[Ne.messageAntistock]:f,[Ne.myMessage]:!E.isSellerReply,[Ne.otherMessage]:E.isSellerReply,[Ne.loadingMessage]:d===E.id}),children:[s.jsxRuntimeExports.jsx("div",{className:Ne.messageContent,children:s.splitTextIntoSpans(E.content,!1)}),d!==E.id&&s.jsxRuntimeExports.jsx("div",{className:Ne.messageDate,children:y(E.createdAt)}),d===E.id&&s.jsxRuntimeExports.jsx("div",{className:Ne.messageDate,children:s.jsxRuntimeExports.jsx(s.Loader,{})})]},E.id))}),s.jsxRuntimeExports.jsxs("div",{className:Ne.input,children:[s.jsxRuntimeExports.jsx("textarea",{disabled:p,className:Ne.textarea,value:u,placeholder:p?"The ticket has been closed. Need further assistance? Please submit a new request.":f?"Type a message...":"What worries you?",onChange:E=>c(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),g())}}),s.jsxRuntimeExports.jsx("div",{onClick:g,className:s.clx(Ne.button,{[Ne.disabled]:p}),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"PaperPlaneRight"})})]})]})]})})},qR="_subscriptionContainer_1j6ol_1",VR="_leftSection_1j6ol_15",GR="_content_1j6ol_26",YR="_mainContent_1j6ol_33",XR="_detailsSection_1j6ol_37",QR="_buttonGroup_1j6ol_50",KR="_detailsContent_1j6ol_57",tn={subscriptionContainer:qR,leftSection:VR,content:GR,mainContent:YR,detailsSection:XR,buttonGroup:QR,detailsContent:KR},ZR=()=>{const{id:e,accessToken:t}=s.useParams(),{subscription:n,setSubscription:r}=s.useSubscriptionStore(),{setIsOpen:o}=s.useModalStore(),[i,a]=k.useState(!1),[u,c]=k.useState(!1);k.useLayoutEffect(()=>{r(null)},[e,t]);const{balanceSettings:d,setBalanceSettings:m}=s.useCustomerDashboardStore();return k.useEffect(()=>{e&&t&&(async()=>{if(!e||!t)return;c(!0);const{data:f}=await s.fetchSubscription(e,t);r({...f}),c(!1)})()},[e,t]),k.useEffect(()=>{d||(async()=>{const f=await s.getBalanceSettings();m(f)})()},[d]),u?s.jsxRuntimeExports.jsx(s.Loader,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:tn.subscriptionContainer,children:[s.jsxRuntimeExports.jsx("div",{className:tn.leftSection,children:s.jsxRuntimeExports.jsxs("div",{className:tn.content,children:[s.jsxRuntimeExports.jsx(cr,{}),s.jsxRuntimeExports.jsxs("div",{className:tn.mainContent,children:[n&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Your Subscription"}),s.jsxRuntimeExports.jsx(ky,{subscription:{price:n.price,name:n.productName,description:n.productDescription,status:n.status,image:n.productImage,recurringInterval:n.recurringInterval}}),s.jsxRuntimeExports.jsx("div",{className:tn.buttonGroup,children:n.pricingPlanExists&&s.jsxRuntimeExports.jsx(s.Button$1,{onClick:h=>{h.stopPropagation(),o(!0),a(!0)},style:{maxWidth:"500px",width:"100%"},children:"Change Plan"})})]}),s.jsxRuntimeExports.jsx(vt,{})]})]})}),s.jsxRuntimeExports.jsx("div",{className:tn.detailsSection,children:s.jsxRuntimeExports.jsxs("div",{className:tn.detailsContent,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Details"}),(n==null?void 0:n.coupon)&&s.jsxRuntimeExports.jsx(ik,{coupon:n.coupon,currency:n.price.currency||"USD"}),n&&s.jsxRuntimeExports.jsx(Ak,{id:e||"",accessToken:t||"",subscription:{price:n.price,name:n.productName,description:n.productDescription,status:n.status,image:n.productImage,recurringInterval:n.recurringInterval}}),n&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(Tk,{}),n.activeTo&&s.jsxRuntimeExports.jsx(Jy,{})]}),s.jsxRuntimeExports.jsx(vt,{className:"flex md:hidden"})]})})]}),s.jsxRuntimeExports.jsx(Yy,{isOpen:i,setIsOpen:a,subscription:n})]})},JR="_topUpContainer_1pag6_1",eA="_formWrapper_1pag6_15",tA="_header_1pag6_29",nA="_footer_1pag6_82",rA="_wrapper_1pag6_105",Gn={topUpContainer:JR,formWrapper:eA,header:tA,footer:nA,wrapper:rA},sA=()=>{const{gatewaysDetail:e,setGatewaysDetail:t,balanceSettings:n,setBalanceSettings:r}=s.useCustomerDashboardStore();return k.useEffect(()=>{!e&&n&&(async()=>{const i=await s.getGatewaysDetail(n!=null&&n.isEnabled?(n==null?void 0:n.topUpSettings.gateways)||[]:[]);t(i)})()},[e,n]),k.useEffect(()=>{n||(async()=>{const i=await s.getBalanceSettings();r(i)})()},[n]),s.jsxRuntimeExports.jsxs("div",{className:Gn.wrapper,children:[s.jsxRuntimeExports.jsx(cr,{className:Gn.header}),s.jsxRuntimeExports.jsx("div",{className:Gn.topUpContainer,children:n?s.jsxRuntimeExports.jsx("div",{className:Gn.formWrapper,children:s.jsxRuntimeExports.jsx(s.BalanceModal,{setIsOpen:()=>{},isModal:!1})}):s.jsxRuntimeExports.jsx(s.Loader,{})}),s.jsxRuntimeExports.jsx("div",{className:Gn.footer,children:s.jsxRuntimeExports.jsx(vt,{})})]})},oA="_orderPage_1nvve_1",iA="_leftSection_1nvve_15",aA="_content_1nvve_35",uA="_main_1nvve_42",lA="_statusBlock_1nvve_54",cA="_timelineBlock_1nvve_58",dA="_footer_1nvve_62",hA="_rightSection_1nvve_71",mA="_header_1nvve_84",pA="_productList_1nvve_92",fA="_mobileFooter_1nvve_99",gA="_loaderContainer_1nvve_108",xA="_orderMainData_1nvve_116",EA="_prices_1nvve_123",bA="_headerTitle_1nvve_127",IA="_headerDescription_1nvve_131",Oe={orderPage:oA,leftSection:iA,content:aA,main:uA,statusBlock:lA,timelineBlock:cA,footer:dA,rightSection:hA,header:mA,productList:pA,mobileFooter:fA,loaderContainer:gA,orderMainData:xA,prices:EA,headerTitle:bA,headerDescription:IA},TA=()=>{var h,f,p;const{id:e,accessToken:t}=s.useParams(),n=s.useNavigate(),[r,o]=k.useState(),[i,a]=k.useState(!1),u=s.useCopy(),c=((h=r==null?void 0:r.rawPrice)==null?void 0:h.currency)||"USD",d=new Intl.NumberFormat("en-US",{style:"currency",currency:c}),m=k.useMemo(()=>(r==null?void 0:r.partOrders.map(x=>{var g,y,E,R;return{id:(x==null?void 0:x.id)||0,image:x.productWithVariant.image,name:((g=x.productWithVariant)==null?void 0:g.name)||"",description:((y=x.productWithVariant)==null?void 0:y.description)||"",price:{quantity:x.quantity,amount:((E=x.productWithVariant)==null?void 0:E.price.amount)||0,currency:(R=x.productWithVariant)==null?void 0:R.price.currency},deliveryCategories:"deliveryCategories"in x?x.deliveryCategories:void 0,customerNote:x.customerNote,chargeType:x.chargeType||"ONE_TIME"}}))||[],[r]);return k.useLayoutEffect(()=>{if(e&&!t){const x=JSON.parse(localStorage.getItem("orders")||"{}");x[e]&&n(`/orders/${e}/${x[e].fullAccessToken}`)}},[e]),k.useEffect(()=>{const x=async(y,E=!1)=>{E||a(!0);const{data:R}=await(t?s.fetchAuthorizedOrder(`${y}/${t}`):s.fetchOrder(y));a(!1),R.charge.status===s.ChargeStatus.NotPaid&&n(`/charges/${R.charge.id}`,{replace:!0}),o(R)};e&&x(e);const g=setInterval(()=>{e&&x(e,!0)},5e3);return()=>{clearInterval(g)}},[]),i?s.jsxRuntimeExports.jsx("div",{className:Oe.loaderContainer,children:s.jsxRuntimeExports.jsx(s.Loader,{})}):s.jsxRuntimeExports.jsxs("div",{className:Oe.orderPage,children:[s.jsxRuntimeExports.jsx("div",{className:Oe.leftSection,children:s.jsxRuntimeExports.jsxs("div",{className:Oe.content,children:[s.jsxRuntimeExports.jsx(cr,{}),r&&s.jsxRuntimeExports.jsxs("div",{className:Oe.main,children:[s.jsxRuntimeExports.jsx(s.OrderStatusBlock,{className:Oe.statusBlock,orderStatus:r.status}),s.jsxRuntimeExports.jsxs("div",{className:Oe.orderMainData,children:[s.jsxRuntimeExports.jsx(bl,{lastUpdate:r.createdAt,paymentType:r.charge.gateway,email:r.charge.customerForCharge.email,invoiceId:r.charge.id}),"accessToken"in r.review&&s.jsxRuntimeExports.jsx($k,{orderId:r.id,review:r.review})]}),r.charge&&s.jsxRuntimeExports.jsx(s.TrackPayment,{className:Oe.timelineBlock,timeline:r.charge.timeline}),s.jsxRuntimeExports.jsx(vt,{className:Oe.footer})]})]})}),s.jsxRuntimeExports.jsx("div",{className:Oe.rightSection,children:s.jsxRuntimeExports.jsxs("div",{className:Oe.content,children:[(r==null?void 0:r.charge.name)&&s.jsxRuntimeExports.jsxs("header",{className:Oe.header,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("h1",{className:Oe.headerTitle,children:r.charge.name}),r.charge.description&&s.jsxRuntimeExports.jsx("p",{className:Oe.headerDescription,children:r.charge.description})]}),s.jsxRuntimeExports.jsxs(s.Button$1,{type:"Secondary",onClick:()=>u((r==null?void 0:r.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"}),s.jsxRuntimeExports.jsx("span",{children:"Copy ID"})]})]}),s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:Oe.productList,children:m.map(x=>s.jsxRuntimeExports.jsx(jo,{product:x,isOrder:!0},x.id))}),s.jsxRuntimeExports.jsx(dr,{formatter:d,coupon:null,total:((f=r==null?void 0:r.charge)==null?void 0:f.price.amount)||0,discount:0,totalWithDiscount:((p=r==null?void 0:r.charge)==null?void 0:p.price.amount)||0,className:Oe.prices,isShowSubtotal:!1}),s.jsxRuntimeExports.jsx(vt,{className:Oe.mobileFooter})]})]})})]})},_A=e=>{const{notifications:t,setNotifications:n}=s.useNotificationStore.getState();n(t.filter(r=>r.id!==e))},CA=e=>{const{notifications:t,setNotifications:n}=s.useNotificationStore.getState(),r=s.v4();return n([...t,{id:r,...e}]),r},SA=e=>{const{blocks:t,settings:n,header:r,footer:o,announcement:i,routes:a=[],shopLogo:u,apiURLs:c,isAntistock:d=!1}=e,[m,h]=k.useState(null),{general:f,setIsAntistock:p}=s.useGeneralStore(),{setApiUrls:x}=s.useApiStore(),{setBlocks:g,setSourceBlocks:y,setHeader:E,setFooter:R,setAnnouncement:C,setSettings:P}=s.useBlocksStore(),{themeSettings:L}=s.useThemeSettingsStore(),{settings:A,setSettings:z}=s.useSettingsStore();console.log("window.location.hostname",window.location);const G=s.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"":window.location.hostname,K=localStorage.getItem("shopPassword"),N=localStorage.getItem("shopId")||"",H=localStorage.getItem("draftId")||"";return k.useEffect(()=>{p(d)},[d,p]),k.useEffect(()=>{N||localStorage.setItem("shopId",(f==null?void 0:f.info.id)||"15124f8d-2c8c-4dda-a04c-31c16816f9b6")},[f]),k.useEffect(()=>{H||localStorage.setItem("draftId","ca18cf24-6659-4015-b1ab-9ebe9fa64e74")},[H]),k.useEffect(()=>{G||localStorage.setItem("fakeDomain","drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io")},[G]),k.useEffect(()=>{if(L&&A){const D=mc(L,A);bc(L),pc(D)}},[L,JSON.stringify(A),window.location.hostname]),k.useLayoutEffect(()=>{const D={};Object.keys(t).map(Z=>{D[Z]=t[Z]}),y(D),g(D),E(r),R(o),C(i),P(n),c&&x(c);const Y=new n().blockSettings;z(Y);const q=s.createBrowserRouter([{element:s.jsxRuntimeExports.jsx(sf,{shopDomain:G,shopId:N,shopPassword:K||void 0,shopLogo:u,children:s.jsxRuntimeExports.jsx(s.ReCaptchaProvider,{children:s.jsxRuntimeExports.jsx(Jp,{children:s.jsxRuntimeExports.jsx(s.Outlet,{})})})}),errorElement:s.jsxRuntimeExports.jsx(ef,{}),children:[{path:"/admin/builder/*",element:s.jsxRuntimeExports.jsx(Up,{children:s.jsxRuntimeExports.jsx(Dp,{blocks:t,settings:n,header:r,footer:o,announcement:i})}),errorElement:s.jsxRuntimeExports.jsx(Hp,{})},...a,{path:"/checkout",element:s.jsxRuntimeExports.jsx(Il,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:s.jsxRuntimeExports.jsx(sA,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:s.jsxRuntimeExports.jsx(kR,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:s.jsxRuntimeExports.jsx(TA,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:s.jsxRuntimeExports.jsx(ZR,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Subscriptions",!0)},{path:"/customer-dash",element:s.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:[s.jsxRuntimeExports.jsx(s.RenderAnnouncement,{}),s.jsxRuntimeExports.jsx(s.RenderHeader,{}),s.jsxRuntimeExports.jsx("div",{style:{flex:"1 1 auto"},children:s.jsxRuntimeExports.jsx(s.CustomerDashboard,{})}),s.jsxRuntimeExports.jsx(s.RenderFooter,{})]}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Customer Dashboard",!0)},{path:"/validation",element:s.jsxRuntimeExports.jsx(Qp,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:s.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:[s.jsxRuntimeExports.jsx(s.RenderHeader,{}),s.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:s.jsxRuntimeExports.jsx(s.ReCaptchaProvider,{children:s.jsxRuntimeExports.jsx(WR,{})})}),s.jsxRuntimeExports.jsx(s.RenderFooter,{})]}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Ticket",!0)},{path:"*",element:s.jsxRuntimeExports.jsx(hc,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{})}]}]);h(q)},[f]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:m&&s.jsxRuntimeExports.jsx(s.RouterProvider,{router:m})})};exports.ReCaptchaProvider=s.ReCaptchaProvider;exports.aspectRatioOptions=s.aspectRatioOptions;exports.formatPrice=s.formatPrice;exports.splitTextIntoSpans=s.splitTextIntoSpans;exports.useAdaptiveStyles=s.useAdaptiveStyles;exports.useCart=s.useCart;exports.useReCaptcha=s.useReCaptcha;exports.App=SA;exports.Checkout=Il;exports.ColorVariables=la;exports.hotReload=Ic;exports.iconNames=Cl;exports.removeNotification=_A;exports.showNotification=CA;exports.useBuilderPages=_c;exports.useCreateTicket=Tc;
|
|
131
|
+
`))}function c(p,x,g,y){const E=g.enter("tableCell"),R=g.enter("phrasing"),C=g.containerPhrasing(p,{...y,before:i,after:i});return R(),E(),C}function d(p,x){return Y_(p,{align:x,alignDelimiters:r,padding:n,stringLength:o})}function m(p,x,g){const y=p.children;let E=-1;const R=[],C=x.enter("table");for(;++E<y.length;)R[E]=h(y[E],x,g);return C(),R}function h(p,x,g){const y=p.children;let E=-1;const R=[],C=x.enter("tableRow");for(;++E<y.length;)R[E]=c(y[E],p,x,g);return C(),R}function f(p,x,g){let y=al.inlineCode(p,x,g);return g.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function DC(){return{exit:{taskListCheckValueChecked:ia,taskListCheckValueUnchecked:ia,paragraph:BC}}}function OC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:MC}}}function ia(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function BC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,a;for(;++i<o.length;){const u=o[i];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function MC(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let c=al.listItem(e,t,n,{...r,...u.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(m){return m+a}}function FC(){return[x_(),M_(),$_(),AC(),DC()]}function HC(e){return{extensions:[E_(),F_(e),z_(),PC(e),OC()]}}const UC={tokenize:GC,partial:!0},ul={tokenize:YC,partial:!0},ll={tokenize:XC,partial:!0},cl={tokenize:QC,partial:!0},$C={tokenize:KC,partial:!0},dl={name:"wwwAutolink",tokenize:qC,previous:ml},hl={name:"protocolAutolink",tokenize:VC,previous:pl},Pt={name:"emailAutolink",tokenize:WC,previous:fl},yt={};function zC(){return{text:yt}}let Zt=48;for(;Zt<123;)yt[Zt]=Pt,Zt++,Zt===58?Zt=65:Zt===91&&(Zt=97);yt[43]=Pt;yt[45]=Pt;yt[46]=Pt;yt[95]=Pt;yt[72]=[Pt,hl];yt[104]=[Pt,hl];yt[87]=[Pt,dl];yt[119]=[Pt,dl];function WC(e,t,n){const r=this;let o,i;return a;function a(h){return!io(h)||!fl.call(r,r.previous)||Lo(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(h))}function u(h){return io(h)?(e.consume(h),u):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check($C,m,d)(h):h===45||h===95||Fe(h)?(i=!0,e.consume(h),c):m(h)}function d(h){return e.consume(h),o=!0,c}function m(h){return i&&o&&ze(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function qC(e,t,n){const r=this;return o;function o(a){return a!==87&&a!==119||!ml.call(r,r.previous)||Lo(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UC,e.attempt(ul,e.attempt(ll,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function VC(e,t,n){const r=this;let o="",i=!1;return a;function a(h){return(h===72||h===104)&&pl.call(r,r.previous)&&!Lo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(h),e.consume(h),u):n(h)}function u(h){if(ze(h)&&o.length<5)return o+=String.fromCodePoint(h),e.consume(h),u;if(h===58){const f=o.toLowerCase();if(f==="http"||f==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),i?d:(i=!0,c)):n(h)}function d(h){return h===null||Wr(h)||Ie(h)||on(h)||Zr(h)?n(h):e.attempt(ul,e.attempt(ll,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function GC(e,t,n){let r=0;return o;function o(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),o):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function YC(e,t,n){let r,o,i;return a;function a(d){return d===46||d===95?e.check(cl,c,u)(d):d===null||Ie(d)||on(d)||d!==45&&Zr(d)?c(d):(i=!0,e.consume(d),a)}function u(d){return d===95?r=!0:(o=r,r=void 0),e.consume(d),a}function c(d){return o||r||!i?n(d):t(d)}}function XC(e,t){let n=0,r=0;return o;function o(a){return a===40?(n++,e.consume(a),o):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(cl,t,i)(a):a===null||Ie(a)||on(a)?t(a):(e.consume(a),o)}function i(a){return a===41&&r++,e.consume(a),o}}function QC(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),i):u===93?(e.consume(u),o):u===60||u===null||Ie(u)||on(u)?t(u):n(u)}function o(u){return u===null||u===40||u===91||Ie(u)||on(u)?t(u):r(u)}function i(u){return ze(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):ze(u)?(e.consume(u),a):n(u)}}function KC(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return Fe(i)?n(i):t(i)}}function ml(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function pl(e){return!ze(e)}function fl(e){return!(e===47||io(e))}function io(e){return e===43||e===45||e===46||e===95||Fe(e)}function Lo(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ZC={tokenize:iS,partial:!0};function JC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rS,continuation:{tokenize:sS},exit:oS}},text:{91:{name:"gfmFootnoteCall",tokenize:nS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eS,resolveTo:tS}}}}function eS(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const c=r.events[o][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return u;function u(c){if(!a||!a._balanced)return n(c);const d=mt(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function tS(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function nS(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(i>999||h===93&&!a||h===null||h===91||Ie(h))return n(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return o.includes(mt(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Ie(h)||(a=!0),i++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),i++,d):d(h)}}function rS(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(x)}function m(x){if(a>999||x===93&&!u||x===null||x===91||Ie(x))return n(x);if(x===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=mt(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Ie(x)||(u=!0),a++,e.consume(x),x===92?h:m}function h(x){return x===91||x===92||x===93?(e.consume(x),a++,m):m(x)}function f(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),o.includes(i)||o.push(i),fe(e,p,"gfmFootnoteDefinitionWhitespace")):n(x)}function p(x){return t(x)}}function sS(e,t,n){return e.check(mr,t,e.attempt(ZC,t,n))}function oS(e){e.exit("gfmFootnoteDefinition")}function iS(e,t,n){const r=this;return fe(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function aS(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(a,u){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let d=c;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},h={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},f=[["enter",m,u],["enter",a[d][1],u],["exit",a[d][1],u],["enter",h,u]],p=u.parser.constructs.insideSpan.null;p&&Ke(f,f.length,0,Jr(p,a.slice(d+1,c),u)),Ke(f,f.length,0,[["exit",h,u],["enter",a[c][1],u],["exit",a[c][1],u],["exit",m,u]]),Ke(a,d-1,c-d+3,f),c=d+f.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function i(a,u,c){const d=this.previous,m=this.events;let h=0;return f;function f(x){return d===126&&m[m.length-1][1].type!=="characterEscape"?c(x):(a.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const g=Cn(d);if(x===126)return h>1?c(x):(a.consume(x),h++,p);if(h<2&&!n)return c(x);const y=a.exit("strikethroughSequenceTemporary"),E=Cn(x);return y._open=!E||E===2&&!!g,y._close=!g||g===2&&!!E,u(x)}}}class uS{constructor(){this.map=[]}add(t,n,r){lS(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const i of o)t.push(i);o=r.pop()}this.map.length=0}}function lS(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function cS(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dS(){return{flow:{null:{name:"table",tokenize:hS,resolveAll:mS}}}}function hS(e,t,n){const r=this;let o=0,i=0,a;return u;function u(N){let H=r.events.length-1;for(;H>-1;){const Y=r.events[H][1].type;if(Y==="lineEnding"||Y==="linePrefix")H--;else break}const D=H>-1?r.events[H][1].type:null,$=D==="tableHead"||D==="tableRow"?A:c;return $===A&&r.parser.lazy[r.now().line]?n(N):$(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),d(N)}function d(N){return N===124||(a=!0,i+=1),m(N)}function m(N){return N===null?n(N):Q(N)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):he(N)?fe(e,m,"whitespace")(N):(i+=1,a&&(a=!1,o+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),h(N)))}function h(N){return N===null||N===124||Ie(N)?(e.exit("data"),m(N)):(e.consume(N),N===92?f:h)}function f(N){return N===92||N===124?(e.consume(N),h):h(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,he(N)?fe(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):x(N))}function x(N){return N===45||N===58?y(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),g):L(N)}function g(N){return he(N)?fe(e,y,"whitespace")(N):y(N)}function y(N){return N===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),E):N===45?(i+=1,E(N)):N===null||Q(N)?P(N):L(N)}function E(N){return N===45?(e.enter("tableDelimiterFiller"),R(N)):L(N)}function R(N){return N===45?(e.consume(N),R):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(N))}function C(N){return he(N)?fe(e,P,"whitespace")(N):P(N)}function P(N){return N===124?x(N):N===null||Q(N)?!a||o!==i?L(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):L(N)}function L(N){return n(N)}function A(N){return e.enter("tableRow"),z(N)}function z(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),z):N===null||Q(N)?(e.exit("tableRow"),t(N)):he(N)?fe(e,z,"whitespace")(N):(e.enter("data"),G(N))}function G(N){return N===null||N===124||Ie(N)?(e.exit("data"),z(N)):(e.consume(N),N===92?K:G)}function K(N){return N===92||N===124?(e.consume(N),G):G(N)}}function mS(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,c=0,d,m,h;const f=new uS;for(;++n<e.length;){const p=e[n],x=p[1];p[0]==="enter"?x.type==="tableHead"?(u=!1,c!==0&&(aa(f,t,c,d,m),m=void 0,c=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},f.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},f.add(n,0,[["enter",m,t]])),o=x.type==="tableDelimiterRow"?2:m?3:1):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],h=Pr(f,t,i,o,void 0,h),i=[0,0,0,0]),a[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],h=Pr(f,t,i,o,void 0,h)),i=a,a=[i[1],n,0,0])):x.type==="tableHead"?(u=!0,c=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(c=n,i[1]!==0?(a[0]=a[1],h=Pr(f,t,i,o,n,h)):a[1]!==0&&(h=Pr(f,t,a,o,n,h)),o=0):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&aa(f,t,c,d,m),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=cS(t.events,n))}return e}function Pr(e,t,n,r,o,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},xn(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const c=xn(t.events,n[1]);if(i={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const d=xn(t.events,n[2]),m=xn(t.events,n[3]),h={type:u,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,g=n[3]-n[2]-1;e.add(x,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return o!==void 0&&(i.end=Object.assign({},xn(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function aa(e,t,n,r,o){const i=[],a=xn(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function xn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pS={name:"tasklistCheck",tokenize:gS};function fS(){return{text:{91:pS}}}function gS(e,t,n){const r=this;return o;function o(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Ie(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(c)}function u(c){return Q(c)?t(c):he(c)?e.check({tokenize:xS},t,n)(c):n(c)}}function xS(e,t,n){return fe(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function ES(e){return va([zC(),JC(),aS(e),dS(),fS()])}const bS={};function IS(e){const t=this,n=e||bS,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(ES(n)),i.push(FC()),a.push(HC(n))}const jo=({isOrder:e,product:t})=>{var a;const{shopGeneral:n}=s.useStorefrontStore(),r=t.subscriptionSettings,{cart:o}=s.useCart();console.log(t.description);const{isAntistock:i}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("div",{className:`${ke.checkoutProduct} ${e?ke.isOrder:""}`,children:[s.jsxRuntimeExports.jsxs("div",{className:ke.productDetails,children:[s.jsxRuntimeExports.jsx("div",{className:`${ke.productImage} ${e?ke.isOrderImage:""} ${i?ke.productImageAntistock:""}`,children:t!=null&&t.image?s.jsxRuntimeExports.jsx("img",{className:ke.image,src:s.convertCfImageIdToUrl(t.image.cfId)}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Image",fill:"var(--text-secondary)"})}),s.jsxRuntimeExports.jsx("div",{className:ke.productInfo,children:s.jsxRuntimeExports.jsxs("div",{className:ke.productHeader,children:[s.jsxRuntimeExports.jsx("h2",{className:ke.productName,id:"h5",children:t.name}),s.jsxRuntimeExports.jsxs("span",{className:ke.quantityBadge,id:"md",children:[t.price.quantity,"x"]})]})}),t.chargeType==="RECURRING"&&s.jsxRuntimeExports.jsx("p",{className:ke.productPrice,id:"md",children:r&&`${s.formatPrice(r.price)} / ${s.normalizeInterval(r.recurringIntervalDays||0)}${r.entryFee?" + "+s.formatPrice(r.entryFee):""}`}),t.chargeType==="ONE_TIME"&&s.jsxRuntimeExports.jsx("p",{className:ke.productPrice,id:"md",children:t.variantsGateways&&o.gateway&&t.variantsGateways.some(u=>u.name===o.gateway&&u.overrodePrice)?s.formatPrice(((a=t.variantsGateways.find(u=>u.name===o.gateway))==null?void 0:a.overrodePrice)||t.price):s.formatPrice(t.price)})]}),t.description&&s.jsxRuntimeExports.jsx("p",{className:ke.productDescription,children:s.jsxRuntimeExports.jsx(tu,{remarkPlugins:[IS],rehypePlugins:[d_],components:{a:({node:u,...c})=>s.jsxRuntimeExports.jsx("a",{...c,target:"_blank",rel:"noopener noreferrer",className:ke.link})},children:t.description})}),t.deliveryCategories&&s.jsxRuntimeExports.jsx("div",{className:ke.deliveryCategories,children:t.deliveryCategories.map(u=>s.jsxRuntimeExports.jsx(s.DeliveryItem,{deliveryConfiguration:u},u.id))}),t.customerNote&&s.jsxRuntimeExports.jsxs("div",{className:ke.customerNote,children:[s.jsxRuntimeExports.jsxs("div",{className:ke.noteHeader,children:[(n==null?void 0:n.info.logo)&&s.jsxRuntimeExports.jsx("div",{className:ke.logoContainer,children:s.jsxRuntimeExports.jsx("img",{src:s.convertCfImageIdToUrl(n==null?void 0:n.info.logo.cfId)})}),s.jsxRuntimeExports.jsx("p",{className:ke.shopName,id:"md",children:n==null?void 0:n.info.name})]}),s.jsxRuntimeExports.jsx("p",{className:ke.noteContent,id:"md",children:t.customerNote})]})]})},TS="_coupon_dkjzv_1",_S="_couponApplied_dkjzv_7",CS="_discount_dkjzv_17",SS="_removeButton_dkjzv_23",yS="_removeButtonText_dkjzv_27",kS="_couponInput_dkjzv_31",RS="_couponInputContainer_dkjzv_37",Mt={coupon:TS,couponApplied:_S,discount:CS,removeButton:SS,removeButtonText:yS,couponInput:kS,couponInputContainer:RS},AS=({applyCoupon:e,couponData:t,discount:n,removeCoupon:r,gateway:o})=>{const[i,a]=k.useState(null),[u,c]=k.useState(!1),{isAntistock:d}=s.useGeneralStore();return s.jsxRuntimeExports.jsxs("div",{className:Mt.coupon,children:[u&&s.jsxRuntimeExports.jsx(s.ContentLoader,{speed:2,width:500,height:48,viewBox:"0 0 500 48",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:Mt.skeleton,children:s.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"100%",height:"48"})}),!u&&(t?s.jsxRuntimeExports.jsxs("div",{className:Mt.couponApplied,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"var(--text-success)"}),s.jsxRuntimeExports.jsxs("p",{id:"md",children:[i," is applied"," ",s.jsxRuntimeExports.jsxs("span",{className:Mt.discount,children:["-",n," ",!t.isFixed&&`(${t.discount}%)`]})]}),s.jsxRuntimeExports.jsx("button",{className:Mt.removeButton,onClick:r,children:s.jsxRuntimeExports.jsx("span",{className:Mt.removeButtonText,children:"Remove"})})]}):s.jsxRuntimeExports.jsxs("div",{className:Mt.couponInput,children:[s.jsxRuntimeExports.jsxs("div",{className:Mt.couponInputContainer,children:[s.jsxRuntimeExports.jsx(s.Input$1,{placeholder:"Enter a discount code",value:i||"",onChange:m=>{a(m===""?null:m)}}),s.jsxRuntimeExports.jsx(s.Button$1,{onClick:async()=>{c(!0),i&&await e(i),c(!1)},disabled:!o||!i,type:"Primary",children:"Apply"})]}),!o&&s.jsxRuntimeExports.jsx(s.Tip,{type:"warning",message:d?"Select a payment type to enter a discount or coupon code.":"The discount is related to the method of payment. Select to enter.",id:"md"})]}))]})},NS=({cart:e,products:t,applyCoupon:n,applyCouponPending:r,coupon:o,totalAndDiscount:i,removeCoupon:a})=>{var g;const{priceAdjusment:u}=s.useCartStore(),[c,d]=k.useState(!1),m=k.useMemo(()=>e.parts.map(y=>{const E=t.find(C=>C.id===y.productId),R=E==null?void 0:E.variants.find(C=>C.id===y.productVariantId);return y.chargeType==="RECURRING"&&d(!0),{id:(E==null?void 0:E.id)||0,image:E==null?void 0:E.images[0],name:(R==null?void 0:R.name)||"",description:(R==null?void 0:R.description)||"",price:{quantity:y.quantity,amount:(R==null?void 0:R.price.amount)||0,currency:R==null?void 0:R.price.currency},subscriptionSettings:R==null?void 0:R.subscriptionSettings,chargeType:y.chargeType,variantsGateways:R==null?void 0:R.gateways}}),[e,t]),h=((g=m[0])==null?void 0:g.price.currency)||"USD",f=new Intl.NumberFormat("en-US",{style:"currency",currency:h}),p=k.useMemo(()=>o&&!o.isFixed&&o.discount===100?i.total:i.totalWithDiscount?i.total-i.totalWithDiscount:0,[i,o]),x=u?(u==null?void 0:u.fixedAmount)+Math.round((i.totalWithDiscount!==void 0?i.totalWithDiscount:i.total-p)*((u==null?void 0:u.percentage)/100)):null;return s.jsxRuntimeExports.jsx("div",{className:Kt.checkoutItemsContainer,children:s.jsxRuntimeExports.jsxs("div",{className:Kt.innerContainer,children:[s.jsxRuntimeExports.jsx(cr,{}),s.jsxRuntimeExports.jsxs("div",{className:Kt.headerSection,children:[s.jsxRuntimeExports.jsx("header",{className:Kt.header,children:s.jsxRuntimeExports.jsx("h1",{id:"h3",children:"Checkout"})}),s.jsxRuntimeExports.jsx("div",{className:Kt.productsContainer,children:m.map(y=>s.jsxRuntimeExports.jsx(jo,{product:y},y.id))}),s.jsxRuntimeExports.jsx("div",{className:Kt.couponContainer,children:s.jsxRuntimeExports.jsx(AS,{applyCoupon:n,applyCouponPending:r,couponData:o,discount:f.format(p),removeCoupon:a,gateway:e.gateway})}),s.jsxRuntimeExports.jsx(dr,{formatter:f,coupon:o,total:i.total,discount:p,totalWithDiscount:i.totalWithDiscount,feeOrDiscount:c?null:x})]}),s.jsxRuntimeExports.jsx("div",{className:Kt.checkoutFooter,children:s.jsxRuntimeExports.jsx(vt,{})})]})})},wS="_checkoutOperational_1gpn5_1",LS="_innerContainer_1gpn5_16",jS="_antistock_1gpn5_25",vS="_paymentMethodsSection_1gpn5_30",PS="_socialConnectSection_1gpn5_36",DS="_socialConnectLabel_1gpn5_39",OS="_socialConnectContent_1gpn5_43",BS="_continueButton_1gpn5_47",MS="_button_1gpn5_51",FS="_checkoutFooter_1gpn5_55",Et={checkoutOperational:wS,innerContainer:LS,antistock:jS,paymentMethodsSection:vS,socialConnectSection:PS,socialConnectLabel:DS,socialConnectContent:OS,continueButton:BS,button:MS,checkoutFooter:FS},HS="_customFields_uhcib_2",US="_checkboxWrapper_uhcib_9",$S="_textareaWrapper_uhcib_16",zS="_inputWrapper_uhcib_17",WS="_requiredStar_uhcib_27",En={customFields:HS,checkboxWrapper:US,textareaWrapper:$S,inputWrapper:zS,requiredStar:WS},qS=({customFields:e,setCustomFields:t})=>{if(e.length===0)return null;const n=e.map(r=>s.jsxRuntimeExports.jsx(VS,{customField:r,setCustomFields:t},r.name));return s.jsxRuntimeExports.jsx("div",{className:En.customFields,children:n})},VS=({customField:e,setCustomFields:t})=>{const n=r=>{t(o=>o.map(i=>i.name===e.name?{...i,value:r}:i))};return s.jsxRuntimeExports.jsx(GS,{value:e.value??"",placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:n,label:e.name,regex:e.regex})},GS=({label:e,type:t,defaultValue:n,value:r,placeholder:o,regex:i,required:a,onValueChange:u})=>{if(k.useEffect(()=>{r===""&&n!==void 0&&u(String(n))},[]),t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox)return s.jsxRuntimeExports.jsxs("label",{className:En.checkboxWrapper,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:r==="true",onChange:d=>u(d?"true":"false")}),s.jsxRuntimeExports.jsxs("p",{className:En.checkboxLabel,children:[e,a&&s.jsxRuntimeExports.jsx("span",{className:En.requiredStar,children:"*"})]})]});if(t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Hidden)return s.jsxRuntimeExports.jsx("input",{type:"hidden",value:String(n??""),required:a});const c=d=>{(t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number?/^\d*$/:i?new RegExp(i):/.*/).test(d)&&u(d)};return t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Textarea?s.jsxRuntimeExports.jsx("div",{className:En.textareaWrapper,children:s.jsxRuntimeExports.jsx(s.Textarea$1,{label:e,value:r,placeholder:o,onChange:c,required:a})}):s.jsxRuntimeExports.jsx("div",{className:En.inputWrapper,children:s.jsxRuntimeExports.jsx(s.Input$1,{type:t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number?"number":"text",placeholder:t===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Number?"Type something number...":o,label:e,value:r,required:a,onChange:c})})},YS="_connectedContainer_1rxr8_1",XS="_userInfo_1rxr8_10",QS="_avatar_1rxr8_16",KS="_avatarImage_1rxr8_26",Dr={connectedContainer:YS,userInfo:XS,avatar:QS,avatarImage:KS},ZS=({customerEmail:e})=>{const{discordInfo:t,setDiscordInfo:n}=s.useDiscordStore(),{notifications:r,setNotifications:o}=s.useNotificationStore(),[i,a]=k.useState(!1),[u,c]=k.useState(0),[d,m]=k.useState(null),h=20,f=g=>{var y,E,R,C;return(E=(y=g==null?void 0:g.response)==null?void 0:y.data)!=null&&E.error?g.response.data.error:(C=(R=g==null?void 0:g.response)==null?void 0:R.data)!=null&&C.message?g.response.data.message:g!=null&&g.message?g.message:"Failed to connect to Discord. Please try again later."},p=(g,y)=>{o([...r,{id:s.v4(),message:g,status:y}])};k.useEffect(()=>{if(d&&i){const g=setInterval(()=>{d.closed&&(clearInterval(g),a(!1),m(null))},1e3);return()=>clearInterval(g)}},[d,i]);const x=()=>{e.trim()!==""&&(a(!0),c(0),lc({customerEmail:e,tsId:s.getTsId()}).then(({data:g})=>{const y=window.open(g.redirectUrl);m(y),(!y||y.closed||typeof y.closed>"u")&&setTimeout(()=>{const C=document.createElement("a");C.href=g.redirectUrl,C.target="_blank",C.click()});let E;const R=()=>{if(c(C=>C+1),u>=h||y&&y.closed){u>=h&&p("Authorization timeout. Please try again.","error"),a(!1),clearTimeout(E);return}cc({id:g.id,customerEmail:e}).then(({data:C})=>{n({authorized:!0,id:g.id,avatar:C.avatar,username:C.username}),y&&y.close(),a(!1),m(null),p("Discord successfully connected!","success"),clearTimeout(E)}).catch(C=>{var P;if(console.log("Waiting for authorization...",C,{newWindow:y}),y&&y.closed){a(!1),clearTimeout(E);return}if((P=C==null?void 0:C.response)!=null&&P.status&&C.response.status!==404&&C.response.status>=400){p(f(C),"error"),a(!1),clearTimeout(E);return}clearTimeout(E),E=setTimeout(R,1500)})};R()}).catch(g=>{console.log("Could not initiate Discord authorization",g),p(f(g),"error"),a(!1)}))};return t!=null&&t.authorized?s.jsxRuntimeExports.jsxs("div",{className:Dr.connectedContainer,children:[s.jsxRuntimeExports.jsxs("div",{className:Dr.userInfo,children:[s.jsxRuntimeExports.jsx("div",{className:Dr.avatar,children:t.avatar?s.jsxRuntimeExports.jsx("img",{className:Dr.avatarImage,src:`https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=256`}):s.jsxRuntimeExports.jsx(s.Icon,{name:"UserCircle"})}),s.jsxRuntimeExports.jsx("p",{children:t.username}),s.jsxRuntimeExports.jsx(Rf,{})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Reconnect"})]}):s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},disabled:i,children:i?s.jsxRuntimeExports.jsx(s.Loader,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"DiscordLogo"}),s.jsxRuntimeExports.jsx(s.StableText,{children:"Connect Your Discord"})]})})},JS="_paymentMethodsContainer_1pfqr_2",e3="_antistock_1pfqr_15",ua={paymentMethodsContainer:JS,antistock:e3},t3="_bottomSheet_1x8kc_1",n3="_content_1x8kc_8",r3="_description_1x8kc_11",s3="_title_1x8kc_15",o3="_buttonGroup_1x8kc_19",i3="_buttonWrapper_1x8kc_29",a3="_fullWidthButton_1x8kc_32",u3="_modal_1x8kc_36",l3="_header_1x8kc_43",wt={bottomSheet:t3,content:n3,description:r3,title:s3,buttonGroup:o3,buttonWrapper:i3,fullWidthButton:a3,modal:u3,header:l3},c3=({setIsOpen:e,balance:t})=>{const n=s.useNavigate(),{setIsOpen:r}=s.useModalStore(),o=()=>{n("/top-up?redirectRoute=checkout")};function i(){r(!1),setTimeout(()=>{e(!1)},300)}return s.jsxRuntimeExports.jsxs("div",{className:wt.modal,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:wt.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:wt.title,children:"Insufficient Customer Balance"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:i,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:wt.bottomSheet,children:[s.jsxRuntimeExports.jsx("div",{className:wt.content,children:s.jsxRuntimeExports.jsxs("p",{className:wt.description,children:["You currently have ",t&&s.formatPrice(t)," in your balance. After topping up the required amount, you can continue to checkout."]})}),s.jsxRuntimeExports.jsxs("div",{className:wt.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:wt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:i,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:wt.fullWidthButton,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:o,children:"Add Balance"})})]})]})]})},gl=({align:e,gateway:t,gatewayDisplayName:n,selected:r,onSelect:o,total:i,onSignInClick:a,reversed:u})=>{const{token:c}=s.useStorefrontStore(),{balance:d}=s.useCustomerDashboardStore(),[m,h]=k.useState(!1),{setIsOpen:f}=s.useModalStore(),p=x=>{x.stopPropagation(),o&&o(t),d&&d.amount<i&&(h(!0),f(!0))};return k.useEffect(()=>{},[d,i]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.clx(s.styles$3.paymentMethod,{[s.styles$3.selected]:r,[s.styles$3.alignColumn]:e==="column",[s.styles$3.reversed]:u}),onClick:p,children:[s.jsxRuntimeExports.jsxs("p",{className:s.styles$3.paymentText,id:"md",children:[n," ",s.jsxRuntimeExports.jsxs("span",{className:s.styles$3.balanceText,id:"md",children:["(",c?d&&s.formatPrice(d):s.jsxRuntimeExports.jsx("a",{className:s.styles$3.signInLink,onClick:a,id:"md",children:"Sign in"}),")"]})]}),s.jsxRuntimeExports.jsx("div",{className:s.styles$3.iconContainer,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]}),m&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>h(!1),children:s.jsxRuntimeExports.jsx(c3,{setIsOpen:h,balance:d})})]})},xl=({possibleGateways:e,setGateway:t,totalAndDiscount:n,onSignInClick:r,setPaymentMethod:o,isAntistock:i=!1})=>{const[a,u]=k.useState(),[c,d]=k.useState(),{setPriceAdjustment:m}=s.useCartStore(),[h,f]=k.useState(null),p=(x,g)=>{var y;c!==g&&(t(g),m(((y=h==null?void 0:h.find(E=>E.name===g))==null?void 0:y.priceAdjustment)||null)),o(x),u(x),d(g)};return k.useEffect(()=>{if(h&&h.length>0){const x=h[0];if(x.name==="Balance")d(x.name),t(x.name),m(x.priceAdjustment||null);else if(x.paymentMethods&&x.paymentMethods.length>0){const g=x.paymentMethods[0];u(g),d(x.name),t(x.name),o(g),m(x.priceAdjustment||null)}}},[h]),k.useEffect(()=>{const x=async()=>{const{data:g}=await s.fetchGatewaysDetail([...e.availableGateways,...e.requiresSignInGateways]);f(g)};e.availableGateways.length&&x()},[]),k.useLayoutEffect(()=>{m(null)},[]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[h&&s.jsxRuntimeExports.jsx("div",{className:s.clx(ua.paymentMethodsContainer,{[ua.antistock]:i}),children:h==null?void 0:h.map(x=>x.name==="Balance"?s.jsxRuntimeExports.jsx(gl,{gateway:x.name,gatewayDisplayName:x.displayName,onSelect:g=>{d(g),c!==g&&t(g)},selected:x.name===c,total:n.total,onSignInClick:r,reversed:!0},x.name):x.paymentMethods.map(g=>s.jsxRuntimeExports.jsx(s.CheckoutPaymentMethod,{paymentMethod:g,gateway:x.name,gatewayDisplayName:x.displayName,gatewayLogoCfId:x.logoCfImageId,poweredByLogoCfId:x.poweredByImageCfImageId,onSelect:y=>p(y,x.name),selected:a===g&&c===x.name},`${x.name}-${g}`)))}),!h&&s.jsxRuntimeExports.jsx(s.ContentLoader,{speed:2,width:"100%",height:"220px",viewBox:"0 0 600 220",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",children:s.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"100%",height:"100%"})})]})},d3="_modal_14r0b_1",h3={modal:d3},m3=({setIsOpen:e})=>{const{token:t}=s.useStorefrontStore(),{setIsOpen:n}=s.useModalStore();k.useEffect(()=>{t&&r()},[t]);const r=()=>{n(!1),setTimeout(()=>{e(!1)},300)};return s.jsxRuntimeExports.jsx("div",{className:h3.modal,onClick:o=>o.stopPropagation(),children:s.jsxRuntimeExports.jsx(s.Auth,{inModal:!0})})},p3=({getPossibleGateways:e,setGateway:t,getDiscordSettings:n,cart:r,products:o,submitCart:i,reset:a,setCustomFieldsToCart:u,totalAndDiscount:c,setDiscordSocialConnectId:d,setPaymentMethod:m,isAntistock:h})=>{const f=k.useMemo(()=>n(),[]),[p,x]=k.useState([]),{balance:g,setBalance:y}=s.useCustomerDashboardStore(),{token:E}=s.useStorefrontStore(),{executeRecaptcha:R}=s.useReCaptcha(),{discordInfo:C}=s.useDiscordStore(),{customerEmail:P,setCustomerEmail:L}=s.useCartStore(),A=C!=null&&C.authorized?C.id:void 0,z=s.useNavigate(),G=k.useMemo(()=>e(),[r.parts]),[K,N]=k.useState(!1),{setIsOpen:H}=s.useModalStore(),{notifications:D,setNotifications:$}=s.useNotificationStore();k.useEffect(()=>{const V=s.getCommonCustomFields(r.parts,o).map(ue=>ue.type===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox?{...ue,value:String(ue.defaultValue)}:ue);x([...V])},[]),k.useEffect(()=>{const W=s.getCommonCustomFields(r.parts,o);x(V=>{const ue=new Map(V.map(T=>[T.name,T]));return W.map(T=>{const ce=ue.get(T.name);return ce&&ce.value?{...T,value:ce.value}:T.type===s.PRODUCT_VARIANT_EXTRA_FIELD_TYPE.Checkbox?{...T,value:String(T.defaultValue)}:T})})},[r.parts,o]),k.useEffect(()=>{E&&(async()=>{const V=await s.getBalance();y(V)})()},[E]);function Y(W){return W&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(W)}const q=()=>{const W=[];return p.forEach(V=>{var ue;V.required&&!((ue=V.value)!=null&&ue.toString().trim())&&W.push({message:`Field "${V.name}" is required.`,status:"error",id:s.v4()})}),W.length>0?($([...D,...W]),!1):!0},ee=async W=>{if(W.stopPropagation(),r.gateway==="Balance"&&!E){H(!0),N(!0);return}if(!q())return;const V=Object.fromEntries(p.map(T=>[T.name,T.value||""]));u({...V}),A&&f.isEnabled&&d(A);const ue=await R();if(ue){const T=await i(ue),ce=JSON.parse(localStorage.getItem("orders")||"{}");if(Object.keys(ce).length>10){const je=Date.now()-864e5;Object.keys(ce).forEach(S=>{ce[S].createdAt<=je&&delete ce[S]})}"order"in T?ce[T.order.id]={createdAt:Date.now(),fullAccessToken:T.order.fullAccessToken}:ce[T.id]={createdAt:Date.now(),fullAccessToken:T.fullAccessToken},localStorage.setItem("orders",JSON.stringify(ce)),z(`/orders/${"order"in T?T.order.id:T.id}/${"order"in T?T.order.fullAccessToken:T.fullAccessToken}`),setTimeout(()=>a(),0)}};return s.jsxRuntimeExports.jsxs("div",{className:Et.checkoutOperational,children:[s.jsxRuntimeExports.jsxs("div",{className:Et.innerContainer,children:[r.parts.length>0&&s.jsxRuntimeExports.jsx(xl,{possibleGateways:G,setGateway:t,setPaymentMethod:m,balance:g,totalAndDiscount:c,onSignInClick:()=>{N(!0),H(!0)},isAntistock:h}),s.jsxRuntimeExports.jsx("div",{className:s.clx(Et.paymentMethodsSection,{[Et.antistock]:h}),children:s.jsxRuntimeExports.jsx(s.Input$1,{placeholder:"mail@mail.com",value:P||"",onChange:W=>L(W),disabled:!!E,label:"Email Address"})}),s.jsxRuntimeExports.jsx(qS,{customFields:p,setCustomFields:x}),f.isEnabled&&s.jsxRuntimeExports.jsxs("div",{className:Et.socialConnectSection,children:[s.jsxRuntimeExports.jsx("p",{className:Et.socialConnectLabel,id:"md",children:"Social Connect"}),s.jsxRuntimeExports.jsx("div",{className:Et.socialConnectContent,children:s.jsxRuntimeExports.jsx(ZS,{customerEmail:P||""})})]}),s.jsxRuntimeExports.jsxs("div",{className:Et.continueButton,children:[s.jsxRuntimeExports.jsx(s.Button$1,{onClick:ee,disabled:!r.gateway||!Y(P||"")||f.isRequired&&!(C!=null&&C.authorized),className:Et.button,children:"Continue to Checkout"}),!h&&s.jsxRuntimeExports.jsx(s.TermsOfService,{}),s.jsxRuntimeExports.jsx(s.SecuredBySsl,{})]}),s.jsxRuntimeExports.jsx(vt,{className:Et.checkoutFooter})]}),K&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>N(!1),children:s.jsxRuntimeExports.jsx(m3,{setIsOpen:N})})]})},f3="_mt1_1t7v2_1",g3="_notifyBlock_1t7v2_13",x3="_notifyHeader_1t7v2_19",E3="_notifyContent_1t7v2_25",b3="_buttonBlock_1t7v2_30",I3="_imageBlock_1t7v2_34",T3="_imageContainer_1t7v2_42",_3="_sectionBlock_1t7v2_54",C3="_sectionTitle_1t7v2_61",S3="_sectionSubtitle_1t7v2_64",y3="_inputContainer_1t7v2_69",pt={mt1:f3,notifyBlock:g3,notifyHeader:x3,notifyContent:E3,buttonBlock:b3,imageBlock:I3,imageContainer:T3,sectionBlock:_3,sectionTitle:C3,sectionSubtitle:S3,inputContainer:y3},k3=({props:e})=>{const t=s.useCopy();return s.jsxRuntimeExports.jsx("div",{className:pt.mt1,children:s.jsxRuntimeExports.jsxs("div",{className:pt.inputContainer,children:[s.jsxRuntimeExports.jsx(s.Input$1,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:()=>t(e.text),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"})})]})})},R3=({props:e})=>s.jsxRuntimeExports.jsx(s.Button$1,{className:pt.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),A3=({props:e})=>s.jsxRuntimeExports.jsx("div",{className:pt.imageBlock,children:s.jsxRuntimeExports.jsx("div",{className:pt.imageContainer,children:s.jsxRuntimeExports.jsx("img",{src:e.src,alt:""})})}),N3=({props:e})=>s.jsxRuntimeExports.jsxs("div",{className:pt.notifyBlock,children:[s.jsxRuntimeExports.jsxs("div",{className:pt.notifyHeader,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),s.jsxRuntimeExports.jsx("p",{children:e.heading})]}),s.jsxRuntimeExports.jsx("p",{className:pt.notifyContent,children:e.content})]}),w3=({props:e})=>{var t;return s.jsxRuntimeExports.jsxs("div",{className:pt.sectionBlock,children:[s.jsxRuntimeExports.jsx("p",{className:pt.sectionTitle,children:e.title}),s.jsxRuntimeExports.jsx("span",{className:pt.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>s.jsxRuntimeExports.jsx(El,{block:n},r))]})},El=({block:e})=>{switch(e.type){case"Section":return s.jsxRuntimeExports.jsx(w3,{...e});case"ReadOnlyTextInput":return s.jsxRuntimeExports.jsx(k3,{...e});case"Notify":return s.jsxRuntimeExports.jsx(N3,{...e});case"Button":return s.jsxRuntimeExports.jsx(R3,{...e});case"Image":return s.jsxRuntimeExports.jsx(A3,{...e});default:return null}},L3="_bottomSheet_1x4sq_1",j3="_content_1x4sq_8",v3="_agreementList_1x4sq_11",P3="_agreementItem_1x4sq_16",D3="_warning_1x4sq_23",O3="_buttonGroup_1x4sq_31",B3="_buttonWrapper_1x4sq_41",M3="_fullWidthButton_1x4sq_44",F3="_modal_1x4sq_48",H3="_header_1x4sq_55",Je={bottomSheet:L3,content:j3,agreementList:v3,agreementItem:P3,warning:D3,buttonGroup:O3,buttonWrapper:B3,fullWidthButton:M3,modal:F3,header:H3},U3=({setIsOpen:e,price:t})=>{const[n,r]=k.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:o}=s.useModalStore(),i=()=>{o(!1),setTimeout(()=>{e(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:Je.modal,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:Je.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Note"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:i,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:Je.bottomSheet,children:[s.jsxRuntimeExports.jsxs("div",{className:Je.content,children:[s.jsxRuntimeExports.jsxs("div",{className:Je.agreementList,children:[s.jsxRuntimeExports.jsxs("label",{className:Je.agreementItem,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:n.agreeToSendAsFF,onChange:a=>r({...n,agreeToSendAsFF:a})}),s.jsxRuntimeExports.jsx("p",{children:"I agree to send the payment as friends & family"})]}),s.jsxRuntimeExports.jsxs("label",{className:Je.agreementItem,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:n.agreeToSend,onChange:a=>r({...n,agreeToSend:a})}),s.jsxRuntimeExports.jsxs("p",{children:["I agree to send the payment of ",s.formatPrice(t)," ",t.currency]})]}),s.jsxRuntimeExports.jsxs("label",{className:Je.agreementItem,children:[s.jsxRuntimeExports.jsx(s.Checkbox,{value:n.agreeToNotAddNote,onChange:a=>r({...n,agreeToNotAddNote:a})}),s.jsxRuntimeExports.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),s.jsxRuntimeExports.jsx("div",{className:Je.warning,children:s.jsxRuntimeExports.jsxs("p",{children:["Please note that you are required to send the exact payment of ",s.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),s.jsxRuntimeExports.jsxs("div",{className:Je.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:Je.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",children:s.jsxRuntimeExports.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),s.jsxRuntimeExports.jsx("div",{className:Je.fullWidthButton,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:i,children:"Continue to Payment"})})]})]})]})},$3="_chargeItemsContainer_qmv3w_4",z3="_chargeItemsInner_qmv3w_20",W3="_productsContainer_qmv3w_27",q3="_chargeHeader_qmv3w_41",V3="_chargeTitle_qmv3w_49",G3="_chargeDescription_qmv3w_55",Y3="_copyButton_qmv3w_61",X3="_productsList_qmv3w_73",Q3="_trackingContainer_qmv3w_81",K3="_footerContainer_qmv3w_91",bt={chargeItemsContainer:$3,chargeItemsInner:z3,productsContainer:W3,chargeHeader:q3,chargeTitle:V3,chargeDescription:G3,copyButton:Y3,productsList:X3,trackingContainer:Q3,footerContainer:K3},Z3=({charge:e})=>{var i;const t=s.useCopy(),n=(e==null?void 0:e.price.currency)||"USD",r=new Intl.NumberFormat("en-US",{style:"currency",currency:n}),o=k.useMemo(()=>{var a;return((a=e==null?void 0:e.order)==null?void 0:a.partOrders.map(u=>{var c,d,m,h,f,p;return{id:(u==null?void 0:u.id)||0,image:u.productWithVariant.image,name:((c=u.productWithVariant)==null?void 0:c.variantName)||"",description:((d=u.productWithVariant)==null?void 0:d.description)||"",price:{quantity:u.quantity,amount:((m=u.productWithVariant)==null?void 0:m.price.amount)||0,currency:(h=u.productWithVariant)==null?void 0:h.price.currency},subscriptionSettings:(f=e.order)!=null&&f.subscriptionOrderId?(p=u.productWithVariant)==null?void 0:p.subscriptionSettings:null}}))||[]},[e]);return s.jsxRuntimeExports.jsx("div",{className:bt.chargeItemsContainer,children:s.jsxRuntimeExports.jsxs("div",{className:bt.chargeItemsInner,children:[s.jsxRuntimeExports.jsx(cr,{expiresAt:e==null?void 0:e.expiresAt}),s.jsxRuntimeExports.jsxs("div",{className:bt.productsContainer,children:[(e==null?void 0:e.name)&&s.jsxRuntimeExports.jsxs("header",{className:bt.chargeHeader,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("h1",{className:bt.chargeTitle,id:"h5",children:e.name}),e.description&&s.jsxRuntimeExports.jsx("p",{className:bt.chargeDescription,id:"md",children:e.description})]}),((i=e.order)==null?void 0:i.id)&&s.jsxRuntimeExports.jsxs(s.Button$1,{type:"Secondary",className:bt.copyButton,onClick:()=>{var a;return t(((a=e.order)==null?void 0:a.id)||"")},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"}),"Copy Order ID"]})]}),s.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[!!o.length&&s.jsxRuntimeExports.jsx("div",{className:bt.productsList,children:o.map(a=>s.jsxRuntimeExports.jsx(jo,{product:a},a.id))}),s.jsxRuntimeExports.jsx(dr,{formatter:r,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1})]}),s.jsxRuntimeExports.jsxs("div",{children:[e&&s.jsxRuntimeExports.jsx("div",{className:bt.trackingContainer,children:s.jsxRuntimeExports.jsx(s.TrackPayment,{timeline:e.timeline})}),s.jsxRuntimeExports.jsx(vt,{className:bt.footerContainer})]})]})]})})},J3="_checkoutOrderMainData_hqf60_1",ey="_orderDetailRow_hqf60_6",ty="_chargeIdRow_hqf60_16",ny="_detailLabel_hqf60_25",ry="_detailValue_hqf60_29",sy="_chargeIdContainer_hqf60_33",oy="_chargeId_hqf60_16",iy="_copyIcon_hqf60_51",$e={checkoutOrderMainData:J3,orderDetailRow:ey,chargeIdRow:ty,detailLabel:ny,detailValue:ry,chargeIdContainer:sy,chargeId:oy,copyIcon:iy},bl=({lastUpdate:e,invoiceId:t,email:n,paymentType:r})=>{const o=s.useCopy(),[i,a]=k.useState(null),u=i==null?void 0:i.find(d=>d.name===r);k.useEffect(()=>{i||(async()=>{const m=[r],h=await s.getGatewaysDetail(m);a(h)})()},[r,i]);const c=d=>{const m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h=d.getDate().toString().padStart(2,"0"),f=m[d.getMonth()],p=d.getFullYear(),x=d.getHours(),g=d.getMinutes().toString().padStart(2,"0"),y=d.getSeconds().toString().padStart(2,"0"),E=x>=12?"PM":"AM",R=(x%12||12).toString().padStart(2,"0");return`${f} ${h}, ${p} at ${R}:${g}:${y} ${E}`};return s.jsxRuntimeExports.jsxs("div",{className:$e.checkoutOrderMainData,children:[s.jsxRuntimeExports.jsxs("div",{className:$e.orderDetailRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Last Updated"}),s.jsxRuntimeExports.jsx("p",{className:$e.detailValue,id:"md",children:c(new Date(e))})]}),s.jsxRuntimeExports.jsxs("div",{className:$e.orderDetailRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Payment Type"}),s.jsxRuntimeExports.jsx("p",{className:$e.detailValue,id:"md",children:u==null?void 0:u.displayName})]}),s.jsxRuntimeExports.jsxs("div",{className:$e.orderDetailRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Email"}),s.jsxRuntimeExports.jsx("p",{className:$e.detailValue,id:"md",children:n})]}),s.jsxRuntimeExports.jsxs("div",{className:$e.chargeIdRow,children:[s.jsxRuntimeExports.jsx("p",{className:$e.detailLabel,id:"md",children:"Charge ID"}),s.jsxRuntimeExports.jsxs("div",{className:$e.chargeIdContainer,children:[s.jsxRuntimeExports.jsx("p",{className:$e.chargeId,id:"md",children:t}),s.jsxRuntimeExports.jsx("div",{className:$e.copyIcon,onClick:()=>o(t),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"})})]})]})]})},ay="_bottomSheet_1yai1_1",uy="_formContainer_1yai1_8",ly="_error_1yai1_14",cy="_buttonGroup_1yai1_18",dy="_buttonWrapper_1yai1_28",hy="_fullWidthButton_1yai1_31",my="_modal_1yai1_41",py="_header_1yai1_48",Ft={bottomSheet:ay,formContainer:uy,error:ly,buttonGroup:cy,buttonWrapper:dy,fullWidthButton:hy,modal:my,header:py},fy=({chargeId:e,setIsOpen:t})=>{const[n,r]=k.useState(""),[o,i]=k.useState(""),{setIsOpen:a}=s.useModalStore(),u=m=>{try{return new URL(m),!0}catch{return!1}},c=async m=>{if(m.preventDefault(),!n){i("The link field cannot be empty.");return}if(!u(n)){i("Please enter a valid URL");return}await rc({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},d=()=>{a(!1),setTimeout(()=>{t(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:Ft.modal,onClick:m=>m.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:Ft.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"CashApp Verify"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:d,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsx("form",{onSubmit:c,children:s.jsxRuntimeExports.jsxs("div",{className:Ft.bottomSheet,children:[s.jsxRuntimeExports.jsx("div",{className:Ft.formContainer,children:s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx(s.Input$1,{value:n,onChange:m=>{r(m),i("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),o&&s.jsxRuntimeExports.jsx("p",{className:Ft.error,children:o})]})}),s.jsxRuntimeExports.jsxs("div",{className:Ft.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:Ft.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:d,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:Ft.fullWidthButton,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",children:"Verify"})})]})]})})]})},gy="_container_1opbn_1",xy="_productDetails_1opbn_8",Ey="_imageContainer_1opbn_14",by="_image_1opbn_14",Iy="_textContainer_1opbn_32",Ty="_header_1opbn_40",_y="_title_1opbn_46",Cy="_price_1opbn_53",Sy="_badgeContainer_1opbn_57",yy="_description_1opbn_61",It={container:gy,productDetails:xy,imageContainer:Ey,image:by,textContainer:Iy,header:Ty,title:_y,price:Cy,badgeContainer:Sy,description:yy},ky=({subscription:e})=>s.jsxRuntimeExports.jsxs("div",{className:It.container,children:[s.jsxRuntimeExports.jsxs("div",{className:It.productDetails,children:[s.jsxRuntimeExports.jsx("div",{className:It.imageContainer,children:e!=null&&e.image?s.jsxRuntimeExports.jsx("img",{className:It.image,src:s.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Image"})}),s.jsxRuntimeExports.jsxs("div",{className:It.textContainer,children:[s.jsxRuntimeExports.jsx("div",{className:It.header,children:s.jsxRuntimeExports.jsx("h2",{className:It.title,children:e.name})}),s.jsxRuntimeExports.jsxs("p",{className:It.price,children:[s.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsxRuntimeExports.jsx("div",{className:It.badgeContainer,children:s.jsxRuntimeExports.jsx(s.SubscriptionStatusBadge,{status:e.status})})]}),e.description&&s.jsxRuntimeExports.jsx(tu,{className:It.description,children:e.description})]}),Ry="_card_69liy_1",Ay="_price_69liy_10",Ny="_interval_69liy_17",wy="_name_69liy_22",Ly="_description_69liy_28",jy="_currentPlan_69liy_32",vy="_selectButton_69liy_45",Py="_progressSection_69liy_50",Dy="_progressLabel_69liy_54",Oy="_bottomSheet_69liy_60",By="_title_69liy_69",My="_typeSelector_69liy_80",Fy="_typeOption_69liy_90",Hy="_active_69liy_100",Uy="_saveTag_69liy_108",$y="_planSelector_69liy_117",zy="_modal_69liy_127",Wy="_inactive_69liy_148",qy="_notMounted_69liy_151",Vy="_closeButton_69liy_157",Se={card:Ry,price:Ay,interval:Ny,name:wy,description:Ly,currentPlan:jy,selectButton:vy,progressSection:Py,progressLabel:Dy,bottomSheet:Oy,title:By,typeSelector:My,typeOption:Fy,active:Hy,saveTag:Uy,planSelector:$y,modal:zy,inactive:Wy,notMounted:qy,closeButton:Vy},Gy=({variant:e,onSelect:t,isCurrent:n})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",o=e.subscriptionSettings.price.amount.toFixed(2),i=e.subscriptionSettings.recurringIntervalDays,a=10;return s.jsxRuntimeExports.jsxs("div",{className:Se.card,onClick:t,children:[s.jsxRuntimeExports.jsxs("h2",{className:Se.price,children:["$",o," ",s.jsxRuntimeExports.jsxs("span",{className:Se.interval,children:["/ ",r]})]}),s.jsxRuntimeExports.jsx("h3",{className:Se.name,children:e.name}),e.description&&s.jsxRuntimeExports.jsx("p",{className:Se.description,children:e.description}),n?s.jsxRuntimeExports.jsxs("div",{className:Se.currentPlan,children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Check"}),"Your current Plan"]}):s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",className:Se.selectButton,children:"Select"}),n&&s.jsxRuntimeExports.jsxs("div",{className:Se.progressSection,children:[s.jsxRuntimeExports.jsx(fa,{percent:a/i*100,disablePercentLabel:!0}),s.jsxRuntimeExports.jsxs("p",{className:Se.progressLabel,children:["Used: ",a," of ",i," days"]})]})]})},Yy=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,o]=k.useState(null),[i,a]=k.useState(null),[u,c]=k.useState(null),{id:d,accessToken:m}=s.useParams(),[h,f]=k.useState(!1),[p,x]=k.useState(!1),{setIsOpen:g}=s.useModalStore();k.useEffect(()=>{e&&f(!0)},[e]);const y=()=>{t(!1)},[E,R]=k.useState(null);k.useEffect(()=>{d&&m&&(async()=>{if(d&&m){const{data:A}=await s.getSubscriptionUpgradePlans({id:d,accessToken:m});R(A)}})()},[d,m]),k.useEffect(()=>{var L;if(E!=null&&E.data.types[0]){const A=(L=E.data.types.flatMap(z=>z.productVariants).find(z=>z.data.id===(n==null?void 0:n.variantId)))==null?void 0:L.data;A&&(c(A),a(A))}},[E,n]),k.useEffect(()=>{E!=null&&E.data.types[0]&&o(E==null?void 0:E.data.types[0])},[E==null?void 0:E.data.types]);const C=L=>{o(L),a(null)},P=L=>{a(L),g(!0),x(!0)};return s.jsxRuntimeExports.jsxs("div",{className:s.clx(Se.modal,{[Se.active]:e,[Se.inactive]:!e&&h,[Se.notMounted]:!h}),onClick:L=>L.stopPropagation(),children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:y,hoverable:!0,className:Se.closeButton,fill:"var(--text-primary)"}),s.jsxRuntimeExports.jsxs("div",{className:Se.bottomSheet,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:Se.title,children:"Change Plan"}),s.jsxRuntimeExports.jsx("p",{className:Se.description,children:E==null?void 0:E.data.description}),s.jsxRuntimeExports.jsx("div",{className:Se.typeSelector,children:E==null?void 0:E.data.types.map(L=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(Se.typeOption,{[Se.active]:(r==null?void 0:r.id)===L.id}),onClick:()=>C(L),children:[L.name,L.name==="Yearly"&&s.jsxRuntimeExports.jsx("span",{className:Se.saveTag,children:"Save %"})]},L.id))}),r&&s.jsxRuntimeExports.jsx("div",{className:Se.planSelector,children:r.productVariants.map(L=>s.jsxRuntimeExports.jsx(Gy,{variant:L.data,isSelected:(i==null?void 0:i.id)===L.data.id,isCurrent:(u==null?void 0:u.id)===L.data.id,onSelect:()=>P(L.data)},L.data.id))})]}),p&&i&&n&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>{x(!1)},children:s.jsxRuntimeExports.jsx(Mk,{setIsOpen:x,selectedVariant:i,subscription:n})})]})},Xy="_container_nb625_1",Qy="_title_nb625_11",Ky="_subtitle_nb625_16",Zy="_info_nb625_20",Or={container:Xy,title:Qy,subtitle:Ky,info:Zy},Jy=()=>{const{subscription:e}=s.useSubscriptionStore(),[t,n]=s.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,o]=k.useState(!1),{setIsOpen:i}=s.useModalStore();return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:Or.container,children:[s.jsxRuntimeExports.jsxs("div",{className:Or.info,children:[s.jsxRuntimeExports.jsx("p",{className:Or.title,children:"Expiration Date"}),s.jsxRuntimeExports.jsxs("p",{className:Or.subtitle,children:[t," at ",n]})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Special",onClick:a=>{a.stopPropagation(),i(!0),o(!0)},children:"Extend"})]}),r&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>o(!1),children:s.jsxRuntimeExports.jsx(nR,{setIsOpen:o})})]})},ek="_couponContainer_1sspa_1",tk="_iconWrapper_1sspa_10",nk="_details_1sspa_21",rk="_title_1sspa_25",sk="_progress_1sspa_29",ok="_foreverText_1sspa_34",gn={couponContainer:ek,iconWrapper:tk,details:nk,title:rk,progress:sk,foreverText:ok},ik=({coupon:e,currency:t})=>{const n=e.isFixed?s.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?s.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return s.jsxRuntimeExports.jsxs("div",{className:gn.couponContainer,children:[s.jsxRuntimeExports.jsx("div",{className:gn.iconWrapper,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"CheckCircle"})}),s.jsxRuntimeExports.jsxs("div",{className:gn.details,children:[s.jsxRuntimeExports.jsxs("p",{className:gn.title,children:[e.name,", ",n," discount"]}),s.jsxRuntimeExports.jsx("div",{className:gn.progress,children:s.jsxRuntimeExports.jsx(fa,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),s.jsxRuntimeExports.jsx("p",{className:gn.foreverText,children:"Forever discount code"})]})]})},ak="_paymentMethodContainer_1g0da_4",uk="_paymentMethodTitle_1g0da_15",lk="_activeMethod_1g0da_20",ck="_noMethod_1g0da_28",dk="_activeMethodPaymentMethod_1g0da_37",hk="_paymentMethodLogo_1g0da_47",mk="_paymentMethodNumber_1g0da_57",pk="_method_1g0da_61",Wt={paymentMethodContainer:ak,paymentMethodTitle:uk,activeMethod:lk,noMethod:ck,activeMethodPaymentMethod:dk,paymentMethodLogo:hk,paymentMethodNumber:mk,method:pk},fk="_paymentMethods_1gev0_1",gk="_modal_1gev0_14",xk="_header_1gev0_28",Ek="_content_1gev0_37",Jt={paymentMethods:fk,modal:gk,header:xk,content:Ek},bk=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:o}=s.useSubscriptionStore();if(!r)return null;const{id:i}=s.useParams(),a=s.useNavigate(),{notifications:u,setNotifications:c}=s.useNotificationStore(),{setPaymentMethod:d,setGateway:m,cart:h}=s.useCart(),{setIsOpen:f}=s.useModalStore();async function p(){if(x(),t(!0),i&&r){const{data:g}=await s.changeSubscriptionGateway(i,h.gateway);g.isReconnectPaymentNeeded?a(`/charges/${g.chargeId}`):(c([...u,{status:"success",id:s.v4(),message:"Your action has been successfully completed"}]),o({...r,gatewayName:h.gateway}))}else c([...u,{status:"error",id:s.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function x(){f(!1),setTimeout(()=>{n(!1)},300)}return s.jsxRuntimeExports.jsxs("div",{className:Jt.modal,onClick:g=>{g.stopPropagation()},children:[s.jsxRuntimeExports.jsxs("div",{className:Jt.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:Jt.title,children:"Choose Payment Method"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:x,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:Jt.content,children:[(r==null?void 0:r.availableGateways)&&s.jsxRuntimeExports.jsx(xl,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:m,setPaymentMethod:d,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>a("/customer-dash")}),s.jsxRuntimeExports.jsxs("div",{className:Jt.paymentMethods,children:[s.jsxRuntimeExports.jsx("div",{className:Jt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:Jt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",disabled:!h.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},Ik="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20131.39%2086.9'%3e%3cdefs%3e%3cstyle%3e.a{opacity:0;}.b{fill:%23fff;}.c{fill:%23ff5f00;}.d{fill:%23eb001b;}.e{fill:%23f79e1b;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20class='a'%3e%3crect%20class='b'%20width='131.39'%20height='86.9'/%3e%3c/g%3e%3crect%20class='c'%20x='48.37'%20y='15.14'%20width='34.66'%20height='56.61'/%3e%3cpath%20class='d'%20d='M51.94,43.45a35.94,35.94,0,0,1,13.75-28.3,36,36,0,1,0,0,56.61A35.94,35.94,0,0,1,51.94,43.45Z'/%3e%3cpath%20class='e'%20d='M120.5,65.76V64.6H121v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.36v1.4h.26V64.7l.39.91h.27l.39-.91v1.06Z'/%3e%3cpath%20class='e'%20d='M123.94,43.45a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z'/%3e%3c/svg%3e",Tk=()=>{var x,g,y;const{subscription:e}=s.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=s.useCart(),r=s.useNavigate(),[o,i]=k.useState(null),[a,u]=k.useState(!1),[c,d]=k.useState(!1),{setIsOpen:m}=s.useModalStore();if(!e)return null;const[h,f]=k.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return k.useEffect(()=>{(async()=>{const R=await s.getGatewaysDetail(e.availableGateways);i(R)})()},[]),k.useEffect(()=>{t.gateway!==h&&f(t.gateway)},[t.gateway]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:Wt.paymentMethodContainer,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("p",{className:Wt.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&s.jsxRuntimeExports.jsx(_k,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&h==="Balance"&&s.jsxRuntimeExports.jsx(gl,{gateway:h,gatewayDisplayName:h,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!h&&s.jsxRuntimeExports.jsx("span",{className:Wt.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&h&&s.jsxRuntimeExports.jsx("div",{className:Wt.activeMethod,children:o&&s.jsxRuntimeExports.jsx(s.CheckoutPaymentMethod,{align:"row",gatewayLogoCfId:(x=o.find(E=>E.name===h))==null?void 0:x.logoCfImageId,gatewayDisplayName:(g=o.find(E=>E.name===h))==null?void 0:g.displayName,gateway:h,poweredByLogoCfId:(y=o.find(E=>E.name===h))==null?void 0:y.poweredByImageCfImageId,className:Wt.activeMethodPaymentMethod,selected:p===h,onSelect:E=>{n(E)}},h)})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Special",onClick:E=>{E.stopPropagation(),m(!0),d(!0)},children:t.gateway?"Change":"Manage"})]}),c&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>d(!1),children:s.jsxRuntimeExports.jsx(bk,{setIsLoading:u,setIsOpen:d})})]})},_k=({gatewayInfo:e})=>{var t,n,r,o,i;return s.jsxRuntimeExports.jsxs("div",{className:Wt.method,children:[s.jsxRuntimeExports.jsxs("div",{className:Wt.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&s.jsxRuntimeExports.jsx(s.Visa,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&s.jsxRuntimeExports.jsx("img",{src:Ik,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((o=e.card)==null?void 0:o.brand.toLowerCase())!=="mastercard"&&s.jsxRuntimeExports.jsx(s.Icon,{name:"CreditCard",width:22})]}),s.jsxRuntimeExports.jsxs("p",{className:Wt.paymentMethodNumber,children:["•••• •••• •••• ",(i=e.card)==null?void 0:i.last4]})]})},Ck="_subscriptionProductContainer_83ibx_4",Sk="_subscriptionProductImage_83ibx_15",yk="_subscriptionProductInfo_83ibx_32",kk="_name_83ibx_37",Rk="_price_83ibx_40",Vn={subscriptionProductContainer:Ck,subscriptionProductImage:Sk,subscriptionProductInfo:yk,name:kk,price:Rk},Ak=({subscription:e,id:t,accessToken:n})=>{const[r,o]=k.useState(!1),{setIsOpen:i}=s.useModalStore();return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:Vn.subscriptionProductContainer,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsx("div",{className:Vn.subscriptionProductImage,children:e!=null&&e.image?s.jsxRuntimeExports.jsx("img",{src:s.convertCfImageIdToUrl(e.image.cfId)}):s.jsxRuntimeExports.jsx(s.Icon,{name:"Image"})}),s.jsxRuntimeExports.jsxs("div",{className:Vn.subscriptionProductInfo,children:[s.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:s.jsxRuntimeExports.jsx("h2",{className:Vn.name,children:e.name})}),s.jsxRuntimeExports.jsxs("p",{className:Vn.price,children:[s.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsxRuntimeExports.jsx(s.Button$1,{type:"Special",onClick:a=>{a.preventDefault(),o(!0),i(!0)},children:"Cancel"})]}),r&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>o(!1),children:s.jsxRuntimeExports.jsx(fR,{accessToken:n,id:t,isOpen:r,setIsOpen:o})})]})},Nk="_content_5ctxw_1",wk="_selectedPlan_5ctxw_37",Lk="_planName_5ctxw_44",jk="_description_5ctxw_48",vk="_price_5ctxw_51",Pk="_buttonGroup_5ctxw_79",Dk="_buttonWrapper_5ctxw_84",Ok="_modal_5ctxw_88",Bk="_header_5ctxw_95",lt={content:Nk,selectedPlan:wk,planName:Lk,description:jk,price:vk,buttonGroup:Pk,buttonWrapper:Dk,modal:Ok,header:Bk},Mk=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=s.useModalStore(),o=()=>{i()},i=()=>{r(!1),setTimeout(()=>{e(!1)},300)},a=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,u=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=a-u,d=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return s.jsxRuntimeExports.jsxs("div",{className:lt.modal,children:[s.jsxRuntimeExports.jsxs("div",{className:lt.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Choose upgrade method"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:()=>i(),fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:lt.bottomSheet,children:[s.jsxRuntimeExports.jsxs("div",{className:lt.content,children:[s.jsxRuntimeExports.jsxs("div",{className:lt.selectedPlan,children:[s.jsxRuntimeExports.jsx("h2",{className:lt.planName,children:t.name}),s.jsxRuntimeExports.jsx("p",{className:lt.description,children:t.description}),s.jsxRuntimeExports.jsxs("p",{className:lt.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),s.jsxRuntimeExports.jsx(dr,{formatter:d,coupon:null,total:c,discount:u})]}),s.jsxRuntimeExports.jsxs("div",{className:lt.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:lt.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:()=>i(),children:"Stay with us"})}),s.jsxRuntimeExports.jsx("div",{className:lt.buttonWrapper,children:s.jsxRuntimeExports.jsxs(s.Button$1,{type:"Primary",onClick:o,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},Fk="_reviewMessage_1t8u4_1",Hk="_leaveReviewContainer_1t8u4_11",Uk="_leaveReviewTitle_1t8u4_20",Hs={reviewMessage:Fk,leaveReviewContainer:Hk,leaveReviewTitle:Uk},$k=({review:e,orderId:t,className:n})=>{const[r,o]=k.useState((e==null?void 0:e.rating)||0),[i,a]=k.useState(!1),{setIsOpen:u}=s.useModalStore(),{notifications:c,setNotifications:d}=s.useNotificationStore(),m=async h=>{e&&"accessToken"in e&&(await ac({comment:h,rating:r,tsId:s.getTsId()},t,e.accessToken),d([...c,{status:"success",id:s.v4(),message:"Review left successfully"}]),a(!1))};return k.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(u(!0),a(!0))},[r]),e?e.rating&&"accessToken"in e?s.jsxRuntimeExports.jsxs("div",{className:Hs.reviewMessage,children:["You left a ",e.rating," star rating"]}):s.jsxRuntimeExports.jsxs("div",{className:s.clx(Hs.leaveReviewContainer,n),children:[s.jsxRuntimeExports.jsx("p",{className:Hs.leaveReviewTitle,children:"Leave a review"}),s.jsxRuntimeExports.jsx(Ff,{rating:r,setRating:o,disabled:!!e.rating||!("accessToken"in e)}),i&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>a(!1),children:s.jsxRuntimeExports.jsx(Qk,{setIsOpen:a,onSubmit:m})})]}):null},zk="_bottomSheet_1bcyj_1",Wk="_content_1bcyj_7",qk="_title_1bcyj_18",Vk="_buttonGroup_1bcyj_22",Gk="_buttonWrapper_1bcyj_33",Yk="_modal_1bcyj_37",Xk="_header_1bcyj_44",Ht={bottomSheet:zk,content:Wk,title:qk,buttonGroup:Vk,buttonWrapper:Gk,modal:Yk,header:Xk},Qk=({setIsOpen:e,onSubmit:t})=>{const[n,r]=k.useState(""),{setIsOpen:o}=s.useModalStore(),i=()=>{o(!1),setTimeout(()=>{e(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:Ht.modal,onClick:a=>a.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:Ht.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:Ht.title,children:"Review Description"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",hoverable:!0,onClick:i,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:Ht.bottomSheet,children:[s.jsxRuntimeExports.jsx("div",{className:Ht.content,children:s.jsxRuntimeExports.jsx(s.Textarea$1,{placeholder:"Great product and fast checkout...",value:n,onChange:a=>r(a),label:"Describe your review in detail below"})}),s.jsxRuntimeExports.jsxs("div",{className:Ht.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:Ht.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:i,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:Ht.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",disabled:!n,onClick:()=>{i(),t(n)},children:"Submit"})})]})]})]})},Kk="_container_1idhv_1",Zk="_buttonGroup_1idhv_8",Jk="_buttonWrapper_1idhv_15",eR="_header_1idhv_19",tR="_content_1idhv_28",en={container:Kk,buttonGroup:Zk,buttonWrapper:Jk,header:eR,content:tR},nR=({setIsOpen:e})=>{const{subscription:t}=s.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:o}=s.useCart(),[i,a]=k.useState(1),u=s.useNavigate(),{setIsOpen:c}=s.useModalStore(),{setNotifications:d,notifications:m}=s.useNotificationStore(),[h,f]=k.useState(!1),p=k.useMemo(()=>n(),[o,r]),x=k.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(h)return s.jsxRuntimeExports.jsx(s.ProcessingPaymentModal,{});const g=(t==null?void 0:t.price.currency)||"USD",y=new Intl.NumberFormat("en-US",{style:"currency",currency:g});async function E(){var C;f(!0);try{const{data:P}=await s.extendSubscription((t==null?void 0:t.id)||"",{});d([{id:s.v4(),message:"Order created successfully",status:"success"}]),u(`/orders/${(C=P.data)==null?void 0:C.id}/${P.data.fullAccessToken}`)}catch(P){const L=P;d([...m,{id:s.v4(),message:`Order creation failed: ${L.message}`,status:"error"}]),R()}finally{f(!1)}}function R(){c(!1),setTimeout(()=>{e(!1)},300)}return s.jsxRuntimeExports.jsxs("div",{className:en.container,onClick:C=>C.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:en.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",className:en.title,children:"Extend Subscription"}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:R,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:en.content,children:[s.jsxRuntimeExports.jsx(Kf,{step:i,totalSteps:12,onStepChange:a,label:"How long would you like to extend your subscription for?"}),s.jsxRuntimeExports.jsx(dr,{formatter:y,coupon:o,total:p.total,discount:x,totalWithDiscount:p.totalWithDiscount}),s.jsxRuntimeExports.jsxs("div",{className:en.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:en.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:R,children:"Cancel"})}),s.jsxRuntimeExports.jsx("div",{className:en.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:E,children:"Extend"})})]})]})]})},rR="_bottomSheet_uw5jb_1",sR="_content_uw5jb_7",oR="_radioGroup_uw5jb_11",iR="_confirmation_uw5jb_26",aR="_iconWrapper_uw5jb_33",uR="_title_uw5jb_42",lR="_message_uw5jb_48",cR="_buttonGroup_uw5jb_54",dR="_buttonWrapper_uw5jb_64",hR="_modal_uw5jb_68",mR="_header_uw5jb_77",ve={bottomSheet:rR,content:sR,radioGroup:oR,confirmation:iR,iconWrapper:aR,title:uR,message:lR,buttonGroup:cR,buttonWrapper:dR,modal:hR,header:mR},pR={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},fR=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[o,i]=k.useState(0),[a,u]=k.useState(!1),[c,d]=k.useState(""),[m,h]=k.useState(""),{setIsOpen:f}=s.useModalStore(),p=async()=>{if(!c)return;u(!0);const g=await s.cancelSubscription(n,r,{reason:c==="Other reason"?m:c});u(!1),g&&i(2)};k.useEffect(()=>{e||(i(0),d(""),h(""))},[e]);const x=()=>{f(!1),setTimeout(()=>{t(!1)},300)};return s.jsxRuntimeExports.jsxs("div",{className:ve.modal,onClick:g=>g.stopPropagation(),children:[s.jsxRuntimeExports.jsxs("div",{className:ve.header,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:pR[o]||""}),s.jsxRuntimeExports.jsx(s.Icon,{name:"X",onClick:x,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxRuntimeExports.jsxs("div",{className:ve.content,children:[o===0&&s.jsxRuntimeExports.jsxs("div",{className:ve.bottomSheet,children:[s.jsxRuntimeExports.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),s.jsxRuntimeExports.jsxs("div",{className:ve.radioGroup,children:[s.jsxRuntimeExports.jsx(s.Radio,{defaultValue:c,onChange:g=>d(g),options:[{value:"Found another company",label:"Found another company"},{value:"Expensive",label:"Expensive"},{value:"Technical problems",label:"Technical problems"},{value:"Support problems",label:"Support problems"},{value:"Other reason",label:"Other reason"}],flexDirection:"column"}),c==="Other reason"&&s.jsxRuntimeExports.jsx(s.Textarea$1,{value:m,onChange:g=>h(g),placeholder:"Describe the reason..."})]}),s.jsxRuntimeExports.jsxs("div",{className:ve.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Stay with us"})}),s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:()=>c&&i(1),disabled:!c,children:"Continue"})})]})]}),o===1&&s.jsxRuntimeExports.jsxs("div",{className:ve.bottomSheet,children:[s.jsxRuntimeExports.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),s.jsxRuntimeExports.jsxs("div",{className:ve.buttonGroup,children:[s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Stay with us"})}),s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Primary",onClick:p,disabled:a,children:"Cancel it anyway"})})]})]}),o===2&&s.jsxRuntimeExports.jsxs("div",{className:ve.bottomSheet,children:[s.jsxRuntimeExports.jsxs("div",{className:`${ve.confirmation}`,children:[s.jsxRuntimeExports.jsx("div",{className:ve.iconWrapper,children:s.jsxRuntimeExports.jsx(s.Icon,{name:"Check",fill:"var(--text-success)"})}),s.jsxRuntimeExports.jsx("p",{className:ve.title,children:"Subscription Cancelled"}),s.jsxRuntimeExports.jsx("p",{className:ve.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),s.jsxRuntimeExports.jsx("div",{className:ve.buttonGroup,children:s.jsxRuntimeExports.jsx("div",{className:ve.buttonWrapper,children:s.jsxRuntimeExports.jsx(s.Button$1,{type:"Secondary",onClick:x,children:"Close"})})})]})]})]})},gR="_checkoutContainer_wkomn_1",xR="_loaderContainer_wkomn_20",Us={checkoutContainer:gR,loaderContainer:xR},Il=()=>{const{isAntistock:e}=s.useGeneralStore(),{cart:t,products:n,pending:r,getTotalAndDiscount:o,getPossibleGateways:i,submitCart:a,setGateway:u,applyCoupon:c,setDiscordSocialConnectId:d,setCustomFields:m,applyCouponPending:h,coupon:f,removeCoupon:p,getDiscordSettings:x,setPaymentMethod:g,reset:y}=s.useCart(),E=k.useMemo(()=>o(),[f,t]),R=s.useNavigate();return k.useEffect(()=>{if(t.parts.length===0)try{R(-1)}catch{R("/")}},[t.parts]),r?s.jsxRuntimeExports.jsx("div",{className:Us.checkoutContainer,children:s.jsxRuntimeExports.jsx("div",{className:Us.loaderContainer,children:s.jsxRuntimeExports.jsx(s.Loader,{})})}):s.jsxRuntimeExports.jsxs("div",{className:Us.checkoutContainer,children:[s.jsxRuntimeExports.jsx(NS,{cart:t,products:n,applyCoupon:c,applyCouponPending:h,coupon:f,removeCoupon:p,totalAndDiscount:E}),s.jsxRuntimeExports.jsx(p3,{cart:t,getPossibleGateways:i,setGateway:u,getDiscordSettings:x,products:n,submitCart:a,totalAndDiscount:E,setCustomFieldsToCart:m,setDiscordSocialConnectId:d,setPaymentMethod:g,reset:y,isAntistock:e})]})},ER="_chargePageContainer_1a200_1",bR="_chargeItems_1a200_14",IR="_mainContent_1a200_25",TR="_contentWrapper_1a200_36",_R="_statusBlock_1a200_41",CR="_notPaidSection_1a200_45",SR="_footer_1a200_53",yR="_loaderContainer_1a200_63",Ut={chargePageContainer:ER,chargeItems:bR,mainContent:IR,contentWrapper:TR,statusBlock:_R,notPaidSection:CR,footer:SR,loaderContainer:yR},kR=()=>{const{id:e}=s.useParams(),[t,n]=s.useSearchParams(),[r,o]=k.useState(!1),[i,a]=k.useState(),[u,c]=k.useState(!0),d=s.useNavigate(),m=k.useRef(),{setIsOpen:h}=s.useModalStore();return k.useEffect(()=>{const f=async(x,g=!1)=>{g||o(!0);const{data:y}=await uc(x);o(!1),a(y)},p=setInterval(()=>{e&&f(e,!0)},5e3);return e&&f(e),()=>{clearInterval(p)}},[]),k.useEffect(()=>{const f=setTimeout(()=>{console.log("charge timeout",i);const p=t.get("redirectRoute");(i==null?void 0:i.status)===s.ChargeStatus.Paid&&i.redirectUrl&&!m.current&&window.open(i.redirectUrl,"_self"),(i==null?void 0:i.status)===s.ChargeStatus.Paid&&m.current&&d(m.current,{replace:!0}),p&&m&&(m.current=p,t.delete("redirectRoute"),n(t))},1e3);return()=>clearTimeout(f)},[i]),k.useEffect(()=>{((i==null?void 0:i.gateway)==="PayPalFF"||(i==null?void 0:i.gateway)==="Сashapp")&&h(!0)},[i]),r?s.jsxRuntimeExports.jsx("div",{className:Ut.loaderContainer,children:s.jsxRuntimeExports.jsx(s.Loader,{})}):s.jsxRuntimeExports.jsxs("div",{className:Ut.chargePageContainer,children:[s.jsxRuntimeExports.jsx("div",{className:Ut.chargeItems,children:s.jsxRuntimeExports.jsx(Z3,{charge:i})}),s.jsxRuntimeExports.jsx("div",{className:Ut.mainContent,children:s.jsxRuntimeExports.jsxs("div",{className:Ut.contentWrapper,children:[i&&(i==null?void 0:i.status)!==s.ChargeStatus.NotPaid&&s.jsxRuntimeExports.jsx(s.ChargeStatusBlock,{charge:i}),i&&s.jsxRuntimeExports.jsx("div",{className:`${Ut.statusBlock}`,children:s.jsxRuntimeExports.jsx(bl,{lastUpdate:i.expiresAt,email:i.customerForCharge.email,invoiceId:i.id,paymentType:i.gateway})}),(i==null?void 0:i.status)===s.ChargeStatus.NotPaid&&s.jsxRuntimeExports.jsx("div",{className:Ut.notPaidSection,children:i==null?void 0:i.displayPaymentInfo.map((f,p)=>s.jsxRuntimeExports.jsx(El,{block:f},p))}),s.jsxRuntimeExports.jsx(vt,{className:Ut.footer})]})}),(i==null?void 0:i.gateway)==="PayPalFF"&&u&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>c(!1),children:s.jsxRuntimeExports.jsx(U3,{price:i.price,setIsOpen:c})}),(i==null?void 0:i.gateway)==="Сashapp"&&u&&s.jsxRuntimeExports.jsx(s.Modal,{close:()=>o(!1),children:s.jsxRuntimeExports.jsx(fy,{setIsOpen:c,chargeId:i.id})})]})};var Tl=(e=>(e.NEW="NEW",e.ANSWERED="ANSWERED",e.NOT_ANSWERED="NOT_ANSWERED",e.CLOSED="CLOSED",e))(Tl||{});const RR="_wrapper_esta4_1",AR="_ticketContainer_esta4_23",NR="_title_esta4_28",wR="_subtext_esta4_35",LR="_container_esta4_41",jR="_content_esta4_52",vR="_messages_esta4_63",PR="_input_esta4_81",DR="_textarea_esta4_94",OR="_message_esta4_63",BR="_messageDate_esta4_139",MR="_messageAntistock_esta4_145",FR="_myMessage_esta4_149",HR="_otherMessage_esta4_156",UR="_button_esta4_163",$R="_disabled_esta4_163",zR="_loadingMessage_esta4_189",Ne={wrapper:RR,ticketContainer:AR,title:NR,subtext:wR,container:LR,content:jR,messages:vR,input:PR,textarea:DR,message:OR,messageDate:BR,messageAntistock:MR,myMessage:FR,otherMessage:HR,button:UR,disabled:$R,loadingMessage:zR},WR=()=>{const e=window.location.pathname.split("/"),t=e[e.length-1],n=e[e.length-2],[r,o]=k.useState(!0),[i,a]=k.useState(null),[u,c]=k.useState(""),[d,m]=k.useState(null),{executeRecaptcha:h}=s.useReCaptcha(),{isAntistock:f}=s.useGeneralStore(),p=(i==null?void 0:i.status)===Tl.CLOSED,x=async()=>{if(n&&t){const{data:E}=await s.fetchTicket(n,t);a(E),o(!1)}};k.useEffect(()=>{x();const E=setInterval(()=>{x()},5e3);return()=>clearInterval(E)},[]);const g=async()=>{const E=await h();if(!n||!t||!E||!u.trim())return;const R={content:u,createdAt:new Date().toISOString(),id:Date.now(),isSellerReply:!1};a(C=>C?{...C,messages:[...C.messages,R]}:null),m(R.id),c("");try{await s.sendTicketMessage(n,t,u,E,s.getTsId()),await x()}finally{setTimeout(()=>{m(null)},1e4)}},y=E=>{const R=new Date,C=new Date(E),P=Math.floor((R.getTime()-C.getTime())/1e3);if(P<60)return"right now";if(P<3600){const L=Math.floor(P/60);return`${L} minute${L>1?"s":""} ago`}else if(P<10800){const L=Math.floor(P/3600);return`${L} hour${L>1?"s":""} ago`}else return C.getFullYear()===R.getFullYear()?C.toLocaleDateString("en-US",{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):C.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return s.jsxRuntimeExports.jsx("div",{className:Ne.wrapper,children:r&&!i?s.jsxRuntimeExports.jsx(s.Loader,{}):s.jsxRuntimeExports.jsxs("div",{className:Ne.container,children:[f?s.jsxRuntimeExports.jsxs("div",{className:Ne.ticketContainer,children:[s.jsxRuntimeExports.jsx("div",{className:Ne.title,children:i==null?void 0:i.title}),s.jsxRuntimeExports.jsx("div",{className:Ne.subtext,children:"We’re going to respond to your ticket shortly. You’ll receive updates in your email inbox. Feel free to close this page."})]}):s.jsxRuntimeExports.jsx("div",{className:Ne.title,children:`#${n} (${i==null?void 0:i.title})`}),s.jsxRuntimeExports.jsxs("div",{className:Ne.content,children:[s.jsxRuntimeExports.jsx("div",{className:Ne.messages,children:i==null?void 0:i.messages.sort((E,R)=>new Date(E.createdAt).getTime()-new Date(R.createdAt).getTime()).map(E=>s.jsxRuntimeExports.jsxs("div",{className:s.clx(Ne.message,{[Ne.messageAntistock]:f,[Ne.myMessage]:!E.isSellerReply,[Ne.otherMessage]:E.isSellerReply,[Ne.loadingMessage]:d===E.id}),children:[s.jsxRuntimeExports.jsx("div",{className:Ne.messageContent,children:s.splitTextIntoSpans(E.content,!1)}),d!==E.id&&s.jsxRuntimeExports.jsx("div",{className:Ne.messageDate,children:y(E.createdAt)}),d===E.id&&s.jsxRuntimeExports.jsx("div",{className:Ne.messageDate,children:s.jsxRuntimeExports.jsx(s.Loader,{})})]},E.id))}),s.jsxRuntimeExports.jsxs("div",{className:Ne.input,children:[s.jsxRuntimeExports.jsx("textarea",{disabled:p,className:Ne.textarea,value:u,placeholder:p?"The ticket has been closed. Need further assistance? Please submit a new request.":f?"Type a message...":"What worries you?",onChange:E=>c(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),g())}}),s.jsxRuntimeExports.jsx("div",{onClick:g,className:s.clx(Ne.button,{[Ne.disabled]:p}),children:s.jsxRuntimeExports.jsx(s.Icon,{name:"PaperPlaneRight"})})]})]})]})})},qR="_subscriptionContainer_1j6ol_1",VR="_leftSection_1j6ol_15",GR="_content_1j6ol_26",YR="_mainContent_1j6ol_33",XR="_detailsSection_1j6ol_37",QR="_buttonGroup_1j6ol_50",KR="_detailsContent_1j6ol_57",tn={subscriptionContainer:qR,leftSection:VR,content:GR,mainContent:YR,detailsSection:XR,buttonGroup:QR,detailsContent:KR},ZR=()=>{const{id:e,accessToken:t}=s.useParams(),{subscription:n,setSubscription:r}=s.useSubscriptionStore(),{setIsOpen:o}=s.useModalStore(),[i,a]=k.useState(!1),[u,c]=k.useState(!1);k.useLayoutEffect(()=>{r(null)},[e,t]);const{balanceSettings:d,setBalanceSettings:m}=s.useCustomerDashboardStore();return k.useEffect(()=>{e&&t&&(async()=>{if(!e||!t)return;c(!0);const{data:f}=await s.fetchSubscription(e,t);r({...f}),c(!1)})()},[e,t]),k.useEffect(()=>{d||(async()=>{const f=await s.getBalanceSettings();m(f)})()},[d]),u?s.jsxRuntimeExports.jsx(s.Loader,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:tn.subscriptionContainer,children:[s.jsxRuntimeExports.jsx("div",{className:tn.leftSection,children:s.jsxRuntimeExports.jsxs("div",{className:tn.content,children:[s.jsxRuntimeExports.jsx(cr,{}),s.jsxRuntimeExports.jsxs("div",{className:tn.mainContent,children:[n&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Your Subscription"}),s.jsxRuntimeExports.jsx(ky,{subscription:{price:n.price,name:n.productName,description:n.productDescription,status:n.status,image:n.productImage,recurringInterval:n.recurringInterval}}),s.jsxRuntimeExports.jsx("div",{className:tn.buttonGroup,children:n.pricingPlanExists&&s.jsxRuntimeExports.jsx(s.Button$1,{onClick:h=>{h.stopPropagation(),o(!0),a(!0)},style:{maxWidth:"500px",width:"100%"},children:"Change Plan"})})]}),s.jsxRuntimeExports.jsx(vt,{})]})]})}),s.jsxRuntimeExports.jsx("div",{className:tn.detailsSection,children:s.jsxRuntimeExports.jsxs("div",{className:tn.detailsContent,children:[s.jsxRuntimeExports.jsx("h3",{id:"h3",children:"Details"}),(n==null?void 0:n.coupon)&&s.jsxRuntimeExports.jsx(ik,{coupon:n.coupon,currency:n.price.currency||"USD"}),n&&s.jsxRuntimeExports.jsx(Ak,{id:e||"",accessToken:t||"",subscription:{price:n.price,name:n.productName,description:n.productDescription,status:n.status,image:n.productImage,recurringInterval:n.recurringInterval}}),n&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(Tk,{}),n.activeTo&&s.jsxRuntimeExports.jsx(Jy,{})]}),s.jsxRuntimeExports.jsx(vt,{className:"flex md:hidden"})]})})]}),s.jsxRuntimeExports.jsx(Yy,{isOpen:i,setIsOpen:a,subscription:n})]})},JR="_topUpContainer_1pag6_1",eA="_formWrapper_1pag6_15",tA="_header_1pag6_29",nA="_footer_1pag6_82",rA="_wrapper_1pag6_105",Gn={topUpContainer:JR,formWrapper:eA,header:tA,footer:nA,wrapper:rA},sA=()=>{const{gatewaysDetail:e,setGatewaysDetail:t,balanceSettings:n,setBalanceSettings:r}=s.useCustomerDashboardStore();return k.useEffect(()=>{!e&&n&&(async()=>{const i=await s.getGatewaysDetail(n!=null&&n.isEnabled?(n==null?void 0:n.topUpSettings.gateways)||[]:[]);t(i)})()},[e,n]),k.useEffect(()=>{n||(async()=>{const i=await s.getBalanceSettings();r(i)})()},[n]),s.jsxRuntimeExports.jsxs("div",{className:Gn.wrapper,children:[s.jsxRuntimeExports.jsx(cr,{className:Gn.header}),s.jsxRuntimeExports.jsx("div",{className:Gn.topUpContainer,children:n?s.jsxRuntimeExports.jsx("div",{className:Gn.formWrapper,children:s.jsxRuntimeExports.jsx(s.BalanceModal,{setIsOpen:()=>{},isModal:!1})}):s.jsxRuntimeExports.jsx(s.Loader,{})}),s.jsxRuntimeExports.jsx("div",{className:Gn.footer,children:s.jsxRuntimeExports.jsx(vt,{})})]})},oA="_orderPage_1nvve_1",iA="_leftSection_1nvve_15",aA="_content_1nvve_35",uA="_main_1nvve_42",lA="_statusBlock_1nvve_54",cA="_timelineBlock_1nvve_58",dA="_footer_1nvve_62",hA="_rightSection_1nvve_71",mA="_header_1nvve_84",pA="_productList_1nvve_92",fA="_mobileFooter_1nvve_99",gA="_loaderContainer_1nvve_108",xA="_orderMainData_1nvve_116",EA="_prices_1nvve_123",bA="_headerTitle_1nvve_127",IA="_headerDescription_1nvve_131",Oe={orderPage:oA,leftSection:iA,content:aA,main:uA,statusBlock:lA,timelineBlock:cA,footer:dA,rightSection:hA,header:mA,productList:pA,mobileFooter:fA,loaderContainer:gA,orderMainData:xA,prices:EA,headerTitle:bA,headerDescription:IA},TA=()=>{var h,f,p;const{id:e,accessToken:t}=s.useParams(),n=s.useNavigate(),[r,o]=k.useState(),[i,a]=k.useState(!1),u=s.useCopy(),c=((h=r==null?void 0:r.rawPrice)==null?void 0:h.currency)||"USD",d=new Intl.NumberFormat("en-US",{style:"currency",currency:c}),m=k.useMemo(()=>(r==null?void 0:r.partOrders.map(x=>{var g,y,E,R;return{id:(x==null?void 0:x.id)||0,image:x.productWithVariant.image,name:((g=x.productWithVariant)==null?void 0:g.name)||"",description:((y=x.productWithVariant)==null?void 0:y.description)||"",price:{quantity:x.quantity,amount:((E=x.productWithVariant)==null?void 0:E.price.amount)||0,currency:(R=x.productWithVariant)==null?void 0:R.price.currency},deliveryCategories:"deliveryCategories"in x?x.deliveryCategories:void 0,customerNote:x.customerNote,chargeType:x.chargeType||"ONE_TIME"}}))||[],[r]);return k.useLayoutEffect(()=>{if(e&&!t){const x=JSON.parse(localStorage.getItem("orders")||"{}");x[e]&&n(`/orders/${e}/${x[e].fullAccessToken}`)}},[e]),k.useEffect(()=>{const x=async(y,E=!1)=>{E||a(!0);const{data:R}=await(t?s.fetchAuthorizedOrder(`${y}/${t}`):s.fetchOrder(y));a(!1),R.charge.status===s.ChargeStatus.NotPaid&&n(`/charges/${R.charge.id}`,{replace:!0}),o(R)};e&&x(e);const g=setInterval(()=>{e&&x(e,!0)},5e3);return()=>{clearInterval(g)}},[]),i?s.jsxRuntimeExports.jsx("div",{className:Oe.loaderContainer,children:s.jsxRuntimeExports.jsx(s.Loader,{})}):s.jsxRuntimeExports.jsxs("div",{className:Oe.orderPage,children:[s.jsxRuntimeExports.jsx("div",{className:Oe.leftSection,children:s.jsxRuntimeExports.jsxs("div",{className:Oe.content,children:[s.jsxRuntimeExports.jsx(cr,{}),r&&s.jsxRuntimeExports.jsxs("div",{className:Oe.main,children:[s.jsxRuntimeExports.jsx(s.OrderStatusBlock,{className:Oe.statusBlock,orderStatus:r.status}),s.jsxRuntimeExports.jsxs("div",{className:Oe.orderMainData,children:[s.jsxRuntimeExports.jsx(bl,{lastUpdate:r.createdAt,paymentType:r.charge.gateway,email:r.charge.customerForCharge.email,invoiceId:r.charge.id}),"accessToken"in r.review&&s.jsxRuntimeExports.jsx($k,{orderId:r.id,review:r.review})]}),r.charge&&s.jsxRuntimeExports.jsx(s.TrackPayment,{className:Oe.timelineBlock,timeline:r.charge.timeline}),s.jsxRuntimeExports.jsx(vt,{className:Oe.footer})]})]})}),s.jsxRuntimeExports.jsx("div",{className:Oe.rightSection,children:s.jsxRuntimeExports.jsxs("div",{className:Oe.content,children:[(r==null?void 0:r.charge.name)&&s.jsxRuntimeExports.jsxs("header",{className:Oe.header,children:[s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("h1",{className:Oe.headerTitle,children:r.charge.name}),r.charge.description&&s.jsxRuntimeExports.jsx("p",{className:Oe.headerDescription,children:r.charge.description})]}),s.jsxRuntimeExports.jsxs(s.Button$1,{type:"Secondary",onClick:()=>u((r==null?void 0:r.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[s.jsxRuntimeExports.jsx(s.Icon,{name:"Copy"}),s.jsxRuntimeExports.jsx("span",{children:"Copy ID"})]})]}),s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:Oe.productList,children:m.map(x=>s.jsxRuntimeExports.jsx(jo,{product:x,isOrder:!0},x.id))}),s.jsxRuntimeExports.jsx(dr,{formatter:d,coupon:null,total:((f=r==null?void 0:r.charge)==null?void 0:f.price.amount)||0,discount:0,totalWithDiscount:((p=r==null?void 0:r.charge)==null?void 0:p.price.amount)||0,className:Oe.prices,isShowSubtotal:!1}),s.jsxRuntimeExports.jsx(vt,{className:Oe.mobileFooter})]})]})})]})},_A=e=>{const{notifications:t,setNotifications:n}=s.useNotificationStore.getState();n(t.filter(r=>r.id!==e))},CA=e=>{const{notifications:t,setNotifications:n}=s.useNotificationStore.getState(),r=s.v4();return n([...t,{id:r,...e}]),r},SA=e=>{const{blocks:t,settings:n,header:r,footer:o,announcement:i,routes:a=[],shopLogo:u,apiURLs:c,isAntistock:d=!1}=e,[m,h]=k.useState(null),{general:f,setIsAntistock:p}=s.useGeneralStore(),{setApiUrls:x}=s.useApiStore(),{setBlocks:g,setSourceBlocks:y,setHeader:E,setFooter:R,setAnnouncement:C,setSettings:P}=s.useBlocksStore(),{themeSettings:L}=s.useThemeSettingsStore(),{settings:A,setSettings:z}=s.useSettingsStore();console.log("window.location.hostname",window.location);const G=s.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"":window.location.hostname,K=localStorage.getItem("shopPassword"),N=localStorage.getItem("shopId")||"",H=localStorage.getItem("draftId")||"";return k.useEffect(()=>{p(d)},[d,p]),k.useEffect(()=>{N||localStorage.setItem("shopId",(f==null?void 0:f.info.id)||"15124f8d-2c8c-4dda-a04c-31c16816f9b6")},[f]),k.useEffect(()=>{H||localStorage.setItem("draftId","ca18cf24-6659-4015-b1ab-9ebe9fa64e74")},[H]),k.useEffect(()=>{G||localStorage.setItem("fakeDomain","drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io")},[G]),k.useEffect(()=>{if(L&&A){const D=mc(L,A);bc(L),pc(D)}},[L,JSON.stringify(A),window.location.hostname]),k.useEffect(()=>{const $=new n().blockSettings;z($)},[]),k.useLayoutEffect(()=>{const D={};Object.keys(t).map(Y=>{D[Y]=t[Y]}),y(D),g(D),E(r),R(o),C(i),P(n),c&&x(c);const $=s.createBrowserRouter([{element:s.jsxRuntimeExports.jsx(sf,{shopDomain:G,shopId:N,shopPassword:K||void 0,shopLogo:u,children:s.jsxRuntimeExports.jsx(s.ReCaptchaProvider,{children:s.jsxRuntimeExports.jsx(Jp,{children:s.jsxRuntimeExports.jsx(s.Outlet,{})})})}),errorElement:s.jsxRuntimeExports.jsx(ef,{}),children:[{path:"/admin/builder/*",element:s.jsxRuntimeExports.jsx(Up,{children:s.jsxRuntimeExports.jsx(Dp,{blocks:t,settings:n,header:r,footer:o,announcement:i})}),errorElement:s.jsxRuntimeExports.jsx(Hp,{})},...a,{path:"/checkout",element:s.jsxRuntimeExports.jsx(Il,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:s.jsxRuntimeExports.jsx(sA,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:s.jsxRuntimeExports.jsx(kR,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:s.jsxRuntimeExports.jsx(TA,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:s.jsxRuntimeExports.jsx(ZR,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Subscriptions",!0)},{path:"/customer-dash",element:s.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:[s.jsxRuntimeExports.jsx(s.RenderAnnouncement,{}),s.jsxRuntimeExports.jsx(s.RenderHeader,{}),s.jsxRuntimeExports.jsx("div",{style:{flex:"1 1 auto"},children:s.jsxRuntimeExports.jsx(s.CustomerDashboard,{})}),s.jsxRuntimeExports.jsx(s.RenderFooter,{})]}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Customer Dashboard",!0)},{path:"/validation",element:s.jsxRuntimeExports.jsx(Qp,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:s.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:[s.jsxRuntimeExports.jsx(s.RenderHeader,{}),s.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:s.jsxRuntimeExports.jsx(s.ReCaptchaProvider,{children:s.jsxRuntimeExports.jsx(WR,{})})}),s.jsxRuntimeExports.jsx(s.RenderFooter,{})]}),errorElement:s.jsxRuntimeExports.jsx(Nt,{}),loader:()=>(document.title="Ticket",!0)},{path:"*",element:s.jsxRuntimeExports.jsx(hc,{}),errorElement:s.jsxRuntimeExports.jsx(Nt,{})}]}]);h($)},[f]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:m&&s.jsxRuntimeExports.jsx(s.RouterProvider,{router:m})})};exports.ReCaptchaProvider=s.ReCaptchaProvider;exports.aspectRatioOptions=s.aspectRatioOptions;exports.formatPrice=s.formatPrice;exports.splitTextIntoSpans=s.splitTextIntoSpans;exports.useAdaptiveStyles=s.useAdaptiveStyles;exports.useCart=s.useCart;exports.useReCaptcha=s.useReCaptcha;exports.App=SA;exports.Checkout=Il;exports.ColorVariables=la;exports.hotReload=Ic;exports.iconNames=Cl;exports.removeNotification=_A;exports.showNotification=CA;exports.useBuilderPages=_c;exports.useCreateTicket=Tc;
|