@billgangcom/theme-lib 1.110.7 → 1.110.8

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 (39) hide show
  1. package/dist/{builder-B7hjBRYI.cjs → builder-Ylu8KeuJ.cjs} +2 -2
  2. package/dist/{builder-components-BjoFBErH.cjs → builder-components-DNX0cR4w.cjs} +1 -1
  3. package/dist/{builder-components-DN-mNdj8.js → builder-components-Q4JP7qec.js} +4 -4
  4. package/dist/{builder-D_zv5ue0.js → builder-sxsr8tvQ.js} +5 -5
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +22 -22
  7. package/dist/{charge-BQUHzEju.js → charge-BHimo0Ia.js} +23 -6
  8. package/dist/{charge-BAP3iPAM.cjs → charge-DmSElVXn.cjs} +2 -2
  9. package/dist/{checkout-CUct7uCm.cjs → checkout-ChWWQWwh.cjs} +1 -1
  10. package/dist/{checkout-uzxtu1pZ.js → checkout-d6wvO34l.js} +5 -5
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-R_FZBtaZ.cjs → index-005iXpfH.cjs} +1 -1
  14. package/dist/{index-CEMbDy4G.cjs → index-0L3KsVSz.cjs} +1 -1
  15. package/dist/{index-BJMeFohP.js → index-1u-bUz7Q.js} +1 -1
  16. package/dist/{index-BBMTjm8A.cjs → index-51gUpKgC.cjs} +1 -1
  17. package/dist/{index-hCDY-ip7.js → index-BIE-2CDi.js} +5 -5
  18. package/dist/{index-Cbqz9kIG.cjs → index-CAvNpYWK.cjs} +1 -1
  19. package/dist/{index-CzkkQ8sH.js → index-CULkU3uk.js} +5 -5
  20. package/dist/{index-CMECtXvH.js → index-YFPDL2Gb.js} +5 -5
  21. package/dist/{index-CX1FV9wS.js → index-fcZNDgyv.js} +5 -5
  22. package/dist/{index-BXhAWCRX.cjs → index-tZaYQ2je.cjs} +1 -1
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.es.js +6 -6
  25. package/dist/{order-CdPcB1OE.js → order-D4m9MM2M.js} +5 -5
  26. package/dist/{order-BOaO9a-C.cjs → order-ZUA6jQ9p.cjs} +1 -1
  27. package/dist/{subscription-DIDUTEI3.js → subscription-CTSwv1tc.js} +5 -5
  28. package/dist/{subscription-iNnLGi0T.cjs → subscription-CWcuwOPh.cjs} +1 -1
  29. package/dist/{ticket-DXz_-29l.cjs → ticket-BKgu1XN7.cjs} +1 -1
  30. package/dist/{ticket-B0VGIvyK.js → ticket-CXMhORtd.js} +5 -5
  31. package/dist/{top-up-BhB8jhP6.js → top-up-BQz5oQLf.js} +5 -5
  32. package/dist/{top-up-B7E7FUjn.cjs → top-up-ChgnBzTg.cjs} +1 -1
  33. package/dist/{ui-components-CWLDlDmG.cjs → ui-components-JpkNO8Mq.cjs} +1 -1
  34. package/dist/{ui-components-BTotDG_w.js → ui-components-lP2XJY6B.js} +4 -4
  35. package/dist/ui.cjs.js +1 -1
  36. package/dist/ui.es.js +1 -1
  37. package/dist/{validation-BVAD1q1L.cjs → validation-CTtD_Uas.cjs} +1 -1
  38. package/dist/{validation-jCwzu5MC.js → validation-Dp5GCtLg.js} +5 -5
  39. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";const g=require("./builder-B7hjBRYI.cjs"),s=require("react/jsx-runtime"),P=require("react"),w=require("./ui-components-CWLDlDmG.cjs");require("./builder-components-BjoFBErH.cjs");const Uc=require("./ticket-DXz_-29l.cjs");require("react-dom");const Vc=require("./order-BOaO9a-C.cjs"),Od=require("./subscription-iNnLGi0T.cjs");function Md(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 ne=Md(P),Fd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,zc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=P.useState(!1);return P.useEffect(()=>{typeof window<"u"&&a(Fd())},[]),u?s.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):s.jsx(n,{className:t,...r,children:e})};async function Bd(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await g.request({method:"get",url:r,withToken:!1})).data}const jd=async()=>{const e=g.useApiStore.getState().apiUrls,t=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await g.request({url:n,withToken:!0,method:"get"})},Hd=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},Ud=async(e,t)=>{const r=`${g.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await g.request({url:r,method:"post",body:e,withToken:!1})},_r=async e=>{const t=g.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},Vd=()=>_r("dash/info"),zd=()=>_r("dash/dashboard/home"),$d=()=>_r("rewards"),qd=()=>_r("balance"),Zd=()=>_r("balance/top-up/settings"),Wd=()=>_r("referral-system"),Fi=e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return g.request({url:r,withToken:!1,method:"get"})},Yd=()=>Fi("terms"),Gd=()=>Fi("refund-policy"),Xd=()=>Fi("privacy-policy"),oi=10,Xu=async({url:e,PageNumber:t})=>{var o;const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${oi}`,a=await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),i=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:i}},Bi=async(e,t="get",n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await g.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},Qd=e=>Bi("","post",e),Kd=({PageNumber:e})=>Xu({url:"customers/orders",PageNumber:e}),Jd=e=>Bi(e),e2=e=>Bi(e),t2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await g.request({url:r,method:"post",withToken:!1,body:e})},n2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},r2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await g.request({url:u,method:"get",withToken:!1})},u2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await g.request({url:a,method:"post",withToken:!1,body:n})},a2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await g.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},i2=({PageNumber:e})=>Xu({url:"customers/subscriptions",PageNumber:e}),s2=async({id:e,accessToken:t})=>await r2(e,t),o2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await g.request({url:u,method:"post",withToken:!1,body:t})},c2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},l2=async(e,t,n,r,u)=>{const a=g.useApiStore.getState().apiUrls,i=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${i}/tickets/${e}/${t}/answer`;return(await g.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},d2=({PageNumber:e})=>Xu({url:"customers/tickets",PageNumber:e}),f2=({PageNumber:e})=>Xu({url:"customers/balance/transactions",PageNumber:e}),h2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await g.request({url:a,method:"post",withToken:!1,body:e})},p2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await g.request({url:r,method:"get",withToken:!1})},$c=async e=>{const t=g.useApiStore.getState().apiUrls,n=e.map(i=>["names",i]),r=new URLSearchParams(n),u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await g.request({url:a,method:"get",withToken:!1})},qc=async({email:e,recaptcha:t,tsId:n})=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await g.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},Zc=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=g.useApiStore.getState().apiUrls,a=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await g.request({url:i,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return g.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},ci=async()=>{g.useStorefrontStore.getState().setToken(""),g.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},m2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:Zc,logoutCustomer:ci,requestOtp:qc},Symbol.toStringTag,{value:"Module"})),b2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await g.request({url:r,method:"post",body:e,withToken:!1})},g2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await g.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},_2=async()=>{const{data:e}=await Wd();return e},x2=async e=>{const{data:t}=await g2(e);return t},C2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},E2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await g.request({url:r,method:"get",withToken:!1})};async function T2(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return g.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const ya="Balance",Sn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},y2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Rs=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,i=e.find(h=>h.id===n);if(!i)throw new Error("Product does not exist");const o=i.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=g.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},k2=(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},A2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(b=>(b==null?void 0:b.id)===u.productId),i=a==null?void 0:a.variants.find(b=>b.id===u.productVariantId);if(!i)return;const{gateway:o}=g.useCartStore.getState().cart,c=(i==null?void 0:i.gateways)||[],l=c.some(b=>b.name===o&&b.overrodePrice)?(m=c.find(b=>b.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)||(i==null?void 0:i.price.amount)||0,f=h*u.quantity):f=i!=null&&i.subscriptionSettings?i.subscriptionSettings.price.amount+(((p=i.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const b=k2(i,u.quantity),x=f*(1-b/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},S2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(i=>(i==null?void 0:i.id)===r.productId);return(a=u==null?void 0:u.variants.find(i=>i.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(i=>(i==null?void 0:i.id)===r.productId);return(a=u==null?void 0:u.variants.find(i=>i.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Ps=e=>new Set(e.gateways.map(t=>t.name)),ka={availableGateways:[],requiresSignInGateways:[]},Os=(e,t)=>{if(t.length===0)return ka;const n=e[0];if(!n)return ka;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 ka;const a=Ps(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=Ps(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(ya)?(a.delete(ya),{availableGateways:[...a],requiresSignInGateways:[ya]}):{availableGateways:[...a],requiresSignInGateways:[]}},Ms=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const i=t.find(c=>c.id===a.productId),o=i==null?void 0:i.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,i)=>{const o=a[i.name];return o?(i.required&&!o.required&&(a[i.name]={...i,value:i.defaultValue}),a):(a[i.name]={...i,value:i.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},I2=(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},nu=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:i,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=g.useCartStore(),f=async x=>{var V;h(!0);const{cart:E}=g.useCartStore.getState(),{gateway:_,parts:I}=E,{notifications:k,setNotifications:D}=g.useNotificationStore.getState();_||(h(!1),D([...k,{message:"There should be a gateway for the coupon",status:"error",id:g.v4()}]));const N=I.map(Y=>Y.productId);let v=null;try{const{data:Y}=await b2({gateway:_,couponName:x,productIds:N});v=Y.data,D([...k,{message:"Coupon is applied",status:"success",id:g.v4()}]),i(Z=>({...Z,coupon:x}))}catch(Y){const Z=Y;D([...k,{message:`Coupon is not applied: ${Z.message}`,status:"error",id:g.v4()}]),i(L=>({...L,coupon:null})),c(null),h(!1)}if(h(!1),(V=v==null?void 0:v.restrictToProductIds)!=null&&V.length&&!N.every(Y=>{var Z;return(Z=v==null?void 0:v.restrictToProductIds)==null?void 0:Z.includes(Y)}))throw new Error("Coupon can't be applied to such products");return c(v),v},b={reset(){i({...y2})},addProducts:x=>{const E=g.useCartStore.getState().products,_=x.filter(I=>!E.some(k=>k.id===I.id));o([...E,..._])},addProductToCart:x=>{const E=g.useCartStore.getState().cart;try{Rs(t,x)}catch(I){throw new Error(I)}const _=E.parts.find(I=>I.productId===x.productId&&I.productVariantId===x.productVariantId&&I.chargeType===x.chargeType);if(_)return b.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(E.parts.length&&Os([...E.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");i({...E,parts:[...E.parts,x]}),E.coupon&&f(E.coupon)},removeProduct({productId:x,productVariantId:E}){i(_=>({..._,parts:_.parts.filter(I=>I.productId!==x||I.productVariantId!==E)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Os(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return S2(t,e.parts)},updateQuantityOfProduct(x){Rs(t,x),i(E=>({...E,parts:E.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=g.useCartStore.getState(),{total:E,totalWithVolumeDiscounts:_}=A2(e.parts,t);let I;const k=_;return x&&x.discount?!x.isFixed&&x.discount===100?I=0:I=x.isFixed?Math.max(0,k-x.discount):k*(1-x.discount/100):_!==E&&(I=_),{total:E,totalWithVolumeDiscounts:_!==E?_:void 0,totalWithDiscount:I}},setGateway(x){i(_=>({..._,gateway:x}));const{isAntistock:E}=g.useGeneralStore.getState();e.coupon&&!E&&f(e.coupon)},setPaymentMethod(x){i(E=>({...E,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:E}=g.useCartStore.getState(),{discordInfo:_}=g.useDiscordStore.getState();let I;if(E.parts&&a&&I2(E.parts[0],t))try{const{data:k}=await t2({gateway:E.gateway,coupon:E.coupon,partOrder:E.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...E.customFields},tsId:g.useGetTsId()});I=k.data}catch(k){console.error(k)}else try{const{data:k}=await Qd({gateway:E.gateway,parts:[...E.parts],coupon:E.coupon,customerEmail:E.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...E.customFields},tsId:g.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null});I=k.data}catch(k){const D=k,{notifications:N,setNotifications:v}=g.useNotificationStore.getState();v([...N,{message:`Failed to create order: ${D.message}`,status:"error",id:g.v4()}])}if(l(!1),I)return I;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){i(E=>({...E,discordSocialConnectId:x}))},setCustomFields(x){i(E=>({...E,customFields:{...x}}))}};return P.useEffect(()=>{i(x=>({...x,customerEmail:a??""}))},[a,i]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...b}},Yn=()=>{const{notifications:e,setNotifications:t}=g.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:g.v4()}])}};var li={exports:{}},mu={exports:{}},Ie={};/** @license React v16.13.1
