@billgangcom/theme-lib 1.116.1 → 1.116.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{builder-DqDtctC5.cjs → builder-C7KDCjPK.cjs} +10 -10
  2. package/dist/{builder-components-DzvQc6D4.js → builder-components-C8GR-K0b.js} +4 -4
  3. package/dist/{builder-components-D3Bb10J8.cjs → builder-components-DTCH52Zj.cjs} +1 -1
  4. package/dist/{builder-DUFJOYbB.js → builder-q7_i-usP.js} +15 -9
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +22 -22
  7. package/dist/{charge-I1l9O9oW.cjs → charge-CjJu8ZCC.cjs} +2 -2
  8. package/dist/{charge-JAW-QeMZ.js → charge-D5cvaKFj.js} +8 -7
  9. package/dist/{checkout-BvcF30gE.js → checkout-CsTsjmHG.js} +5 -5
  10. package/dist/{checkout-CwhyZ4zD.cjs → checkout-Dbu7YMSx.cjs} +1 -1
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-Bfh9GkFs.cjs → index-2oIkoScp.cjs} +1 -1
  14. package/dist/{index-Cdm3FwGu.cjs → index-B-z0PneZ.cjs} +1 -1
  15. package/dist/{index-DjnhbFh9.cjs → index-B1UP_MbR.cjs} +1 -1
  16. package/dist/{index-CyaRCiT9.js → index-BLeoCjpE.js} +5 -5
  17. package/dist/{index-bsPNagUY.js → index-BbZMD5la.js} +5 -5
  18. package/dist/{index-DcWpxbHI.js → index-C9TT9z5B.js} +5 -5
  19. package/dist/{index-EjVO3qce.js → index-DU5z0tPJ.js} +5 -5
  20. package/dist/{index-dp4B_uob.cjs → index-DXroLqaD.cjs} +1 -1
  21. package/dist/{index-BGpMbUmG.js → index-d8l00Hpw.js} +1 -1
  22. package/dist/{index-BsM2kPyQ.cjs → index-r9HLobSy.cjs} +1 -1
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.es.js +6 -6
  25. package/dist/{order-BLPHbRzn.js → order-Cveqw4gC.js} +5 -5
  26. package/dist/{order-DN9oIA9o.cjs → order-d9OX_gLP.cjs} +1 -1
  27. package/dist/src/abstractions/PageContext.d.ts +15 -0
  28. package/dist/src/abstractions/Variable.d.ts +1 -0
  29. package/dist/src/builder/api/fetchData.d.ts +3 -0
  30. package/dist/{subscription-r7qA65EX.cjs → subscription-BvsNAnoC.cjs} +1 -1
  31. package/dist/{subscription-D0TYbXFf.js → subscription-Bz6FRE3J.js} +5 -5
  32. package/dist/{ticket-BivnxhDp.cjs → ticket-B90nYD05.cjs} +1 -1
  33. package/dist/{ticket--uOANXoZ.js → ticket-DU1t1M0h.js} +9 -7
  34. package/dist/{top-up-u1oUf64a.js → top-up-2OMBI611.js} +5 -5
  35. package/dist/{top-up-C13wralR.cjs → top-up-CFc0wZAg.cjs} +1 -1
  36. package/dist/{ui-components-CC9DRvrZ.cjs → ui-components-B79-9qoP.cjs} +1 -1
  37. package/dist/{ui-components-CqwUR9GH.js → ui-components-BxH-lR8m.js} +4 -4
  38. package/dist/ui.cjs.js +1 -1
  39. package/dist/ui.es.js +1 -1
  40. package/dist/{validation-BtrRWzoi.cjs → validation-Crn-70HH.cjs} +1 -1
  41. package/dist/{validation-ekksqWOd.js → validation-DpREFoxz.js} +5 -5
  42. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";const b=require("./builder-DqDtctC5.cjs"),i=require("react/jsx-runtime"),D=require("react"),v=require("./ui-components-CC9DRvrZ.cjs"),Gc=require("./builder-components-D3Bb10J8.cjs"),Xc=require("./ticket-BivnxhDp.cjs");require("react-dom");const Kc=require("./order-DN9oIA9o.cjs"),Yd=require("./subscription-r7qA65EX.cjs");function Gd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const fe=Gd(D),Xd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Qc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=D.useState(!1);return D.useEffect(()=>{typeof window<"u"&&a(Xd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function Kd(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const Qd=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},Jd=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},e2=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},kr=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},t2=()=>kr("dash/info"),n2=()=>kr("dash/dashboard/home"),r2=()=>kr("rewards"),u2=()=>kr("balance"),a2=()=>kr("balance/top-up/settings"),s2=()=>kr("referral-system"),Zs=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},i2=()=>Zs("terms"),o2=()=>Zs("refund-policy"),c2=()=>Zs("privacy-policy"),bs=10,ra=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${bs}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},ua=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},l2=e=>ua("","post",e),d2=({PageNumber:e})=>ra({url:"customers/orders",PageNumber:e}),f2=e=>ua(e),h2=e=>ua(e),p2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},Jc=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},m2=(e,t,n)=>ua(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),g2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},b2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},_2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},x2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},E2=({PageNumber:e})=>ra({url:"customers/subscriptions",PageNumber:e}),T2=async({id:e,accessToken:t})=>await _2(e,t),y2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},k2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},A2=async(e,t,n,r,u)=>{const a=b.useApiStore.getState().apiUrls,s=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await b.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},S2=({PageNumber:e})=>ra({url:"customers/tickets",PageNumber:e}),I2=({PageNumber:e})=>ra({url:"customers/balance/transactions",PageNumber:e}),v2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},N2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},w2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},Eu=new Map,el=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(Eu.has(o))return Eu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw Eu.delete(o),l});return Eu.set(o,c),c},tl=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},nl=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},_s=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},D2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:nl,logoutCustomer:_s,requestOtp:tl},Symbol.toStringTag,{value:"Module"})),L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},P2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},R2=async()=>{const{data:e}=await s2();return e},O2=async e=>{const{data:t}=await P2(e);return t},M2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},F2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function B2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const j2=async(e,t,n,r)=>{const a=`${b.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},La="Balance",Pn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},H2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Hi=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},U2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},V2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=U2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},$2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Ui=e=>new Set(e.gateways.map(t=>t.name)),Pa={availableGateways:[],requiresSignInGateways:[]},Vi=(e,t)=>{if(t.length===0)return Pa;const n=e[0];if(!n)return Pa;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Pa;const a=Ui(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Ui(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(La)?(a.delete(La),{availableGateways:[...a],requiresSignInGateways:[La]}):{availableGateways:[...a],requiresSignInGateways:[]}},$i=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},z2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},ou=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var F;h(!0);const{cart:C}=b.useCartStore.getState(),{gateway:_,parts:N}=C,{notifications:y,setNotifications:L}=b.useNotificationStore.getState();_||(h(!1),L([...y,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const S=N.map(W=>W.productId);let I=null;try{const{data:W}=await L2({gateway:_,couponName:x,productIds:S});I=W.data,L([...y,{message:"Coupon is applied",status:"success",id:b.v4()}]),s(V=>({...V,coupon:x}))}catch(W){const V=W;L([...y,{message:`Coupon is not applied: ${V.message}`,status:"error",id:b.v4()}]),s(P=>({...P,coupon:null})),c(null),h(!1)}if(h(!1),(F=I==null?void 0:I.restrictToProductIds)!=null&&F.length&&!S.every(W=>{var V;return(V=I==null?void 0:I.restrictToProductIds)==null?void 0:V.includes(W)}))throw new Error("Coupon can't be applied to such products");return c(I),I},g={reset(){s({...H2})},addProducts:x=>{const C=b.useCartStore.getState().products,_=x.filter(N=>!C.some(y=>y.id===N.id));o([...C,..._])},addProductToCart:x=>{const C=b.useCartStore.getState().cart;try{Hi(t,x)}catch(N){throw new Error(N)}const _=C.parts.find(N=>N.productId===x.productId&&N.productVariantId===x.productVariantId&&N.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(C.parts.length&&Vi([...C.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...C,parts:[...C.parts,x]}),C.coupon&&f(C.coupon)},removeProduct({productId:x,productVariantId:C}){s(_=>({..._,parts:_.parts.filter(N=>N.productId!==x||N.productVariantId!==C)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Vi(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return $2(t,e.parts)},updateQuantityOfProduct(x){Hi(t,x),s(C=>({...C,parts:C.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:C,totalWithVolumeDiscounts:_}=V2(e.parts,t);let N;const y=_;return x&&x.discount?!x.isFixed&&x.discount===100?N=0:N=x.isFixed?Math.max(0,y-x.discount):y*(1-x.discount/100):_!==C&&(N=_),{total:C,totalWithVolumeDiscounts:_!==C?_:void 0,totalWithDiscount:N}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:C}=b.useGeneralStore.getState();e.coupon&&!C&&f(e.coupon)},setPaymentMethod(x){s(C=>({...C,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:C}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let N;if(C.parts&&a&&z2(C.parts[0],t))try{const{data:y}=await g2({gateway:C.gateway,coupon:C.coupon,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId()});N=y.data}catch(y){console.error(y)}else try{const{data:y}=await l2({gateway:C.gateway,parts:[...C.parts],coupon:C.coupon,customerEmail:C.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:C.usePriorityReplacement===!0});N=y.data}catch(y){const L=y,{notifications:S,setNotifications:I}=b.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${L.message}`,status:"error",id:b.v4()}])}if(l(!1),N)return N;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(C=>({...C,discordSocialConnectId:x}))},setCustomFields(x){s(C=>({...C,customFields:{...x}}))}};return D.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},tr=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var xs={exports:{}},Tu={exports:{}},Be={};/** @license React v16.13.1
1
+ "use strict";const b=require("./builder-C7KDCjPK.cjs"),i=require("react/jsx-runtime"),D=require("react"),v=require("./ui-components-B79-9qoP.cjs"),Gc=require("./builder-components-DTCH52Zj.cjs"),Xc=require("./ticket-B90nYD05.cjs");require("react-dom");const Kc=require("./order-d9OX_gLP.cjs"),Yd=require("./subscription-BvsNAnoC.cjs");function Gd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const fe=Gd(D),Xd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Qc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=D.useState(!1);return D.useEffect(()=>{typeof window<"u"&&a(Xd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function Kd(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const Qd=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},Jd=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},e2=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},kr=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},t2=()=>kr("dash/info"),n2=()=>kr("dash/dashboard/home"),r2=()=>kr("rewards"),u2=()=>kr("balance"),a2=()=>kr("balance/top-up/settings"),s2=()=>kr("referral-system"),Zs=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},i2=()=>Zs("terms"),o2=()=>Zs("refund-policy"),c2=()=>Zs("privacy-policy"),bs=10,ra=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${bs}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},ua=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},l2=e=>ua("","post",e),d2=({PageNumber:e})=>ra({url:"customers/orders",PageNumber:e}),f2=e=>ua(e),h2=e=>ua(e),p2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},Jc=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},m2=(e,t,n)=>ua(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),g2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},b2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},_2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},x2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},E2=({PageNumber:e})=>ra({url:"customers/subscriptions",PageNumber:e}),T2=async({id:e,accessToken:t})=>await _2(e,t),y2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},k2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},A2=async(e,t,n,r,u)=>{const a=b.useApiStore.getState().apiUrls,s=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await b.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},S2=({PageNumber:e})=>ra({url:"customers/tickets",PageNumber:e}),I2=({PageNumber:e})=>ra({url:"customers/balance/transactions",PageNumber:e}),v2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},N2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},w2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},Eu=new Map,el=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(Eu.has(o))return Eu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw Eu.delete(o),l});return Eu.set(o,c),c},tl=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},nl=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},_s=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},D2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:nl,logoutCustomer:_s,requestOtp:tl},Symbol.toStringTag,{value:"Module"})),L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},P2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},R2=async()=>{const{data:e}=await s2();return e},O2=async e=>{const{data:t}=await P2(e);return t},M2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},F2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function B2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const j2=async(e,t,n,r)=>{const a=`${b.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},La="Balance",Pn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},H2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Hi=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},U2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},V2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=U2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},$2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Ui=e=>new Set(e.gateways.map(t=>t.name)),Pa={availableGateways:[],requiresSignInGateways:[]},Vi=(e,t)=>{if(t.length===0)return Pa;const n=e[0];if(!n)return Pa;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Pa;const a=Ui(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Ui(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(La)?(a.delete(La),{availableGateways:[...a],requiresSignInGateways:[La]}):{availableGateways:[...a],requiresSignInGateways:[]}},$i=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},z2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},ou=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var F;h(!0);const{cart:C}=b.useCartStore.getState(),{gateway:_,parts:N}=C,{notifications:y,setNotifications:L}=b.useNotificationStore.getState();_||(h(!1),L([...y,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const S=N.map(W=>W.productId);let I=null;try{const{data:W}=await L2({gateway:_,couponName:x,productIds:S});I=W.data,L([...y,{message:"Coupon is applied",status:"success",id:b.v4()}]),s(V=>({...V,coupon:x}))}catch(W){const V=W;L([...y,{message:`Coupon is not applied: ${V.message}`,status:"error",id:b.v4()}]),s(P=>({...P,coupon:null})),c(null),h(!1)}if(h(!1),(F=I==null?void 0:I.restrictToProductIds)!=null&&F.length&&!S.every(W=>{var V;return(V=I==null?void 0:I.restrictToProductIds)==null?void 0:V.includes(W)}))throw new Error("Coupon can't be applied to such products");return c(I),I},g={reset(){s({...H2})},addProducts:x=>{const C=b.useCartStore.getState().products,_=x.filter(N=>!C.some(y=>y.id===N.id));o([...C,..._])},addProductToCart:x=>{const C=b.useCartStore.getState().cart;try{Hi(t,x)}catch(N){throw new Error(N)}const _=C.parts.find(N=>N.productId===x.productId&&N.productVariantId===x.productVariantId&&N.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(C.parts.length&&Vi([...C.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...C,parts:[...C.parts,x]}),C.coupon&&f(C.coupon)},removeProduct({productId:x,productVariantId:C}){s(_=>({..._,parts:_.parts.filter(N=>N.productId!==x||N.productVariantId!==C)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Vi(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return $2(t,e.parts)},updateQuantityOfProduct(x){Hi(t,x),s(C=>({...C,parts:C.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:C,totalWithVolumeDiscounts:_}=V2(e.parts,t);let N;const y=_;return x&&x.discount?!x.isFixed&&x.discount===100?N=0:N=x.isFixed?Math.max(0,y-x.discount):y*(1-x.discount/100):_!==C&&(N=_),{total:C,totalWithVolumeDiscounts:_!==C?_:void 0,totalWithDiscount:N}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:C}=b.useGeneralStore.getState();e.coupon&&!C&&f(e.coupon)},setPaymentMethod(x){s(C=>({...C,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:C}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let N;if(C.parts&&a&&z2(C.parts[0],t))try{const{data:y}=await g2({gateway:C.gateway,coupon:C.coupon,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId()});N=y.data}catch(y){console.error(y)}else try{const{data:y}=await l2({gateway:C.gateway,parts:[...C.parts],coupon:C.coupon,customerEmail:C.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:C.usePriorityReplacement===!0});N=y.data}catch(y){const L=y,{notifications:S,setNotifications:I}=b.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${L.message}`,status:"error",id:b.v4()}])}if(l(!1),N)return N;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(C=>({...C,discordSocialConnectId:x}))},setCustomFields(x){s(C=>({...C,customFields:{...x}}))}};return D.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},tr=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var xs={exports:{}},Tu={exports:{}},Be={};/** @license React v16.13.1
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -106,4 +106,4 @@ and limitations under the License.
106
106
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:c,tableRow:o}};function s(p,g,x,C){return l(h(p,x,C),p.align)}function o(p,g,x,C){const _=f(p,x,C),N=l([_]);return N.slice(0,N.indexOf(`
107
107
  `))}function c(p,g,x,C){const _=x.enter("tableCell"),N=x.enter("phrasing"),y=x.containerPhrasing(p,{...C,before:a,after:a});return N(),_(),y}function l(p,g){return sT(p,{align:g,alignDelimiters:r,padding:n,stringLength:u})}function h(p,g,x){const C=p.children;let _=-1;const N=[],y=g.enter("table");for(;++_<C.length;)N[_]=f(C[_],g,x);return y(),N}function f(p,g,x){const C=p.children;let _=-1;const N=[],y=g.enter("tableRow");for(;++_<C.length;)N[_]=c(C[_],p,g,x);return y(),N}function m(p,g,x){let C=E1.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function WT(){return{exit:{taskListCheckValueChecked:Sc,taskListCheckValueUnchecked:Sc,paragraph:GT}}}function YT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:XT}}}function Sc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function GT(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 u=t.children;let a=-1,s;for(;++a<u.length;){const o=u[a];if(o.type==="paragraph"){s=o;break}}s===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 XT(e,t,n,r){const u=e.children[0],a=typeof e.checked=="boolean"&&u&&u.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let c=E1.listItem(e,t,n,{...r,...o.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(h){return h+s}}function KT(){return[NE(),XE(),eT(),HT(),WT()]}function QT(e){return{extensions:[wE(),KE(e),tT(),ZT(e),YT()]}}const JT={tokenize:ay,partial:!0},T1={tokenize:sy,partial:!0},y1={tokenize:iy,partial:!0},k1={tokenize:oy,partial:!0},ey={tokenize:cy,partial:!0},A1={name:"wwwAutolink",tokenize:ry,previous:I1},S1={name:"protocolAutolink",tokenize:uy,previous:v1},kn={name:"emailAutolink",tokenize:ny,previous:N1},mn={};function ty(){return{text:mn}}let Wn=48;for(;Wn<123;)mn[Wn]=kn,Wn++,Wn===58?Wn=65:Wn===91&&(Wn=97);mn[43]=kn;mn[45]=kn;mn[46]=kn;mn[95]=kn;mn[72]=[kn,S1];mn[104]=[kn,S1];mn[87]=[kn,A1];mn[119]=[kn,A1];function ny(e,t,n){const r=this;let u,a;return s;function s(f){return!Bs(f)||!N1.call(r,r.previous)||Ii(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Bs(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(ey,h,l)(f):f===45||f===95||mt(f)?(a=!0,e.consume(f),c):h(f)}function l(f){return e.consume(f),u=!0,c}function h(f){return a&&u&&Tt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function ry(e,t,n){const r=this;return u;function u(s){return s!==87&&s!==119||!I1.call(r,r.previous)||Ii(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(JT,e.attempt(T1,e.attempt(y1,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function uy(e,t,n){const r=this;let u="",a=!1;return s;function s(f){return(f===72||f===104)&&v1.call(r,r.previous)&&!Ii(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Tt(f)&&u.length<5)return u+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const m=u.toLowerCase();if(m==="http"||m==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?l:(a=!0,c)):n(f)}function l(f){return f===null||Xu(f)||$e(f)||er(f)||Ea(f)?n(f):e.attempt(T1,e.attempt(y1,h),n)(f)}function h(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function ay(e,t,n){let r=0;return u;function u(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),u):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function sy(e,t,n){let r,u,a;return s;function s(l){return l===46||l===95?e.check(k1,c,o)(l):l===null||$e(l)||er(l)||l!==45&&Ea(l)?c(l):(a=!0,e.consume(l),s)}function o(l){return l===95?r=!0:(u=r,r=void 0),e.consume(l),s}function c(l){return u||r||!a?n(l):t(l)}}function iy(e,t){let n=0,r=0;return u;function u(s){return s===40?(n++,e.consume(s),u):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(k1,t,a)(s):s===null||$e(s)||er(s)?t(s):(e.consume(s),u)}function a(s){return s===41&&r++,e.consume(s),u}}function oy(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),u):o===60||o===null||$e(o)||er(o)?t(o):n(o)}function u(o){return o===null||o===40||o===91||$e(o)||er(o)?t(o):r(o)}function a(o){return Tt(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):Tt(o)?(e.consume(o),s):n(o)}}function cy(e,t,n){return r;function r(a){return e.consume(a),u}function u(a){return mt(a)?n(a):t(a)}}function I1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$e(e)}function v1(e){return!Tt(e)}function N1(e){return!(e===47||Bs(e))}function Bs(e){return e===43||e===45||e===46||e===95||mt(e)}function Ii(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 ly={tokenize:_y,partial:!0};function dy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:my,continuation:{tokenize:gy},exit:by}},text:{91:{name:"gfmFootnoteCall",tokenize:py},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:fy,resolveTo:hy}}}}function fy(e,t,n){const r=this;let u=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;u--;){const c=r.events[u][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!s||!s._balanced)return n(c);const l=Jt(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function hy(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)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",u,t],["exit",u,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function py(e,t,n){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||$e(f))return n(f);if(f===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return u.includes(Jt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return $e(f)||(s=!0),a++,e.consume(f),f===92?h:l}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,l):l(f)}}function my(e,t,n){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(g)}function h(g){if(s>999||g===93&&!o||g===null||g===91||$e(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=Jt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return $e(g)||(o=!0),s++,e.consume(g),g===92?f:h}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,h):h(g)}function m(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u.includes(a)||u.push(a),Le(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function gy(e,t,n){return e.check(gu,t,e.attempt(ly,t,n))}function by(e){e.exit("gfmFootnoteDefinition")}function _y(e,t,n){const r=this;return Le(e,u,"gfmFootnoteDefinitionIndent",5);function u(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function xy(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:u};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(s,o){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let l=c;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[c][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[c][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[c][1].start)},m=[["enter",h,o],["enter",s[l][1],o],["exit",s[l][1],o],["enter",f,o]],p=o.parser.constructs.insideSpan.null;p&&Ht(m,m.length,0,Ta(p,s.slice(l+1,c),o)),Ht(m,m.length,0,[["exit",f,o],["enter",s[c][1],o],["exit",s[c][1],o],["exit",h,o]]),Ht(s,l-1,c-l+3,m),c=l+m.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function a(s,o,c){const l=this.previous,h=this.events;let f=0;return m;function m(g){return l===126&&h[h.length-1][1].type!=="characterEscape"?c(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=Er(l);if(g===126)return f>1?c(g):(s.consume(g),f++,p);if(f<2&&!n)return c(g);const C=s.exit("strikethroughSequenceTemporary"),_=Er(g);return C._open=!_||_===2&&!!x,C._close=!x||x===2&&!!_,o(g)}}}class Cy{constructor(){this.map=[]}add(t,n,r){Ey(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[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 u=r.pop();for(;u;){for(const a of u)t.push(a);u=r.pop()}this.map.length=0}}function Ey(e,t,n,r){let u=0;if(!(n===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===t){e.map[u][1]+=n,e.map[u][2].push(...r);return}u+=1}e.map.push([t,n,r])}}function Ty(e,t){let n=!1;const r=[];for(;t<e.length;){const u=e[t];if(n){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function yy(){return{flow:{null:{name:"table",tokenize:ky,resolveAll:Ay}}}}function ky(e,t,n){const r=this;let u=0,a=0,s;return o;function o(P){let j=r.events.length-1;for(;j>-1;){const ce=r.events[j][1].type;if(ce==="lineEnding"||ce==="linePrefix")j--;else break}const M=j>-1?r.events[j][1].type:null,J=M==="tableHead"||M==="tableRow"?I:c;return J===I&&r.parser.lazy[r.now().line]?n(P):J(P)}function c(P){return e.enter("tableHead"),e.enter("tableRow"),l(P)}function l(P){return P===124||(s=!0,a+=1),h(P)}function h(P){return P===null?n(P):le(P)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),p):n(P):Ne(P)?Le(e,h,"whitespace")(P):(a+=1,s&&(s=!1,u+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),s=!0,h):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||$e(P)?(e.exit("data"),h(P)):(e.consume(P),P===92?m:f)}function m(P){return P===92||P===124?(e.consume(P),f):f(P)}function p(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),s=!1,Ne(P)?Le(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):g(P))}function g(P){return P===45||P===58?C(P):P===124?(s=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),x):S(P)}function x(P){return Ne(P)?Le(e,C,"whitespace")(P):C(P)}function C(P){return P===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),_):P===45?(a+=1,_(P)):P===null||le(P)?L(P):S(P)}function _(P){return P===45?(e.enter("tableDelimiterFiller"),N(P)):S(P)}function N(P){return P===45?(e.consume(P),N):P===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(P))}function y(P){return Ne(P)?Le(e,L,"whitespace")(P):L(P)}function L(P){return P===124?g(P):P===null||le(P)?!s||u!==a?S(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):S(P)}function S(P){return n(P)}function I(P){return e.enter("tableRow"),F(P)}function F(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),F):P===null||le(P)?(e.exit("tableRow"),t(P)):Ne(P)?Le(e,F,"whitespace")(P):(e.enter("data"),W(P))}function W(P){return P===null||P===124||$e(P)?(e.exit("data"),F(P)):(e.consume(P),P===92?V:W)}function V(P){return P===92||P===124?(e.consume(P),W):W(P)}}function Ay(e,t){let n=-1,r=!0,u=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,c=0,l,h,f;const m=new Cy;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(Ic(m,t,c,l,h),h=void 0,c=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",l,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",h,t]])),u=g.type==="tableDelimiterRow"?2:h?3:1):u&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=Fu(m,t,a,u,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=Fu(m,t,a,u,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(s[0]=s[1],f=Fu(m,t,a,u,n,f)):s[1]!==0&&(f=Fu(m,t,s,u,n,f)),u=0):u&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&Ic(m,t,c,l,h),m.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Ty(t.events,n))}return e}function Fu(e,t,n,r,u,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},fr(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=fr(t.events,n[1]);if(a={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const l=fr(t.events,n[2]),h=fr(t.events,n[3]),f={type:o,start:Object.assign({},l),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;e.add(g,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return u!==void 0&&(a.end=Object.assign({},fr(t.events,u)),e.add(u,0,[["exit",a,t]]),a=void 0),a}function Ic(e,t,n,r,u){const a=[],s=fr(t.events,n);u&&(u.end=Object.assign({},s),a.push(["exit",u,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function fr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Sy={name:"tasklistCheck",tokenize:vy};function Iy(){return{text:{91:Sy}}}function vy(e,t,n){const r=this;return u;function u(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return $e(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return le(c)?t(c):Ne(c)?e.check({tokenize:Ny},t,n)(c):n(c)}}function Ny(e,t,n){return Le(e,r,"whitespace");function r(u){return u===null?n(u):t(u)}}function wy(e){return B0([ty(),dy(),xy(e),yy(),Iy()])}const Dy={};function w1(e){const t=this,n=e||Dy,r=t.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(wy(n)),a.push(KT()),s.push(QT(n))}const vc=/[#.]/g;function Ly(e,t){const n=e||"",r={};let u=0,a,s;for(;u<n.length;){vc.lastIndex=u;const o=vc.exec(n),c=n.slice(u,o?o.index:n.length);c&&(a?a==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:s=c,u+=c.length),o&&(a=o[0],u++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function D1(e,t,n){const r=n?My(n):void 0;function u(a,s,...o){let c;if(a==null){c={type:"root",children:[]};const l=s;o.unshift(l)}else{c=Ly(a,t);const l=c.tagName.toLowerCase(),h=r?r.get(l):void 0;if(c.tagName=h||l,Py(s))o.unshift(s);else for(const[f,m]of Object.entries(s))Ry(e,c.properties,f,m)}for(const l of o)js(c.children,l);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return u}function Py(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const u=t[r];if(u&&typeof u=="object"){if(!Array.isArray(u))return!0;const a=u;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Ry(e,t,n,r){const u=fi(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?u.spaceSeparated?a=Oo(r):u.commaSeparated?a=wo(r):u.commaOrSpaceSeparated?a=Oo(wo(r).join(" ")):a=Nc(u,u.property,r):Array.isArray(r)?a=[...r]:a=u.property==="style"?Oy(r):String(r);if(Array.isArray(a)){const s=[];for(const o of a)s.push(Nc(u,u.property,o));a=s}u.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[u.property]=a}}function js(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)js(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?js(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Nc(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||uu(n)===uu(t)))return!0}return n}function Oy(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function My(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Fy=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],By=D1(xa,"div"),jy=D1(vr,"g",Fy);function Hy(e){const t=String(e),n=[];return{toOffset:u,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let o=n[s];if(o===void 0){const c=wc(t,n[s-1]);o=c===-1?t.length+1:c+1,n[s]=o}if(o>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function u(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const o=n[n.length-1],c=wc(t,o),l=c===-1?t.length+1:c+1;if(o===l)break;n.push(l)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function wc(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
108
108
  `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Qn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},L1={}.hasOwnProperty,Uy=Object.prototype;function Vy(e,t){const n=t||{};return vi({file:n.file||void 0,location:!1,schema:n.space==="svg"?vr:xa,verbose:n.verbose||!1},e)}function vi(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},zu(e,r,n),n}case"#document":case"#document-fragment":{const r=t,u="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:P1(e,t.childNodes),data:{quirksMode:u}},e.file&&e.location){const a=String(e.file),s=Hy(a),o=s.toPoint(0),c=s.toPoint(a.length);n.position={start:o,end:c}}return n}case"#documentType":{const r=t;return n={type:"doctype"},zu(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},zu(e,r,n),n}default:return n=$y(e,t),n}}function P1(e,t){let n=-1;const r=[];for(;++n<t.length;){const u=vi(e,t[n]);r.push(u)}return r}function $y(e,t){const n=e.schema;e.schema=t.namespaceURI===Qn.svg?vr:xa;let r=-1;const u={};for(;++r<t.attrs.length;){const o=t.attrs[r],c=(o.prefix?o.prefix+":":"")+o.name;L1.call(Uy,c)||(u[c]=o.value)}const s=(e.schema.space==="svg"?jy:By)(t.tagName,u,P1(e,t.childNodes));if(zu(e,t,s),s.tagName==="template"){const o=t,c=o.sourceCodeLocation,l=c&&c.startTag&&hr(c.startTag),h=c&&c.endTag&&hr(c.endTag),f=vi(e,o.content);l&&h&&e.file&&(f.position={start:l.end,end:h.start}),s.content=f}return e.schema=n,s}function zu(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=zy(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function zy(e,t,n){const r=hr(n);if(t.type==="element"){const u=t.children[t.children.length-1];if(r&&!n.endTag&&u&&u.position&&u.position.end&&(r.end=Object.assign({},u.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)L1.call(n.attrs,s)&&(a[fi(e.schema,s).property]=hr(n.attrs[s]));n.startTag;const o=hr(n.startTag),c=n.endTag?hr(n.endTag):void 0,l={opening:o};c&&(l.closing=c),l.properties=a,t.data={position:l}}}return r}function hr(e){const t=Dc({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Dc({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Dc(e){return e.line&&e.column?e:void 0}class _u{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}_u.prototype.property={};_u.prototype.normal={};_u.prototype.space=null;function R1(e,t){const n={},r={};let u=-1;for(;++u<e.length;)Object.assign(n,e[u].property),Object.assign(r,e[u].normal);return new _u(n,r,t)}function Hs(e){return e.toLowerCase()}class Gt{constructor(t,n){this.property=t,this.attribute=n}}Gt.prototype.space=null;Gt.prototype.boolean=!1;Gt.prototype.booleanish=!1;Gt.prototype.overloadedBoolean=!1;Gt.prototype.number=!1;Gt.prototype.commaSeparated=!1;Gt.prototype.spaceSeparated=!1;Gt.prototype.commaOrSpaceSeparated=!1;Gt.prototype.mustUseProperty=!1;Gt.prototype.defined=!1;let qy=0;const Ee=ur(),nt=ur(),O1=ur(),K=ur(),qe=ur(),_r=ur(),Ft=ur();function ur(){return 2**++qy}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:nt,commaOrSpaceSeparated:Ft,commaSeparated:_r,number:K,overloadedBoolean:O1,spaceSeparated:qe},Symbol.toStringTag,{value:"Module"})),ds=Object.keys(Us);class Ni extends Gt{constructor(t,n,r,u){let a=-1;if(super(t,n),Lc(this,"space",u),typeof r=="number")for(;++a<ds.length;){const s=ds[a];Lc(this,ds[a],(r&Us[s])===Us[s])}}}Ni.prototype.defined=!0;function Lc(e,t,n){n&&(e[t]=n)}const Zy={}.hasOwnProperty;function wr(e){const t={},n={};let r;for(r in e.properties)if(Zy.call(e.properties,r)){const u=e.properties[r],a=new Ni(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Hs(r)]=r,n[Hs(a.attribute)]=r}return new _u(t,n,e.space)}const M1=wr({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),F1=wr({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function B1(e,t){return t in e?e[t]:t}function j1(e,t){return B1(e,t.toLowerCase())}const H1=wr({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:j1,properties:{xmlns:null,xmlnsXLink:null}}),U1=wr({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:nt,ariaAutoComplete:null,ariaBusy:nt,ariaChecked:nt,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:qe,ariaCurrent:null,ariaDescribedBy:qe,ariaDetails:null,ariaDisabled:nt,ariaDropEffect:qe,ariaErrorMessage:null,ariaExpanded:nt,ariaFlowTo:qe,ariaGrabbed:nt,ariaHasPopup:null,ariaHidden:nt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qe,ariaLevel:K,ariaLive:null,ariaModal:nt,ariaMultiLine:nt,ariaMultiSelectable:nt,ariaOrientation:null,ariaOwns:qe,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:nt,ariaReadOnly:nt,ariaRelevant:null,ariaRequired:nt,ariaRoleDescription:qe,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:nt,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null}}),Wy=wr({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:j1,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_r,acceptCharset:qe,accessKey:qe,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:qe,autoFocus:Ee,autoPlay:Ee,blocking:qe,capture:null,charSet:null,checked:Ee,cite:null,className:qe,cols:K,colSpan:null,content:null,contentEditable:nt,controls:Ee,controlsList:qe,coords:K|_r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:O1,draggable:nt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:qe,height:K,hidden:Ee,high:K,href:null,hrefLang:null,htmlFor:qe,httpEquiv:qe,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:qe,itemRef:qe,itemScope:Ee,itemType:qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:K,pattern:null,ping:qe,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:qe,required:Ee,reversed:Ee,rows:K,rowSpan:K,sandbox:qe,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:nt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:nt,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qe,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:nt,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:K,security:null,unselectable:null}}),Yy=wr({space:"svg",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"},transform:B1,properties:{about:Ft,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:qe,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:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,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:_r,g2:_r,glyphName:_r,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,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:K,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:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,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:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Gy=/^data[-\w.:]+$/i,Pc=/-[a-z]/g,Xy=/[A-Z]/g;function Ky(e,t){const n=Hs(t);let r=t,u=Gt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Gy.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Pc,Jy);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Pc.test(a)){let s=a.replace(Xy,Qy);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}u=Ni}return new u(r,t)}function Qy(e){return"-"+e.toLowerCase()}function Jy(e){return e.charAt(1).toUpperCase()}const ek=R1([F1,M1,H1,U1,Wy],"html"),V1=R1([F1,M1,H1,U1,Yy],"svg"),tk={},nk={}.hasOwnProperty,$1=l1("type",{handlers:{root:uk,element:ck,text:ik,comment:ok,doctype:sk}});function rk(e,t){const r=(t||tk).space;return $1(e,r==="svg"?V1:ek)}function uk(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=wi(e.children,n,t),Dr(e,n),n}function ak(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=wi(e.children,n,t),Dr(e,n),n}function sk(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Dr(e,t),t}function ik(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Dr(e,t),t}function ok(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Dr(e,t),t}function ck(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=V1);const u=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&nk.call(e.properties,a)){const c=lk(r,a,e.properties[a]);c&&u.push(c)}}const s=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:u,namespaceURI:Qn[s],childNodes:[],parentNode:null};return o.childNodes=wi(e.children,o,r),Dr(e,o),e.tagName==="template"&&e.content&&(o.content=ak(e.content,r)),o}function lk(e,t,n){const r=Ky(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?E0(n):w0(n));const u={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=u.name.indexOf(":");a<0?u.prefix="":(u.name=u.name.slice(a+1),u.prefix=r.attribute.slice(0,a)),u.namespace=Qn[r.space]}return u}function wi(e,t,n){let r=-1;const u=[];if(e)for(;++r<e.length;){const a=$1(e[r],n);a.parentNode=t,u.push(a)}return u}function Dr(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const dk=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],fk=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),We="�";var T;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const yt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function z1(e){return e>=55296&&e<=57343}function hk(e){return e>=56320&&e<=57343}function pk(e,t){return(e-55296)*1024+9216+t}function q1(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Z1(e){return e>=64976&&e<=65007||fk.has(e)}var B;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(B||(B={}));const mk=65536;class gk{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=mk,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:u,offset:a}=this,s=u+n,o=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(hk(n))return this.pos++,this._addGap(),pk(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(B.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const r=this.html.charCodeAt(n);return r===T.CARRIAGE_RETURN?T.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let t=this.html.charCodeAt(this.pos);return t===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):t===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,z1(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===T.LINE_FEED||t===T.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){q1(t)?this._err(B.controlCharacterInInputStream):Z1(t)&&this._err(B.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ie;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Ie||(Ie={}));function W1(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const bk=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),_k=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function xk(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=_k.get(e))!==null&&t!==void 0?t:e}var dt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(dt||(dt={}));const Ck=32;var Bn;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Bn||(Bn={}));function Vs(e){return e>=dt.ZERO&&e<=dt.NINE}function Ek(e){return e>=dt.UPPER_A&&e<=dt.UPPER_F||e>=dt.LOWER_A&&e<=dt.LOWER_F}function Tk(e){return e>=dt.UPPER_A&&e<=dt.UPPER_Z||e>=dt.LOWER_A&&e<=dt.LOWER_Z||Vs(e)}function yk(e){return e===dt.EQUALS||Tk(e)}var ot;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ot||(ot={}));var yn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(yn||(yn={}));class kk{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=ot.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=yn.Strict}startEntity(t){this.decodeMode=t,this.state=ot.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ot.EntityStart:return t.charCodeAt(n)===dt.NUM?(this.state=ot.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ot.NamedEntity,this.stateNamedEntity(t,n));case ot.NumericStart:return this.stateNumericStart(t,n);case ot.NumericDecimal:return this.stateNumericDecimal(t,n);case ot.NumericHex:return this.stateNumericHex(t,n);case ot.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Ck)===dt.LOWER_X?(this.state=ot.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ot.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,u){if(n!==r){const a=r-n;this.result=this.result*Math.pow(u,a)+Number.parseInt(t.substr(n,a),u),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const u=t.charCodeAt(n);if(Vs(u)||Ek(u))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(u,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const u=t.charCodeAt(n);if(Vs(u))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(u,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===dt.SEMI)this.consumed+=1;else if(this.decodeMode===yn.Strict)return 0;return this.emitCodePoint(xk(this.result),this.consumed),this.errors&&(t!==dt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let u=r[this.treeIndex],a=(u&Bn.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=Ak(r,u,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===yn.Attribute&&(a===0||yk(s))?0:this.emitNotTerminatedNamedEntity();if(u=r[this.treeIndex],a=(u&Bn.VALUE_LENGTH)>>14,a!==0){if(s===dt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==yn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,u=(r[n]&Bn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,u,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:u}=this;return this.emitCodePoint(n===1?u[t]&~Bn.VALUE_LENGTH:u[t+1],r),n===3&&this.emitCodePoint(u[t+2],r),r}end(){var t;switch(this.state){case ot.NamedEntity:return this.result!==0&&(this.decodeMode!==yn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ot.NumericDecimal:return this.emitNumericEntity(0,2);case ot.NumericHex:return this.emitNumericEntity(0,3);case ot.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ot.EntityStart:return 0}}}function Ak(e,t,n,r){const u=(t&Bn.BRANCH_LENGTH)>>7,a=t&Bn.JUMP_TABLE;if(u===0)return a!==0&&r===a?n:-1;if(a){const c=r-a;return c<0||c>=u?-1:e[n+c]-1}let s=n,o=s+u-1;for(;s<=o;){const c=s+o>>>1,l=e[c];if(l<r)s=c+1;else if(l>r)o=c-1;else return e[c+u]}return-1}var z;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(z||(z={}));var Jn;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Jn||(Jn={}));var Zt;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Zt||(Zt={}));var O;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(O||(O={}));var d;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(d||(d={}));const Sk=new Map([[O.A,d.A],[O.ADDRESS,d.ADDRESS],[O.ANNOTATION_XML,d.ANNOTATION_XML],[O.APPLET,d.APPLET],[O.AREA,d.AREA],[O.ARTICLE,d.ARTICLE],[O.ASIDE,d.ASIDE],[O.B,d.B],[O.BASE,d.BASE],[O.BASEFONT,d.BASEFONT],[O.BGSOUND,d.BGSOUND],[O.BIG,d.BIG],[O.BLOCKQUOTE,d.BLOCKQUOTE],[O.BODY,d.BODY],[O.BR,d.BR],[O.BUTTON,d.BUTTON],[O.CAPTION,d.CAPTION],[O.CENTER,d.CENTER],[O.CODE,d.CODE],[O.COL,d.COL],[O.COLGROUP,d.COLGROUP],[O.DD,d.DD],[O.DESC,d.DESC],[O.DETAILS,d.DETAILS],[O.DIALOG,d.DIALOG],[O.DIR,d.DIR],[O.DIV,d.DIV],[O.DL,d.DL],[O.DT,d.DT],[O.EM,d.EM],[O.EMBED,d.EMBED],[O.FIELDSET,d.FIELDSET],[O.FIGCAPTION,d.FIGCAPTION],[O.FIGURE,d.FIGURE],[O.FONT,d.FONT],[O.FOOTER,d.FOOTER],[O.FOREIGN_OBJECT,d.FOREIGN_OBJECT],[O.FORM,d.FORM],[O.FRAME,d.FRAME],[O.FRAMESET,d.FRAMESET],[O.H1,d.H1],[O.H2,d.H2],[O.H3,d.H3],[O.H4,d.H4],[O.H5,d.H5],[O.H6,d.H6],[O.HEAD,d.HEAD],[O.HEADER,d.HEADER],[O.HGROUP,d.HGROUP],[O.HR,d.HR],[O.HTML,d.HTML],[O.I,d.I],[O.IMG,d.IMG],[O.IMAGE,d.IMAGE],[O.INPUT,d.INPUT],[O.IFRAME,d.IFRAME],[O.KEYGEN,d.KEYGEN],[O.LABEL,d.LABEL],[O.LI,d.LI],[O.LINK,d.LINK],[O.LISTING,d.LISTING],[O.MAIN,d.MAIN],[O.MALIGNMARK,d.MALIGNMARK],[O.MARQUEE,d.MARQUEE],[O.MATH,d.MATH],[O.MENU,d.MENU],[O.META,d.META],[O.MGLYPH,d.MGLYPH],[O.MI,d.MI],[O.MO,d.MO],[O.MN,d.MN],[O.MS,d.MS],[O.MTEXT,d.MTEXT],[O.NAV,d.NAV],[O.NOBR,d.NOBR],[O.NOFRAMES,d.NOFRAMES],[O.NOEMBED,d.NOEMBED],[O.NOSCRIPT,d.NOSCRIPT],[O.OBJECT,d.OBJECT],[O.OL,d.OL],[O.OPTGROUP,d.OPTGROUP],[O.OPTION,d.OPTION],[O.P,d.P],[O.PARAM,d.PARAM],[O.PLAINTEXT,d.PLAINTEXT],[O.PRE,d.PRE],[O.RB,d.RB],[O.RP,d.RP],[O.RT,d.RT],[O.RTC,d.RTC],[O.RUBY,d.RUBY],[O.S,d.S],[O.SCRIPT,d.SCRIPT],[O.SEARCH,d.SEARCH],[O.SECTION,d.SECTION],[O.SELECT,d.SELECT],[O.SOURCE,d.SOURCE],[O.SMALL,d.SMALL],[O.SPAN,d.SPAN],[O.STRIKE,d.STRIKE],[O.STRONG,d.STRONG],[O.STYLE,d.STYLE],[O.SUB,d.SUB],[O.SUMMARY,d.SUMMARY],[O.SUP,d.SUP],[O.TABLE,d.TABLE],[O.TBODY,d.TBODY],[O.TEMPLATE,d.TEMPLATE],[O.TEXTAREA,d.TEXTAREA],[O.TFOOT,d.TFOOT],[O.TD,d.TD],[O.TH,d.TH],[O.THEAD,d.THEAD],[O.TITLE,d.TITLE],[O.TR,d.TR],[O.TRACK,d.TRACK],[O.TT,d.TT],[O.U,d.U],[O.UL,d.UL],[O.SVG,d.SVG],[O.VAR,d.VAR],[O.WBR,d.WBR],[O.XMP,d.XMP]]);function Lr(e){var t;return(t=Sk.get(e))!==null&&t!==void 0?t:d.UNKNOWN}const q=d,Ik={[z.HTML]:new Set([q.ADDRESS,q.APPLET,q.AREA,q.ARTICLE,q.ASIDE,q.BASE,q.BASEFONT,q.BGSOUND,q.BLOCKQUOTE,q.BODY,q.BR,q.BUTTON,q.CAPTION,q.CENTER,q.COL,q.COLGROUP,q.DD,q.DETAILS,q.DIR,q.DIV,q.DL,q.DT,q.EMBED,q.FIELDSET,q.FIGCAPTION,q.FIGURE,q.FOOTER,q.FORM,q.FRAME,q.FRAMESET,q.H1,q.H2,q.H3,q.H4,q.H5,q.H6,q.HEAD,q.HEADER,q.HGROUP,q.HR,q.HTML,q.IFRAME,q.IMG,q.INPUT,q.LI,q.LINK,q.LISTING,q.MAIN,q.MARQUEE,q.MENU,q.META,q.NAV,q.NOEMBED,q.NOFRAMES,q.NOSCRIPT,q.OBJECT,q.OL,q.P,q.PARAM,q.PLAINTEXT,q.PRE,q.SCRIPT,q.SECTION,q.SELECT,q.SOURCE,q.STYLE,q.SUMMARY,q.TABLE,q.TBODY,q.TD,q.TEMPLATE,q.TEXTAREA,q.TFOOT,q.TH,q.THEAD,q.TITLE,q.TR,q.TRACK,q.UL,q.WBR,q.XMP]),[z.MATHML]:new Set([q.MI,q.MO,q.MN,q.MS,q.MTEXT,q.ANNOTATION_XML]),[z.SVG]:new Set([q.TITLE,q.FOREIGN_OBJECT,q.DESC]),[z.XLINK]:new Set,[z.XML]:new Set,[z.XMLNS]:new Set},$s=new Set([q.H1,q.H2,q.H3,q.H4,q.H5,q.H6]);O.STYLE,O.SCRIPT,O.XMP,O.IFRAME,O.NOEMBED,O.NOFRAMES,O.PLAINTEXT;var k;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(k||(k={}));const Je={DATA:k.DATA,RCDATA:k.RCDATA,RAWTEXT:k.RAWTEXT,SCRIPT_DATA:k.SCRIPT_DATA,PLAINTEXT:k.PLAINTEXT,CDATA_SECTION:k.CDATA_SECTION};function vk(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function $r(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function Nk(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function Dn(e){return Nk(e)||$r(e)}function Rc(e){return Dn(e)||vk(e)}function Bu(e){return e+32}function Y1(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function Oc(e){return Y1(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function wk(e){return e===T.NULL?B.nullCharacterReference:e>1114111?B.characterReferenceOutsideUnicodeRange:z1(e)?B.surrogateCharacterReference:Z1(e)?B.noncharacterCharacterReference:q1(e)||e===T.CARRIAGE_RETURN?B.controlCharacterReference:null}class Dk{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=k.DATA,this.returnState=k.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new gk(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new kk(bk,(r,u)=>{this.preprocessor.pos=this.entityStartPos+u-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(B.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(B.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const u=wk(r);u&&this._err(u,1)}}:void 0)}_err(t,n=0){var r,u;(u=(r=this.handler).onParseError)===null||u===void 0||u.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ie.START_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ie.END_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Ie.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Ie.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(W1(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const u=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);u[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(B.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Lr(t.tagName),t.type===Ie.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(B.endTagWithAttributes),t.selfClosing&&this._err(B.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ie.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ie.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ie.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ie.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Y1(t)?Ie.WHITESPACE_CHARACTER:t===T.NULL?Ie.NULL_CHARACTER:Ie.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ie.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=k.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?yn.Attribute:yn.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===k.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case k.DATA:{this._stateData(t);break}case k.RCDATA:{this._stateRcdata(t);break}case k.RAWTEXT:{this._stateRawtext(t);break}case k.SCRIPT_DATA:{this._stateScriptData(t);break}case k.PLAINTEXT:{this._statePlaintext(t);break}case k.TAG_OPEN:{this._stateTagOpen(t);break}case k.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case k.TAG_NAME:{this._stateTagName(t);break}case k.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case k.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case k.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case k.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case k.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case k.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case k.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case k.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case k.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case k.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case k.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case k.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case k.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case k.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case k.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case k.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case k.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case k.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case k.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case k.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case k.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case k.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case k.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case k.BOGUS_COMMENT:{this._stateBogusComment(t);break}case k.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case k.COMMENT_START:{this._stateCommentStart(t);break}case k.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case k.COMMENT:{this._stateComment(t);break}case k.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case k.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case k.COMMENT_END:{this._stateCommentEnd(t);break}case k.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case k.DOCTYPE:{this._stateDoctype(t);break}case k.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case k.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case k.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case k.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case k.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case k.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case k.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case k.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case k.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case k.CDATA_SECTION:{this._stateCdataSection(t);break}case k.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case k.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case k.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case k.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=k.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitCodePoint(t);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=k.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(We);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case T.LESS_THAN_SIGN:{this.state=k.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(We);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(We);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(We);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Dn(t))this._createStartTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case T.EXCLAMATION_MARK:{this.state=k.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=k.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(B.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t);break}case T.EOF:{this._err(B.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(B.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=k.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Dn(t))this._createEndTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case T.GREATER_THAN_SIGN:{this._err(B.missingEndTagName),this.state=k.DATA;break}case T.EOF:{this._err(B.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(B.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=k.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.tagName+=We;break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint($r(t)?Bu(t):t)}}_stateRcdataLessThanSign(t){t===T.SOLIDUS?this.state=k.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=k.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Dn(t)?(this.state=k.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=k.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=k.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=k.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=k.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===T.SOLIDUS?this.state=k.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=k.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Dn(t)?(this.state=k.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=k.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case T.SOLIDUS:{this.state=k.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=k.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=k.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Dn(t)?(this.state=k.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===T.HYPHEN_MINUS?(this.state=k.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===T.HYPHEN_MINUS?(this.state=k.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(We);break}case T.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_ESCAPED,this._emitChars(We);break}case T.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=k.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_ESCAPED,this._emitChars(We);break}case T.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===T.SOLIDUS?this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Dn(t)?(this._emitChars("<"),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Dn(t)?(this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(yt.SCRIPT,!1)&&Oc(this.preprocessor.peek(yt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<yt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(We);break}case T.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(We);break}case T.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=k.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(We);break}case T.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===T.SOLIDUS?(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(yt.SCRIPT,!1)&&Oc(this.preprocessor.peek(yt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<yt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=k.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=k.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._err(B.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=k.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=k.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=k.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=k.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(B.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.name+=We;break}default:this.currentAttr.name+=String.fromCodePoint($r(t)?Bu(t):t)}}_stateAfterAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=k.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=k.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=k.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=k.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=k.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(B.missingAttributeValue),this.state=k.DATA,this.emitCurrentTagToken();break}default:this.state=k.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case T.QUOTATION_MARK:{this.state=k.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.value+=We;break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case T.APOSTROPHE:{this.state=k.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.value+=We;break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=k.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=k.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.value+=We;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(B.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=k.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=k.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=k.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBetweenAttributes),this.state=k.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=k.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this._err(B.unexpectedSolidusInTag),this.state=k.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.data+=We;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(yt.DASH_DASH,!0)?(this._createCommentToken(yt.DASH_DASH.length+1),this.state=k.COMMENT_START):this._consumeSequenceIfMatch(yt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(yt.DOCTYPE.length+1),this.state=k.DOCTYPE):this._consumeSequenceIfMatch(yt.CDATA_START,!0)?this.inForeignNode?this.state=k.CDATA_SECTION:(this._err(B.cdataInHtmlContent),this._createCommentToken(yt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=k.BOGUS_COMMENT):this._ensureHibernation()||(this._err(B.incorrectlyOpenedComment),this._createCommentToken(2),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=k.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=k.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=k.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=k.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=k.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.data+=We;break}case T.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case T.EXCLAMATION_MARK:{n.data+="!",this.state=k.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=k.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===T.HYPHEN_MINUS?this.state=k.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=k.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===T.HYPHEN_MINUS?this.state=k.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=k.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==T.GREATER_THAN_SIGN&&t!==T.EOF&&this._err(B.nestedComment),this.state=k.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_END;break}case T.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=k.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=k.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=k.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{n.data+="--!",this.state=k.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(B.incorrectlyClosedComment),this.state=k.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=k.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=k.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case T.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBeforeDoctypeName),this.state=k.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if($r(t))this._createDoctypeToken(String.fromCharCode(Bu(t))),this.state=k.DOCTYPE_NAME;else switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(B.unexpectedNullCharacter),this._createDoctypeToken(We),this.state=k.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(B.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=k.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.name+=We;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint($r(t)?Bu(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(yt.PUBLIC,!1)?this.state=k.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(yt.SYSTEM,!1)?this.state=k.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(B.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(B.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(B.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(B.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(B.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.publicId+=We;break}case T.GREATER_THAN_SIGN:{this._err(B.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.publicId+=We;break}case T.GREATER_THAN_SIGN:{this._err(B.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(B.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(B.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.systemId+=We;break}case T.GREATER_THAN_SIGN:{this._err(B.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(B.unexpectedNullCharacter),n.systemId+=We;break}case T.GREATER_THAN_SIGN:{this._err(B.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.NULL:{this._err(B.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case T.RIGHT_SQUARE_BRACKET:{this.state=k.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(B.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===T.RIGHT_SQUARE_BRACKET?this.state=k.CDATA_SECTION_END:(this._emitChars("]"),this.state=k.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case T.GREATER_THAN_SIGN:{this.state=k.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=k.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Rc(this.preprocessor.peek(1))?k.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Rc(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===T.SEMICOLON&&this._err(B.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const G1=new Set([d.DD,d.DT,d.LI,d.OPTGROUP,d.OPTION,d.P,d.RB,d.RP,d.RT,d.RTC]),Mc=new Set([...G1,d.CAPTION,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]),Ju=new Set([d.APPLET,d.CAPTION,d.HTML,d.MARQUEE,d.OBJECT,d.TABLE,d.TD,d.TEMPLATE,d.TH]),Lk=new Set([...Ju,d.OL,d.UL]),Pk=new Set([...Ju,d.BUTTON]),Fc=new Set([d.ANNOTATION_XML,d.MI,d.MN,d.MO,d.MS,d.MTEXT]),Bc=new Set([d.DESC,d.FOREIGN_OBJECT,d.TITLE]),Rk=new Set([d.TR,d.TEMPLATE,d.HTML]),Ok=new Set([d.TBODY,d.TFOOT,d.THEAD,d.TEMPLATE,d.HTML]),Mk=new Set([d.TABLE,d.TEMPLATE,d.HTML]),Fk=new Set([d.TD,d.TH]);class Bk{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=d.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===d.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===z.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const u=this._indexOf(t)+1;this.items.splice(u,0,n),this.tagIDs.splice(u,0,r),this.stackTop++,u===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,u===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==z.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped($s,z.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Fk,z.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Mk,z.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Ok,z.HTML)}clearBackToTableRowContext(){this.clearBackTo(Rk,z.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===d.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===d.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const u=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case z.HTML:{if(u===t)return!0;if(n.has(u))return!1;break}case z.SVG:{if(Bc.has(u))return!1;break}case z.MATHML:{if(Fc.has(u))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ju)}hasInListItemScope(t){return this.hasInDynamicScope(t,Lk)}hasInButtonScope(t){return this.hasInDynamicScope(t,Pk)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case z.HTML:{if($s.has(n))return!0;if(Ju.has(n))return!1;break}case z.SVG:{if(Bc.has(n))return!1;break}case z.MATHML:{if(Fc.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===z.HTML)switch(this.tagIDs[n]){case t:return!0;case d.TABLE:case d.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===z.HTML)switch(this.tagIDs[t]){case d.TBODY:case d.THEAD:case d.TFOOT:return!0;case d.TABLE:case d.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===z.HTML)switch(this.tagIDs[n]){case t:return!0;case d.OPTION:case d.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&G1.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Mc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Mc.has(this.currentTagId);)this.pop()}}const fs=3;var cn;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(cn||(cn={}));const jc={type:cn.Marker};class jk{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],u=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const c=this.entries[o];if(c.type===cn.Marker)break;const{element:l}=c;if(this.treeAdapter.getTagName(l)===a&&this.treeAdapter.getNamespaceURI(l)===s){const h=this.treeAdapter.getAttrList(l);h.length===u&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<fs)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<fs)return;const u=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const o=r[s];o.attrs.every(c=>u.get(c.name)===c.value)&&(a+=1,a>=fs&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(jc)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:cn.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:cn.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(jc);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===cn.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===cn.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===cn.Element&&n.element===t)}}const Ln={createDocument(){return{nodeName:"#document",mode:Zt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const u=e.childNodes.find(a=>a.nodeName==="#documentType");if(u)u.name=t,u.publicId=n,u.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ln.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ln.isTextNode(n)){n.value+=t;return}}Ln.appendChild(e,Ln.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ln.isTextNode(r)?r.value+=t:Ln.insertBefore(e,Ln.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},X1="html",Hk="about:legacy-compat",Uk="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",K1=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Vk=[...K1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],$k=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Q1=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],zk=[...Q1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Hc(e,t){return t.some(n=>e.startsWith(n))}function qk(e){return e.name===X1&&e.publicId===null&&(e.systemId===null||e.systemId===Hk)}function Zk(e){if(e.name!==X1)return Zt.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Uk)return Zt.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),$k.has(n))return Zt.QUIRKS;let r=t===null?Vk:K1;if(Hc(n,r))return Zt.QUIRKS;if(r=t===null?Q1:zk,Hc(n,r))return Zt.LIMITED_QUIRKS}return Zt.NO_QUIRKS}const Uc={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Wk="definitionurl",Yk="definitionURL",Gk=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Xk=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:z.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:z.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:z.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:z.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:z.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:z.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:z.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:z.XML}],["xml:space",{prefix:"xml",name:"space",namespace:z.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:z.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:z.XMLNS}]]),Kk=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Qk=new Set([d.B,d.BIG,d.BLOCKQUOTE,d.BODY,d.BR,d.CENTER,d.CODE,d.DD,d.DIV,d.DL,d.DT,d.EM,d.EMBED,d.H1,d.H2,d.H3,d.H4,d.H5,d.H6,d.HEAD,d.HR,d.I,d.IMG,d.LI,d.LISTING,d.MENU,d.META,d.NOBR,d.OL,d.P,d.PRE,d.RUBY,d.S,d.SMALL,d.SPAN,d.STRONG,d.STRIKE,d.SUB,d.SUP,d.TABLE,d.TT,d.U,d.UL,d.VAR]);function Jk(e){const t=e.tagID;return t===d.FONT&&e.attrs.some(({name:r})=>r===Jn.COLOR||r===Jn.SIZE||r===Jn.FACE)||Qk.has(t)}function J1(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Wk){e.attrs[t].name=Yk;break}}function ed(e){for(let t=0;t<e.attrs.length;t++){const n=Gk.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Di(e){for(let t=0;t<e.attrs.length;t++){const n=Xk.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function eA(e){const t=Kk.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Lr(e.tagName))}function tA(e,t){return t===z.MATHML&&(e===d.MI||e===d.MO||e===d.MN||e===d.MS||e===d.MTEXT)}function nA(e,t,n){if(t===z.MATHML&&e===d.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Jn.ENCODING){const u=n[r].value.toLowerCase();return u===Uc.TEXT_HTML||u===Uc.APPLICATION_XML}}return t===z.SVG&&(e===d.FOREIGN_OBJECT||e===d.DESC||e===d.TITLE)}function rA(e,t,n,r){return(!r||r===z.HTML)&&nA(e,t,n)||(!r||r===z.MATHML)&&tA(e,t)}const uA="hidden",aA=8,sA=3;var w;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(w||(w={}));const iA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},td=new Set([d.TABLE,d.TBODY,d.TFOOT,d.THEAD,d.TR]),Vc={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ln,onParseError:null};class $c{constructor(t,n,r=null,u=null){this.fragmentContext=r,this.scriptHandler=u,this.currentToken=null,this.stopped=!1,this.insertionMode=w.INITIAL,this.originalInsertionMode=w.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Vc,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new Dk(this.options,this),this.activeFormattingElements=new jk(this.treeAdapter),this.fragmentContextID=r?Lr(this.treeAdapter.getTagName(r)):d.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Bk(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Vc,...n};t??(t=r.treeAdapter.createElement(O.TEMPLATE,z.HTML,[]));const u=r.treeAdapter.createElement("documentmock",z.HTML,[]),a=new this(r,u,t);return a.fragmentContextID===d.TEMPLATE&&a.tmplInsertionModeStack.unshift(w.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var u;if(!this.onParseError)return;const a=(u=t.location)!==null&&u!==void 0?u:iA,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var u,a;(a=(u=this.treeAdapter).onItemPush)===null||a===void 0||a.call(u,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,u;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(u=(r=this.treeAdapter).onItemPop)===null||u===void 0||u.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===z.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,z.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=w.TEXT}switchToPlaintextParsing(){this.insertionMode=w.TEXT,this.originalInsertionMode=w.IN_BODY,this.tokenizer.state=Je.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===O.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==z.HTML))switch(this.fragmentContextID){case d.TITLE:case d.TEXTAREA:{this.tokenizer.state=Je.RCDATA;break}case d.STYLE:case d.XMP:case d.IFRAME:case d.NOEMBED:case d.NOFRAMES:case d.NOSCRIPT:{this.tokenizer.state=Je.RAWTEXT;break}case d.SCRIPT:{this.tokenizer.state=Je.SCRIPT_DATA;break}case d.PLAINTEXT:{this.tokenizer.state=Je.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",u=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,u),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,z.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,z.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(O.HTML,z.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,d.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const u=this.treeAdapter.getChildNodes(n),a=r?u.lastIndexOf(r):u.length,s=u[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:c,endCol:l,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:c,endCol:l,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,u=this.treeAdapter.getTagName(t),a=n.type===Ie.END_TAG&&u===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===d.SVG&&this.treeAdapter.getTagName(n)===O.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===z.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===d.MGLYPH||t.tagID===d.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,z.HTML)}_processToken(t){switch(t.type){case Ie.CHARACTER:{this.onCharacter(t);break}case Ie.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ie.COMMENT:{this.onComment(t);break}case Ie.DOCTYPE:{this.onDoctype(t);break}case Ie.START_TAG:{this._processStartTag(t);break}case Ie.END_TAG:{this.onEndTag(t);break}case Ie.EOF:{this.onEof(t);break}case Ie.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const u=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return rA(t,u,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(u=>u.type===cn.Marker||this.openElements.contains(u.element)),r=n===-1?t-1:n-1;for(let u=r;u>=0;u--){const a=this.activeFormattingElements.entries[u];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=w.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(d.P),this.openElements.popUntilTagNamePopped(d.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case d.TR:{this.insertionMode=w.IN_ROW;return}case d.TBODY:case d.THEAD:case d.TFOOT:{this.insertionMode=w.IN_TABLE_BODY;return}case d.CAPTION:{this.insertionMode=w.IN_CAPTION;return}case d.COLGROUP:{this.insertionMode=w.IN_COLUMN_GROUP;return}case d.TABLE:{this.insertionMode=w.IN_TABLE;return}case d.BODY:{this.insertionMode=w.IN_BODY;return}case d.FRAMESET:{this.insertionMode=w.IN_FRAMESET;return}case d.SELECT:{this._resetInsertionModeForSelect(t);return}case d.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case d.HTML:{this.insertionMode=this.headElement?w.AFTER_HEAD:w.BEFORE_HEAD;return}case d.TD:case d.TH:{if(t>0){this.insertionMode=w.IN_CELL;return}break}case d.HEAD:{if(t>0){this.insertionMode=w.IN_HEAD;return}break}}this.insertionMode=w.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===d.TEMPLATE)break;if(r===d.TABLE){this.insertionMode=w.IN_SELECT_IN_TABLE;return}}this.insertionMode=w.IN_SELECT}_isElementCausesFosterParenting(t){return td.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case d.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===z.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case d.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return Ik[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FS(this,t);return}switch(this.insertionMode){case w.INITIAL:{jr(this,t);break}case w.BEFORE_HTML:{Yr(this,t);break}case w.BEFORE_HEAD:{Gr(this,t);break}case w.IN_HEAD:{Xr(this,t);break}case w.IN_HEAD_NO_SCRIPT:{Kr(this,t);break}case w.AFTER_HEAD:{Qr(this,t);break}case w.IN_BODY:case w.IN_CAPTION:case w.IN_CELL:case w.IN_TEMPLATE:{rd(this,t);break}case w.TEXT:case w.IN_SELECT:case w.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case w.IN_TABLE:case w.IN_TABLE_BODY:case w.IN_ROW:{hs(this,t);break}case w.IN_TABLE_TEXT:{cd(this,t);break}case w.IN_COLUMN_GROUP:{ea(this,t);break}case w.AFTER_BODY:{ta(this,t);break}case w.AFTER_AFTER_BODY:{qu(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MS(this,t);return}switch(this.insertionMode){case w.INITIAL:{jr(this,t);break}case w.BEFORE_HTML:{Yr(this,t);break}case w.BEFORE_HEAD:{Gr(this,t);break}case w.IN_HEAD:{Xr(this,t);break}case w.IN_HEAD_NO_SCRIPT:{Kr(this,t);break}case w.AFTER_HEAD:{Qr(this,t);break}case w.TEXT:{this._insertCharacters(t);break}case w.IN_TABLE:case w.IN_TABLE_BODY:case w.IN_ROW:{hs(this,t);break}case w.IN_COLUMN_GROUP:{ea(this,t);break}case w.AFTER_BODY:{ta(this,t);break}case w.AFTER_AFTER_BODY:{qu(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){zs(this,t);return}switch(this.insertionMode){case w.INITIAL:case w.BEFORE_HTML:case w.BEFORE_HEAD:case w.IN_HEAD:case w.IN_HEAD_NO_SCRIPT:case w.AFTER_HEAD:case w.IN_BODY:case w.IN_TABLE:case w.IN_CAPTION:case w.IN_COLUMN_GROUP:case w.IN_TABLE_BODY:case w.IN_ROW:case w.IN_CELL:case w.IN_SELECT:case w.IN_SELECT_IN_TABLE:case w.IN_TEMPLATE:case w.IN_FRAMESET:case w.AFTER_FRAMESET:{zs(this,t);break}case w.IN_TABLE_TEXT:{Hr(this,t);break}case w.AFTER_BODY:{pA(this,t);break}case w.AFTER_AFTER_BODY:case w.AFTER_AFTER_FRAMESET:{mA(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case w.INITIAL:{gA(this,t);break}case w.BEFORE_HEAD:case w.IN_HEAD:case w.IN_HEAD_NO_SCRIPT:case w.AFTER_HEAD:{this._err(t,B.misplacedDoctype);break}case w.IN_TABLE_TEXT:{Hr(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,B.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?BS(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case w.INITIAL:{jr(this,t);break}case w.BEFORE_HTML:{bA(this,t);break}case w.BEFORE_HEAD:{xA(this,t);break}case w.IN_HEAD:{nn(this,t);break}case w.IN_HEAD_NO_SCRIPT:{TA(this,t);break}case w.AFTER_HEAD:{kA(this,t);break}case w.IN_BODY:{bt(this,t);break}case w.IN_TABLE:{yr(this,t);break}case w.IN_TABLE_TEXT:{Hr(this,t);break}case w.IN_CAPTION:{CS(this,t);break}case w.IN_COLUMN_GROUP:{Ri(this,t);break}case w.IN_TABLE_BODY:{Na(this,t);break}case w.IN_ROW:{wa(this,t);break}case w.IN_CELL:{yS(this,t);break}case w.IN_SELECT:{fd(this,t);break}case w.IN_SELECT_IN_TABLE:{AS(this,t);break}case w.IN_TEMPLATE:{IS(this,t);break}case w.AFTER_BODY:{NS(this,t);break}case w.IN_FRAMESET:{wS(this,t);break}case w.AFTER_FRAMESET:{LS(this,t);break}case w.AFTER_AFTER_BODY:{RS(this,t);break}case w.AFTER_AFTER_FRAMESET:{OS(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?jS(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case w.INITIAL:{jr(this,t);break}case w.BEFORE_HTML:{_A(this,t);break}case w.BEFORE_HEAD:{CA(this,t);break}case w.IN_HEAD:{EA(this,t);break}case w.IN_HEAD_NO_SCRIPT:{yA(this,t);break}case w.AFTER_HEAD:{AA(this,t);break}case w.IN_BODY:{va(this,t);break}case w.TEXT:{lS(this,t);break}case w.IN_TABLE:{iu(this,t);break}case w.IN_TABLE_TEXT:{Hr(this,t);break}case w.IN_CAPTION:{ES(this,t);break}case w.IN_COLUMN_GROUP:{TS(this,t);break}case w.IN_TABLE_BODY:{qs(this,t);break}case w.IN_ROW:{dd(this,t);break}case w.IN_CELL:{kS(this,t);break}case w.IN_SELECT:{hd(this,t);break}case w.IN_SELECT_IN_TABLE:{SS(this,t);break}case w.IN_TEMPLATE:{vS(this,t);break}case w.AFTER_BODY:{md(this,t);break}case w.IN_FRAMESET:{DS(this,t);break}case w.AFTER_FRAMESET:{PS(this,t);break}case w.AFTER_AFTER_BODY:{qu(this,t);break}}}onEof(t){switch(this.insertionMode){case w.INITIAL:{jr(this,t);break}case w.BEFORE_HTML:{Yr(this,t);break}case w.BEFORE_HEAD:{Gr(this,t);break}case w.IN_HEAD:{Xr(this,t);break}case w.IN_HEAD_NO_SCRIPT:{Kr(this,t);break}case w.AFTER_HEAD:{Qr(this,t);break}case w.IN_BODY:case w.IN_TABLE:case w.IN_CAPTION:case w.IN_COLUMN_GROUP:case w.IN_TABLE_BODY:case w.IN_ROW:case w.IN_CELL:case w.IN_SELECT:case w.IN_SELECT_IN_TABLE:{id(this,t);break}case w.TEXT:{dS(this,t);break}case w.IN_TABLE_TEXT:{Hr(this,t);break}case w.IN_TEMPLATE:{pd(this,t);break}case w.AFTER_BODY:case w.IN_FRAMESET:case w.AFTER_FRAMESET:case w.AFTER_AFTER_BODY:case w.AFTER_AFTER_FRAMESET:{Pi(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===T.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case w.IN_HEAD:case w.IN_HEAD_NO_SCRIPT:case w.AFTER_HEAD:case w.TEXT:case w.IN_COLUMN_GROUP:case w.IN_SELECT:case w.IN_SELECT_IN_TABLE:case w.IN_FRAMESET:case w.AFTER_FRAMESET:{this._insertCharacters(t);break}case w.IN_BODY:case w.IN_CAPTION:case w.IN_CELL:case w.IN_TEMPLATE:case w.AFTER_BODY:case w.AFTER_AFTER_BODY:case w.AFTER_AFTER_FRAMESET:{nd(this,t);break}case w.IN_TABLE:case w.IN_TABLE_BODY:case w.IN_ROW:{hs(this,t);break}case w.IN_TABLE_TEXT:{od(this,t);break}}}}function oA(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):sd(e,t),n}function cA(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const u=e.openElements.items[r];if(u===t.element)break;e._isSpecialElement(u,e.openElements.tagIDs[r])&&(n=u)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function lA(e,t,n){let r=t,u=e.openElements.getCommonAncestor(t);for(let a=0,s=u;s!==n;a++,s=u){u=e.openElements.getCommonAncestor(s);const o=e.activeFormattingElements.getElementEntry(s),c=o&&a>=sA;!o||c?(c&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(s)):(s=dA(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function dA(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function fA(e,t,n){const r=e.treeAdapter.getTagName(t),u=Lr(r);if(e._isElementCausesFosterParenting(u))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);u===d.TEMPLATE&&a===z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hA(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:u}=n,a=e.treeAdapter.createElement(u.tagName,r,u.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,u),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,u.tagID)}function Li(e,t){for(let n=0;n<aA;n++){const r=oA(e,t);if(!r)break;const u=cA(e,r);if(!u)break;e.activeFormattingElements.bookmark=r;const a=lA(e,u,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&fA(e,s,a),hA(e,u,r)}}function zs(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function pA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function mA(e,t){e._appendCommentNode(t,e.document)}function Pi(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],u=e.treeAdapter.getNodeSourceCodeLocation(r);if(u&&!u.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function gA(e,t){e._setDocumentType(t);const n=t.forceQuirks?Zt.QUIRKS:Zk(t);qk(t)||e._err(t,B.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=w.BEFORE_HTML}function jr(e,t){e._err(t,B.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Zt.QUIRKS),e.insertionMode=w.BEFORE_HTML,e._processToken(t)}function bA(e,t){t.tagID===d.HTML?(e._insertElement(t,z.HTML),e.insertionMode=w.BEFORE_HEAD):Yr(e,t)}function _A(e,t){const n=t.tagID;(n===d.HTML||n===d.HEAD||n===d.BODY||n===d.BR)&&Yr(e,t)}function Yr(e,t){e._insertFakeRootElement(),e.insertionMode=w.BEFORE_HEAD,e._processToken(t)}function xA(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.HEAD:{e._insertElement(t,z.HTML),e.headElement=e.openElements.current,e.insertionMode=w.IN_HEAD;break}default:Gr(e,t)}}function CA(e,t){const n=t.tagID;n===d.HEAD||n===d.BODY||n===d.HTML||n===d.BR?Gr(e,t):e._err(t,B.endTagWithoutMatchingOpenElement)}function Gr(e,t){e._insertFakeElement(O.HEAD,d.HEAD),e.headElement=e.openElements.current,e.insertionMode=w.IN_HEAD,e._processToken(t)}function nn(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:{e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break}case d.TITLE:{e._switchToTextParsing(t,Je.RCDATA);break}case d.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Je.RAWTEXT):(e._insertElement(t,z.HTML),e.insertionMode=w.IN_HEAD_NO_SCRIPT);break}case d.NOFRAMES:case d.STYLE:{e._switchToTextParsing(t,Je.RAWTEXT);break}case d.SCRIPT:{e._switchToTextParsing(t,Je.SCRIPT_DATA);break}case d.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=w.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(w.IN_TEMPLATE);break}case d.HEAD:{e._err(t,B.misplacedStartTagForHeadElement);break}default:Xr(e,t)}}function EA(e,t){switch(t.tagID){case d.HEAD:{e.openElements.pop(),e.insertionMode=w.AFTER_HEAD;break}case d.BODY:case d.BR:case d.HTML:{Xr(e,t);break}case d.TEMPLATE:{ar(e,t);break}default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function ar(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==d.TEMPLATE&&e._err(t,B.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(d.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,B.endTagWithoutMatchingOpenElement)}function Xr(e,t){e.openElements.pop(),e.insertionMode=w.AFTER_HEAD,e._processToken(t)}function TA(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.BASEFONT:case d.BGSOUND:case d.HEAD:case d.LINK:case d.META:case d.NOFRAMES:case d.STYLE:{nn(e,t);break}case d.NOSCRIPT:{e._err(t,B.nestedNoscriptInHead);break}default:Kr(e,t)}}function yA(e,t){switch(t.tagID){case d.NOSCRIPT:{e.openElements.pop(),e.insertionMode=w.IN_HEAD;break}case d.BR:{Kr(e,t);break}default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Kr(e,t){const n=t.type===Ie.EOF?B.openElementsLeftAfterEof:B.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=w.IN_HEAD,e._processToken(t)}function kA(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.BODY:{e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=w.IN_BODY;break}case d.FRAMESET:{e._insertElement(t,z.HTML),e.insertionMode=w.IN_FRAMESET;break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:case d.NOFRAMES:case d.SCRIPT:case d.STYLE:case d.TEMPLATE:case d.TITLE:{e._err(t,B.abandonedHeadElementChild),e.openElements.push(e.headElement,d.HEAD),nn(e,t),e.openElements.remove(e.headElement);break}case d.HEAD:{e._err(t,B.misplacedStartTagForHeadElement);break}default:Qr(e,t)}}function AA(e,t){switch(t.tagID){case d.BODY:case d.HTML:case d.BR:{Qr(e,t);break}case d.TEMPLATE:{ar(e,t);break}default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Qr(e,t){e._insertFakeElement(O.BODY,d.BODY),e.insertionMode=w.IN_BODY,Ia(e,t)}function Ia(e,t){switch(t.type){case Ie.CHARACTER:{rd(e,t);break}case Ie.WHITESPACE_CHARACTER:{nd(e,t);break}case Ie.COMMENT:{zs(e,t);break}case Ie.START_TAG:{bt(e,t);break}case Ie.END_TAG:{va(e,t);break}case Ie.EOF:{id(e,t);break}}}function nd(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function rd(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function SA(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function IA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function vA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,z.HTML),e.insertionMode=w.IN_FRAMESET)}function NA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function wA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&$s.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,z.HTML)}function DA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function LA(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,z.HTML),n||(e.formElement=e.openElements.current))}function PA(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const u=e.openElements.tagIDs[r];if(n===d.LI&&u===d.LI||(n===d.DD||n===d.DT)&&(u===d.DD||u===d.DT)){e.openElements.generateImpliedEndTagsWithExclusion(u),e.openElements.popUntilTagNamePopped(u);break}if(u!==d.ADDRESS&&u!==d.DIV&&u!==d.P&&e._isSpecialElement(e.openElements.items[r],u))break}e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function RA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.tokenizer.state=Je.PLAINTEXT}function OA(e,t){e.openElements.hasInScope(d.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1}function MA(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(O.A);n&&(Li(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BA(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(d.NOBR)&&(Li(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function HA(e,t){e.treeAdapter.getDocumentMode(e.document)!==Zt.QUIRKS&&e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=w.IN_TABLE}function ud(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function ad(e){const t=W1(e,Jn.TYPE);return t!=null&&t.toLowerCase()===uA}function UA(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),ad(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function VA(e,t){e._appendElement(t,z.HTML),t.ackSelfClosing=!0}function $A(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function zA(e,t){t.tagName=O.IMG,t.tagID=d.IMG,ud(e,t)}function qA(e,t){e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Je.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=w.TEXT}function ZA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Je.RAWTEXT)}function WA(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Je.RAWTEXT)}function zc(e,t){e._switchToTextParsing(t,Je.RAWTEXT)}function YA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===w.IN_TABLE||e.insertionMode===w.IN_CAPTION||e.insertionMode===w.IN_TABLE_BODY||e.insertionMode===w.IN_ROW||e.insertionMode===w.IN_CELL?w.IN_SELECT_IN_TABLE:w.IN_SELECT}function GA(e,t){e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function XA(e,t){e.openElements.hasInScope(d.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,z.HTML)}function KA(e,t){e.openElements.hasInScope(d.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(d.RTC),e._insertElement(t,z.HTML)}function QA(e,t){e._reconstructActiveFormattingElements(),J1(t),Di(t),t.selfClosing?e._appendElement(t,z.MATHML):e._insertElement(t,z.MATHML),t.ackSelfClosing=!0}function JA(e,t){e._reconstructActiveFormattingElements(),ed(t),Di(t),t.selfClosing?e._appendElement(t,z.SVG):e._insertElement(t,z.SVG),t.ackSelfClosing=!0}function qc(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function bt(e,t){switch(t.tagID){case d.I:case d.S:case d.B:case d.U:case d.EM:case d.TT:case d.BIG:case d.CODE:case d.FONT:case d.SMALL:case d.STRIKE:case d.STRONG:{FA(e,t);break}case d.A:{MA(e,t);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{wA(e,t);break}case d.P:case d.DL:case d.OL:case d.UL:case d.DIV:case d.DIR:case d.NAV:case d.MAIN:case d.MENU:case d.ASIDE:case d.CENTER:case d.FIGURE:case d.FOOTER:case d.HEADER:case d.HGROUP:case d.DIALOG:case d.DETAILS:case d.ADDRESS:case d.ARTICLE:case d.SEARCH:case d.SECTION:case d.SUMMARY:case d.FIELDSET:case d.BLOCKQUOTE:case d.FIGCAPTION:{NA(e,t);break}case d.LI:case d.DD:case d.DT:{PA(e,t);break}case d.BR:case d.IMG:case d.WBR:case d.AREA:case d.EMBED:case d.KEYGEN:{ud(e,t);break}case d.HR:{$A(e,t);break}case d.RB:case d.RTC:{XA(e,t);break}case d.RT:case d.RP:{KA(e,t);break}case d.PRE:case d.LISTING:{DA(e,t);break}case d.XMP:{ZA(e,t);break}case d.SVG:{JA(e,t);break}case d.HTML:{SA(e,t);break}case d.BASE:case d.LINK:case d.META:case d.STYLE:case d.TITLE:case d.SCRIPT:case d.BGSOUND:case d.BASEFONT:case d.TEMPLATE:{nn(e,t);break}case d.BODY:{IA(e,t);break}case d.FORM:{LA(e,t);break}case d.NOBR:{BA(e,t);break}case d.MATH:{QA(e,t);break}case d.TABLE:{HA(e,t);break}case d.INPUT:{UA(e,t);break}case d.PARAM:case d.TRACK:case d.SOURCE:{VA(e,t);break}case d.IMAGE:{zA(e,t);break}case d.BUTTON:{OA(e,t);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{jA(e,t);break}case d.IFRAME:{WA(e,t);break}case d.SELECT:{YA(e,t);break}case d.OPTION:case d.OPTGROUP:{GA(e,t);break}case d.NOEMBED:case d.NOFRAMES:{zc(e,t);break}case d.FRAMESET:{vA(e,t);break}case d.TEXTAREA:{qA(e,t);break}case d.NOSCRIPT:{e.options.scriptingEnabled?zc(e,t):qc(e,t);break}case d.PLAINTEXT:{RA(e,t);break}case d.COL:case d.TH:case d.TD:case d.TR:case d.HEAD:case d.FRAME:case d.TBODY:case d.TFOOT:case d.THEAD:case d.CAPTION:case d.COLGROUP:break;default:qc(e,t)}}function eS(e,t){if(e.openElements.hasInScope(d.BODY)&&(e.insertionMode=w.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function tS(e,t){e.openElements.hasInScope(d.BODY)&&(e.insertionMode=w.AFTER_BODY,md(e,t))}function nS(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function rS(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(d.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(d.FORM):n&&e.openElements.remove(n))}function uS(e){e.openElements.hasInButtonScope(d.P)||e._insertFakeElement(O.P,d.P),e._closePElement()}function aS(e){e.openElements.hasInListItemScope(d.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(d.LI),e.openElements.popUntilTagNamePopped(d.LI))}function sS(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function iS(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function oS(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cS(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(O.BR,d.BR),e.openElements.pop(),e.framesetOk=!1}function sd(e,t){const n=t.tagName,r=t.tagID;for(let u=e.openElements.stackTop;u>0;u--){const a=e.openElements.items[u],s=e.openElements.tagIDs[u];if(r===s&&(r!==d.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=u&&e.openElements.shortenToLength(u);break}if(e._isSpecialElement(a,s))break}}function va(e,t){switch(t.tagID){case d.A:case d.B:case d.I:case d.S:case d.U:case d.EM:case d.TT:case d.BIG:case d.CODE:case d.FONT:case d.NOBR:case d.SMALL:case d.STRIKE:case d.STRONG:{Li(e,t);break}case d.P:{uS(e);break}case d.DL:case d.UL:case d.OL:case d.DIR:case d.DIV:case d.NAV:case d.PRE:case d.MAIN:case d.MENU:case d.ASIDE:case d.BUTTON:case d.CENTER:case d.FIGURE:case d.FOOTER:case d.HEADER:case d.HGROUP:case d.DIALOG:case d.ADDRESS:case d.ARTICLE:case d.DETAILS:case d.SEARCH:case d.SECTION:case d.SUMMARY:case d.LISTING:case d.FIELDSET:case d.BLOCKQUOTE:case d.FIGCAPTION:{nS(e,t);break}case d.LI:{aS(e);break}case d.DD:case d.DT:{sS(e,t);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{iS(e);break}case d.BR:{cS(e);break}case d.BODY:{eS(e,t);break}case d.HTML:{tS(e,t);break}case d.FORM:{rS(e);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{oS(e,t);break}case d.TEMPLATE:{ar(e,t);break}default:sd(e,t)}}function id(e,t){e.tmplInsertionModeStack.length>0?pd(e,t):Pi(e,t)}function lS(e,t){var n;t.tagID===d.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function dS(e,t){e._err(t,B.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function hs(e,t){if(e.openElements.currentTagId!==void 0&&td.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=w.IN_TABLE_TEXT,t.type){case Ie.CHARACTER:{cd(e,t);break}case Ie.WHITESPACE_CHARACTER:{od(e,t);break}}else xu(e,t)}function fS(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,z.HTML),e.insertionMode=w.IN_CAPTION}function hS(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=w.IN_COLUMN_GROUP}function pS(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(O.COLGROUP,d.COLGROUP),e.insertionMode=w.IN_COLUMN_GROUP,Ri(e,t)}function mS(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=w.IN_TABLE_BODY}function gS(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(O.TBODY,d.TBODY),e.insertionMode=w.IN_TABLE_BODY,Na(e,t)}function bS(e,t){e.openElements.hasInTableScope(d.TABLE)&&(e.openElements.popUntilTagNamePopped(d.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function _S(e,t){ad(t)?e._appendElement(t,z.HTML):xu(e,t),t.ackSelfClosing=!0}function xS(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function yr(e,t){switch(t.tagID){case d.TD:case d.TH:case d.TR:{gS(e,t);break}case d.STYLE:case d.SCRIPT:case d.TEMPLATE:{nn(e,t);break}case d.COL:{pS(e,t);break}case d.FORM:{xS(e,t);break}case d.TABLE:{bS(e,t);break}case d.TBODY:case d.TFOOT:case d.THEAD:{mS(e,t);break}case d.INPUT:{_S(e,t);break}case d.CAPTION:{fS(e,t);break}case d.COLGROUP:{hS(e,t);break}default:xu(e,t)}}function iu(e,t){switch(t.tagID){case d.TABLE:{e.openElements.hasInTableScope(d.TABLE)&&(e.openElements.popUntilTagNamePopped(d.TABLE),e._resetInsertionMode());break}case d.TEMPLATE:{ar(e,t);break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TBODY:case d.TD:case d.TFOOT:case d.TH:case d.THEAD:case d.TR:break;default:xu(e,t)}}function xu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Ia(e,t),e.fosterParentingEnabled=n}function od(e,t){e.pendingCharacterTokens.push(t)}function cd(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Hr(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)xu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const ld=new Set([d.CAPTION,d.COL,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]);function CS(e,t){const n=t.tagID;ld.has(n)?e.openElements.hasInTableScope(d.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=w.IN_TABLE,yr(e,t)):bt(e,t)}function ES(e,t){const n=t.tagID;switch(n){case d.CAPTION:case d.TABLE:{e.openElements.hasInTableScope(d.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=w.IN_TABLE,n===d.TABLE&&iu(e,t));break}case d.BODY:case d.COL:case d.COLGROUP:case d.HTML:case d.TBODY:case d.TD:case d.TFOOT:case d.TH:case d.THEAD:case d.TR:break;default:va(e,t)}}function Ri(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.COL:{e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break}case d.TEMPLATE:{nn(e,t);break}default:ea(e,t)}}function TS(e,t){switch(t.tagID){case d.COLGROUP:{e.openElements.currentTagId===d.COLGROUP&&(e.openElements.pop(),e.insertionMode=w.IN_TABLE);break}case d.TEMPLATE:{ar(e,t);break}case d.COL:break;default:ea(e,t)}}function ea(e,t){e.openElements.currentTagId===d.COLGROUP&&(e.openElements.pop(),e.insertionMode=w.IN_TABLE,e._processToken(t))}function Na(e,t){switch(t.tagID){case d.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,z.HTML),e.insertionMode=w.IN_ROW;break}case d.TH:case d.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(O.TR,d.TR),e.insertionMode=w.IN_ROW,wa(e,t);break}case d.CAPTION:case d.COL:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE,yr(e,t));break}default:yr(e,t)}}function qs(e,t){const n=t.tagID;switch(t.tagID){case d.TBODY:case d.TFOOT:case d.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE);break}case d.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE,iu(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TD:case d.TH:case d.TR:break;default:iu(e,t)}}function wa(e,t){switch(t.tagID){case d.TH:case d.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,z.HTML),e.insertionMode=w.IN_CELL,e.activeFormattingElements.insertMarker();break}case d.CAPTION:case d.COL:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE_BODY,Na(e,t));break}default:yr(e,t)}}function dd(e,t){switch(t.tagID){case d.TR:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE_BODY);break}case d.TABLE:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE_BODY,qs(e,t));break}case d.TBODY:case d.TFOOT:case d.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(d.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=w.IN_TABLE_BODY,qs(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TD:case d.TH:break;default:iu(e,t)}}function yS(e,t){const n=t.tagID;ld.has(n)?(e.openElements.hasInTableScope(d.TD)||e.openElements.hasInTableScope(d.TH))&&(e._closeTableCell(),wa(e,t)):bt(e,t)}function kS(e,t){const n=t.tagID;switch(n){case d.TD:case d.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=w.IN_ROW);break}case d.TABLE:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),dd(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:break;default:va(e,t)}}function fd(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.OPTION:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e._insertElement(t,z.HTML);break}case d.OPTGROUP:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop(),e._insertElement(t,z.HTML);break}case d.HR:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop(),e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break}case d.INPUT:case d.KEYGEN:case d.TEXTAREA:case d.SELECT:{e.openElements.hasInSelectScope(d.SELECT)&&(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode(),t.tagID!==d.SELECT&&e._processStartTag(t));break}case d.SCRIPT:case d.TEMPLATE:{nn(e,t);break}}}function hd(e,t){switch(t.tagID){case d.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===d.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===d.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop();break}case d.OPTION:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop();break}case d.SELECT:{e.openElements.hasInSelectScope(d.SELECT)&&(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode());break}case d.TEMPLATE:{ar(e,t);break}}}function AS(e,t){const n=t.tagID;n===d.CAPTION||n===d.TABLE||n===d.TBODY||n===d.TFOOT||n===d.THEAD||n===d.TR||n===d.TD||n===d.TH?(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode(),e._processStartTag(t)):fd(e,t)}function SS(e,t){const n=t.tagID;n===d.CAPTION||n===d.TABLE||n===d.TBODY||n===d.TFOOT||n===d.THEAD||n===d.TR||n===d.TD||n===d.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode(),e.onEndTag(t)):hd(e,t)}function IS(e,t){switch(t.tagID){case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:case d.NOFRAMES:case d.SCRIPT:case d.STYLE:case d.TEMPLATE:case d.TITLE:{nn(e,t);break}case d.CAPTION:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{e.tmplInsertionModeStack[0]=w.IN_TABLE,e.insertionMode=w.IN_TABLE,yr(e,t);break}case d.COL:{e.tmplInsertionModeStack[0]=w.IN_COLUMN_GROUP,e.insertionMode=w.IN_COLUMN_GROUP,Ri(e,t);break}case d.TR:{e.tmplInsertionModeStack[0]=w.IN_TABLE_BODY,e.insertionMode=w.IN_TABLE_BODY,Na(e,t);break}case d.TD:case d.TH:{e.tmplInsertionModeStack[0]=w.IN_ROW,e.insertionMode=w.IN_ROW,wa(e,t);break}default:e.tmplInsertionModeStack[0]=w.IN_BODY,e.insertionMode=w.IN_BODY,bt(e,t)}}function vS(e,t){t.tagID===d.TEMPLATE&&ar(e,t)}function pd(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(d.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Pi(e,t)}function NS(e,t){t.tagID===d.HTML?bt(e,t):ta(e,t)}function md(e,t){var n;if(t.tagID===d.HTML){if(e.fragmentContext||(e.insertionMode=w.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===d.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else ta(e,t)}function ta(e,t){e.insertionMode=w.IN_BODY,Ia(e,t)}function wS(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.FRAMESET:{e._insertElement(t,z.HTML);break}case d.FRAME:{e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break}case d.NOFRAMES:{nn(e,t);break}}}function DS(e,t){t.tagID===d.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==d.FRAMESET&&(e.insertionMode=w.AFTER_FRAMESET))}function LS(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.NOFRAMES:{nn(e,t);break}}}function PS(e,t){t.tagID===d.HTML&&(e.insertionMode=w.AFTER_AFTER_FRAMESET)}function RS(e,t){t.tagID===d.HTML?bt(e,t):qu(e,t)}function qu(e,t){e.insertionMode=w.IN_BODY,Ia(e,t)}function OS(e,t){switch(t.tagID){case d.HTML:{bt(e,t);break}case d.NOFRAMES:{nn(e,t);break}}}function MS(e,t){t.chars=We,e._insertCharacters(t)}function FS(e,t){e._insertCharacters(t),e.framesetOk=!1}function gd(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==z.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function BS(e,t){if(Jk(t))gd(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===z.MATHML?J1(t):r===z.SVG&&(eA(t),ed(t)),Di(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function jS(e,t){if(t.tagID===d.P||t.tagID===d.BR){gd(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===z.HTML){e._endTagOutsideForeignContent(t);break}const u=e.treeAdapter.getTagName(r);if(u.toLowerCase()===t.tagName){t.tagName=u,e.openElements.shortenToLength(n);break}}}O.AREA,O.BASE,O.BASEFONT,O.BGSOUND,O.BR,O.COL,O.EMBED,O.FRAME,O.HR,O.IMG,O.INPUT,O.KEYGEN,O.LINK,O.META,O.PARAM,O.SOURCE,O.TRACK,O.WBR;const HS=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,US=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Zc={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function bd(e,t){const n=KS(e),r=l1("type",{handlers:{root:VS,element:$S,text:zS,comment:xd,doctype:qS,raw:WS},unknown:YS}),u={parser:n?new $c(Zc):$c.getFragmentParser(void 0,Zc),handle(o){r(o,u)},stitches:!1,options:t||{}};r(e,u),Pr(u,pn());const a=n?u.parser.document:u.parser.getFragment(),s=Vy(a,{file:u.options.file});return u.stitches&&Sa(s,"comment",function(o,c,l){const h=o;if(h.value.stitch&&l&&c!==void 0){const f=l.children;return f[c]=h.value.stitch,c}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function _d(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function VS(e,t){_d(e.children,t)}function $S(e,t){GS(e,t),_d(e.children,t),XS(e,t)}function zS(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ie.CHARACTER,chars:e.value,location:Cu(e)};Pr(t,pn(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function qS(e,t){const n={type:Ie.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Cu(e)};Pr(t,pn(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ZS(e,t){t.stitches=!0;const n=QS(e);if("children"in e&&"children"in n){const r=bd({type:"root",children:e.children},t.options);n.children=r.children}xd({type:"comment",value:{stitch:n}},t)}function xd(e,t){const n=e.value,r={type:Ie.COMMENT,data:n,location:Cu(e)};Pr(t,pn(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function WS(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Cd(t,pn(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(HS,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function YS(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))ZS(n,t);else{let r="";throw US.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Pr(e,t){Cd(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Je.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Cd(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function GS(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Je.PLAINTEXT)return;Pr(t,pn(e));const r=t.parser.openElements.current;let u="namespaceURI"in r?r.namespaceURI:Qn.html;u===Qn.html&&n==="svg"&&(u=Qn.svg);const a=rk({...e,children:[]},{space:u===Qn.svg?"svg":"html"}),s={type:Ie.START_TAG,tagName:n,tagID:Lr(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Cu(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function XS(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&dk.includes(n)||t.parser.tokenizer.state===Je.PLAINTEXT)return;Pr(t,Ca(e));const r={type:Ie.END_TAG,tagName:n,tagID:Lr(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Cu(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Je.RCDATA||t.parser.tokenizer.state===Je.RAWTEXT||t.parser.tokenizer.state===Je.SCRIPT_DATA)&&(t.parser.tokenizer.state=Je.DATA)}function KS(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Cu(e){const t=pn(e)||{line:void 0,column:void 0,offset:void 0},n=Ca(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function QS(e){return"children"in e?Tr({...e,children:[]}):Tr(e)}function Ed(e){return function(t,n){return bd(t,{...e,file:n})}}const Oi=()=>{const{shopTerms:e}=b.useStorefrontStore(),{isAntistock:t}=b.useGeneralStore();return!(e!=null&&e.showTermsOfServiceOnProduct)||!(e!=null&&e.termsOfService)?null:i.jsxs("div",{className:Mr.container,children:[i.jsx("div",{className:Mr.icon,children:i.jsx(v.Icon,{name:"FileCloud",fill:"var(--text-secondary)"})}),t?i.jsx(fa,{text:e.termsOfService}):i.jsx(ki,{remarkPlugins:[w1],rehypePlugins:[Ed],className:Mr.text,components:{a:({node:n,...r})=>i.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",className:Mr.link,id:"md"}),p:({node:n,...r})=>i.jsx("p",{...r,className:Mr.text,id:"md"})},children:e==null?void 0:e.termsOfService})]})},JS="_securedBySsl_1ng38_2",eI="_text_1ng38_9",ps={securedBySsl:JS,text:eI},Mi=({isAntistock:e})=>i.jsxs("div",{className:ps.securedBySsl,children:[i.jsx("div",{className:ps.iconWrapper,children:i.jsx(v.Icon,{name:"ShieldCheck",fill:"var(--text-secondary)"})}),i.jsx("p",{className:ps.text,id:"md",children:e?"Your data is secured by extended validation SSL certificates (256-bit encryption).":"Your data is secured by extended validation SSL certificates (256-bit encryption). This complies with the strongest payment security standard available today."})]}),tI="_container_152ix_1",nI="_header_152ix_7",rI="_backButton_152ix_13",uI="_title_152ix_22",aI="_cards_152ix_28",sI="_card_152ix_28",iI="_selected_152ix_46",oI="_prioritySelected_152ix_50",cI="_price_152ix_51",lI="_description_152ix_61",$t={container:tI,header:nI,backButton:rI,title:uI,cards:aI,card:sI,selected:iI,prioritySelected:oI,price:cI,description:lI},Wc=(e,t,n)=>e+n*t/100,dI=e=>{if(!e)return!0;try{const t=JSON.parse(e);if(t.blocks&&Array.isArray(t.blocks))return!t.blocks.some(n=>n.text?n.text.replace(/[\s\u00A0\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\u3164]/g,"").length>0:!1)}catch{return e.replace(/[\s\u00A0\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\u3164]/g,"").length===0}return!1},Td=({config:e,totalAmount:t,selected:n,onSelect:r,onBack:u,formatter:a})=>{if(!e)return null;const{priorityReplacement:s,standardReplacement:o}=e,c=!!(s!=null&&s.enabled),l=!!(o!=null&&o.enabled),f=[{key:"PRIORITY",title:(s==null?void 0:s.name)||"Priority Replacement",desc:(s==null?void 0:s.description)||"",price:Wc((s==null?void 0:s.fixedFee)||0,(s==null?void 0:s.feePercentage)||0,t),isPriority:!0,visible:c&&(!l||l)},{key:"STANDARD",title:(o==null?void 0:o.name)||"Standard Replacement",desc:(o==null?void 0:o.description)||"",price:Wc((o==null?void 0:o.fixedFee)||0,(o==null?void 0:o.feePercentage)||0,t),isPriority:!1,visible:c&&l?!0:l},{key:"NONE",title:"No Replacements",desc:i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"• No guaranteed refunds or replacements."}),i.jsx("p",{children:"• No priority support."}),i.jsx("p",{children:"• No dedicated buyer resolution team."})]}),price:0,isPriority:!1,visible:c&&!l}].filter(m=>m.visible);return i.jsxs("div",{className:$t.container,children:[i.jsxs("div",{className:$t.header,children:[i.jsx("button",{type:"button",className:$t.backButton,onClick:u,"aria-label":"Back to payment methods",children:"←"}),i.jsx("h4",{className:$t.title,children:"Protect Your Checkout"})]}),i.jsx("div",{className:$t.cards,children:f.map(m=>i.jsxs("div",{className:b.clx($t.card,{[$t.selected]:n===m.key,[$t.prioritySelected]:n==="PRIORITY"&&m.isPriority}),onClick:()=>r(m.key),role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&r(m.key)},children:[i.jsx("div",{className:$t.title,children:m.title}),i.jsx("div",{className:$t.price,children:a.format(m.price)}),typeof m.desc=="string"?!dI(m.desc)&&i.jsx("div",{className:$t.description,children:i.jsx(fa,{text:m.desc})}):i.jsx("div",{className:$t.description,children:m.desc})]},m.key))})]})},yd=({getPossibleGateways:e,setGateway:t,getDiscordSettings:n,cart:r,products:u,submitCart:a,reset:s,setCustomFieldsToCart:o,totalAndDiscount:c,setDiscordSocialConnectId:l,setPaymentMethod:h,isAntistock:f})=>{var Re;const m=D.useMemo(()=>n(),[]),[p,g]=D.useState([]),{balance:x,setBalance:C}=b.useCustomerDashboardStore(),{token:_}=b.useStorefrontStore(),{general:N}=b.useGeneralStore(),{executeRecaptcha:y}=cu(),{discordInfo:L}=b.useDiscordStore(),{customerEmail:S,setCustomerEmail:I,setUsePriorityReplacement:F,setReplacementConfig:W}=b.useCartStore(),V=L!=null&&L.authorized?L.id:void 0,P=b.useNavigate(),j=D.useMemo(()=>e(),[r.parts]),[M,J]=D.useState(null),[ce,re]=D.useState(!1),[he,xe]=D.useState(null),He=!!((Re=M==null?void 0:M.priorityReplacement)!=null&&Re.enabled),we=ce&&He,[E,G]=D.useState(!1),{setIsOpen:ue}=b.useModalStore(),{notifications:A,setNotifications:te}=b.useNotificationStore();D.useEffect(()=>{const Y=$i(r.parts,u).map(U=>U.type===Pn.Checkbox?{...U,value:String(U.defaultValue)}:U);g([...Y])},[]),D.useEffect(()=>{const R=$i(r.parts,u);g(Y=>{const U=new Map(Y.map(Z=>[Z.name,Z]));return R.map(Z=>{const se=U.get(Z.name);return se&&se.value?{...Z,value:se.value}:Z.type===Pn.Checkbox?{...Z,value:String(Z.defaultValue)}:Z})})},[r.parts,u]),D.useEffect(()=>{_&&(async()=>{const Y=await ia();C(Y)})()},[_]);function oe(R){return R&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(R)}const ne=()=>{const R=[];return p.forEach(Y=>{var U;Y.required&&!((U=Y.value)!=null&&U.toString().trim())&&R.push({message:`Field "${Y.name}" is required.`,status:"error",id:b.v4()})}),R.length>0?(te([...A,...R]),!1):!0},$=async R=>{var se,ge,De,_e;if(R.stopPropagation(),r.gateway==="Balance"&&!_){ue(!0),G(!0);return}if(!ne())return;const Y=!!(M&&((se=M.priorityReplacement)!=null&&se.enabled));if(Y&&!we){re(!0),he===null&&((ge=M==null?void 0:M.priorityReplacement)!=null&&ge.enabled)&&(xe("PRIORITY"),F(!0));return}Y||(De=M==null?void 0:M.standardReplacement)!=null&&De.enabled&&!((_e=M==null?void 0:M.priorityReplacement)!=null&&_e.enabled)&&(he===null&&xe("STANDARD"),F(!1));const U=Object.fromEntries(p.map(de=>[de.name,de.value||""]));o({...U}),V&&m.isEnabled&&l(V);const Z=await y();if(Z){const de=await a(Z),Oe=JSON.parse(localStorage.getItem("orders")||"{}");if(Object.keys(Oe).length>10){const at=Date.now()-864e5;Object.keys(Oe).forEach(_t=>{Oe[_t].createdAt<=at&&delete Oe[_t]})}"order"in de?Oe[de.order.id]={createdAt:Date.now(),fullAccessToken:de.order.fullAccessToken}:Oe[de.id]={createdAt:Date.now(),fullAccessToken:de.fullAccessToken},localStorage.setItem("orders",JSON.stringify(Oe)),P(`/orders/${"order"in de?de.order.id:de.id}/${"order"in de?de.order.fullAccessToken:de.fullAccessToken}`),setTimeout(()=>s(),2e3)}};D.useEffect(()=>{const R=[...j.availableGateways,...j.requiresSignInGateways];if(!R.length)return;let Y=!1;return(async()=>{try{const{data:U}=await el(R);if(Y)return;let Z=null;Array.isArray(U)||(U&&U.replacement?Z=U.replacement:((U==null?void 0:U.priorityReplacement)!==void 0||(U==null?void 0:U.standardReplacement)!==void 0)&&(Z={priorityReplacement:U.priorityReplacement,standardReplacement:U.standardReplacement})),J(Z),W(Z)}catch{}})(),()=>{Y=!0}},[j.availableGateways.join(","),j.requiresSignInGateways.join(",")]),D.useEffect(()=>{var U,Z;if(!M)return;const R=!!((U=M.priorityReplacement)!=null&&U.enabled),Y=!!((Z=M.standardReplacement)!=null&&Z.enabled);!R&&Y&&(xe("STANDARD"),F(!1),re(!1))},[M]);const ee=R=>{xe(R),F(R==="PRIORITY"?!0:R==="STANDARD"?!1:void 0)},ie=D.useMemo(()=>{const R=r.parts[0];if(!R)return"USD";const Y=u.find(Z=>Z.id===R.productId),U=Y==null?void 0:Y.variants.find(Z=>Z.id===R.productVariantId);if(U!=null&&U.gateways&&r.gateway){const Z=U.gateways.find(se=>se.name===r.gateway&&se.overrodePrice);if(Z!=null&&Z.overrodePrice)return Z.overrodePrice.currency}return(U==null?void 0:U.price.currency)||"USD"},[r.parts,r.gateway,u]),ae=D.useMemo(()=>new Intl.NumberFormat("en-US",{style:"currency",currency:ie}),[ie]);return i.jsxs("div",{className:xt.checkoutOperational,style:f?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:[i.jsxs("div",{className:`${xt.innerContainer} ${f?xt.innerContainerAntistock:""}`,children:[f&&!we?i.jsx("h4",{style:{fontSize:"var(--input-label-size)",color:"var(--text-secondary)",paddingBottom:"12px",fontWeight:"400"},children:"Select Payment Method"}):null,r.parts.length>0&&!we&&i.jsx(li,{possibleGateways:j,setGateway:t,setPaymentMethod:h,balance:x,totalAndDiscount:c,onSignInClick:()=>{G(!0),ue(!0)},isAntistock:f}),we?i.jsx("div",{style:{marginTop:"12px"},children:i.jsx(Td,{config:M,totalAmount:c.totalWithDiscount??c.total,selected:he,onSelect:ee,onBack:()=>re(!1),formatter:ae})}):null,!we&&i.jsx("div",{className:b.clx(xt.paymentMethodsSection,{[xt.antistock]:f,[xt.paymentMethodsSectionAntistock]:f}),children:i.jsx(v.Input,{placeholder:"your@email.com",value:S||"",onChange:R=>I(R),disabled:!!_,label:"Email Address"})}),!we&&i.jsx(b0,{customFields:p,setCustomFields:g}),m.isEnabled&&!we&&i.jsxs("div",{className:xt.socialConnectSection,children:[i.jsx("p",{className:xt.socialConnectLabel,id:"md",children:"Social Connect"}),i.jsx("div",{className:xt.socialConnectContent,children:i.jsx(x0,{customerEmail:S||""})})]}),i.jsxs("div",{className:`${xt.continueButton} ${f?xt.continueButtonAntistock:""}`,children:[i.jsx(v.Button,{onClick:$,disabled:!r.gateway||!oe(S||"")||m.isRequired&&!(L!=null&&L.authorized),className:xt.button,children:"Continue to Checkout"}),we?i.jsxs("div",{style:{marginTop:"1rem",display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("div",{className:xt.iconWrapper,children:i.jsx(v.Icon,{name:"Shield",fill:"var(--text-secondary)"})}),i.jsxs("p",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:["Protected by ",(N==null?void 0:N.info.name)||"Shop"," Buyer Protection"]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Oi,{}),i.jsx(Mi,{isAntistock:f})]})]}),!we&&i.jsx(Vn,{className:`${xt.checkoutFooter} ${f?xt.checkoutFooterAntistock:""}`})]}),E&&i.jsx(v.Modal,{close:()=>G(!1),children:i.jsx(C0,{setIsOpen:G})})]})},fI="_bottomSheet_1a6cu_1",hI="_title_1a6cu_8",pI="_contentTitle_1a6cu_12",mI="_contentText_1a6cu_16",gI="_discordMessageTitle_1a6cu_20",bI="_content_1a6cu_12",_I="_section_1a6cu_27",xI="_copyButton_1a6cu_32",CI="_scrollableBox_1a6cu_37",EI="_scrollableBoxAntistock_1a6cu_47",TI="_discordMessage_1a6cu_20",yI="_link_1a6cu_61",kI="_buttonGroup_1a6cu_68",AI="_buttonWrapper_1a6cu_80",SI="_modal_1a6cu_84",II="_modalAntistock_1a6cu_91",vI="_header_1a6cu_96",NI="_copyButtonAntistock_1a6cu_104",st={bottomSheet:fI,title:hI,contentTitle:pI,contentText:mI,discordMessageTitle:gI,content:bI,section:_I,copyButton:xI,scrollableBox:CI,scrollableBoxAntistock:EI,discordMessage:TI,link:yI,buttonGroup:kI,buttonWrapper:AI,modal:SI,modalAntistock:II,header:vI,copyButtonAntistock:NI},kd=({setIsOpen:e,deliveryConfiguration:t})=>{const n=tr(),r=t.type===Fe.Discord,{setIsOpen:u}=b.useModalStore(),{isAntistock:a}=b.useGeneralStore(),s=t.type===Fe.Serial?t.deliveryItems.map(c=>c.serialKey).join(`
109
- `):t.deliveryItems[0].textData,o=()=>{u(!1),a?e(!1):setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:b.clx(st.modal,{[st.modalAntistock]:a}),onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:st.header,children:[i.jsx("h3",{id:"h3",className:st.title,children:a?"View Content":"Thank you for the purchase!"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:st.bottomSheet,children:[i.jsx("div",{className:st.content,children:r?i.jsx("div",{className:st.discordMessage,children:i.jsx("p",{className:st.discordMessageTitle,id:"md",children:"Discord role has been granted"})}):i.jsxs("div",{children:[i.jsxs("div",{className:st.section,children:[!a&&i.jsx("p",{className:st.contentTitle,id:"md",children:"Content"}),!a&&i.jsxs(v.Button,{className:st.copyButton,type:"Secondary",onClick:()=>n(s),children:[i.jsx(v.Icon,{name:"Copy"}),"Copy to Clipboard"]})]}),i.jsx("div",{className:b.clx(st.scrollableBox,{[st.scrollableBoxAntistock]:a}),children:i.jsx("p",{className:st.contentText,id:"md",children:a?i.jsx(fa,{text:s}):i.jsx(ki,{remarkPlugins:[w1],rehypePlugins:[Ed],components:{a:({node:c,...l})=>i.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer",className:st.link})},children:s})})})]})}),a&&i.jsxs(v.Button,{className:st.copyButtonAntistock,type:"Secondary",onClick:()=>n(s),style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"Copy"}),"Copy All"]}),!a&&i.jsx("div",{className:st.buttonGroup,children:i.jsx("div",{className:st.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:o,children:"Close"})})})]})]})},wI="_mt1_1l62z_1",DI="_notifyBlock_1l62z_13",LI="_notifyHeader_1l62z_19",PI="_notifyContent_1l62z_25",RI="_buttonBlock_1l62z_30",OI="_imageBlock_1l62z_34",MI="_imageContainer_1l62z_42",FI="_sectionBlock_1l62z_54",BI="_sectionTitle_1l62z_61",jI="_sectionSubtitle_1l62z_64",HI="_inputContainer_1l62z_69",en={mt1:wI,notifyBlock:DI,notifyHeader:LI,notifyContent:PI,buttonBlock:RI,imageBlock:OI,imageContainer:MI,sectionBlock:FI,sectionTitle:BI,sectionSubtitle:jI,inputContainer:HI},UI=({props:e})=>{const t=tr();return i.jsx("div",{className:en.mt1,children:i.jsxs("div",{className:en.inputContainer,children:[i.jsx(v.Input,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&i.jsx(v.Button,{type:"Secondary",onClick:()=>t(e.text),children:i.jsx(v.Icon,{name:"Copy"})})]})})},VI=({props:e})=>i.jsx(v.Button,{className:en.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),$I=({props:e})=>i.jsx("div",{className:en.imageBlock,children:i.jsx("div",{className:en.imageContainer,children:i.jsx("img",{src:e.src,alt:""})})}),zI=({props:e})=>i.jsxs("div",{className:en.notifyBlock,children:[i.jsxs("div",{className:en.notifyHeader,children:[i.jsx(v.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),i.jsx("p",{children:e.heading})]}),i.jsx("p",{className:en.notifyContent,children:e.content})]}),qI=({props:e})=>{var t;return i.jsxs("div",{className:en.sectionBlock,children:[i.jsx("p",{className:en.sectionTitle,children:e.title}),i.jsx("span",{className:en.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>i.jsx(na,{block:n},r))]})},na=({block:e})=>{switch(e.type){case"Section":return i.jsx(qI,{...e});case"ReadOnlyTextInput":return i.jsx(UI,{...e});case"Notify":return i.jsx(zI,{...e});case"Button":return i.jsx(VI,{...e});case"Image":return i.jsx($I,{...e});default:return null}},ZI="_chargeStatusBlock_12swd_4",WI="_isAntistock_12swd_13",YI="_chargeStatusIcon_12swd_19",GI="_chargeStatusTitle_12swd_27",XI="_chargeStatusDescription_12swd_33",KI="_pickUpButton_12swd_39",QI="_actionButtons_12swd_49",JI="_actionButton_12swd_49",Nt={chargeStatusBlock:ZI,isAntistock:WI,chargeStatusIcon:YI,chargeStatusTitle:GI,chargeStatusDescription:XI,pickUpButton:KI,actionButtons:QI,actionButton:JI},Kn={[ke.Paid]:"Payment Successful",[ke.Pending]:"Payment Pending",[ke.Expired]:"Payment Expired",[ke.Cancelled]:"Payment Cancelled",[ke.NotPaid]:"Payment Failed",[ke.Refunded]:"Payment Refunded"},Ad={[ke.Paid]:"Your payment has successfully been processed. Tap on the button below to be redirected back to our website.",[ke.Pending]:"Your payment is currently pending. We recommend checking back shortly for confirmation.",[ke.Expired]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ke.Cancelled]:"You canceled the warrant. If there are any problems, please contact support",[ke.NotPaid]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ke.Refunded]:"Your payment has been refunded. Please check your payment method for confirmation."},Sd=()=>({[ke.Paid]:i.jsx("div",{className:`${Nt.chargeStatusIcon}`,children:i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"})}),[ke.Pending]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"Clock",fill:"var(--text-warning)"})}),[ke.Expired]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ke.Cancelled]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ke.NotPaid]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ke.Refunded]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-warning)"})})}),Id=({charge:e})=>{var p,g;const t=e.status,n=b.useNavigate(),{shopDomain:r}=b.useStorefrontStore(),{isAntistock:u,general:a}=b.useGeneralStore(),s=D.useRef(),o=!!((p=a==null?void 0:a.info)!=null&&p.disableSupport),c=(g=a==null?void 0:a.info)==null?void 0:g.thirdPartySupportUrl,l=!(o&&!c),[h,f]=b.useSearchParams(),m=()=>{var C,_;if(!((C=e.order)!=null&&C.id))return;const x=h.get("redirectRoute");if((e==null?void 0:e.status)===ke.Paid&&e.redirectUrl&&!s.current){const y=JSON.parse(localStorage.getItem("orders")||"{}")[((_=e==null?void 0:e.order)==null?void 0:_.id)||""];y?window.open(y.fullAccessToken?`${e.redirectUrl}/${y.fullAccessToken}`:`${e.redirectUrl}`,"_self"):window.open(e.redirectUrl,"_self")}(e==null?void 0:e.status)===ke.Paid&&s.current&&n(s.current,{replace:!0}),x&&s&&(s.current=x,h.delete("redirectRoute"),f(h))};return i.jsxs("div",{className:b.clx(Nt.chargeStatusBlock,{[Nt.isAntistock]:u}),children:[Sd()[t],i.jsx("h2",{className:Nt.chargeStatusTitle,children:Kn[t]}),i.jsx("p",{className:Nt.chargeStatusDescription,children:Ad[t]}),t===ke.Paid?i.jsx("div",{className:Nt.pickUpButton,style:u?{justifyContent:"flex-start"}:void 0,children:i.jsxs(v.Button,{onClick:m,style:{width:"100%",maxWidth:"250px",display:"flex",alignItems:"center",gap:"5px"},type:"Secondary",children:[i.jsx(v.Icon,{name:"ArrowLineUpRight"}),u?"View Order":"Pick up Order"]})}):i.jsxs("div",{className:Nt.actionButtons,children:[i.jsx("div",{className:Nt.actionButton,children:i.jsxs(v.Button,{type:"Secondary",onClick:()=>window.open(`https://${r}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),l&&i.jsx("div",{className:Nt.actionButton,children:i.jsxs(v.Button,{type:"Secondary",style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},onClick:()=>{o&&c?window.open(c):u?window.open(`https://${r}/support`):n("/contact")},children:[i.jsx(v.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},ev="_bottomSheet_1x4sq_1",tv="_content_1x4sq_8",nv="_agreementList_1x4sq_11",rv="_agreementItem_1x4sq_16",uv="_warning_1x4sq_23",av="_buttonGroup_1x4sq_31",sv="_buttonWrapper_1x4sq_41",iv="_fullWidthButton_1x4sq_44",ov="_modal_1x4sq_48",cv="_header_1x4sq_55",zt={bottomSheet:ev,content:tv,agreementList:nv,agreementItem:rv,warning:uv,buttonGroup:av,buttonWrapper:sv,fullWidthButton:iv,modal:ov,header:cv},vd=({setIsOpen:e,price:t})=>{const[n,r]=D.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:zt.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:zt.header,children:[i.jsx("h3",{id:"h3",children:"Note"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:zt.bottomSheet,children:[i.jsxs("div",{className:zt.content,children:[i.jsxs("div",{className:zt.agreementList,children:[i.jsxs("label",{className:zt.agreementItem,children:[i.jsx(v.CheckboxSettings,{value:n.agreeToSendAsFF,onChange:s=>r({...n,agreeToSendAsFF:s})}),i.jsx("p",{children:"I agree to send the payment as friends & family"})]}),i.jsxs("label",{className:zt.agreementItem,children:[i.jsx(v.CheckboxSettings,{value:n.agreeToSend,onChange:s=>r({...n,agreeToSend:s})}),i.jsxs("p",{children:["I agree to send the payment of ",b.formatPrice(t)," ",t.currency]})]}),i.jsxs("label",{className:zt.agreementItem,children:[i.jsx(v.CheckboxSettings,{value:n.agreeToNotAddNote,onChange:s=>r({...n,agreeToNotAddNote:s})}),i.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),i.jsx("div",{className:zt.warning,children:i.jsxs("p",{children:["Please note that you are required to send the exact payment of ",b.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),i.jsxs("div",{className:zt.buttonGroup,children:[i.jsx("div",{className:zt.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",children:i.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),i.jsx("div",{className:zt.fullWidthButton,children:i.jsx(v.Button,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:a,children:"Continue to Payment"})})]})]})]})},lv="_chargeItemsContainer_vynct_5",dv="_chargeItemsInner_vynct_18",fv="_productsContainer_vynct_25",hv="_antistockLayout_vynct_40",pv="_mainContentAntistock_vynct_53",mv="_desktopTrackPayment_vynct_64",gv="_desktopFooter_vynct_73",bv="_footerContainerAntistock_vynct_94",_v="_chargeHeader_vynct_107",xv="_chargeTitle_vynct_115",Cv="_chargeDescription_vynct_121",Ev="_copyButton_vynct_127",Tv="_productsList_vynct_139",yv="_footerContainer_vynct_94",kt={chargeItemsContainer:lv,chargeItemsInner:dv,productsContainer:fv,antistockLayout:hv,mainContentAntistock:pv,desktopTrackPayment:mv,desktopFooter:gv,footerContainerAntistock:bv,chargeHeader:_v,chargeTitle:xv,chargeDescription:Cv,copyButton:Ev,productsList:Tv,footerContainer:yv},Nd=({charge:e})=>{var s;const t=tr(),{isAntistock:n}=b.useGeneralStore(),r=(e==null?void 0:e.price.currency)||"USD",u=new Intl.NumberFormat("en-US",{style:"currency",currency:r}),a=D.useMemo(()=>{var o;return((o=e==null?void 0:e.order)==null?void 0:o.partOrders.map(c=>{var l,h,f,m;return{id:(c==null?void 0:c.id)||0,image:c.productWithVariant.image,name:(()=>{var x,C;const p=((x=c.productWithVariant)==null?void 0:x.name)||"",g=((C=c.productWithVariant)==null?void 0:C.variantName)||"";return!p&&!g?"":!g||p===g?p:p?`${p} (${g})`:g})(),description:"",price:{quantity:c.quantity,amount:((l=c.productWithVariant)==null?void 0:l.price.amount)||0,currency:(h=c.productWithVariant)==null?void 0:h.price.currency},subscriptionSettings:(f=e.order)!=null&&f.subscriptionOrderId?(m=c.productWithVariant)==null?void 0:m.subscriptionSettings:null}}))||[]},[e]);return i.jsx("div",{className:kt.chargeItemsContainer,children:i.jsxs("div",{className:kt.chargeItemsInner,children:[i.jsx(ba,{expiresAt:e==null?void 0:e.expiresAt}),i.jsxs("div",{className:`${kt.productsContainer} ${n?kt.antistockLayout:""}`,children:[(e==null?void 0:e.name)&&i.jsxs("header",{className:kt.chargeHeader,children:[i.jsxs("div",{children:[i.jsx("h1",{className:kt.chargeTitle,id:"h5",children:e.name}),e.description&&i.jsx("p",{className:kt.chargeDescription,id:"md",children:e.description})]}),((s=e.order)==null?void 0:s.id)&&!n&&i.jsxs(v.Button,{type:"Secondary",className:kt.copyButton,onClick:()=>{var o;return t(((o=e.order)==null?void 0:o.id)||"")},children:[i.jsx(v.Icon,{name:"Copy"}),"Copy Order ID"]})]}),i.jsxs("div",{className:n?kt.mainContentAntistock:"",style:n?void 0:{flex:1},children:[!!a.length&&i.jsx("div",{className:kt.productsList,children:a.map(o=>i.jsx(_a,{product:o},o.id))}),i.jsx(Sr,{formatter:u,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1}),n&&e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:kt.desktopTrackPayment,children:i.jsx(Da,{timeline:e.timeline})}),i.jsx(Vn,{className:kt.desktopFooter})]})]}),!n&&i.jsx(Vn,{className:`${kt.footerContainer} ${n?kt.footerContainerAntistock:""}`})]})]})})},kv="_checkoutOrderMainData_hqf60_1",Av="_orderDetailRow_hqf60_6",Sv="_chargeIdRow_hqf60_16",Iv="_detailLabel_hqf60_25",vv="_detailValue_hqf60_29",Nv="_chargeIdContainer_hqf60_33",wv="_chargeId_hqf60_16",Dv="_copyIcon_hqf60_51",et={checkoutOrderMainData:kv,orderDetailRow:Av,chargeIdRow:Sv,detailLabel:Iv,detailValue:vv,chargeIdContainer:Nv,chargeId:wv,copyIcon:Dv},Fi=({lastUpdate:e,invoiceId:t,email:n,paymentType:r,orderId:u})=>{const a=tr(),[s,o]=D.useState(null),c=s==null?void 0:s.find(h=>h.name===r);D.useEffect(()=>{s||(async()=>{if(!r)return;const m=await lu([r]);o(m)})()},[r,s]);const l=h=>{const f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=h.getDate().toString().padStart(2,"0"),p=f[h.getMonth()],g=h.getFullYear(),x=h.getHours(),C=h.getMinutes().toString().padStart(2,"0"),_=h.getSeconds().toString().padStart(2,"0"),N=x>=12?"PM":"AM",y=(x%12||12).toString().padStart(2,"0");return`${p} ${m}, ${g} at ${y}:${C}:${_} ${N}`};return i.jsxs("div",{className:et.checkoutOrderMainData,children:[i.jsxs("div",{className:et.orderDetailRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Last Updated"}),i.jsx("p",{className:et.detailValue,id:"md",children:l(new Date(e))})]}),r&&i.jsxs("div",{className:et.orderDetailRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Payment Type"}),i.jsx("p",{className:et.detailValue,id:"md",children:c==null?void 0:c.displayName})]}),i.jsxs("div",{className:et.orderDetailRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Email"}),i.jsx("p",{className:et.detailValue,id:"md",children:n})]}),t&&i.jsxs("div",{className:et.chargeIdRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Charge ID"}),i.jsxs("div",{className:et.chargeIdContainer,children:[i.jsx("p",{className:et.chargeId,id:"md",children:t}),i.jsx("div",{className:et.copyIcon,onClick:()=>a(t),children:i.jsx(v.Icon,{name:"Copy"})})]})]}),u&&i.jsxs("div",{className:et.chargeIdRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Order ID"}),i.jsxs("div",{className:et.chargeIdContainer,children:[i.jsx("p",{className:et.chargeId,id:"md",children:u}),i.jsx("div",{className:et.copyIcon,onClick:()=>a(u),children:i.jsx(v.Icon,{name:"Copy"})})]})]})]})},Lv="_bottomSheet_1yai1_1",Pv="_formContainer_1yai1_8",Rv="_error_1yai1_14",Ov="_buttonGroup_1yai1_18",Mv="_buttonWrapper_1yai1_28",Fv="_fullWidthButton_1yai1_31",Bv="_modal_1yai1_41",jv="_header_1yai1_48",vn={bottomSheet:Lv,formContainer:Pv,error:Rv,buttonGroup:Ov,buttonWrapper:Mv,fullWidthButton:Fv,modal:Bv,header:jv},wd=({chargeId:e,setIsOpen:t})=>{const[n,r]=D.useState(""),[u,a]=D.useState(""),{setIsOpen:s}=b.useModalStore(),o=h=>{try{return new URL(h),!0}catch{return!1}},c=async h=>{if(h.preventDefault(),!n){a("The link field cannot be empty.");return}if(!o(n)){a("Please enter a valid URL");return}await e2({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},l=()=>{s(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:vn.modal,onClick:h=>h.stopPropagation(),children:[i.jsxs("div",{className:vn.header,children:[i.jsx("h3",{id:"h3",children:"CashApp Verify"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:l,fill:"var(--text-primary)"})]}),i.jsx("form",{onSubmit:c,children:i.jsxs("div",{className:vn.bottomSheet,children:[i.jsx("div",{className:vn.formContainer,children:i.jsxs("div",{children:[i.jsx(v.Input,{value:n,onChange:h=>{r(h),a("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),u&&i.jsx("p",{className:vn.error,children:u})]})}),i.jsxs("div",{className:vn.buttonGroup,children:[i.jsx("div",{className:vn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:l,children:"Cancel"})}),i.jsx("div",{className:vn.fullWidthButton,children:i.jsx(v.Button,{type:"Primary",children:"Verify"})})]})]})})]})},Hv="_trackPaymentContainer_fk3b6_1",Uv="_trackPaymentBox_fk3b6_5",Vv="_trackPaymentBoxActive_fk3b6_18",$v="_trackPaymentHeader_fk3b6_23",zv="_trackPaymentTitle_fk3b6_27",qv="_trackPaymentTimeline_fk3b6_33",Zv="_trackPaymentItem_fk3b6_42",Wv="_itemHeader_fk3b6_48",Yv="_itemDate_fk3b6_55",Gv="_itemMessage_fk3b6_59",Xv="_trackPaymentToggle_fk3b6_64",Kv="_trackPaymentToggleContent_fk3b6_75",Qv="_trackPaymentToggleText_fk3b6_81",Jv="_antistock_fk3b6_88",Ct={trackPaymentContainer:Hv,trackPaymentBox:Uv,trackPaymentBoxActive:Vv,trackPaymentHeader:$v,trackPaymentTitle:zv,trackPaymentTimeline:qv,trackPaymentItem:Zv,itemHeader:Wv,itemDate:Yv,itemMessage:Gv,trackPaymentToggle:Xv,trackPaymentToggleContent:Kv,trackPaymentToggleText:Qv,antistock:Jv},Yc=(e,t)=>{const n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),u=e.getFullYear(),a=e.getHours(),s=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0"),c=a>=12?"PM":"AM",l=(a%12||12).toString().padStart(2,"0");return t==="dd.MM.yyyy"?`${n}.${r}.${u}`:t==="hh:mm:ss aa"?`${l}:${s}:${o} ${c}`:""},eN={[ke.Paid]:{displayName:Kn[ke.Paid],displayMessage:"The invoice has been completed and the product has been delivered.",type:"success"},[ke.Pending]:{displayName:Kn[ke.Pending],displayMessage:"The invoice has been created and we are now waiting to receive the payment.",type:"warning"},[ke.Expired]:{displayName:Kn[ke.Expired],displayMessage:"Your payment has expired due to the payment not being sent in time.",type:"error"},[ke.Cancelled]:{displayName:Kn[ke.Cancelled],displayMessage:"The order has been canceled. The payment was not sent within the time limit.",type:"error"},[ke.NotPaid]:{displayName:"New",displayMessage:"The charge has been created and is awaiting payment.",type:"success"},[ke.Refunded]:{displayName:Kn[ke.Refunded],displayMessage:"Your order was refunded. Please check your payment method for confirmation.",type:"warning"}},tN=({date:e,chargeStatus:t})=>(console.log(t),i.jsxs("div",{className:Ct.trackPaymentItem,children:[i.jsxs("div",{className:Ct.itemHeader,children:[i.jsx("p",{className:Ct.itemDate,id:"md-bold",children:Yc(new Date(e),"dd.MM.yyyy")}),i.jsx("p",{className:Ct.itemTime,id:"md",children:Yc(new Date(e),"hh:mm:ss aa")})]}),i.jsx("p",{className:Ct.itemMessage,id:"md",children:eN[t].displayMessage})]})),Da=({timeline:e,className:t})=>{const[n,r]=D.useState(!1),{isAntistock:u}=b.useGeneralStore();return i.jsxs("div",{className:b.clx(Ct.trackPaymentContainer,t,{[Ct.antistock]:u}),children:[i.jsxs("div",{className:`${Ct.trackPaymentBox} ${n?Ct.trackPaymentBoxActive:""}`,style:u?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsx("header",{className:Ct.trackPaymentHeader,children:i.jsx("h2",{className:Ct.trackPaymentTitle,id:"h4",children:"Track Payment"})}),i.jsx("div",{className:Ct.trackPaymentTimeline,children:Object.keys(e).map(a=>i.jsx(tN,{date:e[a],chargeStatus:a},a))})]}),i.jsxs("div",{className:Ct.trackPaymentToggle,onClick:()=>r(!n),style:u?{padding:"1.25rem",border:"1px solid var(--border-secondary)",borderRadius:"var(--border-radius)"}:void 0,children:[i.jsxs("div",{className:Ct.trackPaymentToggleContent,children:[u?null:i.jsx(v.Icon,{name:"MagnifyingGlass",fill:"var(--text-secondary)"}),i.jsx("p",{className:Ct.trackPaymentToggleText,id:"h5",children:"Track Payment"})]}),i.jsx(v.Icon,{name:"CaretRight",fill:"var(--text-primary)",width:16,height:16})]})]})},nN="_dateTime_1dnnn_11",rN="_tableItem_1dnnn_25",uN="_status_1dnnn_29",aN="_statusInProgress_1dnnn_38",sN="_statusText_1dnnn_42",iN="_statusIcon_1dnnn_46",oN="_statusInProgressText_1dnnn_52",cN="_statusInProgressIcon_1dnnn_57",lN="_message_1dnnn_63",Et={dateTime:nN,tableItem:rN,status:uN,statusInProgress:aN,statusText:sN,statusIcon:iN,statusInProgressText:oN,statusInProgressIcon:cN,message:lN},Dd=({item:e})=>{const[t,n]=b.extractDateAndTime(e.createdAt),r=b.useNavigate(),a=(s=>s.length>30?s.slice(0,27)+"...":s)(e.latestMessage);return i.jsxs(D.Fragment,{children:[i.jsx(ct,{className:Et.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("span",{id:"md",children:["#",e.id]})}),i.jsx(ct,{className:b.clx(Et.message,Et.tableItem),onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx("span",{id:"md",children:a})}),i.jsx(ct,{className:Et.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:t}),i.jsx("div",{className:Et.dateTime,id:"md",children:n})]})}),i.jsx(ct,{className:Et.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx(dN,{status:e.status})})]},e.id)},dN=({status:e})=>i.jsxs("div",{className:b.clx(Et.status,{[Et.statusClosed]:e==="CLOSED",[Et.statusInProgress]:e!=="CLOSED"}),children:[i.jsx("div",{className:b.clx(Et.statusIcon,{[Et.statusInProgressIcon]:e!=="CLOSED"}),children:e==="CLOSED"?i.jsx(v.Icon,{name:"CheckCircle",className:Et.statusIcon}):i.jsx(v.Icon,{name:"Clock",className:Et.statusInProgressIcon})}),i.jsx("div",{className:b.clx(Et.statusText,{[Et.statusInProgressText]:e!=="CLOSED"}),id:"md",children:e==="CLOSED"?"Closed":"In Progress"})]}),fN="_tableContainer_1eytq_1",hN="_table_1eytq_1",pN="_productInfo_1eytq_19",mN="_productImage_1eytq_26",gN="_productName_1eytq_35",bN="_expirationDate_1eytq_46",_N="_overflowItem_1eytq_51",xN="_gatewayContainer_1eytq_57",CN="_gatewayImage_1eytq_62",EN="_dateTime_1eytq_67",TN="_tableLoader_1eytq_72",yN="_tableItem_1eytq_81",ht={tableContainer:fN,table:hN,productInfo:pN,productImage:mN,productName:gN,expirationDate:bN,overflowItem:_N,gatewayContainer:xN,gatewayImage:CN,dateTime:EN,tableLoader:TN,tableItem:yN},kN="_badge_1oac8_1",AN="_active_1oac8_12",SN="_awaitingPayment_1oac8_17",IN="_cancelled_1oac8_22",vN="_changedGateway_1oac8_27",NN="_expired_1oac8_32",wN="_rial_1oac8_37",DN="_pastDue_1oac8_42",LN="_replaced_1oac8_47",Tn={badge:kN,active:AN,awaitingPayment:SN,cancelled:IN,changedGateway:vN,expired:NN,rial:wN,pastDue:DN,replaced:LN},PN=()=>({[En.ACTIVE]:{icon:i.jsx(v.Icon,{name:"CheckCircle"}),title:"Active",className:Tn.active},[En.AWAITING_PAYMENT]:{icon:i.jsx(v.Icon,{name:"Clock"}),title:"Awaiting Payment",className:Tn.awaitingPayment},[En.CANCELLED]:{icon:i.jsx(v.Icon,{name:"XCircle"}),title:"Cancelled",className:Tn.cancelled},[En.CHANGED_GATEWAY]:{icon:i.jsx(v.Icon,{name:"Warning"}),title:"Upgraded",className:Tn.changedGateway},[En.EXPIRED]:{icon:i.jsx(v.Icon,{name:"XCircle"}),title:"Expired",className:Tn.expired},[En.RIAL]:{icon:i.jsx(v.Icon,{name:"Clock"}),title:"Active",className:Tn.rial},[En.PAST_DUE]:{icon:i.jsx(v.Icon,{name:"Clock"}),title:"Trial",className:Tn.pastDue},[En.REPLACED]:{icon:i.jsx(v.Icon,{name:"Warning"}),title:"Replaced",className:Tn.replaced}}),Bi=({status:e})=>{const t=PN()[e];return i.jsxs("div",{className:`${Tn.badge} ${t.className}`,children:[t.icon,i.jsx("p",{id:"md",children:t.title})]})},RN=(e,t)=>{const n=t.find(r=>r.name===e);return n?i.jsxs("div",{className:ht.gatewayContainer,children:[i.jsx("img",{alt:n.displayName,src:b.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:ht.gatewayImage}),i.jsx("div",{children:n.displayName})]}):null},ON=({item:e,gatewaysDetail:t})=>{const[n,r]=b.extractDateAndTime(e.createdAt),[u]=b.extractDateAndTime(e.activeTo||""),a=tr();return i.jsxs(D.Fragment,{children:[i.jsx(ct,{children:i.jsxs("div",{className:ht.productInfo,children:[i.jsx("div",{className:ht.productImage,children:i.jsx(v.Icon,{name:"Image",width:20,height:20,fill:"var(--text-secondary)"})}),i.jsxs("div",{children:[i.jsx(b.NavLink,{to:`/subscriptions/${e.id}/${e.accessToken}`,className:ht.productName,id:"md",children:e.productName}),i.jsx("p",{className:ht.expirationDate,children:e.activeTo&&`expires at ${u}`})]})]})}),i.jsx(ct,{className:ht.overflowItem,onClick:()=>a(e.id),children:e.id}),i.jsx(ct,{children:i.jsx(Bi,{status:e.status})}),i.jsx(ct,{children:b.formatPrice(e.price)}),i.jsx(ct,{children:RN(e.gatewayName,t)}),i.jsx(ct,{children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:n}),i.jsx("div",{className:ht.dateTime,id:"md",children:r})]})})]},e.id)},Ld=({subscriptions:e,gatewaysDetail:t,totalCount:n,page:r,setPage:u})=>{const s=!(!(e!=null&&e.length)||!t);return i.jsxs("div",{className:ht.tableContainer,children:[i.jsxs(ga,{className:ht.table,children:[i.jsx(wt,{className:ht.tableItem,children:"Product name"}),i.jsx(wt,{className:ht.tableItem,children:"ID"}),i.jsx(wt,{className:ht.tableItem,children:"Status"}),i.jsx(wt,{className:ht.tableItem,children:"Value"}),i.jsx(wt,{className:ht.tableItem,children:"Payment"}),i.jsx(wt,{className:ht.tableItem,children:"Date"}),s&&(e==null?void 0:e.map(o=>i.jsx(ON,{item:o,gatewaysDetail:t},o.id)))]}),!s&&i.jsx("div",{className:ht.tableLoader,children:i.jsx(v.Loader,{})}),s&&i.jsx(pu,{currentPage:r,totalCount:n,onPageChange:u})]})},MN="_pageLoading_1rj3k_2",FN="_title_1rj3k_11",BN="_description_1rj3k_17",ms={pageLoading:MN,title:FN,description:BN},jN=({description:e,title:t})=>i.jsxs("div",{className:ms.pageLoading,children:[i.jsx("div",{children:i.jsx(v.Loader,{})}),i.jsx("h1",{className:ms.title,children:t}),i.jsx("p",{className:ms.description,children:e})]}),HN="_container_1opbn_1",UN="_productDetails_1opbn_8",VN="_imageContainer_1opbn_14",$N="_image_1opbn_14",zN="_textContainer_1opbn_32",qN="_header_1opbn_40",ZN="_title_1opbn_46",WN="_price_1opbn_53",YN="_badgeContainer_1opbn_57",GN="_description_1opbn_61",un={container:HN,productDetails:UN,imageContainer:VN,image:$N,textContainer:zN,header:qN,title:ZN,price:WN,badgeContainer:YN,description:GN},Pd=({subscription:e})=>i.jsxs("div",{className:un.container,children:[i.jsxs("div",{className:un.productDetails,children:[i.jsx("div",{className:un.imageContainer,children:e!=null&&e.image?i.jsx("img",{className:un.image,src:b.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):i.jsx(v.Icon,{name:"Image"})}),i.jsxs("div",{className:un.textContainer,children:[i.jsx("div",{className:un.header,children:i.jsx("h2",{className:un.title,children:e.name})}),i.jsxs("p",{className:un.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx("div",{className:un.badgeContainer,children:i.jsx(Bi,{status:e.status})})]}),e.description&&i.jsx(ki,{className:un.description,children:e.description})]}),XN="_card_69liy_1",KN="_price_69liy_10",QN="_interval_69liy_17",JN="_name_69liy_22",ew="_description_69liy_28",tw="_currentPlan_69liy_32",nw="_selectButton_69liy_45",rw="_progressSection_69liy_50",uw="_progressLabel_69liy_54",aw="_bottomSheet_69liy_60",sw="_title_69liy_69",iw="_typeSelector_69liy_80",ow="_typeOption_69liy_90",cw="_active_69liy_100",lw="_saveTag_69liy_108",dw="_planSelector_69liy_117",fw="_modal_69liy_127",hw="_inactive_69liy_148",pw="_notMounted_69liy_151",mw="_closeButton_69liy_157",Ke={card:XN,price:KN,interval:QN,name:JN,description:ew,currentPlan:tw,selectButton:nw,progressSection:rw,progressLabel:uw,bottomSheet:aw,title:sw,typeSelector:iw,typeOption:ow,active:cw,saveTag:lw,planSelector:dw,modal:fw,inactive:hw,notMounted:pw,closeButton:mw},gw=({variant:e,onSelect:t,isCurrent:n})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",u=e.subscriptionSettings.price.amount.toFixed(2),a=e.subscriptionSettings.recurringIntervalDays,s=10;return i.jsxs("div",{className:Ke.card,onClick:t,children:[i.jsxs("h2",{className:Ke.price,children:["$",u," ",i.jsxs("span",{className:Ke.interval,children:["/ ",r]})]}),i.jsx("h3",{className:Ke.name,children:e.name}),e.description&&i.jsx("p",{className:Ke.description,children:e.description}),n?i.jsxs("div",{className:Ke.currentPlan,children:[i.jsx(v.Icon,{name:"Check"}),"Your current Plan"]}):i.jsx(v.Button,{type:"Secondary",className:Ke.selectButton,children:"Select"}),n&&i.jsxs("div",{className:Ke.progressSection,children:[i.jsx(p0,{percent:s/a*100,disablePercentLabel:!0}),i.jsxs("p",{className:Ke.progressLabel,children:["Used: ",s," of ",a," days"]})]})]})},Rd=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,u]=D.useState(null),[a,s]=D.useState(null),[o,c]=D.useState(null),{id:l,accessToken:h}=b.useParams(),[f,m]=D.useState(!1),[p,g]=D.useState(!1),{setIsOpen:x}=b.useModalStore();D.useEffect(()=>{e&&m(!0)},[e]);const C=()=>{t(!1)},[_,N]=D.useState(null);D.useEffect(()=>{l&&h&&(async()=>{if(l&&h){const{data:I}=await T2({id:l,accessToken:h});N(I)}})()},[l,h]),D.useEffect(()=>{var S;if(_!=null&&_.data.types[0]){const I=(S=_.data.types.flatMap(F=>F.productVariants).find(F=>F.data.id===(n==null?void 0:n.variantId)))==null?void 0:S.data;I&&(c(I),s(I))}},[_,n]),D.useEffect(()=>{_!=null&&_.data.types[0]&&u(_==null?void 0:_.data.types[0])},[_==null?void 0:_.data.types]);const y=S=>{u(S),s(null)},L=S=>{s(S),x(!0),g(!0)};return i.jsxs("div",{className:b.clx(Ke.modal,{[Ke.active]:e,[Ke.inactive]:!e&&f,[Ke.notMounted]:!f}),onClick:S=>S.stopPropagation(),children:[i.jsx(v.Icon,{name:"X",onClick:C,hoverable:!0,className:Ke.closeButton,fill:"var(--text-primary)"}),i.jsxs("div",{className:Ke.bottomSheet,children:[i.jsx("h3",{id:"h3",className:Ke.title,children:"Change Plan"}),i.jsx("p",{className:Ke.description,children:_==null?void 0:_.data.description}),i.jsx("div",{className:Ke.typeSelector,children:_==null?void 0:_.data.types.map(S=>i.jsxs("div",{className:b.clx(Ke.typeOption,{[Ke.active]:(r==null?void 0:r.id)===S.id}),onClick:()=>y(S),children:[S.name,S.name==="Yearly"&&i.jsx("span",{className:Ke.saveTag,children:"Save %"})]},S.id))}),r&&i.jsx("div",{className:Ke.planSelector,children:r.productVariants.map(S=>i.jsx(gw,{variant:S.data,isSelected:(a==null?void 0:a.id)===S.data.id,isCurrent:(o==null?void 0:o.id)===S.data.id,onSelect:()=>L(S.data)},S.data.id))})]}),p&&a&&n&&i.jsx(v.Modal,{close:()=>{g(!1)},children:i.jsx(jd,{setIsOpen:g,selectedVariant:a,subscription:n})})]})},bw="_container_nb625_1",_w="_title_nb625_11",xw="_subtitle_nb625_16",Cw="_info_nb625_20",ju={container:bw,title:_w,subtitle:xw,info:Cw},Od=()=>{const{subscription:e}=b.useSubscriptionStore(),[t,n]=b.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,u]=D.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ju.container,children:[i.jsxs("div",{className:ju.info,children:[i.jsx("p",{className:ju.title,children:"Expiration Date"}),i.jsxs("p",{className:ju.subtitle,children:[t," at ",n]})]}),i.jsx(v.Button,{type:"Special",onClick:s=>{s.stopPropagation(),a(!0),u(!0)},children:"Extend"})]}),r&&i.jsx(v.Modal,{close:()=>u(!1),children:i.jsx(zd,{setIsOpen:u})})]})},Ew="_couponContainer_1sspa_1",Tw="_iconWrapper_1sspa_10",yw="_details_1sspa_21",kw="_title_1sspa_25",Aw="_progress_1sspa_29",Sw="_foreverText_1sspa_34",lr={couponContainer:Ew,iconWrapper:Tw,details:yw,title:kw,progress:Aw,foreverText:Sw},Md=({coupon:e,currency:t})=>{const n=e.isFixed?b.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?b.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return i.jsxs("div",{className:lr.couponContainer,children:[i.jsx("div",{className:lr.iconWrapper,children:i.jsx(v.Icon,{name:"CheckCircle"})}),i.jsxs("div",{className:lr.details,children:[i.jsxs("p",{className:lr.title,children:[e.name,", ",n," discount"]}),i.jsx("div",{className:lr.progress,children:i.jsx(p0,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),i.jsx("p",{className:lr.foreverText,children:"Forever discount code"})]})]})},Iw="_paymentMethodContainer_1g0da_4",vw="_paymentMethodTitle_1g0da_15",Nw="_activeMethod_1g0da_20",ww="_noMethod_1g0da_28",Dw="_activeMethodPaymentMethod_1g0da_37",Lw="_paymentMethodLogo_1g0da_47",Pw="_paymentMethodNumber_1g0da_57",Rw="_method_1g0da_61",Mn={paymentMethodContainer:Iw,paymentMethodTitle:vw,activeMethod:Nw,noMethod:ww,activeMethodPaymentMethod:Dw,paymentMethodLogo:Lw,paymentMethodNumber:Pw,method:Rw},Ow="_paymentMethods_1gev0_1",Mw="_modal_1gev0_14",Fw="_header_1gev0_28",Bw="_content_1gev0_37",Yn={paymentMethods:Ow,modal:Mw,header:Fw,content:Bw},jw=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:u}=b.useSubscriptionStore();if(!r)return null;const{id:a}=b.useParams(),s=b.useNavigate(),{notifications:o,setNotifications:c}=b.useNotificationStore(),{setPaymentMethod:l,setGateway:h,cart:f}=ou(),{setIsOpen:m}=b.useModalStore();async function p(){if(g(),t(!0),a&&r){const{data:x}=await C2(a,f.gateway);x.isReconnectPaymentNeeded?s(`/charges/${x.chargeId}`):(c([...o,{status:"success",id:b.v4(),message:"Your action has been successfully completed"}]),u({...r,gatewayName:f.gateway}))}else c([...o,{status:"error",id:b.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function g(){m(!1),setTimeout(()=>{n(!1)},300)}return i.jsxs("div",{className:Yn.modal,onClick:x=>{x.stopPropagation()},children:[i.jsxs("div",{className:Yn.header,children:[i.jsx("h3",{id:"h3",className:Yn.title,children:"Choose Payment Method"}),i.jsx(v.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Yn.content,children:[(r==null?void 0:r.availableGateways)&&i.jsx(li,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:h,setPaymentMethod:l,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>s("/customer-dash")}),i.jsxs("div",{className:Yn.paymentMethods,children:[i.jsx("div",{className:Yn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Cancel"})}),i.jsx("div",{className:Yn.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",disabled:!f.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},Hw="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",Fd=()=>{var g,x,C;const{subscription:e}=b.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=ou(),r=b.useNavigate(),[u,a]=D.useState(null),[s,o]=D.useState(!1),[c,l]=D.useState(!1),{setIsOpen:h}=b.useModalStore();if(!e)return null;const[f,m]=D.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return D.useEffect(()=>{(async()=>{const N=await lu(e.availableGateways);a(N)})()},[]),D.useEffect(()=>{t.gateway!==f&&m(t.gateway)},[t.gateway]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Mn.paymentMethodContainer,children:[i.jsxs("div",{children:[i.jsx("p",{className:Mn.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&i.jsx(Uw,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f==="Balance"&&i.jsx(oi,{gateway:f,gatewayDisplayName:f,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!f&&i.jsx("span",{className:Mn.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f&&i.jsx("div",{className:Mn.activeMethod,children:u&&i.jsx(ci,{align:"row",gatewayLogoCfId:(g=u.find(_=>_.name===f))==null?void 0:g.logoCfImageId,gatewayDisplayName:(x=u.find(_=>_.name===f))==null?void 0:x.displayName,gateway:f,poweredByLogoCfId:(C=u.find(_=>_.name===f))==null?void 0:C.poweredByImageCfImageId,className:Mn.activeMethodPaymentMethod,selected:p===f,onSelect:_=>{n(_)}},f)})]}),i.jsx(v.Button,{type:"Special",onClick:_=>{_.stopPropagation(),h(!0),l(!0)},children:t.gateway?"Change":"Manage"})]}),c&&i.jsx(v.Modal,{close:()=>l(!1),children:i.jsx(jw,{setIsLoading:o,setIsOpen:l})})]})},Uw=({gatewayInfo:e})=>{var t,n,r,u,a;return i.jsxs("div",{className:Mn.method,children:[i.jsxs("div",{className:Mn.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&i.jsx(rm,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&i.jsx("img",{src:Hw,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((u=e.card)==null?void 0:u.brand.toLowerCase())!=="mastercard"&&i.jsx(v.Icon,{name:"CreditCard",width:22})]}),i.jsxs("p",{className:Mn.paymentMethodNumber,children:["•••• •••• •••• ",(a=e.card)==null?void 0:a.last4]})]})},Vw="_subscriptionProductContainer_83ibx_4",$w="_subscriptionProductImage_83ibx_15",zw="_subscriptionProductInfo_83ibx_32",qw="_name_83ibx_37",Zw="_price_83ibx_40",Ur={subscriptionProductContainer:Vw,subscriptionProductImage:$w,subscriptionProductInfo:zw,name:qw,price:Zw},Bd=({subscription:e,id:t,accessToken:n})=>{const[r,u]=D.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Ur.subscriptionProductContainer,onClick:s=>s.stopPropagation(),children:[i.jsx("div",{className:Ur.subscriptionProductImage,children:e!=null&&e.image?i.jsx("img",{src:b.convertCfImageIdToUrl(e.image.cfId)}):i.jsx(v.Icon,{name:"Image"})}),i.jsxs("div",{className:Ur.subscriptionProductInfo,children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h2",{className:Ur.name,children:e.name})}),i.jsxs("p",{className:Ur.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx(v.Button,{type:"Special",onClick:s=>{s.preventDefault(),u(!0),a(!0)},children:"Cancel"})]}),r&&i.jsx(v.Modal,{close:()=>u(!1),children:i.jsx(qd,{accessToken:n,id:t,isOpen:r,setIsOpen:u})})]})},Ww="_content_5ctxw_1",Yw="_selectedPlan_5ctxw_37",Gw="_planName_5ctxw_44",Xw="_description_5ctxw_48",Kw="_price_5ctxw_51",Qw="_buttonGroup_5ctxw_79",Jw="_buttonWrapper_5ctxw_84",eD="_modal_5ctxw_88",tD="_header_5ctxw_95",Qt={content:Ww,selectedPlan:Yw,planName:Gw,description:Xw,price:Kw,buttonGroup:Qw,buttonWrapper:Jw,modal:eD,header:tD},jd=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=b.useModalStore(),u=()=>{a()},a=()=>{r(!1),setTimeout(()=>{e(!1)},300)},s=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,o=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=s-o,l=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return i.jsxs("div",{className:Qt.modal,children:[i.jsxs("div",{className:Qt.header,children:[i.jsx("h3",{id:"h3",children:"Choose upgrade method"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:()=>a(),fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Qt.bottomSheet,children:[i.jsxs("div",{className:Qt.content,children:[i.jsxs("div",{className:Qt.selectedPlan,children:[i.jsx("h2",{className:Qt.planName,children:t.name}),i.jsx("p",{className:Qt.description,children:t.description}),i.jsxs("p",{className:Qt.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),i.jsx(Sr,{formatter:l,coupon:null,total:c,discount:o})]}),i.jsxs("div",{className:Qt.buttonGroup,children:[i.jsx("div",{className:Qt.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:()=>a(),children:"Stay with us"})}),i.jsx("div",{className:Qt.buttonWrapper,children:i.jsxs(v.Button,{type:"Primary",onClick:u,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},nD="_orderStatusBlock_2wo4y_2",rD="_orderStatusBlockAntistock_2wo4y_11",uD="_iconWrapper_2wo4y_16",aD="_orderStatusTitle_2wo4y_26",sD="_orderStatusDescription_2wo4y_31",iD="_actionButtons_2wo4y_36",oD="_actionButton_2wo4y_36",cD="_button_2wo4y_47",an={orderStatusBlock:nD,orderStatusBlockAntistock:rD,iconWrapper:uD,orderStatusTitle:aD,orderStatusDescription:sD,actionButtons:iD,actionButton:oD,button:cD},lD={[ve.New]:"New",[ve.Pending]:"Order Pending",[ve.Expired]:"Order Expired",[ve.Cancelled]:"Order Canceled",[ve.Failed]:"Order Failed",[ve.FullDeliveryFailure]:"Delivery Failure",[ve.PartiallyDelivered]:"Partial Delivery Failure",[ve.Refunded]:"Order Refunded",[ve.Completed]:"Order Completed"},dD={[ve.New]:"Your order has been created and is awaiting payment.",[ve.Pending]:"Your order is currently pending. We recommend checking back shortly for confirmation.",[ve.Expired]:"Your order has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ve.Cancelled]:"You canceled the warrant. If there are any problems, please contact support.",[ve.Failed]:"Your order could not be processed due to a payment or system error. Please try again or contact support.",[ve.FullDeliveryFailure]:"Your payment was successful but the product is currently out of stock. Please contact us below to get this sorted.",[ve.PartiallyDelivered]:"Your payment was successful but some products were out of stock. Please contact us below to get this sorted.",[ve.Refunded]:"Your order was refunded. Please check your payment method for confirmation.",[ve.Completed]:"Your order has successfully been processed. View your products below or check your email for additional information."},Hd=()=>({[ve.Completed]:i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"}),[ve.Pending]:i.jsx(v.Icon,{name:"Clock",fill:"var(--text-warning)"}),[ve.New]:i.jsx(v.Icon,{name:"Clock",fill:"var(--text-warning)"}),[ve.Expired]:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"}),[ve.Cancelled]:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"}),[ve.Failed]:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"}),[ve.FullDeliveryFailure]:i.jsx(v.Icon,{name:"Warning",fill:"var(--text-warning)"}),[ve.PartiallyDelivered]:i.jsx(v.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"}),[ve.Refunded]:i.jsx(v.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"})}),Ud=({orderStatus:e,className:t})=>{var l,h;const{shopDomain:n}=b.useStorefrontStore(),{isAntistock:r,general:u}=b.useGeneralStore(),a=b.useNavigate(),s=!!((l=u==null?void 0:u.info)!=null&&l.disableSupport),o=(h=u==null?void 0:u.info)==null?void 0:h.thirdPartySupportUrl,c=!(s&&!o);return i.jsxs("div",{className:b.clx(an.orderStatusBlock,t,{[an.orderStatusBlockAntistock]:r}),children:[i.jsx("div",{className:an.iconWrapper,style:r?{background:"none"}:void 0,children:Hd()[e]}),i.jsx("h2",{className:an.orderStatusTitle,children:lD[e]}),i.jsx("p",{className:an.orderStatusDescription,children:dD[e]}),i.jsxs("div",{className:an.actionButtons,children:[i.jsx("div",{className:an.actionButton,children:i.jsxs(v.Button,{type:"Secondary",className:an.button,onClick:()=>window.open(`https://${n}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),c&&i.jsx("div",{className:an.actionButton,children:i.jsxs(v.Button,{type:"Secondary",className:an.button,onClick:()=>{s&&o?window.open(o):r?window.open(`https://${n}/support`):a("/contact")},style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},fD="_reviewMessage_1t8u4_1",hD="_leaveReviewContainer_1t8u4_11",pD="_leaveReviewTitle_1t8u4_20",gs={reviewMessage:fD,leaveReviewContainer:hD,leaveReviewTitle:pD},Vd=({review:e,orderId:t,className:n})=>{const[r,u]=D.useState((e==null?void 0:e.rating)||0),[a,s]=D.useState(!1),{setIsOpen:o}=b.useModalStore(),{notifications:c,setNotifications:l}=b.useNotificationStore(),h=async f=>{e&&"accessToken"in e&&(await v2({comment:f,rating:r,tsId:b.useGetTsId()},t,e.accessToken),l([...c,{status:"success",id:b.v4(),message:"Review left successfully"}]),s(!1))};return D.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(o(!0),s(!0))},[r]),e?e.rating&&"accessToken"in e?i.jsxs("div",{className:gs.reviewMessage,children:["You left a ",e.rating," star rating"]}):i.jsxs("div",{className:b.clx(gs.leaveReviewContainer,n),children:[i.jsx("p",{className:gs.leaveReviewTitle,children:"Leave a review"}),i.jsx(O8,{rating:r,setRating:u,disabled:!!e.rating||!("accessToken"in e)}),a&&i.jsx(v.Modal,{close:()=>s(!1),children:i.jsx($d,{setIsOpen:s,onSubmit:h})})]}):null},mD="_bottomSheet_1bcyj_1",gD="_content_1bcyj_7",bD="_title_1bcyj_18",_D="_buttonGroup_1bcyj_22",xD="_buttonWrapper_1bcyj_33",CD="_modal_1bcyj_37",ED="_header_1bcyj_44",Nn={bottomSheet:mD,content:gD,title:bD,buttonGroup:_D,buttonWrapper:xD,modal:CD,header:ED},$d=({setIsOpen:e,onSubmit:t})=>{const[n,r]=D.useState(""),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:Nn.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:Nn.header,children:[i.jsx("h3",{id:"h3",className:Nn.title,children:"Review Description"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Nn.bottomSheet,children:[i.jsx("div",{className:Nn.content,children:i.jsx(v.Textarea,{placeholder:"Great product and fast checkout...",value:n,onChange:s=>r(s),label:"Describe your review in detail below"})}),i.jsxs("div",{className:Nn.buttonGroup,children:[i.jsx("div",{className:Nn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),i.jsx("div",{className:Nn.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",disabled:!n,onClick:()=>{a(),t(n)},children:"Submit"})})]})]})]})},TD="_container_1idhv_1",yD="_buttonGroup_1idhv_8",kD="_buttonWrapper_1idhv_15",AD="_header_1idhv_19",SD="_content_1idhv_28",Gn={container:TD,buttonGroup:yD,buttonWrapper:kD,header:AD,content:SD},ID="_modal_1rkmj_1",vD="_modalPayment_1rkmj_7",ND="_title_1rkmj_15",wD="_description_1rkmj_20",Hu={modal:ID,modalPayment:vD,title:ND,description:wD},ji=()=>i.jsxs("div",{className:b.clx(Hu.modal,Hu.modalPayment),onClick:e=>e.stopPropagation(),children:[i.jsx(v.Loader,{style:{border:"4px solid var(--surface-action1)",borderLeftColor:"var(--surface-secondary)",width:"40px",height:"40px"}}),i.jsx("h2",{id:"h3",className:Hu.title,children:"Processing Payment"}),i.jsx("p",{className:Hu.description,children:"This payment is currently being processed. If you're here, it simply means that the payment was created but not complete."})]}),zd=({setIsOpen:e})=>{const{subscription:t}=b.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:u}=ou(),[a,s]=D.useState(1),o=b.useNavigate(),{setIsOpen:c}=b.useModalStore(),{setNotifications:l,notifications:h}=b.useNotificationStore(),[f,m]=D.useState(!1),p=D.useMemo(()=>n(),[u,r]),g=D.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(f)return i.jsx(ji,{});const x=(t==null?void 0:t.price.currency)||"USD",C=new Intl.NumberFormat("en-US",{style:"currency",currency:x});async function _(){var y;m(!0);try{const{data:L}=await y2((t==null?void 0:t.id)||"",{});l([{id:b.v4(),message:"Order created successfully",status:"success"}]),o(`/orders/${(y=L.data)==null?void 0:y.id}/${L.data.fullAccessToken}`)}catch(L){const S=L;l([...h,{id:b.v4(),message:`Order creation failed: ${S.message}`,status:"error"}]),N()}finally{m(!1)}}function N(){c(!1),setTimeout(()=>{e(!1)},300)}return i.jsxs("div",{className:Gn.container,onClick:y=>y.stopPropagation(),children:[i.jsxs("div",{className:Gn.header,children:[i.jsx("h3",{id:"h3",className:Gn.title,children:"Extend Subscription"}),i.jsx(v.Icon,{name:"X",onClick:N,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Gn.content,children:[i.jsx(W8,{step:a,totalSteps:12,onStepChange:s,label:"How long would you like to extend your subscription for?"}),i.jsx(Sr,{formatter:C,coupon:u,total:p.total,discount:g,totalWithDiscount:p.totalWithDiscount}),i.jsxs("div",{className:Gn.buttonGroup,children:[i.jsx("div",{className:Gn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:N,children:"Cancel"})}),i.jsx("div",{className:Gn.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",onClick:_,children:"Extend"})})]})]})]})},DD="_bottomSheet_uw5jb_1",LD="_content_uw5jb_7",PD="_radioGroup_uw5jb_11",RD="_confirmation_uw5jb_26",OD="_iconWrapper_uw5jb_33",MD="_title_uw5jb_42",FD="_message_uw5jb_48",BD="_buttonGroup_uw5jb_54",jD="_buttonWrapper_uw5jb_64",HD="_modal_uw5jb_68",UD="_header_uw5jb_77",ut={bottomSheet:DD,content:LD,radioGroup:PD,confirmation:RD,iconWrapper:OD,title:MD,message:FD,buttonGroup:BD,buttonWrapper:jD,modal:HD,header:UD},VD={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},qd=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[u,a]=D.useState(0),[s,o]=D.useState(!1),[c,l]=D.useState(""),[h,f]=D.useState(""),{setIsOpen:m}=b.useModalStore(),p=async()=>{if(!c)return;o(!0);const x=await x2(n,r,{reason:c==="Other reason"?h:c});o(!1),x&&a(2)};D.useEffect(()=>{e||(a(0),l(""),f(""))},[e]);const g=()=>{m(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:ut.modal,onClick:x=>x.stopPropagation(),children:[i.jsxs("div",{className:ut.header,children:[i.jsx("h3",{id:"h3",children:VD[u]||""}),i.jsx(v.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:ut.content,children:[u===0&&i.jsxs("div",{className:ut.bottomSheet,children:[i.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),i.jsxs("div",{className:ut.radioGroup,children:[i.jsx(v.Radio,{defaultValue:c,onChange:x=>l(x),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"&&i.jsx(v.Textarea,{value:h,onChange:x=>f(x),placeholder:"Describe the reason..."})]}),i.jsxs("div",{className:ut.buttonGroup,children:[i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",onClick:()=>c&&a(1),disabled:!c,children:"Continue"})})]})]}),u===1&&i.jsxs("div",{className:ut.bottomSheet,children:[i.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),i.jsxs("div",{className:ut.buttonGroup,children:[i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",onClick:p,disabled:s,children:"Cancel it anyway"})})]})]}),u===2&&i.jsxs("div",{className:ut.bottomSheet,children:[i.jsxs("div",{className:`${ut.confirmation}`,children:[i.jsx("div",{className:ut.iconWrapper,children:i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"})}),i.jsx("p",{className:ut.title,children:"Subscription Cancelled"}),i.jsx("p",{className:ut.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),i.jsx("div",{className:ut.buttonGroup,children:i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Close"})})})]})]})]})},$D="_vouchCard_ntutv_1",zD="_vouchContent_ntutv_13",qD="_vouchIcon_ntutv_20",ZD="_vouchText_ntutv_29",WD="_vouchTitle_ntutv_35",YD="_vouchDescription_ntutv_42",GD="_addMessageButton_ntutv_48",XD="_vouchCardSubmitted_ntutv_53",At={vouchCard:$D,vouchContent:zD,vouchIcon:qD,vouchText:ZD,vouchTitle:WD,vouchDescription:YD,addMessageButton:GD,vouchCardSubmitted:XD},Zd=({onAddMessage:e,className:t,isSubmitted:n=!1})=>n?i.jsx("div",{className:`${At.vouchCard} ${At.vouchCardSubmitted} ${t||""}`,children:i.jsxs("div",{className:At.vouchContent,children:[i.jsx("div",{className:At.vouchIcon,children:i.jsx(v.Icon,{name:"Check"})}),i.jsxs("div",{className:At.vouchText,children:[i.jsx("h3",{className:At.vouchTitle,children:"Thank You"}),i.jsx("p",{className:At.vouchDescription,children:"We appreciate you sharing your experience with your purchase."})]})]})}):i.jsxs("div",{className:`${At.vouchCard} ${t||""}`,children:[i.jsxs("div",{className:At.vouchContent,children:[i.jsx("div",{className:At.vouchIcon,children:i.jsx(v.Icon,{name:"Star"})}),i.jsxs("div",{className:At.vouchText,children:[i.jsx("h3",{className:At.vouchTitle,children:"Leave a Vouch"}),i.jsx("p",{className:At.vouchDescription,children:"Share your experience with our team."})]})]}),i.jsx(v.Button,{type:"Secondary",onClick:e,className:At.addMessageButton,children:"Add Message"})]}),KD="_vouchModal_sh6up_1",QD="_vouchModalAntistock_sh6up_12",JD="_vouchModalHeader_sh6up_17",eL="_title_sh6up_25",tL="_closeButton_sh6up_32",nL="_vouchModalContent_sh6up_46",rL="_bottomSheet_sh6up_53",uL="_content_sh6up_61",aL="_productContainer_sh6up_65",sL="_searchContainer_sh6up_73",iL="_scrollableBox_sh6up_77",oL="_productItem_sh6up_87",cL="_productImage_sh6up_97",lL="_productName_sh6up_119",dL="_productItemError_sh6up_125",fL="_noResults_sh6up_130",hL="_fieldError_sh6up_140",pL="_vouchForm_sh6up_145",mL="_formField_sh6up_151",gL="_imagesSection_sh6up_157",bL="_imagesTitle_sh6up_163",_L="_requiredStar_sh6up_171",xL="_uploadArea_sh6up_175",CL="_uploadAreaDragOver_sh6up_189",EL="_uploadAreaUploading_sh6up_194",TL="_uploadAreaError_sh6up_200",yL="_uploadContent_sh6up_207",kL="_uploadIcon_sh6up_216",AL="_uploadText_sh6up_225",SL="_uploadSubtext_sh6up_234",IL="_browseText_sh6up_240",vL="_imagePreview_sh6up_245",NL="_imageLoading_sh6up_258",wL="_removeButton_sh6up_280",DL="_vouchModalFooter_sh6up_303",LL="_submitButton_sh6up_308",ye={vouchModal:KD,vouchModalAntistock:QD,vouchModalHeader:JD,title:eL,closeButton:tL,vouchModalContent:nL,bottomSheet:rL,content:uL,productContainer:aL,searchContainer:sL,scrollableBox:iL,productItem:oL,productImage:cL,productName:lL,productItemError:dL,noResults:fL,fieldError:hL,vouchForm:pL,formField:mL,imagesSection:gL,imagesTitle:bL,requiredStar:_L,uploadArea:xL,uploadAreaDragOver:CL,uploadAreaUploading:EL,uploadAreaError:TL,uploadContent:yL,uploadIcon:kL,uploadText:AL,uploadSubtext:SL,browseText:IL,imagePreview:vL,imageLoading:NL,removeButton:wL,vouchModalFooter:DL,submitButton:LL},Wd=({isOpen:e,onClose:t,products:n,orderId:r,accessToken:u,shopDomain:a,onSuccess:s})=>{const{isAntistock:o}=b.useGeneralStore(),{setNotifications:c,notifications:l}=b.useNotificationStore(),{setIsOpen:h}=b.useModalStore(),[f,m]=D.useState(null),[p,g]=D.useState(!1),[x,C]=D.useState(!1),[_,N]=D.useState(!1),y=D.useRef(null),[L,S]=D.useState(""),[I,F]=D.useState(""),[W,V]=D.useState(n.map($=>$.id.toString())),[P,j]=D.useState(!1),[M,J]=D.useState({}),ce=D.useRef(null),re=D.useRef(null),he=D.useRef(null),xe=()=>{var $;($=y.current)==null||$.click()},He=D.useCallback(async $=>{var ee,ie,ae,Re,R;if(!$.type.startsWith("image/")){c([...l,{id:b.v4(),message:"Please select a valid image file",status:"error"}]);return}if($.size>10*1024*1024){c([...l,{id:b.v4(),message:"File size must be less than 10MB",status:"error"}]);return}g(!0),J(Y=>({...Y,image:void 0}));try{const Y=await Jc($),U=(ie=(ee=Y.data)==null?void 0:ee.data)==null?void 0:ie.imageId,Z=(Re=(ae=Y.data)==null?void 0:ae.data)==null?void 0:Re.url;if(!U||!Z)throw new Error(Y.data.message||"Upload failed");m({id:U.toString(),url:Z}),C(!0)}catch(Y){let U="Failed to upload image";const Z=Y;if((R=Z==null?void 0:Z.response)!=null&&R.data){const se=Z.response.data;se.message&&se.errors&&Array.isArray(se.errors)||se.errors&&Array.isArray(se.errors)?U=se.errors.join(", "):se.message&&(U=se.message)}else Y instanceof Error&&(U=Y.message);c([...l,{id:b.v4(),message:U,status:"error"}])}finally{g(!1),y.current&&(y.current.value="")}},[l,c]),we=async $=>{const ee=$.target.files;!ee||ee.length===0||await He(ee[0])},E=$=>{$.preventDefault(),$.stopPropagation(),N(!0)},G=$=>{$.preventDefault(),$.stopPropagation(),N(!1)},ue=async $=>{$.preventDefault(),$.stopPropagation(),N(!1);const ee=$.dataTransfer.files;ee&&ee.length>0&&await He(ee[0])},A=D.useMemo(()=>I.trim()?new Gc.Fuse(n,{keys:["name"],threshold:.3}).search(I).map(ee=>ee.item):n,[n,I]),te=$=>{V(ee=>ee.includes($)&&ee.length===1?ee:ee.includes($)?ee.filter(ie=>ie!==$):[...ee,$]),J(ee=>({...ee,selectedProducts:void 0}))},oe=async()=>{var ee;J({});const $={};if(W.length===0&&($.selectedProducts="Please select at least one product"),f||($.image="Please upload a screenshot"),L.trim()||($.message="Please enter a message"),Object.keys($).length>0){J($),setTimeout(()=>{$.selectedProducts&&ce.current?ce.current.scrollIntoView({behavior:"smooth",block:"center"}):$.image&&re.current?re.current.scrollIntoView({behavior:"smooth",block:"center"}):$.message&&he.current&&he.current.scrollIntoView({behavior:"smooth",block:"center"})},100);return}if(!r||!u||!a||!f){c([...l,{id:b.v4(),message:"Missing required information",status:"error"}]),j(!1);return}try{const ie={imageId:parseInt(f.id),productIds:W.map(ae=>parseInt(ae)),comment:L.trim(),tsId:b.v4()};await j2(ie,a,r,u),c([...l,{id:b.v4(),message:"Vouch submitted successfully",status:"success"}]),s==null||s(),t()}catch(ie){console.log({error:ie});let ae="Failed to submit vouch",Re="";const R=ie;if((ee=R==null?void 0:R.response)!=null&&ee.data){const Y=R.response.data;Y.message&&Y.errors&&Array.isArray(Y.errors)?(Re=Y.message,ae=Y.errors.join(", ")):Y.errors&&Array.isArray(Y.errors)?ae=Y.errors.join(", "):Y.message&&(ae=Y.message)}else ie instanceof Error&&(ae=ie.message);c([...l,{id:b.v4(),message:ae,status:"error",label:Re}])}finally{j(!1)}},ne=()=>{S(""),m(null),F(""),V(n.map($=>$.id.toString())),J({}),t()};return D.useEffect(()=>{e&&V(n.map($=>$.id.toString()))},[e,n]),D.useEffect(()=>{e&&h(!0)},[e,h]),e?i.jsx(v.Modal,{close:ne,withAnimation:!o,children:i.jsxs("div",{className:b.clx(ye.vouchModal,{[ye.vouchModalAntistock]:o}),onClick:$=>$.stopPropagation(),children:[i.jsxs("div",{className:ye.vouchModalHeader,children:[i.jsx("h3",{className:ye.title,children:"Vouch"}),i.jsx("button",{className:ye.closeButton,onClick:ne,children:i.jsx(v.Icon,{name:"X"})})]}),i.jsxs("div",{className:ye.vouchModalContent,children:[i.jsx("div",{className:ye.bottomSheet,children:i.jsxs("div",{className:ye.content,children:[i.jsxs("div",{className:ye.productContainer,children:[i.jsx("div",{className:ye.searchContainer,children:i.jsx(v.Input,{onChange:F,isSearch:!0,value:I,placeholder:"Search for products",label:"Products *"})}),i.jsx("div",{ref:ce,className:ye.scrollableBox,children:A.length>0?A.map($=>i.jsxs("div",{className:b.clx(ye.productItem,{[ye.productItemError]:M.selectedProducts&&!W.includes($.id.toString())}),onClick:()=>te($.id.toString()),children:[i.jsx("div",{className:ye.productImage,children:$.image?i.jsx("img",{src:b.convertCfImageIdToUrl($.image.cfId),alt:$.name}):i.jsx(v.Icon,{name:"Image"})}),i.jsx("span",{className:ye.productName,children:$.name}),i.jsx(v.Checkbox,{value:W.includes($.id.toString()),onChange:()=>te($.id.toString()),disabled:W.length===1&&W.includes($.id.toString())})]},$.id)):i.jsx("div",{className:ye.noResults,children:i.jsx("p",{children:"No products found"})})}),M.selectedProducts&&i.jsx("div",{className:ye.fieldError,children:M.selectedProducts})]}),i.jsx("div",{className:ye.vouchForm,children:i.jsxs("div",{className:ye.formField,ref:re,children:[i.jsxs("div",{className:ye.imagesSection,children:[i.jsxs("h4",{className:ye.imagesTitle,children:["Screenshot",i.jsx("span",{className:ye.requiredStar,children:" *"})]}),f?i.jsxs("div",{className:ye.imagePreview,children:[x&&i.jsx("div",{className:ye.imageLoading,children:i.jsx(v.Icon,{name:"Loader"})}),i.jsx("img",{src:f.url,alt:"Screenshot",onLoad:()=>C(!1),onError:()=>C(!1),style:{opacity:x?0:1}}),i.jsx("button",{className:ye.removeButton,onClick:()=>{m(null),C(!1)},children:i.jsx(v.Icon,{name:"X"})})]}):i.jsx("div",{className:b.clx(ye.uploadArea,{[ye.uploadAreaDragOver]:_,[ye.uploadAreaUploading]:p,[ye.uploadAreaError]:M.image}),onDragOver:E,onDragLeave:G,onDrop:ue,onClick:xe,tabIndex:0,children:i.jsxs("div",{className:ye.uploadContent,children:[i.jsx("div",{className:ye.uploadIcon,children:i.jsx(v.Icon,{name:"CloudArrowUpIcon"})}),i.jsx("div",{className:ye.uploadText,children:p?i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"Uploading image..."}),i.jsx("p",{className:ye.uploadSubtext,children:"Please wait"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Drop your image here, or ",i.jsx("span",{className:ye.browseText,children:"tap to browse"})]}),i.jsx("p",{className:ye.uploadSubtext,children:"Maximum of 10MB per image"})]})})]})}),i.jsx("input",{type:"file",ref:y,onChange:we,accept:"image/*",style:{display:"none"}}),M.image&&i.jsx("div",{className:ye.fieldError,children:M.image})]}),i.jsxs("div",{className:ye.formField,ref:he,children:[i.jsx(v.Textarea,{label:"Message *",value:L,onChange:S,placeholder:"Instant product delivery, paid with balance...",error:M.message}),M.message&&i.jsx("div",{className:ye.fieldError,children:M.message})]})]})})]})}),i.jsx("div",{className:ye.vouchModalFooter,children:i.jsx(v.Button,{type:"Primary",onClick:oe,disabled:P||p,className:ye.submitButton,children:P?"SUBMITTING...":"LEAVE A VOUCH"})})]})]})}):null},PL=Object.freeze(Object.defineProperty({__proto__:null,ActivePaymentMethod:Fd,ActiveSubscriptionProduct:Bd,Auth:si,AuthLogin:a0,AuthModal:C0,AuthRequestOtp:u0,CHARGE_STATUS_DESCRIPTION:Ad,CHARGE_STATUS_DISPLAY_NAME:Kn,CancelSubscription:qd,CashAppVerify:wd,ChangeSubscriptionPlan:Rd,ChargeBlocksRenderer:na,ChargeItems:Nd,ChargeStatusBlock:Id,CheckoutBalancePaymentMethod:oi,CheckoutFooter:Vn,CheckoutHeader:ba,CheckoutItems:g0,CheckoutOperational:yd,CheckoutOrderMainData:Fi,CheckoutPaymentMethod:ci,CheckoutPrices:Sr,CheckoutProduct:_a,ChoosePlanUpgradeMethod:jd,ConnectDiscord:x0,CustomField:_0,CustomFields:b0,CustomerDashboard:L4,LeaveAReview:Vd,NoItemsBlock:ma,OpenDelivery:kd,OrderStatusBlock:Ud,OrdersTable:l0,PageLoading:jN,PageTitle:pa,Pagination:d0,PaginationWithRange:pu,PayPalFFNote:vd,PaymentMethods:li,ProcessingPaymentModal:ji,ProtectYourCheckout:Td,ReferralBlock:s0,ReferralBlockInfo:o0,ReferralBlockSteps:i0,SecuredBySsl:Mi,Sidebar:jl,SkeletonReferralBlock:c0,StatItem:It,StatusIndicator:h0,StatusVariant:Hn,SubmitReview:$d,SubscriptionCoupon:Md,SubscriptionExpiration:zd,SubscriptionExpirationDate:Od,SubscriptionProduct:Pd,SubscriptionStatusBadge:Bi,SubscriptionsTable:Ld,Table:ga,TableItem:ct,TableItemTitle:wt,TermsOfService:Oi,TicketRow:Dd,TrackPayment:Da,VouchCard:Zd,VouchModal:Wd,getChargeStatusIcon:Sd,getOrderStatusIcon:Hd,getPaginationText:f0},Symbol.toStringTag,{value:"Module"})),RL="_chargePageContainer_1azbl_1",OL="_chargeItems_1azbl_14",ML="_mainContent_1azbl_25",FL="_contentWrapper_1azbl_44",BL="_antistockContent_1azbl_53",jL="_statusBlock_1azbl_58",HL="_statusBlockAntistock_1azbl_63",UL="_notPaidSection_1azbl_68",VL="_antistockPayNow_1azbl_82",$L="_antistockFooter_1azbl_86",zL="_antistockTrackPayment_1azbl_96",qL="_footer_1azbl_106",ZL="_loaderContainer_1azbl_128",Ot={chargePageContainer:RL,chargeItems:OL,mainContent:ML,contentWrapper:FL,antistockContent:BL,statusBlock:jL,statusBlockAntistock:HL,notPaidSection:UL,antistockPayNow:VL,antistockFooter:$L,antistockTrackPayment:zL,footer:qL,loaderContainer:ZL},WL=()=>{const{id:e}=b.useParams(),[t,n]=b.useSearchParams(),[r,u]=D.useState(!1),[a,s]=D.useState(),[o,c]=D.useState(!0),l=b.useNavigate(),h=D.useRef(),f=D.useRef(!1),{setIsOpen:m}=b.useModalStore(),{isAntistock:p}=b.useGeneralStore();return D.useEffect(()=>{const g=async(C,_=!1)=>{_||u(!0);const{data:N}=await N2(C);u(!1),s(N)},x=setInterval(()=>{e&&g(e,!0)},5e3);return e&&g(e),()=>{clearInterval(x)}},[]),D.useEffect(()=>{const g=setTimeout(()=>{var C;console.log("charge timeout",a);const x=t.get("redirectRoute");if((a==null?void 0:a.status)===ke.Paid&&a.redirectUrl&&!h.current){const N=JSON.parse(localStorage.getItem("orders")||"{}")[((C=a==null?void 0:a.order)==null?void 0:C.id)||""];N?window.open(N.fullAccessToken?`${a.redirectUrl}/${N.fullAccessToken}`:`${a.redirectUrl}`,"_self"):window.open(a.redirectUrl,"_self")}(a==null?void 0:a.status)===ke.Paid&&h.current&&(console.log("redirectRouteRef.current",h.current),l(h.current,{replace:!0})),x&&h&&(h.current=x,t.delete("redirectRoute"),n(t))},1e3);return()=>clearTimeout(g)},[a]),D.useEffect(()=>{((a==null?void 0:a.gateway)==="PayPalFF"||(a==null?void 0:a.gateway)==="Сashapp")&&m(!0)},[a]),D.useEffect(()=>{var g;if(a!=null&&a.displayPaymentInfo&&a.displayPaymentInfo.length===1&&a.status===ke.NotPaid&&!f.current){const x=a.displayPaymentInfo[0];x.type==="Button"&&((g=x.props)!=null&&g.url)&&(window.open(x.props.url,"_blank"),f.current=!0)}},[a==null?void 0:a.displayPaymentInfo,a==null?void 0:a.status]),r?i.jsx("div",{className:Ot.loaderContainer,children:i.jsx(v.Loader,{})}):i.jsxs("div",{className:Ot.chargePageContainer,children:[i.jsx("div",{className:Ot.chargeItems,children:i.jsx(Nd,{charge:a})}),i.jsx("div",{className:Ot.mainContent,style:p?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:i.jsxs("div",{className:b.clx(Ot.contentWrapper,{[Ot.antistockContent]:p}),children:[a&&(a==null?void 0:a.status)!==ke.NotPaid&&i.jsx(Id,{charge:a}),a&&i.jsxs("div",{className:b.clx(Ot.statusBlock,{[Ot.statusBlockAntistock]:p}),children:[i.jsx(Fi,{lastUpdate:a.expiresAt,email:a.customerForCharge.email,invoiceId:a.id,paymentType:a.gateway}),p&&(a==null?void 0:a.status)===ke.NotPaid&&i.jsx("div",{className:Ot.antistockPayNow,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(na,{block:g},x))}),p&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Ot.antistockTrackPayment,children:i.jsx(Da,{timeline:a.timeline})}),i.jsx(Vn,{className:Ot.antistockFooter})]})]}),!p&&(a==null?void 0:a.status)===ke.NotPaid&&i.jsx("div",{className:Ot.notPaidSection,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(na,{block:g},x))}),!p&&i.jsx(Vn,{className:Ot.footer})]})}),(a==null?void 0:a.gateway)==="PayPalFF"&&o&&i.jsx(v.Modal,{close:()=>c(!1),children:i.jsx(vd,{price:a.price,setIsOpen:c})}),(a==null?void 0:a.gateway)==="Сashapp"&&o&&i.jsx(v.Modal,{close:()=>u(!1),children:i.jsx(wd,{setIsOpen:c,chargeId:a.id})})]})},YL=Object.freeze(Object.defineProperty({__proto__:null,ChargePage:WL},Symbol.toStringTag,{value:"Module"}));exports.ActivePaymentMethod=Fd;exports.ActiveSubscriptionProduct=Bd;exports.BalanceModal=Wl;exports.ChangeSubscriptionPlan=Rd;exports.ChargeStatus=ke;exports.CheckoutFooter=Vn;exports.CheckoutHeader=ba;exports.CheckoutItems=g0;exports.CheckoutOperational=yd;exports.CheckoutOrderMainData=Fi;exports.CheckoutPrices=Sr;exports.CheckoutProduct=_a;exports.LeaveAReview=Vd;exports.MarkdownText=fa;exports.NoItemsBlock=ma;exports.OrderStatus=ve;exports.OrderStatusBlock=Ud;exports.OrdersTable=l0;exports.PageTitle=pa;exports.PaginationWithRange=pu;exports.ReCaptchaProvider=Ks;exports.StableText=Qc;exports.SubscriptionCoupon=Md;exports.SubscriptionExpirationDate=Od;exports.SubscriptionProduct=Pd;exports.SubscriptionsTable=Ld;exports.Table=ga;exports.TableItemTitle=wt;exports.TicketRow=Dd;exports.TrackPayment=Da;exports.VouchCard=Zd;exports.VouchModal=Wd;exports.auth=D2;exports.fetchAuthorizedOrder=h2;exports.fetchGeneral=Kd;exports.fetchOrder=f2;exports.fetchOrders=d2;exports.fetchPrivacyPolicy=c2;exports.fetchRefundPolicy=o2;exports.fetchSubscription=b2;exports.fetchSubscriptions=E2;exports.fetchTerms=i2;exports.fetchThemeAndSettings=Qd;exports.fetchTicket=k2;exports.fetchTickets=S2;exports.getBalance=ia;exports.getBalanceSettings=fl;exports.getGatewaysDetail=lu;exports.index=PL;exports.index$1=YL;exports.parseDraftJsText=dl;exports.recapcha=Ef;exports.sendTicketMessage=A2;exports.useCart=ou;exports.useCopy=tr;exports.useGeneralInfo=sl;exports.useMarkdownIt=Bl;exports.useReCaptcha=cu;
109
+ `):t.deliveryItems[0].textData,o=()=>{u(!1),a?e(!1):setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:b.clx(st.modal,{[st.modalAntistock]:a}),onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:st.header,children:[i.jsx("h3",{id:"h3",className:st.title,children:a?"View Content":"Thank you for the purchase!"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:st.bottomSheet,children:[i.jsx("div",{className:st.content,children:r?i.jsx("div",{className:st.discordMessage,children:i.jsx("p",{className:st.discordMessageTitle,id:"md",children:"Discord role has been granted"})}):i.jsxs("div",{children:[i.jsxs("div",{className:st.section,children:[!a&&i.jsx("p",{className:st.contentTitle,id:"md",children:"Content"}),!a&&i.jsxs(v.Button,{className:st.copyButton,type:"Secondary",onClick:()=>n(s),children:[i.jsx(v.Icon,{name:"Copy"}),"Copy to Clipboard"]})]}),i.jsx("div",{className:b.clx(st.scrollableBox,{[st.scrollableBoxAntistock]:a}),children:i.jsx("p",{className:st.contentText,id:"md",children:a?i.jsx(fa,{text:s}):i.jsx(ki,{remarkPlugins:[w1],rehypePlugins:[Ed],components:{a:({node:c,...l})=>i.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer",className:st.link})},children:s})})})]})}),a&&i.jsxs(v.Button,{className:st.copyButtonAntistock,type:"Secondary",onClick:()=>n(s),style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"Copy"}),"Copy All"]}),!a&&i.jsx("div",{className:st.buttonGroup,children:i.jsx("div",{className:st.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:o,children:"Close"})})})]})]})},wI="_mt1_1l62z_1",DI="_notifyBlock_1l62z_13",LI="_notifyHeader_1l62z_19",PI="_notifyContent_1l62z_25",RI="_buttonBlock_1l62z_30",OI="_imageBlock_1l62z_34",MI="_imageContainer_1l62z_42",FI="_sectionBlock_1l62z_54",BI="_sectionTitle_1l62z_61",jI="_sectionSubtitle_1l62z_64",HI="_inputContainer_1l62z_69",en={mt1:wI,notifyBlock:DI,notifyHeader:LI,notifyContent:PI,buttonBlock:RI,imageBlock:OI,imageContainer:MI,sectionBlock:FI,sectionTitle:BI,sectionSubtitle:jI,inputContainer:HI},UI=({props:e})=>{const t=tr();return i.jsx("div",{className:en.mt1,children:i.jsxs("div",{className:en.inputContainer,children:[i.jsx(v.Input,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&i.jsx(v.Button,{type:"Secondary",onClick:()=>t(e.text),children:i.jsx(v.Icon,{name:"Copy"})})]})})},VI=({props:e})=>i.jsx(v.Button,{className:en.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),$I=({props:e})=>i.jsx("div",{className:en.imageBlock,children:i.jsx("div",{className:en.imageContainer,children:i.jsx("img",{src:e.src,alt:""})})}),zI=({props:e})=>i.jsxs("div",{className:en.notifyBlock,children:[i.jsxs("div",{className:en.notifyHeader,children:[i.jsx(v.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),i.jsx("p",{children:e.heading})]}),i.jsx("p",{className:en.notifyContent,children:e.content})]}),qI=({props:e})=>{var t;return i.jsxs("div",{className:en.sectionBlock,children:[i.jsx("p",{className:en.sectionTitle,children:e.title}),i.jsx("span",{className:en.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>i.jsx(na,{block:n},r))]})},na=({block:e})=>{switch(e.type){case"Section":return i.jsx(qI,{...e});case"ReadOnlyTextInput":return i.jsx(UI,{...e});case"Notify":return i.jsx(zI,{...e});case"Button":return i.jsx(VI,{...e});case"Image":return i.jsx($I,{...e});default:return null}},ZI="_chargeStatusBlock_12swd_4",WI="_isAntistock_12swd_13",YI="_chargeStatusIcon_12swd_19",GI="_chargeStatusTitle_12swd_27",XI="_chargeStatusDescription_12swd_33",KI="_pickUpButton_12swd_39",QI="_actionButtons_12swd_49",JI="_actionButton_12swd_49",Nt={chargeStatusBlock:ZI,isAntistock:WI,chargeStatusIcon:YI,chargeStatusTitle:GI,chargeStatusDescription:XI,pickUpButton:KI,actionButtons:QI,actionButton:JI},Kn={[ke.Paid]:"Payment Successful",[ke.Pending]:"Payment Pending",[ke.Expired]:"Payment Expired",[ke.Cancelled]:"Payment Cancelled",[ke.NotPaid]:"Payment Failed",[ke.Refunded]:"Payment Refunded"},Ad={[ke.Paid]:"Your payment has successfully been processed. Tap on the button below to be redirected back to our website.",[ke.Pending]:"Your payment is currently pending. We recommend checking back shortly for confirmation.",[ke.Expired]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ke.Cancelled]:"You canceled the warrant. If there are any problems, please contact support",[ke.NotPaid]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ke.Refunded]:"Your payment has been refunded. Please check your payment method for confirmation."},Sd=()=>({[ke.Paid]:i.jsx("div",{className:`${Nt.chargeStatusIcon}`,children:i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"})}),[ke.Pending]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"Clock",fill:"var(--text-warning)"})}),[ke.Expired]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ke.Cancelled]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ke.NotPaid]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ke.Refunded]:i.jsx("div",{className:Nt.chargeStatusIcon,children:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-warning)"})})}),Id=({charge:e})=>{var p,g;const t=e.status,n=b.useNavigate(),{shopDomain:r}=b.useStorefrontStore(),{isAntistock:u,general:a}=b.useGeneralStore(),s=D.useRef(),o=!!((p=a==null?void 0:a.info)!=null&&p.disableSupport),c=(g=a==null?void 0:a.info)==null?void 0:g.thirdPartySupportUrl,l=!(o&&!c),[h,f]=b.useSearchParams(),m=()=>{var C,_;if(!((C=e.order)!=null&&C.id))return;const x=h.get("redirectRoute");if((e==null?void 0:e.status)===ke.Paid&&e.redirectUrl&&!s.current){const y=JSON.parse(localStorage.getItem("orders")||"{}")[((_=e==null?void 0:e.order)==null?void 0:_.id)||""];y?window.open(y.fullAccessToken?`${e.redirectUrl}/${y.fullAccessToken}`:`${e.redirectUrl}`,"_self"):window.open(e.redirectUrl,"_self")}(e==null?void 0:e.status)===ke.Paid&&s.current&&n(s.current,{replace:!0}),x&&s&&(s.current=x,h.delete("redirectRoute"),f(h))};return i.jsxs("div",{className:b.clx(Nt.chargeStatusBlock,{[Nt.isAntistock]:u}),children:[Sd()[t],i.jsx("h2",{className:Nt.chargeStatusTitle,children:Kn[t]}),i.jsx("p",{className:Nt.chargeStatusDescription,children:Ad[t]}),t===ke.Paid?i.jsx("div",{className:Nt.pickUpButton,style:u?{justifyContent:"flex-start"}:void 0,children:i.jsxs(v.Button,{onClick:m,style:{width:"100%",maxWidth:"250px",display:"flex",alignItems:"center",gap:"5px"},type:"Secondary",children:[i.jsx(v.Icon,{name:"ArrowLineUpRight"}),u?"View Order":"Pick up Order"]})}):i.jsxs("div",{className:Nt.actionButtons,children:[i.jsx("div",{className:Nt.actionButton,children:i.jsxs(v.Button,{type:"Secondary",onClick:()=>window.open(`https://${r}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),l&&i.jsx("div",{className:Nt.actionButton,children:i.jsxs(v.Button,{type:"Secondary",style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},onClick:()=>{o&&c?window.open(c):u?window.open(`https://${r}/support`):n("/contact")},children:[i.jsx(v.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},ev="_bottomSheet_1x4sq_1",tv="_content_1x4sq_8",nv="_agreementList_1x4sq_11",rv="_agreementItem_1x4sq_16",uv="_warning_1x4sq_23",av="_buttonGroup_1x4sq_31",sv="_buttonWrapper_1x4sq_41",iv="_fullWidthButton_1x4sq_44",ov="_modal_1x4sq_48",cv="_header_1x4sq_55",zt={bottomSheet:ev,content:tv,agreementList:nv,agreementItem:rv,warning:uv,buttonGroup:av,buttonWrapper:sv,fullWidthButton:iv,modal:ov,header:cv},vd=({setIsOpen:e,price:t})=>{const[n,r]=D.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:zt.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:zt.header,children:[i.jsx("h3",{id:"h3",children:"Note"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:zt.bottomSheet,children:[i.jsxs("div",{className:zt.content,children:[i.jsxs("div",{className:zt.agreementList,children:[i.jsxs("label",{className:zt.agreementItem,children:[i.jsx(v.CheckboxSettings,{value:n.agreeToSendAsFF,onChange:s=>r({...n,agreeToSendAsFF:s})}),i.jsx("p",{children:"I agree to send the payment as friends & family"})]}),i.jsxs("label",{className:zt.agreementItem,children:[i.jsx(v.CheckboxSettings,{value:n.agreeToSend,onChange:s=>r({...n,agreeToSend:s})}),i.jsxs("p",{children:["I agree to send the payment of ",b.formatPrice(t)," ",t.currency]})]}),i.jsxs("label",{className:zt.agreementItem,children:[i.jsx(v.CheckboxSettings,{value:n.agreeToNotAddNote,onChange:s=>r({...n,agreeToNotAddNote:s})}),i.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),i.jsx("div",{className:zt.warning,children:i.jsxs("p",{children:["Please note that you are required to send the exact payment of ",b.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),i.jsxs("div",{className:zt.buttonGroup,children:[i.jsx("div",{className:zt.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",children:i.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),i.jsx("div",{className:zt.fullWidthButton,children:i.jsx(v.Button,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:a,children:"Continue to Payment"})})]})]})]})},lv="_chargeItemsContainer_vynct_5",dv="_chargeItemsInner_vynct_18",fv="_productsContainer_vynct_25",hv="_antistockLayout_vynct_40",pv="_mainContentAntistock_vynct_53",mv="_desktopTrackPayment_vynct_64",gv="_desktopFooter_vynct_73",bv="_footerContainerAntistock_vynct_94",_v="_chargeHeader_vynct_107",xv="_chargeTitle_vynct_115",Cv="_chargeDescription_vynct_121",Ev="_copyButton_vynct_127",Tv="_productsList_vynct_139",yv="_footerContainer_vynct_94",kt={chargeItemsContainer:lv,chargeItemsInner:dv,productsContainer:fv,antistockLayout:hv,mainContentAntistock:pv,desktopTrackPayment:mv,desktopFooter:gv,footerContainerAntistock:bv,chargeHeader:_v,chargeTitle:xv,chargeDescription:Cv,copyButton:Ev,productsList:Tv,footerContainer:yv},Nd=({charge:e})=>{var s;const t=tr(),{isAntistock:n}=b.useGeneralStore(),r=(e==null?void 0:e.price.currency)||"USD",u=new Intl.NumberFormat("en-US",{style:"currency",currency:r}),a=D.useMemo(()=>{var o;return((o=e==null?void 0:e.order)==null?void 0:o.partOrders.map(c=>{var l,h,f,m;return{id:(c==null?void 0:c.id)||0,image:c.productWithVariant.image,name:(()=>{var x,C;const p=((x=c.productWithVariant)==null?void 0:x.name)||"",g=((C=c.productWithVariant)==null?void 0:C.variantName)||"";return!p&&!g?"":!g||p===g?p:p?`${p} (${g})`:g})(),description:"",price:{quantity:c.quantity,amount:((l=c.productWithVariant)==null?void 0:l.price.amount)||0,currency:(h=c.productWithVariant)==null?void 0:h.price.currency},subscriptionSettings:(f=e.order)!=null&&f.subscriptionOrderId?(m=c.productWithVariant)==null?void 0:m.subscriptionSettings:null}}))||[]},[e]);return i.jsx("div",{className:kt.chargeItemsContainer,children:i.jsxs("div",{className:kt.chargeItemsInner,children:[i.jsx(ba,{expiresAt:e==null?void 0:e.expiresAt}),i.jsxs("div",{className:`${kt.productsContainer} ${n?kt.antistockLayout:""}`,children:[(e==null?void 0:e.name)&&i.jsxs("header",{className:kt.chargeHeader,children:[i.jsxs("div",{children:[i.jsx("h1",{className:kt.chargeTitle,id:"h5",children:e.name}),e.description&&i.jsx("p",{className:kt.chargeDescription,id:"md",children:e.description})]}),((s=e.order)==null?void 0:s.id)&&!n&&i.jsxs(v.Button,{type:"Secondary",className:kt.copyButton,onClick:()=>{var o;return t(((o=e.order)==null?void 0:o.id)||"")},children:[i.jsx(v.Icon,{name:"Copy"}),"Copy Order ID"]})]}),i.jsxs("div",{className:n?kt.mainContentAntistock:"",style:n?void 0:{flex:1},children:[!!a.length&&i.jsx("div",{className:kt.productsList,children:a.map(o=>i.jsx(_a,{product:o},o.id))}),i.jsx(Sr,{formatter:u,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1}),n&&e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:kt.desktopTrackPayment,children:i.jsx(Da,{timeline:e.timeline})}),i.jsx(Vn,{className:kt.desktopFooter})]})]}),!n&&i.jsx(Vn,{className:`${kt.footerContainer} ${n?kt.footerContainerAntistock:""}`})]})]})})},kv="_checkoutOrderMainData_hqf60_1",Av="_orderDetailRow_hqf60_6",Sv="_chargeIdRow_hqf60_16",Iv="_detailLabel_hqf60_25",vv="_detailValue_hqf60_29",Nv="_chargeIdContainer_hqf60_33",wv="_chargeId_hqf60_16",Dv="_copyIcon_hqf60_51",et={checkoutOrderMainData:kv,orderDetailRow:Av,chargeIdRow:Sv,detailLabel:Iv,detailValue:vv,chargeIdContainer:Nv,chargeId:wv,copyIcon:Dv},Fi=({lastUpdate:e,invoiceId:t,email:n,paymentType:r,orderId:u})=>{const a=tr(),[s,o]=D.useState(null),c=s==null?void 0:s.find(h=>h.name===r);D.useEffect(()=>{s||(async()=>{if(!r)return;const m=await lu([r]);o(m)})()},[r,s]);const l=h=>{const f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=h.getDate().toString().padStart(2,"0"),p=f[h.getMonth()],g=h.getFullYear(),x=h.getHours(),C=h.getMinutes().toString().padStart(2,"0"),_=h.getSeconds().toString().padStart(2,"0"),N=x>=12?"PM":"AM",y=(x%12||12).toString().padStart(2,"0");return`${p} ${m}, ${g} at ${y}:${C}:${_} ${N}`};return i.jsxs("div",{className:et.checkoutOrderMainData,children:[i.jsxs("div",{className:et.orderDetailRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Last Updated"}),i.jsx("p",{className:et.detailValue,id:"md",children:l(new Date(e))})]}),r&&i.jsxs("div",{className:et.orderDetailRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Payment Type"}),i.jsx("p",{className:et.detailValue,id:"md",children:c==null?void 0:c.displayName})]}),i.jsxs("div",{className:et.orderDetailRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Email"}),i.jsx("p",{className:et.detailValue,id:"md",children:n})]}),t&&i.jsxs("div",{className:et.chargeIdRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Charge ID"}),i.jsxs("div",{className:et.chargeIdContainer,children:[i.jsx("p",{className:et.chargeId,id:"md",children:t}),i.jsx("div",{className:et.copyIcon,onClick:()=>a(t),children:i.jsx(v.Icon,{name:"Copy"})})]})]}),u&&i.jsxs("div",{className:et.chargeIdRow,children:[i.jsx("p",{className:et.detailLabel,id:"md",children:"Order ID"}),i.jsxs("div",{className:et.chargeIdContainer,children:[i.jsx("p",{className:et.chargeId,id:"md",children:u}),i.jsx("div",{className:et.copyIcon,onClick:()=>a(u),children:i.jsx(v.Icon,{name:"Copy"})})]})]})]})},Lv="_bottomSheet_1yai1_1",Pv="_formContainer_1yai1_8",Rv="_error_1yai1_14",Ov="_buttonGroup_1yai1_18",Mv="_buttonWrapper_1yai1_28",Fv="_fullWidthButton_1yai1_31",Bv="_modal_1yai1_41",jv="_header_1yai1_48",vn={bottomSheet:Lv,formContainer:Pv,error:Rv,buttonGroup:Ov,buttonWrapper:Mv,fullWidthButton:Fv,modal:Bv,header:jv},wd=({chargeId:e,setIsOpen:t})=>{const[n,r]=D.useState(""),[u,a]=D.useState(""),{setIsOpen:s}=b.useModalStore(),o=h=>{try{return new URL(h),!0}catch{return!1}},c=async h=>{if(h.preventDefault(),!n){a("The link field cannot be empty.");return}if(!o(n)){a("Please enter a valid URL");return}await e2({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},l=()=>{s(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:vn.modal,onClick:h=>h.stopPropagation(),children:[i.jsxs("div",{className:vn.header,children:[i.jsx("h3",{id:"h3",children:"CashApp Verify"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:l,fill:"var(--text-primary)"})]}),i.jsx("form",{onSubmit:c,children:i.jsxs("div",{className:vn.bottomSheet,children:[i.jsx("div",{className:vn.formContainer,children:i.jsxs("div",{children:[i.jsx(v.Input,{value:n,onChange:h=>{r(h),a("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),u&&i.jsx("p",{className:vn.error,children:u})]})}),i.jsxs("div",{className:vn.buttonGroup,children:[i.jsx("div",{className:vn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:l,children:"Cancel"})}),i.jsx("div",{className:vn.fullWidthButton,children:i.jsx(v.Button,{type:"Primary",children:"Verify"})})]})]})})]})},Hv="_trackPaymentContainer_fk3b6_1",Uv="_trackPaymentBox_fk3b6_5",Vv="_trackPaymentBoxActive_fk3b6_18",$v="_trackPaymentHeader_fk3b6_23",zv="_trackPaymentTitle_fk3b6_27",qv="_trackPaymentTimeline_fk3b6_33",Zv="_trackPaymentItem_fk3b6_42",Wv="_itemHeader_fk3b6_48",Yv="_itemDate_fk3b6_55",Gv="_itemMessage_fk3b6_59",Xv="_trackPaymentToggle_fk3b6_64",Kv="_trackPaymentToggleContent_fk3b6_75",Qv="_trackPaymentToggleText_fk3b6_81",Jv="_antistock_fk3b6_88",Ct={trackPaymentContainer:Hv,trackPaymentBox:Uv,trackPaymentBoxActive:Vv,trackPaymentHeader:$v,trackPaymentTitle:zv,trackPaymentTimeline:qv,trackPaymentItem:Zv,itemHeader:Wv,itemDate:Yv,itemMessage:Gv,trackPaymentToggle:Xv,trackPaymentToggleContent:Kv,trackPaymentToggleText:Qv,antistock:Jv},Yc=(e,t)=>{const n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),u=e.getFullYear(),a=e.getHours(),s=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0"),c=a>=12?"PM":"AM",l=(a%12||12).toString().padStart(2,"0");return t==="dd.MM.yyyy"?`${n}.${r}.${u}`:t==="hh:mm:ss aa"?`${l}:${s}:${o} ${c}`:""},eN={[ke.Paid]:{displayName:Kn[ke.Paid],displayMessage:"The invoice has been completed and the product has been delivered.",type:"success"},[ke.Pending]:{displayName:Kn[ke.Pending],displayMessage:"The invoice has been created and we are now waiting to receive the payment.",type:"warning"},[ke.Expired]:{displayName:Kn[ke.Expired],displayMessage:"Your payment has expired due to the payment not being sent in time.",type:"error"},[ke.Cancelled]:{displayName:Kn[ke.Cancelled],displayMessage:"The order has been canceled. The payment was not sent within the time limit.",type:"error"},[ke.NotPaid]:{displayName:"New",displayMessage:"The charge has been created and is awaiting payment.",type:"success"},[ke.Refunded]:{displayName:Kn[ke.Refunded],displayMessage:"Your order was refunded. Please check your payment method for confirmation.",type:"warning"}},tN=({date:e,chargeStatus:t})=>(console.log(t),i.jsxs("div",{className:Ct.trackPaymentItem,children:[i.jsxs("div",{className:Ct.itemHeader,children:[i.jsx("p",{className:Ct.itemDate,id:"md-bold",children:Yc(new Date(e),"dd.MM.yyyy")}),i.jsx("p",{className:Ct.itemTime,id:"md",children:Yc(new Date(e),"hh:mm:ss aa")})]}),i.jsx("p",{className:Ct.itemMessage,id:"md",children:eN[t].displayMessage})]})),Da=({timeline:e,className:t})=>{const[n,r]=D.useState(!1),{isAntistock:u}=b.useGeneralStore();return i.jsxs("div",{className:b.clx(Ct.trackPaymentContainer,t,{[Ct.antistock]:u}),children:[i.jsxs("div",{className:`${Ct.trackPaymentBox} ${n?Ct.trackPaymentBoxActive:""}`,style:u?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsx("header",{className:Ct.trackPaymentHeader,children:i.jsx("h2",{className:Ct.trackPaymentTitle,id:"h4",children:"Track Payment"})}),i.jsx("div",{className:Ct.trackPaymentTimeline,children:Object.keys(e).map(a=>i.jsx(tN,{date:e[a],chargeStatus:a},a))})]}),i.jsxs("div",{className:Ct.trackPaymentToggle,onClick:()=>r(!n),style:u?{padding:"1.25rem",border:"1px solid var(--border-secondary)",borderRadius:"var(--border-radius)"}:void 0,children:[i.jsxs("div",{className:Ct.trackPaymentToggleContent,children:[u?null:i.jsx(v.Icon,{name:"MagnifyingGlass",fill:"var(--text-secondary)"}),i.jsx("p",{className:Ct.trackPaymentToggleText,id:"h5",children:"Track Payment"})]}),i.jsx(v.Icon,{name:"CaretRight",fill:"var(--text-primary)",width:16,height:16})]})]})},nN="_dateTime_1dnnn_11",rN="_tableItem_1dnnn_25",uN="_status_1dnnn_29",aN="_statusInProgress_1dnnn_38",sN="_statusText_1dnnn_42",iN="_statusIcon_1dnnn_46",oN="_statusInProgressText_1dnnn_52",cN="_statusInProgressIcon_1dnnn_57",lN="_message_1dnnn_63",Et={dateTime:nN,tableItem:rN,status:uN,statusInProgress:aN,statusText:sN,statusIcon:iN,statusInProgressText:oN,statusInProgressIcon:cN,message:lN},Dd=({item:e})=>{const[t,n]=b.extractDateAndTime(e.createdAt),r=b.useNavigate(),a=(s=>s.length>30?s.slice(0,27)+"...":s)(e.latestMessage);return i.jsxs(D.Fragment,{children:[i.jsx(ct,{className:Et.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("span",{id:"md",children:["#",e.id]})}),i.jsx(ct,{className:b.clx(Et.message,Et.tableItem),onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx("span",{id:"md",children:a})}),i.jsx(ct,{className:Et.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:t}),i.jsx("div",{className:Et.dateTime,id:"md",children:n})]})}),i.jsx(ct,{className:Et.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx(dN,{status:e.status})})]},e.id)},dN=({status:e})=>i.jsxs("div",{className:b.clx(Et.status,{[Et.statusClosed]:e==="CLOSED",[Et.statusInProgress]:e!=="CLOSED"}),children:[i.jsx("div",{className:b.clx(Et.statusIcon,{[Et.statusInProgressIcon]:e!=="CLOSED"}),children:e==="CLOSED"?i.jsx(v.Icon,{name:"CheckCircle",className:Et.statusIcon}):i.jsx(v.Icon,{name:"Clock",className:Et.statusInProgressIcon})}),i.jsx("div",{className:b.clx(Et.statusText,{[Et.statusInProgressText]:e!=="CLOSED"}),id:"md",children:e==="CLOSED"?"Closed":"In Progress"})]}),fN="_tableContainer_1eytq_1",hN="_table_1eytq_1",pN="_productInfo_1eytq_19",mN="_productImage_1eytq_26",gN="_productName_1eytq_35",bN="_expirationDate_1eytq_46",_N="_overflowItem_1eytq_51",xN="_gatewayContainer_1eytq_57",CN="_gatewayImage_1eytq_62",EN="_dateTime_1eytq_67",TN="_tableLoader_1eytq_72",yN="_tableItem_1eytq_81",ht={tableContainer:fN,table:hN,productInfo:pN,productImage:mN,productName:gN,expirationDate:bN,overflowItem:_N,gatewayContainer:xN,gatewayImage:CN,dateTime:EN,tableLoader:TN,tableItem:yN},kN="_badge_1oac8_1",AN="_active_1oac8_12",SN="_awaitingPayment_1oac8_17",IN="_cancelled_1oac8_22",vN="_changedGateway_1oac8_27",NN="_expired_1oac8_32",wN="_rial_1oac8_37",DN="_pastDue_1oac8_42",LN="_replaced_1oac8_47",Tn={badge:kN,active:AN,awaitingPayment:SN,cancelled:IN,changedGateway:vN,expired:NN,rial:wN,pastDue:DN,replaced:LN},PN=()=>({[En.ACTIVE]:{icon:i.jsx(v.Icon,{name:"CheckCircle"}),title:"Active",className:Tn.active},[En.AWAITING_PAYMENT]:{icon:i.jsx(v.Icon,{name:"Clock"}),title:"Awaiting Payment",className:Tn.awaitingPayment},[En.CANCELLED]:{icon:i.jsx(v.Icon,{name:"XCircle"}),title:"Cancelled",className:Tn.cancelled},[En.CHANGED_GATEWAY]:{icon:i.jsx(v.Icon,{name:"Warning"}),title:"Upgraded",className:Tn.changedGateway},[En.EXPIRED]:{icon:i.jsx(v.Icon,{name:"XCircle"}),title:"Expired",className:Tn.expired},[En.RIAL]:{icon:i.jsx(v.Icon,{name:"Clock"}),title:"Active",className:Tn.rial},[En.PAST_DUE]:{icon:i.jsx(v.Icon,{name:"Clock"}),title:"Trial",className:Tn.pastDue},[En.REPLACED]:{icon:i.jsx(v.Icon,{name:"Warning"}),title:"Replaced",className:Tn.replaced}}),Bi=({status:e})=>{const t=PN()[e];return i.jsxs("div",{className:`${Tn.badge} ${t.className}`,children:[t.icon,i.jsx("p",{id:"md",children:t.title})]})},RN=(e,t)=>{const n=t.find(r=>r.name===e);return n?i.jsxs("div",{className:ht.gatewayContainer,children:[i.jsx("img",{alt:n.displayName,src:b.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:ht.gatewayImage}),i.jsx("div",{children:n.displayName})]}):null},ON=({item:e,gatewaysDetail:t})=>{const[n,r]=b.extractDateAndTime(e.createdAt),[u]=b.extractDateAndTime(e.activeTo||""),a=tr();return i.jsxs(D.Fragment,{children:[i.jsx(ct,{children:i.jsxs("div",{className:ht.productInfo,children:[i.jsx("div",{className:ht.productImage,children:i.jsx(v.Icon,{name:"Image",width:20,height:20,fill:"var(--text-secondary)"})}),i.jsxs("div",{children:[i.jsx(b.NavLink,{to:`/subscriptions/${e.id}/${e.accessToken}`,className:ht.productName,id:"md",children:e.productName}),i.jsx("p",{className:ht.expirationDate,children:e.activeTo&&`expires at ${u}`})]})]})}),i.jsx(ct,{className:ht.overflowItem,onClick:()=>a(e.id),children:e.id}),i.jsx(ct,{children:i.jsx(Bi,{status:e.status})}),i.jsx(ct,{children:b.formatPrice(e.price)}),i.jsx(ct,{children:RN(e.gatewayName,t)}),i.jsx(ct,{children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:n}),i.jsx("div",{className:ht.dateTime,id:"md",children:r})]})})]},e.id)},Ld=({subscriptions:e,gatewaysDetail:t,totalCount:n,page:r,setPage:u})=>{const s=!(!(e!=null&&e.length)||!t);return i.jsxs("div",{className:ht.tableContainer,children:[i.jsxs(ga,{className:ht.table,children:[i.jsx(wt,{className:ht.tableItem,children:"Product name"}),i.jsx(wt,{className:ht.tableItem,children:"ID"}),i.jsx(wt,{className:ht.tableItem,children:"Status"}),i.jsx(wt,{className:ht.tableItem,children:"Value"}),i.jsx(wt,{className:ht.tableItem,children:"Payment"}),i.jsx(wt,{className:ht.tableItem,children:"Date"}),s&&(e==null?void 0:e.map(o=>i.jsx(ON,{item:o,gatewaysDetail:t},o.id)))]}),!s&&i.jsx("div",{className:ht.tableLoader,children:i.jsx(v.Loader,{})}),s&&i.jsx(pu,{currentPage:r,totalCount:n,onPageChange:u})]})},MN="_pageLoading_1rj3k_2",FN="_title_1rj3k_11",BN="_description_1rj3k_17",ms={pageLoading:MN,title:FN,description:BN},jN=({description:e,title:t})=>i.jsxs("div",{className:ms.pageLoading,children:[i.jsx("div",{children:i.jsx(v.Loader,{})}),i.jsx("h1",{className:ms.title,children:t}),i.jsx("p",{className:ms.description,children:e})]}),HN="_container_1opbn_1",UN="_productDetails_1opbn_8",VN="_imageContainer_1opbn_14",$N="_image_1opbn_14",zN="_textContainer_1opbn_32",qN="_header_1opbn_40",ZN="_title_1opbn_46",WN="_price_1opbn_53",YN="_badgeContainer_1opbn_57",GN="_description_1opbn_61",un={container:HN,productDetails:UN,imageContainer:VN,image:$N,textContainer:zN,header:qN,title:ZN,price:WN,badgeContainer:YN,description:GN},Pd=({subscription:e})=>i.jsxs("div",{className:un.container,children:[i.jsxs("div",{className:un.productDetails,children:[i.jsx("div",{className:un.imageContainer,children:e!=null&&e.image?i.jsx("img",{className:un.image,src:b.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):i.jsx(v.Icon,{name:"Image"})}),i.jsxs("div",{className:un.textContainer,children:[i.jsx("div",{className:un.header,children:i.jsx("h2",{className:un.title,children:e.name})}),i.jsxs("p",{className:un.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx("div",{className:un.badgeContainer,children:i.jsx(Bi,{status:e.status})})]}),e.description&&i.jsx(ki,{className:un.description,children:e.description})]}),XN="_card_69liy_1",KN="_price_69liy_10",QN="_interval_69liy_17",JN="_name_69liy_22",ew="_description_69liy_28",tw="_currentPlan_69liy_32",nw="_selectButton_69liy_45",rw="_progressSection_69liy_50",uw="_progressLabel_69liy_54",aw="_bottomSheet_69liy_60",sw="_title_69liy_69",iw="_typeSelector_69liy_80",ow="_typeOption_69liy_90",cw="_active_69liy_100",lw="_saveTag_69liy_108",dw="_planSelector_69liy_117",fw="_modal_69liy_127",hw="_inactive_69liy_148",pw="_notMounted_69liy_151",mw="_closeButton_69liy_157",Ke={card:XN,price:KN,interval:QN,name:JN,description:ew,currentPlan:tw,selectButton:nw,progressSection:rw,progressLabel:uw,bottomSheet:aw,title:sw,typeSelector:iw,typeOption:ow,active:cw,saveTag:lw,planSelector:dw,modal:fw,inactive:hw,notMounted:pw,closeButton:mw},gw=({variant:e,onSelect:t,isCurrent:n})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",u=e.subscriptionSettings.price.amount.toFixed(2),a=e.subscriptionSettings.recurringIntervalDays,s=10;return i.jsxs("div",{className:Ke.card,onClick:t,children:[i.jsxs("h2",{className:Ke.price,children:["$",u," ",i.jsxs("span",{className:Ke.interval,children:["/ ",r]})]}),i.jsx("h3",{className:Ke.name,children:e.name}),e.description&&i.jsx("p",{className:Ke.description,children:e.description}),n?i.jsxs("div",{className:Ke.currentPlan,children:[i.jsx(v.Icon,{name:"Check"}),"Your current Plan"]}):i.jsx(v.Button,{type:"Secondary",className:Ke.selectButton,children:"Select"}),n&&i.jsxs("div",{className:Ke.progressSection,children:[i.jsx(p0,{percent:s/a*100,disablePercentLabel:!0}),i.jsxs("p",{className:Ke.progressLabel,children:["Used: ",s," of ",a," days"]})]})]})},Rd=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,u]=D.useState(null),[a,s]=D.useState(null),[o,c]=D.useState(null),{id:l,accessToken:h}=b.useParams(),[f,m]=D.useState(!1),[p,g]=D.useState(!1),{setIsOpen:x}=b.useModalStore();D.useEffect(()=>{e&&m(!0)},[e]);const C=()=>{t(!1)},[_,N]=D.useState(null);D.useEffect(()=>{l&&h&&(async()=>{if(l&&h){const{data:I}=await T2({id:l,accessToken:h});N(I)}})()},[l,h]),D.useEffect(()=>{var S;if(_!=null&&_.data.types[0]){const I=(S=_.data.types.flatMap(F=>F.productVariants).find(F=>F.data.id===(n==null?void 0:n.variantId)))==null?void 0:S.data;I&&(c(I),s(I))}},[_,n]),D.useEffect(()=>{_!=null&&_.data.types[0]&&u(_==null?void 0:_.data.types[0])},[_==null?void 0:_.data.types]);const y=S=>{u(S),s(null)},L=S=>{s(S),x(!0),g(!0)};return i.jsxs("div",{className:b.clx(Ke.modal,{[Ke.active]:e,[Ke.inactive]:!e&&f,[Ke.notMounted]:!f}),onClick:S=>S.stopPropagation(),children:[i.jsx(v.Icon,{name:"X",onClick:C,hoverable:!0,className:Ke.closeButton,fill:"var(--text-primary)"}),i.jsxs("div",{className:Ke.bottomSheet,children:[i.jsx("h3",{id:"h3",className:Ke.title,children:"Change Plan"}),i.jsx("p",{className:Ke.description,children:_==null?void 0:_.data.description}),i.jsx("div",{className:Ke.typeSelector,children:_==null?void 0:_.data.types.map(S=>i.jsxs("div",{className:b.clx(Ke.typeOption,{[Ke.active]:(r==null?void 0:r.id)===S.id}),onClick:()=>y(S),children:[S.name,S.name==="Yearly"&&i.jsx("span",{className:Ke.saveTag,children:"Save %"})]},S.id))}),r&&i.jsx("div",{className:Ke.planSelector,children:r.productVariants.map(S=>i.jsx(gw,{variant:S.data,isSelected:(a==null?void 0:a.id)===S.data.id,isCurrent:(o==null?void 0:o.id)===S.data.id,onSelect:()=>L(S.data)},S.data.id))})]}),p&&a&&n&&i.jsx(v.Modal,{close:()=>{g(!1)},children:i.jsx(jd,{setIsOpen:g,selectedVariant:a,subscription:n})})]})},bw="_container_nb625_1",_w="_title_nb625_11",xw="_subtitle_nb625_16",Cw="_info_nb625_20",ju={container:bw,title:_w,subtitle:xw,info:Cw},Od=()=>{const{subscription:e}=b.useSubscriptionStore(),[t,n]=b.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,u]=D.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ju.container,children:[i.jsxs("div",{className:ju.info,children:[i.jsx("p",{className:ju.title,children:"Expiration Date"}),i.jsxs("p",{className:ju.subtitle,children:[t," at ",n]})]}),i.jsx(v.Button,{type:"Special",onClick:s=>{s.stopPropagation(),a(!0),u(!0)},children:"Extend"})]}),r&&i.jsx(v.Modal,{close:()=>u(!1),children:i.jsx(zd,{setIsOpen:u})})]})},Ew="_couponContainer_1sspa_1",Tw="_iconWrapper_1sspa_10",yw="_details_1sspa_21",kw="_title_1sspa_25",Aw="_progress_1sspa_29",Sw="_foreverText_1sspa_34",lr={couponContainer:Ew,iconWrapper:Tw,details:yw,title:kw,progress:Aw,foreverText:Sw},Md=({coupon:e,currency:t})=>{const n=e.isFixed?b.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?b.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return i.jsxs("div",{className:lr.couponContainer,children:[i.jsx("div",{className:lr.iconWrapper,children:i.jsx(v.Icon,{name:"CheckCircle"})}),i.jsxs("div",{className:lr.details,children:[i.jsxs("p",{className:lr.title,children:[e.name,", ",n," discount"]}),i.jsx("div",{className:lr.progress,children:i.jsx(p0,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),i.jsx("p",{className:lr.foreverText,children:"Forever discount code"})]})]})},Iw="_paymentMethodContainer_1g0da_4",vw="_paymentMethodTitle_1g0da_15",Nw="_activeMethod_1g0da_20",ww="_noMethod_1g0da_28",Dw="_activeMethodPaymentMethod_1g0da_37",Lw="_paymentMethodLogo_1g0da_47",Pw="_paymentMethodNumber_1g0da_57",Rw="_method_1g0da_61",Mn={paymentMethodContainer:Iw,paymentMethodTitle:vw,activeMethod:Nw,noMethod:ww,activeMethodPaymentMethod:Dw,paymentMethodLogo:Lw,paymentMethodNumber:Pw,method:Rw},Ow="_paymentMethods_1gev0_1",Mw="_modal_1gev0_14",Fw="_header_1gev0_28",Bw="_content_1gev0_37",Yn={paymentMethods:Ow,modal:Mw,header:Fw,content:Bw},jw=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:u}=b.useSubscriptionStore();if(!r)return null;const{id:a}=b.useParams(),s=b.useNavigate(),{notifications:o,setNotifications:c}=b.useNotificationStore(),{setPaymentMethod:l,setGateway:h,cart:f}=ou(),{setIsOpen:m}=b.useModalStore();async function p(){if(g(),t(!0),a&&r){const{data:x}=await C2(a,f.gateway);x.isReconnectPaymentNeeded?s(`/charges/${x.chargeId}`):(c([...o,{status:"success",id:b.v4(),message:"Your action has been successfully completed"}]),u({...r,gatewayName:f.gateway}))}else c([...o,{status:"error",id:b.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function g(){m(!1),setTimeout(()=>{n(!1)},300)}return i.jsxs("div",{className:Yn.modal,onClick:x=>{x.stopPropagation()},children:[i.jsxs("div",{className:Yn.header,children:[i.jsx("h3",{id:"h3",className:Yn.title,children:"Choose Payment Method"}),i.jsx(v.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Yn.content,children:[(r==null?void 0:r.availableGateways)&&i.jsx(li,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:h,setPaymentMethod:l,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>s("/customer-dash")}),i.jsxs("div",{className:Yn.paymentMethods,children:[i.jsx("div",{className:Yn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Cancel"})}),i.jsx("div",{className:Yn.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",disabled:!f.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},Hw="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",Fd=()=>{var g,x,C;const{subscription:e}=b.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=ou(),r=b.useNavigate(),[u,a]=D.useState(null),[s,o]=D.useState(!1),[c,l]=D.useState(!1),{setIsOpen:h}=b.useModalStore();if(!e)return null;const[f,m]=D.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return D.useEffect(()=>{(async()=>{const N=await lu(e.availableGateways);a(N)})()},[]),D.useEffect(()=>{t.gateway!==f&&m(t.gateway)},[t.gateway]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Mn.paymentMethodContainer,children:[i.jsxs("div",{children:[i.jsx("p",{className:Mn.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&i.jsx(Uw,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f==="Balance"&&i.jsx(oi,{gateway:f,gatewayDisplayName:f,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!f&&i.jsx("span",{className:Mn.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f&&i.jsx("div",{className:Mn.activeMethod,children:u&&i.jsx(ci,{align:"row",gatewayLogoCfId:(g=u.find(_=>_.name===f))==null?void 0:g.logoCfImageId,gatewayDisplayName:(x=u.find(_=>_.name===f))==null?void 0:x.displayName,gateway:f,poweredByLogoCfId:(C=u.find(_=>_.name===f))==null?void 0:C.poweredByImageCfImageId,className:Mn.activeMethodPaymentMethod,selected:p===f,onSelect:_=>{n(_)}},f)})]}),i.jsx(v.Button,{type:"Special",onClick:_=>{_.stopPropagation(),h(!0),l(!0)},children:t.gateway?"Change":"Manage"})]}),c&&i.jsx(v.Modal,{close:()=>l(!1),children:i.jsx(jw,{setIsLoading:o,setIsOpen:l})})]})},Uw=({gatewayInfo:e})=>{var t,n,r,u,a;return i.jsxs("div",{className:Mn.method,children:[i.jsxs("div",{className:Mn.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&i.jsx(rm,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&i.jsx("img",{src:Hw,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((u=e.card)==null?void 0:u.brand.toLowerCase())!=="mastercard"&&i.jsx(v.Icon,{name:"CreditCard",width:22})]}),i.jsxs("p",{className:Mn.paymentMethodNumber,children:["•••• •••• •••• ",(a=e.card)==null?void 0:a.last4]})]})},Vw="_subscriptionProductContainer_83ibx_4",$w="_subscriptionProductImage_83ibx_15",zw="_subscriptionProductInfo_83ibx_32",qw="_name_83ibx_37",Zw="_price_83ibx_40",Ur={subscriptionProductContainer:Vw,subscriptionProductImage:$w,subscriptionProductInfo:zw,name:qw,price:Zw},Bd=({subscription:e,id:t,accessToken:n})=>{const[r,u]=D.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Ur.subscriptionProductContainer,onClick:s=>s.stopPropagation(),children:[i.jsx("div",{className:Ur.subscriptionProductImage,children:e!=null&&e.image?i.jsx("img",{src:b.convertCfImageIdToUrl(e.image.cfId)}):i.jsx(v.Icon,{name:"Image"})}),i.jsxs("div",{className:Ur.subscriptionProductInfo,children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h2",{className:Ur.name,children:e.name})}),i.jsxs("p",{className:Ur.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx(v.Button,{type:"Special",onClick:s=>{s.preventDefault(),u(!0),a(!0)},children:"Cancel"})]}),r&&i.jsx(v.Modal,{close:()=>u(!1),children:i.jsx(qd,{accessToken:n,id:t,isOpen:r,setIsOpen:u})})]})},Ww="_content_5ctxw_1",Yw="_selectedPlan_5ctxw_37",Gw="_planName_5ctxw_44",Xw="_description_5ctxw_48",Kw="_price_5ctxw_51",Qw="_buttonGroup_5ctxw_79",Jw="_buttonWrapper_5ctxw_84",eD="_modal_5ctxw_88",tD="_header_5ctxw_95",Qt={content:Ww,selectedPlan:Yw,planName:Gw,description:Xw,price:Kw,buttonGroup:Qw,buttonWrapper:Jw,modal:eD,header:tD},jd=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=b.useModalStore(),u=()=>{a()},a=()=>{r(!1),setTimeout(()=>{e(!1)},300)},s=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,o=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=s-o,l=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return i.jsxs("div",{className:Qt.modal,children:[i.jsxs("div",{className:Qt.header,children:[i.jsx("h3",{id:"h3",children:"Choose upgrade method"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:()=>a(),fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Qt.bottomSheet,children:[i.jsxs("div",{className:Qt.content,children:[i.jsxs("div",{className:Qt.selectedPlan,children:[i.jsx("h2",{className:Qt.planName,children:t.name}),i.jsx("p",{className:Qt.description,children:t.description}),i.jsxs("p",{className:Qt.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),i.jsx(Sr,{formatter:l,coupon:null,total:c,discount:o})]}),i.jsxs("div",{className:Qt.buttonGroup,children:[i.jsx("div",{className:Qt.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:()=>a(),children:"Stay with us"})}),i.jsx("div",{className:Qt.buttonWrapper,children:i.jsxs(v.Button,{type:"Primary",onClick:u,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},nD="_orderStatusBlock_2wo4y_2",rD="_orderStatusBlockAntistock_2wo4y_11",uD="_iconWrapper_2wo4y_16",aD="_orderStatusTitle_2wo4y_26",sD="_orderStatusDescription_2wo4y_31",iD="_actionButtons_2wo4y_36",oD="_actionButton_2wo4y_36",cD="_button_2wo4y_47",an={orderStatusBlock:nD,orderStatusBlockAntistock:rD,iconWrapper:uD,orderStatusTitle:aD,orderStatusDescription:sD,actionButtons:iD,actionButton:oD,button:cD},lD={[ve.New]:"New",[ve.Pending]:"Order Pending",[ve.Expired]:"Order Expired",[ve.Cancelled]:"Order Canceled",[ve.Failed]:"Order Failed",[ve.FullDeliveryFailure]:"Delivery Failure",[ve.PartiallyDelivered]:"Partial Delivery Failure",[ve.Refunded]:"Order Refunded",[ve.Completed]:"Order Completed"},dD={[ve.New]:"Your order has been created and is awaiting payment.",[ve.Pending]:"Your order is currently pending. We recommend checking back shortly for confirmation.",[ve.Expired]:"Your order has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ve.Cancelled]:"You canceled the warrant. If there are any problems, please contact support.",[ve.Failed]:"Your order could not be processed due to a payment or system error. Please try again or contact support.",[ve.FullDeliveryFailure]:"Your payment was successful but the product is currently out of stock. Please contact us below to get this sorted.",[ve.PartiallyDelivered]:"Your payment was successful but some products were out of stock. Please contact us below to get this sorted.",[ve.Refunded]:"Your order was refunded. Please check your payment method for confirmation.",[ve.Completed]:"Your order has successfully been processed. View your products below or check your email for additional information."},Hd=()=>({[ve.Completed]:i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"}),[ve.Pending]:i.jsx(v.Icon,{name:"Clock",fill:"var(--text-warning)"}),[ve.New]:i.jsx(v.Icon,{name:"Clock",fill:"var(--text-warning)"}),[ve.Expired]:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"}),[ve.Cancelled]:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"}),[ve.Failed]:i.jsx(v.Icon,{name:"XCircle",fill:"var(--text-action)"}),[ve.FullDeliveryFailure]:i.jsx(v.Icon,{name:"Warning",fill:"var(--text-warning)"}),[ve.PartiallyDelivered]:i.jsx(v.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"}),[ve.Refunded]:i.jsx(v.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"})}),Ud=({orderStatus:e,className:t})=>{var l,h;const{shopDomain:n}=b.useStorefrontStore(),{isAntistock:r,general:u}=b.useGeneralStore(),a=b.useNavigate(),s=!!((l=u==null?void 0:u.info)!=null&&l.disableSupport),o=(h=u==null?void 0:u.info)==null?void 0:h.thirdPartySupportUrl,c=!(s&&!o);return i.jsxs("div",{className:b.clx(an.orderStatusBlock,t,{[an.orderStatusBlockAntistock]:r}),children:[i.jsx("div",{className:an.iconWrapper,style:r?{background:"none"}:void 0,children:Hd()[e]}),i.jsx("h2",{className:an.orderStatusTitle,children:lD[e]}),i.jsx("p",{className:an.orderStatusDescription,children:dD[e]}),i.jsxs("div",{className:an.actionButtons,children:[i.jsx("div",{className:an.actionButton,children:i.jsxs(v.Button,{type:"Secondary",className:an.button,onClick:()=>window.open(`https://${n}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),c&&i.jsx("div",{className:an.actionButton,children:i.jsxs(v.Button,{type:"Secondary",className:an.button,onClick:()=>{s&&o?window.open(o):r?window.open(`https://${n}/support`):a("/contact")},style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(v.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},fD="_reviewMessage_1t8u4_1",hD="_leaveReviewContainer_1t8u4_11",pD="_leaveReviewTitle_1t8u4_20",gs={reviewMessage:fD,leaveReviewContainer:hD,leaveReviewTitle:pD},Vd=({review:e,orderId:t,className:n})=>{const[r,u]=D.useState((e==null?void 0:e.rating)||0),[a,s]=D.useState(!1),{setIsOpen:o}=b.useModalStore(),{notifications:c,setNotifications:l}=b.useNotificationStore(),h=async f=>{e&&"accessToken"in e&&(await v2({comment:f,rating:r,tsId:b.useGetTsId()},t,e.accessToken),l([...c,{status:"success",id:b.v4(),message:"Review left successfully"}]),s(!1))};return D.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(o(!0),s(!0))},[r]),e?e.rating&&"accessToken"in e?i.jsxs("div",{className:gs.reviewMessage,children:["You left a ",e.rating," star rating"]}):i.jsxs("div",{className:b.clx(gs.leaveReviewContainer,n),children:[i.jsx("p",{className:gs.leaveReviewTitle,children:"Leave a review"}),i.jsx(O8,{rating:r,setRating:u,disabled:!!e.rating||!("accessToken"in e)}),a&&i.jsx(v.Modal,{close:()=>s(!1),children:i.jsx($d,{setIsOpen:s,onSubmit:h})})]}):null},mD="_bottomSheet_1bcyj_1",gD="_content_1bcyj_7",bD="_title_1bcyj_18",_D="_buttonGroup_1bcyj_22",xD="_buttonWrapper_1bcyj_33",CD="_modal_1bcyj_37",ED="_header_1bcyj_44",Nn={bottomSheet:mD,content:gD,title:bD,buttonGroup:_D,buttonWrapper:xD,modal:CD,header:ED},$d=({setIsOpen:e,onSubmit:t})=>{const[n,r]=D.useState(""),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:Nn.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:Nn.header,children:[i.jsx("h3",{id:"h3",className:Nn.title,children:"Review Description"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Nn.bottomSheet,children:[i.jsx("div",{className:Nn.content,children:i.jsx(v.Textarea,{placeholder:"Great product and fast checkout...",value:n,onChange:s=>r(s),label:"Describe your review in detail below"})}),i.jsxs("div",{className:Nn.buttonGroup,children:[i.jsx("div",{className:Nn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),i.jsx("div",{className:Nn.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",disabled:!n,onClick:()=>{a(),t(n)},children:"Submit"})})]})]})]})},TD="_container_1idhv_1",yD="_buttonGroup_1idhv_8",kD="_buttonWrapper_1idhv_15",AD="_header_1idhv_19",SD="_content_1idhv_28",Gn={container:TD,buttonGroup:yD,buttonWrapper:kD,header:AD,content:SD},ID="_modal_1rkmj_1",vD="_modalPayment_1rkmj_7",ND="_title_1rkmj_15",wD="_description_1rkmj_20",Hu={modal:ID,modalPayment:vD,title:ND,description:wD},ji=()=>i.jsxs("div",{className:b.clx(Hu.modal,Hu.modalPayment),onClick:e=>e.stopPropagation(),children:[i.jsx(v.Loader,{style:{border:"4px solid var(--surface-action1)",borderLeftColor:"var(--surface-secondary)",width:"40px",height:"40px"}}),i.jsx("h2",{id:"h3",className:Hu.title,children:"Processing Payment"}),i.jsx("p",{className:Hu.description,children:"This payment is currently being processed. If you're here, it simply means that the payment was created but not complete."})]}),zd=({setIsOpen:e})=>{const{subscription:t}=b.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:u}=ou(),[a,s]=D.useState(1),o=b.useNavigate(),{setIsOpen:c}=b.useModalStore(),{setNotifications:l,notifications:h}=b.useNotificationStore(),[f,m]=D.useState(!1),p=D.useMemo(()=>n(),[u,r]),g=D.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(f)return i.jsx(ji,{});const x=(t==null?void 0:t.price.currency)||"USD",C=new Intl.NumberFormat("en-US",{style:"currency",currency:x});async function _(){var y;m(!0);try{const{data:L}=await y2((t==null?void 0:t.id)||"",{});l([{id:b.v4(),message:"Order created successfully",status:"success"}]),o(`/orders/${(y=L.data)==null?void 0:y.id}/${L.data.fullAccessToken}`)}catch(L){const S=L;l([...h,{id:b.v4(),message:`Order creation failed: ${S.message}`,status:"error"}]),N()}finally{m(!1)}}function N(){c(!1),setTimeout(()=>{e(!1)},300)}return i.jsxs("div",{className:Gn.container,onClick:y=>y.stopPropagation(),children:[i.jsxs("div",{className:Gn.header,children:[i.jsx("h3",{id:"h3",className:Gn.title,children:"Extend Subscription"}),i.jsx(v.Icon,{name:"X",onClick:N,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Gn.content,children:[i.jsx(W8,{step:a,totalSteps:12,onStepChange:s,label:"How long would you like to extend your subscription for?"}),i.jsx(Sr,{formatter:C,coupon:u,total:p.total,discount:g,totalWithDiscount:p.totalWithDiscount}),i.jsxs("div",{className:Gn.buttonGroup,children:[i.jsx("div",{className:Gn.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:N,children:"Cancel"})}),i.jsx("div",{className:Gn.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",onClick:_,children:"Extend"})})]})]})]})},DD="_bottomSheet_uw5jb_1",LD="_content_uw5jb_7",PD="_radioGroup_uw5jb_11",RD="_confirmation_uw5jb_26",OD="_iconWrapper_uw5jb_33",MD="_title_uw5jb_42",FD="_message_uw5jb_48",BD="_buttonGroup_uw5jb_54",jD="_buttonWrapper_uw5jb_64",HD="_modal_uw5jb_68",UD="_header_uw5jb_77",ut={bottomSheet:DD,content:LD,radioGroup:PD,confirmation:RD,iconWrapper:OD,title:MD,message:FD,buttonGroup:BD,buttonWrapper:jD,modal:HD,header:UD},VD={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},qd=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[u,a]=D.useState(0),[s,o]=D.useState(!1),[c,l]=D.useState(""),[h,f]=D.useState(""),{setIsOpen:m}=b.useModalStore(),p=async()=>{if(!c)return;o(!0);const x=await x2(n,r,{reason:c==="Other reason"?h:c});o(!1),x&&a(2)};D.useEffect(()=>{e||(a(0),l(""),f(""))},[e]);const g=()=>{m(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:ut.modal,onClick:x=>x.stopPropagation(),children:[i.jsxs("div",{className:ut.header,children:[i.jsx("h3",{id:"h3",children:VD[u]||""}),i.jsx(v.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:ut.content,children:[u===0&&i.jsxs("div",{className:ut.bottomSheet,children:[i.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),i.jsxs("div",{className:ut.radioGroup,children:[i.jsx(v.Radio,{defaultValue:c,onChange:x=>l(x),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"&&i.jsx(v.Textarea,{value:h,onChange:x=>f(x),placeholder:"Describe the reason..."})]}),i.jsxs("div",{className:ut.buttonGroup,children:[i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",onClick:()=>c&&a(1),disabled:!c,children:"Continue"})})]})]}),u===1&&i.jsxs("div",{className:ut.bottomSheet,children:[i.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),i.jsxs("div",{className:ut.buttonGroup,children:[i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Primary",onClick:p,disabled:s,children:"Cancel it anyway"})})]})]}),u===2&&i.jsxs("div",{className:ut.bottomSheet,children:[i.jsxs("div",{className:`${ut.confirmation}`,children:[i.jsx("div",{className:ut.iconWrapper,children:i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"})}),i.jsx("p",{className:ut.title,children:"Subscription Cancelled"}),i.jsx("p",{className:ut.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),i.jsx("div",{className:ut.buttonGroup,children:i.jsx("div",{className:ut.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Close"})})})]})]})]})},$D="_vouchCard_ntutv_1",zD="_vouchContent_ntutv_13",qD="_vouchIcon_ntutv_20",ZD="_vouchText_ntutv_29",WD="_vouchTitle_ntutv_35",YD="_vouchDescription_ntutv_42",GD="_addMessageButton_ntutv_48",XD="_vouchCardSubmitted_ntutv_53",At={vouchCard:$D,vouchContent:zD,vouchIcon:qD,vouchText:ZD,vouchTitle:WD,vouchDescription:YD,addMessageButton:GD,vouchCardSubmitted:XD},Zd=({onAddMessage:e,className:t,isSubmitted:n=!1})=>n?i.jsx("div",{className:`${At.vouchCard} ${At.vouchCardSubmitted} ${t||""}`,children:i.jsxs("div",{className:At.vouchContent,children:[i.jsx("div",{className:At.vouchIcon,children:i.jsx(v.Icon,{name:"Check"})}),i.jsxs("div",{className:At.vouchText,children:[i.jsx("h3",{className:At.vouchTitle,children:"Thank You"}),i.jsx("p",{className:At.vouchDescription,children:"We appreciate you sharing your experience with your purchase."})]})]})}):i.jsxs("div",{className:`${At.vouchCard} ${t||""}`,children:[i.jsxs("div",{className:At.vouchContent,children:[i.jsx("div",{className:At.vouchIcon,children:i.jsx(v.Icon,{name:"Star"})}),i.jsxs("div",{className:At.vouchText,children:[i.jsx("h3",{className:At.vouchTitle,children:"Leave a Vouch"}),i.jsx("p",{className:At.vouchDescription,children:"Share your experience with our team."})]})]}),i.jsx(v.Button,{type:"Secondary",onClick:e,className:At.addMessageButton,children:"Add Message"})]}),KD="_vouchModal_sh6up_1",QD="_vouchModalAntistock_sh6up_12",JD="_vouchModalHeader_sh6up_17",eL="_title_sh6up_25",tL="_closeButton_sh6up_32",nL="_vouchModalContent_sh6up_46",rL="_bottomSheet_sh6up_53",uL="_content_sh6up_61",aL="_productContainer_sh6up_65",sL="_searchContainer_sh6up_73",iL="_scrollableBox_sh6up_77",oL="_productItem_sh6up_87",cL="_productImage_sh6up_97",lL="_productName_sh6up_119",dL="_productItemError_sh6up_125",fL="_noResults_sh6up_130",hL="_fieldError_sh6up_140",pL="_vouchForm_sh6up_145",mL="_formField_sh6up_151",gL="_imagesSection_sh6up_157",bL="_imagesTitle_sh6up_163",_L="_requiredStar_sh6up_171",xL="_uploadArea_sh6up_175",CL="_uploadAreaDragOver_sh6up_189",EL="_uploadAreaUploading_sh6up_194",TL="_uploadAreaError_sh6up_200",yL="_uploadContent_sh6up_207",kL="_uploadIcon_sh6up_216",AL="_uploadText_sh6up_225",SL="_uploadSubtext_sh6up_234",IL="_browseText_sh6up_240",vL="_imagePreview_sh6up_245",NL="_imageLoading_sh6up_258",wL="_removeButton_sh6up_280",DL="_vouchModalFooter_sh6up_303",LL="_submitButton_sh6up_308",ye={vouchModal:KD,vouchModalAntistock:QD,vouchModalHeader:JD,title:eL,closeButton:tL,vouchModalContent:nL,bottomSheet:rL,content:uL,productContainer:aL,searchContainer:sL,scrollableBox:iL,productItem:oL,productImage:cL,productName:lL,productItemError:dL,noResults:fL,fieldError:hL,vouchForm:pL,formField:mL,imagesSection:gL,imagesTitle:bL,requiredStar:_L,uploadArea:xL,uploadAreaDragOver:CL,uploadAreaUploading:EL,uploadAreaError:TL,uploadContent:yL,uploadIcon:kL,uploadText:AL,uploadSubtext:SL,browseText:IL,imagePreview:vL,imageLoading:NL,removeButton:wL,vouchModalFooter:DL,submitButton:LL},Wd=({isOpen:e,onClose:t,products:n,orderId:r,accessToken:u,shopDomain:a,onSuccess:s})=>{const{isAntistock:o}=b.useGeneralStore(),{setNotifications:c,notifications:l}=b.useNotificationStore(),{setIsOpen:h}=b.useModalStore(),[f,m]=D.useState(null),[p,g]=D.useState(!1),[x,C]=D.useState(!1),[_,N]=D.useState(!1),y=D.useRef(null),[L,S]=D.useState(""),[I,F]=D.useState(""),[W,V]=D.useState(n.map($=>$.id.toString())),[P,j]=D.useState(!1),[M,J]=D.useState({}),ce=D.useRef(null),re=D.useRef(null),he=D.useRef(null),xe=()=>{var $;($=y.current)==null||$.click()},He=D.useCallback(async $=>{var ee,ie,ae,Re,R;if(!$.type.startsWith("image/")){c([...l,{id:b.v4(),message:"Please select a valid image file",status:"error"}]);return}if($.size>10*1024*1024){c([...l,{id:b.v4(),message:"File size must be less than 10MB",status:"error"}]);return}g(!0),J(Y=>({...Y,image:void 0}));try{const Y=await Jc($),U=(ie=(ee=Y.data)==null?void 0:ee.data)==null?void 0:ie.imageId,Z=(Re=(ae=Y.data)==null?void 0:ae.data)==null?void 0:Re.url;if(!U||!Z)throw new Error(Y.data.message||"Upload failed");m({id:U.toString(),url:Z}),C(!0)}catch(Y){let U="Failed to upload image";const Z=Y;if((R=Z==null?void 0:Z.response)!=null&&R.data){const se=Z.response.data;se.message&&se.errors&&Array.isArray(se.errors)||se.errors&&Array.isArray(se.errors)?U=se.errors.join(", "):se.message&&(U=se.message)}else Y instanceof Error&&(U=Y.message);c([...l,{id:b.v4(),message:U,status:"error"}])}finally{g(!1),y.current&&(y.current.value="")}},[l,c]),we=async $=>{const ee=$.target.files;!ee||ee.length===0||await He(ee[0])},E=$=>{$.preventDefault(),$.stopPropagation(),N(!0)},G=$=>{$.preventDefault(),$.stopPropagation(),N(!1)},ue=async $=>{$.preventDefault(),$.stopPropagation(),N(!1);const ee=$.dataTransfer.files;ee&&ee.length>0&&await He(ee[0])},A=D.useMemo(()=>I.trim()?new Gc.Fuse(n,{keys:["name"],threshold:.3}).search(I).map(ee=>ee.item):n,[n,I]),te=$=>{V(ee=>ee.includes($)&&ee.length===1?ee:ee.includes($)?ee.filter(ie=>ie!==$):[...ee,$]),J(ee=>({...ee,selectedProducts:void 0}))},oe=async()=>{var ee;J({});const $={};if(W.length===0&&($.selectedProducts="Please select at least one product"),f||($.image="Please upload a screenshot"),L.trim()||($.message="Please enter a message"),Object.keys($).length>0){J($),setTimeout(()=>{$.selectedProducts&&ce.current?ce.current.scrollIntoView({behavior:"smooth",block:"center"}):$.image&&re.current?re.current.scrollIntoView({behavior:"smooth",block:"center"}):$.message&&he.current&&he.current.scrollIntoView({behavior:"smooth",block:"center"})},100);return}if(!r||!u||!a||!f){c([...l,{id:b.v4(),message:"Missing required information",status:"error"}]),j(!1);return}try{const ie={imageId:parseInt(f.id),productIds:W.map(ae=>parseInt(ae)),comment:L.trim(),tsId:b.v4()};await j2(ie,a,r,u),c([...l,{id:b.v4(),message:"Vouch submitted successfully",status:"success"}]),s==null||s(),t()}catch(ie){console.log({error:ie});let ae="Failed to submit vouch",Re="";const R=ie;if((ee=R==null?void 0:R.response)!=null&&ee.data){const Y=R.response.data;Y.message&&Y.errors&&Array.isArray(Y.errors)?(Re=Y.message,ae=Y.errors.join(", ")):Y.errors&&Array.isArray(Y.errors)?ae=Y.errors.join(", "):Y.message&&(ae=Y.message)}else ie instanceof Error&&(ae=ie.message);c([...l,{id:b.v4(),message:ae,status:"error",label:Re}])}finally{j(!1)}},ne=()=>{S(""),m(null),F(""),V(n.map($=>$.id.toString())),J({}),t()};return D.useEffect(()=>{e&&V(n.map($=>$.id.toString()))},[e,n]),D.useEffect(()=>{e&&h(!0)},[e,h]),e?i.jsx(v.Modal,{close:ne,withAnimation:!o,children:i.jsxs("div",{className:b.clx(ye.vouchModal,{[ye.vouchModalAntistock]:o}),onClick:$=>$.stopPropagation(),children:[i.jsxs("div",{className:ye.vouchModalHeader,children:[i.jsx("h3",{className:ye.title,children:"Vouch"}),i.jsx("button",{className:ye.closeButton,onClick:ne,children:i.jsx(v.Icon,{name:"X"})})]}),i.jsxs("div",{className:ye.vouchModalContent,children:[i.jsx("div",{className:ye.bottomSheet,children:i.jsxs("div",{className:ye.content,children:[i.jsxs("div",{className:ye.productContainer,children:[i.jsx("div",{className:ye.searchContainer,children:i.jsx(v.Input,{onChange:F,isSearch:!0,value:I,placeholder:"Search for products",label:"Products *"})}),i.jsx("div",{ref:ce,className:ye.scrollableBox,children:A.length>0?A.map($=>i.jsxs("div",{className:b.clx(ye.productItem,{[ye.productItemError]:M.selectedProducts&&!W.includes($.id.toString())}),onClick:()=>te($.id.toString()),children:[i.jsx("div",{className:ye.productImage,children:$.image?i.jsx("img",{src:b.convertCfImageIdToUrl($.image.cfId),alt:$.name}):i.jsx(v.Icon,{name:"Image"})}),i.jsx("span",{className:ye.productName,children:$.name}),i.jsx(v.Checkbox,{value:W.includes($.id.toString()),onChange:()=>te($.id.toString()),disabled:W.length===1&&W.includes($.id.toString())})]},$.id)):i.jsx("div",{className:ye.noResults,children:i.jsx("p",{children:"No products found"})})}),M.selectedProducts&&i.jsx("div",{className:ye.fieldError,children:M.selectedProducts})]}),i.jsx("div",{className:ye.vouchForm,children:i.jsxs("div",{className:ye.formField,ref:re,children:[i.jsxs("div",{className:ye.imagesSection,children:[i.jsxs("h4",{className:ye.imagesTitle,children:["Screenshot",i.jsx("span",{className:ye.requiredStar,children:" *"})]}),f?i.jsxs("div",{className:ye.imagePreview,children:[x&&i.jsx("div",{className:ye.imageLoading,children:i.jsx(v.Icon,{name:"Loader"})}),i.jsx("img",{src:f.url,alt:"Screenshot",onLoad:()=>C(!1),onError:()=>C(!1),style:{opacity:x?0:1}}),i.jsx("button",{className:ye.removeButton,onClick:()=>{m(null),C(!1)},children:i.jsx(v.Icon,{name:"X"})})]}):i.jsx("div",{className:b.clx(ye.uploadArea,{[ye.uploadAreaDragOver]:_,[ye.uploadAreaUploading]:p,[ye.uploadAreaError]:M.image}),onDragOver:E,onDragLeave:G,onDrop:ue,onClick:xe,tabIndex:0,children:i.jsxs("div",{className:ye.uploadContent,children:[i.jsx("div",{className:ye.uploadIcon,children:i.jsx(v.Icon,{name:"CloudArrowUpIcon"})}),i.jsx("div",{className:ye.uploadText,children:p?i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"Uploading image..."}),i.jsx("p",{className:ye.uploadSubtext,children:"Please wait"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Drop your image here, or ",i.jsx("span",{className:ye.browseText,children:"tap to browse"})]}),i.jsx("p",{className:ye.uploadSubtext,children:"Maximum of 10MB per image"})]})})]})}),i.jsx("input",{type:"file",ref:y,onChange:we,accept:"image/*",style:{display:"none"}}),M.image&&i.jsx("div",{className:ye.fieldError,children:M.image})]}),i.jsxs("div",{className:ye.formField,ref:he,children:[i.jsx(v.Textarea,{label:"Message *",value:L,onChange:S,placeholder:"Instant product delivery, paid with balance...",error:M.message,maxLength:150}),M.message&&i.jsx("div",{className:ye.fieldError,children:M.message})]})]})})]})}),i.jsx("div",{className:ye.vouchModalFooter,children:i.jsx(v.Button,{type:"Primary",onClick:oe,disabled:P||p,className:ye.submitButton,children:P?"SUBMITTING...":"LEAVE A VOUCH"})})]})]})}):null},PL=Object.freeze(Object.defineProperty({__proto__:null,ActivePaymentMethod:Fd,ActiveSubscriptionProduct:Bd,Auth:si,AuthLogin:a0,AuthModal:C0,AuthRequestOtp:u0,CHARGE_STATUS_DESCRIPTION:Ad,CHARGE_STATUS_DISPLAY_NAME:Kn,CancelSubscription:qd,CashAppVerify:wd,ChangeSubscriptionPlan:Rd,ChargeBlocksRenderer:na,ChargeItems:Nd,ChargeStatusBlock:Id,CheckoutBalancePaymentMethod:oi,CheckoutFooter:Vn,CheckoutHeader:ba,CheckoutItems:g0,CheckoutOperational:yd,CheckoutOrderMainData:Fi,CheckoutPaymentMethod:ci,CheckoutPrices:Sr,CheckoutProduct:_a,ChoosePlanUpgradeMethod:jd,ConnectDiscord:x0,CustomField:_0,CustomFields:b0,CustomerDashboard:L4,LeaveAReview:Vd,NoItemsBlock:ma,OpenDelivery:kd,OrderStatusBlock:Ud,OrdersTable:l0,PageLoading:jN,PageTitle:pa,Pagination:d0,PaginationWithRange:pu,PayPalFFNote:vd,PaymentMethods:li,ProcessingPaymentModal:ji,ProtectYourCheckout:Td,ReferralBlock:s0,ReferralBlockInfo:o0,ReferralBlockSteps:i0,SecuredBySsl:Mi,Sidebar:jl,SkeletonReferralBlock:c0,StatItem:It,StatusIndicator:h0,StatusVariant:Hn,SubmitReview:$d,SubscriptionCoupon:Md,SubscriptionExpiration:zd,SubscriptionExpirationDate:Od,SubscriptionProduct:Pd,SubscriptionStatusBadge:Bi,SubscriptionsTable:Ld,Table:ga,TableItem:ct,TableItemTitle:wt,TermsOfService:Oi,TicketRow:Dd,TrackPayment:Da,VouchCard:Zd,VouchModal:Wd,getChargeStatusIcon:Sd,getOrderStatusIcon:Hd,getPaginationText:f0},Symbol.toStringTag,{value:"Module"})),RL="_chargePageContainer_1azbl_1",OL="_chargeItems_1azbl_14",ML="_mainContent_1azbl_25",FL="_contentWrapper_1azbl_44",BL="_antistockContent_1azbl_53",jL="_statusBlock_1azbl_58",HL="_statusBlockAntistock_1azbl_63",UL="_notPaidSection_1azbl_68",VL="_antistockPayNow_1azbl_82",$L="_antistockFooter_1azbl_86",zL="_antistockTrackPayment_1azbl_96",qL="_footer_1azbl_106",ZL="_loaderContainer_1azbl_128",Ot={chargePageContainer:RL,chargeItems:OL,mainContent:ML,contentWrapper:FL,antistockContent:BL,statusBlock:jL,statusBlockAntistock:HL,notPaidSection:UL,antistockPayNow:VL,antistockFooter:$L,antistockTrackPayment:zL,footer:qL,loaderContainer:ZL},WL=()=>{const{id:e}=b.useParams(),[t,n]=b.useSearchParams(),[r,u]=D.useState(!1),[a,s]=D.useState(),[o,c]=D.useState(!0),l=b.useNavigate(),h=D.useRef(),f=D.useRef(!1),{setIsOpen:m}=b.useModalStore(),{isAntistock:p}=b.useGeneralStore();return D.useEffect(()=>{const g=async(C,_=!1)=>{_||u(!0);const{data:N}=await N2(C);u(!1),s(N)},x=setInterval(()=>{e&&g(e,!0)},5e3);return e&&g(e),()=>{clearInterval(x)}},[]),D.useEffect(()=>{const g=setTimeout(()=>{var C;console.log("charge timeout",a);const x=t.get("redirectRoute");if((a==null?void 0:a.status)===ke.Paid&&a.redirectUrl&&!h.current){const N=JSON.parse(localStorage.getItem("orders")||"{}")[((C=a==null?void 0:a.order)==null?void 0:C.id)||""];N?window.open(N.fullAccessToken?`${a.redirectUrl}/${N.fullAccessToken}`:`${a.redirectUrl}`,"_self"):window.open(a.redirectUrl,"_self")}(a==null?void 0:a.status)===ke.Paid&&h.current&&(console.log("redirectRouteRef.current",h.current),l(h.current,{replace:!0})),x&&h&&(h.current=x,t.delete("redirectRoute"),n(t))},1e3);return()=>clearTimeout(g)},[a]),D.useEffect(()=>{((a==null?void 0:a.gateway)==="PayPalFF"||(a==null?void 0:a.gateway)==="Сashapp")&&m(!0)},[a]),D.useEffect(()=>{var g;if(a!=null&&a.displayPaymentInfo&&a.displayPaymentInfo.length===1&&a.status===ke.NotPaid&&!f.current){const x=a.displayPaymentInfo[0];x.type==="Button"&&((g=x.props)!=null&&g.url)&&(window.open(x.props.url,"_blank"),f.current=!0)}},[a==null?void 0:a.displayPaymentInfo,a==null?void 0:a.status]),r?i.jsx("div",{className:Ot.loaderContainer,children:i.jsx(v.Loader,{})}):i.jsxs("div",{className:Ot.chargePageContainer,children:[i.jsx("div",{className:Ot.chargeItems,children:i.jsx(Nd,{charge:a})}),i.jsx("div",{className:Ot.mainContent,style:p?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:i.jsxs("div",{className:b.clx(Ot.contentWrapper,{[Ot.antistockContent]:p}),children:[a&&(a==null?void 0:a.status)!==ke.NotPaid&&i.jsx(Id,{charge:a}),a&&i.jsxs("div",{className:b.clx(Ot.statusBlock,{[Ot.statusBlockAntistock]:p}),children:[i.jsx(Fi,{lastUpdate:a.expiresAt,email:a.customerForCharge.email,invoiceId:a.id,paymentType:a.gateway}),p&&(a==null?void 0:a.status)===ke.NotPaid&&i.jsx("div",{className:Ot.antistockPayNow,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(na,{block:g},x))}),p&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Ot.antistockTrackPayment,children:i.jsx(Da,{timeline:a.timeline})}),i.jsx(Vn,{className:Ot.antistockFooter})]})]}),!p&&(a==null?void 0:a.status)===ke.NotPaid&&i.jsx("div",{className:Ot.notPaidSection,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(na,{block:g},x))}),!p&&i.jsx(Vn,{className:Ot.footer})]})}),(a==null?void 0:a.gateway)==="PayPalFF"&&o&&i.jsx(v.Modal,{close:()=>c(!1),children:i.jsx(vd,{price:a.price,setIsOpen:c})}),(a==null?void 0:a.gateway)==="Сashapp"&&o&&i.jsx(v.Modal,{close:()=>u(!1),children:i.jsx(wd,{setIsOpen:c,chargeId:a.id})})]})},YL=Object.freeze(Object.defineProperty({__proto__:null,ChargePage:WL},Symbol.toStringTag,{value:"Module"}));exports.ActivePaymentMethod=Fd;exports.ActiveSubscriptionProduct=Bd;exports.BalanceModal=Wl;exports.ChangeSubscriptionPlan=Rd;exports.ChargeStatus=ke;exports.CheckoutFooter=Vn;exports.CheckoutHeader=ba;exports.CheckoutItems=g0;exports.CheckoutOperational=yd;exports.CheckoutOrderMainData=Fi;exports.CheckoutPrices=Sr;exports.CheckoutProduct=_a;exports.LeaveAReview=Vd;exports.MarkdownText=fa;exports.NoItemsBlock=ma;exports.OrderStatus=ve;exports.OrderStatusBlock=Ud;exports.OrdersTable=l0;exports.PageTitle=pa;exports.PaginationWithRange=pu;exports.ReCaptchaProvider=Ks;exports.StableText=Qc;exports.SubscriptionCoupon=Md;exports.SubscriptionExpirationDate=Od;exports.SubscriptionProduct=Pd;exports.SubscriptionsTable=Ld;exports.Table=ga;exports.TableItemTitle=wt;exports.TicketRow=Dd;exports.TrackPayment=Da;exports.VouchCard=Zd;exports.VouchModal=Wd;exports.auth=D2;exports.fetchAuthorizedOrder=h2;exports.fetchGeneral=Kd;exports.fetchOrder=f2;exports.fetchOrders=d2;exports.fetchPrivacyPolicy=c2;exports.fetchRefundPolicy=o2;exports.fetchSubscription=b2;exports.fetchSubscriptions=E2;exports.fetchTerms=i2;exports.fetchThemeAndSettings=Qd;exports.fetchTicket=k2;exports.fetchTickets=S2;exports.getBalance=ia;exports.getBalanceSettings=fl;exports.getGatewaysDetail=lu;exports.index=PL;exports.index$1=YL;exports.parseDraftJsText=dl;exports.recapcha=Ef;exports.sendTicketMessage=A2;exports.useCart=ou;exports.useCopy=tr;exports.useGeneralInfo=sl;exports.useMarkdownIt=Bl;exports.useReCaptcha=cu;