1
+ "use strict";const g=require("./builder-Ylu8KeuJ.cjs"),s=require("react/jsx-runtime"),P=require("react"),w=require("./ui-components-JpkNO8Mq.cjs");require("./builder-components-DNX0cR4w.cjs");const Uc=require("./ticket-BKgu1XN7.cjs");require("react-dom");const Vc=require("./order-ZUA6jQ9p.cjs"),Od=require("./subscription-CWcuwOPh.cjs");function Md(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 ne=Md(P),Fd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,zc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=P.useState(!1);return P.useEffect(()=>{typeof window<"u"&&a(Fd())},[]),u?s.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):s.jsx(n,{className:t,...r,children:e})};async function Bd(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await g.request({method:"get",url:r,withToken:!1})).data}const jd=async()=>{const e=g.useApiStore.getState().apiUrls,t=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await g.request({url:n,withToken:!0,method:"get"})},Hd=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},Ud=async(e,t)=>{const r=`${g.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await g.request({url:r,method:"post",body:e,withToken:!1})},_r=async e=>{const t=g.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},Vd=()=>_r("dash/info"),zd=()=>_r("dash/dashboard/home"),$d=()=>_r("rewards"),qd=()=>_r("balance"),Zd=()=>_r("balance/top-up/settings"),Wd=()=>_r("referral-system"),Fi=e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return g.request({url:r,withToken:!1,method:"get"})},Yd=()=>Fi("terms"),Gd=()=>Fi("refund-policy"),Xd=()=>Fi("privacy-policy"),oi=10,Xu=async({url:e,PageNumber:t})=>{var o;const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${oi}`,a=await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),i=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:i}},Bi=async(e,t="get",n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await g.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},Qd=e=>Bi("","post",e),Kd=({PageNumber:e})=>Xu({url:"customers/orders",PageNumber:e}),Jd=e=>Bi(e),e2=e=>Bi(e),t2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await g.request({url:r,method:"post",withToken:!1,body:e})},n2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},r2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await g.request({url:u,method:"get",withToken:!1})},u2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await g.request({url:a,method:"post",withToken:!1,body:n})},a2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await g.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},i2=({PageNumber:e})=>Xu({url:"customers/subscriptions",PageNumber:e}),s2=async({id:e,accessToken:t})=>await r2(e,t),o2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await g.request({url:u,method:"post",withToken:!1,body:t})},c2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},l2=async(e,t,n,r,u)=>{const a=g.useApiStore.getState().apiUrls,i=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${i}/tickets/${e}/${t}/answer`;return(await g.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},d2=({PageNumber:e})=>Xu({url:"customers/tickets",PageNumber:e}),f2=({PageNumber:e})=>Xu({url:"customers/balance/transactions",PageNumber:e}),h2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await g.request({url:a,method:"post",withToken:!1,body:e})},p2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await g.request({url:r,method:"get",withToken:!1})},$c=async e=>{const t=g.useApiStore.getState().apiUrls,n=e.map(i=>["names",i]),r=new URLSearchParams(n),u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await g.request({url:a,method:"get",withToken:!1})},qc=async({email:e,recaptcha:t,tsId:n})=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await g.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},Zc=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=g.useApiStore.getState().apiUrls,a=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await g.request({url:i,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return g.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},ci=async()=>{g.useStorefrontStore.getState().setToken(""),g.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},m2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:Zc,logoutCustomer:ci,requestOtp:qc},Symbol.toStringTag,{value:"Module"})),b2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await g.request({url:r,method:"post",body:e,withToken:!1})},g2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await g.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},_2=async()=>{const{data:e}=await Wd();return e},x2=async e=>{const{data:t}=await g2(e);return t},C2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},E2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await g.request({url:r,method:"get",withToken:!1})};async function T2(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return g.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const ya="Balance",Sn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},y2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Rs=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,i=e.find(h=>h.id===n);if(!i)throw new Error("Product does not exist");const o=i.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=g.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},k2=(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},A2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(b=>(b==null?void 0:b.id)===u.productId),i=a==null?void 0:a.variants.find(b=>b.id===u.productVariantId);if(!i)return;const{gateway:o}=g.useCartStore.getState().cart,c=(i==null?void 0:i.gateways)||[],l=c.some(b=>b.name===o&&b.overrodePrice)?(m=c.find(b=>b.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)||(i==null?void 0:i.price.amount)||0,f=h*u.quantity):f=i!=null&&i.subscriptionSettings?i.subscriptionSettings.price.amount+(((p=i.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const b=k2(i,u.quantity),x=f*(1-b/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},S2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(i=>(i==null?void 0:i.id)===r.productId);return(a=u==null?void 0:u.variants.find(i=>i.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(i=>(i==null?void 0:i.id)===r.productId);return(a=u==null?void 0:u.variants.find(i=>i.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Ps=e=>new Set(e.gateways.map(t=>t.name)),ka={availableGateways:[],requiresSignInGateways:[]},Os=(e,t)=>{if(t.length===0)return ka;const n=e[0];if(!n)return ka;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 ka;const a=Ps(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=Ps(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(ya)?(a.delete(ya),{availableGateways:[...a],requiresSignInGateways:[ya]}):{availableGateways:[...a],requiresSignInGateways:[]}},Ms=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const i=t.find(c=>c.id===a.productId),o=i==null?void 0:i.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,i)=>{const o=a[i.name];return o?(i.required&&!o.required&&(a[i.name]={...i,value:i.defaultValue}),a):(a[i.name]={...i,value:i.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},I2=(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},nu=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:i,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=g.useCartStore(),f=async x=>{var V;h(!0);const{cart:E}=g.useCartStore.getState(),{gateway:_,parts:I}=E,{notifications:k,setNotifications:D}=g.useNotificationStore.getState();_||(h(!1),D([...k,{message:"There should be a gateway for the coupon",status:"error",id:g.v4()}]));const N=I.map(Y=>Y.productId);let v=null;try{const{data:Y}=await b2({gateway:_,couponName:x,productIds:N});v=Y.data,D([...k,{message:"Coupon is applied",status:"success",id:g.v4()}]),i(Z=>({...Z,coupon:x}))}catch(Y){const Z=Y;D([...k,{message:`Coupon is not applied: ${Z.message}`,status:"error",id:g.v4()}]),i(L=>({...L,coupon:null})),c(null),h(!1)}if(h(!1),(V=v==null?void 0:v.restrictToProductIds)!=null&&V.length&&!N.every(Y=>{var Z;return(Z=v==null?void 0:v.restrictToProductIds)==null?void 0:Z.includes(Y)}))throw new Error("Coupon can't be applied to such products");return c(v),v},b={reset(){i({...y2})},addProducts:x=>{const E=g.useCartStore.getState().products,_=x.filter(I=>!E.some(k=>k.id===I.id));o([...E,..._])},addProductToCart:x=>{const E=g.useCartStore.getState().cart;try{Rs(t,x)}catch(I){throw new Error(I)}const _=E.parts.find(I=>I.productId===x.productId&&I.productVariantId===x.productVariantId&&I.chargeType===x.chargeType);if(_)return b.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(E.parts.length&&Os([...E.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");i({...E,parts:[...E.parts,x]}),E.coupon&&f(E.coupon)},removeProduct({productId:x,productVariantId:E}){i(_=>({..._,parts:_.parts.filter(I=>I.productId!==x||I.productVariantId!==E)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Os(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return S2(t,e.parts)},updateQuantityOfProduct(x){Rs(t,x),i(E=>({...E,parts:E.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=g.useCartStore.getState(),{total:E,totalWithVolumeDiscounts:_}=A2(e.parts,t);let I;const k=_;return x&&x.discount?!x.isFixed&&x.discount===100?I=0:I=x.isFixed?Math.max(0,k-x.discount):k*(1-x.discount/100):_!==E&&(I=_),{total:E,totalWithVolumeDiscounts:_!==E?_:void 0,totalWithDiscount:I}},setGateway(x){i(_=>({..._,gateway:x}));const{isAntistock:E}=g.useGeneralStore.getState();e.coupon&&!E&&f(e.coupon)},setPaymentMethod(x){i(E=>({...E,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:E}=g.useCartStore.getState(),{discordInfo:_}=g.useDiscordStore.getState();let I;if(E.parts&&a&&I2(E.parts[0],t))try{const{data:k}=await t2({gateway:E.gateway,coupon:E.coupon,partOrder:E.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...E.customFields},tsId:g.useGetTsId()});I=k.data}catch(k){console.error(k)}else try{const{data:k}=await Qd({gateway:E.gateway,parts:[...E.parts],coupon:E.coupon,customerEmail:E.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...E.customFields},tsId:g.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null});I=k.data}catch(k){const D=k,{notifications:N,setNotifications:v}=g.useNotificationStore.getState();v([...N,{message:`Failed to create order: ${D.message}`,status:"error",id:g.v4()}])}if(l(!1),I)return I;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){i(E=>({...E,discordSocialConnectId:x}))},setCustomFields(x){i(E=>({...E,customFields:{...x}}))}};return P.useEffect(()=>{i(x=>({...x,customerEmail:a??""}))},[a,i]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...b}},Yn=()=>{const{notifications:e,setNotifications:t}=g.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:g.v4()}])}};var li={exports:{}},mu={exports:{}},Ie={};/** @license React v16.13.1
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -104,4 +104,4 @@ and limitations under the License.
104
104
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:i,tableCell:c,tableRow:o}};function i(p,b,x,E){return l(h(p,x,E),p.align)}function o(p,b,x,E){const _=f(p,x,E),I=l([_]);return I.slice(0,I.indexOf(`
105
105
  `))}function c(p,b,x,E){const _=x.enter("tableCell"),I=x.enter("phrasing"),k=x.containerPhrasing(p,{...E,before:a,after:a});return I(),_(),k}function l(p,b){return kC(p,{align:b,alignDelimiters:r,padding:n,stringLength:u})}function h(p,b,x){const E=p.children;let _=-1;const I=[],k=b.enter("table");for(;++_<E.length;)I[_]=f(E[_],b,x);return k(),I}function f(p,b,x){const E=p.children;let _=-1;const I=[],k=b.enter("tableRow");for(;++_<E.length;)I[_]=c(E[_],p,b,x);return k(),I}function m(p,b,x){let E=d1.inlineCode(p,b,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function dE(){return{exit:{taskListCheckValueChecked:xc,taskListCheckValueUnchecked:xc,paragraph:hE}}}function fE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pE}}}function xc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function hE(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,i;for(;++a<u.length;){const o=u[a];if(o.type==="paragraph"){i=o;break}}i===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 pE(e,t,n,r){const u=e.children[0],a=typeof e.checked=="boolean"&&u&&u.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(i);let c=d1.listItem(e,t,n,{...r,...o.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(h){return h+i}}function mE(){return[Wx(),pC(),_C(),uE(),dE()]}function bE(e){return{extensions:[Yx(),mC(e),xC(),lE(e),fE()]}}const gE={tokenize:yE,partial:!0},f1={tokenize:kE,partial:!0},h1={tokenize:AE,partial:!0},p1={tokenize:SE,partial:!0},_E={tokenize:IE,partial:!0},m1={name:"wwwAutolink",tokenize:EE,previous:g1},b1={name:"protocolAutolink",tokenize:TE,previous:_1},gn={name:"emailAutolink",tokenize:CE,previous:x1},sn={};function xE(){return{text:sn}}let Hn=48;for(;Hn<123;)sn[Hn]=gn,Hn++,Hn===58?Hn=65:Hn===91&&(Hn=97);sn[43]=gn;sn[45]=gn;sn[46]=gn;sn[95]=gn;sn[72]=[gn,b1];sn[104]=[gn,b1];sn[87]=[gn,m1];sn[119]=[gn,m1];function CE(e,t,n){const r=this;let u,a;return i;function i(f){return!vi(f)||!x1.call(r,r.previous)||Cs(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return vi(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(_E,h,l)(f):f===45||f===95||it(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&&ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function EE(e,t,n){const r=this;return u;function u(i){return i!==87&&i!==119||!g1.call(r,r.previous)||Cs(r.events)?n(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(gE,e.attempt(f1,e.attempt(h1,a),n),n)(i))}function a(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function TE(e,t,n){const r=this;let u="",a=!1;return i;function i(f){return(f===72||f===104)&&_1.call(r,r.previous)&&!Cs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(ft(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||zu(f)||we(f)||Wn(f)||fa(f)?n(f):e.attempt(f1,e.attempt(h1,h),n)(f)}function h(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function yE(e,t,n){let r=0;return u;function u(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),u):i===46&&r===3?(e.consume(i),a):n(i)}function a(i){return i===null?n(i):t(i)}}function kE(e,t,n){let r,u,a;return i;function i(l){return l===46||l===95?e.check(p1,c,o)(l):l===null||we(l)||Wn(l)||l!==45&&fa(l)?c(l):(a=!0,e.consume(l),i)}function o(l){return l===95?r=!0:(u=r,r=void 0),e.consume(l),i}function c(l){return u||r||!a?n(l):t(l)}}function AE(e,t){let n=0,r=0;return u;function u(i){return i===40?(n++,e.consume(i),u):i===41&&r<n?a(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(p1,t,a)(i):i===null||we(i)||Wn(i)?t(i):(e.consume(i),u)}function a(i){return i===41&&r++,e.consume(i),u}}function SE(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||we(o)||Wn(o)?t(o):n(o)}function u(o){return o===null||o===40||o===91||we(o)||Wn(o)?t(o):r(o)}function a(o){return ft(o)?i(o):n(o)}function i(o){return o===59?(e.consume(o),r):ft(o)?(e.consume(o),i):n(o)}}function IE(e,t,n){return r;function r(a){return e.consume(a),u}function u(a){return it(a)?n(a):t(a)}}function g1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||we(e)}function _1(e){return!ft(e)}function x1(e){return!(e===47||vi(e))}function vi(e){return e===43||e===45||e===46||e===95||it(e)}function Cs(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 NE={tokenize:ME,partial:!0};function vE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:RE,continuation:{tokenize:PE},exit:OE}},text:{91:{name:"gfmFootnoteCall",tokenize:DE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wE,resolveTo:LE}}}}function wE(e,t,n){const r=this;let u=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;u--;){const c=r.events[u][1];if(c.type==="labelImage"){i=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(!i||!i._balanced)return n(c);const l=qt(r.sliceSerialize({start:i.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 LE(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)},i={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",i,t],["exit",i,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 DE(e,t,n){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,i;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&&!i||f===null||f===91||we(f))return n(f);if(f===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return u.includes(qt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return we(f)||(i=!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 RE(e,t,n){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,i=0,o;return c;function c(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(b)}function h(b){if(i>999||b===93&&!o||b===null||b===91||we(b))return n(b);if(b===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=qt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return we(b)||(o=!0),i++,e.consume(b),b===92?f:h}function f(b){return b===91||b===92||b===93?(e.consume(b),i++,h):h(b)}function m(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),u.includes(a)||u.push(a),ke(e,p,"gfmFootnoteDefinitionWhitespace")):n(b)}function p(b){return t(b)}}function PE(e,t,n){return e.check(lu,t,e.attempt(NE,t,n))}function OE(e){e.exit("gfmFootnoteDefinition")}function ME(e,t,n){const r=this;return ke(e,u,"gfmFootnoteDefinitionIndent",5);function u(a){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(a):n(a)}}function FE(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(i,o){let c=-1;for(;++c<i.length;)if(i[c][0]==="enter"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._close){let l=c;for(;l--;)if(i[l][0]==="exit"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._open&&i[c][1].end.offset-i[c][1].start.offset===i[l][1].end.offset-i[l][1].start.offset){i[c][1].type="strikethroughSequence",i[l][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},i[l][1].start),end:Object.assign({},i[c][1].end)},f={type:"strikethroughText",start:Object.assign({},i[l][1].end),end:Object.assign({},i[c][1].start)},m=[["enter",h,o],["enter",i[l][1],o],["exit",i[l][1],o],["enter",f,o]],p=o.parser.constructs.insideSpan.null;p&&Rt(m,m.length,0,ha(p,i.slice(l+1,c),o)),Rt(m,m.length,0,[["exit",f,o],["enter",i[c][1],o],["exit",i[c][1],o],["exit",h,o]]),Rt(i,l-1,c-l+3,m),c=l+m.length-2;break}}for(c=-1;++c<i.length;)i[c][1].type==="strikethroughSequenceTemporary"&&(i[c][1].type="data");return i}function a(i,o,c){const l=this.previous,h=this.events;let f=0;return m;function m(b){return l===126&&h[h.length-1][1].type!=="characterEscape"?c(b):(i.enter("strikethroughSequenceTemporary"),p(b))}function p(b){const x=mr(l);if(b===126)return f>1?c(b):(i.consume(b),f++,p);if(f<2&&!n)return c(b);const E=i.exit("strikethroughSequenceTemporary"),_=mr(b);return E._open=!_||_===2&&!!x,E._close=!x||x===2&&!!_,o(b)}}}class BE{constructor(){this.map=[]}add(t,n,r){jE(this,t,n,r)}consume(t){if(this.map.sort(function(a,i){return a[0]-i[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 jE(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 HE(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 UE(){return{flow:{null:{name:"table",tokenize:VE,resolveAll:zE}}}}function VE(e,t,n){const r=this;let u=0,a=0,i;return o;function o(L){let F=r.events.length-1;for(;F>-1;){const ae=r.events[F][1].type;if(ae==="lineEnding"||ae==="linePrefix")F--;else break}const H=F>-1?r.events[F][1].type:null,G=H==="tableHead"||H==="tableRow"?v:c;return G===v&&r.parser.lazy[r.now().line]?n(L):G(L)}function c(L){return e.enter("tableHead"),e.enter("tableRow"),l(L)}function l(L){return L===124||(i=!0,a+=1),h(L)}function h(L){return L===null?n(L):ee(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):n(L):Ee(L)?ke(e,h,"whitespace")(L):(a+=1,i&&(i=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),i=!0,h):(e.enter("data"),f(L)))}function f(L){return L===null||L===124||we(L)?(e.exit("data"),h(L)):(e.consume(L),L===92?m:f)}function m(L){return L===92||L===124?(e.consume(L),f):f(L)}function p(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),i=!1,Ee(L)?ke(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):b(L))}function b(L){return L===45||L===58?E(L):L===124?(i=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):N(L)}function x(L){return Ee(L)?ke(e,E,"whitespace")(L):E(L)}function E(L){return L===58?(a+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):L===45?(a+=1,_(L)):L===null||ee(L)?D(L):N(L)}function _(L){return L===45?(e.enter("tableDelimiterFiller"),I(L)):N(L)}function I(L){return L===45?(e.consume(L),I):L===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(L))}function k(L){return Ee(L)?ke(e,D,"whitespace")(L):D(L)}function D(L){return L===124?b(L):L===null||ee(L)?!i||u!==a?N(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):N(L)}function N(L){return n(L)}function v(L){return e.enter("tableRow"),V(L)}function V(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),V):L===null||ee(L)?(e.exit("tableRow"),t(L)):Ee(L)?ke(e,V,"whitespace")(L):(e.enter("data"),Y(L))}function Y(L){return L===null||L===124||we(L)?(e.exit("data"),V(L)):(e.consume(L),L===92?Z:Y)}function Z(L){return L===92||L===124?(e.consume(L),Y):Y(L)}}function zE(e,t){let n=-1,r=!0,u=0,a=[0,0,0,0],i=[0,0,0,0],o=!1,c=0,l,h,f;const m=new BE;for(;++n<e.length;){const p=e[n],b=p[1];p[0]==="enter"?b.type==="tableHead"?(o=!1,c!==0&&(Cc(m,t,c,l,h),h=void 0,c=0),l={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},m.add(n,0,[["enter",l,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],i=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},m.add(n,0,[["enter",h,t]])),u=b.type==="tableDelimiterRow"?2:h?3:1):u&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(a[1]!==0&&(i[0]=i[1],f=wu(m,t,a,u,void 0,f),a=[0,0,0,0]),i[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(i[0]=i[1],f=wu(m,t,a,u,void 0,f)),a=i,i=[a[1],n,0,0])):b.type==="tableHead"?(o=!0,c=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(c=n,a[1]!==0?(i[0]=i[1],f=wu(m,t,a,u,n,f)):i[1]!==0&&(f=wu(m,t,i,u,n,f)),u=0):u&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(i[3]=n)}for(c!==0&&Cc(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=HE(t.events,n))}return e}function wu(e,t,n,r,u,a){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},ir(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=ir(t.events,n[1]);if(a={type:i,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const l=ir(t.events,n[2]),h=ir(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 b=n[2]+1,x=n[3]-n[2]-1;e.add(b,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return u!==void 0&&(a.end=Object.assign({},ir(t.events,u)),e.add(u,0,[["exit",a,t]]),a=void 0),a}function Cc(e,t,n,r,u){const a=[],i=ir(t.events,n);u&&(u.end=Object.assign({},i),a.push(["exit",u,t])),r.end=Object.assign({},i),a.push(["exit",r,t]),e.add(n+1,0,a)}function ir(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $E={name:"tasklistCheck",tokenize:ZE};function qE(){return{text:{91:$E}}}function ZE(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 we(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),i):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),i):n(c)}function i(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return ee(c)?t(c):Ee(c)?e.check({tokenize:WE},t,n)(c):n(c)}}function WE(e,t,n){return ke(e,r,"whitespace");function r(u){return u===null?n(u):t(u)}}function YE(e){return N0([xE(),vE(),FE(e),UE(),qE()])}const GE={};function C1(e){const t=this,n=e||GE,r=t.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(YE(n)),a.push(mE()),i.push(bE(n))}const Ec=/[#.]/g;function XE(e,t){const n=e||"",r={};let u=0,a,i;for(;u<n.length;){Ec.lastIndex=u;const o=Ec.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]:i=c,u+=c.length),o&&(a=o[0],u++)}return{type:"element",tagName:i||t||"div",properties:r,children:[]}}function E1(e,t,n){const r=n?eT(n):void 0;function u(a,i,...o){let c;if(a==null){c={type:"root",children:[]};const l=i;o.unshift(l)}else{c=XE(a,t);const l=c.tagName.toLowerCase(),h=r?r.get(l):void 0;if(c.tagName=h||l,QE(i))o.unshift(i);else for(const[f,m]of Object.entries(i))KE(e,c.properties,f,m)}for(const l of o)wi(c.children,l);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return u}function QE(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 i of a)if(typeof i!="number"&&typeof i!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function KE(e,t,n,r){const u=as(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=No(r):u.commaSeparated?a=yo(r):u.commaOrSpaceSeparated?a=No(yo(r).join(" ")):a=Tc(u,u.property,r):Array.isArray(r)?a=[...r]:a=u.property==="style"?JE(r):String(r);if(Array.isArray(a)){const i=[];for(const o of a)i.push(Tc(u,u.property,o));a=i}u.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[u.property]=a}}function wi(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)wi(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?wi(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Tc(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Kr(n)===Kr(t)))return!0}return n}function JE(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function eT(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const tT=["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"],nT=E1(la,"div"),rT=E1(Tr,"g",tT);function uT(e){const t=String(e),n=[];return{toOffset:u,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let i=0;for(;;){let o=n[i];if(o===void 0){const c=yc(t,n[i-1]);o=c===-1?t.length+1:c+1,n[i]=o}if(o>a)return{line:i+1,column:a-(i>0?n[i-1]:0)+1,offset:a};i++}}}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=yc(t,o),l=c===-1?t.length+1:c+1;if(o===l)break;n.push(l)}const i=(a.line>1?n[a.line-2]:0)+a.column-1;if(i<n[a.line-1])return i}}}function yc(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
106
106
  `,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/"},T1={}.hasOwnProperty,aT=Object.prototype;function iT(e,t){const n=t||{};return Es({file:n.file||void 0,location:!1,schema:n.space==="svg"?Tr:la,verbose:n.verbose||!1},e)}function Es(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Fu(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:y1(e,t.childNodes),data:{quirksMode:u}},e.file&&e.location){const a=String(e.file),i=uT(a),o=i.toPoint(0),c=i.toPoint(a.length);n.position={start:o,end:c}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Fu(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Fu(e,r,n),n}default:return n=sT(e,t),n}}function y1(e,t){let n=-1;const r=[];for(;++n<t.length;){const u=Es(e,t[n]);r.push(u)}return r}function sT(e,t){const n=e.schema;e.schema=t.namespaceURI===qn.svg?Tr:la;let r=-1;const u={};for(;++r<t.attrs.length;){const o=t.attrs[r],c=(o.prefix?o.prefix+":":"")+o.name;T1.call(aT,c)||(u[c]=o.value)}const i=(e.schema.space==="svg"?rT:nT)(t.tagName,u,y1(e,t.childNodes));if(Fu(e,t,i),i.tagName==="template"){const o=t,c=o.sourceCodeLocation,l=c&&c.startTag&&sr(c.startTag),h=c&&c.endTag&&sr(c.endTag),f=Es(e,o.content);l&&h&&e.file&&(f.position={start:l.end,end:h.start}),i.content=f}return e.schema=n,i}function Fu(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=oT(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function oT(e,t,n){const r=sr(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 i;if(n.attrs)for(i in n.attrs)T1.call(n.attrs,i)&&(a[as(e.schema,i).property]=sr(n.attrs[i]));n.startTag;const o=sr(n.startTag),c=n.endTag?sr(n.endTag):void 0,l={opening:o};c&&(l.closing=c),l.properties=a,t.data={position:l}}}return r}function sr(e){const t=kc({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=kc({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function kc(e){return e.line&&e.column?e:void 0}class fu{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}fu.prototype.property={};fu.prototype.normal={};fu.prototype.space=null;function k1(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 fu(n,r,t)}function Li(e){return e.toLowerCase()}class Ut{constructor(t,n){this.property=t,this.attribute=n}}Ut.prototype.space=null;Ut.prototype.boolean=!1;Ut.prototype.booleanish=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.number=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.spaceSeparated=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.defined=!1;let cT=0;const he=Qn(),qe=Qn(),A1=Qn(),$=Qn(),Re=Qn(),fr=Qn(),wt=Qn();function Qn(){return 2**++cT}const Di=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:qe,commaOrSpaceSeparated:wt,commaSeparated:fr,number:$,overloadedBoolean:A1,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),ni=Object.keys(Di);class Ts extends Ut{constructor(t,n,r,u){let a=-1;if(super(t,n),Ac(this,"space",u),typeof r=="number")for(;++a<ni.length;){const i=ni[a];Ac(this,ni[a],(r&Di[i])===Di[i])}}}Ts.prototype.defined=!0;function Ac(e,t,n){n&&(e[t]=n)}const lT={}.hasOwnProperty;function kr(e){const t={},n={};let r;for(r in e.properties)if(lT.call(e.properties,r)){const u=e.properties[r],a=new Ts(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Li(r)]=r,n[Li(a.attribute)]=r}return new fu(t,n,e.space)}const S1=kr({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}}),I1=kr({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function N1(e,t){return t in e?e[t]:t}function v1(e,t){return N1(e,t.toLowerCase())}const w1=kr({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:v1,properties:{xmlns:null,xmlnsXLink:null}}),L1=kr({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:qe,ariaAutoComplete:null,ariaBusy:qe,ariaChecked:qe,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:Re,ariaCurrent:null,ariaDescribedBy:Re,ariaDetails:null,ariaDisabled:qe,ariaDropEffect:Re,ariaErrorMessage:null,ariaExpanded:qe,ariaFlowTo:Re,ariaGrabbed:qe,ariaHasPopup:null,ariaHidden:qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Re,ariaLevel:$,ariaLive:null,ariaModal:qe,ariaMultiLine:qe,ariaMultiSelectable:qe,ariaOrientation:null,ariaOwns:Re,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:qe,ariaReadOnly:qe,ariaRelevant:null,ariaRequired:qe,ariaRoleDescription:Re,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:qe,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null}}),dT=kr({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:v1,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fr,acceptCharset:Re,accessKey:Re,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:Re,autoFocus:he,autoPlay:he,blocking:Re,capture:null,charSet:null,checked:he,cite:null,className:Re,cols:$,colSpan:null,content:null,contentEditable:qe,controls:he,controlsList:Re,coords:$|fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:A1,draggable:qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:Re,height:$,hidden:he,high:$,href:null,hrefLang:null,htmlFor:Re,httpEquiv:Re,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:Re,itemRef:Re,itemScope:he,itemType:Re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,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:he,optimum:$,pattern:null,ping:Re,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:Re,required:he,reversed:he,rows:$,rowSpan:$,sandbox:Re,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:qe,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Re,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:qe,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:he,disableRemotePlayback:he,prefix:null,property:null,results:$,security:null,unselectable:null}}),fT=kr({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:N1,properties:{about:wt,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:Re,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:fr,g2:fr,glyphName:fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:wt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wt,rev:wt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wt,requiredFeatures:wt,requiredFonts:wt,requiredFormats:wt,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:wt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wt,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),hT=/^data[-\w.:]+$/i,Sc=/-[a-z]/g,pT=/[A-Z]/g;function mT(e,t){const n=Li(t);let r=t,u=Ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hT.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Sc,gT);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Sc.test(a)){let i=a.replace(pT,bT);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}u=Ts}return new u(r,t)}function bT(e){return"-"+e.toLowerCase()}function gT(e){return e.charAt(1).toUpperCase()}const _T=k1([I1,S1,w1,L1,dT],"html"),D1=k1([I1,S1,w1,L1,fT],"svg"),xT={},CT={}.hasOwnProperty,R1=e1("type",{handlers:{root:TT,element:IT,text:AT,comment:ST,doctype:kT}});function ET(e,t){const r=(t||xT).space;return R1(e,r==="svg"?D1:_T)}function TT(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=ys(e.children,n,t),Ar(e,n),n}function yT(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=ys(e.children,n,t),Ar(e,n),n}function kT(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ar(e,t),t}function AT(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ar(e,t),t}function ST(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ar(e,t),t}function IT(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=D1);const u=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&CT.call(e.properties,a)){const c=NT(r,a,e.properties[a]);c&&u.push(c)}}const i=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:u,namespaceURI:qn[i],childNodes:[],parentNode:null};return o.childNodes=ys(e.children,o,r),Ar(e,o),e.tagName==="template"&&e.content&&(o.content=yT(e.content,r)),o}function NT(e,t,n){const r=mT(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?d0(n):C0(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 ys(e,t,n){let r=-1;const u=[];if(e)for(;++r<e.length;){const a=R1(e[r],n);a.parentNode=t,u.push(a)}return u}function Ar(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 vT=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],wT=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]),Oe="�";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 bt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function P1(e){return e>=55296&&e<=57343}function LT(e){return e>=56320&&e<=57343}function DT(e,t){return(e-55296)*1024+9216+t}function O1(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function M1(e){return e>=64976&&e<=65007||wT.has(e)}var O;(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"})(O||(O={}));const RT=65536;class PT{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=RT,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,i=u+n,o=a+n;return{code:t,startLine:r,endLine:r,startCol:i,endCol:i,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(LT(n))return this.pos++,this._addGap(),DT(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(O.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,P1(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){O1(t)?this._err(O.controlCharacterInInputStream):M1(t)&&this._err(O.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var xe;(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"})(xe||(xe={}));function F1(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 OT=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))),MT=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 FT(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=MT.get(e))!==null&&t!==void 0?t:e}var et;(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"})(et||(et={}));const BT=32;var Ln;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ln||(Ln={}));function Ri(e){return e>=et.ZERO&&e<=et.NINE}function jT(e){return e>=et.UPPER_A&&e<=et.UPPER_F||e>=et.LOWER_A&&e<=et.LOWER_F}function HT(e){return e>=et.UPPER_A&&e<=et.UPPER_Z||e>=et.LOWER_A&&e<=et.LOWER_Z||Ri(e)}function UT(e){return e===et.EQUALS||HT(e)}var Qe;(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"})(Qe||(Qe={}));var bn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(bn||(bn={}));class VT{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Qe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bn.Strict}startEntity(t){this.decodeMode=t,this.state=Qe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Qe.EntityStart:return t.charCodeAt(n)===et.NUM?(this.state=Qe.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Qe.NamedEntity,this.stateNamedEntity(t,n));case Qe.NumericStart:return this.stateNumericStart(t,n);case Qe.NumericDecimal:return this.stateNumericDecimal(t,n);case Qe.NumericHex:return this.stateNumericHex(t,n);case Qe.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|BT)===et.LOWER_X?(this.state=Qe.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Qe.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(Ri(u)||jT(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(Ri(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===et.SEMI)this.consumed+=1;else if(this.decodeMode===bn.Strict)return 0;return this.emitCodePoint(FT(this.result),this.consumed),this.errors&&(t!==et.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&Ln.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const i=t.charCodeAt(n);if(this.treeIndex=zT(r,u,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===bn.Attribute&&(a===0||UT(i))?0:this.emitNotTerminatedNamedEntity();if(u=r[this.treeIndex],a=(u&Ln.VALUE_LENGTH)>>14,a!==0){if(i===et.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bn.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]&Ln.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]&~Ln.VALUE_LENGTH:u[t+1],r),n===3&&this.emitCodePoint(u[t+2],r),r}end(){var t;switch(this.state){case Qe.NamedEntity:return this.result!==0&&(this.decodeMode!==bn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Qe.NumericDecimal:return this.emitNumericEntity(0,2);case Qe.NumericHex:return this.emitNumericEntity(0,3);case Qe.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Qe.EntityStart:return 0}}}function zT(e,t,n,r){const u=(t&Ln.BRANCH_LENGTH)>>7,a=t&Ln.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 i=n,o=i+u-1;for(;i<=o;){const c=i+o>>>1,l=e[c];if(l<r)i=c+1;else if(l>r)o=c-1;else return e[c+u]}return-1}var B;(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/"})(B||(B={}));var Zn;(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"})(Zn||(Zn={}));var Bt;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Bt||(Bt={}));var R;(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"})(R||(R={}));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 $T=new Map([[R.A,d.A],[R.ADDRESS,d.ADDRESS],[R.ANNOTATION_XML,d.ANNOTATION_XML],[R.APPLET,d.APPLET],[R.AREA,d.AREA],[R.ARTICLE,d.ARTICLE],[R.ASIDE,d.ASIDE],[R.B,d.B],[R.BASE,d.BASE],[R.BASEFONT,d.BASEFONT],[R.BGSOUND,d.BGSOUND],[R.BIG,d.BIG],[R.BLOCKQUOTE,d.BLOCKQUOTE],[R.BODY,d.BODY],[R.BR,d.BR],[R.BUTTON,d.BUTTON],[R.CAPTION,d.CAPTION],[R.CENTER,d.CENTER],[R.CODE,d.CODE],[R.COL,d.COL],[R.COLGROUP,d.COLGROUP],[R.DD,d.DD],[R.DESC,d.DESC],[R.DETAILS,d.DETAILS],[R.DIALOG,d.DIALOG],[R.DIR,d.DIR],[R.DIV,d.DIV],[R.DL,d.DL],[R.DT,d.DT],[R.EM,d.EM],[R.EMBED,d.EMBED],[R.FIELDSET,d.FIELDSET],[R.FIGCAPTION,d.FIGCAPTION],[R.FIGURE,d.FIGURE],[R.FONT,d.FONT],[R.FOOTER,d.FOOTER],[R.FOREIGN_OBJECT,d.FOREIGN_OBJECT],[R.FORM,d.FORM],[R.FRAME,d.FRAME],[R.FRAMESET,d.FRAMESET],[R.H1,d.H1],[R.H2,d.H2],[R.H3,d.H3],[R.H4,d.H4],[R.H5,d.H5],[R.H6,d.H6],[R.HEAD,d.HEAD],[R.HEADER,d.HEADER],[R.HGROUP,d.HGROUP],[R.HR,d.HR],[R.HTML,d.HTML],[R.I,d.I],[R.IMG,d.IMG],[R.IMAGE,d.IMAGE],[R.INPUT,d.INPUT],[R.IFRAME,d.IFRAME],[R.KEYGEN,d.KEYGEN],[R.LABEL,d.LABEL],[R.LI,d.LI],[R.LINK,d.LINK],[R.LISTING,d.LISTING],[R.MAIN,d.MAIN],[R.MALIGNMARK,d.MALIGNMARK],[R.MARQUEE,d.MARQUEE],[R.MATH,d.MATH],[R.MENU,d.MENU],[R.META,d.META],[R.MGLYPH,d.MGLYPH],[R.MI,d.MI],[R.MO,d.MO],[R.MN,d.MN],[R.MS,d.MS],[R.MTEXT,d.MTEXT],[R.NAV,d.NAV],[R.NOBR,d.NOBR],[R.NOFRAMES,d.NOFRAMES],[R.NOEMBED,d.NOEMBED],[R.NOSCRIPT,d.NOSCRIPT],[R.OBJECT,d.OBJECT],[R.OL,d.OL],[R.OPTGROUP,d.OPTGROUP],[R.OPTION,d.OPTION],[R.P,d.P],[R.PARAM,d.PARAM],[R.PLAINTEXT,d.PLAINTEXT],[R.PRE,d.PRE],[R.RB,d.RB],[R.RP,d.RP],[R.RT,d.RT],[R.RTC,d.RTC],[R.RUBY,d.RUBY],[R.S,d.S],[R.SCRIPT,d.SCRIPT],[R.SEARCH,d.SEARCH],[R.SECTION,d.SECTION],[R.SELECT,d.SELECT],[R.SOURCE,d.SOURCE],[R.SMALL,d.SMALL],[R.SPAN,d.SPAN],[R.STRIKE,d.STRIKE],[R.STRONG,d.STRONG],[R.STYLE,d.STYLE],[R.SUB,d.SUB],[R.SUMMARY,d.SUMMARY],[R.SUP,d.SUP],[R.TABLE,d.TABLE],[R.TBODY,d.TBODY],[R.TEMPLATE,d.TEMPLATE],[R.TEXTAREA,d.TEXTAREA],[R.TFOOT,d.TFOOT],[R.TD,d.TD],[R.TH,d.TH],[R.THEAD,d.THEAD],[R.TITLE,d.TITLE],[R.TR,d.TR],[R.TRACK,d.TRACK],[R.TT,d.TT],[R.U,d.U],[R.UL,d.UL],[R.SVG,d.SVG],[R.VAR,d.VAR],[R.WBR,d.WBR],[R.XMP,d.XMP]]);function Sr(e){var t;return(t=$T.get(e))!==null&&t!==void 0?t:d.UNKNOWN}const j=d,qT={[B.HTML]:new Set([j.ADDRESS,j.APPLET,j.AREA,j.ARTICLE,j.ASIDE,j.BASE,j.BASEFONT,j.BGSOUND,j.BLOCKQUOTE,j.BODY,j.BR,j.BUTTON,j.CAPTION,j.CENTER,j.COL,j.COLGROUP,j.DD,j.DETAILS,j.DIR,j.DIV,j.DL,j.DT,j.EMBED,j.FIELDSET,j.FIGCAPTION,j.FIGURE,j.FOOTER,j.FORM,j.FRAME,j.FRAMESET,j.H1,j.H2,j.H3,j.H4,j.H5,j.H6,j.HEAD,j.HEADER,j.HGROUP,j.HR,j.HTML,j.IFRAME,j.IMG,j.INPUT,j.LI,j.LINK,j.LISTING,j.MAIN,j.MARQUEE,j.MENU,j.META,j.NAV,j.NOEMBED,j.NOFRAMES,j.NOSCRIPT,j.OBJECT,j.OL,j.P,j.PARAM,j.PLAINTEXT,j.PRE,j.SCRIPT,j.SECTION,j.SELECT,j.SOURCE,j.STYLE,j.SUMMARY,j.TABLE,j.TBODY,j.TD,j.TEMPLATE,j.TEXTAREA,j.TFOOT,j.TH,j.THEAD,j.TITLE,j.TR,j.TRACK,j.UL,j.WBR,j.XMP]),[B.MATHML]:new Set([j.MI,j.MO,j.MN,j.MS,j.MTEXT,j.ANNOTATION_XML]),[B.SVG]:new Set([j.TITLE,j.FOREIGN_OBJECT,j.DESC]),[B.XLINK]:new Set,[B.XML]:new Set,[B.XMLNS]:new Set},Pi=new Set([j.H1,j.H2,j.H3,j.H4,j.H5,j.H6]);R.STYLE,R.SCRIPT,R.XMP,R.IFRAME,R.NOEMBED,R.NOFRAMES,R.PLAINTEXT;var y;(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"})(y||(y={}));const Ve={DATA:y.DATA,RCDATA:y.RCDATA,RAWTEXT:y.RAWTEXT,SCRIPT_DATA:y.SCRIPT_DATA,PLAINTEXT:y.PLAINTEXT,CDATA_SECTION:y.CDATA_SECTION};function ZT(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function Fr(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function WT(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function kn(e){return WT(e)||Fr(e)}function Ic(e){return kn(e)||ZT(e)}function Lu(e){return e+32}function B1(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function Nc(e){return B1(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function YT(e){return e===T.NULL?O.nullCharacterReference:e>1114111?O.characterReferenceOutsideUnicodeRange:P1(e)?O.surrogateCharacterReference:M1(e)?O.noncharacterCharacterReference:O1(e)||e===T.CARRIAGE_RETURN?O.controlCharacterReference:null}class GT{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=y.DATA,this.returnState=y.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new PT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new VT(OT,(r,u)=>{this.preprocessor.pos=this.entityStartPos+u-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(O.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(O.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const u=YT(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:xe.START_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:xe.END_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:xe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:xe.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(F1(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(O.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=Sr(t.tagName),t.type===xe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(O.endTagWithAttributes),t.selfClosing&&this._err(O.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 xe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case xe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case xe.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:xe.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=B1(t)?xe.WHITESPACE_CHARACTER:t===T.NULL?xe.NULL_CHARACTER:xe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(xe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=y.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bn.Attribute:bn.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===y.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===y.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===y.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case y.DATA:{this._stateData(t);break}case y.RCDATA:{this._stateRcdata(t);break}case y.RAWTEXT:{this._stateRawtext(t);break}case y.SCRIPT_DATA:{this._stateScriptData(t);break}case y.PLAINTEXT:{this._statePlaintext(t);break}case y.TAG_OPEN:{this._stateTagOpen(t);break}case y.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case y.TAG_NAME:{this._stateTagName(t);break}case y.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case y.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case y.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case y.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case y.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case y.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case y.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case y.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case y.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case y.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case y.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case y.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case y.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case y.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case y.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case y.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case y.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case y.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case y.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case y.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case y.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case y.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case y.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case y.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case y.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case y.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case y.BOGUS_COMMENT:{this._stateBogusComment(t);break}case y.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case y.COMMENT_START:{this._stateCommentStart(t);break}case y.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case y.COMMENT:{this._stateComment(t);break}case y.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case y.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case y.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case y.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case y.COMMENT_END:{this._stateCommentEnd(t);break}case y.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case y.DOCTYPE:{this._stateDoctype(t);break}case y.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case y.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case y.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case y.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case y.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case y.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case y.CDATA_SECTION:{this._stateCdataSection(t);break}case y.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case y.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case y.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case y.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=y.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(O.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=y.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(O.unexpectedNullCharacter),this._emitChars(Oe);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case T.LESS_THAN_SIGN:{this.state=y.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(O.unexpectedNullCharacter),this._emitChars(Oe);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(O.unexpectedNullCharacter),this._emitChars(Oe);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case T.NULL:{this._err(O.unexpectedNullCharacter),this._emitChars(Oe);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(kn(t))this._createStartTagToken(),this.state=y.TAG_NAME,this._stateTagName(t);else switch(t){case T.EXCLAMATION_MARK:{this.state=y.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=y.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(O.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=y.BOGUS_COMMENT,this._stateBogusComment(t);break}case T.EOF:{this._err(O.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(O.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=y.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(kn(t))this._createEndTagToken(),this.state=y.TAG_NAME,this._stateTagName(t);else switch(t){case T.GREATER_THAN_SIGN:{this._err(O.missingEndTagName),this.state=y.DATA;break}case T.EOF:{this._err(O.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(O.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=y.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=y.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=y.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.tagName+=Oe;break}case T.EOF:{this._err(O.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Fr(t)?Lu(t):t)}}_stateRcdataLessThanSign(t){t===T.SOLIDUS?this.state=y.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=y.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){kn(t)?(this.state=y.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=y.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=y.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=y.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=y.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=y.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===T.SOLIDUS?this.state=y.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=y.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){kn(t)?(this.state=y.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=y.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=y.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case T.SOLIDUS:{this.state=y.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=y.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=y.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){kn(t)?(this.state=y.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=y.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=y.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===T.HYPHEN_MINUS?(this.state=y.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=y.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===T.HYPHEN_MINUS?(this.state=y.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=y.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(O.unexpectedNullCharacter),this._emitChars(Oe);break}case T.EOF:{this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_ESCAPED,this._emitChars(Oe);break}case T.EOF:{this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=y.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_ESCAPED,this._emitChars(Oe);break}case T.EOF:{this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===T.SOLIDUS?this.state=y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:kn(t)?(this._emitChars("<"),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){kn(t)?(this.state=y.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(bt.SCRIPT,!1)&&Nc(this.preprocessor.peek(bt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<bt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(O.unexpectedNullCharacter),this._emitChars(Oe);break}case T.EOF:{this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Oe);break}case T.EOF:{this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.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=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=y.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Oe);break}case T.EOF:{this._err(O.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===T.SOLIDUS?(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(bt.SCRIPT,!1)&&Nc(this.preprocessor.peek(bt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<bt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=y.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=y.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=y.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._err(O.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=y.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=y.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=y.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=y.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(O.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.currentAttr.name+=Oe;break}default:this.currentAttr.name+=String.fromCodePoint(Fr(t)?Lu(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=y.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=y.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(O.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=y.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=y.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=y.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(O.missingAttributeValue),this.state=y.DATA,this.emitCurrentTagToken();break}default:this.state=y.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case T.QUOTATION_MARK:{this.state=y.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.currentAttr.value+=Oe;break}case T.EOF:{this._err(O.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case T.APOSTROPHE:{this.state=y.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.currentAttr.value+=Oe;break}case T.EOF:{this._err(O.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=y.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=y.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(O.unexpectedNullCharacter),this.currentAttr.value+=Oe;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(O.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case T.EOF:{this._err(O.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=y.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=y.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=y.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(O.eofInTag),this._emitEOFToken();break}default:this._err(O.missingWhitespaceBetweenAttributes),this.state=y.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=y.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(O.eofInTag),this._emitEOFToken();break}default:this._err(O.unexpectedSolidusInTag),this.state=y.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.data+=Oe;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(bt.DASH_DASH,!0)?(this._createCommentToken(bt.DASH_DASH.length+1),this.state=y.COMMENT_START):this._consumeSequenceIfMatch(bt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(bt.DOCTYPE.length+1),this.state=y.DOCTYPE):this._consumeSequenceIfMatch(bt.CDATA_START,!0)?this.inForeignNode?this.state=y.CDATA_SECTION:(this._err(O.cdataInHtmlContent),this._createCommentToken(bt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=y.BOGUS_COMMENT):this._ensureHibernation()||(this._err(O.incorrectlyOpenedComment),this._createCommentToken(2),this.state=y.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case T.HYPHEN_MINUS:{this.state=y.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(O.abruptClosingOfEmptyComment),this.state=y.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=y.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=y.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(O.abruptClosingOfEmptyComment),this.state=y.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(O.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=y.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=y.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=y.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.data+=Oe;break}case T.EOF:{this._err(O.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=y.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=y.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===T.HYPHEN_MINUS?this.state=y.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=y.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===T.HYPHEN_MINUS?this.state=y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=y.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==T.GREATER_THAN_SIGN&&t!==T.EOF&&this._err(O.nestedComment),this.state=y.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=y.COMMENT_END;break}case T.EOF:{this._err(O.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=y.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=y.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(O.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=y.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{n.data+="--!",this.state=y.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(O.incorrectlyClosedComment),this.state=y.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(O.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=y.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=y.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case T.EOF:{this._err(O.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingWhitespaceBeforeDoctypeName),this.state=y.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Fr(t))this._createDoctypeToken(String.fromCharCode(Lu(t))),this.state=y.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(O.unexpectedNullCharacter),this._createDoctypeToken(Oe),this.state=y.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(O.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case T.EOF:{this._err(O.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=y.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=y.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.name+=Oe;break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Fr(t)?Lu(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=y.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(bt.PUBLIC,!1)?this.state=y.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(bt.SYSTEM,!1)?this.state=y.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(O.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=y.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=y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(O.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(O.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(O.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.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=y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(O.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.publicId+=Oe;break}case T.GREATER_THAN_SIGN:{this._err(O.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case T.EOF:{this._err(O.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=y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.publicId+=Oe;break}case T.GREATER_THAN_SIGN:{this._err(O.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case T.EOF:{this._err(O.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=y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(O.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(O.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.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=y.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.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=y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(O.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(O.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(O.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.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=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(O.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.systemId+=Oe;break}case T.GREATER_THAN_SIGN:{this._err(O.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case T.EOF:{this._err(O.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=y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(O.unexpectedNullCharacter),n.systemId+=Oe;break}case T.GREATER_THAN_SIGN:{this._err(O.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case T.EOF:{this._err(O.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=y.DATA;break}case T.EOF:{this._err(O.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(O.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case T.NULL:{this._err(O.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case T.RIGHT_SQUARE_BRACKET:{this.state=y.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(O.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===T.RIGHT_SQUARE_BRACKET?this.state=y.CDATA_SECTION_END:(this._emitChars("]"),this.state=y.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case T.GREATER_THAN_SIGN:{this.state=y.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=y.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()&&Ic(this.preprocessor.peek(1))?y.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Ic(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===T.SEMICOLON&&this._err(O.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const j1=new Set([d.DD,d.DT,d.LI,d.OPTGROUP,d.OPTION,d.P,d.RB,d.RP,d.RT,d.RTC]),vc=new Set([...j1,d.CAPTION,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]),Zu=new Set([d.APPLET,d.CAPTION,d.HTML,d.MARQUEE,d.OBJECT,d.TABLE,d.TD,d.TEMPLATE,d.TH]),XT=new Set([...Zu,d.OL,d.UL]),QT=new Set([...Zu,d.BUTTON]),wc=new Set([d.ANNOTATION_XML,d.MI,d.MN,d.MO,d.MS,d.MTEXT]),Lc=new Set([d.DESC,d.FOREIGN_OBJECT,d.TITLE]),KT=new Set([d.TR,d.TEMPLATE,d.HTML]),JT=new Set([d.TBODY,d.TFOOT,d.THEAD,d.TEMPLATE,d.HTML]),ey=new Set([d.TABLE,d.TEMPLATE,d.HTML]),ty=new Set([d.TD,d.TH]);class ny{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)===B.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])!==B.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(Pi,B.HTML)}popUntilTableCellPopped(){this.popUntilPopped(ty,B.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(ey,B.HTML)}clearBackToTableBodyContext(){this.clearBackTo(JT,B.HTML)}clearBackToTableRowContext(){this.clearBackTo(KT,B.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 B.HTML:{if(u===t)return!0;if(n.has(u))return!1;break}case B.SVG:{if(Lc.has(u))return!1;break}case B.MATHML:{if(wc.has(u))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Zu)}hasInListItemScope(t){return this.hasInDynamicScope(t,XT)}hasInButtonScope(t){return this.hasInDynamicScope(t,QT)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case B.HTML:{if(Pi.has(n))return!0;if(Zu.has(n))return!1;break}case B.SVG:{if(Lc.has(n))return!1;break}case B.MATHML:{if(wc.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===B.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])===B.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])===B.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&&j1.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&vc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&vc.has(this.currentTagId);)this.pop()}}const ri=3;var en;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(en||(en={}));const Dc={type:en.Marker};class ry{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],u=n.length,a=this.treeAdapter.getTagName(t),i=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const c=this.entries[o];if(c.type===en.Marker)break;const{element:l}=c;if(this.treeAdapter.getTagName(l)===a&&this.treeAdapter.getNamespaceURI(l)===i){const h=this.treeAdapter.getAttrList(l);h.length===u&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<ri)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<ri)return;const u=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(c=>u.get(c.name)===c.value)&&(a+=1,a>=ri&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Dc)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:en.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:en.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(Dc);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===en.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===en.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===en.Element&&n.element===t)}}const An={createDocument(){return{nodeName:"#document",mode:Bt.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};An.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(An.isTextNode(n)){n.value+=t;return}}An.appendChild(e,An.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&An.isTextNode(r)?r.value+=t:An.insertBefore(e,An.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}}},H1="html",uy="about:legacy-compat",ay="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",U1=["+//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//"],iy=[...U1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],sy=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),V1=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],oy=[...V1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Rc(e,t){return t.some(n=>e.startsWith(n))}function cy(e){return e.name===H1&&e.publicId===null&&(e.systemId===null||e.systemId===uy)}function ly(e){if(e.name!==H1)return Bt.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===ay)return Bt.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),sy.has(n))return Bt.QUIRKS;let r=t===null?iy:U1;if(Rc(n,r))return Bt.QUIRKS;if(r=t===null?V1:oy,Rc(n,r))return Bt.LIMITED_QUIRKS}return Bt.NO_QUIRKS}const Pc={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},dy="definitionurl",fy="definitionURL",hy=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])),py=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:B.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:B.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:B.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:B.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:B.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:B.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:B.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:B.XML}],["xml:space",{prefix:"xml",name:"space",namespace:B.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:B.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:B.XMLNS}]]),my=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])),by=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 gy(e){const t=e.tagID;return t===d.FONT&&e.attrs.some(({name:r})=>r===Zn.COLOR||r===Zn.SIZE||r===Zn.FACE)||by.has(t)}function z1(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===dy){e.attrs[t].name=fy;break}}function $1(e){for(let t=0;t<e.attrs.length;t++){const n=hy.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ks(e){for(let t=0;t<e.attrs.length;t++){const n=py.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 _y(e){const t=my.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Sr(e.tagName))}function xy(e,t){return t===B.MATHML&&(e===d.MI||e===d.MO||e===d.MN||e===d.MS||e===d.MTEXT)}function Cy(e,t,n){if(t===B.MATHML&&e===d.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Zn.ENCODING){const u=n[r].value.toLowerCase();return u===Pc.TEXT_HTML||u===Pc.APPLICATION_XML}}return t===B.SVG&&(e===d.FOREIGN_OBJECT||e===d.DESC||e===d.TITLE)}function Ey(e,t,n,r){return(!r||r===B.HTML)&&Cy(e,t,n)||(!r||r===B.MATHML)&&xy(e,t)}const Ty="hidden",yy=8,ky=3;var S;(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"})(S||(S={}));const Ay={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},q1=new Set([d.TABLE,d.TBODY,d.TFOOT,d.THEAD,d.TR]),Oc={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:An,onParseError:null};class Mc{constructor(t,n,r=null,u=null){this.fragmentContext=r,this.scriptHandler=u,this.currentToken=null,this.stopped=!1,this.insertionMode=S.INITIAL,this.originalInsertionMode=S.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={...Oc,...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 GT(this.options,this),this.activeFormattingElements=new ry(this.treeAdapter),this.fragmentContextID=r?Sr(this.treeAdapter.getTagName(r)):d.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new ny(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={...Oc,...n};t??(t=r.treeAdapter.createElement(R.TEMPLATE,B.HTML,[]));const u=r.treeAdapter.createElement("documentmock",B.HTML,[]),a=new this(r,u,t);return a.fragmentContextID===d.TEMPLATE&&a.tmplInsertionModeStack.unshift(S.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:Ay,i={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(i)}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,i;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,i=this.fragmentContextID):{current:a,currentTagId:i}=this.openElements,this._setContextModes(a,i)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===B.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,B.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=S.TEXT}switchToPlaintextParsing(){this.insertionMode=S.TEXT,this.originalInsertionMode=S.IN_BODY,this.tokenizer.state=Ve.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)===R.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==B.HTML))switch(this.fragmentContextID){case d.TITLE:case d.TEXTAREA:{this.tokenizer.state=Ve.RCDATA;break}case d.STYLE:case d.XMP:case d.IFRAME:case d.NOEMBED:case d.NOFRAMES:case d.NOSCRIPT:{this.tokenizer.state=Ve.RAWTEXT;break}case d.SCRIPT:{this.tokenizer.state=Ve.SCRIPT_DATA;break}case d.PLAINTEXT:{this.tokenizer.state=Ve.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 i=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,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,B.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,B.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(R.HTML,B.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,i=u[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:c,endCol:l,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:c,endCol:l,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,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===xe.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)===R.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===B.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===d.MGLYPH||t.tagID===d.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,B.HTML)}_processToken(t){switch(t.type){case xe.CHARACTER:{this.onCharacter(t);break}case xe.NULL_CHARACTER:{this.onNullCharacter(t);break}case xe.COMMENT:{this.onComment(t);break}case xe.DOCTYPE:{this.onDoctype(t);break}case xe.START_TAG:{this._processStartTag(t);break}case xe.END_TAG:{this.onEndTag(t);break}case xe.EOF:{this.onEof(t);break}case xe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const u=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return Ey(t,u,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(u=>u.type===en.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=S.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=S.IN_ROW;return}case d.TBODY:case d.THEAD:case d.TFOOT:{this.insertionMode=S.IN_TABLE_BODY;return}case d.CAPTION:{this.insertionMode=S.IN_CAPTION;return}case d.COLGROUP:{this.insertionMode=S.IN_COLUMN_GROUP;return}case d.TABLE:{this.insertionMode=S.IN_TABLE;return}case d.BODY:{this.insertionMode=S.IN_BODY;return}case d.FRAMESET:{this.insertionMode=S.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?S.AFTER_HEAD:S.BEFORE_HEAD;return}case d.TD:case d.TH:{if(t>0){this.insertionMode=S.IN_CELL;return}break}case d.HEAD:{if(t>0){this.insertionMode=S.IN_HEAD;return}break}}this.insertionMode=S.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=S.IN_SELECT_IN_TABLE;return}}this.insertionMode=S.IN_SELECT}_isElementCausesFosterParenting(t){return q1.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)===B.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 qT[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){tA(this,t);return}switch(this.insertionMode){case S.INITIAL:{Rr(this,t);break}case S.BEFORE_HTML:{Vr(this,t);break}case S.BEFORE_HEAD:{zr(this,t);break}case S.IN_HEAD:{$r(this,t);break}case S.IN_HEAD_NO_SCRIPT:{qr(this,t);break}case S.AFTER_HEAD:{Zr(this,t);break}case S.IN_BODY:case S.IN_CAPTION:case S.IN_CELL:case S.IN_TEMPLATE:{W1(this,t);break}case S.TEXT:case S.IN_SELECT:case S.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case S.IN_TABLE:case S.IN_TABLE_BODY:case S.IN_ROW:{ui(this,t);break}case S.IN_TABLE_TEXT:{J1(this,t);break}case S.IN_COLUMN_GROUP:{Wu(this,t);break}case S.AFTER_BODY:{Yu(this,t);break}case S.AFTER_AFTER_BODY:{Bu(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){eA(this,t);return}switch(this.insertionMode){case S.INITIAL:{Rr(this,t);break}case S.BEFORE_HTML:{Vr(this,t);break}case S.BEFORE_HEAD:{zr(this,t);break}case S.IN_HEAD:{$r(this,t);break}case S.IN_HEAD_NO_SCRIPT:{qr(this,t);break}case S.AFTER_HEAD:{Zr(this,t);break}case S.TEXT:{this._insertCharacters(t);break}case S.IN_TABLE:case S.IN_TABLE_BODY:case S.IN_ROW:{ui(this,t);break}case S.IN_COLUMN_GROUP:{Wu(this,t);break}case S.AFTER_BODY:{Yu(this,t);break}case S.AFTER_AFTER_BODY:{Bu(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Oi(this,t);return}switch(this.insertionMode){case S.INITIAL:case S.BEFORE_HTML:case S.BEFORE_HEAD:case S.IN_HEAD:case S.IN_HEAD_NO_SCRIPT:case S.AFTER_HEAD:case S.IN_BODY:case S.IN_TABLE:case S.IN_CAPTION:case S.IN_COLUMN_GROUP:case S.IN_TABLE_BODY:case S.IN_ROW:case S.IN_CELL:case S.IN_SELECT:case S.IN_SELECT_IN_TABLE:case S.IN_TEMPLATE:case S.IN_FRAMESET:case S.AFTER_FRAMESET:{Oi(this,t);break}case S.IN_TABLE_TEXT:{Pr(this,t);break}case S.AFTER_BODY:{Dy(this,t);break}case S.AFTER_AFTER_BODY:case S.AFTER_AFTER_FRAMESET:{Ry(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case S.INITIAL:{Py(this,t);break}case S.BEFORE_HEAD:case S.IN_HEAD:case S.IN_HEAD_NO_SCRIPT:case S.AFTER_HEAD:{this._err(t,O.misplacedDoctype);break}case S.IN_TABLE_TEXT:{Pr(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,O.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?nA(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case S.INITIAL:{Rr(this,t);break}case S.BEFORE_HTML:{Oy(this,t);break}case S.BEFORE_HEAD:{Fy(this,t);break}case S.IN_HEAD:{Yt(this,t);break}case S.IN_HEAD_NO_SCRIPT:{Hy(this,t);break}case S.AFTER_HEAD:{Vy(this,t);break}case S.IN_BODY:{ot(this,t);break}case S.IN_TABLE:{gr(this,t);break}case S.IN_TABLE_TEXT:{Pr(this,t);break}case S.IN_CAPTION:{Bk(this,t);break}case S.IN_COLUMN_GROUP:{Is(this,t);break}case S.IN_TABLE_BODY:{Ca(this,t);break}case S.IN_ROW:{Ea(this,t);break}case S.IN_CELL:{Uk(this,t);break}case S.IN_SELECT:{nd(this,t);break}case S.IN_SELECT_IN_TABLE:{zk(this,t);break}case S.IN_TEMPLATE:{qk(this,t);break}case S.AFTER_BODY:{Wk(this,t);break}case S.IN_FRAMESET:{Yk(this,t);break}case S.AFTER_FRAMESET:{Xk(this,t);break}case S.AFTER_AFTER_BODY:{Kk(this,t);break}case S.AFTER_AFTER_FRAMESET:{Jk(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?rA(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case S.INITIAL:{Rr(this,t);break}case S.BEFORE_HTML:{My(this,t);break}case S.BEFORE_HEAD:{By(this,t);break}case S.IN_HEAD:{jy(this,t);break}case S.IN_HEAD_NO_SCRIPT:{Uy(this,t);break}case S.AFTER_HEAD:{zy(this,t);break}case S.IN_BODY:{xa(this,t);break}case S.TEXT:{Nk(this,t);break}case S.IN_TABLE:{tu(this,t);break}case S.IN_TABLE_TEXT:{Pr(this,t);break}case S.IN_CAPTION:{jk(this,t);break}case S.IN_COLUMN_GROUP:{Hk(this,t);break}case S.IN_TABLE_BODY:{Mi(this,t);break}case S.IN_ROW:{td(this,t);break}case S.IN_CELL:{Vk(this,t);break}case S.IN_SELECT:{rd(this,t);break}case S.IN_SELECT_IN_TABLE:{$k(this,t);break}case S.IN_TEMPLATE:{Zk(this,t);break}case S.AFTER_BODY:{ad(this,t);break}case S.IN_FRAMESET:{Gk(this,t);break}case S.AFTER_FRAMESET:{Qk(this,t);break}case S.AFTER_AFTER_BODY:{Bu(this,t);break}}}onEof(t){switch(this.insertionMode){case S.INITIAL:{Rr(this,t);break}case S.BEFORE_HTML:{Vr(this,t);break}case S.BEFORE_HEAD:{zr(this,t);break}case S.IN_HEAD:{$r(this,t);break}case S.IN_HEAD_NO_SCRIPT:{qr(this,t);break}case S.AFTER_HEAD:{Zr(this,t);break}case S.IN_BODY:case S.IN_TABLE:case S.IN_CAPTION:case S.IN_COLUMN_GROUP:case S.IN_TABLE_BODY:case S.IN_ROW:case S.IN_CELL:case S.IN_SELECT:case S.IN_SELECT_IN_TABLE:{Q1(this,t);break}case S.TEXT:{vk(this,t);break}case S.IN_TABLE_TEXT:{Pr(this,t);break}case S.IN_TEMPLATE:{ud(this,t);break}case S.AFTER_BODY:case S.IN_FRAMESET:case S.AFTER_FRAMESET:case S.AFTER_AFTER_BODY:case S.AFTER_AFTER_FRAMESET:{Ss(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 S.IN_HEAD:case S.IN_HEAD_NO_SCRIPT:case S.AFTER_HEAD:case S.TEXT:case S.IN_COLUMN_GROUP:case S.IN_SELECT:case S.IN_SELECT_IN_TABLE:case S.IN_FRAMESET:case S.AFTER_FRAMESET:{this._insertCharacters(t);break}case S.IN_BODY:case S.IN_CAPTION:case S.IN_CELL:case S.IN_TEMPLATE:case S.AFTER_BODY:case S.AFTER_AFTER_BODY:case S.AFTER_AFTER_FRAMESET:{Z1(this,t);break}case S.IN_TABLE:case S.IN_TABLE_BODY:case S.IN_ROW:{ui(this,t);break}case S.IN_TABLE_TEXT:{K1(this,t);break}}}}function Sy(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):X1(e,t),n}function Iy(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 Ny(e,t,n){let r=t,u=e.openElements.getCommonAncestor(t);for(let a=0,i=u;i!==n;a++,i=u){u=e.openElements.getCommonAncestor(i);const o=e.activeFormattingElements.getElementEntry(i),c=o&&a>=ky;!o||c?(c&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(i)):(i=vy(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(i,r),r=i)}return r}function vy(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 wy(e,t,n){const r=e.treeAdapter.getTagName(t),u=Sr(r);if(e._isElementCausesFosterParenting(u))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);u===d.TEMPLATE&&a===B.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Ly(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 As(e,t){for(let n=0;n<yy;n++){const r=Sy(e,t);if(!r)break;const u=Iy(e,r);if(!u)break;e.activeFormattingElements.bookmark=r;const a=Ny(e,u,r.element),i=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),i&&wy(e,i,a),Ly(e,u,r)}}function Oi(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Dy(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Ry(e,t){e._appendCommentNode(t,e.document)}function Ss(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],i=e.treeAdapter.getNodeSourceCodeLocation(a);i&&!i.endTag&&e._setEndLocation(a,t)}}}}function Py(e,t){e._setDocumentType(t);const n=t.forceQuirks?Bt.QUIRKS:ly(t);cy(t)||e._err(t,O.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=S.BEFORE_HTML}function Rr(e,t){e._err(t,O.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Bt.QUIRKS),e.insertionMode=S.BEFORE_HTML,e._processToken(t)}function Oy(e,t){t.tagID===d.HTML?(e._insertElement(t,B.HTML),e.insertionMode=S.BEFORE_HEAD):Vr(e,t)}function My(e,t){const n=t.tagID;(n===d.HTML||n===d.HEAD||n===d.BODY||n===d.BR)&&Vr(e,t)}function Vr(e,t){e._insertFakeRootElement(),e.insertionMode=S.BEFORE_HEAD,e._processToken(t)}function Fy(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.HEAD:{e._insertElement(t,B.HTML),e.headElement=e.openElements.current,e.insertionMode=S.IN_HEAD;break}default:zr(e,t)}}function By(e,t){const n=t.tagID;n===d.HEAD||n===d.BODY||n===d.HTML||n===d.BR?zr(e,t):e._err(t,O.endTagWithoutMatchingOpenElement)}function zr(e,t){e._insertFakeElement(R.HEAD,d.HEAD),e.headElement=e.openElements.current,e.insertionMode=S.IN_HEAD,e._processToken(t)}function Yt(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:{e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break}case d.TITLE:{e._switchToTextParsing(t,Ve.RCDATA);break}case d.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ve.RAWTEXT):(e._insertElement(t,B.HTML),e.insertionMode=S.IN_HEAD_NO_SCRIPT);break}case d.NOFRAMES:case d.STYLE:{e._switchToTextParsing(t,Ve.RAWTEXT);break}case d.SCRIPT:{e._switchToTextParsing(t,Ve.SCRIPT_DATA);break}case d.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=S.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(S.IN_TEMPLATE);break}case d.HEAD:{e._err(t,O.misplacedStartTagForHeadElement);break}default:$r(e,t)}}function jy(e,t){switch(t.tagID){case d.HEAD:{e.openElements.pop(),e.insertionMode=S.AFTER_HEAD;break}case d.BODY:case d.BR:case d.HTML:{$r(e,t);break}case d.TEMPLATE:{Kn(e,t);break}default:e._err(t,O.endTagWithoutMatchingOpenElement)}}function Kn(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==d.TEMPLATE&&e._err(t,O.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(d.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,O.endTagWithoutMatchingOpenElement)}function $r(e,t){e.openElements.pop(),e.insertionMode=S.AFTER_HEAD,e._processToken(t)}function Hy(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.BASEFONT:case d.BGSOUND:case d.HEAD:case d.LINK:case d.META:case d.NOFRAMES:case d.STYLE:{Yt(e,t);break}case d.NOSCRIPT:{e._err(t,O.nestedNoscriptInHead);break}default:qr(e,t)}}function Uy(e,t){switch(t.tagID){case d.NOSCRIPT:{e.openElements.pop(),e.insertionMode=S.IN_HEAD;break}case d.BR:{qr(e,t);break}default:e._err(t,O.endTagWithoutMatchingOpenElement)}}function qr(e,t){const n=t.type===xe.EOF?O.openElementsLeftAfterEof:O.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=S.IN_HEAD,e._processToken(t)}function Vy(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.BODY:{e._insertElement(t,B.HTML),e.framesetOk=!1,e.insertionMode=S.IN_BODY;break}case d.FRAMESET:{e._insertElement(t,B.HTML),e.insertionMode=S.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,O.abandonedHeadElementChild),e.openElements.push(e.headElement,d.HEAD),Yt(e,t),e.openElements.remove(e.headElement);break}case d.HEAD:{e._err(t,O.misplacedStartTagForHeadElement);break}default:Zr(e,t)}}function zy(e,t){switch(t.tagID){case d.BODY:case d.HTML:case d.BR:{Zr(e,t);break}case d.TEMPLATE:{Kn(e,t);break}default:e._err(t,O.endTagWithoutMatchingOpenElement)}}function Zr(e,t){e._insertFakeElement(R.BODY,d.BODY),e.insertionMode=S.IN_BODY,_a(e,t)}function _a(e,t){switch(t.type){case xe.CHARACTER:{W1(e,t);break}case xe.WHITESPACE_CHARACTER:{Z1(e,t);break}case xe.COMMENT:{Oi(e,t);break}case xe.START_TAG:{ot(e,t);break}case xe.END_TAG:{xa(e,t);break}case xe.EOF:{Q1(e,t);break}}}function Z1(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function W1(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function $y(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function qy(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Zy(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,B.HTML),e.insertionMode=S.IN_FRAMESET)}function Wy(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,B.HTML)}function Yy(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Pi.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,B.HTML)}function Gy(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,B.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Xy(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,B.HTML),n||(e.formElement=e.openElements.current))}function Qy(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,B.HTML)}function Ky(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,B.HTML),e.tokenizer.state=Ve.PLAINTEXT}function Jy(e,t){e.openElements.hasInScope(d.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.framesetOk=!1}function ek(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(R.A);n&&(As(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function tk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function nk(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(d.NOBR)&&(As(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,B.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function uk(e,t){e.treeAdapter.getDocumentMode(e.document)!==Bt.QUIRKS&&e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,B.HTML),e.framesetOk=!1,e.insertionMode=S.IN_TABLE}function Y1(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,B.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function G1(e){const t=F1(e,Zn.TYPE);return t!=null&&t.toLowerCase()===Ty}function ak(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,B.HTML),G1(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function ik(e,t){e._appendElement(t,B.HTML),t.ackSelfClosing=!0}function sk(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._appendElement(t,B.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function ok(e,t){t.tagName=R.IMG,t.tagID=d.IMG,Y1(e,t)}function ck(e,t){e._insertElement(t,B.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ve.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=S.TEXT}function lk(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ve.RAWTEXT)}function dk(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ve.RAWTEXT)}function Fc(e,t){e._switchToTextParsing(t,Ve.RAWTEXT)}function fk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===S.IN_TABLE||e.insertionMode===S.IN_CAPTION||e.insertionMode===S.IN_TABLE_BODY||e.insertionMode===S.IN_ROW||e.insertionMode===S.IN_CELL?S.IN_SELECT_IN_TABLE:S.IN_SELECT}function hk(e,t){e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML)}function pk(e,t){e.openElements.hasInScope(d.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,B.HTML)}function mk(e,t){e.openElements.hasInScope(d.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(d.RTC),e._insertElement(t,B.HTML)}function bk(e,t){e._reconstructActiveFormattingElements(),z1(t),ks(t),t.selfClosing?e._appendElement(t,B.MATHML):e._insertElement(t,B.MATHML),t.ackSelfClosing=!0}function gk(e,t){e._reconstructActiveFormattingElements(),$1(t),ks(t),t.selfClosing?e._appendElement(t,B.SVG):e._insertElement(t,B.SVG),t.ackSelfClosing=!0}function Bc(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,B.HTML)}function ot(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:{tk(e,t);break}case d.A:{ek(e,t);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{Yy(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:{Wy(e,t);break}case d.LI:case d.DD:case d.DT:{Qy(e,t);break}case d.BR:case d.IMG:case d.WBR:case d.AREA:case d.EMBED:case d.KEYGEN:{Y1(e,t);break}case d.HR:{sk(e,t);break}case d.RB:case d.RTC:{pk(e,t);break}case d.RT:case d.RP:{mk(e,t);break}case d.PRE:case d.LISTING:{Gy(e,t);break}case d.XMP:{lk(e,t);break}case d.SVG:{gk(e,t);break}case d.HTML:{$y(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:{Yt(e,t);break}case d.BODY:{qy(e,t);break}case d.FORM:{Xy(e,t);break}case d.NOBR:{nk(e,t);break}case d.MATH:{bk(e,t);break}case d.TABLE:{uk(e,t);break}case d.INPUT:{ak(e,t);break}case d.PARAM:case d.TRACK:case d.SOURCE:{ik(e,t);break}case d.IMAGE:{ok(e,t);break}case d.BUTTON:{Jy(e,t);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{rk(e,t);break}case d.IFRAME:{dk(e,t);break}case d.SELECT:{fk(e,t);break}case d.OPTION:case d.OPTGROUP:{hk(e,t);break}case d.NOEMBED:case d.NOFRAMES:{Fc(e,t);break}case d.FRAMESET:{Zy(e,t);break}case d.TEXTAREA:{ck(e,t);break}case d.NOSCRIPT:{e.options.scriptingEnabled?Fc(e,t):Bc(e,t);break}case d.PLAINTEXT:{Ky(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:Bc(e,t)}}function _k(e,t){if(e.openElements.hasInScope(d.BODY)&&(e.insertionMode=S.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function xk(e,t){e.openElements.hasInScope(d.BODY)&&(e.insertionMode=S.AFTER_BODY,ad(e,t))}function Ck(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Ek(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 Tk(e){e.openElements.hasInButtonScope(d.P)||e._insertFakeElement(R.P,d.P),e._closePElement()}function yk(e){e.openElements.hasInListItemScope(d.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(d.LI),e.openElements.popUntilTagNamePopped(d.LI))}function kk(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Ak(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Sk(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Ik(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(R.BR,d.BR),e.openElements.pop(),e.framesetOk=!1}function X1(e,t){const n=t.tagName,r=t.tagID;for(let u=e.openElements.stackTop;u>0;u--){const a=e.openElements.items[u],i=e.openElements.tagIDs[u];if(r===i&&(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,i))break}}function xa(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:{As(e,t);break}case d.P:{Tk(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:{Ck(e,t);break}case d.LI:{yk(e);break}case d.DD:case d.DT:{kk(e,t);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{Ak(e);break}case d.BR:{Ik(e);break}case d.BODY:{_k(e,t);break}case d.HTML:{xk(e,t);break}case d.FORM:{Ek(e);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{Sk(e,t);break}case d.TEMPLATE:{Kn(e,t);break}default:X1(e,t)}}function Q1(e,t){e.tmplInsertionModeStack.length>0?ud(e,t):Ss(e,t)}function Nk(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 vk(e,t){e._err(t,O.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function ui(e,t){if(e.openElements.currentTagId!==void 0&&q1.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=S.IN_TABLE_TEXT,t.type){case xe.CHARACTER:{J1(e,t);break}case xe.WHITESPACE_CHARACTER:{K1(e,t);break}}else hu(e,t)}function wk(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,B.HTML),e.insertionMode=S.IN_CAPTION}function Lk(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,B.HTML),e.insertionMode=S.IN_COLUMN_GROUP}function Dk(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(R.COLGROUP,d.COLGROUP),e.insertionMode=S.IN_COLUMN_GROUP,Is(e,t)}function Rk(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,B.HTML),e.insertionMode=S.IN_TABLE_BODY}function Pk(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(R.TBODY,d.TBODY),e.insertionMode=S.IN_TABLE_BODY,Ca(e,t)}function Ok(e,t){e.openElements.hasInTableScope(d.TABLE)&&(e.openElements.popUntilTagNamePopped(d.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Mk(e,t){G1(t)?e._appendElement(t,B.HTML):hu(e,t),t.ackSelfClosing=!0}function Fk(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,B.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function gr(e,t){switch(t.tagID){case d.TD:case d.TH:case d.TR:{Pk(e,t);break}case d.STYLE:case d.SCRIPT:case d.TEMPLATE:{Yt(e,t);break}case d.COL:{Dk(e,t);break}case d.FORM:{Fk(e,t);break}case d.TABLE:{Ok(e,t);break}case d.TBODY:case d.TFOOT:case d.THEAD:{Rk(e,t);break}case d.INPUT:{Mk(e,t);break}case d.CAPTION:{wk(e,t);break}case d.COLGROUP:{Lk(e,t);break}default:hu(e,t)}}function tu(e,t){switch(t.tagID){case d.TABLE:{e.openElements.hasInTableScope(d.TABLE)&&(e.openElements.popUntilTagNamePopped(d.TABLE),e._resetInsertionMode());break}case d.TEMPLATE:{Kn(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:hu(e,t)}}function hu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,_a(e,t),e.fosterParentingEnabled=n}function K1(e,t){e.pendingCharacterTokens.push(t)}function J1(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Pr(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)hu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const ed=new Set([d.CAPTION,d.COL,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]);function Bk(e,t){const n=t.tagID;ed.has(n)?e.openElements.hasInTableScope(d.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=S.IN_TABLE,gr(e,t)):ot(e,t)}function jk(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=S.IN_TABLE,n===d.TABLE&&tu(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:xa(e,t)}}function Is(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.COL:{e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break}case d.TEMPLATE:{Yt(e,t);break}default:Wu(e,t)}}function Hk(e,t){switch(t.tagID){case d.COLGROUP:{e.openElements.currentTagId===d.COLGROUP&&(e.openElements.pop(),e.insertionMode=S.IN_TABLE);break}case d.TEMPLATE:{Kn(e,t);break}case d.COL:break;default:Wu(e,t)}}function Wu(e,t){e.openElements.currentTagId===d.COLGROUP&&(e.openElements.pop(),e.insertionMode=S.IN_TABLE,e._processToken(t))}function Ca(e,t){switch(t.tagID){case d.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,B.HTML),e.insertionMode=S.IN_ROW;break}case d.TH:case d.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(R.TR,d.TR),e.insertionMode=S.IN_ROW,Ea(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=S.IN_TABLE,gr(e,t));break}default:gr(e,t)}}function Mi(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=S.IN_TABLE);break}case d.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=S.IN_TABLE,tu(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:tu(e,t)}}function Ea(e,t){switch(t.tagID){case d.TH:case d.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,B.HTML),e.insertionMode=S.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=S.IN_TABLE_BODY,Ca(e,t));break}default:gr(e,t)}}function td(e,t){switch(t.tagID){case d.TR:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=S.IN_TABLE_BODY);break}case d.TABLE:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=S.IN_TABLE_BODY,Mi(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=S.IN_TABLE_BODY,Mi(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:tu(e,t)}}function Uk(e,t){const n=t.tagID;ed.has(n)?(e.openElements.hasInTableScope(d.TD)||e.openElements.hasInTableScope(d.TH))&&(e._closeTableCell(),Ea(e,t)):ot(e,t)}function Vk(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=S.IN_ROW);break}case d.TABLE:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),td(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:break;default:xa(e,t)}}function nd(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.OPTION:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e._insertElement(t,B.HTML);break}case d.OPTGROUP:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop(),e._insertElement(t,B.HTML);break}case d.HR:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop(),e._appendElement(t,B.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:{Yt(e,t);break}}}function rd(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:{Kn(e,t);break}}}function zk(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)):nd(e,t)}function $k(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)):rd(e,t)}function qk(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:{Yt(e,t);break}case d.CAPTION:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{e.tmplInsertionModeStack[0]=S.IN_TABLE,e.insertionMode=S.IN_TABLE,gr(e,t);break}case d.COL:{e.tmplInsertionModeStack[0]=S.IN_COLUMN_GROUP,e.insertionMode=S.IN_COLUMN_GROUP,Is(e,t);break}case d.TR:{e.tmplInsertionModeStack[0]=S.IN_TABLE_BODY,e.insertionMode=S.IN_TABLE_BODY,Ca(e,t);break}case d.TD:case d.TH:{e.tmplInsertionModeStack[0]=S.IN_ROW,e.insertionMode=S.IN_ROW,Ea(e,t);break}default:e.tmplInsertionModeStack[0]=S.IN_BODY,e.insertionMode=S.IN_BODY,ot(e,t)}}function Zk(e,t){t.tagID===d.TEMPLATE&&Kn(e,t)}function ud(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(d.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ss(e,t)}function Wk(e,t){t.tagID===d.HTML?ot(e,t):Yu(e,t)}function ad(e,t){var n;if(t.tagID===d.HTML){if(e.fragmentContext||(e.insertionMode=S.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 Yu(e,t)}function Yu(e,t){e.insertionMode=S.IN_BODY,_a(e,t)}function Yk(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.FRAMESET:{e._insertElement(t,B.HTML);break}case d.FRAME:{e._appendElement(t,B.HTML),t.ackSelfClosing=!0;break}case d.NOFRAMES:{Yt(e,t);break}}}function Gk(e,t){t.tagID===d.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==d.FRAMESET&&(e.insertionMode=S.AFTER_FRAMESET))}function Xk(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.NOFRAMES:{Yt(e,t);break}}}function Qk(e,t){t.tagID===d.HTML&&(e.insertionMode=S.AFTER_AFTER_FRAMESET)}function Kk(e,t){t.tagID===d.HTML?ot(e,t):Bu(e,t)}function Bu(e,t){e.insertionMode=S.IN_BODY,_a(e,t)}function Jk(e,t){switch(t.tagID){case d.HTML:{ot(e,t);break}case d.NOFRAMES:{Yt(e,t);break}}}function eA(e,t){t.chars=Oe,e._insertCharacters(t)}function tA(e,t){e._insertCharacters(t),e.framesetOk=!1}function id(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==B.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function nA(e,t){if(gy(t))id(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===B.MATHML?z1(t):r===B.SVG&&(_y(t),$1(t)),ks(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function rA(e,t){if(t.tagID===d.P||t.tagID===d.BR){id(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)===B.HTML){e._endTagOutsideForeignContent(t);break}const u=e.treeAdapter.getTagName(r);if(u.toLowerCase()===t.tagName){t.tagName=u,e.openElements.shortenToLength(n);break}}}R.AREA,R.BASE,R.BASEFONT,R.BGSOUND,R.BR,R.COL,R.EMBED,R.FRAME,R.HR,R.IMG,R.INPUT,R.KEYGEN,R.LINK,R.META,R.PARAM,R.SOURCE,R.TRACK,R.WBR;const uA=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,aA=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),jc={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function sd(e,t){const n=mA(e),r=e1("type",{handlers:{root:iA,element:sA,text:oA,comment:cd,doctype:cA,raw:dA},unknown:fA}),u={parser:n?new Mc(jc):Mc.getFragmentParser(void 0,jc),handle(o){r(o,u)},stitches:!1,options:t||{}};r(e,u),Ir(u,an());const a=n?u.parser.document:u.parser.getFragment(),i=iT(a,{file:u.options.file});return u.stitches&&ga(i,"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}}),i.type==="root"&&i.children.length===1&&i.children[0].type===e.type?i.children[0]:i}function od(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function iA(e,t){od(e.children,t)}function sA(e,t){hA(e,t),od(e.children,t),pA(e,t)}function oA(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:xe.CHARACTER,chars:e.value,location:pu(e)};Ir(t,an(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function cA(e,t){const n={type:xe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:pu(e)};Ir(t,an(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function lA(e,t){t.stitches=!0;const n=bA(e);if("children"in e&&"children"in n){const r=sd({type:"root",children:e.children},t.options);n.children=r.children}cd({type:"comment",value:{stitch:n}},t)}function cd(e,t){const n=e.value,r={type:xe.COMMENT,data:n,location:pu(e)};Ir(t,an(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function dA(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,ld(t,an(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(uA,"&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 fA(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))lA(n,t);else{let r="";throw aA.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 Ir(e,t){ld(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=Ve.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 ld(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 hA(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ve.PLAINTEXT)return;Ir(t,an(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=ET({...e,children:[]},{space:u===qn.svg?"svg":"html"}),i={type:xe.START_TAG,tagName:n,tagID:Sr(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:pu(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function pA(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&vT.includes(n)||t.parser.tokenizer.state===Ve.PLAINTEXT)return;Ir(t,da(e));const r={type:xe.END_TAG,tagName:n,tagID:Sr(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:pu(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ve.RCDATA||t.parser.tokenizer.state===Ve.RAWTEXT||t.parser.tokenizer.state===Ve.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ve.DATA)}function mA(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function pu(e){const t=an(e)||{line:void 0,column:void 0,offset:void 0},n=da(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 bA(e){return"children"in e?br({...e,children:[]}):br(e)}function dd(e){return function(t,n){return sd(t,{...e,file:n})}}const Ns=()=>{const{shopTerms:e}=g.useStorefrontStore(),{isAntistock:t}=g.useGeneralStore();return!(e!=null&&e.showTermsOfServiceOnProduct)||!(e!=null&&e.termsOfService)?null:s.jsxs("div",{className:wr.container,children:[s.jsx("div",{className:wr.icon,children:s.jsx(w.Icon,{name:"FileCloud",fill:"var(--text-secondary)"})}),t?s.jsx(Ki,{text:e.termsOfService}):s.jsx(gs,{remarkPlugins:[C1],rehypePlugins:[dd],className:wr.text,components:{a:({node:n,...r})=>s.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",className:wr.link,id:"md"}),p:({node:n,...r})=>s.jsx("p",{...r,className:wr.text,id:"md"})},children:e==null?void 0:e.termsOfService})]})},gA="_securedBySsl_1ng38_2",_A="_text_1ng38_9",ai={securedBySsl:gA,text:_A},vs=({isAntistock:e})=>s.jsxs("div",{className:ai.securedBySsl,children:[s.jsx("div",{className:ai.iconWrapper,children:s.jsx(w.Icon,{name:"ShieldCheck",fill:"var(--text-secondary)"})}),s.jsx("p",{className:ai.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."})]}),fd=({getPossibleGateways:e,setGateway:t,getDiscordSettings:n,cart:r,products:u,submitCart:a,reset:i,setCustomFieldsToCart:o,totalAndDiscount:c,setDiscordSocialConnectId:l,setPaymentMethod:h,isAntistock:f})=>{const m=P.useMemo(()=>n(),[]),[p,b]=P.useState([]),{balance:x,setBalance:E}=g.useCustomerDashboardStore(),{token:_}=g.useStorefrontStore(),{executeRecaptcha:I}=ru(),{discordInfo:k}=g.useDiscordStore(),{customerEmail:D,setCustomerEmail:N}=g.useCartStore(),v=k!=null&&k.authorized?k.id:void 0,V=g.useNavigate(),Y=P.useMemo(()=>e(),[r.parts]),[Z,L]=P.useState(!1),{setIsOpen:F}=g.useModalStore(),{notifications:H,setNotifications:G}=g.useNotificationStore();P.useEffect(()=>{const Te=Ms(r.parts,u).map(ye=>ye.type===Sn.Checkbox?{...ye,value:String(ye.defaultValue)}:ye);b([...Te])},[]),P.useEffect(()=>{const ie=Ms(r.parts,u);b(Te=>{const ye=new Map(Te.map(C=>[C.name,C]));return ie.map(C=>{const U=ye.get(C.name);return U&&U.value?{...C,value:U.value}:C.type===Sn.Checkbox?{...C,value:String(C.defaultValue)}:C})})},[r.parts,u]),P.useEffect(()=>{_&&(async()=>{const Te=await Ju();E(Te)})()},[_]);function ae(ie){return ie&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(ie)}const K=()=>{const ie=[];return p.forEach(Te=>{var ye;Te.required&&!((ye=Te.value)!=null&&ye.toString().trim())&&ie.push({message:`Field "${Te.name}" is required.`,status:"error",id:g.v4()})}),ie.length>0?(G([...H,...ie]),!1):!0},be=async ie=>{if(ie.stopPropagation(),r.gateway==="Balance"&&!_){F(!0),L(!0);return}if(!K())return;const Te=Object.fromEntries(p.map(C=>[C.name,C.value||""]));o({...Te}),v&&m.isEnabled&&l(v);const ye=await I();if(ye){const C=await a(ye),U=JSON.parse(localStorage.getItem("orders")||"{}");if(Object.keys(U).length>10){const J=Date.now()-864e5;Object.keys(U).forEach(A=>{U[A].createdAt<=J&&delete U[A]})}"order"in C?U[C.order.id]={createdAt:Date.now(),fullAccessToken:C.order.fullAccessToken}:U[C.id]={createdAt:Date.now(),fullAccessToken:C.fullAccessToken},localStorage.setItem("orders",JSON.stringify(U)),V(`/orders/${"order"in C?C.order.id:C.id}/${"order"in C?C.order.fullAccessToken:C.fullAccessToken}`),setTimeout(()=>i(),2e3)}};return s.jsxs("div",{className:mt.checkoutOperational,style:f?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:[s.jsxs("div",{className:`${mt.innerContainer} ${f?mt.innerContainerAntistock:""}`,children:[f?s.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&&s.jsx(rs,{possibleGateways:Y,setGateway:t,setPaymentMethod:h,balance:x,totalAndDiscount:c,onSignInClick:()=>{L(!0),F(!0)},isAntistock:f}),s.jsx("div",{className:g.clx(mt.paymentMethodsSection,{[mt.antistock]:f,[mt.paymentMethodsSectionAntistock]:f}),children:s.jsx(w.Input,{placeholder:"your@email.com",value:D||"",onChange:ie=>N(ie),disabled:!!_,label:"Email Address"})}),s.jsx(s0,{customFields:p,setCustomFields:b}),m.isEnabled&&s.jsxs("div",{className:mt.socialConnectSection,children:[s.jsx("p",{className:mt.socialConnectLabel,id:"md",children:"Social Connect"}),s.jsx("div",{className:mt.socialConnectContent,children:s.jsx(c0,{customerEmail:D||""})})]}),s.jsxs("div",{className:`${mt.continueButton} ${f?mt.continueButtonAntistock:""}`,children:[s.jsx(w.Button,{onClick:be,disabled:!r.gateway||!ae(D||"")||m.isRequired&&!(k!=null&&k.authorized),className:mt.button,children:"Continue to Checkout"}),s.jsx(Ns,{}),s.jsx(vs,{isAntistock:f})]}),s.jsx(On,{className:`${mt.checkoutFooter} ${f?mt.checkoutFooterAntistock:""}`})]}),Z&&s.jsx(w.Modal,{close:()=>L(!1),children:s.jsx(l0,{setIsOpen:L})})]})},xA="_bottomSheet_1a6cu_1",CA="_title_1a6cu_8",EA="_contentTitle_1a6cu_12",TA="_contentText_1a6cu_16",yA="_discordMessageTitle_1a6cu_20",kA="_content_1a6cu_12",AA="_section_1a6cu_27",SA="_copyButton_1a6cu_32",IA="_scrollableBox_1a6cu_37",NA="_scrollableBoxAntistock_1a6cu_47",vA="_discordMessage_1a6cu_20",wA="_link_1a6cu_61",LA="_buttonGroup_1a6cu_68",DA="_buttonWrapper_1a6cu_80",RA="_modal_1a6cu_84",PA="_modalAntistock_1a6cu_91",OA="_header_1a6cu_96",MA="_copyButtonAntistock_1a6cu_104",Ge={bottomSheet:xA,title:CA,contentTitle:EA,contentText:TA,discordMessageTitle:yA,content:kA,section:AA,copyButton:SA,scrollableBox:IA,scrollableBoxAntistock:NA,discordMessage:vA,link:wA,buttonGroup:LA,buttonWrapper:DA,modal:RA,modalAntistock:PA,header:OA,copyButtonAntistock:MA},hd=({setIsOpen:e,deliveryConfiguration:t})=>{const n=Yn(),r=t.type===Se.Discord,{setIsOpen:u}=g.useModalStore(),{isAntistock:a}=g.useGeneralStore(),i=t.type===Se.Serial?t.deliveryItems.map(c=>c.serialKey).join(`
107
- `):t.deliveryItems[0].textData,o=()=>{u(!1),a?e(!1):setTimeout(()=>{e(!1)},300)};return s.jsxs("div",{className:g.clx(Ge.modal,{[Ge.modalAntistock]:a}),onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:Ge.header,children:[s.jsx("h3",{id:"h3",className:Ge.title,children:a?"View Content":"Thank you for the purchase!"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Ge.bottomSheet,children:[s.jsx("div",{className:Ge.content,children:r?s.jsx("div",{className:Ge.discordMessage,children:s.jsx("p",{className:Ge.discordMessageTitle,id:"md",children:"Discord role has been granted"})}):s.jsxs("div",{children:[s.jsxs("div",{className:Ge.section,children:[!a&&s.jsx("p",{className:Ge.contentTitle,id:"md",children:"Content"}),!a&&s.jsxs(w.Button,{className:Ge.copyButton,type:"Secondary",onClick:()=>n(i),children:[s.jsx(w.Icon,{name:"Copy"}),"Copy to Clipboard"]})]}),s.jsx("div",{className:g.clx(Ge.scrollableBox,{[Ge.scrollableBoxAntistock]:a}),children:s.jsx("p",{className:Ge.contentText,id:"md",children:a?s.jsx(Ki,{text:i}):s.jsx(gs,{remarkPlugins:[C1],rehypePlugins:[dd],components:{a:({node:c,...l})=>s.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer",className:Ge.link})},children:i})})})]})}),a&&s.jsxs(w.Button,{className:Ge.copyButtonAntistock,type:"Secondary",onClick:()=>n(i),children:[s.jsx(w.Icon,{name:"Copy"}),"Copy All"]}),!a&&s.jsx("div",{className:Ge.buttonGroup,children:s.jsx("div",{className:Ge.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:o,children:"Close"})})})]})]})},FA="_mt1_1l62z_1",BA="_notifyBlock_1l62z_13",jA="_notifyHeader_1l62z_19",HA="_notifyContent_1l62z_25",UA="_buttonBlock_1l62z_30",VA="_imageBlock_1l62z_34",zA="_imageContainer_1l62z_42",$A="_sectionBlock_1l62z_54",qA="_sectionTitle_1l62z_61",ZA="_sectionSubtitle_1l62z_64",WA="_inputContainer_1l62z_69",Zt={mt1:FA,notifyBlock:BA,notifyHeader:jA,notifyContent:HA,buttonBlock:UA,imageBlock:VA,imageContainer:zA,sectionBlock:$A,sectionTitle:qA,sectionSubtitle:ZA,inputContainer:WA},YA=({props:e})=>{const t=Yn();return s.jsx("div",{className:Zt.mt1,children:s.jsxs("div",{className:Zt.inputContainer,children:[s.jsx(w.Input,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&s.jsx(w.Button,{type:"Secondary",onClick:()=>t(e.text),children:s.jsx(w.Icon,{name:"Copy"})})]})})},GA=({props:e})=>s.jsx(w.Button,{className:Zt.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),XA=({props:e})=>s.jsx("div",{className:Zt.imageBlock,children:s.jsx("div",{className:Zt.imageContainer,children:s.jsx("img",{src:e.src,alt:""})})}),QA=({props:e})=>s.jsxs("div",{className:Zt.notifyBlock,children:[s.jsxs("div",{className:Zt.notifyHeader,children:[s.jsx(w.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),s.jsx("p",{children:e.heading})]}),s.jsx("p",{className:Zt.notifyContent,children:e.content})]}),KA=({props:e})=>{var t;return s.jsxs("div",{className:Zt.sectionBlock,children:[s.jsx("p",{className:Zt.sectionTitle,children:e.title}),s.jsx("span",{className:Zt.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>s.jsx(Gu,{block:n},r))]})},Gu=({block:e})=>{switch(e.type){case"Section":return s.jsx(KA,{...e});case"ReadOnlyTextInput":return s.jsx(YA,{...e});case"Notify":return s.jsx(QA,{...e});case"Button":return s.jsx(GA,{...e});case"Image":return s.jsx(XA,{...e});default:return null}},JA="_chargeStatusBlock_12swd_4",eS="_isAntistock_12swd_13",tS="_chargeStatusIcon_12swd_19",nS="_chargeStatusTitle_12swd_27",rS="_chargeStatusDescription_12swd_33",uS="_pickUpButton_12swd_39",aS="_actionButtons_12swd_49",iS="_actionButton_12swd_49",Et={chargeStatusBlock:JA,isAntistock:eS,chargeStatusIcon:tS,chargeStatusTitle:nS,chargeStatusDescription:rS,pickUpButton:uS,actionButtons:aS,actionButton:iS},$n={[pe.Paid]:"Payment Successful",[pe.Pending]:"Payment Pending",[pe.Expired]:"Payment Expired",[pe.Cancelled]:"Payment Cancelled",[pe.NotPaid]:"Payment Failed",[pe.Refunded]:"Payment Refunded"},pd={[pe.Paid]:"Your payment has successfully been processed. Tap on the button below to be redirected back to our website.",[pe.Pending]:"Your payment is currently pending. We recommend checking back shortly for confirmation.",[pe.Expired]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[pe.Cancelled]:"You canceled the warrant. If there are any problems, please contact support",[pe.NotPaid]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[pe.Refunded]:"Your payment has been refunded. Please check your payment method for confirmation."},md=()=>({[pe.Paid]:s.jsx("div",{className:`${Et.chargeStatusIcon}`,children:s.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),[pe.Pending]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"})}),[pe.Expired]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[pe.Cancelled]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[pe.NotPaid]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[pe.Refunded]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-warning)"})})}),bd=({charge:e})=>{const t=e.status,n=g.useNavigate(),{shopDomain:r}=g.useStorefrontStore(),{isAntistock:u}=g.useGeneralStore(),a=P.useRef(),[i,o]=g.useSearchParams(),c=()=>{var h,f;if(!((h=e.order)!=null&&h.id))return;const l=i.get("redirectRoute");if((e==null?void 0:e.status)===pe.Paid&&e.redirectUrl&&!a.current){const p=JSON.parse(localStorage.getItem("orders")||"{}")[((f=e==null?void 0:e.order)==null?void 0:f.id)||""];p?window.open(p.fullAccessToken?`${e.redirectUrl}/${p.fullAccessToken}`:`${e.redirectUrl}`,"_self"):window.open(e.redirectUrl,"_self")}(e==null?void 0:e.status)===pe.Paid&&a.current&&n(a.current,{replace:!0}),l&&a&&(a.current=l,i.delete("redirectRoute"),o(i))};return s.jsxs("div",{className:g.clx(Et.chargeStatusBlock,{[Et.isAntistock]:u}),children:[md()[t],s.jsx("h2",{className:Et.chargeStatusTitle,children:$n[t]}),s.jsx("p",{className:Et.chargeStatusDescription,children:pd[t]}),t===pe.Paid?s.jsx("div",{className:Et.pickUpButton,style:u?{justifyContent:"flex-start"}:void 0,children:s.jsxs(w.Button,{onClick:c,style:{width:"100%",maxWidth:"250px",display:"flex",alignItems:"center",gap:"5px"},type:"Secondary",children:[s.jsx(w.Icon,{name:"ArrowLineUpRight"}),u?"View Order":"Pick up Order"]})}):s.jsxs("div",{className:Et.actionButtons,children:[s.jsx("div",{className:Et.actionButton,children:s.jsxs(w.Button,{type:"Secondary",onClick:()=>window.open(`https://${r}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[s.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),s.jsx("div",{className:Et.actionButton,children:s.jsxs(w.Button,{type:"Secondary",style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},onClick:()=>{u?window.open(`https://${r}/support`):n("/contact")},children:[s.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},sS="_bottomSheet_1x4sq_1",oS="_content_1x4sq_8",cS="_agreementList_1x4sq_11",lS="_agreementItem_1x4sq_16",dS="_warning_1x4sq_23",fS="_buttonGroup_1x4sq_31",hS="_buttonWrapper_1x4sq_41",pS="_fullWidthButton_1x4sq_44",mS="_modal_1x4sq_48",bS="_header_1x4sq_55",Mt={bottomSheet:sS,content:oS,agreementList:cS,agreementItem:lS,warning:dS,buttonGroup:fS,buttonWrapper:hS,fullWidthButton:pS,modal:mS,header:bS},gd=({setIsOpen:e,price:t})=>{const[n,r]=P.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:u}=g.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return s.jsxs("div",{className:Mt.modal,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:Mt.header,children:[s.jsx("h3",{id:"h3",children:"Note"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Mt.bottomSheet,children:[s.jsxs("div",{className:Mt.content,children:[s.jsxs("div",{className:Mt.agreementList,children:[s.jsxs("label",{className:Mt.agreementItem,children:[s.jsx(w.Checkbox,{value:n.agreeToSendAsFF,onChange:i=>r({...n,agreeToSendAsFF:i})}),s.jsx("p",{children:"I agree to send the payment as friends & family"})]}),s.jsxs("label",{className:Mt.agreementItem,children:[s.jsx(w.Checkbox,{value:n.agreeToSend,onChange:i=>r({...n,agreeToSend:i})}),s.jsxs("p",{children:["I agree to send the payment of ",g.formatPrice(t)," ",t.currency]})]}),s.jsxs("label",{className:Mt.agreementItem,children:[s.jsx(w.Checkbox,{value:n.agreeToNotAddNote,onChange:i=>r({...n,agreeToNotAddNote:i})}),s.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),s.jsx("div",{className:Mt.warning,children:s.jsxs("p",{children:["Please note that you are required to send the exact payment of ",g.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),s.jsxs("div",{className:Mt.buttonGroup,children:[s.jsx("div",{className:Mt.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",children:s.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),s.jsx("div",{className:Mt.fullWidthButton,children:s.jsx(w.Button,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:a,children:"Continue to Payment"})})]})]})]})},gS="_chargeItemsContainer_vynct_5",_S="_chargeItemsInner_vynct_18",xS="_productsContainer_vynct_25",CS="_antistockLayout_vynct_40",ES="_mainContentAntistock_vynct_53",TS="_desktopTrackPayment_vynct_64",yS="_desktopFooter_vynct_73",kS="_footerContainerAntistock_vynct_94",AS="_chargeHeader_vynct_107",SS="_chargeTitle_vynct_115",IS="_chargeDescription_vynct_121",NS="_copyButton_vynct_127",vS="_productsList_vynct_139",wS="_footerContainer_vynct_94",gt={chargeItemsContainer:gS,chargeItemsInner:_S,productsContainer:xS,antistockLayout:CS,mainContentAntistock:ES,desktopTrackPayment:TS,desktopFooter:yS,footerContainerAntistock:kS,chargeHeader:AS,chargeTitle:SS,chargeDescription:IS,copyButton:NS,productsList:vS,footerContainer:wS},_d=({charge:e})=>{var i;const t=Yn(),{isAntistock:n}=g.useGeneralStore(),r=(e==null?void 0:e.price.currency)||"USD",u=new Intl.NumberFormat("en-US",{style:"currency",currency:r}),a=P.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,E;const p=((x=c.productWithVariant)==null?void 0:x.name)||"",b=((E=c.productWithVariant)==null?void 0:E.variantName)||"";return!p&&!b?"":!b||p===b?p:p?`${p} (${b})`:b})(),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 s.jsx("div",{className:gt.chargeItemsContainer,children:s.jsxs("div",{className:gt.chargeItemsInner,children:[s.jsx(oa,{expiresAt:e==null?void 0:e.expiresAt}),s.jsxs("div",{className:`${gt.productsContainer} ${n?gt.antistockLayout:""}`,children:[(e==null?void 0:e.name)&&s.jsxs("header",{className:gt.chargeHeader,children:[s.jsxs("div",{children:[s.jsx("h1",{className:gt.chargeTitle,id:"h5",children:e.name}),e.description&&s.jsx("p",{className:gt.chargeDescription,id:"md",children:e.description})]}),((i=e.order)==null?void 0:i.id)&&!n&&s.jsxs(w.Button,{type:"Secondary",className:gt.copyButton,onClick:()=>{var o;return t(((o=e.order)==null?void 0:o.id)||"")},children:[s.jsx(w.Icon,{name:"Copy"}),"Copy Order ID"]})]}),s.jsxs("div",{className:n?gt.mainContentAntistock:"",style:n?void 0:{flex:1},children:[!!a.length&&s.jsx("div",{className:gt.productsList,children:a.map(o=>s.jsx(ca,{product:o},o.id))}),s.jsx(Cr,{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&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:gt.desktopTrackPayment,children:s.jsx(Ta,{timeline:e.timeline})}),s.jsx(On,{className:gt.desktopFooter})]})]}),!n&&s.jsx(On,{className:`${gt.footerContainer} ${n?gt.footerContainerAntistock:""}`})]})]})})},LS="_checkoutOrderMainData_hqf60_1",DS="_orderDetailRow_hqf60_6",RS="_chargeIdRow_hqf60_16",PS="_detailLabel_hqf60_25",OS="_detailValue_hqf60_29",MS="_chargeIdContainer_hqf60_33",FS="_chargeId_hqf60_16",BS="_copyIcon_hqf60_51",ze={checkoutOrderMainData:LS,orderDetailRow:DS,chargeIdRow:RS,detailLabel:PS,detailValue:OS,chargeIdContainer:MS,chargeId:FS,copyIcon:BS},ws=({lastUpdate:e,invoiceId:t,email:n,paymentType:r,orderId:u})=>{const a=Yn(),[i,o]=P.useState(null),c=i==null?void 0:i.find(h=>h.name===r);P.useEffect(()=>{i||(async()=>{if(!r)return;const m=await uu([r]);o(m)})()},[r,i]);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()],b=h.getFullYear(),x=h.getHours(),E=h.getMinutes().toString().padStart(2,"0"),_=h.getSeconds().toString().padStart(2,"0"),I=x>=12?"PM":"AM",k=(x%12||12).toString().padStart(2,"0");return`${p} ${m}, ${b} at ${k}:${E}:${_} ${I}`};return s.jsxs("div",{className:ze.checkoutOrderMainData,children:[s.jsxs("div",{className:ze.orderDetailRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Last Updated"}),s.jsx("p",{className:ze.detailValue,id:"md",children:l(new Date(e))})]}),r&&s.jsxs("div",{className:ze.orderDetailRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Payment Type"}),s.jsx("p",{className:ze.detailValue,id:"md",children:c==null?void 0:c.displayName})]}),s.jsxs("div",{className:ze.orderDetailRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Email"}),s.jsx("p",{className:ze.detailValue,id:"md",children:n})]}),t&&s.jsxs("div",{className:ze.chargeIdRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Charge ID"}),s.jsxs("div",{className:ze.chargeIdContainer,children:[s.jsx("p",{className:ze.chargeId,id:"md",children:t}),s.jsx("div",{className:ze.copyIcon,onClick:()=>a(t),children:s.jsx(w.Icon,{name:"Copy"})})]})]}),u&&s.jsxs("div",{className:ze.chargeIdRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Order ID"}),s.jsxs("div",{className:ze.chargeIdContainer,children:[s.jsx("p",{className:ze.chargeId,id:"md",children:u}),s.jsx("div",{className:ze.copyIcon,onClick:()=>a(u),children:s.jsx(w.Icon,{name:"Copy"})})]})]})]})},jS="_bottomSheet_1yai1_1",HS="_formContainer_1yai1_8",US="_error_1yai1_14",VS="_buttonGroup_1yai1_18",zS="_buttonWrapper_1yai1_28",$S="_fullWidthButton_1yai1_31",qS="_modal_1yai1_41",ZS="_header_1yai1_48",En={bottomSheet:jS,formContainer:HS,error:US,buttonGroup:VS,buttonWrapper:zS,fullWidthButton:$S,modal:qS,header:ZS},xd=({chargeId:e,setIsOpen:t})=>{const[n,r]=P.useState(""),[u,a]=P.useState(""),{setIsOpen:i}=g.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 Ud({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},l=()=>{i(!1),setTimeout(()=>{t(!1)},300)};return s.jsxs("div",{className:En.modal,onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:En.header,children:[s.jsx("h3",{id:"h3",children:"CashApp Verify"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:l,fill:"var(--text-primary)"})]}),s.jsx("form",{onSubmit:c,children:s.jsxs("div",{className:En.bottomSheet,children:[s.jsx("div",{className:En.formContainer,children:s.jsxs("div",{children:[s.jsx(w.Input,{value:n,onChange:h=>{r(h),a("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),u&&s.jsx("p",{className:En.error,children:u})]})}),s.jsxs("div",{className:En.buttonGroup,children:[s.jsx("div",{className:En.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:l,children:"Cancel"})}),s.jsx("div",{className:En.fullWidthButton,children:s.jsx(w.Button,{type:"Primary",children:"Verify"})})]})]})})]})},WS="_trackPaymentContainer_fk3b6_1",YS="_trackPaymentBox_fk3b6_5",GS="_trackPaymentBoxActive_fk3b6_18",XS="_trackPaymentHeader_fk3b6_23",QS="_trackPaymentTitle_fk3b6_27",KS="_trackPaymentTimeline_fk3b6_33",JS="_trackPaymentItem_fk3b6_42",eI="_itemHeader_fk3b6_48",tI="_itemDate_fk3b6_55",nI="_itemMessage_fk3b6_59",rI="_trackPaymentToggle_fk3b6_64",uI="_trackPaymentToggleContent_fk3b6_75",aI="_trackPaymentToggleText_fk3b6_81",iI="_antistock_fk3b6_88",lt={trackPaymentContainer:WS,trackPaymentBox:YS,trackPaymentBoxActive:GS,trackPaymentHeader:XS,trackPaymentTitle:QS,trackPaymentTimeline:KS,trackPaymentItem:JS,itemHeader:eI,itemDate:tI,itemMessage:nI,trackPaymentToggle:rI,trackPaymentToggleContent:uI,trackPaymentToggleText:aI,antistock:iI},Hc=(e,t)=>{const n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),u=e.getFullYear(),a=e.getHours(),i=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}:${i}:${o} ${c}`:""},sI={[pe.Paid]:{displayName:$n[pe.Paid],displayMessage:"The invoice has been completed and the product has been delivered.",type:"success"},[pe.Pending]:{displayName:$n[pe.Pending],displayMessage:"The invoice has been created and we are now waiting to receive the payment.",type:"warning"},[pe.Expired]:{displayName:$n[pe.Expired],displayMessage:"Your payment has expired due to the payment not being sent in time.",type:"error"},[pe.Cancelled]:{displayName:$n[pe.Cancelled],displayMessage:"The order has been canceled. The payment was not sent within the time limit.",type:"error"},[pe.NotPaid]:{displayName:"New",displayMessage:"The charge has been created and is awaiting payment.",type:"success"},[pe.Refunded]:{displayName:$n[pe.Refunded],displayMessage:"Your order was refunded. Please check your payment method for confirmation.",type:"warning"}},oI=({date:e,chargeStatus:t})=>(console.log(t),s.jsxs("div",{className:lt.trackPaymentItem,children:[s.jsxs("div",{className:lt.itemHeader,children:[s.jsx("p",{className:lt.itemDate,id:"md-bold",children:Hc(new Date(e),"dd.MM.yyyy")}),s.jsx("p",{className:lt.itemTime,id:"md",children:Hc(new Date(e),"hh:mm:ss aa")})]}),s.jsx("p",{className:lt.itemMessage,id:"md",children:sI[t].displayMessage})]})),Ta=({timeline:e,className:t})=>{const[n,r]=P.useState(!1),{isAntistock:u}=g.useGeneralStore();return s.jsxs("div",{className:g.clx(lt.trackPaymentContainer,t,{[lt.antistock]:u}),children:[s.jsxs("div",{className:`${lt.trackPaymentBox} ${n?lt.trackPaymentBoxActive:""}`,style:u?{border:"1px solid var(--border-secondary)"}:void 0,children:[s.jsx("header",{className:lt.trackPaymentHeader,children:s.jsx("h2",{className:lt.trackPaymentTitle,id:"h4",children:"Track Payment"})}),s.jsx("div",{className:lt.trackPaymentTimeline,children:Object.keys(e).map(a=>s.jsx(oI,{date:e[a],chargeStatus:a},a))})]}),s.jsxs("div",{className:lt.trackPaymentToggle,onClick:()=>r(!n),style:u?{padding:"1.25rem",border:"1px solid var(--border-secondary)",borderRadius:"var(--border-radius)"}:void 0,children:[s.jsxs("div",{className:lt.trackPaymentToggleContent,children:[u?null:s.jsx(w.Icon,{name:"MagnifyingGlass",fill:"var(--text-secondary)"}),s.jsx("p",{className:lt.trackPaymentToggleText,id:"h5",children:"Track Payment"})]}),s.jsx(w.Icon,{name:"CaretRight",fill:"var(--text-primary)",width:16,height:16})]})]})},cI="_dateTime_1dnnn_11",lI="_tableItem_1dnnn_25",dI="_status_1dnnn_29",fI="_statusInProgress_1dnnn_38",hI="_statusText_1dnnn_42",pI="_statusIcon_1dnnn_46",mI="_statusInProgressText_1dnnn_52",bI="_statusInProgressIcon_1dnnn_57",gI="_message_1dnnn_63",dt={dateTime:cI,tableItem:lI,status:dI,statusInProgress:fI,statusText:hI,statusIcon:pI,statusInProgressText:mI,statusInProgressIcon:bI,message:gI},Cd=({item:e})=>{const[t,n]=g.extractDateAndTime(e.createdAt),r=g.useNavigate(),a=(i=>i.length>30?i.slice(0,27)+"...":i)(e.latestMessage);return s.jsxs(P.Fragment,{children:[s.jsx(Ke,{className:dt.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsxs("span",{id:"md",children:["#",e.id]})}),s.jsx(Ke,{className:g.clx(dt.message,dt.tableItem),onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsx("span",{id:"md",children:a})}),s.jsx(Ke,{className:dt.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsxs("div",{children:[s.jsx("div",{id:"md",children:t}),s.jsx("div",{className:dt.dateTime,id:"md",children:n})]})}),s.jsx(Ke,{className:dt.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsx(_I,{status:e.status})})]},e.id)},_I=({status:e})=>s.jsxs("div",{className:g.clx(dt.status,{[dt.statusClosed]:e==="CLOSED",[dt.statusInProgress]:e!=="CLOSED"}),children:[s.jsx("div",{className:g.clx(dt.statusIcon,{[dt.statusInProgressIcon]:e!=="CLOSED"}),children:e==="CLOSED"?s.jsx(w.Icon,{name:"CheckCircle",className:dt.statusIcon}):s.jsx(w.Icon,{name:"Clock",className:dt.statusInProgressIcon})}),s.jsx("div",{className:g.clx(dt.statusText,{[dt.statusInProgressText]:e!=="CLOSED"}),id:"md",children:e==="CLOSED"?"Closed":"In Progress"})]}),xI="_tableContainer_1eytq_1",CI="_table_1eytq_1",EI="_productInfo_1eytq_19",TI="_productImage_1eytq_26",yI="_productName_1eytq_35",kI="_expirationDate_1eytq_46",AI="_overflowItem_1eytq_51",SI="_gatewayContainer_1eytq_57",II="_gatewayImage_1eytq_62",NI="_dateTime_1eytq_67",vI="_tableLoader_1eytq_72",wI="_tableItem_1eytq_81",nt={tableContainer:xI,table:CI,productInfo:EI,productImage:TI,productName:yI,expirationDate:kI,overflowItem:AI,gatewayContainer:SI,gatewayImage:II,dateTime:NI,tableLoader:vI,tableItem:wI},LI="_badge_1oac8_1",DI="_active_1oac8_12",RI="_awaitingPayment_1oac8_17",PI="_cancelled_1oac8_22",OI="_changedGateway_1oac8_27",MI="_expired_1oac8_32",FI="_rial_1oac8_37",BI="_pastDue_1oac8_42",jI="_replaced_1oac8_47",mn={badge:LI,active:DI,awaitingPayment:RI,cancelled:PI,changedGateway:OI,expired:MI,rial:FI,pastDue:BI,replaced:jI},HI=()=>({[pn.ACTIVE]:{icon:s.jsx(w.Icon,{name:"CheckCircle"}),title:"Active",className:mn.active},[pn.AWAITING_PAYMENT]:{icon:s.jsx(w.Icon,{name:"Clock"}),title:"Awaiting Payment",className:mn.awaitingPayment},[pn.CANCELLED]:{icon:s.jsx(w.Icon,{name:"XCircle"}),title:"Cancelled",className:mn.cancelled},[pn.CHANGED_GATEWAY]:{icon:s.jsx(w.Icon,{name:"Warning"}),title:"Upgraded",className:mn.changedGateway},[pn.EXPIRED]:{icon:s.jsx(w.Icon,{name:"XCircle"}),title:"Expired",className:mn.expired},[pn.RIAL]:{icon:s.jsx(w.Icon,{name:"Clock"}),title:"Active",className:mn.rial},[pn.PAST_DUE]:{icon:s.jsx(w.Icon,{name:"Clock"}),title:"Trial",className:mn.pastDue},[pn.REPLACED]:{icon:s.jsx(w.Icon,{name:"Warning"}),title:"Replaced",className:mn.replaced}}),Ls=({status:e})=>{const t=HI()[e];return s.jsxs("div",{className:`${mn.badge} ${t.className}`,children:[t.icon,s.jsx("p",{id:"md",children:t.title})]})},UI=(e,t)=>{const n=t.find(r=>r.name===e);return n?s.jsxs("div",{className:nt.gatewayContainer,children:[s.jsx("img",{alt:n.displayName,src:g.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:nt.gatewayImage}),s.jsx("div",{children:n.displayName})]}):null},VI=({item:e,gatewaysDetail:t})=>{const[n,r]=g.extractDateAndTime(e.createdAt),[u]=g.extractDateAndTime(e.activeTo||""),a=Yn();return s.jsxs(P.Fragment,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:nt.productInfo,children:[s.jsx("div",{className:nt.productImage,children:s.jsx(w.Icon,{name:"Image",width:20,height:20,fill:"var(--text-secondary)"})}),s.jsxs("div",{children:[s.jsx(g.NavLink,{to:`/subscriptions/${e.id}/${e.accessToken}`,className:nt.productName,id:"md",children:e.productName}),s.jsx("p",{className:nt.expirationDate,children:e.activeTo&&`expires at ${u}`})]})]})}),s.jsx(Ke,{className:nt.overflowItem,onClick:()=>a(e.id),children:e.id}),s.jsx(Ke,{children:s.jsx(Ls,{status:e.status})}),s.jsx(Ke,{children:g.formatPrice(e.price)}),s.jsx(Ke,{children:UI(e.gatewayName,t)}),s.jsx(Ke,{children:s.jsxs("div",{children:[s.jsx("div",{id:"md",children:n}),s.jsx("div",{className:nt.dateTime,id:"md",children:r})]})})]},e.id)},Ed=({subscriptions:e,gatewaysDetail:t,totalCount:n,page:r,setPage:u})=>{const i=!(!(e!=null&&e.length)||!t);return s.jsxs("div",{className:nt.tableContainer,children:[s.jsxs(sa,{className:nt.table,children:[s.jsx(Tt,{className:nt.tableItem,children:"Product name"}),s.jsx(Tt,{className:nt.tableItem,children:"ID"}),s.jsx(Tt,{className:nt.tableItem,children:"Status"}),s.jsx(Tt,{className:nt.tableItem,children:"Value"}),s.jsx(Tt,{className:nt.tableItem,children:"Payment"}),s.jsx(Tt,{className:nt.tableItem,children:"Date"}),i&&(e==null?void 0:e.map(o=>s.jsx(VI,{item:o,gatewaysDetail:t},o.id)))]}),!i&&s.jsx("div",{className:nt.tableLoader,children:s.jsx(w.Loader,{})}),i&&s.jsx(ou,{currentPage:r,totalCount:n,onPageChange:u})]})},zI="_pageLoading_1rj3k_2",$I="_title_1rj3k_11",qI="_description_1rj3k_17",ii={pageLoading:zI,title:$I,description:qI},ZI=({description:e,title:t})=>s.jsxs("div",{className:ii.pageLoading,children:[s.jsx("div",{children:s.jsx(w.Loader,{})}),s.jsx("h1",{className:ii.title,children:t}),s.jsx("p",{className:ii.description,children:e})]}),WI="_container_1opbn_1",YI="_productDetails_1opbn_8",GI="_imageContainer_1opbn_14",XI="_image_1opbn_14",QI="_textContainer_1opbn_32",KI="_header_1opbn_40",JI="_title_1opbn_46",eN="_price_1opbn_53",tN="_badgeContainer_1opbn_57",nN="_description_1opbn_61",Xt={container:WI,productDetails:YI,imageContainer:GI,image:XI,textContainer:QI,header:KI,title:JI,price:eN,badgeContainer:tN,description:nN},Td=({subscription:e})=>s.jsxs("div",{className:Xt.container,children:[s.jsxs("div",{className:Xt.productDetails,children:[s.jsx("div",{className:Xt.imageContainer,children:e!=null&&e.image?s.jsx("img",{className:Xt.image,src:g.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):s.jsx(w.Icon,{name:"Image"})}),s.jsxs("div",{className:Xt.textContainer,children:[s.jsx("div",{className:Xt.header,children:s.jsx("h2",{className:Xt.title,children:e.name})}),s.jsxs("p",{className:Xt.price,children:[g.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsx("div",{className:Xt.badgeContainer,children:s.jsx(Ls,{status:e.status})})]}),e.description&&s.jsx(gs,{className:Xt.description,children:e.description})]}),rN="_card_69liy_1",uN="_price_69liy_10",aN="_interval_69liy_17",iN="_name_69liy_22",sN="_description_69liy_28",oN="_currentPlan_69liy_32",cN="_selectButton_69liy_45",lN="_progressSection_69liy_50",dN="_progressLabel_69liy_54",fN="_bottomSheet_69liy_60",hN="_title_69liy_69",pN="_typeSelector_69liy_80",mN="_typeOption_69liy_90",bN="_active_69liy_100",gN="_saveTag_69liy_108",_N="_planSelector_69liy_117",xN="_modal_69liy_127",CN="_inactive_69liy_148",EN="_notMounted_69liy_151",TN="_closeButton_69liy_157",je={card:rN,price:uN,interval:aN,name:iN,description:sN,currentPlan:oN,selectButton:cN,progressSection:lN,progressLabel:dN,bottomSheet:fN,title:hN,typeSelector:pN,typeOption:mN,active:bN,saveTag:gN,planSelector:_N,modal:xN,inactive:CN,notMounted:EN,closeButton:TN},yN=({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,i=10;return s.jsxs("div",{className:je.card,onClick:t,children:[s.jsxs("h2",{className:je.price,children:["$",u," ",s.jsxs("span",{className:je.interval,children:["/ ",r]})]}),s.jsx("h3",{className:je.name,children:e.name}),e.description&&s.jsx("p",{className:je.description,children:e.description}),n?s.jsxs("div",{className:je.currentPlan,children:[s.jsx(w.Icon,{name:"Check"}),"Your current Plan"]}):s.jsx(w.Button,{type:"Secondary",className:je.selectButton,children:"Select"}),n&&s.jsxs("div",{className:je.progressSection,children:[s.jsx(u0,{percent:i/a*100,disablePercentLabel:!0}),s.jsxs("p",{className:je.progressLabel,children:["Used: ",i," of ",a," days"]})]})]})},yd=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,u]=P.useState(null),[a,i]=P.useState(null),[o,c]=P.useState(null),{id:l,accessToken:h}=g.useParams(),[f,m]=P.useState(!1),[p,b]=P.useState(!1),{setIsOpen:x}=g.useModalStore();P.useEffect(()=>{e&&m(!0)},[e]);const E=()=>{t(!1)},[_,I]=P.useState(null);P.useEffect(()=>{l&&h&&(async()=>{if(l&&h){const{data:v}=await s2({id:l,accessToken:h});I(v)}})()},[l,h]),P.useEffect(()=>{var N;if(_!=null&&_.data.types[0]){const v=(N=_.data.types.flatMap(V=>V.productVariants).find(V=>V.data.id===(n==null?void 0:n.variantId)))==null?void 0:N.data;v&&(c(v),i(v))}},[_,n]),P.useEffect(()=>{_!=null&&_.data.types[0]&&u(_==null?void 0:_.data.types[0])},[_==null?void 0:_.data.types]);const k=N=>{u(N),i(null)},D=N=>{i(N),x(!0),b(!0)};return s.jsxs("div",{className:g.clx(je.modal,{[je.active]:e,[je.inactive]:!e&&f,[je.notMounted]:!f}),onClick:N=>N.stopPropagation(),children:[s.jsx(w.Icon,{name:"X",onClick:E,hoverable:!0,className:je.closeButton,fill:"var(--text-primary)"}),s.jsxs("div",{className:je.bottomSheet,children:[s.jsx("h3",{id:"h3",className:je.title,children:"Change Plan"}),s.jsx("p",{className:je.description,children:_==null?void 0:_.data.description}),s.jsx("div",{className:je.typeSelector,children:_==null?void 0:_.data.types.map(N=>s.jsxs("div",{className:g.clx(je.typeOption,{[je.active]:(r==null?void 0:r.id)===N.id}),onClick:()=>k(N),children:[N.name,N.name==="Yearly"&&s.jsx("span",{className:je.saveTag,children:"Save %"})]},N.id))}),r&&s.jsx("div",{className:je.planSelector,children:r.productVariants.map(N=>s.jsx(yN,{variant:N.data,isSelected:(a==null?void 0:a.id)===N.data.id,isCurrent:(o==null?void 0:o.id)===N.data.id,onSelect:()=>D(N.data)},N.data.id))})]}),p&&a&&n&&s.jsx(w.Modal,{close:()=>{b(!1)},children:s.jsx(Nd,{setIsOpen:b,selectedVariant:a,subscription:n})})]})},kN="_container_nb625_1",AN="_title_nb625_11",SN="_subtitle_nb625_16",IN="_info_nb625_20",Du={container:kN,title:AN,subtitle:SN,info:IN},kd=()=>{const{subscription:e}=g.useSubscriptionStore(),[t,n]=g.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,u]=P.useState(!1),{setIsOpen:a}=g.useModalStore();return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:Du.container,children:[s.jsxs("div",{className:Du.info,children:[s.jsx("p",{className:Du.title,children:"Expiration Date"}),s.jsxs("p",{className:Du.subtitle,children:[t," at ",n]})]}),s.jsx(w.Button,{type:"Special",onClick:i=>{i.stopPropagation(),a(!0),u(!0)},children:"Extend"})]}),r&&s.jsx(w.Modal,{close:()=>u(!1),children:s.jsx(Rd,{setIsOpen:u})})]})},NN="_couponContainer_1sspa_1",vN="_iconWrapper_1sspa_10",wN="_details_1sspa_21",LN="_title_1sspa_25",DN="_progress_1sspa_29",RN="_foreverText_1sspa_34",ur={couponContainer:NN,iconWrapper:vN,details:wN,title:LN,progress:DN,foreverText:RN},Ad=({coupon:e,currency:t})=>{const n=e.isFixed?g.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?g.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return s.jsxs("div",{className:ur.couponContainer,children:[s.jsx("div",{className:ur.iconWrapper,children:s.jsx(w.Icon,{name:"CheckCircle"})}),s.jsxs("div",{className:ur.details,children:[s.jsxs("p",{className:ur.title,children:[e.name,", ",n," discount"]}),s.jsx("div",{className:ur.progress,children:s.jsx(u0,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),s.jsx("p",{className:ur.foreverText,children:"Forever discount code"})]})]})},PN="_paymentMethodContainer_1g0da_4",ON="_paymentMethodTitle_1g0da_15",MN="_activeMethod_1g0da_20",FN="_noMethod_1g0da_28",BN="_activeMethodPaymentMethod_1g0da_37",jN="_paymentMethodLogo_1g0da_47",HN="_paymentMethodNumber_1g0da_57",UN="_method_1g0da_61",vn={paymentMethodContainer:PN,paymentMethodTitle:ON,activeMethod:MN,noMethod:FN,activeMethodPaymentMethod:BN,paymentMethodLogo:jN,paymentMethodNumber:HN,method:UN},VN="_paymentMethods_1gev0_1",zN="_modal_1gev0_14",$N="_header_1gev0_28",qN="_content_1gev0_37",Un={paymentMethods:VN,modal:zN,header:$N,content:qN},ZN=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:u}=g.useSubscriptionStore();if(!r)return null;const{id:a}=g.useParams(),i=g.useNavigate(),{notifications:o,setNotifications:c}=g.useNotificationStore(),{setPaymentMethod:l,setGateway:h,cart:f}=nu(),{setIsOpen:m}=g.useModalStore();async function p(){if(b(),t(!0),a&&r){const{data:x}=await a2(a,f.gateway);x.isReconnectPaymentNeeded?i(`/charges/${x.chargeId}`):(c([...o,{status:"success",id:g.v4(),message:"Your action has been successfully completed"}]),u({...r,gatewayName:f.gateway}))}else c([...o,{status:"error",id:g.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function b(){m(!1),setTimeout(()=>{n(!1)},300)}return s.jsxs("div",{className:Un.modal,onClick:x=>{x.stopPropagation()},children:[s.jsxs("div",{className:Un.header,children:[s.jsx("h3",{id:"h3",className:Un.title,children:"Choose Payment Method"}),s.jsx(w.Icon,{name:"X",onClick:b,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Un.content,children:[(r==null?void 0:r.availableGateways)&&s.jsx(rs,{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:()=>i("/customer-dash")}),s.jsxs("div",{className:Un.paymentMethods,children:[s.jsx("div",{className:Un.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Cancel"})}),s.jsx("div",{className:Un.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",disabled:!f.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},WN="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",Sd=()=>{var b,x,E;const{subscription:e}=g.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=nu(),r=g.useNavigate(),[u,a]=P.useState(null),[i,o]=P.useState(!1),[c,l]=P.useState(!1),{setIsOpen:h}=g.useModalStore();if(!e)return null;const[f,m]=P.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return P.useEffect(()=>{(async()=>{const I=await uu(e.availableGateways);a(I)})()},[]),P.useEffect(()=>{t.gateway!==f&&m(t.gateway)},[t.gateway]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:vn.paymentMethodContainer,children:[s.jsxs("div",{children:[s.jsx("p",{className:vn.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&s.jsx(YN,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f==="Balance"&&s.jsx(ts,{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&&s.jsx("span",{className:vn.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f&&s.jsx("div",{className:vn.activeMethod,children:u&&s.jsx(ns,{align:"row",gatewayLogoCfId:(b=u.find(_=>_.name===f))==null?void 0:b.logoCfImageId,gatewayDisplayName:(x=u.find(_=>_.name===f))==null?void 0:x.displayName,gateway:f,poweredByLogoCfId:(E=u.find(_=>_.name===f))==null?void 0:E.poweredByImageCfImageId,className:vn.activeMethodPaymentMethod,selected:p===f,onSelect:_=>{n(_)}},f)})]}),s.jsx(w.Button,{type:"Special",onClick:_=>{_.stopPropagation(),h(!0),l(!0)},children:t.gateway?"Change":"Manage"})]}),c&&s.jsx(w.Modal,{close:()=>l(!1),children:s.jsx(ZN,{setIsLoading:o,setIsOpen:l})})]})},YN=({gatewayInfo:e})=>{var t,n,r,u,a;return s.jsxs("div",{className:vn.method,children:[s.jsxs("div",{className:vn.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&s.jsx(H4,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&s.jsx("img",{src:WN,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((u=e.card)==null?void 0:u.brand.toLowerCase())!=="mastercard"&&s.jsx(w.Icon,{name:"CreditCard",width:22})]}),s.jsxs("p",{className:vn.paymentMethodNumber,children:["•••• •••• •••• ",(a=e.card)==null?void 0:a.last4]})]})},GN="_subscriptionProductContainer_83ibx_4",XN="_subscriptionProductImage_83ibx_15",QN="_subscriptionProductInfo_83ibx_32",KN="_name_83ibx_37",JN="_price_83ibx_40",Or={subscriptionProductContainer:GN,subscriptionProductImage:XN,subscriptionProductInfo:QN,name:KN,price:JN},Id=({subscription:e,id:t,accessToken:n})=>{const[r,u]=P.useState(!1),{setIsOpen:a}=g.useModalStore();return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:Or.subscriptionProductContainer,onClick:i=>i.stopPropagation(),children:[s.jsx("div",{className:Or.subscriptionProductImage,children:e!=null&&e.image?s.jsx("img",{src:g.convertCfImageIdToUrl(e.image.cfId)}):s.jsx(w.Icon,{name:"Image"})}),s.jsxs("div",{className:Or.subscriptionProductInfo,children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h2",{className:Or.name,children:e.name})}),s.jsxs("p",{className:Or.price,children:[g.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsx(w.Button,{type:"Special",onClick:i=>{i.preventDefault(),u(!0),a(!0)},children:"Cancel"})]}),r&&s.jsx(w.Modal,{close:()=>u(!1),children:s.jsx(Pd,{accessToken:n,id:t,isOpen:r,setIsOpen:u})})]})},ev="_content_5ctxw_1",tv="_selectedPlan_5ctxw_37",nv="_planName_5ctxw_44",rv="_description_5ctxw_48",uv="_price_5ctxw_51",av="_buttonGroup_5ctxw_79",iv="_buttonWrapper_5ctxw_84",sv="_modal_5ctxw_88",ov="_header_5ctxw_95",$t={content:ev,selectedPlan:tv,planName:nv,description:rv,price:uv,buttonGroup:av,buttonWrapper:iv,modal:sv,header:ov},Nd=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=g.useModalStore(),u=()=>{a()},a=()=>{r(!1),setTimeout(()=>{e(!1)},300)},i=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,o=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=i-o,l=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return s.jsxs("div",{className:$t.modal,children:[s.jsxs("div",{className:$t.header,children:[s.jsx("h3",{id:"h3",children:"Choose upgrade method"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:()=>a(),fill:"var(--text-primary)"})]}),s.jsxs("div",{className:$t.bottomSheet,children:[s.jsxs("div",{className:$t.content,children:[s.jsxs("div",{className:$t.selectedPlan,children:[s.jsx("h2",{className:$t.planName,children:t.name}),s.jsx("p",{className:$t.description,children:t.description}),s.jsxs("p",{className:$t.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),s.jsx(Cr,{formatter:l,coupon:null,total:c,discount:o})]}),s.jsxs("div",{className:$t.buttonGroup,children:[s.jsx("div",{className:$t.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:()=>a(),children:"Stay with us"})}),s.jsx("div",{className:$t.buttonWrapper,children:s.jsxs(w.Button,{type:"Primary",onClick:u,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},cv="_orderStatusBlock_2wo4y_2",lv="_orderStatusBlockAntistock_2wo4y_11",dv="_iconWrapper_2wo4y_16",fv="_orderStatusTitle_2wo4y_26",hv="_orderStatusDescription_2wo4y_31",pv="_actionButtons_2wo4y_36",mv="_actionButton_2wo4y_36",bv="_button_2wo4y_47",Qt={orderStatusBlock:cv,orderStatusBlockAntistock:lv,iconWrapper:dv,orderStatusTitle:fv,orderStatusDescription:hv,actionButtons:pv,actionButton:mv,button:bv},gv={[Ce.New]:"New",[Ce.Pending]:"Order Pending",[Ce.Expired]:"Order Expired",[Ce.Cancelled]:"Order Canceled",[Ce.Failed]:"Order Failed",[Ce.FullDeliveryFailure]:"Delivery Failure",[Ce.PartiallyDelivered]:"Partial Delivery Failure",[Ce.Refunded]:"Order Refunded",[Ce.Completed]:"Order Completed"},_v={[Ce.New]:"Your order has been created and is awaiting payment.",[Ce.Pending]:"Your order is currently pending. We recommend checking back shortly for confirmation.",[Ce.Expired]:"Your order has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[Ce.Cancelled]:"You canceled the warrant. If there are any problems, please contact support.",[Ce.Failed]:"Your order could not be processed due to a payment or system error. Please try again or contact support.",[Ce.FullDeliveryFailure]:"Your payment was successful but the product is currently out of stock. Please contact us below to get this sorted.",[Ce.PartiallyDelivered]:"Your payment was successful but some products were out of stock. Please contact us below to get this sorted.",[Ce.Refunded]:"Your order was refunded. Please check your payment method for confirmation.",[Ce.Completed]:"Your order has successfully been processed. View your products below or check your email for additional information."},vd=()=>({[Ce.Completed]:s.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"}),[Ce.Pending]:s.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ce.New]:s.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ce.Expired]:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ce.Cancelled]:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ce.Failed]:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ce.FullDeliveryFailure]:s.jsx(w.Icon,{name:"Warning",fill:"var(--text-warning)"}),[Ce.PartiallyDelivered]:s.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"}),[Ce.Refunded]:s.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"})}),wd=({orderStatus:e,className:t})=>{const{shopDomain:n}=g.useStorefrontStore(),{isAntistock:r}=g.useGeneralStore(),u=g.useNavigate();return s.jsxs("div",{className:g.clx(Qt.orderStatusBlock,t,{[Qt.orderStatusBlockAntistock]:r}),children:[s.jsx("div",{className:Qt.iconWrapper,style:r?{background:"none"}:void 0,children:vd()[e]}),s.jsx("h2",{className:Qt.orderStatusTitle,children:gv[e]}),s.jsx("p",{className:Qt.orderStatusDescription,children:_v[e]}),s.jsxs("div",{className:Qt.actionButtons,children:[s.jsx("div",{className:Qt.actionButton,children:s.jsxs(w.Button,{type:"Secondary",className:Qt.button,onClick:()=>window.open(`https://${n}`),children:[s.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),s.jsx("div",{className:Qt.actionButton,children:s.jsxs(w.Button,{type:"Secondary",className:Qt.button,onClick:()=>{r?window.open(`https://${n}/support`):u("/contact")},children:[s.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},xv="_reviewMessage_1t8u4_1",Cv="_leaveReviewContainer_1t8u4_11",Ev="_leaveReviewTitle_1t8u4_20",si={reviewMessage:xv,leaveReviewContainer:Cv,leaveReviewTitle:Ev},Ld=({review:e,orderId:t,className:n})=>{const[r,u]=P.useState((e==null?void 0:e.rating)||0),[a,i]=P.useState(!1),{setIsOpen:o}=g.useModalStore(),{notifications:c,setNotifications:l}=g.useNotificationStore(),h=async f=>{e&&"accessToken"in e&&(await h2({comment:f,rating:r,tsId:g.useGetTsId()},t,e.accessToken),l([...c,{status:"success",id:g.v4(),message:"Review left successfully"}]),i(!1))};return P.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(o(!0),i(!0))},[r]),e?e.rating&&"accessToken"in e?s.jsxs("div",{className:si.reviewMessage,children:["You left a ",e.rating," star rating"]}):s.jsxs("div",{className:g.clx(si.leaveReviewContainer,n),children:[s.jsx("p",{className:si.leaveReviewTitle,children:"Leave a review"}),s.jsx(g8,{rating:r,setRating:u,disabled:!!e.rating||!("accessToken"in e)}),a&&s.jsx(w.Modal,{close:()=>i(!1),children:s.jsx(Dd,{setIsOpen:i,onSubmit:h})})]}):null},Tv="_bottomSheet_1bcyj_1",yv="_content_1bcyj_7",kv="_title_1bcyj_18",Av="_buttonGroup_1bcyj_22",Sv="_buttonWrapper_1bcyj_33",Iv="_modal_1bcyj_37",Nv="_header_1bcyj_44",Tn={bottomSheet:Tv,content:yv,title:kv,buttonGroup:Av,buttonWrapper:Sv,modal:Iv,header:Nv},Dd=({setIsOpen:e,onSubmit:t})=>{const[n,r]=P.useState(""),{setIsOpen:u}=g.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return s.jsxs("div",{className:Tn.modal,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:Tn.header,children:[s.jsx("h3",{id:"h3",className:Tn.title,children:"Review Description"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Tn.bottomSheet,children:[s.jsx("div",{className:Tn.content,children:s.jsx(w.Textarea,{placeholder:"Great product and fast checkout...",value:n,onChange:i=>r(i),label:"Describe your review in detail below"})}),s.jsxs("div",{className:Tn.buttonGroup,children:[s.jsx("div",{className:Tn.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),s.jsx("div",{className:Tn.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",disabled:!n,onClick:()=>{a(),t(n)},children:"Submit"})})]})]})]})},vv="_container_1idhv_1",wv="_buttonGroup_1idhv_8",Lv="_buttonWrapper_1idhv_15",Dv="_header_1idhv_19",Rv="_content_1idhv_28",Vn={container:vv,buttonGroup:wv,buttonWrapper:Lv,header:Dv,content:Rv},Pv="_modal_1rkmj_1",Ov="_modalPayment_1rkmj_7",Mv="_title_1rkmj_15",Fv="_description_1rkmj_20",Ru={modal:Pv,modalPayment:Ov,title:Mv,description:Fv},Ds=()=>s.jsxs("div",{className:g.clx(Ru.modal,Ru.modalPayment),onClick:e=>e.stopPropagation(),children:[s.jsx(w.Loader,{style:{border:"4px solid var(--surface-action1)",borderLeftColor:"var(--surface-secondary)",width:"40px",height:"40px"}}),s.jsx("h2",{id:"h3",className:Ru.title,children:"Processing Payment"}),s.jsx("p",{className:Ru.description,children:"This payment is currently being processed. If you're here, it simply means that the payment was created but not complete."})]}),Rd=({setIsOpen:e})=>{const{subscription:t}=g.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:u}=nu(),[a,i]=P.useState(1),o=g.useNavigate(),{setIsOpen:c}=g.useModalStore(),{setNotifications:l,notifications:h}=g.useNotificationStore(),[f,m]=P.useState(!1),p=P.useMemo(()=>n(),[u,r]),b=P.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(f)return s.jsx(Ds,{});const x=(t==null?void 0:t.price.currency)||"USD",E=new Intl.NumberFormat("en-US",{style:"currency",currency:x});async function _(){var k;m(!0);try{const{data:D}=await o2((t==null?void 0:t.id)||"",{});l([{id:g.v4(),message:"Order created successfully",status:"success"}]),o(`/orders/${(k=D.data)==null?void 0:k.id}/${D.data.fullAccessToken}`)}catch(D){const N=D;l([...h,{id:g.v4(),message:`Order creation failed: ${N.message}`,status:"error"}]),I()}finally{m(!1)}}function I(){c(!1),setTimeout(()=>{e(!1)},300)}return s.jsxs("div",{className:Vn.container,onClick:k=>k.stopPropagation(),children:[s.jsxs("div",{className:Vn.header,children:[s.jsx("h3",{id:"h3",className:Vn.title,children:"Extend Subscription"}),s.jsx(w.Icon,{name:"X",onClick:I,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Vn.content,children:[s.jsx(v8,{step:a,totalSteps:12,onStepChange:i,label:"How long would you like to extend your subscription for?"}),s.jsx(Cr,{formatter:E,coupon:u,total:p.total,discount:b,totalWithDiscount:p.totalWithDiscount}),s.jsxs("div",{className:Vn.buttonGroup,children:[s.jsx("div",{className:Vn.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:I,children:"Cancel"})}),s.jsx("div",{className:Vn.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",onClick:_,children:"Extend"})})]})]})]})},Bv="_bottomSheet_uw5jb_1",jv="_content_uw5jb_7",Hv="_radioGroup_uw5jb_11",Uv="_confirmation_uw5jb_26",Vv="_iconWrapper_uw5jb_33",zv="_title_uw5jb_42",$v="_message_uw5jb_48",qv="_buttonGroup_uw5jb_54",Zv="_buttonWrapper_uw5jb_64",Wv="_modal_uw5jb_68",Yv="_header_uw5jb_77",We={bottomSheet:Bv,content:jv,radioGroup:Hv,confirmation:Uv,iconWrapper:Vv,title:zv,message:$v,buttonGroup:qv,buttonWrapper:Zv,modal:Wv,header:Yv},Gv={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},Pd=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[u,a]=P.useState(0),[i,o]=P.useState(!1),[c,l]=P.useState(""),[h,f]=P.useState(""),{setIsOpen:m}=g.useModalStore(),p=async()=>{if(!c)return;o(!0);const x=await u2(n,r,{reason:c==="Other reason"?h:c});o(!1),x&&a(2)};P.useEffect(()=>{e||(a(0),l(""),f(""))},[e]);const b=()=>{m(!1),setTimeout(()=>{t(!1)},300)};return s.jsxs("div",{className:We.modal,onClick:x=>x.stopPropagation(),children:[s.jsxs("div",{className:We.header,children:[s.jsx("h3",{id:"h3",children:Gv[u]||""}),s.jsx(w.Icon,{name:"X",onClick:b,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:We.content,children:[u===0&&s.jsxs("div",{className:We.bottomSheet,children:[s.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),s.jsxs("div",{className:We.radioGroup,children:[s.jsx(w.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"&&s.jsx(w.Textarea,{value:h,onChange:x=>f(x),placeholder:"Describe the reason..."})]}),s.jsxs("div",{className:We.buttonGroup,children:[s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Stay with us"})}),s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",onClick:()=>c&&a(1),disabled:!c,children:"Continue"})})]})]}),u===1&&s.jsxs("div",{className:We.bottomSheet,children:[s.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),s.jsxs("div",{className:We.buttonGroup,children:[s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Stay with us"})}),s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",onClick:p,disabled:i,children:"Cancel it anyway"})})]})]}),u===2&&s.jsxs("div",{className:We.bottomSheet,children:[s.jsxs("div",{className:`${We.confirmation}`,children:[s.jsx("div",{className:We.iconWrapper,children:s.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),s.jsx("p",{className:We.title,children:"Subscription Cancelled"}),s.jsx("p",{className:We.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),s.jsx("div",{className:We.buttonGroup,children:s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Close"})})})]})]})]})},Xv=Object.freeze(Object.defineProperty({__proto__:null,ActivePaymentMethod:Sd,ActiveSubscriptionProduct:Id,Auth:Ji,AuthLogin:Gl,AuthModal:l0,AuthRequestOtp:Yl,CHARGE_STATUS_DESCRIPTION:pd,CHARGE_STATUS_DISPLAY_NAME:$n,CancelSubscription:Pd,CashAppVerify:xd,ChangeSubscriptionPlan:yd,ChargeBlocksRenderer:Gu,ChargeItems:_d,ChargeStatusBlock:bd,CheckoutBalancePaymentMethod:ts,CheckoutFooter:On,CheckoutHeader:oa,CheckoutItems:i0,CheckoutOperational:fd,CheckoutOrderMainData:ws,CheckoutPaymentMethod:ns,CheckoutPrices:Cr,CheckoutProduct:ca,ChoosePlanUpgradeMethod:Nd,ConnectDiscord:c0,CustomField:o0,CustomFields:s0,CustomerDashboard:m5,LeaveAReview:Ld,NoItemsBlock:ia,OpenDelivery:hd,OrderStatusBlock:wd,OrdersTable:e0,PageLoading:ZI,PageTitle:aa,Pagination:t0,PaginationWithRange:ou,PayPalFFNote:gd,PaymentMethods:rs,ProcessingPaymentModal:Ds,ReferralBlock:Xl,ReferralBlockInfo:Kl,ReferralBlockSteps:Ql,SecuredBySsl:vs,Sidebar:vl,SkeletonReferralBlock:Jl,StatItem:xt,StatusIndicator:r0,StatusVariant:Rn,SubmitReview:Dd,SubscriptionCoupon:Ad,SubscriptionExpiration:Rd,SubscriptionExpirationDate:kd,SubscriptionProduct:Td,SubscriptionStatusBadge:Ls,SubscriptionsTable:Ed,Table:sa,TableItem:Ke,TableItemTitle:Tt,TermsOfService:Ns,TicketRow:Cd,TrackPayment:Ta,getChargeStatusIcon:md,getOrderStatusIcon:vd,getPaginationText:n0},Symbol.toStringTag,{value:"Module"})),Qv="_chargePageContainer_1azbl_1",Kv="_chargeItems_1azbl_14",Jv="_mainContent_1azbl_25",ew="_contentWrapper_1azbl_44",tw="_antistockContent_1azbl_53",nw="_statusBlock_1azbl_58",rw="_statusBlockAntistock_1azbl_63",uw="_notPaidSection_1azbl_68",aw="_antistockPayNow_1azbl_82",iw="_antistockFooter_1azbl_86",sw="_antistockTrackPayment_1azbl_96",ow="_footer_1azbl_106",cw="_loaderContainer_1azbl_128",Nt={chargePageContainer:Qv,chargeItems:Kv,mainContent:Jv,contentWrapper:ew,antistockContent:tw,statusBlock:nw,statusBlockAntistock:rw,notPaidSection:uw,antistockPayNow:aw,antistockFooter:iw,antistockTrackPayment:sw,footer:ow,loaderContainer:cw},lw=()=>{const{id:e}=g.useParams(),[t,n]=g.useSearchParams(),[r,u]=P.useState(!1),[a,i]=P.useState(),[o,c]=P.useState(!0),l=g.useNavigate(),h=P.useRef(),f=P.useRef(!1),{setIsOpen:m}=g.useModalStore(),{isAntistock:p}=g.useGeneralStore();return P.useEffect(()=>{const b=async(E,_=!1)=>{_||u(!0);const{data:I}=await p2(E);u(!1),i(I)},x=setInterval(()=>{e&&b(e,!0)},5e3);return e&&b(e),()=>{clearInterval(x)}},[]),P.useEffect(()=>{const b=setTimeout(()=>{var E;console.log("charge timeout",a);const x=t.get("redirectRoute");if((a==null?void 0:a.status)===pe.Paid&&a.redirectUrl&&!h.current){const I=JSON.parse(localStorage.getItem("orders")||"{}")[((E=a==null?void 0:a.order)==null?void 0:E.id)||""];I?window.open(I.fullAccessToken?`${a.redirectUrl}/${I.fullAccessToken}`:`${a.redirectUrl}`,"_self"):window.open(a.redirectUrl,"_self")}(a==null?void 0:a.status)===pe.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(b)},[a]),P.useEffect(()=>{((a==null?void 0:a.gateway)==="PayPalFF"||(a==null?void 0:a.gateway)==="Сashapp")&&m(!0)},[a]),P.useEffect(()=>{var b;if(a!=null&&a.displayPaymentInfo&&a.displayPaymentInfo.length===1&&a.status===pe.NotPaid&&!f.current){const x=a.displayPaymentInfo[0];x.type==="Button"&&((b=x.props)!=null&&b.url)&&(window.open(x.props.url,"_blank"),f.current=!0)}},[a==null?void 0:a.displayPaymentInfo,a==null?void 0:a.status]),r?s.jsx("div",{className:Nt.loaderContainer,children:s.jsx(w.Loader,{})}):s.jsxs("div",{className:Nt.chargePageContainer,children:[s.jsx("div",{className:Nt.chargeItems,children:s.jsx(_d,{charge:a})}),s.jsx("div",{className:Nt.mainContent,style:p?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:s.jsxs("div",{className:g.clx(Nt.contentWrapper,{[Nt.antistockContent]:p}),children:[a&&(a==null?void 0:a.status)!==pe.NotPaid&&s.jsx(bd,{charge:a}),a&&s.jsxs("div",{className:g.clx(Nt.statusBlock,{[Nt.statusBlockAntistock]:p}),children:[s.jsx(ws,{lastUpdate:a.expiresAt,email:a.customerForCharge.email,invoiceId:a.id,paymentType:a.gateway}),p&&(a==null?void 0:a.status)===pe.NotPaid&&s.jsx("div",{className:Nt.antistockPayNow,children:a==null?void 0:a.displayPaymentInfo.map((b,x)=>s.jsx(Gu,{block:b},x))}),p&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Nt.antistockTrackPayment,children:s.jsx(Ta,{timeline:a.timeline})}),s.jsx(On,{className:Nt.antistockFooter})]})]}),!p&&(a==null?void 0:a.status)===pe.NotPaid&&s.jsx("div",{className:Nt.notPaidSection,children:a==null?void 0:a.displayPaymentInfo.map((b,x)=>s.jsx(Gu,{block:b},x))}),!p&&s.jsx(On,{className:Nt.footer})]})}),(a==null?void 0:a.gateway)==="PayPalFF"&&o&&s.jsx(w.Modal,{close:()=>c(!1),children:s.jsx(gd,{price:a.price,setIsOpen:c})}),(a==null?void 0:a.gateway)==="Сashapp"&&o&&s.jsx(w.Modal,{close:()=>u(!1),children:s.jsx(xd,{setIsOpen:c,chargeId:a.id})})]})},dw=Object.freeze(Object.defineProperty({__proto__:null,ChargePage:lw},Symbol.toStringTag,{value:"Module"}));exports.ActivePaymentMethod=Sd;exports.ActiveSubscriptionProduct=Id;exports.BalanceModal=Fl;exports.ChangeSubscriptionPlan=yd;exports.ChargeStatus=pe;exports.CheckoutFooter=On;exports.CheckoutHeader=oa;exports.CheckoutItems=i0;exports.CheckoutOperational=fd;exports.CheckoutOrderMainData=ws;exports.CheckoutPrices=Cr;exports.CheckoutProduct=ca;exports.LeaveAReview=Ld;exports.MarkdownText=Ki;exports.NoItemsBlock=ia;exports.OrderStatus=Ce;exports.OrderStatusBlock=wd;exports.OrdersTable=e0;exports.PageTitle=aa;exports.PaginationWithRange=ou;exports.ReCaptchaProvider=zi;exports.StableText=zc;exports.SubscriptionCoupon=Ad;exports.SubscriptionExpirationDate=kd;exports.SubscriptionProduct=Td;exports.SubscriptionsTable=Ed;exports.Table=sa;exports.TableItemTitle=Tt;exports.TicketRow=Cd;exports.TrackPayment=Ta;exports.auth=m2;exports.fetchAuthorizedOrder=e2;exports.fetchGeneral=Bd;exports.fetchOrder=Jd;exports.fetchOrders=Kd;exports.fetchPrivacyPolicy=Xd;exports.fetchRefundPolicy=Gd;exports.fetchSubscription=n2;exports.fetchSubscriptions=i2;exports.fetchTerms=Yd;exports.fetchThemeAndSettings=jd;exports.fetchTicket=c2;exports.fetchTickets=d2;exports.getBalance=Ju;exports.getBalanceSettings=nl;exports.getGatewaysDetail=uu;exports.index=Xv;exports.index$1=dw;exports.parseDraftJsText=tl;exports.recapcha=rf;exports.sendTicketMessage=l2;exports.useCart=nu;exports.useCopy=Yn;exports.useGeneralInfo=Xc;exports.useMarkdownIt=Nl;exports.useReCaptcha=ru;
107
+ `):t.deliveryItems[0].textData,o=()=>{u(!1),a?e(!1):setTimeout(()=>{e(!1)},300)};return s.jsxs("div",{className:g.clx(Ge.modal,{[Ge.modalAntistock]:a}),onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:Ge.header,children:[s.jsx("h3",{id:"h3",className:Ge.title,children:a?"View Content":"Thank you for the purchase!"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Ge.bottomSheet,children:[s.jsx("div",{className:Ge.content,children:r?s.jsx("div",{className:Ge.discordMessage,children:s.jsx("p",{className:Ge.discordMessageTitle,id:"md",children:"Discord role has been granted"})}):s.jsxs("div",{children:[s.jsxs("div",{className:Ge.section,children:[!a&&s.jsx("p",{className:Ge.contentTitle,id:"md",children:"Content"}),!a&&s.jsxs(w.Button,{className:Ge.copyButton,type:"Secondary",onClick:()=>n(i),children:[s.jsx(w.Icon,{name:"Copy"}),"Copy to Clipboard"]})]}),s.jsx("div",{className:g.clx(Ge.scrollableBox,{[Ge.scrollableBoxAntistock]:a}),children:s.jsx("p",{className:Ge.contentText,id:"md",children:a?s.jsx(Ki,{text:i}):s.jsx(gs,{remarkPlugins:[C1],rehypePlugins:[dd],components:{a:({node:c,...l})=>s.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer",className:Ge.link})},children:i})})})]})}),a&&s.jsxs(w.Button,{className:Ge.copyButtonAntistock,type:"Secondary",onClick:()=>n(i),style:{display:"flex",alignItems:"center",gap:"5px"},children:[s.jsx(w.Icon,{name:"Copy"}),"Copy All"]}),!a&&s.jsx("div",{className:Ge.buttonGroup,children:s.jsx("div",{className:Ge.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:o,children:"Close"})})})]})]})},FA="_mt1_1l62z_1",BA="_notifyBlock_1l62z_13",jA="_notifyHeader_1l62z_19",HA="_notifyContent_1l62z_25",UA="_buttonBlock_1l62z_30",VA="_imageBlock_1l62z_34",zA="_imageContainer_1l62z_42",$A="_sectionBlock_1l62z_54",qA="_sectionTitle_1l62z_61",ZA="_sectionSubtitle_1l62z_64",WA="_inputContainer_1l62z_69",Zt={mt1:FA,notifyBlock:BA,notifyHeader:jA,notifyContent:HA,buttonBlock:UA,imageBlock:VA,imageContainer:zA,sectionBlock:$A,sectionTitle:qA,sectionSubtitle:ZA,inputContainer:WA},YA=({props:e})=>{const t=Yn();return s.jsx("div",{className:Zt.mt1,children:s.jsxs("div",{className:Zt.inputContainer,children:[s.jsx(w.Input,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&s.jsx(w.Button,{type:"Secondary",onClick:()=>t(e.text),children:s.jsx(w.Icon,{name:"Copy"})})]})})},GA=({props:e})=>s.jsx(w.Button,{className:Zt.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),XA=({props:e})=>s.jsx("div",{className:Zt.imageBlock,children:s.jsx("div",{className:Zt.imageContainer,children:s.jsx("img",{src:e.src,alt:""})})}),QA=({props:e})=>s.jsxs("div",{className:Zt.notifyBlock,children:[s.jsxs("div",{className:Zt.notifyHeader,children:[s.jsx(w.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),s.jsx("p",{children:e.heading})]}),s.jsx("p",{className:Zt.notifyContent,children:e.content})]}),KA=({props:e})=>{var t;return s.jsxs("div",{className:Zt.sectionBlock,children:[s.jsx("p",{className:Zt.sectionTitle,children:e.title}),s.jsx("span",{className:Zt.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>s.jsx(Gu,{block:n},r))]})},Gu=({block:e})=>{switch(e.type){case"Section":return s.jsx(KA,{...e});case"ReadOnlyTextInput":return s.jsx(YA,{...e});case"Notify":return s.jsx(QA,{...e});case"Button":return s.jsx(GA,{...e});case"Image":return s.jsx(XA,{...e});default:return null}},JA="_chargeStatusBlock_12swd_4",eS="_isAntistock_12swd_13",tS="_chargeStatusIcon_12swd_19",nS="_chargeStatusTitle_12swd_27",rS="_chargeStatusDescription_12swd_33",uS="_pickUpButton_12swd_39",aS="_actionButtons_12swd_49",iS="_actionButton_12swd_49",Et={chargeStatusBlock:JA,isAntistock:eS,chargeStatusIcon:tS,chargeStatusTitle:nS,chargeStatusDescription:rS,pickUpButton:uS,actionButtons:aS,actionButton:iS},$n={[pe.Paid]:"Payment Successful",[pe.Pending]:"Payment Pending",[pe.Expired]:"Payment Expired",[pe.Cancelled]:"Payment Cancelled",[pe.NotPaid]:"Payment Failed",[pe.Refunded]:"Payment Refunded"},pd={[pe.Paid]:"Your payment has successfully been processed. Tap on the button below to be redirected back to our website.",[pe.Pending]:"Your payment is currently pending. We recommend checking back shortly for confirmation.",[pe.Expired]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[pe.Cancelled]:"You canceled the warrant. If there are any problems, please contact support",[pe.NotPaid]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[pe.Refunded]:"Your payment has been refunded. Please check your payment method for confirmation."},md=()=>({[pe.Paid]:s.jsx("div",{className:`${Et.chargeStatusIcon}`,children:s.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),[pe.Pending]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"})}),[pe.Expired]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[pe.Cancelled]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[pe.NotPaid]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[pe.Refunded]:s.jsx("div",{className:Et.chargeStatusIcon,children:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-warning)"})})}),bd=({charge:e})=>{const t=e.status,n=g.useNavigate(),{shopDomain:r}=g.useStorefrontStore(),{isAntistock:u}=g.useGeneralStore(),a=P.useRef(),[i,o]=g.useSearchParams(),c=()=>{var h,f;if(!((h=e.order)!=null&&h.id))return;const l=i.get("redirectRoute");if((e==null?void 0:e.status)===pe.Paid&&e.redirectUrl&&!a.current){const p=JSON.parse(localStorage.getItem("orders")||"{}")[((f=e==null?void 0:e.order)==null?void 0:f.id)||""];p?window.open(p.fullAccessToken?`${e.redirectUrl}/${p.fullAccessToken}`:`${e.redirectUrl}`,"_self"):window.open(e.redirectUrl,"_self")}(e==null?void 0:e.status)===pe.Paid&&a.current&&n(a.current,{replace:!0}),l&&a&&(a.current=l,i.delete("redirectRoute"),o(i))};return s.jsxs("div",{className:g.clx(Et.chargeStatusBlock,{[Et.isAntistock]:u}),children:[md()[t],s.jsx("h2",{className:Et.chargeStatusTitle,children:$n[t]}),s.jsx("p",{className:Et.chargeStatusDescription,children:pd[t]}),t===pe.Paid?s.jsx("div",{className:Et.pickUpButton,style:u?{justifyContent:"flex-start"}:void 0,children:s.jsxs(w.Button,{onClick:c,style:{width:"100%",maxWidth:"250px",display:"flex",alignItems:"center",gap:"5px"},type:"Secondary",children:[s.jsx(w.Icon,{name:"ArrowLineUpRight"}),u?"View Order":"Pick up Order"]})}):s.jsxs("div",{className:Et.actionButtons,children:[s.jsx("div",{className:Et.actionButton,children:s.jsxs(w.Button,{type:"Secondary",onClick:()=>window.open(`https://${r}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[s.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),s.jsx("div",{className:Et.actionButton,children:s.jsxs(w.Button,{type:"Secondary",style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},onClick:()=>{u?window.open(`https://${r}/support`):n("/contact")},children:[s.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},sS="_bottomSheet_1x4sq_1",oS="_content_1x4sq_8",cS="_agreementList_1x4sq_11",lS="_agreementItem_1x4sq_16",dS="_warning_1x4sq_23",fS="_buttonGroup_1x4sq_31",hS="_buttonWrapper_1x4sq_41",pS="_fullWidthButton_1x4sq_44",mS="_modal_1x4sq_48",bS="_header_1x4sq_55",Mt={bottomSheet:sS,content:oS,agreementList:cS,agreementItem:lS,warning:dS,buttonGroup:fS,buttonWrapper:hS,fullWidthButton:pS,modal:mS,header:bS},gd=({setIsOpen:e,price:t})=>{const[n,r]=P.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:u}=g.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return s.jsxs("div",{className:Mt.modal,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:Mt.header,children:[s.jsx("h3",{id:"h3",children:"Note"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Mt.bottomSheet,children:[s.jsxs("div",{className:Mt.content,children:[s.jsxs("div",{className:Mt.agreementList,children:[s.jsxs("label",{className:Mt.agreementItem,children:[s.jsx(w.Checkbox,{value:n.agreeToSendAsFF,onChange:i=>r({...n,agreeToSendAsFF:i})}),s.jsx("p",{children:"I agree to send the payment as friends & family"})]}),s.jsxs("label",{className:Mt.agreementItem,children:[s.jsx(w.Checkbox,{value:n.agreeToSend,onChange:i=>r({...n,agreeToSend:i})}),s.jsxs("p",{children:["I agree to send the payment of ",g.formatPrice(t)," ",t.currency]})]}),s.jsxs("label",{className:Mt.agreementItem,children:[s.jsx(w.Checkbox,{value:n.agreeToNotAddNote,onChange:i=>r({...n,agreeToNotAddNote:i})}),s.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),s.jsx("div",{className:Mt.warning,children:s.jsxs("p",{children:["Please note that you are required to send the exact payment of ",g.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),s.jsxs("div",{className:Mt.buttonGroup,children:[s.jsx("div",{className:Mt.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",children:s.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),s.jsx("div",{className:Mt.fullWidthButton,children:s.jsx(w.Button,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:a,children:"Continue to Payment"})})]})]})]})},gS="_chargeItemsContainer_vynct_5",_S="_chargeItemsInner_vynct_18",xS="_productsContainer_vynct_25",CS="_antistockLayout_vynct_40",ES="_mainContentAntistock_vynct_53",TS="_desktopTrackPayment_vynct_64",yS="_desktopFooter_vynct_73",kS="_footerContainerAntistock_vynct_94",AS="_chargeHeader_vynct_107",SS="_chargeTitle_vynct_115",IS="_chargeDescription_vynct_121",NS="_copyButton_vynct_127",vS="_productsList_vynct_139",wS="_footerContainer_vynct_94",gt={chargeItemsContainer:gS,chargeItemsInner:_S,productsContainer:xS,antistockLayout:CS,mainContentAntistock:ES,desktopTrackPayment:TS,desktopFooter:yS,footerContainerAntistock:kS,chargeHeader:AS,chargeTitle:SS,chargeDescription:IS,copyButton:NS,productsList:vS,footerContainer:wS},_d=({charge:e})=>{var i;const t=Yn(),{isAntistock:n}=g.useGeneralStore(),r=(e==null?void 0:e.price.currency)||"USD",u=new Intl.NumberFormat("en-US",{style:"currency",currency:r}),a=P.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,E;const p=((x=c.productWithVariant)==null?void 0:x.name)||"",b=((E=c.productWithVariant)==null?void 0:E.variantName)||"";return!p&&!b?"":!b||p===b?p:p?`${p} (${b})`:b})(),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 s.jsx("div",{className:gt.chargeItemsContainer,children:s.jsxs("div",{className:gt.chargeItemsInner,children:[s.jsx(oa,{expiresAt:e==null?void 0:e.expiresAt}),s.jsxs("div",{className:`${gt.productsContainer} ${n?gt.antistockLayout:""}`,children:[(e==null?void 0:e.name)&&s.jsxs("header",{className:gt.chargeHeader,children:[s.jsxs("div",{children:[s.jsx("h1",{className:gt.chargeTitle,id:"h5",children:e.name}),e.description&&s.jsx("p",{className:gt.chargeDescription,id:"md",children:e.description})]}),((i=e.order)==null?void 0:i.id)&&!n&&s.jsxs(w.Button,{type:"Secondary",className:gt.copyButton,onClick:()=>{var o;return t(((o=e.order)==null?void 0:o.id)||"")},children:[s.jsx(w.Icon,{name:"Copy"}),"Copy Order ID"]})]}),s.jsxs("div",{className:n?gt.mainContentAntistock:"",style:n?void 0:{flex:1},children:[!!a.length&&s.jsx("div",{className:gt.productsList,children:a.map(o=>s.jsx(ca,{product:o},o.id))}),s.jsx(Cr,{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&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:gt.desktopTrackPayment,children:s.jsx(Ta,{timeline:e.timeline})}),s.jsx(On,{className:gt.desktopFooter})]})]}),!n&&s.jsx(On,{className:`${gt.footerContainer} ${n?gt.footerContainerAntistock:""}`})]})]})})},LS="_checkoutOrderMainData_hqf60_1",DS="_orderDetailRow_hqf60_6",RS="_chargeIdRow_hqf60_16",PS="_detailLabel_hqf60_25",OS="_detailValue_hqf60_29",MS="_chargeIdContainer_hqf60_33",FS="_chargeId_hqf60_16",BS="_copyIcon_hqf60_51",ze={checkoutOrderMainData:LS,orderDetailRow:DS,chargeIdRow:RS,detailLabel:PS,detailValue:OS,chargeIdContainer:MS,chargeId:FS,copyIcon:BS},ws=({lastUpdate:e,invoiceId:t,email:n,paymentType:r,orderId:u})=>{const a=Yn(),[i,o]=P.useState(null),c=i==null?void 0:i.find(h=>h.name===r);P.useEffect(()=>{i||(async()=>{if(!r)return;const m=await uu([r]);o(m)})()},[r,i]);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()],b=h.getFullYear(),x=h.getHours(),E=h.getMinutes().toString().padStart(2,"0"),_=h.getSeconds().toString().padStart(2,"0"),I=x>=12?"PM":"AM",k=(x%12||12).toString().padStart(2,"0");return`${p} ${m}, ${b} at ${k}:${E}:${_} ${I}`};return s.jsxs("div",{className:ze.checkoutOrderMainData,children:[s.jsxs("div",{className:ze.orderDetailRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Last Updated"}),s.jsx("p",{className:ze.detailValue,id:"md",children:l(new Date(e))})]}),r&&s.jsxs("div",{className:ze.orderDetailRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Payment Type"}),s.jsx("p",{className:ze.detailValue,id:"md",children:c==null?void 0:c.displayName})]}),s.jsxs("div",{className:ze.orderDetailRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Email"}),s.jsx("p",{className:ze.detailValue,id:"md",children:n})]}),t&&s.jsxs("div",{className:ze.chargeIdRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Charge ID"}),s.jsxs("div",{className:ze.chargeIdContainer,children:[s.jsx("p",{className:ze.chargeId,id:"md",children:t}),s.jsx("div",{className:ze.copyIcon,onClick:()=>a(t),children:s.jsx(w.Icon,{name:"Copy"})})]})]}),u&&s.jsxs("div",{className:ze.chargeIdRow,children:[s.jsx("p",{className:ze.detailLabel,id:"md",children:"Order ID"}),s.jsxs("div",{className:ze.chargeIdContainer,children:[s.jsx("p",{className:ze.chargeId,id:"md",children:u}),s.jsx("div",{className:ze.copyIcon,onClick:()=>a(u),children:s.jsx(w.Icon,{name:"Copy"})})]})]})]})},jS="_bottomSheet_1yai1_1",HS="_formContainer_1yai1_8",US="_error_1yai1_14",VS="_buttonGroup_1yai1_18",zS="_buttonWrapper_1yai1_28",$S="_fullWidthButton_1yai1_31",qS="_modal_1yai1_41",ZS="_header_1yai1_48",En={bottomSheet:jS,formContainer:HS,error:US,buttonGroup:VS,buttonWrapper:zS,fullWidthButton:$S,modal:qS,header:ZS},xd=({chargeId:e,setIsOpen:t})=>{const[n,r]=P.useState(""),[u,a]=P.useState(""),{setIsOpen:i}=g.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 Ud({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},l=()=>{i(!1),setTimeout(()=>{t(!1)},300)};return s.jsxs("div",{className:En.modal,onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:En.header,children:[s.jsx("h3",{id:"h3",children:"CashApp Verify"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:l,fill:"var(--text-primary)"})]}),s.jsx("form",{onSubmit:c,children:s.jsxs("div",{className:En.bottomSheet,children:[s.jsx("div",{className:En.formContainer,children:s.jsxs("div",{children:[s.jsx(w.Input,{value:n,onChange:h=>{r(h),a("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),u&&s.jsx("p",{className:En.error,children:u})]})}),s.jsxs("div",{className:En.buttonGroup,children:[s.jsx("div",{className:En.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:l,children:"Cancel"})}),s.jsx("div",{className:En.fullWidthButton,children:s.jsx(w.Button,{type:"Primary",children:"Verify"})})]})]})})]})},WS="_trackPaymentContainer_fk3b6_1",YS="_trackPaymentBox_fk3b6_5",GS="_trackPaymentBoxActive_fk3b6_18",XS="_trackPaymentHeader_fk3b6_23",QS="_trackPaymentTitle_fk3b6_27",KS="_trackPaymentTimeline_fk3b6_33",JS="_trackPaymentItem_fk3b6_42",eI="_itemHeader_fk3b6_48",tI="_itemDate_fk3b6_55",nI="_itemMessage_fk3b6_59",rI="_trackPaymentToggle_fk3b6_64",uI="_trackPaymentToggleContent_fk3b6_75",aI="_trackPaymentToggleText_fk3b6_81",iI="_antistock_fk3b6_88",lt={trackPaymentContainer:WS,trackPaymentBox:YS,trackPaymentBoxActive:GS,trackPaymentHeader:XS,trackPaymentTitle:QS,trackPaymentTimeline:KS,trackPaymentItem:JS,itemHeader:eI,itemDate:tI,itemMessage:nI,trackPaymentToggle:rI,trackPaymentToggleContent:uI,trackPaymentToggleText:aI,antistock:iI},Hc=(e,t)=>{const n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),u=e.getFullYear(),a=e.getHours(),i=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}:${i}:${o} ${c}`:""},sI={[pe.Paid]:{displayName:$n[pe.Paid],displayMessage:"The invoice has been completed and the product has been delivered.",type:"success"},[pe.Pending]:{displayName:$n[pe.Pending],displayMessage:"The invoice has been created and we are now waiting to receive the payment.",type:"warning"},[pe.Expired]:{displayName:$n[pe.Expired],displayMessage:"Your payment has expired due to the payment not being sent in time.",type:"error"},[pe.Cancelled]:{displayName:$n[pe.Cancelled],displayMessage:"The order has been canceled. The payment was not sent within the time limit.",type:"error"},[pe.NotPaid]:{displayName:"New",displayMessage:"The charge has been created and is awaiting payment.",type:"success"},[pe.Refunded]:{displayName:$n[pe.Refunded],displayMessage:"Your order was refunded. Please check your payment method for confirmation.",type:"warning"}},oI=({date:e,chargeStatus:t})=>(console.log(t),s.jsxs("div",{className:lt.trackPaymentItem,children:[s.jsxs("div",{className:lt.itemHeader,children:[s.jsx("p",{className:lt.itemDate,id:"md-bold",children:Hc(new Date(e),"dd.MM.yyyy")}),s.jsx("p",{className:lt.itemTime,id:"md",children:Hc(new Date(e),"hh:mm:ss aa")})]}),s.jsx("p",{className:lt.itemMessage,id:"md",children:sI[t].displayMessage})]})),Ta=({timeline:e,className:t})=>{const[n,r]=P.useState(!1),{isAntistock:u}=g.useGeneralStore();return s.jsxs("div",{className:g.clx(lt.trackPaymentContainer,t,{[lt.antistock]:u}),children:[s.jsxs("div",{className:`${lt.trackPaymentBox} ${n?lt.trackPaymentBoxActive:""}`,style:u?{border:"1px solid var(--border-secondary)"}:void 0,children:[s.jsx("header",{className:lt.trackPaymentHeader,children:s.jsx("h2",{className:lt.trackPaymentTitle,id:"h4",children:"Track Payment"})}),s.jsx("div",{className:lt.trackPaymentTimeline,children:Object.keys(e).map(a=>s.jsx(oI,{date:e[a],chargeStatus:a},a))})]}),s.jsxs("div",{className:lt.trackPaymentToggle,onClick:()=>r(!n),style:u?{padding:"1.25rem",border:"1px solid var(--border-secondary)",borderRadius:"var(--border-radius)"}:void 0,children:[s.jsxs("div",{className:lt.trackPaymentToggleContent,children:[u?null:s.jsx(w.Icon,{name:"MagnifyingGlass",fill:"var(--text-secondary)"}),s.jsx("p",{className:lt.trackPaymentToggleText,id:"h5",children:"Track Payment"})]}),s.jsx(w.Icon,{name:"CaretRight",fill:"var(--text-primary)",width:16,height:16})]})]})},cI="_dateTime_1dnnn_11",lI="_tableItem_1dnnn_25",dI="_status_1dnnn_29",fI="_statusInProgress_1dnnn_38",hI="_statusText_1dnnn_42",pI="_statusIcon_1dnnn_46",mI="_statusInProgressText_1dnnn_52",bI="_statusInProgressIcon_1dnnn_57",gI="_message_1dnnn_63",dt={dateTime:cI,tableItem:lI,status:dI,statusInProgress:fI,statusText:hI,statusIcon:pI,statusInProgressText:mI,statusInProgressIcon:bI,message:gI},Cd=({item:e})=>{const[t,n]=g.extractDateAndTime(e.createdAt),r=g.useNavigate(),a=(i=>i.length>30?i.slice(0,27)+"...":i)(e.latestMessage);return s.jsxs(P.Fragment,{children:[s.jsx(Ke,{className:dt.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsxs("span",{id:"md",children:["#",e.id]})}),s.jsx(Ke,{className:g.clx(dt.message,dt.tableItem),onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsx("span",{id:"md",children:a})}),s.jsx(Ke,{className:dt.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsxs("div",{children:[s.jsx("div",{id:"md",children:t}),s.jsx("div",{className:dt.dateTime,id:"md",children:n})]})}),s.jsx(Ke,{className:dt.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:s.jsx(_I,{status:e.status})})]},e.id)},_I=({status:e})=>s.jsxs("div",{className:g.clx(dt.status,{[dt.statusClosed]:e==="CLOSED",[dt.statusInProgress]:e!=="CLOSED"}),children:[s.jsx("div",{className:g.clx(dt.statusIcon,{[dt.statusInProgressIcon]:e!=="CLOSED"}),children:e==="CLOSED"?s.jsx(w.Icon,{name:"CheckCircle",className:dt.statusIcon}):s.jsx(w.Icon,{name:"Clock",className:dt.statusInProgressIcon})}),s.jsx("div",{className:g.clx(dt.statusText,{[dt.statusInProgressText]:e!=="CLOSED"}),id:"md",children:e==="CLOSED"?"Closed":"In Progress"})]}),xI="_tableContainer_1eytq_1",CI="_table_1eytq_1",EI="_productInfo_1eytq_19",TI="_productImage_1eytq_26",yI="_productName_1eytq_35",kI="_expirationDate_1eytq_46",AI="_overflowItem_1eytq_51",SI="_gatewayContainer_1eytq_57",II="_gatewayImage_1eytq_62",NI="_dateTime_1eytq_67",vI="_tableLoader_1eytq_72",wI="_tableItem_1eytq_81",nt={tableContainer:xI,table:CI,productInfo:EI,productImage:TI,productName:yI,expirationDate:kI,overflowItem:AI,gatewayContainer:SI,gatewayImage:II,dateTime:NI,tableLoader:vI,tableItem:wI},LI="_badge_1oac8_1",DI="_active_1oac8_12",RI="_awaitingPayment_1oac8_17",PI="_cancelled_1oac8_22",OI="_changedGateway_1oac8_27",MI="_expired_1oac8_32",FI="_rial_1oac8_37",BI="_pastDue_1oac8_42",jI="_replaced_1oac8_47",mn={badge:LI,active:DI,awaitingPayment:RI,cancelled:PI,changedGateway:OI,expired:MI,rial:FI,pastDue:BI,replaced:jI},HI=()=>({[pn.ACTIVE]:{icon:s.jsx(w.Icon,{name:"CheckCircle"}),title:"Active",className:mn.active},[pn.AWAITING_PAYMENT]:{icon:s.jsx(w.Icon,{name:"Clock"}),title:"Awaiting Payment",className:mn.awaitingPayment},[pn.CANCELLED]:{icon:s.jsx(w.Icon,{name:"XCircle"}),title:"Cancelled",className:mn.cancelled},[pn.CHANGED_GATEWAY]:{icon:s.jsx(w.Icon,{name:"Warning"}),title:"Upgraded",className:mn.changedGateway},[pn.EXPIRED]:{icon:s.jsx(w.Icon,{name:"XCircle"}),title:"Expired",className:mn.expired},[pn.RIAL]:{icon:s.jsx(w.Icon,{name:"Clock"}),title:"Active",className:mn.rial},[pn.PAST_DUE]:{icon:s.jsx(w.Icon,{name:"Clock"}),title:"Trial",className:mn.pastDue},[pn.REPLACED]:{icon:s.jsx(w.Icon,{name:"Warning"}),title:"Replaced",className:mn.replaced}}),Ls=({status:e})=>{const t=HI()[e];return s.jsxs("div",{className:`${mn.badge} ${t.className}`,children:[t.icon,s.jsx("p",{id:"md",children:t.title})]})},UI=(e,t)=>{const n=t.find(r=>r.name===e);return n?s.jsxs("div",{className:nt.gatewayContainer,children:[s.jsx("img",{alt:n.displayName,src:g.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:nt.gatewayImage}),s.jsx("div",{children:n.displayName})]}):null},VI=({item:e,gatewaysDetail:t})=>{const[n,r]=g.extractDateAndTime(e.createdAt),[u]=g.extractDateAndTime(e.activeTo||""),a=Yn();return s.jsxs(P.Fragment,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:nt.productInfo,children:[s.jsx("div",{className:nt.productImage,children:s.jsx(w.Icon,{name:"Image",width:20,height:20,fill:"var(--text-secondary)"})}),s.jsxs("div",{children:[s.jsx(g.NavLink,{to:`/subscriptions/${e.id}/${e.accessToken}`,className:nt.productName,id:"md",children:e.productName}),s.jsx("p",{className:nt.expirationDate,children:e.activeTo&&`expires at ${u}`})]})]})}),s.jsx(Ke,{className:nt.overflowItem,onClick:()=>a(e.id),children:e.id}),s.jsx(Ke,{children:s.jsx(Ls,{status:e.status})}),s.jsx(Ke,{children:g.formatPrice(e.price)}),s.jsx(Ke,{children:UI(e.gatewayName,t)}),s.jsx(Ke,{children:s.jsxs("div",{children:[s.jsx("div",{id:"md",children:n}),s.jsx("div",{className:nt.dateTime,id:"md",children:r})]})})]},e.id)},Ed=({subscriptions:e,gatewaysDetail:t,totalCount:n,page:r,setPage:u})=>{const i=!(!(e!=null&&e.length)||!t);return s.jsxs("div",{className:nt.tableContainer,children:[s.jsxs(sa,{className:nt.table,children:[s.jsx(Tt,{className:nt.tableItem,children:"Product name"}),s.jsx(Tt,{className:nt.tableItem,children:"ID"}),s.jsx(Tt,{className:nt.tableItem,children:"Status"}),s.jsx(Tt,{className:nt.tableItem,children:"Value"}),s.jsx(Tt,{className:nt.tableItem,children:"Payment"}),s.jsx(Tt,{className:nt.tableItem,children:"Date"}),i&&(e==null?void 0:e.map(o=>s.jsx(VI,{item:o,gatewaysDetail:t},o.id)))]}),!i&&s.jsx("div",{className:nt.tableLoader,children:s.jsx(w.Loader,{})}),i&&s.jsx(ou,{currentPage:r,totalCount:n,onPageChange:u})]})},zI="_pageLoading_1rj3k_2",$I="_title_1rj3k_11",qI="_description_1rj3k_17",ii={pageLoading:zI,title:$I,description:qI},ZI=({description:e,title:t})=>s.jsxs("div",{className:ii.pageLoading,children:[s.jsx("div",{children:s.jsx(w.Loader,{})}),s.jsx("h1",{className:ii.title,children:t}),s.jsx("p",{className:ii.description,children:e})]}),WI="_container_1opbn_1",YI="_productDetails_1opbn_8",GI="_imageContainer_1opbn_14",XI="_image_1opbn_14",QI="_textContainer_1opbn_32",KI="_header_1opbn_40",JI="_title_1opbn_46",eN="_price_1opbn_53",tN="_badgeContainer_1opbn_57",nN="_description_1opbn_61",Xt={container:WI,productDetails:YI,imageContainer:GI,image:XI,textContainer:QI,header:KI,title:JI,price:eN,badgeContainer:tN,description:nN},Td=({subscription:e})=>s.jsxs("div",{className:Xt.container,children:[s.jsxs("div",{className:Xt.productDetails,children:[s.jsx("div",{className:Xt.imageContainer,children:e!=null&&e.image?s.jsx("img",{className:Xt.image,src:g.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):s.jsx(w.Icon,{name:"Image"})}),s.jsxs("div",{className:Xt.textContainer,children:[s.jsx("div",{className:Xt.header,children:s.jsx("h2",{className:Xt.title,children:e.name})}),s.jsxs("p",{className:Xt.price,children:[g.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsx("div",{className:Xt.badgeContainer,children:s.jsx(Ls,{status:e.status})})]}),e.description&&s.jsx(gs,{className:Xt.description,children:e.description})]}),rN="_card_69liy_1",uN="_price_69liy_10",aN="_interval_69liy_17",iN="_name_69liy_22",sN="_description_69liy_28",oN="_currentPlan_69liy_32",cN="_selectButton_69liy_45",lN="_progressSection_69liy_50",dN="_progressLabel_69liy_54",fN="_bottomSheet_69liy_60",hN="_title_69liy_69",pN="_typeSelector_69liy_80",mN="_typeOption_69liy_90",bN="_active_69liy_100",gN="_saveTag_69liy_108",_N="_planSelector_69liy_117",xN="_modal_69liy_127",CN="_inactive_69liy_148",EN="_notMounted_69liy_151",TN="_closeButton_69liy_157",je={card:rN,price:uN,interval:aN,name:iN,description:sN,currentPlan:oN,selectButton:cN,progressSection:lN,progressLabel:dN,bottomSheet:fN,title:hN,typeSelector:pN,typeOption:mN,active:bN,saveTag:gN,planSelector:_N,modal:xN,inactive:CN,notMounted:EN,closeButton:TN},yN=({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,i=10;return s.jsxs("div",{className:je.card,onClick:t,children:[s.jsxs("h2",{className:je.price,children:["$",u," ",s.jsxs("span",{className:je.interval,children:["/ ",r]})]}),s.jsx("h3",{className:je.name,children:e.name}),e.description&&s.jsx("p",{className:je.description,children:e.description}),n?s.jsxs("div",{className:je.currentPlan,children:[s.jsx(w.Icon,{name:"Check"}),"Your current Plan"]}):s.jsx(w.Button,{type:"Secondary",className:je.selectButton,children:"Select"}),n&&s.jsxs("div",{className:je.progressSection,children:[s.jsx(u0,{percent:i/a*100,disablePercentLabel:!0}),s.jsxs("p",{className:je.progressLabel,children:["Used: ",i," of ",a," days"]})]})]})},yd=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,u]=P.useState(null),[a,i]=P.useState(null),[o,c]=P.useState(null),{id:l,accessToken:h}=g.useParams(),[f,m]=P.useState(!1),[p,b]=P.useState(!1),{setIsOpen:x}=g.useModalStore();P.useEffect(()=>{e&&m(!0)},[e]);const E=()=>{t(!1)},[_,I]=P.useState(null);P.useEffect(()=>{l&&h&&(async()=>{if(l&&h){const{data:v}=await s2({id:l,accessToken:h});I(v)}})()},[l,h]),P.useEffect(()=>{var N;if(_!=null&&_.data.types[0]){const v=(N=_.data.types.flatMap(V=>V.productVariants).find(V=>V.data.id===(n==null?void 0:n.variantId)))==null?void 0:N.data;v&&(c(v),i(v))}},[_,n]),P.useEffect(()=>{_!=null&&_.data.types[0]&&u(_==null?void 0:_.data.types[0])},[_==null?void 0:_.data.types]);const k=N=>{u(N),i(null)},D=N=>{i(N),x(!0),b(!0)};return s.jsxs("div",{className:g.clx(je.modal,{[je.active]:e,[je.inactive]:!e&&f,[je.notMounted]:!f}),onClick:N=>N.stopPropagation(),children:[s.jsx(w.Icon,{name:"X",onClick:E,hoverable:!0,className:je.closeButton,fill:"var(--text-primary)"}),s.jsxs("div",{className:je.bottomSheet,children:[s.jsx("h3",{id:"h3",className:je.title,children:"Change Plan"}),s.jsx("p",{className:je.description,children:_==null?void 0:_.data.description}),s.jsx("div",{className:je.typeSelector,children:_==null?void 0:_.data.types.map(N=>s.jsxs("div",{className:g.clx(je.typeOption,{[je.active]:(r==null?void 0:r.id)===N.id}),onClick:()=>k(N),children:[N.name,N.name==="Yearly"&&s.jsx("span",{className:je.saveTag,children:"Save %"})]},N.id))}),r&&s.jsx("div",{className:je.planSelector,children:r.productVariants.map(N=>s.jsx(yN,{variant:N.data,isSelected:(a==null?void 0:a.id)===N.data.id,isCurrent:(o==null?void 0:o.id)===N.data.id,onSelect:()=>D(N.data)},N.data.id))})]}),p&&a&&n&&s.jsx(w.Modal,{close:()=>{b(!1)},children:s.jsx(Nd,{setIsOpen:b,selectedVariant:a,subscription:n})})]})},kN="_container_nb625_1",AN="_title_nb625_11",SN="_subtitle_nb625_16",IN="_info_nb625_20",Du={container:kN,title:AN,subtitle:SN,info:IN},kd=()=>{const{subscription:e}=g.useSubscriptionStore(),[t,n]=g.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,u]=P.useState(!1),{setIsOpen:a}=g.useModalStore();return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:Du.container,children:[s.jsxs("div",{className:Du.info,children:[s.jsx("p",{className:Du.title,children:"Expiration Date"}),s.jsxs("p",{className:Du.subtitle,children:[t," at ",n]})]}),s.jsx(w.Button,{type:"Special",onClick:i=>{i.stopPropagation(),a(!0),u(!0)},children:"Extend"})]}),r&&s.jsx(w.Modal,{close:()=>u(!1),children:s.jsx(Rd,{setIsOpen:u})})]})},NN="_couponContainer_1sspa_1",vN="_iconWrapper_1sspa_10",wN="_details_1sspa_21",LN="_title_1sspa_25",DN="_progress_1sspa_29",RN="_foreverText_1sspa_34",ur={couponContainer:NN,iconWrapper:vN,details:wN,title:LN,progress:DN,foreverText:RN},Ad=({coupon:e,currency:t})=>{const n=e.isFixed?g.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?g.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return s.jsxs("div",{className:ur.couponContainer,children:[s.jsx("div",{className:ur.iconWrapper,children:s.jsx(w.Icon,{name:"CheckCircle"})}),s.jsxs("div",{className:ur.details,children:[s.jsxs("p",{className:ur.title,children:[e.name,", ",n," discount"]}),s.jsx("div",{className:ur.progress,children:s.jsx(u0,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),s.jsx("p",{className:ur.foreverText,children:"Forever discount code"})]})]})},PN="_paymentMethodContainer_1g0da_4",ON="_paymentMethodTitle_1g0da_15",MN="_activeMethod_1g0da_20",FN="_noMethod_1g0da_28",BN="_activeMethodPaymentMethod_1g0da_37",jN="_paymentMethodLogo_1g0da_47",HN="_paymentMethodNumber_1g0da_57",UN="_method_1g0da_61",vn={paymentMethodContainer:PN,paymentMethodTitle:ON,activeMethod:MN,noMethod:FN,activeMethodPaymentMethod:BN,paymentMethodLogo:jN,paymentMethodNumber:HN,method:UN},VN="_paymentMethods_1gev0_1",zN="_modal_1gev0_14",$N="_header_1gev0_28",qN="_content_1gev0_37",Un={paymentMethods:VN,modal:zN,header:$N,content:qN},ZN=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:u}=g.useSubscriptionStore();if(!r)return null;const{id:a}=g.useParams(),i=g.useNavigate(),{notifications:o,setNotifications:c}=g.useNotificationStore(),{setPaymentMethod:l,setGateway:h,cart:f}=nu(),{setIsOpen:m}=g.useModalStore();async function p(){if(b(),t(!0),a&&r){const{data:x}=await a2(a,f.gateway);x.isReconnectPaymentNeeded?i(`/charges/${x.chargeId}`):(c([...o,{status:"success",id:g.v4(),message:"Your action has been successfully completed"}]),u({...r,gatewayName:f.gateway}))}else c([...o,{status:"error",id:g.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function b(){m(!1),setTimeout(()=>{n(!1)},300)}return s.jsxs("div",{className:Un.modal,onClick:x=>{x.stopPropagation()},children:[s.jsxs("div",{className:Un.header,children:[s.jsx("h3",{id:"h3",className:Un.title,children:"Choose Payment Method"}),s.jsx(w.Icon,{name:"X",onClick:b,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Un.content,children:[(r==null?void 0:r.availableGateways)&&s.jsx(rs,{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:()=>i("/customer-dash")}),s.jsxs("div",{className:Un.paymentMethods,children:[s.jsx("div",{className:Un.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Cancel"})}),s.jsx("div",{className:Un.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",disabled:!f.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},WN="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",Sd=()=>{var b,x,E;const{subscription:e}=g.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=nu(),r=g.useNavigate(),[u,a]=P.useState(null),[i,o]=P.useState(!1),[c,l]=P.useState(!1),{setIsOpen:h}=g.useModalStore();if(!e)return null;const[f,m]=P.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return P.useEffect(()=>{(async()=>{const I=await uu(e.availableGateways);a(I)})()},[]),P.useEffect(()=>{t.gateway!==f&&m(t.gateway)},[t.gateway]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:vn.paymentMethodContainer,children:[s.jsxs("div",{children:[s.jsx("p",{className:vn.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&s.jsx(YN,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f==="Balance"&&s.jsx(ts,{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&&s.jsx("span",{className:vn.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f&&s.jsx("div",{className:vn.activeMethod,children:u&&s.jsx(ns,{align:"row",gatewayLogoCfId:(b=u.find(_=>_.name===f))==null?void 0:b.logoCfImageId,gatewayDisplayName:(x=u.find(_=>_.name===f))==null?void 0:x.displayName,gateway:f,poweredByLogoCfId:(E=u.find(_=>_.name===f))==null?void 0:E.poweredByImageCfImageId,className:vn.activeMethodPaymentMethod,selected:p===f,onSelect:_=>{n(_)}},f)})]}),s.jsx(w.Button,{type:"Special",onClick:_=>{_.stopPropagation(),h(!0),l(!0)},children:t.gateway?"Change":"Manage"})]}),c&&s.jsx(w.Modal,{close:()=>l(!1),children:s.jsx(ZN,{setIsLoading:o,setIsOpen:l})})]})},YN=({gatewayInfo:e})=>{var t,n,r,u,a;return s.jsxs("div",{className:vn.method,children:[s.jsxs("div",{className:vn.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&s.jsx(H4,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&s.jsx("img",{src:WN,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((u=e.card)==null?void 0:u.brand.toLowerCase())!=="mastercard"&&s.jsx(w.Icon,{name:"CreditCard",width:22})]}),s.jsxs("p",{className:vn.paymentMethodNumber,children:["•••• •••• •••• ",(a=e.card)==null?void 0:a.last4]})]})},GN="_subscriptionProductContainer_83ibx_4",XN="_subscriptionProductImage_83ibx_15",QN="_subscriptionProductInfo_83ibx_32",KN="_name_83ibx_37",JN="_price_83ibx_40",Or={subscriptionProductContainer:GN,subscriptionProductImage:XN,subscriptionProductInfo:QN,name:KN,price:JN},Id=({subscription:e,id:t,accessToken:n})=>{const[r,u]=P.useState(!1),{setIsOpen:a}=g.useModalStore();return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:Or.subscriptionProductContainer,onClick:i=>i.stopPropagation(),children:[s.jsx("div",{className:Or.subscriptionProductImage,children:e!=null&&e.image?s.jsx("img",{src:g.convertCfImageIdToUrl(e.image.cfId)}):s.jsx(w.Icon,{name:"Image"})}),s.jsxs("div",{className:Or.subscriptionProductInfo,children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h2",{className:Or.name,children:e.name})}),s.jsxs("p",{className:Or.price,children:[g.formatPrice(e.price)," / ",e.recurringInterval]})]}),s.jsx(w.Button,{type:"Special",onClick:i=>{i.preventDefault(),u(!0),a(!0)},children:"Cancel"})]}),r&&s.jsx(w.Modal,{close:()=>u(!1),children:s.jsx(Pd,{accessToken:n,id:t,isOpen:r,setIsOpen:u})})]})},ev="_content_5ctxw_1",tv="_selectedPlan_5ctxw_37",nv="_planName_5ctxw_44",rv="_description_5ctxw_48",uv="_price_5ctxw_51",av="_buttonGroup_5ctxw_79",iv="_buttonWrapper_5ctxw_84",sv="_modal_5ctxw_88",ov="_header_5ctxw_95",$t={content:ev,selectedPlan:tv,planName:nv,description:rv,price:uv,buttonGroup:av,buttonWrapper:iv,modal:sv,header:ov},Nd=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=g.useModalStore(),u=()=>{a()},a=()=>{r(!1),setTimeout(()=>{e(!1)},300)},i=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,o=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=i-o,l=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return s.jsxs("div",{className:$t.modal,children:[s.jsxs("div",{className:$t.header,children:[s.jsx("h3",{id:"h3",children:"Choose upgrade method"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:()=>a(),fill:"var(--text-primary)"})]}),s.jsxs("div",{className:$t.bottomSheet,children:[s.jsxs("div",{className:$t.content,children:[s.jsxs("div",{className:$t.selectedPlan,children:[s.jsx("h2",{className:$t.planName,children:t.name}),s.jsx("p",{className:$t.description,children:t.description}),s.jsxs("p",{className:$t.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),s.jsx(Cr,{formatter:l,coupon:null,total:c,discount:o})]}),s.jsxs("div",{className:$t.buttonGroup,children:[s.jsx("div",{className:$t.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:()=>a(),children:"Stay with us"})}),s.jsx("div",{className:$t.buttonWrapper,children:s.jsxs(w.Button,{type:"Primary",onClick:u,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},cv="_orderStatusBlock_2wo4y_2",lv="_orderStatusBlockAntistock_2wo4y_11",dv="_iconWrapper_2wo4y_16",fv="_orderStatusTitle_2wo4y_26",hv="_orderStatusDescription_2wo4y_31",pv="_actionButtons_2wo4y_36",mv="_actionButton_2wo4y_36",bv="_button_2wo4y_47",Qt={orderStatusBlock:cv,orderStatusBlockAntistock:lv,iconWrapper:dv,orderStatusTitle:fv,orderStatusDescription:hv,actionButtons:pv,actionButton:mv,button:bv},gv={[Ce.New]:"New",[Ce.Pending]:"Order Pending",[Ce.Expired]:"Order Expired",[Ce.Cancelled]:"Order Canceled",[Ce.Failed]:"Order Failed",[Ce.FullDeliveryFailure]:"Delivery Failure",[Ce.PartiallyDelivered]:"Partial Delivery Failure",[Ce.Refunded]:"Order Refunded",[Ce.Completed]:"Order Completed"},_v={[Ce.New]:"Your order has been created and is awaiting payment.",[Ce.Pending]:"Your order is currently pending. We recommend checking back shortly for confirmation.",[Ce.Expired]:"Your order has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[Ce.Cancelled]:"You canceled the warrant. If there are any problems, please contact support.",[Ce.Failed]:"Your order could not be processed due to a payment or system error. Please try again or contact support.",[Ce.FullDeliveryFailure]:"Your payment was successful but the product is currently out of stock. Please contact us below to get this sorted.",[Ce.PartiallyDelivered]:"Your payment was successful but some products were out of stock. Please contact us below to get this sorted.",[Ce.Refunded]:"Your order was refunded. Please check your payment method for confirmation.",[Ce.Completed]:"Your order has successfully been processed. View your products below or check your email for additional information."},vd=()=>({[Ce.Completed]:s.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"}),[Ce.Pending]:s.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ce.New]:s.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ce.Expired]:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ce.Cancelled]:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ce.Failed]:s.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ce.FullDeliveryFailure]:s.jsx(w.Icon,{name:"Warning",fill:"var(--text-warning)"}),[Ce.PartiallyDelivered]:s.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"}),[Ce.Refunded]:s.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"})}),wd=({orderStatus:e,className:t})=>{const{shopDomain:n}=g.useStorefrontStore(),{isAntistock:r}=g.useGeneralStore(),u=g.useNavigate();return s.jsxs("div",{className:g.clx(Qt.orderStatusBlock,t,{[Qt.orderStatusBlockAntistock]:r}),children:[s.jsx("div",{className:Qt.iconWrapper,style:r?{background:"none"}:void 0,children:vd()[e]}),s.jsx("h2",{className:Qt.orderStatusTitle,children:gv[e]}),s.jsx("p",{className:Qt.orderStatusDescription,children:_v[e]}),s.jsxs("div",{className:Qt.actionButtons,children:[s.jsx("div",{className:Qt.actionButton,children:s.jsxs(w.Button,{type:"Secondary",className:Qt.button,onClick:()=>window.open(`https://${n}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[s.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),s.jsx("div",{className:Qt.actionButton,children:s.jsxs(w.Button,{type:"Secondary",className:Qt.button,onClick:()=>{r?window.open(`https://${n}/support`):u("/contact")},style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[s.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},xv="_reviewMessage_1t8u4_1",Cv="_leaveReviewContainer_1t8u4_11",Ev="_leaveReviewTitle_1t8u4_20",si={reviewMessage:xv,leaveReviewContainer:Cv,leaveReviewTitle:Ev},Ld=({review:e,orderId:t,className:n})=>{const[r,u]=P.useState((e==null?void 0:e.rating)||0),[a,i]=P.useState(!1),{setIsOpen:o}=g.useModalStore(),{notifications:c,setNotifications:l}=g.useNotificationStore(),h=async f=>{e&&"accessToken"in e&&(await h2({comment:f,rating:r,tsId:g.useGetTsId()},t,e.accessToken),l([...c,{status:"success",id:g.v4(),message:"Review left successfully"}]),i(!1))};return P.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(o(!0),i(!0))},[r]),e?e.rating&&"accessToken"in e?s.jsxs("div",{className:si.reviewMessage,children:["You left a ",e.rating," star rating"]}):s.jsxs("div",{className:g.clx(si.leaveReviewContainer,n),children:[s.jsx("p",{className:si.leaveReviewTitle,children:"Leave a review"}),s.jsx(g8,{rating:r,setRating:u,disabled:!!e.rating||!("accessToken"in e)}),a&&s.jsx(w.Modal,{close:()=>i(!1),children:s.jsx(Dd,{setIsOpen:i,onSubmit:h})})]}):null},Tv="_bottomSheet_1bcyj_1",yv="_content_1bcyj_7",kv="_title_1bcyj_18",Av="_buttonGroup_1bcyj_22",Sv="_buttonWrapper_1bcyj_33",Iv="_modal_1bcyj_37",Nv="_header_1bcyj_44",Tn={bottomSheet:Tv,content:yv,title:kv,buttonGroup:Av,buttonWrapper:Sv,modal:Iv,header:Nv},Dd=({setIsOpen:e,onSubmit:t})=>{const[n,r]=P.useState(""),{setIsOpen:u}=g.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return s.jsxs("div",{className:Tn.modal,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:Tn.header,children:[s.jsx("h3",{id:"h3",className:Tn.title,children:"Review Description"}),s.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Tn.bottomSheet,children:[s.jsx("div",{className:Tn.content,children:s.jsx(w.Textarea,{placeholder:"Great product and fast checkout...",value:n,onChange:i=>r(i),label:"Describe your review in detail below"})}),s.jsxs("div",{className:Tn.buttonGroup,children:[s.jsx("div",{className:Tn.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),s.jsx("div",{className:Tn.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",disabled:!n,onClick:()=>{a(),t(n)},children:"Submit"})})]})]})]})},vv="_container_1idhv_1",wv="_buttonGroup_1idhv_8",Lv="_buttonWrapper_1idhv_15",Dv="_header_1idhv_19",Rv="_content_1idhv_28",Vn={container:vv,buttonGroup:wv,buttonWrapper:Lv,header:Dv,content:Rv},Pv="_modal_1rkmj_1",Ov="_modalPayment_1rkmj_7",Mv="_title_1rkmj_15",Fv="_description_1rkmj_20",Ru={modal:Pv,modalPayment:Ov,title:Mv,description:Fv},Ds=()=>s.jsxs("div",{className:g.clx(Ru.modal,Ru.modalPayment),onClick:e=>e.stopPropagation(),children:[s.jsx(w.Loader,{style:{border:"4px solid var(--surface-action1)",borderLeftColor:"var(--surface-secondary)",width:"40px",height:"40px"}}),s.jsx("h2",{id:"h3",className:Ru.title,children:"Processing Payment"}),s.jsx("p",{className:Ru.description,children:"This payment is currently being processed. If you're here, it simply means that the payment was created but not complete."})]}),Rd=({setIsOpen:e})=>{const{subscription:t}=g.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:u}=nu(),[a,i]=P.useState(1),o=g.useNavigate(),{setIsOpen:c}=g.useModalStore(),{setNotifications:l,notifications:h}=g.useNotificationStore(),[f,m]=P.useState(!1),p=P.useMemo(()=>n(),[u,r]),b=P.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(f)return s.jsx(Ds,{});const x=(t==null?void 0:t.price.currency)||"USD",E=new Intl.NumberFormat("en-US",{style:"currency",currency:x});async function _(){var k;m(!0);try{const{data:D}=await o2((t==null?void 0:t.id)||"",{});l([{id:g.v4(),message:"Order created successfully",status:"success"}]),o(`/orders/${(k=D.data)==null?void 0:k.id}/${D.data.fullAccessToken}`)}catch(D){const N=D;l([...h,{id:g.v4(),message:`Order creation failed: ${N.message}`,status:"error"}]),I()}finally{m(!1)}}function I(){c(!1),setTimeout(()=>{e(!1)},300)}return s.jsxs("div",{className:Vn.container,onClick:k=>k.stopPropagation(),children:[s.jsxs("div",{className:Vn.header,children:[s.jsx("h3",{id:"h3",className:Vn.title,children:"Extend Subscription"}),s.jsx(w.Icon,{name:"X",onClick:I,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:Vn.content,children:[s.jsx(v8,{step:a,totalSteps:12,onStepChange:i,label:"How long would you like to extend your subscription for?"}),s.jsx(Cr,{formatter:E,coupon:u,total:p.total,discount:b,totalWithDiscount:p.totalWithDiscount}),s.jsxs("div",{className:Vn.buttonGroup,children:[s.jsx("div",{className:Vn.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:I,children:"Cancel"})}),s.jsx("div",{className:Vn.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",onClick:_,children:"Extend"})})]})]})]})},Bv="_bottomSheet_uw5jb_1",jv="_content_uw5jb_7",Hv="_radioGroup_uw5jb_11",Uv="_confirmation_uw5jb_26",Vv="_iconWrapper_uw5jb_33",zv="_title_uw5jb_42",$v="_message_uw5jb_48",qv="_buttonGroup_uw5jb_54",Zv="_buttonWrapper_uw5jb_64",Wv="_modal_uw5jb_68",Yv="_header_uw5jb_77",We={bottomSheet:Bv,content:jv,radioGroup:Hv,confirmation:Uv,iconWrapper:Vv,title:zv,message:$v,buttonGroup:qv,buttonWrapper:Zv,modal:Wv,header:Yv},Gv={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},Pd=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[u,a]=P.useState(0),[i,o]=P.useState(!1),[c,l]=P.useState(""),[h,f]=P.useState(""),{setIsOpen:m}=g.useModalStore(),p=async()=>{if(!c)return;o(!0);const x=await u2(n,r,{reason:c==="Other reason"?h:c});o(!1),x&&a(2)};P.useEffect(()=>{e||(a(0),l(""),f(""))},[e]);const b=()=>{m(!1),setTimeout(()=>{t(!1)},300)};return s.jsxs("div",{className:We.modal,onClick:x=>x.stopPropagation(),children:[s.jsxs("div",{className:We.header,children:[s.jsx("h3",{id:"h3",children:Gv[u]||""}),s.jsx(w.Icon,{name:"X",onClick:b,hoverable:!0,fill:"var(--text-primary)"})]}),s.jsxs("div",{className:We.content,children:[u===0&&s.jsxs("div",{className:We.bottomSheet,children:[s.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),s.jsxs("div",{className:We.radioGroup,children:[s.jsx(w.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"&&s.jsx(w.Textarea,{value:h,onChange:x=>f(x),placeholder:"Describe the reason..."})]}),s.jsxs("div",{className:We.buttonGroup,children:[s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Stay with us"})}),s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",onClick:()=>c&&a(1),disabled:!c,children:"Continue"})})]})]}),u===1&&s.jsxs("div",{className:We.bottomSheet,children:[s.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),s.jsxs("div",{className:We.buttonGroup,children:[s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Stay with us"})}),s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Primary",onClick:p,disabled:i,children:"Cancel it anyway"})})]})]}),u===2&&s.jsxs("div",{className:We.bottomSheet,children:[s.jsxs("div",{className:`${We.confirmation}`,children:[s.jsx("div",{className:We.iconWrapper,children:s.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),s.jsx("p",{className:We.title,children:"Subscription Cancelled"}),s.jsx("p",{className:We.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),s.jsx("div",{className:We.buttonGroup,children:s.jsx("div",{className:We.buttonWrapper,children:s.jsx(w.Button,{type:"Secondary",onClick:b,children:"Close"})})})]})]})]})},Xv=Object.freeze(Object.defineProperty({__proto__:null,ActivePaymentMethod:Sd,ActiveSubscriptionProduct:Id,Auth:Ji,AuthLogin:Gl,AuthModal:l0,AuthRequestOtp:Yl,CHARGE_STATUS_DESCRIPTION:pd,CHARGE_STATUS_DISPLAY_NAME:$n,CancelSubscription:Pd,CashAppVerify:xd,ChangeSubscriptionPlan:yd,ChargeBlocksRenderer:Gu,ChargeItems:_d,ChargeStatusBlock:bd,CheckoutBalancePaymentMethod:ts,CheckoutFooter:On,CheckoutHeader:oa,CheckoutItems:i0,CheckoutOperational:fd,CheckoutOrderMainData:ws,CheckoutPaymentMethod:ns,CheckoutPrices:Cr,CheckoutProduct:ca,ChoosePlanUpgradeMethod:Nd,ConnectDiscord:c0,CustomField:o0,CustomFields:s0,CustomerDashboard:m5,LeaveAReview:Ld,NoItemsBlock:ia,OpenDelivery:hd,OrderStatusBlock:wd,OrdersTable:e0,PageLoading:ZI,PageTitle:aa,Pagination:t0,PaginationWithRange:ou,PayPalFFNote:gd,PaymentMethods:rs,ProcessingPaymentModal:Ds,ReferralBlock:Xl,ReferralBlockInfo:Kl,ReferralBlockSteps:Ql,SecuredBySsl:vs,Sidebar:vl,SkeletonReferralBlock:Jl,StatItem:xt,StatusIndicator:r0,StatusVariant:Rn,SubmitReview:Dd,SubscriptionCoupon:Ad,SubscriptionExpiration:Rd,SubscriptionExpirationDate:kd,SubscriptionProduct:Td,SubscriptionStatusBadge:Ls,SubscriptionsTable:Ed,Table:sa,TableItem:Ke,TableItemTitle:Tt,TermsOfService:Ns,TicketRow:Cd,TrackPayment:Ta,getChargeStatusIcon:md,getOrderStatusIcon:vd,getPaginationText:n0},Symbol.toStringTag,{value:"Module"})),Qv="_chargePageContainer_1azbl_1",Kv="_chargeItems_1azbl_14",Jv="_mainContent_1azbl_25",ew="_contentWrapper_1azbl_44",tw="_antistockContent_1azbl_53",nw="_statusBlock_1azbl_58",rw="_statusBlockAntistock_1azbl_63",uw="_notPaidSection_1azbl_68",aw="_antistockPayNow_1azbl_82",iw="_antistockFooter_1azbl_86",sw="_antistockTrackPayment_1azbl_96",ow="_footer_1azbl_106",cw="_loaderContainer_1azbl_128",Nt={chargePageContainer:Qv,chargeItems:Kv,mainContent:Jv,contentWrapper:ew,antistockContent:tw,statusBlock:nw,statusBlockAntistock:rw,notPaidSection:uw,antistockPayNow:aw,antistockFooter:iw,antistockTrackPayment:sw,footer:ow,loaderContainer:cw},lw=()=>{const{id:e}=g.useParams(),[t,n]=g.useSearchParams(),[r,u]=P.useState(!1),[a,i]=P.useState(),[o,c]=P.useState(!0),l=g.useNavigate(),h=P.useRef(),f=P.useRef(!1),{setIsOpen:m}=g.useModalStore(),{isAntistock:p}=g.useGeneralStore();return P.useEffect(()=>{const b=async(E,_=!1)=>{_||u(!0);const{data:I}=await p2(E);u(!1),i(I)},x=setInterval(()=>{e&&b(e,!0)},5e3);return e&&b(e),()=>{clearInterval(x)}},[]),P.useEffect(()=>{const b=setTimeout(()=>{var E;console.log("charge timeout",a);const x=t.get("redirectRoute");if((a==null?void 0:a.status)===pe.Paid&&a.redirectUrl&&!h.current){const I=JSON.parse(localStorage.getItem("orders")||"{}")[((E=a==null?void 0:a.order)==null?void 0:E.id)||""];I?window.open(I.fullAccessToken?`${a.redirectUrl}/${I.fullAccessToken}`:`${a.redirectUrl}`,"_self"):window.open(a.redirectUrl,"_self")}(a==null?void 0:a.status)===pe.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(b)},[a]),P.useEffect(()=>{((a==null?void 0:a.gateway)==="PayPalFF"||(a==null?void 0:a.gateway)==="Сashapp")&&m(!0)},[a]),P.useEffect(()=>{var b;if(a!=null&&a.displayPaymentInfo&&a.displayPaymentInfo.length===1&&a.status===pe.NotPaid&&!f.current){const x=a.displayPaymentInfo[0];x.type==="Button"&&((b=x.props)!=null&&b.url)&&(window.open(x.props.url,"_blank"),f.current=!0)}},[a==null?void 0:a.displayPaymentInfo,a==null?void 0:a.status]),r?s.jsx("div",{className:Nt.loaderContainer,children:s.jsx(w.Loader,{})}):s.jsxs("div",{className:Nt.chargePageContainer,children:[s.jsx("div",{className:Nt.chargeItems,children:s.jsx(_d,{charge:a})}),s.jsx("div",{className:Nt.mainContent,style:p?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:s.jsxs("div",{className:g.clx(Nt.contentWrapper,{[Nt.antistockContent]:p}),children:[a&&(a==null?void 0:a.status)!==pe.NotPaid&&s.jsx(bd,{charge:a}),a&&s.jsxs("div",{className:g.clx(Nt.statusBlock,{[Nt.statusBlockAntistock]:p}),children:[s.jsx(ws,{lastUpdate:a.expiresAt,email:a.customerForCharge.email,invoiceId:a.id,paymentType:a.gateway}),p&&(a==null?void 0:a.status)===pe.NotPaid&&s.jsx("div",{className:Nt.antistockPayNow,children:a==null?void 0:a.displayPaymentInfo.map((b,x)=>s.jsx(Gu,{block:b},x))}),p&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Nt.antistockTrackPayment,children:s.jsx(Ta,{timeline:a.timeline})}),s.jsx(On,{className:Nt.antistockFooter})]})]}),!p&&(a==null?void 0:a.status)===pe.NotPaid&&s.jsx("div",{className:Nt.notPaidSection,children:a==null?void 0:a.displayPaymentInfo.map((b,x)=>s.jsx(Gu,{block:b},x))}),!p&&s.jsx(On,{className:Nt.footer})]})}),(a==null?void 0:a.gateway)==="PayPalFF"&&o&&s.jsx(w.Modal,{close:()=>c(!1),children:s.jsx(gd,{price:a.price,setIsOpen:c})}),(a==null?void 0:a.gateway)==="Сashapp"&&o&&s.jsx(w.Modal,{close:()=>u(!1),children:s.jsx(xd,{setIsOpen:c,chargeId:a.id})})]})},dw=Object.freeze(Object.defineProperty({__proto__:null,ChargePage:lw},Symbol.toStringTag,{value:"Module"}));exports.ActivePaymentMethod=Sd;exports.ActiveSubscriptionProduct=Id;exports.BalanceModal=Fl;exports.ChangeSubscriptionPlan=yd;exports.ChargeStatus=pe;exports.CheckoutFooter=On;exports.CheckoutHeader=oa;exports.CheckoutItems=i0;exports.CheckoutOperational=fd;exports.CheckoutOrderMainData=ws;exports.CheckoutPrices=Cr;exports.CheckoutProduct=ca;exports.LeaveAReview=Ld;exports.MarkdownText=Ki;exports.NoItemsBlock=ia;exports.OrderStatus=Ce;exports.OrderStatusBlock=wd;exports.OrdersTable=e0;exports.PageTitle=aa;exports.PaginationWithRange=ou;exports.ReCaptchaProvider=zi;exports.StableText=zc;exports.SubscriptionCoupon=Ad;exports.SubscriptionExpirationDate=kd;exports.SubscriptionProduct=Td;exports.SubscriptionsTable=Ed;exports.Table=sa;exports.TableItemTitle=Tt;exports.TicketRow=Cd;exports.TrackPayment=Ta;exports.auth=m2;exports.fetchAuthorizedOrder=e2;exports.fetchGeneral=Bd;exports.fetchOrder=Jd;exports.fetchOrders=Kd;exports.fetchPrivacyPolicy=Xd;exports.fetchRefundPolicy=Gd;exports.fetchSubscription=n2;exports.fetchSubscriptions=i2;exports.fetchTerms=Yd;exports.fetchThemeAndSettings=jd;exports.fetchTicket=c2;exports.fetchTickets=d2;exports.getBalance=Ju;exports.getBalanceSettings=nl;exports.getGatewaysDetail=uu;exports.index=Xv;exports.index$1=dw;exports.parseDraftJsText=tl;exports.recapcha=rf;exports.sendTicketMessage=l2;exports.useCart=nu;exports.useCopy=Yn;exports.useGeneralInfo=Xc;exports.useMarkdownIt=Nl;exports.useReCaptcha=ru;