@dcl/shop 0.1.0-29254964718.commit-bc79b69 → 0.1.0-29320049445.commit-d3838e0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-CYPw0X0a.js → AnimatedBackground-D8118Htr.js} +3 -3
- package/assets/{Assets-DxS2faEZ.js → Assets-C2ZyKmXZ.js} +1 -1
- package/assets/{Button-jfeZp7ca.js → Button-DTR3VbGL.js} +1 -1
- package/assets/Cart-ByEfJHct.js +1 -0
- package/assets/{CircularProgress-CPvlc7QL.js → CircularProgress-DD1sqZ1V.js} +1 -1
- package/assets/{Collection-CYi23kK5.js → Collection-C_nk8Cc9.js} +1 -1
- package/assets/{Creator-qLB6WcFI.js → Creator-DVFLJ7iH.js} +1 -1
- package/assets/{ExchangeController-V8OR0dzr.js → ExchangeController-CYJDs8Oj.js} +1 -1
- package/assets/{GetCredits-DPE-aWPu.js → GetCredits-D2iWhTcj.js} +2 -2
- package/assets/{HelpersUtil-CtIs2MhB.js → HelpersUtil-Dmv1LAz_.js} +1 -1
- package/assets/{ImportListings-40JsDT9M.js → ImportListings-DgxCofmJ.js} +1 -1
- package/assets/{ItemDetail-I6d0cFBS.js → ItemDetail-Bm_JOK-F.js} +2 -2
- package/assets/{Market-WU7aF7sI.js → Market-BCmHclZK.js} +1 -1
- package/assets/{MenuItem-w3Bac3-j.js → MenuItem-DMQM1XbL.js} +1 -1
- package/assets/{MyAssets-3d8acYU5.js → MyAssets-DymuAMH5.js} +1 -1
- package/assets/{MyFavorites-B_cD0Nva.js → MyFavorites-DWNoEFBD.js} +1 -1
- package/assets/{MyPurchases-BKjDwmLs.js → MyPurchases-D84T4Vx3.js} +1 -1
- package/assets/{NotFound-lbzVYbwO.js → NotFound-Dagrrmzl.js} +1 -1
- package/assets/{RealCheckout-B0bgjX2-.js → RealCheckout-BPBVi18T.js} +1 -1
- package/assets/{ShopFooterInner-DZ0k_kvA.js → ShopFooterInner-D-Q5vmHv.js} +2 -2
- package/assets/{Success-Dg5SGZJd.js → Success-Bxdmwj3S.js} +1 -1
- package/assets/{SvgIcon-5egtOrJ1.js → SvgIcon-tZThylOM.js} +1 -1
- package/assets/{SwapController-DGVAOKON.js → SwapController-DJiO7vRN.js} +1 -1
- package/assets/{TradeService-CFsfszzf.js → TradeService-DgGPCq3X.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-D-sA9voE.js → W3MFrameProviderSingleton-Dbmy1dzQ.js} +3 -3
- package/assets/{WebCryptoP256-Cur58MZH.js → WebCryptoP256-B6kTE1Xu.js} +1 -1
- package/assets/{basic-w3M6gfMQ.js → basic-7l7fYC0h.js} +1 -1
- package/assets/{biconomy-CYidIfsD.js → biconomy-DBc0b5BU.js} +1 -1
- package/assets/{buy-DPkdz8_j.js → buy-BHEAD_2E.js} +1 -1
- package/assets/{buy-gasless-C1f9BGN1.js → buy-gasless-GK0eCKOi.js} +1 -1
- package/assets/{ccip-tqDMgLYY.js → ccip-CDl-jxYU.js} +1 -1
- package/assets/{ccip-BVFRaXzI.js → ccip-c2nNiaqY.js} +1 -1
- package/assets/{collection-VGK84by0.js → collection-Bhqpzm3u.js} +1 -1
- package/assets/{controller-DX7HSWkP.js → controller-C30R-DIM.js} +2 -2
- package/assets/{core-BM6gIeM_.js → core-LJnxpowd.js} +4 -4
- package/assets/{custom-CsWC_84R.js → custom-B6UGmDBe.js} +1 -1
- package/assets/{data-capture-SKbYUAS8.js → data-capture-D9WXH5H8.js} +1 -1
- package/assets/{decimals-CZLlhwKd.js → decimals-DkFRQ-Q_.js} +1 -1
- package/assets/decimals-cRl2SfGL.js +1 -0
- package/assets/{detectExtension-BZ2-93E_.js → detectExtension-4_-wEfA1.js} +1 -1
- package/assets/{email-DDSeTNsL.js → email-DT71RWlD.js} +1 -1
- package/assets/{embedded-wallet-Brrr_aoM.js → embedded-wallet-CnpQ49jF.js} +1 -1
- package/assets/{engine-BFbHnKUR.js → engine-CkMo1RZI.js} +1 -1
- package/assets/{estimate-l1-fee-C-ypH83W.js → estimate-l1-fee-CTa3ECEH.js} +1 -1
- package/assets/{eth_estimateGas-DoUbiXjX.js → eth_estimateGas-BvtsPWax.js} +1 -1
- package/assets/{eth_getStorageAt-XRojRAyD.js → eth_getStorageAt-BqgsPxL7.js} +1 -1
- package/assets/{eth_getTransactionCount-CKTG58Gl.js → eth_getTransactionCount-UCfyAFdB.js} +1 -1
- package/assets/{extractIPFS-CUFJqgxI.js → extractIPFS-DG4t5PYk.js} +1 -1
- package/assets/{features-TNRzfRjw.js → features-CR2fovuQ.js} +1 -1
- package/assets/{fetchTokenMetadata-CFrMm1kS.js → fetchTokenMetadata-Bg_2ndT9.js} +2 -2
- package/assets/{generateUtilityClasses-fINIb8L-.js → generateUtilityClasses-DSb5S1QX.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-nffk7j4l.js → get-ecosystem-wallet-info-7MvFWG3H.js} +1 -1
- package/assets/{getBalance-BSwMlOG5.js → getBalance-DnZeONhO.js} +1 -1
- package/assets/{getInstalledModules-DqnNZrIl.js → getInstalledModules-65CrTBh9.js} +1 -1
- package/assets/{getNFT-D5RLr30P.js → getNFT-BjPgXKEk.js} +2 -2
- package/assets/{getNFT-CsNxud4l.js → getNFT-h_6lgu6L.js} +1 -1
- package/assets/{hashTypedData-BUM2UbU8.js → hashTypedData-CCHlVdPD.js} +1 -1
- package/assets/{hashTypedData-DOlGWBor.js → hashTypedData-DwIjbbFX.js} +1 -1
- package/assets/{import-Bvvecx-a.js → import-BNRuToyt.js} +1 -1
- package/assets/{in-app-wallet-calls-BwsYr0X-.js → in-app-wallet-calls-Cld5eU_A.js} +1 -1
- package/assets/{index-Dya1qtKt.js → index-43SQdDEL.js} +1 -1
- package/assets/{index-DkYuWNYd.js → index-B4yA2d4S.js} +1 -1
- package/assets/{index-BlUhpggc.js → index-B9JYyJt0.js} +1 -1
- package/assets/{index-Dhamn116.js → index-B9otq3-q.js} +1 -1
- package/assets/{index-BN16ZkhT.js → index-BM9edklV.js} +1 -1
- package/assets/{index-93I3rDvn.js → index-BO4n841H.js} +1 -1
- package/assets/{index-1W4ke6tk.js → index-BXIzYIxO.js} +1 -1
- package/assets/{index-Dn_nS3H8.js → index-BYTiU9Rp.js} +1 -1
- package/assets/{index-DGI8RsK5.js → index-BjO3oOvS.js} +1 -1
- package/assets/{index-BsGtBIbY.js → index-Bm82Ysu0.js} +1 -1
- package/assets/{index-C8v4sBkt.js → index-BoZzNw20.js} +1 -1
- package/assets/{index-DoV0ZXV-.js → index-C3aicU78.js} +1 -1
- package/assets/{index-DGb0-PGf.js → index-C9Ow-yaN.js} +1 -1
- package/assets/{index-y18oYnpV.js → index-CIusyvIU.js} +1 -1
- package/assets/{index-pBIbi3sY.js → index-CPDRsZny.js} +1 -1
- package/assets/{index-DQUQfZyN.js → index-CU3vhHNi.js} +1 -1
- package/assets/index-CVXtX0PM.css +1 -0
- package/assets/{index-DBgz21lR.js → index-CXZsKw11.js} +1 -1
- package/assets/{index-CKP5tgqu.js → index-CZTmTVEQ.js} +1 -1
- package/assets/{index-5E4Qxuys.js → index-C_4va4PR.js} +1 -1
- package/assets/{index-BWkZgiPu.js → index-CbEdOCMv.js} +1 -1
- package/assets/{index-BGEefTl2.js → index-CcZDN6xB.js} +2 -2
- package/assets/{index-BHQVkrbu.js → index-Cft6bDRc.js} +1 -1
- package/assets/{index-xfTQqZlI.js → index-CjG_diaY.js} +1 -1
- package/assets/{index-DT_ZoznA.js → index-Ck_cpbFj.js} +1 -1
- package/assets/{index-Dyy2Vrl8.js → index-Cs5GUEVq.js} +1 -1
- package/assets/{index-SmBWdodi.js → index-CtR0-kMd.js} +1 -1
- package/assets/{index-UZsYrJpx.js → index-CulD7anc.js} +1 -1
- package/assets/{index-DYWK8g8J.js → index-D023IJZK.js} +1 -1
- package/assets/{index-B9e3yQ39.js → index-D0TpMfsd.js} +3 -3
- package/assets/{index-OpBhEJ0O.js → index-D2Um9ObU.js} +6 -6
- package/assets/{index-ByRL-K0O.js → index-D2ssp5zB.js} +1 -1
- package/assets/{index-CIsmu4yZ.js → index-D5ovRFW1.js} +1 -1
- package/assets/{index-C5yBkdsj.js → index-D7WQVMSv.js} +1 -1
- package/assets/{index-NmDgDGPG.js → index-DDnN1pDK.js} +1 -1
- package/assets/{index-CK_w5rE-.js → index-DJkr6-xO.js} +1 -1
- package/assets/{index-CRJchE0b.js → index-DS1pL6HC.js} +2 -2
- package/assets/{index-DkRoZ1kn.js → index-DV2FazaP.js} +1 -1
- package/assets/{index-BPZXZd4b.js → index-DVgPI-6N.js} +3 -3
- package/assets/{index-5FJu7_pQ.js → index-DbxqT7m7.js} +1 -1
- package/assets/{index-BzNrbFS5.js → index-Dhu-Bz2t.js} +1 -1
- package/assets/{index-CaT4Yoza.js → index-DlFHQdDu.js} +1 -1
- package/assets/{index-D2VoAnKZ.js → index-DlIuq6jd.js} +1 -1
- package/assets/{index-C-zOuzFt.js → index-Dp-cLS48.js} +1 -1
- package/assets/{index-DOxmIwh4.js → index-DwjnQBsE.js} +1 -1
- package/assets/{index-w4da2I_c.js → index-MrwyliNz.js} +2 -2
- package/assets/{index-rziIJjT3.js → index-NDhRRKT0.js} +1 -1
- package/assets/{index-CBp1JvML.js → index-PU6jeNmW.js} +1 -1
- package/assets/{index-BAVs-li0.js → index-QO5cp5L-.js} +1 -1
- package/assets/{index-BLs4FXiR.js → index-_GZQRFwL.js} +1 -1
- package/assets/{index-Cccog_Wr.js → index-muhwH55r.js} +1 -1
- package/assets/{index-CVEtsrwz.js → index-phORwTpP.js} +1 -1
- package/assets/{index-CrAp-Hqd.js → index-puVzLhO-.js} +1 -1
- package/assets/{index-CdglnCaM.js → index-yRkC3DTj.js} +1 -1
- package/assets/{index.es-Bz88joRt.js → index.es-7yHE63Mr.js} +1 -1
- package/assets/{index.es-WVKi35_9.js → index.es-CueCtv_n.js} +4 -4
- package/assets/{index.es-B2m0dGuK.js → index.es-DB_hWcoD.js} +1 -1
- package/assets/{localBatchGatewayRequest-Dx1Ngoiv.js → localBatchGatewayRequest-QP4WJriF.js} +1 -1
- package/assets/{mana-rate-BwWfDtJA.js → mana-rate-4QXh_m-p.js} +1 -1
- package/assets/network-BEMFiHk7.js +1 -0
- package/assets/{networks-DV6L3hZH.js → networks-4YuiRyg1.js} +1 -1
- package/assets/{onramp-BgQ1VTr3.js → onramp-CfVtNvjp.js} +1 -1
- package/assets/{openzeppelin-d5g8gt6k.js → openzeppelin-DbBDC_N5.js} +1 -1
- package/assets/{ownerOf-mSbNpFEc.js → ownerOf-D6amIBsC.js} +1 -1
- package/assets/{parseNft-BqTY16Sh.js → parseNft-CQR7wXZj.js} +2 -2
- package/assets/{parseSignature-DED62W1Z.js → parseSignature-DtN7Da1u.js} +1 -1
- package/assets/{parseSignature-DDoIdVmZ.js → parseSignature-F_Me7mom.js} +3 -3
- package/assets/{pay-with-exchange-DtygapAt.js → pay-with-exchange-B7Bd4iqa.js} +1 -1
- package/assets/{qr-overlay-BsnSx594.js → qr-overlay-pL8q4T1-.js} +1 -1
- package/assets/{receive-Bk_Y4nir.js → receive-FovoUesq.js} +1 -1
- package/assets/{resolveImplementation-2cqTuYY3.js → resolveImplementation-C1IpJeNu.js} +1 -1
- package/assets/{rpc-C-_3TTfR.js → rpc-YG6onxrm.js} +1 -1
- package/assets/{secp256k1-DTGkWTQZ.js → secp256k1-B9ML4WoL.js} +1 -1
- package/assets/{secp256k1-B6m_r9vE.js → secp256k1-CsTtoxbp.js} +1 -1
- package/assets/{secp256k1-DJm7cf-B.js → secp256k1-VNwS2fdz.js} +1 -1
- package/assets/{send-CtZgL8WM.js → send-BLug7buc.js} +1 -1
- package/assets/{send-batch-transaction-D0n9dziL.js → send-batch-transaction-D1H56wSe.js} +1 -1
- package/assets/{send-eip712-transaction-BZIS831Y.js → send-eip712-transaction-CUHLn_sU.js} +2 -2
- package/assets/{send-gasless-transaction-DApNUzAF.js → send-gasless-transaction-CLN4cYEo.js} +2 -2
- package/assets/{sendRawTransaction-BoQdixC3.js → sendRawTransaction-BVMWM3X5.js} +3 -3
- package/assets/{serializeTransaction-DN1RjM-F.js → serializeTransaction-B3e8UzRs.js} +1 -1
- package/assets/{session-proposal-BjuHQlqy.js → session-proposal-DoNCD8tP.js} +1 -1
- package/assets/{session-request-BYnkRq1D.js → session-request-BIQg2USj.js} +2 -2
- package/assets/{sha256-S4mPKaQu.js → sha256-CuKLjWGp.js} +1 -1
- package/assets/{signing-DCH_IdFq.js → signing-C2a0H4MH.js} +4 -4
- package/assets/{socials-BoDTcCP1.js → socials-CqruJPTX.js} +1 -1
- package/assets/{swaps-CZEay7rk.js → swaps-Boy2RZ8W.js} +1 -1
- package/assets/{thirdweb-C7C9bpXy.js → thirdweb-BwuJg2dB.js} +3 -3
- package/assets/{totalSupply-CZT7CnUl.js → totalSupply-DeWMSbxB.js} +1 -1
- package/assets/{transactionReceipt-h0CSeAi-.js → transactionReceipt-BP7XUN1R.js} +1 -1
- package/assets/{transactions-CbcysK7b.js → transactions-DbQedYU2.js} +1 -1
- package/assets/{useInfiniteGrid-DcPmkTvS.js → useInfiniteGrid-DX5h-FPW.js} +1 -1
- package/assets/{verifyHash-D30bdle-.js → verifyHash-CzgVP6Sw.js} +1 -1
- package/assets/{w3m-modal-YGSU7pfJ.js → w3m-modal-CBdScIhk.js} +1 -1
- package/assets/{w3m-modal-DKot6AnX.js → w3m-modal-CmETWGlc.js} +1 -1
- package/assets/{wait-for-tx-receipt-Dx_eJJVk.js → wait-for-tx-receipt-Du4irykF.js} +1 -1
- package/assets/{wallet-kind-8FEv-QVA.js → wallet-kind-ChVeEHHr.js} +1 -1
- package/assets/{wallets-C58TNTZv.js → wallets-DesBSEpy.js} +6 -6
- package/assets/{web-connector-BLGVIwAD.js → web-connector-m9S9GTf8.js} +3 -3
- package/assets/{writeContract-DvcMEQyV.js → writeContract-DOpwxqRR.js} +1 -1
- package/assets/{zoraTestnet-B_y-7tzp.js → zoraTestnet-BTa64jfE.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/Cart-D-1Cw1Sr.js +0 -1
- package/assets/decimals-Dx-ayJ8g.js +0 -1
- package/assets/index-MNMpVtqO.css +0 -1
- package/assets/network-Ecp55o0j.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
var kD=Object.defineProperty;var HE=e=>{throw TypeError(e)};var UD=(e,t,r)=>t in e?kD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Yn=(e,t,r)=>UD(e,typeof t!="symbol"?t+"":t,r),Ed=(e,t,r)=>t.has(e)||HE("Cannot "+r);var ue=(e,t,r)=>(Ed(e,t,"read from private field"),r?r.call(e):t.get(e)),We=(e,t,r)=>t.has(e)?HE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),je=(e,t,r,n)=>(Ed(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),rt=(e,t,r)=>(Ed(e,t,"access private method"),r);var Yu=(e,t,r,n)=>({set _(i){je(e,t,i,r)},get _(){return ue(e,t,n)}});import{r as De,j as J,l as zO,g as WO,R as YO,c as sg,L as Oo,a as c_,m as xn,d as FD,n as HD,o as dr,N as VD,p as GD,B as zD}from"./react-Vu6nbGi5.js";import{g as Sl,p as yl,W as WD,m as YD,h as VE,f as xO}from"./ethers-JeCAM1sd.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Vo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Qi,ei,Wa,LO,xD=(LO=class extends Vo{constructor(){super();We(this,Qi);We(this,ei);We(this,Wa);je(this,Wa,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){ue(this,ei)||this.setEventListener(ue(this,Wa))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,ei))==null||t.call(this),je(this,ei,void 0))}setEventListener(t){var r;je(this,Wa,t),(r=ue(this,ei))==null||r.call(this),je(this,ei,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){ue(this,Qi)!==t&&(je(this,Qi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof ue(this,Qi)=="boolean"?ue(this,Qi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Qi=new WeakMap,ei=new WeakMap,Wa=new WeakMap,LO),l_=new xD,KD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ti,u_,$O,XD=($O=class{constructor(){We(this,ti,KD);We(this,u_,!1)}setTimeoutProvider(e){je(this,ti,e)}setTimeout(e,t){return ue(this,ti).setTimeout(e,t)}clearTimeout(e){ue(this,ti).clearTimeout(e)}setInterval(e,t){return ue(this,ti).setInterval(e,t)}clearInterval(e){ue(this,ti).clearInterval(e)}},ti=new WeakMap,u_=new WeakMap,$O),Ji=new XD;function JD(e){setTimeout(e,0)}var QD=typeof window>"u"||"Deno"in globalThis;function Sr(){}function ZD(e,t){return typeof e=="function"?e(t):e}function og(e){return typeof e=="number"&&e>=0&&e!==1/0}function KO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ui(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function GE(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:s,stale:o}=e;if(s){if(n){if(t.queryHash!==d_(s,t.options))return!1}else if(!Po(t.queryKey,s))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||a&&!a(t))}function zE(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(No(t.options.mutationKey)!==No(a))return!1}else if(!Po(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function d_(e,t){return((t==null?void 0:t.queryKeyHashFn)||No)(e)}function No(e){return JSON.stringify(e,(t,r)=>cg(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Po(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Po(e[r],t[r])):!1}var ej=Object.prototype.hasOwnProperty;function XO(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=WE(e)&&WE(t);if(!n&&!(cg(e)&&cg(t)))return t;const a=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,u=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c],p=e[d],f=t[d];if(p===f){u[d]=p,(n?c<a:ej.call(e,d))&&l++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){u[d]=f;continue}const _=XO(p,f,r+1);u[d]=_,_===p&&l++}return a===o&&l===a?e:u}function ug(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function WE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cg(e){if(!YE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!YE(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function YE(e){return Object.prototype.toString.call(e)==="[object Object]"}function tj(e){return new Promise(t=>{Ji.setTimeout(t,e)})}function lg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?XO(e,t):t}function n6(e){return e}function rj(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function nj(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var f_=Symbol();function JO(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===f_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function QO(e,t){return typeof e=="function"?e(...t):!!e}function ij(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Co=(()=>{let e=()=>QD;return{isServer(){return e()},setIsServer(t){e=t}}})();function dg(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var aj=JD;function sj(){let e=[],t=0,r=o=>{o()},n=o=>{o()},i=aj;const a=o=>{t?e.push(o):i(()=>{r(o)})},s=()=>{const o=e;e=[],o.length&&i(()=>{n(()=>{o.forEach(u=>{r(u)})})})};return{batch:o=>{let u;t++;try{u=o()}finally{t--,t||s()}return u},batchCalls:o=>(...u)=>{a(()=>{o(...u)})},schedule:a,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var Zt=sj(),Ya,ri,xa,qO,oj=(qO=class extends Vo{constructor(){super();We(this,Ya,!0);We(this,ri);We(this,xa);je(this,xa,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){ue(this,ri)||this.setEventListener(ue(this,xa))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,ri))==null||t.call(this),je(this,ri,void 0))}setEventListener(t){var r;je(this,xa,t),(r=ue(this,ri))==null||r.call(this),je(this,ri,t(this.setOnline.bind(this)))}setOnline(t){ue(this,Ya)!==t&&(je(this,Ya,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return ue(this,Ya)}},Ya=new WeakMap,ri=new WeakMap,xa=new WeakMap,qO),Il=new oj;function uj(e){return Math.min(1e3*2**e,3e4)}function ZO(e){return(e??"online")==="online"?Il.isOnline():!0}var fg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function eN(e){let t=!1,r=0,n;const i=dg(),a=()=>i.status!=="pending",s=R=>{var w;if(!a()){const O=new fg(R);p(O),(w=e.onCancel)==null||w.call(e,O)}},o=()=>{t=!0},u=()=>{t=!1},l=()=>l_.isFocused()&&(e.networkMode==="always"||Il.isOnline())&&e.canRun(),c=()=>ZO(e.networkMode)&&e.canRun(),d=R=>{a()||(n==null||n(),i.resolve(R))},p=R=>{a()||(n==null||n(),i.reject(R))},f=()=>new Promise(R=>{var w;n=O=>{(a()||l())&&R(O)},(w=e.onPause)==null||w.call(e)}).then(()=>{var R;n=void 0,a()||(R=e.onContinue)==null||R.call(e)}),_=()=>{if(a())return;let R;const w=r===0?e.initialPromise:void 0;try{R=w??e.fn()}catch(O){R=Promise.reject(O)}Promise.resolve(R).then(d).catch(O=>{var v;if(a())return;const h=e.retry??(Co.isServer()?0:3),T=e.retryDelay??uj,b=typeof T=="function"?T(r,O):T,m=h===!0||typeof h=="number"&&r<h||typeof h=="function"&&h(r,O);if(t||!m){p(O);return}r++,(v=e.onFail)==null||v.call(e,r,O),tj(b).then(()=>l()?void 0:f()).then(()=>{t?p(O):_()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(n==null||n(),i),cancelRetry:o,continueRetry:u,canStart:c,start:()=>(c()?_():f().then(_),i)}}var Zi,BO,tN=(BO=class{constructor(){We(this,Zi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),og(this.gcTime)&&je(this,Zi,Ji.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Co.isServer()?1/0:300*1e3))}clearGcTimeout(){ue(this,Zi)!==void 0&&(Ji.clearTimeout(ue(this,Zi)),je(this,Zi,void 0))}},Zi=new WeakMap,BO);function cj(e){return{onFetch:(t,r)=>{var c,d,p,f,_;const n=t.options,i=(p=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,a=((f=t.state.data)==null?void 0:f.pages)||[],s=((_=t.state.data)==null?void 0:_.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const l=async()=>{let R=!1;const w=T=>{ij(T,()=>t.signal,()=>R=!0)},O=JO(t.options,t.fetchOptions),h=async(T,b,m)=>{if(R)return Promise.reject(t.signal.reason);if(b==null&&T.pages.length)return Promise.resolve(T);const A=(()=>{const Y={client:t.client,queryKey:t.queryKey,pageParam:b,direction:m?"backward":"forward",meta:t.options.meta};return w(Y),Y})(),P=await O(A),{maxPages:q}=t.options,z=m?nj:rj;return{pages:z(T.pages,P,q),pageParams:z(T.pageParams,b,q)}};if(i&&a.length){const T=i==="backward",b=T?rN:pg,m={pages:a,pageParams:s},v=b(n,m);o=await h(m,v,T)}else{const T=e??a.length;do{const b=u===0?s[0]??n.initialPageParam:pg(n,o);if(u>0&&b==null)break;o=await h(o,b),u++}while(u<T)}return o};t.options.persister?t.fetchFn=()=>{var R,w;return(w=(R=t.options).persister)==null?void 0:w.call(R,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function pg(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function rN(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function i6(e,t){return t?pg(e,t)!=null:!1}function a6(e,t){return!t||!e.getPreviousPageParam?!1:rN(e,t)!=null}var Ka,ea,Xa,jr,ta,xt,Bo,ra,Pr,nN,Ln,kO,lj=(kO=class extends tN{constructor(t){super();We(this,Pr);We(this,Ka);We(this,ea);We(this,Xa);We(this,jr);We(this,ta);We(this,xt);We(this,Bo);We(this,ra);je(this,ra,!1),je(this,Bo,t.defaultOptions),this.setOptions(t.options),this.observers=[],je(this,ta,t.client),je(this,jr,ue(this,ta).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,ea,KE(this.options)),this.state=t.state??ue(this,ea),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,Ka)}get promise(){var t;return(t=ue(this,xt))==null?void 0:t.promise}setOptions(t){if(this.options={...ue(this,Bo),...t},t!=null&&t._type&&je(this,Ka,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=KE(this.options);r.data!==void 0&&(this.setState(xE(r.data,r.dataUpdatedAt)),je(this,ea,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,jr).remove(this)}setData(t,r){const n=lg(this.state.data,t,this.options);return rt(this,Pr,Ln).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){rt(this,Pr,Ln).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=ue(this,xt))==null?void 0:n.promise;return(i=ue(this,xt))==null||i.cancel(t),r?r.then(Sr).catch(Sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,ea)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===f_||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ui(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!KO(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=ue(this,xt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=ue(this,xt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ue(this,jr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(ue(this,xt)&&(ue(this,ra)||rt(this,Pr,nN).call(this)?ue(this,xt).cancel({revert:!0}):ue(this,xt).cancelRetry()),this.scheduleGc()),ue(this,jr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||rt(this,Pr,Ln).call(this,{type:"invalidate"})}async fetch(t,r){var l,c,d,p,f,_,R,w,O,h,T;if(this.state.fetchStatus!=="idle"&&((l=ue(this,xt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(ue(this,xt))return ue(this,xt).continueRetry(),ue(this,xt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(m=>m.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(je(this,ra,!0),n.signal)})},a=()=>{const b=JO(this.options,r),v=(()=>{const A={client:ue(this,ta),queryKey:this.queryKey,meta:this.meta};return i(A),A})();return je(this,ra,!1),this.options.persister?this.options.persister(b,v,this):b(v)},o=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:ue(this,ta),state:this.state,fetchFn:a};return i(b),b})(),u=ue(this,Ka)==="infinite"?cj(this.options.pages):this.options.behavior;u==null||u.onFetch(o,this),je(this,Xa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&rt(this,Pr,Ln).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta}),je(this,xt,eN({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:b=>{b instanceof fg&&b.revert&&this.setState({...ue(this,Xa),fetchStatus:"idle"}),n.abort()},onFail:(b,m)=>{rt(this,Pr,Ln).call(this,{type:"failed",failureCount:b,error:m})},onPause:()=>{rt(this,Pr,Ln).call(this,{type:"pause"})},onContinue:()=>{rt(this,Pr,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const b=await ue(this,xt).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(f=(p=ue(this,jr).config).onSuccess)==null||f.call(p,b,this),(R=(_=ue(this,jr).config).onSettled)==null||R.call(_,b,this.state.error,this),b}catch(b){if(b instanceof fg){if(b.silent)return ue(this,xt).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw rt(this,Pr,Ln).call(this,{type:"error",error:b}),(O=(w=ue(this,jr).config).onError)==null||O.call(w,b,this),(T=(h=ue(this,jr).config).onSettled)==null||T.call(h,this.state.data,b,this),b}finally{this.scheduleGc()}}},Ka=new WeakMap,ea=new WeakMap,Xa=new WeakMap,jr=new WeakMap,ta=new WeakMap,xt=new WeakMap,Bo=new WeakMap,ra=new WeakMap,Pr=new WeakSet,nN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ln=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...iN(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...xE(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return je(this,Xa,t.manual?i:void 0),i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Zt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),ue(this,jr).notify({query:this,type:"updated",action:t})})},kO);function iN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function xE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function KE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Tr,st,ko,pr,na,Ja,Bn,ni,Uo,Qa,Za,ia,aa,ii,es,_t,Qs,mg,hg,yg,gg,_g,Eg,vg,aN,UO,dj=(UO=class extends Vo{constructor(t,r){super();We(this,_t);We(this,Tr);We(this,st);We(this,ko);We(this,pr);We(this,na);We(this,Ja);We(this,Bn);We(this,ni);We(this,Uo);We(this,Qa);We(this,Za);We(this,ia);We(this,aa);We(this,ii);We(this,es,new Set);this.options=r,je(this,Tr,t),je(this,ni,null),je(this,Bn,dg()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,st).addObserver(this),XE(ue(this,st),this.options)?rt(this,_t,Qs).call(this):this.updateResult(),rt(this,_t,gg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bg(ue(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bg(ue(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,rt(this,_t,_g).call(this),rt(this,_t,Eg).call(this),ue(this,st).removeObserver(this)}setOptions(t){const r=this.options,n=ue(this,st);if(this.options=ue(this,Tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,ue(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");rt(this,_t,vg).call(this),ue(this,st).setOptions(this.options),r._defaulted&&!ug(this.options,r)&&ue(this,Tr).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,st),observer:this});const i=this.hasListeners();i&&JE(ue(this,st),n,this.options,r)&&rt(this,_t,Qs).call(this),this.updateResult(),i&&(ue(this,st)!==n||Cr(this.options.enabled,ue(this,st))!==Cr(r.enabled,ue(this,st))||ui(this.options.staleTime,ue(this,st))!==ui(r.staleTime,ue(this,st)))&&rt(this,_t,mg).call(this);const a=rt(this,_t,hg).call(this);i&&(ue(this,st)!==n||Cr(this.options.enabled,ue(this,st))!==Cr(r.enabled,ue(this,st))||a!==ue(this,ii))&&rt(this,_t,yg).call(this,a)}getOptimisticResult(t){const r=ue(this,Tr).getQueryCache().build(ue(this,Tr),t),n=this.createResult(r,t);return pj(this,n)&&(je(this,pr,n),je(this,Ja,this.options),je(this,na,ue(this,st).state)),n}getCurrentResult(){return ue(this,pr)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ue(this,Bn).status==="pending"&&ue(this,Bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){ue(this,es).add(t)}getCurrentQuery(){return ue(this,st)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=ue(this,Tr).defaultQueryOptions(t),n=ue(this,Tr).getQueryCache().build(ue(this,Tr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return rt(this,_t,Qs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,pr)))}createResult(t,r){var q;const n=ue(this,st),i=this.options,a=ue(this,pr),s=ue(this,na),o=ue(this,Ja),l=t!==n?t.state:ue(this,ko),{state:c}=t;let d={...c},p=!1,f;if(r._optimisticResults){const z=this.hasListeners(),Y=!z&&XE(t,r),W=z&&JE(t,n,r,i);(Y||W)&&(d={...d,...iN(c.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:R,status:w}=d;f=d.data;let O=!1;if(r.placeholderData!==void 0&&f===void 0&&w==="pending"){let z;a!=null&&a.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(z=a.data,O=!0):z=typeof r.placeholderData=="function"?r.placeholderData((q=ue(this,Za))==null?void 0:q.state.data,ue(this,Za)):r.placeholderData,z!==void 0&&(w="success",f=lg(a==null?void 0:a.data,z,r),p=!0)}if(r.select&&f!==void 0&&!O)if(a&&f===(s==null?void 0:s.data)&&r.select===ue(this,Uo))f=ue(this,Qa);else try{je(this,Uo,r.select),f=r.select(f),f=lg(a==null?void 0:a.data,f,r),je(this,Qa,f),je(this,ni,null)}catch(z){je(this,ni,z)}ue(this,ni)&&(_=ue(this,ni),f=ue(this,Qa),R=Date.now(),w="error");const h=d.fetchStatus==="fetching",T=w==="pending",b=w==="error",m=T&&h,v=f!==void 0,P={status:w,fetchStatus:d.fetchStatus,isPending:T,isSuccess:w==="success",isError:b,isInitialLoading:m,isLoading:m,data:f,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:R,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:h,isRefetching:h&&!T,isLoadingError:b&&!v,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:b&&v,isStale:p_(t,r),refetch:this.refetch,promise:ue(this,Bn),isEnabled:Cr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=P.data!==void 0,Y=P.status==="error"&&!z,W=ce=>{Y?ce.reject(P.error):z&&ce.resolve(P.data)},U=()=>{const ce=je(this,Bn,P.promise=dg());W(ce)},F=ue(this,Bn);switch(F.status){case"pending":t.queryHash===n.queryHash&&W(F);break;case"fulfilled":(Y||P.data!==F.value)&&U();break;case"rejected":(!Y||P.error!==F.reason)&&U();break}}return P}updateResult(){const t=ue(this,pr),r=this.createResult(ue(this,st),this.options);if(je(this,na,ue(this,st).state),je(this,Ja,this.options),ue(this,na).data!==void 0&&je(this,Za,ue(this,st)),ug(r,t))return;je(this,pr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,es).size)return!0;const s=new Set(a??ue(this,es));return this.options.throwOnError&&s.add("error"),Object.keys(ue(this,pr)).some(o=>{const u=o;return ue(this,pr)[u]!==t[u]&&s.has(u)})};rt(this,_t,aN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&rt(this,_t,gg).call(this)}},Tr=new WeakMap,st=new WeakMap,ko=new WeakMap,pr=new WeakMap,na=new WeakMap,Ja=new WeakMap,Bn=new WeakMap,ni=new WeakMap,Uo=new WeakMap,Qa=new WeakMap,Za=new WeakMap,ia=new WeakMap,aa=new WeakMap,ii=new WeakMap,es=new WeakMap,_t=new WeakSet,Qs=function(t){rt(this,_t,vg).call(this);let r=ue(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Sr)),r},mg=function(){rt(this,_t,_g).call(this);const t=ui(this.options.staleTime,ue(this,st));if(Co.isServer()||ue(this,pr).isStale||!og(t))return;const n=KO(ue(this,pr).dataUpdatedAt,t)+1;je(this,ia,Ji.setTimeout(()=>{ue(this,pr).isStale||this.updateResult()},n))},hg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,st)):this.options.refetchInterval)??!1},yg=function(t){rt(this,_t,Eg).call(this),je(this,ii,t),!(Co.isServer()||Cr(this.options.enabled,ue(this,st))===!1||!og(ue(this,ii))||ue(this,ii)===0)&&je(this,aa,Ji.setInterval(()=>{(this.options.refetchIntervalInBackground||l_.isFocused())&&rt(this,_t,Qs).call(this)},ue(this,ii)))},gg=function(){rt(this,_t,mg).call(this),rt(this,_t,yg).call(this,rt(this,_t,hg).call(this))},_g=function(){ue(this,ia)!==void 0&&(Ji.clearTimeout(ue(this,ia)),je(this,ia,void 0))},Eg=function(){ue(this,aa)!==void 0&&(Ji.clearInterval(ue(this,aa)),je(this,aa,void 0))},vg=function(){const t=ue(this,Tr).getQueryCache().build(ue(this,Tr),this.options);if(t===ue(this,st))return;const r=ue(this,st);je(this,st,t),je(this,ko,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},aN=function(t){Zt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(ue(this,pr))}),ue(this,Tr).getQueryCache().notify({query:ue(this,st),type:"observerResultsUpdated"})})},UO);function fj(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Cr(t.retryOnMount,e)===!1)}function XE(e,t){return fj(e,t)||e.state.data!==void 0&&bg(e,t,t.refetchOnMount)}function bg(e,t,r){if(Cr(t.enabled,e)!==!1&&ui(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&p_(e,t)}return!1}function JE(e,t,r,n){return(e!==t||Cr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&p_(e,r)}function p_(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(ui(t.staleTime,e))}function pj(e,t){return!ug(e.getCurrentResult(),t)}var Fo,hn,ur,sa,yn,Jn,FO,mj=(FO=class extends tN{constructor(t){super();We(this,yn);We(this,Fo);We(this,hn);We(this,ur);We(this,sa);je(this,Fo,t.client),this.mutationId=t.mutationId,je(this,ur,t.mutationCache),je(this,hn,[]),this.state=t.state||hj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ue(this,hn).includes(t)||(ue(this,hn).push(t),this.clearGcTimeout(),ue(this,ur).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,hn,ue(this,hn).filter(r=>r!==t)),this.scheduleGc(),ue(this,ur).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ue(this,hn).length||(this.state.status==="pending"?this.scheduleGc():ue(this,ur).remove(this))}continue(){var t;return((t=ue(this,sa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,u,l,c,d,p,f,_,R,w,O,h,T,b,m,v,A;const r=()=>{rt(this,yn,Jn).call(this,{type:"continue"})},n={client:ue(this,Fo),meta:this.options.meta,mutationKey:this.options.mutationKey};je(this,sa,eN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(P,q)=>{rt(this,yn,Jn).call(this,{type:"failed",failureCount:P,error:q})},onPause:()=>{rt(this,yn,Jn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,ur).canRun(this)}));const i=this.state.status==="pending",a=!ue(this,sa).canStart();try{if(i)r();else{rt(this,yn,Jn).call(this,{type:"pending",variables:t,isPaused:a}),ue(this,ur).config.onMutate&&await ue(this,ur).config.onMutate(t,this,n);const q=await((o=(s=this.options).onMutate)==null?void 0:o.call(s,t,n));q!==this.state.context&&rt(this,yn,Jn).call(this,{type:"pending",context:q,variables:t,isPaused:a})}const P=await ue(this,sa).start();return await((l=(u=ue(this,ur).config).onSuccess)==null?void 0:l.call(u,P,t,this.state.context,this,n)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,P,t,this.state.context,n)),await((f=(p=ue(this,ur).config).onSettled)==null?void 0:f.call(p,P,null,this.state.variables,this.state.context,this,n)),await((R=(_=this.options).onSettled)==null?void 0:R.call(_,P,null,t,this.state.context,n)),rt(this,yn,Jn).call(this,{type:"success",data:P}),P}catch(P){try{await((O=(w=ue(this,ur).config).onError)==null?void 0:O.call(w,P,t,this.state.context,this,n))}catch(q){Promise.reject(q)}try{await((T=(h=this.options).onError)==null?void 0:T.call(h,P,t,this.state.context,n))}catch(q){Promise.reject(q)}try{await((m=(b=ue(this,ur).config).onSettled)==null?void 0:m.call(b,void 0,P,this.state.variables,this.state.context,this,n))}catch(q){Promise.reject(q)}try{await((A=(v=this.options).onSettled)==null?void 0:A.call(v,void 0,P,t,this.state.context,n))}catch(q){Promise.reject(q)}throw rt(this,yn,Jn).call(this,{type:"error",error:P}),P}finally{ue(this,ur).runNext(this)}}},Fo=new WeakMap,hn=new WeakMap,ur=new WeakMap,sa=new WeakMap,yn=new WeakSet,Jn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Zt.batch(()=>{ue(this,hn).forEach(n=>{n.onMutationUpdate(t)}),ue(this,ur).notify({mutation:this,type:"updated",action:t})})},FO);function hj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var kn,xr,Ho,HO,yj=(HO=class extends Vo{constructor(t={}){super();We(this,kn);We(this,xr);We(this,Ho);this.config=t,je(this,kn,new Set),je(this,xr,new Map),je(this,Ho,0)}build(t,r,n){const i=new mj({client:t,mutationCache:this,mutationId:++Yu(this,Ho)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){ue(this,kn).add(t);const r=xu(t);if(typeof r=="string"){const n=ue(this,xr).get(r);n?n.push(t):ue(this,xr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ue(this,kn).delete(t)){const r=xu(t);if(typeof r=="string"){const n=ue(this,xr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&ue(this,xr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xu(t);if(typeof r=="string"){const n=ue(this,xr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=xu(t);if(typeof r=="string"){const i=(n=ue(this,xr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zt.batch(()=>{ue(this,kn).forEach(t=>{this.notify({type:"removed",mutation:t})}),ue(this,kn).clear(),ue(this,xr).clear()})}getAll(){return Array.from(ue(this,kn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>zE(r,n))}findAll(t={}){return this.getAll().filter(r=>zE(t,r))}notify(t){Zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Zt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Sr))))}},kn=new WeakMap,xr=new WeakMap,Ho=new WeakMap,HO);function xu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var gn,VO,gj=(VO=class extends Vo{constructor(t={}){super();We(this,gn);this.config=t,je(this,gn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??d_(i,r);let s=this.get(a);return s||(s=new lj({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){ue(this,gn).has(t.queryHash)||(ue(this,gn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=ue(this,gn).get(t.queryHash);r&&(t.destroy(),r===t&&ue(this,gn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ue(this,gn).get(t)}getAll(){return[...ue(this,gn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>GE(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>GE(t,n)):r}notify(t){Zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},gn=new WeakMap,VO),Bt,ai,si,ts,rs,oi,ns,is,GO,_j=(GO=class{constructor(e={}){We(this,Bt);We(this,ai);We(this,si);We(this,ts);We(this,rs);We(this,oi);We(this,ns);We(this,is);je(this,Bt,e.queryCache||new gj),je(this,ai,e.mutationCache||new yj),je(this,si,e.defaultOptions||{}),je(this,ts,new Map),je(this,rs,new Map),je(this,oi,0)}mount(){Yu(this,oi)._++,ue(this,oi)===1&&(je(this,ns,l_.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Bt).onFocus())})),je(this,is,Il.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Bt).onOnline())})))}unmount(){var e,t;Yu(this,oi)._--,ue(this,oi)===0&&((e=ue(this,ns))==null||e.call(this),je(this,ns,void 0),(t=ue(this,is))==null||t.call(this),je(this,is,void 0))}isFetching(e){return ue(this,Bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,ai).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=ue(this,Bt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=ue(this,Bt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ui(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return ue(this,Bt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=ue(this,Bt).get(n.queryHash),a=i==null?void 0:i.state.data,s=ZD(t,a);if(s!==void 0)return ue(this,Bt).build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Zt.batch(()=>ue(this,Bt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=ue(this,Bt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=ue(this,Bt);Zt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=ue(this,Bt);return Zt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zt.batch(()=>ue(this,Bt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Sr).catch(Sr)}invalidateQueries(e,t={}){return Zt.batch(()=>(ue(this,Bt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zt.batch(()=>ue(this,Bt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Sr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=ue(this,Bt).build(this,t);return r.isStaleByTime(ui(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sr).catch(Sr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sr).catch(Sr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Il.isOnline()?ue(this,ai).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,Bt)}getMutationCache(){return ue(this,ai)}getDefaultOptions(){return ue(this,si)}setDefaultOptions(e){je(this,si,e)}setQueryDefaults(e,t){ue(this,ts).set(No(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ue(this,ts).values()],r={};return t.forEach(n=>{Po(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){ue(this,rs).set(No(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ue(this,rs).values()],r={};return t.forEach(n=>{Po(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ue(this,si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=d_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===f_&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,Bt).clear(),ue(this,ai).clear()}},Bt=new WeakMap,ai=new WeakMap,si=new WeakMap,ts=new WeakMap,rs=new WeakMap,oi=new WeakMap,ns=new WeakMap,is=new WeakMap,GO),sN=De.createContext(void 0),Ej=e=>{const t=De.useContext(sN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vj=({client:e,children:t})=>(De.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),J.jsx(sN.Provider,{value:e,children:t})),oN=De.createContext(!1),bj=()=>De.useContext(oN);oN.Provider;function Tj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Sj=De.createContext(Tj()),Ij=()=>De.useContext(Sj),Rj=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?QO(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},wj=e=>{De.useEffect(()=>{e.clearReset()},[e])},Aj=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||QO(r,[e.error,n])),Oj=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Nj=(e,t)=>e.isLoading&&e.isFetching&&!t,Pj=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,QE=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Cj(e,t,r){var f,_,R,w;const n=bj(),i=Ij(),a=Ej(),s=a.defaultQueryOptions(e);(_=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||_.call(f,s);const o=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=n?"isRestoring":u?"optimistic":void 0,Oj(s),Rj(s,i,o),wj(i);const l=!a.getQueryCache().get(s.queryHash),[c]=De.useState(()=>new t(a,s)),d=c.getOptimisticResult(s),p=!n&&u;if(De.useSyncExternalStore(De.useCallback(O=>{const h=p?c.subscribe(Zt.batchCalls(O)):Sr;return c.updateResult(),h},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),De.useEffect(()=>{c.setOptions(s)},[s,c]),Pj(s,d))throw QE(s,c,i);if(Aj({result:d,errorResetBoundary:i,throwOnError:s.throwOnError,query:o,suspense:s.suspense}))throw d.error;if((w=(R=a.getDefaultOptions().queries)==null?void 0:R._experimental_afterQuery)==null||w.call(R,s,d),s.experimental_prefetchInRender&&!Co.isServer()&&Nj(d,n)){const O=l?QE(s,c,i):o==null?void 0:o.promise;O==null||O.catch(Sr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?d:c.trackResult(d)}function Ll(e,t){return Cj(e,dj)}const Mj="modulepreload",Dj=function(e){return"https://cdn.decentraland.org/@dcl/shop/0.1.0-29254964718.commit-bc79b69/"+e},ZE={},Gt=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=s(r.map(l=>{if(l=Dj(l),l in ZE)return;ZE[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":Mj,c||(p.as="script"),p.crossOrigin="",p.href=l,u&&p.setAttribute("nonce",u),document.head.appendChild(p),c)return new Promise((f,_)=>{p.addEventListener("load",f),p.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})},uN=Object.prototype.toString;function m_(e){switch(uN.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Fn(e,Error)}}function hs(e,t){return uN.call(e)===`[object ${t}]`}function h_(e){return hs(e,"ErrorEvent")}function ev(e){return hs(e,"DOMError")}function jj(e){return hs(e,"DOMException")}function vn(e){return hs(e,"String")}function y_(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function g_(e){return e===null||y_(e)||typeof e!="object"&&typeof e!="function"}function ca(e){return hs(e,"Object")}function $l(e){return typeof Event<"u"&&Fn(e,Event)}function Lj(e){return typeof Element<"u"&&Fn(e,Element)}function $j(e){return hs(e,"RegExp")}function ys(e){return!!(e&&e.then&&typeof e.then=="function")}function qj(e){return ca(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function cN(e){return typeof e=="number"&&e!==e}function Fn(e,t){try{return e instanceof t}catch{return!1}}function lN(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function Ua(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function tv(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const i=e[n];try{lN(i)?r.push("[VueViewModel]"):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Bj(e,t,r=!1){return vn(e)?$j(t)?t.test(e):vn(t)?r?e===t:e.includes(t):!1:!1}function Go(e,t=[],r=!1){return t.some(n=>Bj(e,n,r))}function kj(e,t,r=250,n,i,a,s){if(!a.exception||!a.exception.values||!s||!Fn(s.originalException,Error))return;const o=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;o&&(a.exception.values=Uj(Tg(e,t,i,s.originalException,n,a.exception.values,o,0),r))}function Tg(e,t,r,n,i,a,s,o){if(a.length>=r+1)return a;let u=[...a];if(Fn(n[i],Error)){rv(s,o);const l=e(t,n[i]),c=u.length;nv(l,i,c,o),u=Tg(e,t,r,n[i],i,[l,...u],l,c)}return Array.isArray(n.errors)&&n.errors.forEach((l,c)=>{if(Fn(l,Error)){rv(s,o);const d=e(t,l),p=u.length;nv(d,`errors[${c}]`,p,o),u=Tg(e,t,r,l,i,[d,...u],d,p)}}),u}function rv(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function nv(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function Uj(e,t){return e.map(r=>(r.value&&(r.value=Ua(r.value,t)),r))}function Ku(e){return e&&e.Math==Math?e:void 0}const ot=typeof globalThis=="object"&&Ku(globalThis)||typeof window=="object"&&Ku(window)||typeof self=="object"&&Ku(self)||typeof Sl=="object"&&Ku(Sl)||(function(){return this})()||{};function __(){return ot}function ql(e,t,r){const n=r||ot,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const Fa=__(),Fj=80;function as(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let a=0,s=0;const o=" > ",u=o.length;let l;const c=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Fj;for(;r&&a++<n&&(l=Hj(r,c),!(l==="html"||a>1&&s+i.length*u+l.length>=d));)i.push(l),s+=l.length,r=r.parentNode;return i.reverse().join(o)}catch{return"<unknown>"}}function Hj(e,t){const r=e,n=[];let i,a,s,o,u;if(!r||!r.tagName)return"";if(Fa.HTMLElement&&r instanceof HTMLElement&&r.dataset&&r.dataset.sentryComponent)return r.dataset.sentryComponent;n.push(r.tagName.toLowerCase());const l=t&&t.length?t.filter(d=>r.getAttribute(d)).map(d=>[d,r.getAttribute(d)]):null;if(l&&l.length)l.forEach(d=>{n.push(`[${d[0]}="${d[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),i=r.className,i&&vn(i))for(a=i.split(/\s+/),u=0;u<a.length;u++)n.push(`.${a[u]}`);const c=["aria-label","type","name","title","alt"];for(u=0;u<c.length;u++)s=c[u],o=r.getAttribute(s),o&&n.push(`[${s}="${o}"]`);return n.join("")}function Vj(){try{return Fa.document.location.href}catch{return""}}function Gj(e){return Fa.document&&Fa.document.querySelector?Fa.document.querySelector(e):null}function dN(e){if(!Fa.HTMLElement)return null;let t=e;const r=5;for(let n=0;n<r;n++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}const gs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zj="Sentry Logger ",Sg=["debug","info","warn","error","log","assert","trace"],Rl={};function zo(e){if(!("console"in ot))return e();const t=ot.console,r={},n=Object.keys(Rl);n.forEach(i=>{const a=Rl[i];r[i]=t[i],t[i]=a});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function Wj(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return gs?Sg.forEach(r=>{t[r]=(...n)=>{e&&zo(()=>{ot.console[r](`${zj}[${r}]:`,...n)})}}):Sg.forEach(r=>{t[r]=()=>{}}),t}const Re=Wj(),Yj=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function xj(e){return e==="http"||e==="https"}function ha(e,t=!1){const{host:r,path:n,pass:i,port:a,projectId:s,protocol:o,publicKey:u}=e;return`${o}://${u}${t&&i?`:${i}`:""}@${r}${a?`:${a}`:""}/${n&&`${n}/`}${s}`}function Kj(e){const t=Yj.exec(e);if(!t){zo(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[r,n,i="",a,s="",o]=t.slice(1);let u="",l=o;const c=l.split("/");if(c.length>1&&(u=c.slice(0,-1).join("/"),l=c.pop()),l){const d=l.match(/^\d+/);d&&(l=d[0])}return fN({host:a,pass:i,path:u,projectId:l,port:s,protocol:r,publicKey:n})}function fN(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Xj(e){if(!gs)return!0;const{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(Re.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:r.match(/^\d+$/)?xj(n)?t&&isNaN(parseInt(t,10))?(Re.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Re.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(Re.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function pN(e){const t=typeof e=="string"?Kj(e):fN(e);if(!(!t||!Xj(t)))return t}class _n extends Error{constructor(t,r="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=r}}function tr(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);typeof i=="function"&&mN(i,n),e[t]=i}function la(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{gs&&Re.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function mN(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,la(e,"__sentry_original__",t)}catch{}}function E_(e){return e.__sentry_original__}function Jj(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function hN(e){if(m_(e))return{message:e.message,name:e.name,stack:e.stack,...av(e)};if($l(e)){const t={type:e.type,target:iv(e.target),currentTarget:iv(e.currentTarget),...av(e)};return typeof CustomEvent<"u"&&Fn(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function iv(e){try{return Lj(e)?as(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function av(e){if(typeof e=="object"&&e!==null){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function Qj(e,t=40){const r=Object.keys(hN(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Ua(r[0],t);for(let n=r.length;n>0;n--){const i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length?i:Ua(i,t)}return""}function Ht(e){return Ig(e,new Map)}function Ig(e,t){if(Zj(e)){const r=t.get(e);if(r!==void 0)return r;const n={};t.set(e,n);for(const i of Object.keys(e))typeof e[i]<"u"&&(n[i]=Ig(e[i],t));return n}if(Array.isArray(e)){const r=t.get(e);if(r!==void 0)return r;const n=[];return t.set(e,n),e.forEach(i=>{n.push(Ig(i,t))}),n}return e}function Zj(e){if(!ca(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const yN=50,sv=/\(error: (.*)\)/,ov=/captureMessage|captureException/;function gN(...e){const t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{const i=[],a=r.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DlIuq6jd.js","assets/react-Vu6nbGi5.js","assets/network-BEMFiHk7.js","assets/index-C3aicU78.js","assets/SvgIcon-tZThylOM.js","assets/generateUtilityClasses-DSb5S1QX.js","assets/colors-LINLm1ux.js","assets/ethers-JeCAM1sd.js","assets/index-MrwyliNz.js","assets/index-CXZsKw11.js","assets/index-BoZzNw20.js","assets/Button-DTR3VbGL.js","assets/CircularProgress-DD1sqZ1V.js","assets/index-CLIR3TTD.js","assets/MenuItem-DMQM1XbL.js","assets/AnimatedBackground-D8118Htr.js","assets/AnimatedBackground-CiurwFBv.css","assets/ShopFooterInner-D-Q5vmHv.js","assets/TradeService-DgGPCq3X.js","assets/index-D5ovRFW1.js","assets/Assets-C2ZyKmXZ.js","assets/FilterBar-CdU8B66A.js","assets/SkeletonCards-BysJEVmg.js","assets/LoadMore-BOCtgPLI.js","assets/useInfiniteGrid-DX5h-FPW.js","assets/Market-BCmHclZK.js","assets/mana-rate-4QXh_m-p.js","assets/buy-BHEAD_2E.js","assets/buy-gasless-GK0eCKOi.js","assets/ItemDetail-Bm_JOK-F.js","assets/ItemDetail-Casltmsg.css","assets/Collection-C_nk8Cc9.js","assets/collection-Bhqpzm3u.js","assets/collection-Ds5shVfK.css","assets/Creator-DVFLJ7iH.js","assets/MyAssets-DymuAMH5.js","assets/import-BNRuToyt.js","assets/wallet-kind-ChVeEHHr.js","assets/MyAssets-BqJHbQOZ.css","assets/MyFavorites-DWNoEFBD.js","assets/MyPurchases-D84T4Vx3.js","assets/ImportListings-DgxCofmJ.js","assets/ImportListings-Cdx3om4x.css","assets/Cart-ByEfJHct.js","assets/GetCredits-D2iWhTcj.js","assets/Success-Bxdmwj3S.js","assets/NotFound-Dagrrmzl.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var kD=Object.defineProperty;var HE=e=>{throw TypeError(e)};var UD=(e,t,r)=>t in e?kD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Yn=(e,t,r)=>UD(e,typeof t!="symbol"?t+"":t,r),Ed=(e,t,r)=>t.has(e)||HE("Cannot "+r);var ue=(e,t,r)=>(Ed(e,t,"read from private field"),r?r.call(e):t.get(e)),We=(e,t,r)=>t.has(e)?HE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),je=(e,t,r,n)=>(Ed(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),rt=(e,t,r)=>(Ed(e,t,"access private method"),r);var Yu=(e,t,r,n)=>({set _(i){je(e,t,i,r)},get _(){return ue(e,t,n)}});import{r as Me,j as J,l as zO,g as WO,R as YO,c as sg,L as Oo,a as c_,m as xn,d as FD,n as HD,o as dr,N as VD,p as GD,B as zD}from"./react-Vu6nbGi5.js";import{g as Sl,p as yl,W as WD,m as YD,h as VE,f as xO}from"./ethers-JeCAM1sd.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Vo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Qi,ei,Wa,LO,xD=(LO=class extends Vo{constructor(){super();We(this,Qi);We(this,ei);We(this,Wa);je(this,Wa,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){ue(this,ei)||this.setEventListener(ue(this,Wa))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,ei))==null||t.call(this),je(this,ei,void 0))}setEventListener(t){var r;je(this,Wa,t),(r=ue(this,ei))==null||r.call(this),je(this,ei,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){ue(this,Qi)!==t&&(je(this,Qi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof ue(this,Qi)=="boolean"?ue(this,Qi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Qi=new WeakMap,ei=new WeakMap,Wa=new WeakMap,LO),l_=new xD,KD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ti,u_,$O,XD=($O=class{constructor(){We(this,ti,KD);We(this,u_,!1)}setTimeoutProvider(e){je(this,ti,e)}setTimeout(e,t){return ue(this,ti).setTimeout(e,t)}clearTimeout(e){ue(this,ti).clearTimeout(e)}setInterval(e,t){return ue(this,ti).setInterval(e,t)}clearInterval(e){ue(this,ti).clearInterval(e)}},ti=new WeakMap,u_=new WeakMap,$O),Ji=new XD;function JD(e){setTimeout(e,0)}var QD=typeof window>"u"||"Deno"in globalThis;function Sr(){}function ZD(e,t){return typeof e=="function"?e(t):e}function og(e){return typeof e=="number"&&e>=0&&e!==1/0}function KO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ui(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function GE(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:s,stale:o}=e;if(s){if(n){if(t.queryHash!==d_(s,t.options))return!1}else if(!Po(t.queryKey,s))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||a&&!a(t))}function zE(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(No(t.options.mutationKey)!==No(a))return!1}else if(!Po(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function d_(e,t){return((t==null?void 0:t.queryKeyHashFn)||No)(e)}function No(e){return JSON.stringify(e,(t,r)=>cg(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Po(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Po(e[r],t[r])):!1}var ej=Object.prototype.hasOwnProperty;function XO(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=WE(e)&&WE(t);if(!n&&!(cg(e)&&cg(t)))return t;const a=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,u=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c],p=e[d],f=t[d];if(p===f){u[d]=p,(n?c<a:ej.call(e,d))&&l++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){u[d]=f;continue}const _=XO(p,f,r+1);u[d]=_,_===p&&l++}return a===o&&l===a?e:u}function ug(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function WE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cg(e){if(!YE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!YE(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function YE(e){return Object.prototype.toString.call(e)==="[object Object]"}function tj(e){return new Promise(t=>{Ji.setTimeout(t,e)})}function lg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?XO(e,t):t}function a6(e){return e}function rj(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function nj(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var f_=Symbol();function JO(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===f_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function QO(e,t){return typeof e=="function"?e(...t):!!e}function ij(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Co=(()=>{let e=()=>QD;return{isServer(){return e()},setIsServer(t){e=t}}})();function dg(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var aj=JD;function sj(){let e=[],t=0,r=o=>{o()},n=o=>{o()},i=aj;const a=o=>{t?e.push(o):i(()=>{r(o)})},s=()=>{const o=e;e=[],o.length&&i(()=>{n(()=>{o.forEach(u=>{r(u)})})})};return{batch:o=>{let u;t++;try{u=o()}finally{t--,t||s()}return u},batchCalls:o=>(...u)=>{a(()=>{o(...u)})},schedule:a,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var Zt=sj(),Ya,ri,xa,qO,oj=(qO=class extends Vo{constructor(){super();We(this,Ya,!0);We(this,ri);We(this,xa);je(this,xa,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){ue(this,ri)||this.setEventListener(ue(this,xa))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,ri))==null||t.call(this),je(this,ri,void 0))}setEventListener(t){var r;je(this,xa,t),(r=ue(this,ri))==null||r.call(this),je(this,ri,t(this.setOnline.bind(this)))}setOnline(t){ue(this,Ya)!==t&&(je(this,Ya,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return ue(this,Ya)}},Ya=new WeakMap,ri=new WeakMap,xa=new WeakMap,qO),Il=new oj;function uj(e){return Math.min(1e3*2**e,3e4)}function ZO(e){return(e??"online")==="online"?Il.isOnline():!0}var fg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function eN(e){let t=!1,r=0,n;const i=dg(),a=()=>i.status!=="pending",s=R=>{var w;if(!a()){const O=new fg(R);p(O),(w=e.onCancel)==null||w.call(e,O)}},o=()=>{t=!0},u=()=>{t=!1},l=()=>l_.isFocused()&&(e.networkMode==="always"||Il.isOnline())&&e.canRun(),c=()=>ZO(e.networkMode)&&e.canRun(),d=R=>{a()||(n==null||n(),i.resolve(R))},p=R=>{a()||(n==null||n(),i.reject(R))},f=()=>new Promise(R=>{var w;n=O=>{(a()||l())&&R(O)},(w=e.onPause)==null||w.call(e)}).then(()=>{var R;n=void 0,a()||(R=e.onContinue)==null||R.call(e)}),_=()=>{if(a())return;let R;const w=r===0?e.initialPromise:void 0;try{R=w??e.fn()}catch(O){R=Promise.reject(O)}Promise.resolve(R).then(d).catch(O=>{var v;if(a())return;const h=e.retry??(Co.isServer()?0:3),T=e.retryDelay??uj,b=typeof T=="function"?T(r,O):T,m=h===!0||typeof h=="number"&&r<h||typeof h=="function"&&h(r,O);if(t||!m){p(O);return}r++,(v=e.onFail)==null||v.call(e,r,O),tj(b).then(()=>l()?void 0:f()).then(()=>{t?p(O):_()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(n==null||n(),i),cancelRetry:o,continueRetry:u,canStart:c,start:()=>(c()?_():f().then(_),i)}}var Zi,BO,tN=(BO=class{constructor(){We(this,Zi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),og(this.gcTime)&&je(this,Zi,Ji.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Co.isServer()?1/0:300*1e3))}clearGcTimeout(){ue(this,Zi)!==void 0&&(Ji.clearTimeout(ue(this,Zi)),je(this,Zi,void 0))}},Zi=new WeakMap,BO);function cj(e){return{onFetch:(t,r)=>{var c,d,p,f,_;const n=t.options,i=(p=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,a=((f=t.state.data)==null?void 0:f.pages)||[],s=((_=t.state.data)==null?void 0:_.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const l=async()=>{let R=!1;const w=T=>{ij(T,()=>t.signal,()=>R=!0)},O=JO(t.options,t.fetchOptions),h=async(T,b,m)=>{if(R)return Promise.reject(t.signal.reason);if(b==null&&T.pages.length)return Promise.resolve(T);const A=(()=>{const Y={client:t.client,queryKey:t.queryKey,pageParam:b,direction:m?"backward":"forward",meta:t.options.meta};return w(Y),Y})(),P=await O(A),{maxPages:q}=t.options,z=m?nj:rj;return{pages:z(T.pages,P,q),pageParams:z(T.pageParams,b,q)}};if(i&&a.length){const T=i==="backward",b=T?rN:pg,m={pages:a,pageParams:s},v=b(n,m);o=await h(m,v,T)}else{const T=e??a.length;do{const b=u===0?s[0]??n.initialPageParam:pg(n,o);if(u>0&&b==null)break;o=await h(o,b),u++}while(u<T)}return o};t.options.persister?t.fetchFn=()=>{var R,w;return(w=(R=t.options).persister)==null?void 0:w.call(R,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function pg(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function rN(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function s6(e,t){return t?pg(e,t)!=null:!1}function o6(e,t){return!t||!e.getPreviousPageParam?!1:rN(e,t)!=null}var Ka,ea,Xa,jr,ta,xt,Bo,ra,Pr,nN,Ln,kO,lj=(kO=class extends tN{constructor(t){super();We(this,Pr);We(this,Ka);We(this,ea);We(this,Xa);We(this,jr);We(this,ta);We(this,xt);We(this,Bo);We(this,ra);je(this,ra,!1),je(this,Bo,t.defaultOptions),this.setOptions(t.options),this.observers=[],je(this,ta,t.client),je(this,jr,ue(this,ta).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,ea,KE(this.options)),this.state=t.state??ue(this,ea),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,Ka)}get promise(){var t;return(t=ue(this,xt))==null?void 0:t.promise}setOptions(t){if(this.options={...ue(this,Bo),...t},t!=null&&t._type&&je(this,Ka,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=KE(this.options);r.data!==void 0&&(this.setState(xE(r.data,r.dataUpdatedAt)),je(this,ea,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,jr).remove(this)}setData(t,r){const n=lg(this.state.data,t,this.options);return rt(this,Pr,Ln).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){rt(this,Pr,Ln).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=ue(this,xt))==null?void 0:n.promise;return(i=ue(this,xt))==null||i.cancel(t),r?r.then(Sr).catch(Sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,ea)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===f_||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ui(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!KO(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=ue(this,xt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=ue(this,xt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ue(this,jr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(ue(this,xt)&&(ue(this,ra)||rt(this,Pr,nN).call(this)?ue(this,xt).cancel({revert:!0}):ue(this,xt).cancelRetry()),this.scheduleGc()),ue(this,jr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||rt(this,Pr,Ln).call(this,{type:"invalidate"})}async fetch(t,r){var l,c,d,p,f,_,R,w,O,h,T;if(this.state.fetchStatus!=="idle"&&((l=ue(this,xt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(ue(this,xt))return ue(this,xt).continueRetry(),ue(this,xt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(m=>m.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(je(this,ra,!0),n.signal)})},a=()=>{const b=JO(this.options,r),v=(()=>{const A={client:ue(this,ta),queryKey:this.queryKey,meta:this.meta};return i(A),A})();return je(this,ra,!1),this.options.persister?this.options.persister(b,v,this):b(v)},o=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:ue(this,ta),state:this.state,fetchFn:a};return i(b),b})(),u=ue(this,Ka)==="infinite"?cj(this.options.pages):this.options.behavior;u==null||u.onFetch(o,this),je(this,Xa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&rt(this,Pr,Ln).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta}),je(this,xt,eN({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:b=>{b instanceof fg&&b.revert&&this.setState({...ue(this,Xa),fetchStatus:"idle"}),n.abort()},onFail:(b,m)=>{rt(this,Pr,Ln).call(this,{type:"failed",failureCount:b,error:m})},onPause:()=>{rt(this,Pr,Ln).call(this,{type:"pause"})},onContinue:()=>{rt(this,Pr,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const b=await ue(this,xt).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(f=(p=ue(this,jr).config).onSuccess)==null||f.call(p,b,this),(R=(_=ue(this,jr).config).onSettled)==null||R.call(_,b,this.state.error,this),b}catch(b){if(b instanceof fg){if(b.silent)return ue(this,xt).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw rt(this,Pr,Ln).call(this,{type:"error",error:b}),(O=(w=ue(this,jr).config).onError)==null||O.call(w,b,this),(T=(h=ue(this,jr).config).onSettled)==null||T.call(h,this.state.data,b,this),b}finally{this.scheduleGc()}}},Ka=new WeakMap,ea=new WeakMap,Xa=new WeakMap,jr=new WeakMap,ta=new WeakMap,xt=new WeakMap,Bo=new WeakMap,ra=new WeakMap,Pr=new WeakSet,nN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ln=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...iN(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...xE(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return je(this,Xa,t.manual?i:void 0),i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Zt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),ue(this,jr).notify({query:this,type:"updated",action:t})})},kO);function iN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function xE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function KE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Tr,st,ko,pr,na,Ja,Bn,ni,Uo,Qa,Za,ia,aa,ii,es,_t,Qs,mg,hg,yg,gg,_g,Eg,vg,aN,UO,dj=(UO=class extends Vo{constructor(t,r){super();We(this,_t);We(this,Tr);We(this,st);We(this,ko);We(this,pr);We(this,na);We(this,Ja);We(this,Bn);We(this,ni);We(this,Uo);We(this,Qa);We(this,Za);We(this,ia);We(this,aa);We(this,ii);We(this,es,new Set);this.options=r,je(this,Tr,t),je(this,ni,null),je(this,Bn,dg()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,st).addObserver(this),XE(ue(this,st),this.options)?rt(this,_t,Qs).call(this):this.updateResult(),rt(this,_t,gg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bg(ue(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bg(ue(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,rt(this,_t,_g).call(this),rt(this,_t,Eg).call(this),ue(this,st).removeObserver(this)}setOptions(t){const r=this.options,n=ue(this,st);if(this.options=ue(this,Tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,ue(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");rt(this,_t,vg).call(this),ue(this,st).setOptions(this.options),r._defaulted&&!ug(this.options,r)&&ue(this,Tr).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,st),observer:this});const i=this.hasListeners();i&&JE(ue(this,st),n,this.options,r)&&rt(this,_t,Qs).call(this),this.updateResult(),i&&(ue(this,st)!==n||Cr(this.options.enabled,ue(this,st))!==Cr(r.enabled,ue(this,st))||ui(this.options.staleTime,ue(this,st))!==ui(r.staleTime,ue(this,st)))&&rt(this,_t,mg).call(this);const a=rt(this,_t,hg).call(this);i&&(ue(this,st)!==n||Cr(this.options.enabled,ue(this,st))!==Cr(r.enabled,ue(this,st))||a!==ue(this,ii))&&rt(this,_t,yg).call(this,a)}getOptimisticResult(t){const r=ue(this,Tr).getQueryCache().build(ue(this,Tr),t),n=this.createResult(r,t);return pj(this,n)&&(je(this,pr,n),je(this,Ja,this.options),je(this,na,ue(this,st).state)),n}getCurrentResult(){return ue(this,pr)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ue(this,Bn).status==="pending"&&ue(this,Bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){ue(this,es).add(t)}getCurrentQuery(){return ue(this,st)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=ue(this,Tr).defaultQueryOptions(t),n=ue(this,Tr).getQueryCache().build(ue(this,Tr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return rt(this,_t,Qs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,pr)))}createResult(t,r){var q;const n=ue(this,st),i=this.options,a=ue(this,pr),s=ue(this,na),o=ue(this,Ja),l=t!==n?t.state:ue(this,ko),{state:c}=t;let d={...c},p=!1,f;if(r._optimisticResults){const z=this.hasListeners(),Y=!z&&XE(t,r),W=z&&JE(t,n,r,i);(Y||W)&&(d={...d,...iN(c.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:R,status:w}=d;f=d.data;let O=!1;if(r.placeholderData!==void 0&&f===void 0&&w==="pending"){let z;a!=null&&a.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(z=a.data,O=!0):z=typeof r.placeholderData=="function"?r.placeholderData((q=ue(this,Za))==null?void 0:q.state.data,ue(this,Za)):r.placeholderData,z!==void 0&&(w="success",f=lg(a==null?void 0:a.data,z,r),p=!0)}if(r.select&&f!==void 0&&!O)if(a&&f===(s==null?void 0:s.data)&&r.select===ue(this,Uo))f=ue(this,Qa);else try{je(this,Uo,r.select),f=r.select(f),f=lg(a==null?void 0:a.data,f,r),je(this,Qa,f),je(this,ni,null)}catch(z){je(this,ni,z)}ue(this,ni)&&(_=ue(this,ni),f=ue(this,Qa),R=Date.now(),w="error");const h=d.fetchStatus==="fetching",T=w==="pending",b=w==="error",m=T&&h,v=f!==void 0,P={status:w,fetchStatus:d.fetchStatus,isPending:T,isSuccess:w==="success",isError:b,isInitialLoading:m,isLoading:m,data:f,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:R,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:h,isRefetching:h&&!T,isLoadingError:b&&!v,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:b&&v,isStale:p_(t,r),refetch:this.refetch,promise:ue(this,Bn),isEnabled:Cr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=P.data!==void 0,Y=P.status==="error"&&!z,W=ce=>{Y?ce.reject(P.error):z&&ce.resolve(P.data)},U=()=>{const ce=je(this,Bn,P.promise=dg());W(ce)},F=ue(this,Bn);switch(F.status){case"pending":t.queryHash===n.queryHash&&W(F);break;case"fulfilled":(Y||P.data!==F.value)&&U();break;case"rejected":(!Y||P.error!==F.reason)&&U();break}}return P}updateResult(){const t=ue(this,pr),r=this.createResult(ue(this,st),this.options);if(je(this,na,ue(this,st).state),je(this,Ja,this.options),ue(this,na).data!==void 0&&je(this,Za,ue(this,st)),ug(r,t))return;je(this,pr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,es).size)return!0;const s=new Set(a??ue(this,es));return this.options.throwOnError&&s.add("error"),Object.keys(ue(this,pr)).some(o=>{const u=o;return ue(this,pr)[u]!==t[u]&&s.has(u)})};rt(this,_t,aN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&rt(this,_t,gg).call(this)}},Tr=new WeakMap,st=new WeakMap,ko=new WeakMap,pr=new WeakMap,na=new WeakMap,Ja=new WeakMap,Bn=new WeakMap,ni=new WeakMap,Uo=new WeakMap,Qa=new WeakMap,Za=new WeakMap,ia=new WeakMap,aa=new WeakMap,ii=new WeakMap,es=new WeakMap,_t=new WeakSet,Qs=function(t){rt(this,_t,vg).call(this);let r=ue(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Sr)),r},mg=function(){rt(this,_t,_g).call(this);const t=ui(this.options.staleTime,ue(this,st));if(Co.isServer()||ue(this,pr).isStale||!og(t))return;const n=KO(ue(this,pr).dataUpdatedAt,t)+1;je(this,ia,Ji.setTimeout(()=>{ue(this,pr).isStale||this.updateResult()},n))},hg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,st)):this.options.refetchInterval)??!1},yg=function(t){rt(this,_t,Eg).call(this),je(this,ii,t),!(Co.isServer()||Cr(this.options.enabled,ue(this,st))===!1||!og(ue(this,ii))||ue(this,ii)===0)&&je(this,aa,Ji.setInterval(()=>{(this.options.refetchIntervalInBackground||l_.isFocused())&&rt(this,_t,Qs).call(this)},ue(this,ii)))},gg=function(){rt(this,_t,mg).call(this),rt(this,_t,yg).call(this,rt(this,_t,hg).call(this))},_g=function(){ue(this,ia)!==void 0&&(Ji.clearTimeout(ue(this,ia)),je(this,ia,void 0))},Eg=function(){ue(this,aa)!==void 0&&(Ji.clearInterval(ue(this,aa)),je(this,aa,void 0))},vg=function(){const t=ue(this,Tr).getQueryCache().build(ue(this,Tr),this.options);if(t===ue(this,st))return;const r=ue(this,st);je(this,st,t),je(this,ko,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},aN=function(t){Zt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(ue(this,pr))}),ue(this,Tr).getQueryCache().notify({query:ue(this,st),type:"observerResultsUpdated"})})},UO);function fj(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Cr(t.retryOnMount,e)===!1)}function XE(e,t){return fj(e,t)||e.state.data!==void 0&&bg(e,t,t.refetchOnMount)}function bg(e,t,r){if(Cr(t.enabled,e)!==!1&&ui(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&p_(e,t)}return!1}function JE(e,t,r,n){return(e!==t||Cr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&p_(e,r)}function p_(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(ui(t.staleTime,e))}function pj(e,t){return!ug(e.getCurrentResult(),t)}var Fo,hn,ur,sa,yn,Jn,FO,mj=(FO=class extends tN{constructor(t){super();We(this,yn);We(this,Fo);We(this,hn);We(this,ur);We(this,sa);je(this,Fo,t.client),this.mutationId=t.mutationId,je(this,ur,t.mutationCache),je(this,hn,[]),this.state=t.state||hj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ue(this,hn).includes(t)||(ue(this,hn).push(t),this.clearGcTimeout(),ue(this,ur).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,hn,ue(this,hn).filter(r=>r!==t)),this.scheduleGc(),ue(this,ur).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ue(this,hn).length||(this.state.status==="pending"?this.scheduleGc():ue(this,ur).remove(this))}continue(){var t;return((t=ue(this,sa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,u,l,c,d,p,f,_,R,w,O,h,T,b,m,v,A;const r=()=>{rt(this,yn,Jn).call(this,{type:"continue"})},n={client:ue(this,Fo),meta:this.options.meta,mutationKey:this.options.mutationKey};je(this,sa,eN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(P,q)=>{rt(this,yn,Jn).call(this,{type:"failed",failureCount:P,error:q})},onPause:()=>{rt(this,yn,Jn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,ur).canRun(this)}));const i=this.state.status==="pending",a=!ue(this,sa).canStart();try{if(i)r();else{rt(this,yn,Jn).call(this,{type:"pending",variables:t,isPaused:a}),ue(this,ur).config.onMutate&&await ue(this,ur).config.onMutate(t,this,n);const q=await((o=(s=this.options).onMutate)==null?void 0:o.call(s,t,n));q!==this.state.context&&rt(this,yn,Jn).call(this,{type:"pending",context:q,variables:t,isPaused:a})}const P=await ue(this,sa).start();return await((l=(u=ue(this,ur).config).onSuccess)==null?void 0:l.call(u,P,t,this.state.context,this,n)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,P,t,this.state.context,n)),await((f=(p=ue(this,ur).config).onSettled)==null?void 0:f.call(p,P,null,this.state.variables,this.state.context,this,n)),await((R=(_=this.options).onSettled)==null?void 0:R.call(_,P,null,t,this.state.context,n)),rt(this,yn,Jn).call(this,{type:"success",data:P}),P}catch(P){try{await((O=(w=ue(this,ur).config).onError)==null?void 0:O.call(w,P,t,this.state.context,this,n))}catch(q){Promise.reject(q)}try{await((T=(h=this.options).onError)==null?void 0:T.call(h,P,t,this.state.context,n))}catch(q){Promise.reject(q)}try{await((m=(b=ue(this,ur).config).onSettled)==null?void 0:m.call(b,void 0,P,this.state.variables,this.state.context,this,n))}catch(q){Promise.reject(q)}try{await((A=(v=this.options).onSettled)==null?void 0:A.call(v,void 0,P,t,this.state.context,n))}catch(q){Promise.reject(q)}throw rt(this,yn,Jn).call(this,{type:"error",error:P}),P}finally{ue(this,ur).runNext(this)}}},Fo=new WeakMap,hn=new WeakMap,ur=new WeakMap,sa=new WeakMap,yn=new WeakSet,Jn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Zt.batch(()=>{ue(this,hn).forEach(n=>{n.onMutationUpdate(t)}),ue(this,ur).notify({mutation:this,type:"updated",action:t})})},FO);function hj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var kn,xr,Ho,HO,yj=(HO=class extends Vo{constructor(t={}){super();We(this,kn);We(this,xr);We(this,Ho);this.config=t,je(this,kn,new Set),je(this,xr,new Map),je(this,Ho,0)}build(t,r,n){const i=new mj({client:t,mutationCache:this,mutationId:++Yu(this,Ho)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){ue(this,kn).add(t);const r=xu(t);if(typeof r=="string"){const n=ue(this,xr).get(r);n?n.push(t):ue(this,xr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ue(this,kn).delete(t)){const r=xu(t);if(typeof r=="string"){const n=ue(this,xr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&ue(this,xr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xu(t);if(typeof r=="string"){const n=ue(this,xr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=xu(t);if(typeof r=="string"){const i=(n=ue(this,xr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zt.batch(()=>{ue(this,kn).forEach(t=>{this.notify({type:"removed",mutation:t})}),ue(this,kn).clear(),ue(this,xr).clear()})}getAll(){return Array.from(ue(this,kn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>zE(r,n))}findAll(t={}){return this.getAll().filter(r=>zE(t,r))}notify(t){Zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Zt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Sr))))}},kn=new WeakMap,xr=new WeakMap,Ho=new WeakMap,HO);function xu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var gn,VO,gj=(VO=class extends Vo{constructor(t={}){super();We(this,gn);this.config=t,je(this,gn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??d_(i,r);let s=this.get(a);return s||(s=new lj({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){ue(this,gn).has(t.queryHash)||(ue(this,gn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=ue(this,gn).get(t.queryHash);r&&(t.destroy(),r===t&&ue(this,gn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ue(this,gn).get(t)}getAll(){return[...ue(this,gn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>GE(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>GE(t,n)):r}notify(t){Zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},gn=new WeakMap,VO),Bt,ai,si,ts,rs,oi,ns,is,GO,_j=(GO=class{constructor(e={}){We(this,Bt);We(this,ai);We(this,si);We(this,ts);We(this,rs);We(this,oi);We(this,ns);We(this,is);je(this,Bt,e.queryCache||new gj),je(this,ai,e.mutationCache||new yj),je(this,si,e.defaultOptions||{}),je(this,ts,new Map),je(this,rs,new Map),je(this,oi,0)}mount(){Yu(this,oi)._++,ue(this,oi)===1&&(je(this,ns,l_.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Bt).onFocus())})),je(this,is,Il.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Bt).onOnline())})))}unmount(){var e,t;Yu(this,oi)._--,ue(this,oi)===0&&((e=ue(this,ns))==null||e.call(this),je(this,ns,void 0),(t=ue(this,is))==null||t.call(this),je(this,is,void 0))}isFetching(e){return ue(this,Bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,ai).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=ue(this,Bt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=ue(this,Bt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ui(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return ue(this,Bt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=ue(this,Bt).get(n.queryHash),a=i==null?void 0:i.state.data,s=ZD(t,a);if(s!==void 0)return ue(this,Bt).build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Zt.batch(()=>ue(this,Bt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=ue(this,Bt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=ue(this,Bt);Zt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=ue(this,Bt);return Zt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zt.batch(()=>ue(this,Bt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Sr).catch(Sr)}invalidateQueries(e,t={}){return Zt.batch(()=>(ue(this,Bt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zt.batch(()=>ue(this,Bt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Sr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=ue(this,Bt).build(this,t);return r.isStaleByTime(ui(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sr).catch(Sr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sr).catch(Sr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Il.isOnline()?ue(this,ai).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,Bt)}getMutationCache(){return ue(this,ai)}getDefaultOptions(){return ue(this,si)}setDefaultOptions(e){je(this,si,e)}setQueryDefaults(e,t){ue(this,ts).set(No(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ue(this,ts).values()],r={};return t.forEach(n=>{Po(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){ue(this,rs).set(No(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ue(this,rs).values()],r={};return t.forEach(n=>{Po(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ue(this,si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=d_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===f_&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,Bt).clear(),ue(this,ai).clear()}},Bt=new WeakMap,ai=new WeakMap,si=new WeakMap,ts=new WeakMap,rs=new WeakMap,oi=new WeakMap,ns=new WeakMap,is=new WeakMap,GO),sN=Me.createContext(void 0),Ej=e=>{const t=Me.useContext(sN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vj=({client:e,children:t})=>(Me.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),J.jsx(sN.Provider,{value:e,children:t})),oN=Me.createContext(!1),bj=()=>Me.useContext(oN);oN.Provider;function Tj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Sj=Me.createContext(Tj()),Ij=()=>Me.useContext(Sj),Rj=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?QO(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},wj=e=>{Me.useEffect(()=>{e.clearReset()},[e])},Aj=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||QO(r,[e.error,n])),Oj=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Nj=(e,t)=>e.isLoading&&e.isFetching&&!t,Pj=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,QE=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Cj(e,t,r){var f,_,R,w;const n=bj(),i=Ij(),a=Ej(),s=a.defaultQueryOptions(e);(_=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||_.call(f,s);const o=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=n?"isRestoring":u?"optimistic":void 0,Oj(s),Rj(s,i,o),wj(i);const l=!a.getQueryCache().get(s.queryHash),[c]=Me.useState(()=>new t(a,s)),d=c.getOptimisticResult(s),p=!n&&u;if(Me.useSyncExternalStore(Me.useCallback(O=>{const h=p?c.subscribe(Zt.batchCalls(O)):Sr;return c.updateResult(),h},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Me.useEffect(()=>{c.setOptions(s)},[s,c]),Pj(s,d))throw QE(s,c,i);if(Aj({result:d,errorResetBoundary:i,throwOnError:s.throwOnError,query:o,suspense:s.suspense}))throw d.error;if((w=(R=a.getDefaultOptions().queries)==null?void 0:R._experimental_afterQuery)==null||w.call(R,s,d),s.experimental_prefetchInRender&&!Co.isServer()&&Nj(d,n)){const O=l?QE(s,c,i):o==null?void 0:o.promise;O==null||O.catch(Sr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?d:c.trackResult(d)}function Ll(e,t){return Cj(e,dj)}const Mj="modulepreload",Dj=function(e){return"https://cdn.decentraland.org/@dcl/shop/0.1.0-29320049445.commit-d3838e0/"+e},ZE={},Gt=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=s(r.map(l=>{if(l=Dj(l),l in ZE)return;ZE[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":Mj,c||(p.as="script"),p.crossOrigin="",p.href=l,u&&p.setAttribute("nonce",u),document.head.appendChild(p),c)return new Promise((f,_)=>{p.addEventListener("load",f),p.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})},uN=Object.prototype.toString;function m_(e){switch(uN.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Fn(e,Error)}}function hs(e,t){return uN.call(e)===`[object ${t}]`}function h_(e){return hs(e,"ErrorEvent")}function ev(e){return hs(e,"DOMError")}function jj(e){return hs(e,"DOMException")}function vn(e){return hs(e,"String")}function y_(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function g_(e){return e===null||y_(e)||typeof e!="object"&&typeof e!="function"}function ca(e){return hs(e,"Object")}function $l(e){return typeof Event<"u"&&Fn(e,Event)}function Lj(e){return typeof Element<"u"&&Fn(e,Element)}function $j(e){return hs(e,"RegExp")}function ys(e){return!!(e&&e.then&&typeof e.then=="function")}function qj(e){return ca(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function cN(e){return typeof e=="number"&&e!==e}function Fn(e,t){try{return e instanceof t}catch{return!1}}function lN(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function Ua(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function tv(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const i=e[n];try{lN(i)?r.push("[VueViewModel]"):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Bj(e,t,r=!1){return vn(e)?$j(t)?t.test(e):vn(t)?r?e===t:e.includes(t):!1:!1}function Go(e,t=[],r=!1){return t.some(n=>Bj(e,n,r))}function kj(e,t,r=250,n,i,a,s){if(!a.exception||!a.exception.values||!s||!Fn(s.originalException,Error))return;const o=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;o&&(a.exception.values=Uj(Tg(e,t,i,s.originalException,n,a.exception.values,o,0),r))}function Tg(e,t,r,n,i,a,s,o){if(a.length>=r+1)return a;let u=[...a];if(Fn(n[i],Error)){rv(s,o);const l=e(t,n[i]),c=u.length;nv(l,i,c,o),u=Tg(e,t,r,n[i],i,[l,...u],l,c)}return Array.isArray(n.errors)&&n.errors.forEach((l,c)=>{if(Fn(l,Error)){rv(s,o);const d=e(t,l),p=u.length;nv(d,`errors[${c}]`,p,o),u=Tg(e,t,r,l,i,[d,...u],d,p)}}),u}function rv(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function nv(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function Uj(e,t){return e.map(r=>(r.value&&(r.value=Ua(r.value,t)),r))}function Ku(e){return e&&e.Math==Math?e:void 0}const ot=typeof globalThis=="object"&&Ku(globalThis)||typeof window=="object"&&Ku(window)||typeof self=="object"&&Ku(self)||typeof Sl=="object"&&Ku(Sl)||(function(){return this})()||{};function __(){return ot}function ql(e,t,r){const n=r||ot,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const Fa=__(),Fj=80;function as(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let a=0,s=0;const o=" > ",u=o.length;let l;const c=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Fj;for(;r&&a++<n&&(l=Hj(r,c),!(l==="html"||a>1&&s+i.length*u+l.length>=d));)i.push(l),s+=l.length,r=r.parentNode;return i.reverse().join(o)}catch{return"<unknown>"}}function Hj(e,t){const r=e,n=[];let i,a,s,o,u;if(!r||!r.tagName)return"";if(Fa.HTMLElement&&r instanceof HTMLElement&&r.dataset&&r.dataset.sentryComponent)return r.dataset.sentryComponent;n.push(r.tagName.toLowerCase());const l=t&&t.length?t.filter(d=>r.getAttribute(d)).map(d=>[d,r.getAttribute(d)]):null;if(l&&l.length)l.forEach(d=>{n.push(`[${d[0]}="${d[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),i=r.className,i&&vn(i))for(a=i.split(/\s+/),u=0;u<a.length;u++)n.push(`.${a[u]}`);const c=["aria-label","type","name","title","alt"];for(u=0;u<c.length;u++)s=c[u],o=r.getAttribute(s),o&&n.push(`[${s}="${o}"]`);return n.join("")}function Vj(){try{return Fa.document.location.href}catch{return""}}function Gj(e){return Fa.document&&Fa.document.querySelector?Fa.document.querySelector(e):null}function dN(e){if(!Fa.HTMLElement)return null;let t=e;const r=5;for(let n=0;n<r;n++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}const gs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zj="Sentry Logger ",Sg=["debug","info","warn","error","log","assert","trace"],Rl={};function zo(e){if(!("console"in ot))return e();const t=ot.console,r={},n=Object.keys(Rl);n.forEach(i=>{const a=Rl[i];r[i]=t[i],t[i]=a});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function Wj(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return gs?Sg.forEach(r=>{t[r]=(...n)=>{e&&zo(()=>{ot.console[r](`${zj}[${r}]:`,...n)})}}):Sg.forEach(r=>{t[r]=()=>{}}),t}const Re=Wj(),Yj=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function xj(e){return e==="http"||e==="https"}function ha(e,t=!1){const{host:r,path:n,pass:i,port:a,projectId:s,protocol:o,publicKey:u}=e;return`${o}://${u}${t&&i?`:${i}`:""}@${r}${a?`:${a}`:""}/${n&&`${n}/`}${s}`}function Kj(e){const t=Yj.exec(e);if(!t){zo(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[r,n,i="",a,s="",o]=t.slice(1);let u="",l=o;const c=l.split("/");if(c.length>1&&(u=c.slice(0,-1).join("/"),l=c.pop()),l){const d=l.match(/^\d+/);d&&(l=d[0])}return fN({host:a,pass:i,path:u,projectId:l,port:s,protocol:r,publicKey:n})}function fN(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Xj(e){if(!gs)return!0;const{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(Re.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:r.match(/^\d+$/)?xj(n)?t&&isNaN(parseInt(t,10))?(Re.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Re.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(Re.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function pN(e){const t=typeof e=="string"?Kj(e):fN(e);if(!(!t||!Xj(t)))return t}class _n extends Error{constructor(t,r="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=r}}function tr(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);typeof i=="function"&&mN(i,n),e[t]=i}function la(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{gs&&Re.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function mN(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,la(e,"__sentry_original__",t)}catch{}}function E_(e){return e.__sentry_original__}function Jj(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function hN(e){if(m_(e))return{message:e.message,name:e.name,stack:e.stack,...av(e)};if($l(e)){const t={type:e.type,target:iv(e.target),currentTarget:iv(e.currentTarget),...av(e)};return typeof CustomEvent<"u"&&Fn(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function iv(e){try{return Lj(e)?as(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function av(e){if(typeof e=="object"&&e!==null){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function Qj(e,t=40){const r=Object.keys(hN(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Ua(r[0],t);for(let n=r.length;n>0;n--){const i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length?i:Ua(i,t)}return""}function Ht(e){return Ig(e,new Map)}function Ig(e,t){if(Zj(e)){const r=t.get(e);if(r!==void 0)return r;const n={};t.set(e,n);for(const i of Object.keys(e))typeof e[i]<"u"&&(n[i]=Ig(e[i],t));return n}if(Array.isArray(e)){const r=t.get(e);if(r!==void 0)return r;const n=[];return t.set(e,n),e.forEach(i=>{n.push(Ig(i,t))}),n}return e}function Zj(e){if(!ca(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const yN=50,sv=/\(error: (.*)\)/,ov=/captureMessage|captureException/;function gN(...e){const t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{const i=[],a=r.split(`
|
|
3
3
|
`);for(let s=n;s<a.length;s++){const o=a[s];if(o.length>1024)continue;const u=sv.test(o)?o.replace(sv,"$1"):o;if(!u.match(/\S*Error: /)){for(const l of t){const c=l(u);if(c){i.push(c);break}}if(i.length>=yN)break}}return tL(i)}}function eL(e){return Array.isArray(e)?gN(...e):e}function tL(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),ov.test(t[t.length-1].function||"")&&(t.pop(),ov.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,yN).map(r=>({...r,filename:r.filename||t[t.length-1].filename,function:r.function||"?"}))}const vd="<anonymous>";function Hn(e){try{return!e||typeof e!="function"?vd:e.name||vd}catch{return vd}}const gl={},uv={};function ya(e,t){gl[e]=gl[e]||[],gl[e].push(t)}function ga(e,t){uv[e]||(t(),uv[e]=!0)}function Xr(e,t){const r=e&&gl[e];if(r)for(const n of r)try{n(t)}catch(i){gs&&Re.error(`Error while triggering instrumentation handler.
|
|
4
4
|
Type: ${e}
|
|
5
5
|
Name: ${Hn(n)}
|
|
@@ -31,7 +31,7 @@ Error:`,i)}}function iB(){return Hq(e=>{Ss("cls",{metric:e}),dP=e},{reportAllCha
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Yv;function nU(){if(Yv)return gt;Yv=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,_=e?Symbol.for("react.lazy"):60116,R=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function T(m){if(typeof m=="object"&&m!==null){var v=m.$$typeof;switch(v){case t:switch(m=m.type,m){case u:case l:case n:case a:case i:case d:return m;default:switch(m=m&&m.$$typeof,m){case o:case c:case _:case f:case s:return m;default:return v}}case r:return v}}}function b(m){return T(m)===l}return gt.AsyncMode=u,gt.ConcurrentMode=l,gt.ContextConsumer=o,gt.ContextProvider=s,gt.Element=t,gt.ForwardRef=c,gt.Fragment=n,gt.Lazy=_,gt.Memo=f,gt.Portal=r,gt.Profiler=a,gt.StrictMode=i,gt.Suspense=d,gt.isAsyncMode=function(m){return b(m)||T(m)===u},gt.isConcurrentMode=b,gt.isContextConsumer=function(m){return T(m)===o},gt.isContextProvider=function(m){return T(m)===s},gt.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},gt.isForwardRef=function(m){return T(m)===c},gt.isFragment=function(m){return T(m)===n},gt.isLazy=function(m){return T(m)===_},gt.isMemo=function(m){return T(m)===f},gt.isPortal=function(m){return T(m)===r},gt.isProfiler=function(m){return T(m)===a},gt.isStrictMode=function(m){return T(m)===i},gt.isSuspense=function(m){return T(m)===d},gt.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===l||m===a||m===i||m===d||m===p||typeof m=="object"&&m!==null&&(m.$$typeof===_||m.$$typeof===f||m.$$typeof===s||m.$$typeof===o||m.$$typeof===c||m.$$typeof===w||m.$$typeof===O||m.$$typeof===h||m.$$typeof===R)},gt.typeOf=T,gt}var xv;function iU(){return xv||(xv=1,Ad.exports=nU()),Ad.exports}var Od,Kv;function aU(){if(Kv)return Od;Kv=1;var e=iU(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=n,a[e.Memo]=i;function s(_){return e.isMemo(_)?i:a[_.$$typeof]||t}var o=Object.defineProperty,u=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;function f(_,R,w){if(typeof R!="string"){if(p){var O=d(R);O&&O!==p&&f(_,O,w)}var h=u(R);l&&(h=h.concat(l(R)));for(var T=s(_),b=s(R),m=0;m<h.length;++m){var v=h[m];if(!r[v]&&!(w&&w[v])&&!(b&&b[v])&&!(T&&T[v])){var A=c(R,v);try{o(_,v,A)}catch{}}}}return _}return Od=f,Od}aU();const sU=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function oU(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}const Xv={componentStack:null,error:null,eventId:null};function uU(e,t){const r=new WeakMap;function n(i,a){if(!r.has(i)){if(i.cause)return r.set(i,!0),n(i.cause,a);i.cause=a}}n(e,t)}class Cl extends
|
|
34
|
+
*/var Yv;function nU(){if(Yv)return gt;Yv=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,_=e?Symbol.for("react.lazy"):60116,R=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function T(m){if(typeof m=="object"&&m!==null){var v=m.$$typeof;switch(v){case t:switch(m=m.type,m){case u:case l:case n:case a:case i:case d:return m;default:switch(m=m&&m.$$typeof,m){case o:case c:case _:case f:case s:return m;default:return v}}case r:return v}}}function b(m){return T(m)===l}return gt.AsyncMode=u,gt.ConcurrentMode=l,gt.ContextConsumer=o,gt.ContextProvider=s,gt.Element=t,gt.ForwardRef=c,gt.Fragment=n,gt.Lazy=_,gt.Memo=f,gt.Portal=r,gt.Profiler=a,gt.StrictMode=i,gt.Suspense=d,gt.isAsyncMode=function(m){return b(m)||T(m)===u},gt.isConcurrentMode=b,gt.isContextConsumer=function(m){return T(m)===o},gt.isContextProvider=function(m){return T(m)===s},gt.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},gt.isForwardRef=function(m){return T(m)===c},gt.isFragment=function(m){return T(m)===n},gt.isLazy=function(m){return T(m)===_},gt.isMemo=function(m){return T(m)===f},gt.isPortal=function(m){return T(m)===r},gt.isProfiler=function(m){return T(m)===a},gt.isStrictMode=function(m){return T(m)===i},gt.isSuspense=function(m){return T(m)===d},gt.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===l||m===a||m===i||m===d||m===p||typeof m=="object"&&m!==null&&(m.$$typeof===_||m.$$typeof===f||m.$$typeof===s||m.$$typeof===o||m.$$typeof===c||m.$$typeof===w||m.$$typeof===O||m.$$typeof===h||m.$$typeof===R)},gt.typeOf=T,gt}var xv;function iU(){return xv||(xv=1,Ad.exports=nU()),Ad.exports}var Od,Kv;function aU(){if(Kv)return Od;Kv=1;var e=iU(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=n,a[e.Memo]=i;function s(_){return e.isMemo(_)?i:a[_.$$typeof]||t}var o=Object.defineProperty,u=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;function f(_,R,w){if(typeof R!="string"){if(p){var O=d(R);O&&O!==p&&f(_,O,w)}var h=u(R);l&&(h=h.concat(l(R)));for(var T=s(_),b=s(R),m=0;m<h.length;++m){var v=h[m];if(!r[v]&&!(w&&w[v])&&!(b&&b[v])&&!(T&&T[v])){var A=c(R,v);try{o(_,v,A)}catch{}}}}return _}return Od=f,Od}aU();const sU=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function oU(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}const Xv={componentStack:null,error:null,eventId:null};function uU(e,t){const r=new WeakMap;function n(i,a){if(!r.has(i)){if(i.cause)return r.set(i,!0),n(i.cause,a);i.cause=a}}n(e,t)}class Cl extends Me.Component{constructor(t){super(t),Cl.prototype.__init.call(this),this.state=Xv,this._openFallbackReportDialog=!0;const r=gr();r&&r.on&&t.showDialog&&(this._openFallbackReportDialog=!1,r.on("afterSendEvent",n=>{!n.type&&n.event_id===this._lastEventId&&Wv({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,{componentStack:r}){const{beforeCapture:n,onError:i,showDialog:a,dialogOptions:s}=this.props;MN(o=>{if(oU(Me.version)&&m_(t)){const l=new Error(t.message);l.name=`React ErrorBoundary ${t.name}`,l.stack=r,uU(t,l)}n&&n(o,t,r);const u=R_(t,{captureContext:{contexts:{react:{componentStack:r}}},mechanism:{handled:!!this.props.fallback}});i&&i(t,r,u),a&&(this._lastEventId=u,this._openFallbackReportDialog&&Wv({...s,eventId:u})),this.setState({error:t,componentStack:r,eventId:u})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:r,eventId:n}=this.state,{onUnmount:i}=this.props;i&&i(t,r,n)}__init(){this.resetErrorBoundary=()=>{const{onReset:t}=this.props,{error:r,componentStack:n,eventId:i}=this.state;t&&t(r,n,i),this.setState(Xv)}}render(){const{fallback:t,children:r}=this.props,n=this.state;if(n.error){let i;return typeof t=="function"?i=t({error:n.error,componentStack:n.componentStack,resetError:this.resetErrorBoundary,eventId:n.eventId}):i=t,Me.isValidElement(i)?i:(t&&sU&&Re.warn("fallback did not produce a valid ReactElement"),null)}return typeof r=="function"?r():r}}const cU=Me.lazy(()=>Gt(()=>import("./index-DlIuq6jd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.Navbar})));function lU(e){return J.jsx(Me.Suspense,{fallback:J.jsx("div",{className:"topnav-skeleton","aria-hidden":!0}),children:J.jsx(cU,{...e})})}const dU={},Jv=e=>{let t;const r=new Set,n=(c,d)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const f=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(_=>_(t,f))}},i=()=>t,u={setState:n,getState:i,getInitialState:()=>l,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{(dU?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},l=t=e(n,i,u);return u},fU=e=>e?Jv(e):Jv;var Nd={exports:{}},Pd={},Cd={exports:{}},Md={};/**
|
|
35
35
|
* @license React
|
|
36
36
|
* use-sync-external-store-shim.production.js
|
|
37
37
|
*
|
|
@@ -66,12 +66,12 @@ Error:`,i)}}function iB(){return Hq(e=>{Ss("cls",{metric:e}),dP=e},{reportAllCha
|
|
|
66
66
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
67
67
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
68
68
|
* @license MIT
|
|
69
|
-
*/(function(y){(function(){var S="input is invalid type",C=typeof window=="object",K=C?window:{};K.JS_SHA3_NO_WINDOW&&(C=!1);var ee=!C&&typeof self=="object";!K.JS_SHA3_NO_NODE_JS&&typeof yl=="object"&&yl.versions&&yl.versions.node?K=sg:ee&&(K=self);var oe=!K.JS_SHA3_NO_COMMON_JS&&y.exports,ve=!K.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",Pe="0123456789abcdef".split(""),He=[4,1024,262144,67108864],Ge=[0,8,16,24],cr=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],qt=[224,256,384,512],Me=[128,256],Kt=["hex","buffer","arrayBuffer","array","digest"],It={128:168,256:136};!K.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),!ve||!K.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});for(var Rt=function(g,B,Q){return function(H){return new lt(g,B,g).update(H)[Q]()}},ir=function(g,B,Q){return function(H,te){return new lt(g,B,te).update(H)[Q]()}},In=function(g,B,Q){return function(H,te,re,ae){return Xt["cshake"+g].update(H,te,re,ae)[Q]()}},on=function(g,B,Q){return function(H,te,re,ae){return Xt["kmac"+g].update(H,te,re,ae)[Q]()}},ar=function(g,B,Q,H){for(var te=0;te<Kt.length;++te){var re=Kt[te];g[re]=B(Q,H,re)}return g},un=function(g,B){var Q=Rt(g,B,"hex");return Q.create=function(){return new lt(g,B,g)},Q.update=function(H){return Q.create().update(H)},ar(Q,Rt,g,B)},Gn=[{name:"keccak",padding:[1,256,65536,16777216],bits:qt,createMethod:un},{name:"sha3",padding:[6,1536,393216,100663296],bits:qt,createMethod:un},{name:"shake",padding:[31,7936,2031616,520093696],bits:Me,createMethod:function(g,B){var Q=ir(g,B,"hex");return Q.create=function(H){return new lt(g,B,H)},Q.update=function(H,te){return Q.create(te).update(H)},ar(Q,ir,g,B)}},{name:"cshake",padding:He,bits:Me,createMethod:function(g,B){var Q=It[g],H=In(g,0,"hex");return H.create=function(te,re,ae){return re||ae?new lt(g,B,te).bytepad([re,ae],Q):Xt["shake"+g].create(te)},H.update=function(te,re,ae,pe){return H.create(re,ae,pe).update(te)},ar(H,In,g,B)}},{name:"kmac",padding:He,bits:Me,createMethod:function(g,B){var Q=It[g],H=on(g,0,"hex");return H.create=function(te,re,ae){return new Ar(g,B,re).bytepad(["KMAC",ae],Q).bytepad([te],Q)},H.update=function(te,re,ae,pe){return H.create(te,ae,pe).update(re)},ar(H,on,g,B)}}],Xt={},Rn=[],sr=0;sr<Gn.length;++sr)for(var cn=Gn[sr],Ae=cn.bits,wn=0;wn<Ae.length;++wn){var Na=cn.name+"_"+Ae[wn];if(Rn.push(Na),Xt[Na]=cn.createMethod(Ae[wn],cn.padding),cn.name!=="sha3"){var Pa=cn.name+Ae[wn];Rn.push(Pa),Xt[Pa]=Xt[Na]}}function lt(g,B,Q){this.blocks=[],this.s=[],this.padding=B,this.outputBits=Q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(g<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Q>>5,this.extraBytes=(31&Q)>>3;for(var H=0;H<50;++H)this.s[H]=0}function Ar(g,B,Q){lt.call(this,g,B,Q)}lt.prototype.update=function(g){if(this.finalized)throw new Error("finalize already called");var B,Q=typeof g;if(Q!=="string"){if(Q!=="object")throw new Error(S);if(g===null)throw new Error(S);if(ve&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!(Array.isArray(g)||ve&&ArrayBuffer.isView(g)))throw new Error(S);B=!0}for(var H,te,re=this.blocks,ae=this.byteCount,pe=g.length,ye=this.blockCount,he=0,Ce=this.s;he<pe;){if(this.reset)for(this.reset=!1,re[0]=this.block,H=1;H<ye+1;++H)re[H]=0;if(B)for(H=this.start;he<pe&&H<ae;++he)re[H>>2]|=g[he]<<Ge[3&H++];else for(H=this.start;he<pe&&H<ae;++he)(te=g.charCodeAt(he))<128?re[H>>2]|=te<<Ge[3&H++]:te<2048?(re[H>>2]|=(192|te>>6)<<Ge[3&H++],re[H>>2]|=(128|63&te)<<Ge[3&H++]):te<55296||te>=57344?(re[H>>2]|=(224|te>>12)<<Ge[3&H++],re[H>>2]|=(128|te>>6&63)<<Ge[3&H++],re[H>>2]|=(128|63&te)<<Ge[3&H++]):(te=65536+((1023&te)<<10|1023&g.charCodeAt(++he)),re[H>>2]|=(240|te>>18)<<Ge[3&H++],re[H>>2]|=(128|te>>12&63)<<Ge[3&H++],re[H>>2]|=(128|te>>6&63)<<Ge[3&H++],re[H>>2]|=(128|63&te)<<Ge[3&H++]);if(this.lastByteIndex=H,H>=ae){for(this.start=H-ae,this.block=re[ye],H=0;H<ye;++H)Ce[H]^=re[H];k(Ce),this.reset=!0}else this.start=H}return this},lt.prototype.encode=function(g,B){var Q=255&g,H=1,te=[Q];for(Q=255&(g>>=8);Q>0;)te.unshift(Q),Q=255&(g>>=8),++H;return B?te.push(H):te.unshift(H),this.update(te),te.length},lt.prototype.encodeString=function(g){var B,Q=typeof g;if(Q!=="string"){if(Q!=="object")throw new Error(S);if(g===null)throw new Error(S);if(ve&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!(Array.isArray(g)||ve&&ArrayBuffer.isView(g)))throw new Error(S);B=!0}var H=0,te=g.length;if(B)H=te;else for(var re=0;re<g.length;++re){var ae=g.charCodeAt(re);ae<128?H+=1:ae<2048?H+=2:ae<55296||ae>=57344?H+=3:(ae=65536+((1023&ae)<<10|1023&g.charCodeAt(++re)),H+=4)}return H+=this.encode(8*H),this.update(g),H},lt.prototype.bytepad=function(g,B){for(var Q=this.encode(B),H=0;H<g.length;++H)Q+=this.encodeString(g[H]);var te=B-Q%B,re=[];return re.length=te,this.update(re),this},lt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,B=this.lastByteIndex,Q=this.blockCount,H=this.s;if(g[B>>2]|=this.padding[3&B],this.lastByteIndex===this.byteCount)for(g[0]=g[Q],B=1;B<Q+1;++B)g[B]=0;for(g[Q-1]|=2147483648,B=0;B<Q;++B)H[B]^=g[B];k(H)}},lt.prototype.toString=lt.prototype.hex=function(){this.finalize();for(var g,B=this.blockCount,Q=this.s,H=this.outputBlocks,te=this.extraBytes,re=0,ae=0,pe="";ae<H;){for(re=0;re<B&&ae<H;++re,++ae)g=Q[re],pe+=Pe[g>>4&15]+Pe[15&g]+Pe[g>>12&15]+Pe[g>>8&15]+Pe[g>>20&15]+Pe[g>>16&15]+Pe[g>>28&15]+Pe[g>>24&15];ae%B==0&&(k(Q),re=0)}return te&&(g=Q[re],pe+=Pe[g>>4&15]+Pe[15&g],te>1&&(pe+=Pe[g>>12&15]+Pe[g>>8&15]),te>2&&(pe+=Pe[g>>20&15]+Pe[g>>16&15])),pe},lt.prototype.arrayBuffer=function(){this.finalize();var g,B=this.blockCount,Q=this.s,H=this.outputBlocks,te=this.extraBytes,re=0,ae=0,pe=this.outputBits>>3;g=te?new ArrayBuffer(H+1<<2):new ArrayBuffer(pe);for(var ye=new Uint32Array(g);ae<H;){for(re=0;re<B&&ae<H;++re,++ae)ye[ae]=Q[re];ae%B==0&&k(Q)}return te&&(ye[re]=Q[re],g=g.slice(0,pe)),g},lt.prototype.buffer=lt.prototype.arrayBuffer,lt.prototype.digest=lt.prototype.array=function(){this.finalize();for(var g,B,Q=this.blockCount,H=this.s,te=this.outputBlocks,re=this.extraBytes,ae=0,pe=0,ye=[];pe<te;){for(ae=0;ae<Q&&pe<te;++ae,++pe)g=pe<<2,B=H[ae],ye[g]=255&B,ye[g+1]=B>>8&255,ye[g+2]=B>>16&255,ye[g+3]=B>>24&255;pe%Q==0&&k(H)}return re&&(g=pe<<2,B=H[ae],ye[g]=255&B,re>1&&(ye[g+1]=B>>8&255),re>2&&(ye[g+2]=B>>16&255)),ye},Ar.prototype=new lt,Ar.prototype.finalize=function(){return this.encode(this.outputBits,!0),lt.prototype.finalize.call(this)};var k=function(g){var B,Q,H,te,re,ae,pe,ye,he,Ce,Ve,Ye,it,wt,jt,et,dt,Ut,An,zn,Wn,lr,ln,Jt,Ft,St,lu,du,fu,pu,mu,hu,yu,gu,_u,Eu,vu,bu,Tu,Su,Iu,Ru,wu,Au,Ou,Nu,Pu,Cu,Mu,Du,ju,Lu,$u,qu,Bu,ku,Uu,Fu,Hu,Vu,Gu,zu,Wu;for(H=0;H<48;H+=2)te=g[0]^g[10]^g[20]^g[30]^g[40],re=g[1]^g[11]^g[21]^g[31]^g[41],ae=g[2]^g[12]^g[22]^g[32]^g[42],pe=g[3]^g[13]^g[23]^g[33]^g[43],ye=g[4]^g[14]^g[24]^g[34]^g[44],he=g[5]^g[15]^g[25]^g[35]^g[45],Ce=g[6]^g[16]^g[26]^g[36]^g[46],Ve=g[7]^g[17]^g[27]^g[37]^g[47],B=(Ye=g[8]^g[18]^g[28]^g[38]^g[48])^(ae<<1|pe>>>31),Q=(it=g[9]^g[19]^g[29]^g[39]^g[49])^(pe<<1|ae>>>31),g[0]^=B,g[1]^=Q,g[10]^=B,g[11]^=Q,g[20]^=B,g[21]^=Q,g[30]^=B,g[31]^=Q,g[40]^=B,g[41]^=Q,B=te^(ye<<1|he>>>31),Q=re^(he<<1|ye>>>31),g[2]^=B,g[3]^=Q,g[12]^=B,g[13]^=Q,g[22]^=B,g[23]^=Q,g[32]^=B,g[33]^=Q,g[42]^=B,g[43]^=Q,B=ae^(Ce<<1|Ve>>>31),Q=pe^(Ve<<1|Ce>>>31),g[4]^=B,g[5]^=Q,g[14]^=B,g[15]^=Q,g[24]^=B,g[25]^=Q,g[34]^=B,g[35]^=Q,g[44]^=B,g[45]^=Q,B=ye^(Ye<<1|it>>>31),Q=he^(it<<1|Ye>>>31),g[6]^=B,g[7]^=Q,g[16]^=B,g[17]^=Q,g[26]^=B,g[27]^=Q,g[36]^=B,g[37]^=Q,g[46]^=B,g[47]^=Q,B=Ce^(te<<1|re>>>31),Q=Ve^(re<<1|te>>>31),g[8]^=B,g[9]^=Q,g[18]^=B,g[19]^=Q,g[28]^=B,g[29]^=Q,g[38]^=B,g[39]^=Q,g[48]^=B,g[49]^=Q,wt=g[0],jt=g[1],Nu=g[11]<<4|g[10]>>>28,Pu=g[10]<<4|g[11]>>>28,du=g[20]<<3|g[21]>>>29,fu=g[21]<<3|g[20]>>>29,Vu=g[31]<<9|g[30]>>>23,Gu=g[30]<<9|g[31]>>>23,Ru=g[40]<<18|g[41]>>>14,wu=g[41]<<18|g[40]>>>14,gu=g[2]<<1|g[3]>>>31,_u=g[3]<<1|g[2]>>>31,et=g[13]<<12|g[12]>>>20,dt=g[12]<<12|g[13]>>>20,Cu=g[22]<<10|g[23]>>>22,Mu=g[23]<<10|g[22]>>>22,pu=g[33]<<13|g[32]>>>19,mu=g[32]<<13|g[33]>>>19,zu=g[42]<<2|g[43]>>>30,Wu=g[43]<<2|g[42]>>>30,qu=g[5]<<30|g[4]>>>2,Bu=g[4]<<30|g[5]>>>2,Eu=g[14]<<6|g[15]>>>26,vu=g[15]<<6|g[14]>>>26,Ut=g[25]<<11|g[24]>>>21,An=g[24]<<11|g[25]>>>21,Du=g[34]<<15|g[35]>>>17,ju=g[35]<<15|g[34]>>>17,hu=g[45]<<29|g[44]>>>3,yu=g[44]<<29|g[45]>>>3,Jt=g[6]<<28|g[7]>>>4,Ft=g[7]<<28|g[6]>>>4,ku=g[17]<<23|g[16]>>>9,Uu=g[16]<<23|g[17]>>>9,bu=g[26]<<25|g[27]>>>7,Tu=g[27]<<25|g[26]>>>7,zn=g[36]<<21|g[37]>>>11,Wn=g[37]<<21|g[36]>>>11,Lu=g[47]<<24|g[46]>>>8,$u=g[46]<<24|g[47]>>>8,Au=g[8]<<27|g[9]>>>5,Ou=g[9]<<27|g[8]>>>5,St=g[18]<<20|g[19]>>>12,lu=g[19]<<20|g[18]>>>12,Fu=g[29]<<7|g[28]>>>25,Hu=g[28]<<7|g[29]>>>25,Su=g[38]<<8|g[39]>>>24,Iu=g[39]<<8|g[38]>>>24,lr=g[48]<<14|g[49]>>>18,ln=g[49]<<14|g[48]>>>18,g[0]=wt^~et&Ut,g[1]=jt^~dt&An,g[10]=Jt^~St&du,g[11]=Ft^~lu&fu,g[20]=gu^~Eu&bu,g[21]=_u^~vu&Tu,g[30]=Au^~Nu&Cu,g[31]=Ou^~Pu&Mu,g[40]=qu^~ku&Fu,g[41]=Bu^~Uu&Hu,g[2]=et^~Ut&zn,g[3]=dt^~An&Wn,g[12]=St^~du&pu,g[13]=lu^~fu&mu,g[22]=Eu^~bu&Su,g[23]=vu^~Tu&Iu,g[32]=Nu^~Cu&Du,g[33]=Pu^~Mu&ju,g[42]=ku^~Fu&Vu,g[43]=Uu^~Hu&Gu,g[4]=Ut^~zn&lr,g[5]=An^~Wn&ln,g[14]=du^~pu&hu,g[15]=fu^~mu&yu,g[24]=bu^~Su&Ru,g[25]=Tu^~Iu&wu,g[34]=Cu^~Du&Lu,g[35]=Mu^~ju&$u,g[44]=Fu^~Vu&zu,g[45]=Hu^~Gu&Wu,g[6]=zn^~lr&wt,g[7]=Wn^~ln&jt,g[16]=pu^~hu&Jt,g[17]=mu^~yu&Ft,g[26]=Su^~Ru&gu,g[27]=Iu^~wu&_u,g[36]=Du^~Lu&Au,g[37]=ju^~$u&Ou,g[46]=Vu^~zu&qu,g[47]=Gu^~Wu&Bu,g[8]=lr^~wt&et,g[9]=ln^~jt&dt,g[18]=hu^~Jt&St,g[19]=yu^~Ft&lu,g[28]=Ru^~gu&Eu,g[29]=wu^~_u&vu,g[38]=Lu^~Au&Nu,g[39]=$u^~Ou&Pu,g[48]=zu^~qu&ku,g[49]=Wu^~Bu&Uu,g[0]^=cr[H],g[1]^=cr[H+1]};if(oe)y.exports=Xt;else for(sr=0;sr<Rn.length;++sr)K[Rn[sr]]=Xt[Rn[sr]]})()})(o);var u=o.exports,l=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,c=Math.ceil,d=Math.floor,p="[BigNumber Error] ",f=p+"Number primitive has more than 15 significant digits: ",_=1e14,R=14,w=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,T=1e9;function b(y){var S=0|y;return y>0||y===S?S:S-1}function m(y){for(var S,C,K=1,ee=y.length,oe=y[0]+"";K<ee;){for(S=y[K++]+"",C=R-S.length;C--;S="0"+S);oe+=S}for(ee=oe.length;oe.charCodeAt(--ee)===48;);return oe.slice(0,ee+1||1)}function v(y,S){var C,K,ee=y.c,oe=S.c,ve=y.s,Pe=S.s,He=y.e,Ge=S.e;if(!ve||!Pe)return null;if(C=ee&&!ee[0],K=oe&&!oe[0],C||K)return C?K?0:-Pe:ve;if(ve!=Pe)return ve;if(C=ve<0,K=He==Ge,!ee||!oe)return K?0:!ee^C?1:-1;if(!K)return He>Ge^C?1:-1;for(Pe=(He=ee.length)<(Ge=oe.length)?He:Ge,ve=0;ve<Pe;ve++)if(ee[ve]!=oe[ve])return ee[ve]>oe[ve]^C?1:-1;return He==Ge?0:He>Ge^C?1:-1}function A(y,S,C,K){if(y<S||y>C||y!==d(y))throw Error(p+(K||"Argument")+(typeof y=="number"?y<S||y>C?" out of range: ":" not an integer: ":" not a primitive number: ")+String(y))}function P(y){var S=y.c.length-1;return b(y.e/R)==S&&y.c[S]%2!=0}function q(y,S){return(y.length>1?y.charAt(0)+"."+y.slice(1):y)+(S<0?"e":"e+")+S}function z(y,S,C){var K,ee;if(S<0){for(ee=C+".";++S;ee+=C);y=ee+y}else if(++S>(K=y.length)){for(ee=C,S-=K;--S;ee+=C);y+=ee}else S<K&&(y=y.slice(0,S)+"."+y.slice(S));return y}var Y=(function y(S){var C,K,ee,oe,ve,Pe,He,Ge,cr,qt,Me=Ae.prototype={constructor:Ae,toString:null,valueOf:null},Kt=new Ae(1),It=20,Rt=4,ir=-7,In=21,on=-1e7,ar=1e7,un=!1,Gn=1,Xt=0,Rn={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},sr="0123456789abcdefghijklmnopqrstuvwxyz",cn=!0;function Ae(k,g){var B,Q,H,te,re,ae,pe,ye,he=this;if(!(he instanceof Ae))return new Ae(k,g);if(g==null){if(k&&k._isBigNumber===!0)return he.s=k.s,void(!k.c||k.e>ar?he.c=he.e=null:k.e<on?he.c=[he.e=0]:(he.e=k.e,he.c=k.c.slice()));if((ae=typeof k=="number")&&0*k==0){if(he.s=1/k<0?(k=-k,-1):1,k===~~k){for(te=0,re=k;re>=10;re/=10,te++);return void(te>ar?he.c=he.e=null:(he.e=te,he.c=[k]))}ye=String(k)}else{if(!l.test(ye=String(k)))return ee(he,ye,ae);he.s=ye.charCodeAt(0)==45?(ye=ye.slice(1),-1):1}(te=ye.indexOf("."))>-1&&(ye=ye.replace(".","")),(re=ye.search(/e/i))>0?(te<0&&(te=re),te+=+ye.slice(re+1),ye=ye.substring(0,re)):te<0&&(te=ye.length)}else{if(A(g,2,sr.length,"Base"),g==10&&cn)return lt(he=new Ae(k),It+he.e+1,Rt);if(ye=String(k),ae=typeof k=="number"){if(0*k!=0)return ee(he,ye,ae,g);if(he.s=1/k<0?(ye=ye.slice(1),-1):1,Ae.DEBUG&&ye.replace(/^0\.0*|\./,"").length>15)throw Error(f+k)}else he.s=ye.charCodeAt(0)===45?(ye=ye.slice(1),-1):1;for(B=sr.slice(0,g),te=re=0,pe=ye.length;re<pe;re++)if(B.indexOf(Q=ye.charAt(re))<0){if(Q=="."){if(re>te){te=pe;continue}}else if(!H&&(ye==ye.toUpperCase()&&(ye=ye.toLowerCase())||ye==ye.toLowerCase()&&(ye=ye.toUpperCase()))){H=!0,re=-1,te=0;continue}return ee(he,String(k),ae,g)}ae=!1,(te=(ye=K(ye,g,10,he.s)).indexOf("."))>-1?ye=ye.replace(".",""):te=ye.length}for(re=0;ye.charCodeAt(re)===48;re++);for(pe=ye.length;ye.charCodeAt(--pe)===48;);if(ye=ye.slice(re,++pe)){if(pe-=re,ae&&Ae.DEBUG&&pe>15&&(k>w||k!==d(k)))throw Error(f+he.s*k);if((te=te-re-1)>ar)he.c=he.e=null;else if(te<on)he.c=[he.e=0];else{if(he.e=te,he.c=[],re=(te+1)%R,te<0&&(re+=R),re<pe){for(re&&he.c.push(+ye.slice(0,re)),pe-=R;re<pe;)he.c.push(+ye.slice(re,re+=R));re=R-(ye=ye.slice(re)).length}else re-=pe;for(;re--;ye+="0");he.c.push(+ye)}}else he.c=[he.e=0]}function wn(k,g,B,Q){var H,te,re,ae,pe;if(B==null?B=Rt:A(B,0,8),!k.c)return k.toString();if(H=k.c[0],re=k.e,g==null)pe=m(k.c),pe=Q==1||Q==2&&(re<=ir||re>=In)?q(pe,re):z(pe,re,"0");else if(te=(k=lt(new Ae(k),g,B)).e,ae=(pe=m(k.c)).length,Q==1||Q==2&&(g<=te||te<=ir)){for(;ae<g;pe+="0",ae++);pe=q(pe,te)}else if(g-=re,pe=z(pe,te,"0"),te+1>ae){if(--g>0)for(pe+=".";g--;pe+="0");}else if((g+=te-ae)>0)for(te+1==ae&&(pe+=".");g--;pe+="0");return k.s<0&&H?"-"+pe:pe}function Na(k,g){for(var B,Q=1,H=new Ae(k[0]);Q<k.length;Q++){if(!(B=new Ae(k[Q])).s){H=B;break}g.call(H,B)&&(H=B)}return H}function Pa(k,g,B){for(var Q=1,H=g.length;!g[--H];g.pop());for(H=g[0];H>=10;H/=10,Q++);return(B=Q+B*R-1)>ar?k.c=k.e=null:B<on?k.c=[k.e=0]:(k.e=B,k.c=g),k}function lt(k,g,B,Q){var H,te,re,ae,pe,ye,he,Ce=k.c,Ve=O;if(Ce){e:{for(H=1,ae=Ce[0];ae>=10;ae/=10,H++);if((te=g-H)<0)te+=R,re=g,he=(pe=Ce[ye=0])/Ve[H-re-1]%10|0;else if((ye=c((te+1)/R))>=Ce.length){if(!Q)break e;for(;Ce.length<=ye;Ce.push(0));pe=he=0,H=1,re=(te%=R)-R+1}else{for(pe=ae=Ce[ye],H=1;ae>=10;ae/=10,H++);he=(re=(te%=R)-R+H)<0?0:pe/Ve[H-re-1]%10|0}if(Q=Q||g<0||Ce[ye+1]!=null||(re<0?pe:pe%Ve[H-re-1]),Q=B<4?(he||Q)&&(B==0||B==(k.s<0?3:2)):he>5||he==5&&(B==4||Q||B==6&&(te>0?re>0?pe/Ve[H-re]:0:Ce[ye-1])%10&1||B==(k.s<0?8:7)),g<1||!Ce[0])return Ce.length=0,Q?(g-=k.e+1,Ce[0]=Ve[(R-g%R)%R],k.e=-g||0):Ce[0]=k.e=0,k;if(te==0?(Ce.length=ye,ae=1,ye--):(Ce.length=ye+1,ae=Ve[R-te],Ce[ye]=re>0?d(pe/Ve[H-re]%Ve[re])*ae:0),Q)for(;;){if(ye==0){for(te=1,re=Ce[0];re>=10;re/=10,te++);for(re=Ce[0]+=ae,ae=1;re>=10;re/=10,ae++);te!=ae&&(k.e++,Ce[0]==_&&(Ce[0]=1));break}if(Ce[ye]+=ae,Ce[ye]!=_)break;Ce[ye--]=0,ae=1}for(te=Ce.length;Ce[--te]===0;Ce.pop());}k.e>ar?k.c=k.e=null:k.e<on&&(k.c=[k.e=0])}return k}function Ar(k){var g,B=k.e;return B===null?k.toString():(g=m(k.c),g=B<=ir||B>=In?q(g,B):z(g,B,"0"),k.s<0?"-"+g:g)}return Ae.clone=y,Ae.ROUND_UP=0,Ae.ROUND_DOWN=1,Ae.ROUND_CEIL=2,Ae.ROUND_FLOOR=3,Ae.ROUND_HALF_UP=4,Ae.ROUND_HALF_DOWN=5,Ae.ROUND_HALF_EVEN=6,Ae.ROUND_HALF_CEIL=7,Ae.ROUND_HALF_FLOOR=8,Ae.EUCLID=9,Ae.config=Ae.set=function(k){var g,B;if(k!=null){if(typeof k!="object")throw Error(p+"Object expected: "+k);if(k.hasOwnProperty(g="DECIMAL_PLACES")&&(A(B=k[g],0,T,g),It=B),k.hasOwnProperty(g="ROUNDING_MODE")&&(A(B=k[g],0,8,g),Rt=B),k.hasOwnProperty(g="EXPONENTIAL_AT")&&((B=k[g])&&B.pop?(A(B[0],-T,0,g),A(B[1],0,T,g),ir=B[0],In=B[1]):(A(B,-T,T,g),ir=-(In=B<0?-B:B))),k.hasOwnProperty(g="RANGE"))if((B=k[g])&&B.pop)A(B[0],-T,-1,g),A(B[1],1,T,g),on=B[0],ar=B[1];else{if(A(B,-T,T,g),!B)throw Error(p+g+" cannot be zero: "+B);on=-(ar=B<0?-B:B)}if(k.hasOwnProperty(g="CRYPTO")){if((B=k[g])!==!!B)throw Error(p+g+" not true or false: "+B);if(B){if(typeof crypto>"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw un=!B,Error(p+"crypto unavailable");un=B}else un=B}if(k.hasOwnProperty(g="MODULO_MODE")&&(A(B=k[g],0,9,g),Gn=B),k.hasOwnProperty(g="POW_PRECISION")&&(A(B=k[g],0,T,g),Xt=B),k.hasOwnProperty(g="FORMAT")){if(typeof(B=k[g])!="object")throw Error(p+g+" not an object: "+B);Rn=B}if(k.hasOwnProperty(g="ALPHABET")){if(typeof(B=k[g])!="string"||/^.?$|[+\-.\s]|(.).*\1/.test(B))throw Error(p+g+" invalid: "+B);cn=B.slice(0,10)=="0123456789",sr=B}}return{DECIMAL_PLACES:It,ROUNDING_MODE:Rt,EXPONENTIAL_AT:[ir,In],RANGE:[on,ar],CRYPTO:un,MODULO_MODE:Gn,POW_PRECISION:Xt,FORMAT:Rn,ALPHABET:sr}},Ae.isBigNumber=function(k){if(!k||k._isBigNumber!==!0)return!1;if(!Ae.DEBUG)return!0;var g,B,Q=k.c,H=k.e,te=k.s;e:if({}.toString.call(Q)=="[object Array]"){if((te===1||te===-1)&&H>=-T&&H<=T&&H===d(H)){if(Q[0]===0){if(H===0&&Q.length===1)return!0;break e}if((g=(H+1)%R)<1&&(g+=R),String(Q[0]).length==g){for(g=0;g<Q.length;g++)if((B=Q[g])<0||B>=_||B!==d(B))break e;if(B!==0)return!0}}}else if(Q===null&&H===null&&(te===null||te===1||te===-1))return!0;throw Error(p+"Invalid BigNumber: "+k)},Ae.maximum=Ae.max=function(){return Na(arguments,Me.lt)},Ae.minimum=Ae.min=function(){return Na(arguments,Me.gt)},Ae.random=(oe=9007199254740992,ve=Math.random()*oe&2097151?function(){return d(Math.random()*oe)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(k){var g,B,Q,H,te,re=0,ae=[],pe=new Ae(Kt);if(k==null?k=It:A(k,0,T),H=c(k/R),un)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(H*=2));re<H;)(te=131072*g[re]+(g[re+1]>>>11))>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),g[re]=B[0],g[re+1]=B[1]):(ae.push(te%1e14),re+=2);re=H/2}else{if(!crypto.randomBytes)throw un=!1,Error(p+"crypto unavailable");for(g=crypto.randomBytes(H*=7);re<H;)(te=281474976710656*(31&g[re])+1099511627776*g[re+1]+4294967296*g[re+2]+16777216*g[re+3]+(g[re+4]<<16)+(g[re+5]<<8)+g[re+6])>=9e15?crypto.randomBytes(7).copy(g,re):(ae.push(te%1e14),re+=7);re=H/7}if(!un)for(;re<H;)(te=ve())<9e15&&(ae[re++]=te%1e14);for(H=ae[--re],k%=R,H&&k&&(te=O[R-k],ae[re]=d(H/te)*te);ae[re]===0;ae.pop(),re--);if(re<0)ae=[Q=0];else{for(Q=-1;ae[0]===0;ae.splice(0,1),Q-=R);for(re=1,te=ae[0];te>=10;te/=10,re++);re<R&&(Q-=R-re)}return pe.e=Q,pe.c=ae,pe}),Ae.sum=function(){for(var k=1,g=arguments,B=new Ae(g[0]);k<g.length;)B=B.plus(g[k++]);return B},K=(function(){var k="0123456789";function g(B,Q,H,te){for(var re,ae,pe=[0],ye=0,he=B.length;ye<he;){for(ae=pe.length;ae--;pe[ae]*=Q);for(pe[0]+=te.indexOf(B.charAt(ye++)),re=0;re<pe.length;re++)pe[re]>H-1&&(pe[re+1]==null&&(pe[re+1]=0),pe[re+1]+=pe[re]/H|0,pe[re]%=H)}return pe.reverse()}return function(B,Q,H,te,re){var ae,pe,ye,he,Ce,Ve,Ye,it,wt=B.indexOf("."),jt=It,et=Rt;for(wt>=0&&(he=Xt,Xt=0,B=B.replace(".",""),Ve=(it=new Ae(Q)).pow(B.length-wt),Xt=he,it.c=g(z(m(Ve.c),Ve.e,"0"),10,H,k),it.e=it.c.length),ye=he=(Ye=g(B,Q,H,re?(ae=sr,k):(ae=k,sr))).length;Ye[--he]==0;Ye.pop());if(!Ye[0])return ae.charAt(0);if(wt<0?--ye:(Ve.c=Ye,Ve.e=ye,Ve.s=te,Ye=(Ve=C(Ve,it,jt,et,H)).c,Ce=Ve.r,ye=Ve.e),wt=Ye[pe=ye+jt+1],he=H/2,Ce=Ce||pe<0||Ye[pe+1]!=null,Ce=et<4?(wt!=null||Ce)&&(et==0||et==(Ve.s<0?3:2)):wt>he||wt==he&&(et==4||Ce||et==6&&1&Ye[pe-1]||et==(Ve.s<0?8:7)),pe<1||!Ye[0])B=Ce?z(ae.charAt(1),-jt,ae.charAt(0)):ae.charAt(0);else{if(Ye.length=pe,Ce)for(--H;++Ye[--pe]>H;)Ye[pe]=0,pe||(++ye,Ye=[1].concat(Ye));for(he=Ye.length;!Ye[--he];);for(wt=0,B="";wt<=he;B+=ae.charAt(Ye[wt++]));B=z(B,ye,ae.charAt(0))}return B}})(),C=(function(){function k(Q,H,te){var re,ae,pe,ye,he=0,Ce=Q.length,Ve=H%h,Ye=H/h|0;for(Q=Q.slice();Ce--;)he=((ae=Ve*(pe=Q[Ce]%h)+(re=Ye*pe+(ye=Q[Ce]/h|0)*Ve)%h*h+he)/te|0)+(re/h|0)+Ye*ye,Q[Ce]=ae%te;return he&&(Q=[he].concat(Q)),Q}function g(Q,H,te,re){var ae,pe;if(te!=re)pe=te>re?1:-1;else for(ae=pe=0;ae<te;ae++)if(Q[ae]!=H[ae]){pe=Q[ae]>H[ae]?1:-1;break}return pe}function B(Q,H,te,re){for(var ae=0;te--;)Q[te]-=ae,ae=Q[te]<H[te]?1:0,Q[te]=ae*re+Q[te]-H[te];for(;!Q[0]&&Q.length>1;Q.splice(0,1));}return function(Q,H,te,re,ae){var pe,ye,he,Ce,Ve,Ye,it,wt,jt,et,dt,Ut,An,zn,Wn,lr,ln,Jt=Q.s==H.s?1:-1,Ft=Q.c,St=H.c;if(!(Ft&&Ft[0]&&St&&St[0]))return new Ae(Q.s&&H.s&&(Ft?!St||Ft[0]!=St[0]:St)?Ft&&Ft[0]==0||!St?0*Jt:Jt/0:NaN);for(jt=(wt=new Ae(Jt)).c=[],Jt=te+(ye=Q.e-H.e)+1,ae||(ae=_,ye=b(Q.e/R)-b(H.e/R),Jt=Jt/R|0),he=0;St[he]==(Ft[he]||0);he++);if(St[he]>(Ft[he]||0)&&ye--,Jt<0)jt.push(1),Ce=!0;else{for(zn=Ft.length,lr=St.length,he=0,Jt+=2,(Ve=d(ae/(St[0]+1)))>1&&(St=k(St,Ve,ae),Ft=k(Ft,Ve,ae),lr=St.length,zn=Ft.length),An=lr,dt=(et=Ft.slice(0,lr)).length;dt<lr;et[dt++]=0);ln=St.slice(),ln=[0].concat(ln),Wn=St[0],St[1]>=ae/2&&Wn++;do{if(Ve=0,(pe=g(St,et,lr,dt))<0){if(Ut=et[0],lr!=dt&&(Ut=Ut*ae+(et[1]||0)),(Ve=d(Ut/Wn))>1)for(Ve>=ae&&(Ve=ae-1),it=(Ye=k(St,Ve,ae)).length,dt=et.length;g(Ye,et,it,dt)==1;)Ve--,B(Ye,lr<it?ln:St,it,ae),it=Ye.length,pe=1;else Ve==0&&(pe=Ve=1),it=(Ye=St.slice()).length;if(it<dt&&(Ye=[0].concat(Ye)),B(et,Ye,dt,ae),dt=et.length,pe==-1)for(;g(St,et,lr,dt)<1;)Ve++,B(et,lr<dt?ln:St,dt,ae),dt=et.length}else pe===0&&(Ve++,et=[0]);jt[he++]=Ve,et[0]?et[dt++]=Ft[An]||0:(et=[Ft[An]],dt=1)}while((An++<zn||et[0]!=null)&&Jt--);Ce=et[0]!=null,jt[0]||jt.splice(0,1)}if(ae==_){for(he=1,Jt=jt[0];Jt>=10;Jt/=10,he++);lt(wt,te+(wt.e=he+ye*R-1)+1,re,Ce)}else wt.e=ye,wt.r=+Ce;return wt}})(),Pe=/^(-?)0([xbo])(?=\w[\w.]*$)/i,He=/^([^.]+)\.$/,Ge=/^\.([^.]+)$/,cr=/^-?(Infinity|NaN)$/,qt=/^\s*\+(?=[\w.])|^\s+|\s+$/g,ee=function(k,g,B,Q){var H,te=B?g:g.replace(qt,"");if(cr.test(te))k.s=isNaN(te)?null:te<0?-1:1;else{if(!B&&(te=te.replace(Pe,(function(re,ae,pe){return H=(pe=pe.toLowerCase())=="x"?16:pe=="b"?2:8,Q&&Q!=H?re:ae})),Q&&(H=Q,te=te.replace(He,"$1").replace(Ge,"0.$1")),g!=te))return new Ae(te,H);if(Ae.DEBUG)throw Error(p+"Not a"+(Q?" base "+Q:"")+" number: "+g);k.s=null}k.c=k.e=null},Me.absoluteValue=Me.abs=function(){var k=new Ae(this);return k.s<0&&(k.s=1),k},Me.comparedTo=function(k,g){return v(this,new Ae(k,g))},Me.decimalPlaces=Me.dp=function(k,g){var B,Q,H,te=this;if(k!=null)return A(k,0,T),g==null?g=Rt:A(g,0,8),lt(new Ae(te),k+te.e+1,g);if(!(B=te.c))return null;if(Q=((H=B.length-1)-b(this.e/R))*R,H=B[H])for(;H%10==0;H/=10,Q--);return Q<0&&(Q=0),Q},Me.dividedBy=Me.div=function(k,g){return C(this,new Ae(k,g),It,Rt)},Me.dividedToIntegerBy=Me.idiv=function(k,g){return C(this,new Ae(k,g),0,1)},Me.exponentiatedBy=Me.pow=function(k,g){var B,Q,H,te,re,ae,pe,ye,he=this;if((k=new Ae(k)).c&&!k.isInteger())throw Error(p+"Exponent not an integer: "+Ar(k));if(g!=null&&(g=new Ae(g)),re=k.e>14,!he.c||!he.c[0]||he.c[0]==1&&!he.e&&he.c.length==1||!k.c||!k.c[0])return ye=new Ae(Math.pow(+Ar(he),re?k.s*(2-P(k)):+Ar(k))),g?ye.mod(g):ye;if(ae=k.s<0,g){if(g.c?!g.c[0]:!g.s)return new Ae(NaN);(Q=!ae&&he.isInteger()&&g.isInteger())&&(he=he.mod(g))}else{if(k.e>9&&(he.e>0||he.e<-1||(he.e==0?he.c[0]>1||re&&he.c[1]>=24e7:he.c[0]<8e13||re&&he.c[0]<=9999975e7)))return te=he.s<0&&P(k)?-0:0,he.e>-1&&(te=1/te),new Ae(ae?1/te:te);Xt&&(te=c(Xt/R+2))}for(re?(B=new Ae(.5),ae&&(k.s=1),pe=P(k)):pe=(H=Math.abs(+Ar(k)))%2,ye=new Ae(Kt);;){if(pe){if(!(ye=ye.times(he)).c)break;te?ye.c.length>te&&(ye.c.length=te):Q&&(ye=ye.mod(g))}if(H){if((H=d(H/2))===0)break;pe=H%2}else if(lt(k=k.times(B),k.e+1,1),k.e>14)pe=P(k);else{if((H=+Ar(k))==0)break;pe=H%2}he=he.times(he),te?he.c&&he.c.length>te&&(he.c.length=te):Q&&(he=he.mod(g))}return Q?ye:(ae&&(ye=Kt.div(ye)),g?ye.mod(g):te?lt(ye,Xt,Rt,void 0):ye)},Me.integerValue=function(k){var g=new Ae(this);return k==null?k=Rt:A(k,0,8),lt(g,g.e+1,k)},Me.isEqualTo=Me.eq=function(k,g){return v(this,new Ae(k,g))===0},Me.isFinite=function(){return!!this.c},Me.isGreaterThan=Me.gt=function(k,g){return v(this,new Ae(k,g))>0},Me.isGreaterThanOrEqualTo=Me.gte=function(k,g){return(g=v(this,new Ae(k,g)))===1||g===0},Me.isInteger=function(){return!!this.c&&b(this.e/R)>this.c.length-2},Me.isLessThan=Me.lt=function(k,g){return v(this,new Ae(k,g))<0},Me.isLessThanOrEqualTo=Me.lte=function(k,g){return(g=v(this,new Ae(k,g)))===-1||g===0},Me.isNaN=function(){return!this.s},Me.isNegative=function(){return this.s<0},Me.isPositive=function(){return this.s>0},Me.isZero=function(){return!!this.c&&this.c[0]==0},Me.minus=function(k,g){var B,Q,H,te,re=this,ae=re.s;if(g=(k=new Ae(k,g)).s,!ae||!g)return new Ae(NaN);if(ae!=g)return k.s=-g,re.plus(k);var pe=re.e/R,ye=k.e/R,he=re.c,Ce=k.c;if(!pe||!ye){if(!he||!Ce)return he?(k.s=-g,k):new Ae(Ce?re:NaN);if(!he[0]||!Ce[0])return Ce[0]?(k.s=-g,k):new Ae(he[0]?re:Rt==3?-0:0)}if(pe=b(pe),ye=b(ye),he=he.slice(),ae=pe-ye){for((te=ae<0)?(ae=-ae,H=he):(ye=pe,H=Ce),H.reverse(),g=ae;g--;H.push(0));H.reverse()}else for(Q=(te=(ae=he.length)<(g=Ce.length))?ae:g,ae=g=0;g<Q;g++)if(he[g]!=Ce[g]){te=he[g]<Ce[g];break}if(te&&(H=he,he=Ce,Ce=H,k.s=-k.s),(g=(Q=Ce.length)-(B=he.length))>0)for(;g--;he[B++]=0);for(g=_-1;Q>ae;){if(he[--Q]<Ce[Q]){for(B=Q;B&&!he[--B];he[B]=g);--he[B],he[Q]+=_}he[Q]-=Ce[Q]}for(;he[0]==0;he.splice(0,1),--ye);return he[0]?Pa(k,he,ye):(k.s=Rt==3?-1:1,k.c=[k.e=0],k)},Me.modulo=Me.mod=function(k,g){var B,Q,H=this;return k=new Ae(k,g),!H.c||!k.s||k.c&&!k.c[0]?new Ae(NaN):!k.c||H.c&&!H.c[0]?new Ae(H):(Gn==9?(Q=k.s,k.s=1,B=C(H,k,0,3),k.s=Q,B.s*=Q):B=C(H,k,0,Gn),(k=H.minus(B.times(k))).c[0]||Gn!=1||(k.s=H.s),k)},Me.multipliedBy=Me.times=function(k,g){var B,Q,H,te,re,ae,pe,ye,he,Ce,Ve,Ye,it,wt,jt,et=this,dt=et.c,Ut=(k=new Ae(k,g)).c;if(!(dt&&Ut&&dt[0]&&Ut[0]))return!et.s||!k.s||dt&&!dt[0]&&!Ut||Ut&&!Ut[0]&&!dt?k.c=k.e=k.s=null:(k.s*=et.s,dt&&Ut?(k.c=[0],k.e=0):k.c=k.e=null),k;for(Q=b(et.e/R)+b(k.e/R),k.s*=et.s,(pe=dt.length)<(Ce=Ut.length)&&(it=dt,dt=Ut,Ut=it,H=pe,pe=Ce,Ce=H),H=pe+Ce,it=[];H--;it.push(0));for(wt=_,jt=h,H=Ce;--H>=0;){for(B=0,Ve=Ut[H]%jt,Ye=Ut[H]/jt|0,te=H+(re=pe);te>H;)B=((ye=Ve*(ye=dt[--re]%jt)+(ae=Ye*ye+(he=dt[re]/jt|0)*Ve)%jt*jt+it[te]+B)/wt|0)+(ae/jt|0)+Ye*he,it[te--]=ye%wt;it[te]=B}return B?++Q:it.splice(0,1),Pa(k,it,Q)},Me.negated=function(){var k=new Ae(this);return k.s=-k.s||null,k},Me.plus=function(k,g){var B,Q=this,H=Q.s;if(g=(k=new Ae(k,g)).s,!H||!g)return new Ae(NaN);if(H!=g)return k.s=-g,Q.minus(k);var te=Q.e/R,re=k.e/R,ae=Q.c,pe=k.c;if(!te||!re){if(!ae||!pe)return new Ae(H/0);if(!ae[0]||!pe[0])return pe[0]?k:new Ae(ae[0]?Q:0*H)}if(te=b(te),re=b(re),ae=ae.slice(),H=te-re){for(H>0?(re=te,B=pe):(H=-H,B=ae),B.reverse();H--;B.push(0));B.reverse()}for((H=ae.length)-(g=pe.length)<0&&(B=pe,pe=ae,ae=B,g=H),H=0;g;)H=(ae[--g]=ae[g]+pe[g]+H)/_|0,ae[g]=_===ae[g]?0:ae[g]%_;return H&&(ae=[H].concat(ae),++re),Pa(k,ae,re)},Me.precision=Me.sd=function(k,g){var B,Q,H,te=this;if(k!=null&&k!==!!k)return A(k,1,T),g==null?g=Rt:A(g,0,8),lt(new Ae(te),k,g);if(!(B=te.c))return null;if(Q=(H=B.length-1)*R+1,H=B[H]){for(;H%10==0;H/=10,Q--);for(H=B[0];H>=10;H/=10,Q++);}return k&&te.e+1>Q&&(Q=te.e+1),Q},Me.shiftedBy=function(k){return A(k,-9007199254740991,w),this.times("1e"+k)},Me.squareRoot=Me.sqrt=function(){var k,g,B,Q,H,te=this,re=te.c,ae=te.s,pe=te.e,ye=It+4,he=new Ae("0.5");if(ae!==1||!re||!re[0])return new Ae(!ae||ae<0&&(!re||re[0])?NaN:re?te:1/0);if((ae=Math.sqrt(+Ar(te)))==0||ae==1/0?(((g=m(re)).length+pe)%2==0&&(g+="0"),ae=Math.sqrt(+g),pe=b((pe+1)/2)-(pe<0||pe%2),B=new Ae(g=ae==1/0?"5e"+pe:(g=ae.toExponential()).slice(0,g.indexOf("e")+1)+pe)):B=new Ae(ae+""),B.c[0]){for((ae=(pe=B.e)+ye)<3&&(ae=0);;)if(H=B,B=he.times(H.plus(C(te,H,ye,1))),m(H.c).slice(0,ae)===(g=m(B.c)).slice(0,ae)){if(B.e<pe&&--ae,(g=g.slice(ae-3,ae+1))!="9999"&&(Q||g!="4999")){+g&&(+g.slice(1)||g.charAt(0)!="5")||(lt(B,B.e+It+2,1),k=!B.times(B).eq(te));break}if(!Q&&(lt(H,H.e+It+2,0),H.times(H).eq(te))){B=H;break}ye+=4,ae+=4,Q=1}}return lt(B,B.e+It+1,Rt,k)},Me.toExponential=function(k,g){return k!=null&&(A(k,0,T),k++),wn(this,k,g,1)},Me.toFixed=function(k,g){return k!=null&&(A(k,0,T),k=k+this.e+1),wn(this,k,g)},Me.toFormat=function(k,g,B){var Q,H=this;if(B==null)k!=null&&g&&typeof g=="object"?(B=g,g=null):k&&typeof k=="object"?(B=k,k=g=null):B=Rn;else if(typeof B!="object")throw Error(p+"Argument not an object: "+B);if(Q=H.toFixed(k,g),H.c){var te,re=Q.split("."),ae=+B.groupSize,pe=+B.secondaryGroupSize,ye=B.groupSeparator||"",he=re[0],Ce=re[1],Ve=H.s<0,Ye=Ve?he.slice(1):he,it=Ye.length;if(pe&&(te=ae,ae=pe,pe=te,it-=te),ae>0&&it>0){for(te=it%ae||ae,he=Ye.substr(0,te);te<it;te+=ae)he+=ye+Ye.substr(te,ae);pe>0&&(he+=ye+Ye.slice(te)),Ve&&(he="-"+he)}Q=Ce?he+(B.decimalSeparator||"")+((pe=+B.fractionGroupSize)?Ce.replace(new RegExp("\\d{"+pe+"}\\B","g"),"$&"+(B.fractionGroupSeparator||"")):Ce):he}return(B.prefix||"")+Q+(B.suffix||"")},Me.toFraction=function(k){var g,B,Q,H,te,re,ae,pe,ye,he,Ce,Ve,Ye=this,it=Ye.c;if(k!=null&&(!(ae=new Ae(k)).isInteger()&&(ae.c||ae.s!==1)||ae.lt(Kt)))throw Error(p+"Argument "+(ae.isInteger()?"out of range: ":"not an integer: ")+Ar(ae));if(!it)return new Ae(Ye);for(g=new Ae(Kt),ye=B=new Ae(Kt),Q=pe=new Ae(Kt),Ve=m(it),te=g.e=Ve.length-Ye.e-1,g.c[0]=O[(re=te%R)<0?R+re:re],k=!k||ae.comparedTo(g)>0?te>0?g:ye:ae,re=ar,ar=1/0,ae=new Ae(Ve),pe.c[0]=0;he=C(ae,g,0,1),(H=B.plus(he.times(Q))).comparedTo(k)!=1;)B=Q,Q=H,ye=pe.plus(he.times(H=ye)),pe=H,g=ae.minus(he.times(H=g)),ae=H;return H=C(k.minus(B),Q,0,1),pe=pe.plus(H.times(ye)),B=B.plus(H.times(Q)),pe.s=ye.s=Ye.s,Ce=C(ye,Q,te*=2,Rt).minus(Ye).abs().comparedTo(C(pe,B,te,Rt).minus(Ye).abs())<1?[ye,Q]:[pe,B],ar=re,Ce},Me.toNumber=function(){return+Ar(this)},Me.toPrecision=function(k,g){return k!=null&&A(k,1,T),wn(this,k,g,2)},Me.toString=function(k){var g,B=this,Q=B.s,H=B.e;return H===null?Q?(g="Infinity",Q<0&&(g="-"+g)):g="NaN":(k==null?g=H<=ir||H>=In?q(m(B.c),H):z(m(B.c),H,"0"):k===10&&cn?g=z(m((B=lt(new Ae(B),It+H+1,Rt)).c),B.e,"0"):(A(k,2,sr.length,"Base"),g=K(z(m(B.c),H,"0"),10,k,Q,!0)),Q<0&&B.c[0]&&(g="-"+g)),g},Me.valueOf=Me.toJSON=function(){return Ar(this)},Me._isBigNumber=!0,Me[Symbol.toStringTag]="BigNumber",Me[Symbol.for("nodejs.util.inspect.custom")]=Me.valueOf,S!=null&&Ae.set(S),Ae})();const W={ROUNDING_MODE:Y.ROUND_DOWN};function U(y){return new TextEncoder().encode(y)}function F(y){return typeof y=="string"?F(X(y)):new TextDecoder().decode(y)}Y.config(W);const ce="UNKNOWN_ERROR",se="INVALID_ARGUMENT";function ne(y,S=ce,C={}){const K=[];Object.keys(C).forEach((ve=>{try{K.push(ve+"="+JSON.stringify(C[ve]))}catch{K.push(ve+"="+JSON.stringify(C[ve].toString()))}}));const ee=y;K.length&&(y+=" ("+K.join(", ")+")");const oe=new Error(y);return oe.reason=ee,oe.code=S,Object.keys(C).forEach((function(ve){oe[ve]=C[ve]})),oe}function X(y){if(typeof y!="string")throw new Error("hexToBytes only accept strings, got: "+typeof y);if(y.substr(0,2)==="0x")return X(y.substr(2));const S=new Uint8Array(Math.ceil(y.length/2));let C=0;for(let K=0;K<y.length;K+=2){const ee=parseInt(y.substr(K,2),16);if(isNaN(ee))throw new Error("Cannot read hex string:"+JSON.stringify(y));S[C]=ee,C++}return S}function x(y){return Array.from(y).map((S=>S.toString(16).padStart(2,"0"))).join("")}function L(y,S){if(typeof y=="string"){if(S&&S.encoding==="hex"&&typeof y=="string"){let C=y;C.length>2&&C.substr(0,2)==="0x"&&(C=C.substr(2));const K=X(C);return u.keccak256(K)}return u.keccak256(U(y))}return u.keccak256(y)}const D={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function $(y,S,C){return new Array(S-y.length+1).join(C||"0")+y}function V(y){let S="",C=0;const K=y.length;for(y.substring(0,2)==="0x"&&(C=2);C<K;C+=2){const ee=parseInt(y.substr(C,2),16);S+=String.fromCharCode(ee)}return S}function N(y){return I(y)&&y.name&&y.name.indexOf("(")!==-1?y.name:y.name+"("+Z(!1,y.inputs||[]).join(",")+")"}function j(...y){const S=y.reduce(((ee,oe)=>ee+oe.length),0),C=new Uint8Array(S);let K=0;for(const ee of y)C.set(ee,K),K+=ee.length;return C}function Z(y,S){const C=[];return S.forEach((function(K){if(typeof K.components=="object"){if(K.type.substring(0,5)!=="tuple")throw new Error("components found but type is not tuple; report on GitHub");let ee="";const oe=K.type.indexOf("[");oe>=0&&(ee=K.type.substring(oe));const ve=Z(y,K.components);C.push("("+ve.join(",")+")"+ee)}else C.push(K.type)})),C}function Ee(y){const S=y.indexOf("("),C=y.indexOf(")");return S!==-1&&C!==-1?y.substr(0,S):y}function _e(y){const S=y.indexOf("("),C=y.indexOf(")");return S!==-1&&C!==-1?y.substr(S+1,C-S-1).replace(" ",""):""}function Se(y){return y==null?y:xe(y).toNumber()}function Ie(y){return xe(y).toNumber()}function ie(y){return M(y)?y.toString(10):""+y}function le(y){return typeof y=="string"&&!y.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y)?"0x"+y:we(y)}function fe(y){if(typeof y=="string")return y.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y)?we(y):"0x"+x(U(y));if(y instanceof Uint8Array)return"0x"+x(y);throw new Error(`toStringData: Error trying to convert ${y} (${typeof y}) to a hex string.`)}function me(y){return typeof y=="boolean"?y:xe(y).toNumber()!==0}function Te(y){const S=xe(y),C=S.toString(16);return S.isLessThan(0)?"-0x"+C.substr(1):"0x"+C}function we(y){if(G(y))return Te(+y);if(M(y))return Te(y);if(E(y)){const S=y;if(S.indexOf("-0x")===0)return Te(S);if(S.indexOf("0x")===0)return S;if(!isFinite(S))return x(U(S))}if(y instanceof Uint8Array)return"0x"+x(y);if(de(y)||I(y))throw new Error("toHex can only be called with scalar values, not objects or arrays");return Te(y)}function Fe(y){const S=y?y.toLowerCase():"ether",C=D[S];if(C===void 0)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(D,null,2));return new Y(C,10)}function xe(y){let S=y||0;return M(S)?S:(typeof S=="string"&&(S=S.trim()),typeof S!="string"||S.indexOf("0x")!==0&&S.indexOf("-0x")!==0?S instanceof Uint8Array?new Y(x(S),16):new Y(S,10):new Y(S.replace("0x","").toLowerCase(),16))}function tt(y){return new Y(new Array(y).fill("1").join(""),2)}function Xe(y,S=256){const C=xe(y).integerValue();return C.isLessThan(0)?tt(S).plus(C).plus(1):C}function ut(y,S){return $(y.toString(2),S,"0")[0]==="1"}function $t(y){if(typeof y!="string")throw ne("invalid address",se,{arg:"address",value:y});if(y.trim().match(/^(0x)?[0-9a-fA-F]{40}$/))return y.trim().substring(0,2)!=="0x"&&(y="0x"+y),nr(y);throw ne("invalid address",se,{arg:"address",value:y})}function vt(y,S=256){if(ut(y,S)){const C=tt(S);return y.minus(C).minus(1)}return y}function zt(y){return/^0x[0-9a-f]{40}$/i.test(y)}function bt(y){return!!/^(0x)?[0-9a-f]{40}$/i.test(y)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(y)&&!/^(0x)?[0-9A-F]{40}$/.test(y))||rr(y))}function rr(y){const S=y.replace("0x",""),C=L(S.toLowerCase());for(let K=0;K<40;K++)if(parseInt(C[K],16)>7&&S[K].toUpperCase()!==S[K]||parseInt(C[K],16)<=7&&S[K].toLowerCase()!==S[K])return!1;return!0}function nr(y){if(y===void 0)return"";const S=y.toLowerCase().replace("0x",""),C=L(S);let K="0x";for(let ee=0;ee<S.length;ee++)parseInt(C[ee],16)>7?K+=S[ee].toUpperCase():K+=S[ee];return K}function ht(y){if(!Array.isArray(y))throw new Error(`Value was not an array: ${JSON.stringify(y)}`);return y}function wr(y){return zt(y)?y:/^[0-9a-f]{40}$/.test(y)?"0x"+y:"0x"+$(we(y).substr(2),40)}function M(y){return y instanceof Y}function E(y){return typeof y=="string"||y&&y.constructor&&y.constructor.name==="String"}function I(y){return y!==null&&!Array.isArray(y)&&typeof y=="object"}function G(y){return typeof y=="boolean"}function de(y){return Array.isArray(y)}var ge,be;function Qe(y,S){if(!y)throw new Error("jsonrpc method should be specified!");if(typeof y!="string")throw new Error(`jsonrpc must be a string, got ${typeof y}!`);return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:y,params:S||[]}}function Pt(y){return Array.isArray(y)?y.every(S):S(y);function S(C){return!!C&&(C.error===void 0||C.error===null)&&C.jsonrpc==="2.0"&&C.id!==null&&"result"in C&&C.result!==void 0}}r.TransactionStatus=void 0,(ge=r.TransactionStatus||(r.TransactionStatus={})).pending="pending",ge.confirmed="confirmed",ge.failed="failed",r.TransactionType=void 0,(be=r.TransactionType||(r.TransactionType={})).queued="queued",be.dropped="dropped",be.replaced="replaced",be.pending="pending",be.reverted="reverted",be.confirmed="confirmed",r.messageId=0;function Tt(y){return xe(y)}function Ct(y){return y==="latest"||y==="pending"||y==="earliest"}function nt(y){return y===void 0?"latest":Wt(y)}function Wt(y){return y==null?null:Ct(y)?y:we(y)}function fd(y){return y.from&&(y.from=vr(y.from)),y.to&&(y.to=vr(y.to)),y.gasPrice!==void 0&&(y.gasPrice=Te(y.gasPrice)),y.gas!==void 0&&(y.gas=Te(y.gas)),y.value!==void 0&&(y.value=Te(y.value)),y.nonce!==void 0&&(y.nonce=Te(y.nonce)),y.data&&!y.data.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y.data)&&(y.data="0x"+y.data),y}function Oa(y){if(typeof y!="string")throw new Error("The provided input for transactionId is not a string, got: "+JSON.stringify(y));if(y.indexOf("0x")!==0)throw new Error("TransactionID must start with 0x, got: "+JSON.stringify(y));if(y.length!==66)throw new Error("TransactionID must be a 32 byte hex, got: "+JSON.stringify(y));return y}function pd(y){if(typeof y!="object")throw new Error("Did not provide transaction options");if(!y.from)throw new Error('Missing "from" in transaction options');return y.from=vr(y.from),y.to&&(y.to=vr(y.to)),y.gasPrice!==void 0&&(y.gasPrice=Te(y.gasPrice)),y.gas!==void 0&&(y.gas=Te(y.gas)),y.value!==void 0&&(y.value=Te(y.value)),y.nonce!==void 0&&(y.nonce=Te(y.nonce)),y.data&&!y.data.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y.data)&&(y.data="0x"+y.data),y}function Os(y){return y?(y.blockNumber!==null&&(y.blockNumber=Ie(y.blockNumber)),y.transactionIndex!==null&&(y.transactionIndex=Ie(y.transactionIndex)),y.nonce=Ie(y.nonce),y.gas=Ie(y.gas),y.gasPrice=xe(y.gasPrice),y.value=xe(y.value),y):null}function IE(y){return y?(y.blockNumber!==null&&(y.blockNumber=Ie(y.blockNumber)),y.transactionIndex!==null&&(y.transactionIndex=Ie(y.transactionIndex)),y.cumulativeGasUsed=Ie(y.cumulativeGasUsed),y.gasUsed=Ie(y.gasUsed),y.effectiveGasPrice!==void 0&&y.effectiveGasPrice!==null&&(y.effectiveGasPrice=Ie(y.effectiveGasPrice)),y.logs&&de(y.logs)&&(y.logs=y.logs.map((function(S){return su(S)}))),y.status=Ie(y.status||""),y):null}function Ns(y){return y?(y.gasLimit=Ie(y.gasLimit),y.gasUsed=Ie(y.gasUsed),y.size=Ie(y.size),y.timestamp=Ie(y.timestamp),y.number!==null&&(y.number=Ie(y.number)),y.difficulty=xe(y.difficulty),y.totalDifficulty=xe(y.totalDifficulty),de(y.transactions)&&y.transactions.forEach((function(S,C){E(S)||(y.transactions[C]=Os(S)||y.transactions[C])})),y):null}function su(y){return y&&(y.blockNumber&&(y.blockNumber=Ie(y.blockNumber)),y.transactionIndex&&(y.transactionIndex=Ie(y.transactionIndex)),y.logIndex&&(y.logIndex=Ie(y.logIndex)),y)}function vr(y){if(zt(y))return y;if(bt(y))return"0x"+y;throw new Error(`Invalid address: ${JSON.stringify(y)}`)}function RE(y){return y}function wE(y){return y&&(y.startingBlock=Ie(y.startingBlock),y.currentBlock=Ie(y.currentBlock),y.highestBlock=Ie(y.highestBlock),y.knownStates&&(y.knownStates=Ie(y.knownStates),y.pulledStates=Ie(y.pulledStates)),y)}function md(y){if(y===null)throw ne("cannot convert null value to array",se,{arg:"value",value:y});if(y instanceof Uint8Array)return new Uint8Array(y);if(typeof y=="string"){const S=y.match(/^(0x)?[0-9a-fA-F]*$/);if(!S)throw ne("invalid hexidecimal string",se,{arg:"value",value:y});if(S[1]!=="0x")throw ne("hex string must have 0x prefix",se,{arg:"value",value:y});(y=y.substring(2)).length%2&&(y="0"+y);const C=[];for(let K=0;K<y.length;K+=2)C.push(parseInt(y.substr(K,2),16));return new Uint8Array(C)}if((function(S){if(!S||parseInt(String(S.length))!==S.length||typeof S=="string")return!1;for(let C=0;C<S.length;C++){const K=S[C];if(K<0||K>=256||parseInt(String(K))!==K)return!1}return!0})(y))return new Uint8Array(y);throw ne("invalid arrayify value",void 0,{arg:"value",value:y,type:typeof y})}function AE(y,S,C){Object.defineProperty(y,S,{enumerable:!0,value:C,writable:!1})}const AD=new Y(-1),OD=new Y(0),ND=new Y(1),OE=new Y("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function NE(y){return(function(S,C){function K(ve){return new Error('unexpected character "'+S[ve]+'" at position '+ve+' in "'+S+'"')}const ee={type:"",name:"",state:{allowType:!0}};let oe=ee;for(let ve=0;ve<S.length;ve++){const Pe=S[ve];switch(Pe){case"(":if(!oe.state.allowParams)throw K(ve);oe.state.allowType=!1,oe.type=Ps(oe.type),oe.components=[{type:"",name:"",parent:oe,state:{allowType:!0}}],oe=oe.components[0];break;case")":delete oe.state,oe.name==="indexed"&&(oe.indexed=!0,oe.name=""),oe.type=Ps(oe.type);const He=oe;if(oe=oe.parent,!oe)throw K(ve);delete He.parent,oe.state.allowParams=!1,oe.state.allowName=!0,oe.state.allowArray=!0;break;case",":delete oe.state,oe.name==="indexed"&&(oe.indexed=!0,oe.name=""),oe.type=Ps(oe.type);const Ge={type:"",name:"",parent:oe.parent,state:{allowType:!0}};oe.parent.components.push(Ge),delete oe.parent,oe=Ge;break;case" ":oe.state.allowType&&oe.type!==""&&(oe.type=Ps(oe.type),delete oe.state.allowType,oe.state.allowName=!0,oe.state.allowParams=!0),oe.state.allowName&&oe.name!==""&&(oe.name==="indexed"?(oe.indexed=!0,oe.name=""):oe.state.allowName=!1);break;case"[":if(!oe.state.allowArray)throw K(ve);oe.type+=Pe,oe.state.allowArray=!1,oe.state.allowName=!1,oe.state.readArray=!0;break;case"]":if(!oe.state.readArray)throw K(ve);oe.type+=Pe,oe.state.readArray=!1,oe.state.allowArray=!0,oe.state.allowName=!0;break;default:if(oe.state.allowType)oe.type+=Pe,oe.state.allowParams=!0,oe.state.allowArray=!0;else if(oe.state.allowName)oe.name+=Pe,delete oe.state.allowArray;else{if(!oe.state.readArray)throw K(ve);oe.type+=Pe}}}if(oe.parent)throw new Error("unexpected eof");return delete ee.state,oe.name==="indexed"&&(oe.indexed=!0,oe.name=""),ee.type=Ps(ee.type),ee})(y)}function Ps(y){return y.match(/^uint($|[^1-9])/)?y="uint256"+y.substring(4):y.match(/^int($|[^1-9])/)&&(y="int256"+y.substring(3)),y}const PD=new RegExp(/^bytes([0-9]*)$/),PE=new RegExp(/^(u?int)([0-9]*)$/),CD=new RegExp(/^(.*)\[([0-9]*)\]$/),MD=function(y,S){const C=y.match(PE);return C&&parseInt(C[2])<=48?S.toNumber():S};class sn{constructor(S,C,K,ee="",oe){this.coerceFunc=S,this.name=C,this.type=K,this.localName=ee,this.dynamic=oe}}class DD extends sn{constructor(S){super(S.coerceFunc,S.name,S.type,void 0,S.dynamic),AE(this,"coder",S)}encode(S){return this.coder.encode(S)}decode(S,C){return this.coder.decode(S,C)}}class jD extends sn{constructor(S,C){super(S,"null","",C,!1)}encode(S){return md([])}decode(S,C){if(C>S.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}}}function ou(y,S){return new Y(y.toString(2).substr(-S),2)}class CE extends sn{constructor(S,C,K,ee){const oe=(K?"int":"uint")+8*C;super(S,oe,oe,ee,!1),this.size=C,this.signed=K}encode(S){try{let C=xe(S);if(this.signed){let ee=ou(OE,8*this.size-1);if(C.gt(ee))throw new Error("out-of-bounds");if(ee=ee.plus(ND).multipliedBy(AD),C.lt(ee))throw new Error("out-of-bounds")}else if(C.lt(OD)||C.gt(ou(OE,8*this.size)))throw new Error("out-of-bounds");C=ou(Xe(C,8*this.size),8*this.size),this.signed&&(C=Xe(vt(C,8*this.size),256));const K=$(Xe(C).toString(16),64);if(K.indexOf("NaN")!==-1)throw ne("invalid number value, NaN",se,{arg:this.localName,coderType:this.name,value:S,v:C,twosComplement:Xe(C),twosComplement16:Xe(C).toString(16),pad:$(Xe(C).toString(16),64),size:this.size});return X(K)}catch(C){throw ne("invalid number value",se,{arg:this.localName,coderType:this.name,value:S,message:C.toString()})}}decode(S,C){if(S.length<C+32)throw ne("insufficient data for "+this.name+" type",se,{arg:this.localName,coderType:this.name,value:we(S.slice(C,C+32))});const K=32-this.size;let ee=new Y(x(S.slice(C+K,C+32)),16);return ee=this.signed?vt(ee,8*this.size):ou(ee,8*this.size),{consumed:32,value:this.coerceFunc(this.name,ee)}}}const Sn=new CE((function(y,S){return S}),32,!1,"none");class ME extends sn{constructor(S,C,K){const ee="bytes"+C;super(S,ee,ee,K,!1),this.length=C}encode(S){const C=new Uint8Array(32);try{if(typeof S=="string"&&S.length%2!=0)throw new Error("hex string cannot be odd-length");const K=md(S);if(K.length>this.length)throw new Error("incorrect data length");C.set(K)}catch(K){throw ne("invalid "+this.name+" value. Use hex strings or Uint8Array",se,{arg:this.localName,coderType:this.name,value:K.value||S,details:K.message})}return C}decode(S,C){if(S.length<C+32)throw ne("insufficient data for "+this.name+" type",se,{arg:this.localName,coderType:this.name,value:we(S.slice(C,C+32))});return{consumed:32,value:this.coerceFunc(this.name,S.slice(C,C+this.length))}}}function DE(y){const S=32*Math.ceil(y.length/32),C=new Uint8Array(S-y.length);return j(Sn.encode(y.length),y,C)}function jE(y,S,C){if(y.length<S+32)throw ne("insufficient data for dynamicBytes length",se,{arg:C,coderType:"dynamicBytes",value:we(y.slice(S,S+32))});let K=Sn.decode(y,S).value;try{K=K.toNumber()}catch(ee){throw ee("dynamic bytes count too large",se,{arg:C,coderType:"dynamicBytes",value:K.toString()})}if(y.length<S+32+K)throw ne("insufficient data for dynamicBytes type",se,{arg:C,coderType:"dynamicBytes",value:we(y.slice(S,S+32+K))});return{consumed:32+32*Math.ceil(K/32),value:y.slice(S+32,S+32+K)}}function uu(y){return 32*Math.ceil(y/32)}function LE(y,S){if(!Array.isArray(S)){if(!S||typeof S!="object")throw ne("invalid tuple value",se,{coderType:"tuple",value:S});{const He=[];y.forEach((function(Ge){He.push(S[Ge.localName])})),S=He}}if(y.length!==S.length)throw ne("types/value length mismatch",se,{coderType:"tuple",value:S});const C=[];y.forEach((function(He,Ge){C.push({dynamic:He.dynamic,value:He.encode(S[Ge])})}));let K=0,ee=0;C.forEach((function(He){He.dynamic?(K+=32,ee+=uu(He.value.length)):K+=uu(He.value.length)}));let oe=0,ve=K;const Pe=new Uint8Array(K+ee);return C.forEach((function(He){He.dynamic?(Pe.set(Sn.encode(ve),oe),oe+=32,Pe.set(He.value,ve),ve+=uu(He.value.length)):(Pe.set(He.value,oe),oe+=uu(He.value.length))})),Pe}class LD extends Array{}class $D extends sn{constructor(S,C,K,ee){super(S,"array",C.type+"["+(K>=0?K:"")+"]",ee,K===-1||C.dynamic),this.coder=C,this.length=K}encode(S){if(!Array.isArray(S))throw ne("expected array value",se,{arg:this.localName,coderType:"array",value:S});let C=this.length,K=new Uint8Array(0);C===-1&&(C=S.length,K=Sn.encode(C)),(function(oe,ve,Pe){if(Pe||(Pe=""),oe<ve)throw ne("missing argument"+Pe,"MISSING_ARGUMENT",{count:oe,expectedCount:ve});if(oe>ve)throw ne("too many arguments"+Pe,"UNEXPECTED_ARGUMENT",{count:oe,expectedCount:ve})})(C,S.length,"in coder array"+(this.localName?" "+this.localName:""));const ee=[];for(let oe=0;oe<S.length;oe++)ee.push(this.coder);return j(K,LE(ee,S))}decode(S,C){let K=0,ee=this.length;if(ee===-1){let Pe;try{Pe=Sn.decode(S,C)}catch(He){throw ne("insufficient data for dynamic array length",se,{arg:this.localName,coderType:"array",value:He.value})}try{ee=Pe.value.toNumber()}catch{throw ne("array count too large",se,{arg:this.localName,coderType:"array",value:Pe.value.toString()})}K+=Pe.consumed,C+=Pe.consumed}const oe=[];for(let Pe=0;Pe<ee;Pe++)oe.push(new DD(this.coder));const ve=(function(Pe,He,Ge){const cr=Ge;let qt=0;const Me=[];return Pe.forEach((function(Kt){let It;if(Kt.dynamic){const Rt=Sn.decode(He,Ge);It=Kt.decode(He,cr+Rt.value.toNumber()),It.consumed=Rt.consumed}else It=Kt.decode(He,Ge);It.value!==void 0&&Me.push(It.value),Ge+=It.consumed,qt+=It.consumed})),{value:Me,consumed:qt}})(oe,S,C);return ve.consumed+=K,ve.value=this.coerceFunc(this.type,ve.value),ve}}class hd extends sn{constructor(S,C,K){let ee=!1;const oe=[];C.forEach((function(ve){ve.dynamic&&(ee=!0),oe.push(ve.type)})),super(S,"tuple","tuple("+oe.join(",")+")",K,ee),this.coders=C}encode(S){return LE(this.coders,S)}decode(S,C){const K=(function(ee,oe,ve){const Pe=ve;let He=0;const Ge=new LD;return ee.forEach((function(cr){let qt;if(cr.dynamic){const Me=Sn.decode(oe,ve);qt=cr.decode(oe,Pe+Me.value.toNumber()),qt.consumed=Me.consumed}else qt=cr.decode(oe,ve);qt.value!==void 0&&Ge.push(qt.value),ve+=qt.consumed,He+=qt.consumed})),ee.forEach((function(cr,qt){let Me=cr.localName;Me&&(Me==="length"&&(Me="_length"),Ge[Me]!==null&&Ge[Me]!==void 0||(Ge[Me]=Ge[qt]))})),{value:Ge,consumed:He}})(this.coders,S,C);return K.value=this.coerceFunc(this.type,K.value),K}}const qD={address:class extends sn{constructor(y,S){super(y,"address","address",S,!1)}encode(y){const S=new Uint8Array(32),C=y.trim();if(!bt(C))throw ne("invalid address format",se,{arg:this.localName,coderType:"address",value:y});try{S.set(X(vr(C)),12)}catch(K){throw ne(`invalid address (${K.message})`,se,{arg:this.localName,coderType:"address",value:y})}return S}decode(y,S){if(y.length<S+32)throw ne("insufficuent data for address type",se,{arg:this.localName,coderType:"address",value:we(y.slice(S,S+32)),missingBytes:S+32-y.length});return{consumed:32,value:this.coerceFunc("address",$t(we(y.slice(S+12,S+32))))}}},bool:class extends sn{constructor(y,S){super(y,"bool","bool",S,!1)}encode(y){return Sn.encode(y?1:0)}decode(y,S){try{const C=Sn.decode(y,S);return{consumed:C.consumed,value:this.coerceFunc("bool",!C.value.isZero())}}catch(C){throw C.reason==="insufficient data for uint256 type"?ne("insufficient data for boolean type",se,{arg:this.localName,coderType:"boolean",value:C.value}):C}}},string:class extends sn{constructor(y,S){super(y,"string","string",S,!0)}encode(y){if(typeof y!="string")throw ne("invalid string value",se,{arg:this.localName,coderType:"string",value:y});return DE(U(y))}decode(y,S){const C=jE(y,S,this.localName);return C.value=this.coerceFunc("string",F(C.value)),C}},bytes:class extends sn{constructor(y,S){super(y,"bytes","bytes",S,!0)}encode(y){try{return DE(md(y))}catch(S){throw S("invalid bytes value",se,{arg:this.localName,coderType:"bytes",value:S.value})}}decode(y,S){const C=jE(y,S,this.localName);return C.value=this.coerceFunc("bytes",C.value),C}},function:class extends ME{constructor(y,S){super(y,24,S)}}};function cu(y,S){const C=qD[S.type];if(C)return new C(y,S.name);let K=S.type.match(PE);if(K){const ee=parseInt(K[2]||"256");if(ee===0||ee>256||ee%8!=0)throw ne("invalid "+K[1]+" bit length",se,{arg:"param",value:S});return new CE(y,ee/8,K[1]==="int",S.name)}if(K=S.type.match(PD),K){const ee=parseInt(K[1]);if(ee===0||ee>32)throw ne("invalid bytes length",se,{arg:"param",value:S});return new ME(y,ee,S.name)}if(K=S.type.match(CD),K){const ee=Object.assign({},S),oe=parseInt(K[2]||"-1");return ee.type=K[1],new $D(y,cu(y,ee),oe,S.name)}if(S.type.substring(0,5)==="tuple")return(function(ee,oe,ve){oe||(oe=[]);const Pe=oe.map((He=>cu(ee,He)));return new hd(ee,Pe,ve)})(y,S.components,S.name);if(S.type==="")return new jD(y,S.name);throw ne("invalid type",se,{arg:"type",value:S.type,fullType:S})}class yd{constructor(S){(function(C,K){if(!(C instanceof K))throw ne("missing new","MISSING_NEW",{name:K.name})})(this,yd),S||(S=MD),AE(this,"coerceFunc",S)}encode(S,C){if(S.length!==C.length)throw ne("types/values length mismatch",se,{count:{types:S.length,values:C.length},value:{types:S,values:C}});const K=S.map((ee=>typeof ee=="string"?NE(ee):ee)).map((ee=>cu(this.coerceFunc,ee)));return new hd(this.coerceFunc,K,"_").encode(C)}decode(S,C){const K=S.map((ee=>typeof ee=="string"?NE(ee):ee)).map((ee=>cu(this.coerceFunc,ee)));return new hd(this.coerceFunc,K,"_").decode(C,0).value}}const $E=new yd;var qE,$e;function Be(y,S,C,K){var ee,oe=arguments.length,ve=oe<3?S:K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ve=Reflect.decorate(y,S,C,K);else for(var Pe=y.length-1;Pe>=0;Pe--)(ee=y[Pe])&&(ve=(oe<3?ee(ve):oe>3?ee(S,C,ve):ee(S,C))||ve);return oe>3&&ve&&Object.defineProperty(S,C,ve),ve}function ke(y,S){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(y,S)}r.coder=void 0,(qE=r.coder||(r.coder={})).encodeParams=function(y,S){return x($E.encode(y,S))},qE.decodeParams=function(y,S){if(y.length>0&&(!S||S==="0x"||S==="0X"))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return $E.decode(y,X("0x"+S.replace(/0x/i,"")))},typeof SuppressedError=="function"&&SuppressedError;class ze{constructor(S){this.callName=S.callName,this.params=S.params||0,this.inputFormatter=S.inputFormatter||null,this.outputFormatter=S.outputFormatter}validateArgs(S){if(S.length!==this.params)throw C=this.callName,K=S.length,ee=this.params,new Error(`Invalid number of input parameters to RPC method "${C}" given: ${K}, expected: ${ee}`);var C,K,ee}formatInput(S){return this.inputFormatter?this.inputFormatter.map((function(C,K){return C?C(S[K]):S[K]})):S}formatOutput(S){return S!==null?this.outputFormatter(S):null}toPayload(S){const C=this.formatInput(S);return this.validateArgs(C),{method:this.callName,params:C}}async execute(S,...C){const K=this.toPayload(C);if(!S)throw new Error("Missing RequestManager in method#exec");const ee=await S.sendAsync(K);return this.formatOutput(ee)}}class br{constructor(S){this.getter=S.getter,this.outputFormatter=S.outputFormatter}formatOutput(S){return this.outputFormatter(S)}async execute(S,...C){const K=await S.sendAsync({method:this.getter,params:[]});return this.formatOutput(K)}}function BE(y){return new Promise((S=>setTimeout(S,y)))}r.eth=void 0,($e=r.eth||(r.eth={})).eth_getBalance=new ze({callName:"eth_getBalance",params:2,inputFormatter:[vr,nt],outputFormatter:Tt}),$e.eth_getStorageAt=new ze({callName:"eth_getStorageAt",params:3,inputFormatter:[vr,we,nt],outputFormatter:le}),$e.eth_getCode=new ze({callName:"eth_getCode",params:2,inputFormatter:[vr,nt],outputFormatter:le}),$e.eth_getBlockByHash=new ze({callName:"eth_getBlockByHash",params:2,inputFormatter:[Wt,function(y){return!!y}],outputFormatter:Ns}),$e.eth_getBlockByNumber=new ze({callName:"eth_getBlockByNumber",params:2,inputFormatter:[Wt,function(y){return!!y}],outputFormatter:Ns}),$e.eth_getUncleByBlockHashAndIndex=new ze({callName:"eth_getUncleByBlockHashAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Ns}),$e.eth_getUncleByBlockNumberAndIndex=new ze({callName:"eth_getUncleByBlockNumberAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Ns}),$e.eth_getBlockTransactionCountByHash=new ze({callName:"eth_getBlockTransactionCountByHash",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getBlockTransactionCountByNumber=new ze({callName:"eth_getBlockTransactionCountByNumber",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getUncleCountByBlockHash=new ze({callName:"eth_getUncleCountByBlockHash",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getUncleCountByBlockNumber=new ze({callName:"eth_getUncleCountByBlockNumber",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getTransactionByHash=new ze({callName:"eth_getTransactionByHash",params:1,inputFormatter:[Oa],outputFormatter:Os}),$e.eth_getTransactionByBlockHashAndIndex=new ze({callName:"eth_getTransactionByBlockHashAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Os}),$e.eth_getTransactionByBlockNumberAndIndex=new ze({callName:"eth_getTransactionByBlockNumberAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Os}),$e.eth_getTransactionReceipt=new ze({callName:"eth_getTransactionReceipt",params:1,inputFormatter:[Oa],outputFormatter:IE}),$e.eth_getTransactionCount=new ze({callName:"eth_getTransactionCount",params:2,inputFormatter:[vr,nt],outputFormatter:Ie}),$e.eth_sendRawTransaction=new ze({callName:"eth_sendRawTransaction",params:1,inputFormatter:[null],outputFormatter:le}),$e.web3_sha3=new ze({callName:"web3_sha3",params:1,inputFormatter:[null],outputFormatter:le}),$e.eth_sendTransaction=new ze({callName:"eth_sendTransaction",params:1,inputFormatter:[pd],outputFormatter:le}),$e.eth_sign=new ze({callName:"eth_sign",params:2,inputFormatter:[vr,null],outputFormatter:le}),$e.eth_call=new ze({callName:"eth_call",params:2,inputFormatter:[fd,nt],outputFormatter:le}),$e.eth_estimateGas=new ze({callName:"eth_estimateGas",params:1,inputFormatter:[fd],outputFormatter:Ie}),$e.eth_submitWork=new ze({callName:"eth_submitWork",params:3,inputFormatter:[null,null,null],outputFormatter:me}),$e.eth_getWork=new ze({callName:"eth_getWork",params:0,inputFormatter:[],outputFormatter:ht}),$e.eth_coinbase=new br({getter:"eth_coinbase",outputFormatter:wr}),$e.eth_mining=new br({getter:"eth_mining",outputFormatter:me}),$e.eth_hashrate=new br({getter:"eth_hashrate",outputFormatter:Ie}),$e.eth_syncing=new br({getter:"eth_syncing",outputFormatter:wE}),$e.eth_gasPrice=new br({getter:"eth_gasPrice",outputFormatter:Tt}),$e.eth_accounts=new br({getter:"eth_accounts",outputFormatter:ht}),$e.eth_blockNumber=new br({getter:"eth_blockNumber",outputFormatter:Ie}),$e.eth_protocolVersion=new br({getter:"eth_protocolVersion",outputFormatter:Ie}),$e.web3_clientVersion=new br({getter:"web3_clientVersion",outputFormatter:ie}),$e.net_version=new br({getter:"net_version",outputFormatter:ie}),$e.shh_version=new ze({callName:"shh_version",params:0,inputFormatter:[],outputFormatter:Ie}),$e.shh_post=new ze({callName:"shh_post",params:1,inputFormatter:[null],outputFormatter:me}),$e.personal_newAccount=new ze({callName:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:wr}),$e.personal_importRawKey=new ze({callName:"personal_importRawKey",params:2,inputFormatter:[null,null],outputFormatter:wr}),$e.personal_sign=new ze({callName:"personal_sign",params:3,inputFormatter:[fe,vr,null],outputFormatter:le}),$e.personal_ecRecover=new ze({callName:"personal_ecRecover",params:2,inputFormatter:[fe,null],outputFormatter:wr}),$e.personal_unlockAccount=new ze({callName:"personal_unlockAccount",params:3,inputFormatter:[vr,null,Se],outputFormatter:me}),$e.personal_sendTransaction=new ze({callName:"personal_sendTransaction",params:2,inputFormatter:[pd,null],outputFormatter:le}),$e.personal_lockAccount=new ze({callName:"personal_lockAccount",params:1,inputFormatter:[vr],outputFormatter:me}),$e.personal_listAccounts=new br({getter:"personal_listAccounts",outputFormatter:ht}),$e.net_listening=new br({getter:"net_listening",outputFormatter:me}),$e.net_peerCount=new br({getter:"net_peerCount",outputFormatter:Ie}),$e.eth_newFilter=new ze({callName:"eth_newFilter",params:1,inputFormatter:[RE],outputFormatter:we}),$e.eth_getLogs=new ze({callName:"eth_getLogs",params:1,inputFormatter:[ht],outputFormatter:ht}),$e.eth_newBlockFilter=new ze({callName:"eth_newBlockFilter",params:0,inputFormatter:[],outputFormatter:we}),$e.eth_newPendingTransactionFilter=new ze({callName:"eth_newPendingTransactionFilter",params:0,inputFormatter:[],outputFormatter:we}),$e.eth_uninstallFilter=new ze({callName:"eth_uninstallFilter",params:1,inputFormatter:[we],outputFormatter:me}),$e.eth_getFilterLogs=new ze({callName:"eth_getFilterLogs",params:1,inputFormatter:[we],outputFormatter:ht}),$e.eth_getFilterChanges=new ze({callName:"eth_getFilterChanges",params:1,inputFormatter:[we],outputFormatter:ht}),$e.eth_submitHashrate=new ze({callName:"eth_submitHashrate",params:2,inputFormatter:[null,null],outputFormatter:me}),$e.shh_newIdentity=new ze({callName:"shh_newIdentity",params:0,inputFormatter:[],outputFormatter:le}),$e.shh_hasIdentity=new ze({callName:"shh_hasIdentity",params:1,inputFormatter:[null],outputFormatter:me}),$e.shh_newGroup=new ze({callName:"shh_newGroup",params:0,inputFormatter:[],outputFormatter:le}),$e.shh_addToGroup=new ze({callName:"shh_addToGroup",params:1,inputFormatter:[null],outputFormatter:me}),$e.shh_newFilter=new ze({callName:"shh_newFilter",params:1,inputFormatter:[null],outputFormatter:we}),$e.shh_uninstallFilter=new ze({callName:"shh_uninstallFilter",params:1,inputFormatter:[null],outputFormatter:me}),$e.shh_getLogs=new ze({callName:"shh_getLogs",params:1,inputFormatter:[null],outputFormatter:ht}),$e.shh_getFilterMessages=new ze({callName:"shh_getFilterMessages",params:1,inputFormatter:[null],outputFormatter:ht}),$e.shh_getFilterChanges=new ze({callName:"shh_getFilterChanges",params:1,inputFormatter:[null],outputFormatter:ht}),$e.shh_getMessages=new ze({callName:"shh_getMessages",params:1,inputFormatter:[null],outputFormatter:ht});function Ue(y,S){const C=r.eth[S];if(!C)throw new Error(`Could not find the method/property named ${S.toString()}`);Object.defineProperty(y,S,{value:function(...K){return C.execute(this,...K)}})}class Le{constructor(S){this.provider=S,this.requests=new Map}async sendAsync(S){const C=await this.provider;if(!C)throw new Error("Provider not set or invalid");const K=Qe(S.method,S.params),ee=s();return this.requests.set(K.id,ee),C.sendAsync(K,((oe,ve)=>{this.requests.delete(K.id),oe?ee.reject(oe):Pt(ve)?ee.resolve(ve.result):ee.reject((function(Pe){const He=Pe&&Pe.error&&Pe.error.message?Pe.error.message:"Invalid JSON RPC response: "+JSON.stringify(Pe);return new Error(He)})(ve))})),ee}setProvider(S){this.provider=S}async getConfirmedTransaction(S){const C=await this.waitForCompletion(S);if(this.isFailure(C))throw new Error(`Transaction "${S}" failed`);return C}async waitForCompletion(S,C){const K=Oa(S);if(await this.isTxDropped(K,C)){const ee=await this.getTransactionAndReceipt(K);return Object.assign(Object.assign({},ee),{status:r.TransactionStatus.failed})}for(;;){const ee=await this.getTransactionAndReceipt(K);if(!this.isPending(ee)&&ee.receipt)return Object.assign(Object.assign({},ee),{status:this.isFailure(ee)?r.TransactionStatus.failed:r.TransactionStatus.confirmed});await BE(2e3)}}async getTransaction(S){let C,K=null;const ee=Oa(S);try{const ve=(await this.eth_accounts())[0];ve&&(K=await this.eth_getTransactionCount(ve,"latest"))}catch{K=null}try{if(C=await this.eth_getTransactionByHash(ee),C===null)return null}catch{return null}if(C.blockNumber===null){if(K!==null){if(C.nonce<K)return{hash:ee,type:r.TransactionType.replaced,nonce:C.nonce};if(C.nonce>K)return{hash:ee,type:r.TransactionType.queued,nonce:C.nonce}}return Object.assign({type:r.TransactionType.pending},C)}let oe;try{if(oe=await this.eth_getTransactionReceipt(ee),oe===null||oe.status===0)return Object.assign({type:r.TransactionType.reverted},C)}catch{return null}return Object.assign(Object.assign({type:r.TransactionType.confirmed},C),{receipt:oe})}async isTxDropped(S,C=15){let K=C;for(;K>0;){if(await this.getTransactionAndReceipt(S)!==null)return!1;K-=1,await BE(2e3)}return!0}async getTransactionAndReceipt(S){S=Oa(S);const[C,K]=await Promise.all([this.eth_getTransactionByHash(S),this.eth_getTransactionReceipt(S)]);return Object.assign(Object.assign({},C),{receipt:K})}isPending(S){return S&&S.blockNumber===null}isFailure(S){return S&&(!S.receipt||S.receipt.status===0)}}Be([Ue,ke("design:type",Function)],Le.prototype,"web3_clientVersion",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"web3_sha3",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"net_version",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"net_peerCount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"net_listening",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_protocolVersion",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_syncing",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_coinbase",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_mining",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_hashrate",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_gasPrice",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_accounts",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_blockNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBalance",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getStorageAt",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionCount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockTransactionCountByHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockTransactionCountByNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleCountByBlockHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleCountByBlockNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getCode",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_sign",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_sendTransaction",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_sendRawTransaction",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_call",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_estimateGas",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockByHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockByNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionByHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionByBlockHashAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionByBlockNumberAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionReceipt",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleByBlockHashAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleByBlockNumberAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_newFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_newBlockFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_newPendingTransactionFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_uninstallFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getFilterChanges",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getFilterLogs",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getLogs",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getWork",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_submitWork",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_submitHashrate",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_post",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_version",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_newIdentity",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_hasIdentity",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_newGroup",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_addToGroup",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_newFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_uninstallFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_getFilterChanges",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_getMessages",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_unlockAccount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_newAccount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_listAccounts",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_lockAccount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_importRawKey",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_sendTransaction",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_sign",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_ecRecover",void 0);class kE{constructor(S){this.json=S,this._inputTypes=S.inputs||[],this._outputTypes=S.outputs||[],this._constant=!!S.constant,this._payable=!!S.payable||S.stateMutability==="payable",this.needsToBeTransaction=this._payable||"constant"in S&&!S.constant||S.stateMutability==="nonpayable",this._name=N(S)}extractDefaultBlock(S){return S.length>this._inputTypes.length&&!I(S[S.length-1])&&nt(S.pop())||"latest"}validateArgs(S){if(S.some((oe=>oe===void 0)))throw new Error("Invalid call, some arguments are undefined");const C=S.filter((function(oe){return!(I(oe)===!0&&de(oe)===!1&&M(oe)===!1&&!(oe instanceof Uint8Array))}));if(C.length!==this._inputTypes.length)throw K=C.length,ee=this._inputTypes.length,new Error(`Invalid number of arguments to Solidity function. given: ${K}, expected: ${ee}`);var K,ee}toPayload(S){let C={to:void 0,data:void 0,value:void 0,from:void 0};S.length>this._inputTypes.length&&I(S[S.length-1])&&(C=S.pop()),this.validateArgs(S);const K=this.signature();let ee=r.coder.encodeParams(this._inputTypes,S);return ee.indexOf("0x")===0&&(ee=ee.substr(2)),C.data="0x"+K+ee,C}signature(){return L(this._name).slice(0,8)}unpackOutput(S){if(!S)return;const C=S.length>=2?S.slice(2):S,K=r.coder.decodeParams(this._outputTypes,C);return K.length===1?K[0]:K}async execute(S,C,...K){if(!S)throw new Error(`Cannot call function ${this.displayName()} because there is no requestManager`);if(this.needsToBeTransaction){const ee=this.toPayload(K);if(ee.to=C,ee.value>0&&!this._payable)throw new Error("Cannot send value to non-payable function");if(!ee.from)throw new Error('Missing "from" in transaction options');return await S.eth_sendTransaction(ee)}{const ee=this.extractDefaultBlock(K),oe=this.toPayload(K);oe.to=C;const ve=await S.eth_call(oe,ee);return this.unpackOutput(ve)}}estimateGas(S,C,...K){if(!(S instanceof Le))throw new Error("estimateGas needs to receive a RequestManager as first argument");const ee=this.toPayload(K);return ee.to=C,S.eth_estimateGas(ee)}displayName(){return Ee(this._name)}typeName(){return _e(this._name)||"void"}attachToContract(S){const C=this.displayName(),K=Object.assign(((...ee)=>this.execute(S.requestManager,S.address,...ee)),{estimateGas:this.estimateGas.bind(this,S.requestManager,S.address),toPayload:(...ee)=>this.toPayload(ee),toRPCMessage:(...ee)=>{const oe=this.extractDefaultBlock(ee),ve=this.toPayload(ee);return ve.to=S.address,{method:"eth_call",params:[ve,oe]}},unpackOutput:ee=>this.unpackOutput(ee)});S[C]||(S[C]=K),S[C][this.typeName()]=K}}function UE(y){if(y==null)return null;const S=String(y).toString();return S.indexOf("0x")===0?S:x(U(S))}class gd{constructor(S){this.requestManager=S,this.isStarted=!1,this.isDisposed=!1,this.formatter=C=>C,this.filterId=s(),this.callbacks=[],this.stopSemaphore=s()}async watch(S){if(this.isDisposed)throw new Error("The filter was disposed");S&&(this.callbacks.push(S),this.isStarted||await this.start())}async start(){if(this.isDisposed)throw new Error("The filter was disposed");if(!this.isStarted){this.isStarted=!0;try{const S=await this.getNewFilter();if(!S)throw new Error("Could not create a filter, response: "+JSON.stringify(S));this.filterId.resolve(S)}catch(S){throw S}this.stopSemaphore=s(),await this.poll()}}async stop(){if(!this.isStarted||this.isDisposed)return;this.isDisposed=!0;const S=await this.filterId;if(this.isStarted=!1,this.stopSemaphore&&await this.stopSemaphore,await this.uninstall()!==!0)throw new Error(`Couldn't stop the eth filter: ${S}`)}async poll(){if(this.isStarted){if(this.callbacks.length){const C=await this.getChanges();C&&this.callbacks.forEach((K=>{this.formatter?C.forEach((ee=>{K(this.formatter(ee))})):C.forEach((ee=>K(ee)))}))}this.stopSemaphore.resolve(1),this.isStarted&&(this.stopSemaphore=s(),setTimeout((S=()=>this.poll(),function(){S().catch((C=>console.error(C)))}),500))}else this.stopSemaphore.resolve(1);var S}}class Cs extends gd{constructor(S,C,K=(ee=>ee)){super(S),this.requestManager=S,this.options=C,this.formatter=K,this.options=this.options||{},this.options.topics=this.options.topics||[],this.options.topics=this.options.topics.map((function(ee){return UE(ee)})),this.options={topics:this.options.topics,address:this.options.address?this.options.address:void 0,fromBlock:typeof this.options.fromBlock=="number"||typeof this.options.fromBlock=="string"?Wt(this.options.fromBlock)||void 0:"latest",toBlock:typeof this.options.toBlock=="number"||typeof this.options.toBlock=="string"?Wt(this.options.toBlock)||void 0:"latest"}}async getLogs(){this.isStarted||await this.start();const S=await this.filterId;return this.requestManager.eth_getFilterLogs(S)}async getNewFilter(){return this.requestManager.eth_newFilter(this.options)}async getChanges(){const S=await this.filterId;return this.requestManager.eth_getFilterChanges(S)}async uninstall(){const S=await this.filterId;return this.requestManager.eth_uninstallFilter(S)}}class _d{constructor(S,C,K){this.requestManager=S,this.address=K,this._anonymous=!1,this._params=C.inputs||[],this._name=N(C),this._anonymous=C.anonymous||!1}types(S){return this._params.filter((function(C){return C.indexed===S}))}displayName(){return Ee(this._name)}typeName(){return _e(this._name)||"void"}signature(){return L(this._name)}encode(S={},C={}){const K={topics:[],address:this.address};C.fromBlock!==void 0&&(K.fromBlock=Wt(C.fromBlock)||void 0),C.toBlock!==void 0&&(K.toBlock=Wt(C.toBlock)||void 0),K.topics=K.topics||[],this._anonymous||K.topics.push("0x"+this.signature());const ee=this._params.filter((function(oe){return oe.indexed===!0})).map((function(oe){const ve=S[oe.name];return ve==null?null:de(ve)?ve.map((function(Pe){return"0x"+r.coder.encodeParams([oe],[Pe])})):"0x"+r.coder.encodeParams([oe],[ve])}));return K.topics=K.topics.concat(ee),K}decode(S){S.data=S.data||"",S.topics=S.topics||[];const C=(this._anonymous?S.topics:S.topics.slice(1)).map((function(Pe){return Pe.slice(2)})).join(""),K=r.coder.decodeParams(this.types(!0),C),ee=S.data.slice(2),oe=r.coder.decodeParams(this.types(!1),ee),ve=this._params.reduce((function(Pe,He){return Pe[He.name]=He.indexed?K.shift():oe.shift(),Pe}),{});return Object.assign(Object.assign({},su(S)),{event:this.displayName(),address:S.address,args:ve})}async execute(S,C){const K=this.encode(S,C),ee=this.decode.bind(this);return new Cs(this.requestManager,K,ee)}attachToContract(S){const C=this.execute.bind(this),K=this.displayName();S.events[K]||(S.events[K]=C),S.events[K][this.typeName()]=this.execute.bind(this,S)}}class BD{constructor(S,C,K){this._requestManager=S,this._json=C,this._address=K}encode(S={}){const C={address:this._address};return S.fromBlock!==void 0&&(C.fromBlock=Wt(S.fromBlock)||void 0),S.toBlock!==void 0&&(C.toBlock=Wt(S.toBlock)||void 0),C}decode(S){S.data=S.data||"";const C=de(S.topics)&&E(S.topics[0])?S.topics[0].slice(2):"",K=this._json.filter((function(ee){return C===L(N(ee))}))[0];return K?new _d(this._requestManager,K,this._address).decode(S):su(S)}async execute(S){const C=this.encode(S),K=this.decode.bind(this);return new Cs(this._requestManager,C,K)}getAllEventsFunction(){return this.execute.bind(this)}}class FE{constructor(S,C,K){var ee;this.requestManager=S,this.abi=C,this.address=K,this.events={},this.transactionHash=null,this.address=K,this.abi=C,(ee=this).abi.filter((function(oe){return oe.type==="function"})).map((function(oe){return new kE(oe)})).forEach((function(oe){oe.attachToContract(ee)})),this.allEvents=(function(oe){const ve=oe.abi.filter((function(He){return He.type==="event"})),Pe=new BD(oe.requestManager,ve,oe.address);return ve.map((function(He){return new _d(oe.requestManager,He,oe.address)})).forEach((function(He){He.attachToContract(oe)})),Pe.getAllEventsFunction()})(this)}}r.AbstractFilter=gd,r.BigNumber=Y,r.Contract=FE,r.ContractFactory=class{constructor(y,S){this.requestManager=y,this.abi=S}async deploy(...y){let S;const C=y[y.length-1];if(I(C)&&!de(C)&&(S=y.pop()),!S)throw new Error("Missing options object");if(!S.data||typeof S.data!="string")throw new Error("Invalid options.data");if(Ie(S.value)>0&&!(this.abi.filter((function(Ge){return Ge.type==="constructor"&&Ge.inputs.length===y.length}))[0]||{}).payable)throw new Error("Cannot send value to non-payable constructor");const K=(ee=this.abi,oe=y,ee.filter((function(Ge){return Ge.type==="constructor"&&Ge.inputs&&Ge.inputs.length===oe.length})).map((function(Ge){return Ge.inputs||[]})).map((function(Ge){return r.coder.encodeParams(Ge,oe)}))[0]||"");var ee,oe;S.data+=K,S.gas||(S.gas=await this.requestManager.eth_estimateGas(S));const ve=await this.requestManager.eth_sendTransaction(S);if(!ve)throw new Error("Error while sending contract creation transaction. A TxHash was not retrieved");const Pe=await(async function(Ge,cr){const qt=s();let Me=0;const Kt=()=>{Me++,Me>50?qt.reject(new Error("Contract transaction couldn't be found after 50 blocks")):Ge.eth_getTransactionReceipt(cr).then((ir=>{ir&&ir.blockHash?qt.resolve(ir):setTimeout(Kt,1e3)}),(ir=>qt.reject(ir)))};Kt();const It=await qt,Rt=await Ge.eth_getCode(It.contractAddress,"latest");if(Rt&&Rt.length>3)return It.contractAddress;throw Object.assign(new Error("The contract code couldn't be stored, please check your gas amount."),{response:Rt,receipt:It})})(this.requestManager,ve),He=await this.at(Pe);return He.transactionHash=ve,He}async at(y){if(!bt(y))throw new TypeError(`Invalid address ${JSON.stringify(y)}`);return new FE(this.requestManager,this.abi,y)}},r.EthBlockFilter=class extends Cs{constructor(y){super(y,{})}async getNewFilter(){return this.requestManager.eth_newBlockFilter()}},r.EthFilter=Cs,r.EthPendingTransactionFilter=class extends Cs{constructor(y){super(y,{})}async getNewFilter(){return this.requestManager.eth_newPendingTransactionFilter()}},r.HTTPProvider=class{constructor(y,S={}){this.host=y,this.options=S,this.debug=!1,this.host=y||"http://localhost:8545"}send(){throw new Error("Sync requests are deprecated")}sendAsync(y,S){try{let C=null;C=y instanceof Array?y.map((oe=>n(oe))):n(y);const K=this.options.fetch||globalThis.fetch;if(K===void 0)throw new Error("There is no global fetch object nor it was provided. Please install and import isomorphic-fetch");const ee={body:JSON.stringify(C),method:"POST",headers:Object.assign(Object.assign({},this.options.headers),{"Content-Type":"application/json"})};this.debug&&console.log("SEND >> "+ee.body),K(this.host,ee).then((async oe=>{if(oe.ok){const ve=await oe.json();this.debug&&console.log("RECV << "+JSON.stringify(ve)),ve.error?S(Object.assign(new Error(ve.error.json||ve.error),ve.error)):S(null,ve)}else{const ve=(typeof oe.text=="function"?await oe.text().catch((()=>"")):"").trim().slice(0,512),Pe="External error. response code: "+oe.status+(ve?" — "+ve:"");this.debug&&console.log("ERR << "+Pe),S(new Error(Pe))}}),(oe=>{this.debug&&console.log("ERR << "+JSON.stringify(oe)),S(oe)}))}catch(C){this.debug&&console.log("ERR << "+JSON.stringify(C)),S(C)}}},r.Method=ze,r.Property=br,r.RequestManager=Le,r.SHHFilter=class extends gd{constructor(y,S){super(y),this.requestManager=y,this.options=S,this.options=this.options||{topics:[]},this.options.topics=this.options.topics||[],this.options.topics=this.options.topics.map((function(C){return UE(C)})),this.options={topics:this.options.topics,to:this.options.to}}async getMessages(){const y=await this.filterId;return this.requestManager.shh_getMessages(y)}async getNewFilter(){return this.requestManager.shh_newFilter(this.options)}async getChanges(){const y=await this.filterId;return this.requestManager.shh_getFilterChanges(y)}async uninstall(){const y=await this.filterId;return this.requestManager.shh_uninstallFilter(y)}},r.SolidityEvent=_d,r.SolidityFunction=kE,r.WebSocketProvider=class{constructor(y,S={}){this.url=y,this.options=S,this.isDisposed=!1,this.responseCallbacks=new Map,this.notificationCallbacks=new Set,this.debug=!1,this.lastChunk="",this.connect()}dispose(){this.isDisposed=!0;const y=this.connection;this.timeout(new Error("Provider disposed.")),y.then((S=>S.close())).catch((S=>{this.debug&&console.error(S)}))}send(){throw new Error("Sync requests are deprecated")}sendAsync(y,S){const C=[];let K;if(y instanceof Array)K=Promise.all(y.map((ee=>{const oe=s();try{const ve=n(ee);C.push(ve),this.responseCallbacks.set(ve.id,oe)}catch(ve){oe.reject(ve)}return oe})));else{const ee=s();try{const oe=n(y);C.push(oe),this.responseCallbacks.set(oe.id,ee)}catch(oe){ee.reject(oe)}K=ee}K.then((ee=>S(null,ee)),(ee=>S(ee))),this.connection.then((ee=>{C.forEach((oe=>{const ve=JSON.stringify(oe);this.debug&&console.log("SEND >> "+ve),ee.send(ve)}))}),(ee=>{S(ee)}))}parseResponse(y){const S=[];return y.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((C=>{let K=C;this.lastChunk&&(K=this.lastChunk+K);let ee=null;try{ee=JSON.parse(K)}catch{return this.lastChunk=K,clearTimeout(this.lastChunkTimeout),void(this.lastChunkTimeout=setTimeout((()=>{this.timeout()}),15e3))}clearTimeout(this.lastChunkTimeout),this.lastChunk="",ee&&S.push(ee)})),S}processMessage(y){if("id"in y){const S=y.id,C=this.responseCallbacks.get(S);if(!C)return void console.error("Error: Received a response for an unknown request",y);this.responseCallbacks.delete(S),y.error!==void 0&&y.error!==null?C.reject(Object.assign(new Error(y.error.message||y.error),y.error)):"result"in y&&C.resolve(y)}else this.notificationCallbacks.forEach((S=>S(null,y)))}timeout(y){this.connection&&this.connection.isPending||(this.connection=s());const S=y||new Error("Connection timeout");this.responseCallbacks.forEach((C=>C.reject(S))),this.responseCallbacks.clear(),this.isDisposed||setTimeout((()=>this.connect()),1e3)}connect(){this.connection&&!this.connection.isPending&&this.connection.then((C=>C.close())).catch((C=>{this.debug&&console.error(C)})),this.connection&&this.connection.isPending||(this.connection=s()),this.lastChunk="";const y=this.options.WebSocketConstructor||(typeof WebSocket<"u"?WebSocket:void 0);if(!y)throw new Error("Please provide a WebSocketConstructor");const S=new y(this.url,this.options.protocol);S.onopen=()=>{this.connection.resolve(S)},S.onerror=C=>{const K=new Error("Error in web socket");K.data=C,this.timeout(K)},S.onclose=C=>{this.timeout(new Error(`Connection closed (${C&&C.reason||"Unknown reason"})`))},S.onmessage=C=>{const K=typeof C.data=="string"?C.data:"";this.debug&&console.log("RECV << "+C.data),this.parseResponse(K).forEach((ee=>{ee instanceof Array?ee.forEach((oe=>this.processMessage(oe))):this.processMessage(ee)}))}}},r.bytesToHex=x,r.bytesToUtf8String=F,r.concatBytes=j,r.default=Le,r.extractDisplayName=Ee,r.extractTypeName=_e,r.fromAscii=function(y,S=0){let C="";for(let K=0;K<y.length;K++){const ee=y.charCodeAt(K).toString(16);C+=ee.length<2?"0"+ee:ee}return"0x"+C.padEnd(S,"0")},r.fromDecimal=Te,r.fromTwosComplement=vt,r.fromWei=function(y,S){const C=xe(y).dividedBy(Fe(S));return M(y)?C:C.toString(10)},r.getAddress=$t,r.getValueOfUnit=Fe,r.hexToBytes=X,r.inputAddressFormatter=vr,r.inputBlockNumberFormatter=Wt,r.inputCallFormatter=fd,r.inputDefaultBlockNumberFormatter=nt,r.inputFilterOptions=RE,r.inputPostFormatter=function(y){return y?(y.ttl=Te(y.ttl),y.workToProve=Te(y.workToProve),y.priority=Te(y.priority),de(y.topics)||(y.topics=y.topics?[y.topics]:[]),y.topics=y.topics.map((function(S){return S.indexOf("0x")===0?S:"0x"+x(U(S))})),y):null},r.inputTransactionFormatter=pd,r.inputTransactionId=Oa,r.isAddress=bt,r.isArray=de,r.isBigNumber=M,r.isBloom=function(y){return!!/^(0x)?[0-9a-f]{512}$/i.test(y)&&!!/^(0x)?[0-9a-f]{512}$/i.test(y)},r.isBoolean=G,r.isChecksumAddress=rr,r.isFunction=function(y){return typeof y=="function"},r.isHex=function(y){return typeof y=="string"&&/^0x[0-9a-fA-F]+$/.test(y)},r.isJson=function(y){try{return!!JSON.parse(y)}catch{return!1}},r.isObject=I,r.isPredefinedBlockNumber=Ct,r.isStrictAddress=zt,r.isString=E,r.isTopic=function(y){return!!/^(0x)?[0-9a-f]{64}$/i.test(y)&&!!/^(0x)?[0-9a-f]{64}$/i.test(y)},r.isValidResponse=Pt,r.outputBigNumberFormatter=Tt,r.outputBlockFormatter=Ns,r.outputLogFormatter=su,r.outputPostFormatter=function(y){return y?(y.expiry=Ie(y.expiry),y.sent=Ie(y.sent),y.ttl=Ie(y.ttl),y.workProved=Ie(y.workProved),y.topics||(y.topics=[]),y.topics=y.topics.map((function(S){return V(S)})),y):null},r.outputSyncingFormatter=wE,r.outputTransactionFormatter=Os,r.outputTransactionReceiptFormatter=IE,r.padLeft=$,r.padRight=function(y,S,C){return y+new Array(S-y.length+1).join(C||"0")},r.sha3=L,r.signedIsNegative=ut,r.stringToUtf8Bytes=U,r.toAddress=wr,r.toArray=ht,r.toAscii=V,r.toBatchPayload=function(y){return y.map((function(S){return Qe(S.method,S.params)}))},r.toBigNumber=xe,r.toBoolean=me,r.toChecksumAddress=nr,r.toData=le,r.toDecimal=Ie,r.toHex=we,r.toJsonRpcRequest=Qe,r.toNullDecimal=Se,r.toString=ie,r.toStringData=fe,r.toTwosComplement=Xe,r.toWei=function(y,S){const C=xe(y).times(Fe(S));return M(y)?C:C.toString(10)},r.transformToFullName=N,Object.defineProperty(r,"__esModule",{value:!0})}))})(So,So.exports)),So.exports}var nl={},JI;function KH(){if(JI)return nl;JI=1,Object.defineProperty(nl,"__esModule",{value:!0}),nl.SignatureValidator=t;const e=td();async function t(r,n){const i=[{constant:!0,inputs:[{name:"hash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"magicValue",type:"bytes4"}],payable:!1,stateMutability:"view",type:"function"}];return await new e.ContractFactory(r,i).at(n)}return nl}var fn={},xp={},Kp={},Mi={},Cn={},Yt={},QI;function Q_(){if(QI)return Yt;QI=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.output=Yt.exists=Yt.hash=Yt.bytes=Yt.bool=Yt.number=Yt.isBytes=void 0;function e(u){if(!Number.isSafeInteger(u)||u<0)throw new Error(`positive integer expected, not ${u}`)}Yt.number=e;function t(u){if(typeof u!="boolean")throw new Error(`boolean expected, not ${u}`)}Yt.bool=t;function r(u){return u instanceof Uint8Array||u!=null&&typeof u=="object"&&u.constructor.name==="Uint8Array"}Yt.isBytes=r;function n(u,...l){if(!r(u))throw new Error("Uint8Array expected");if(l.length>0&&!l.includes(u.length))throw new Error(`Uint8Array expected of length ${l}, not of length=${u.length}`)}Yt.bytes=n;function i(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");e(u.outputLen),e(u.blockLen)}Yt.hash=i;function a(u,l=!0){if(u.destroyed)throw new Error("Hash instance has been destroyed");if(l&&u.finished)throw new Error("Hash#digest() has already been called")}Yt.exists=a;function s(u,l){n(u);const c=l.outputLen;if(u.length<c)throw new Error(`digestInto() expects output buffer of length at least ${c}`)}Yt.output=s;const o={number:e,bool:t,bytes:n,hash:i,exists:a,output:s};return Yt.default=o,Yt}var Xp={},Hs={},ZI;function XH(){return ZI||(ZI=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.crypto=void 0,Hs.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Hs}var e1;function tu(){return e1||(e1=1,(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.byteSwap32=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=e.isBytes=void 0;const t=XH(),r=Q_();function n(W){return W instanceof Uint8Array||W!=null&&typeof W=="object"&&W.constructor.name==="Uint8Array"}e.isBytes=n;const i=W=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength);e.u8=i;const a=W=>new Uint32Array(W.buffer,W.byteOffset,Math.floor(W.byteLength/4));e.u32=a;const s=W=>new DataView(W.buffer,W.byteOffset,W.byteLength);e.createView=s;const o=(W,U)=>W<<32-U|W>>>U;e.rotr=o;const u=(W,U)=>W<<U|W>>>32-U>>>0;e.rotl=u,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const l=W=>W<<24&4278190080|W<<8&16711680|W>>>8&65280|W>>>24&255;e.byteSwap=l,e.byteSwapIfBE=e.isLE?W=>W:W=>(0,e.byteSwap)(W);function c(W){for(let U=0;U<W.length;U++)W[U]=(0,e.byteSwap)(W[U])}e.byteSwap32=c;const d=Array.from({length:256},(W,U)=>U.toString(16).padStart(2,"0"));function p(W){(0,r.bytes)(W);let U="";for(let F=0;F<W.length;F++)U+=d[W[F]];return U}e.bytesToHex=p;const f={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function _(W){if(W>=f._0&&W<=f._9)return W-f._0;if(W>=f._A&&W<=f._F)return W-(f._A-10);if(W>=f._a&&W<=f._f)return W-(f._a-10)}function R(W){if(typeof W!="string")throw new Error("hex string expected, got "+typeof W);const U=W.length,F=U/2;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);const ce=new Uint8Array(F);for(let se=0,ne=0;se<F;se++,ne+=2){const X=_(W.charCodeAt(ne)),x=_(W.charCodeAt(ne+1));if(X===void 0||x===void 0){const L=W[ne]+W[ne+1];throw new Error('hex string expected, got non-hex character "'+L+'" at index '+ne)}ce[se]=X*16+x}return ce}e.hexToBytes=R;const w=async()=>{};e.nextTick=w;async function O(W,U,F){let ce=Date.now();for(let se=0;se<W;se++){F(se);const ne=Date.now()-ce;ne>=0&&ne<U||(await(0,e.nextTick)(),ce+=ne)}}e.asyncLoop=O;function h(W){if(typeof W!="string")throw new Error(`utf8ToBytes expected string, got ${typeof W}`);return new Uint8Array(new TextEncoder().encode(W))}e.utf8ToBytes=h;function T(W){return typeof W=="string"&&(W=h(W)),(0,r.bytes)(W),W}e.toBytes=T;function b(...W){let U=0;for(let ce=0;ce<W.length;ce++){const se=W[ce];(0,r.bytes)(se),U+=se.length}const F=new Uint8Array(U);for(let ce=0,se=0;ce<W.length;ce++){const ne=W[ce];F.set(ne,se),se+=ne.length}return F}e.concatBytes=b;class m{clone(){return this._cloneInto()}}e.Hash=m;const v={}.toString;function A(W,U){if(U!==void 0&&v.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(W,U)}e.checkOpts=A;function P(W){const U=ce=>W().update(T(ce)).digest(),F=W();return U.outputLen=F.outputLen,U.blockLen=F.blockLen,U.create=()=>W(),U}e.wrapConstructor=P;function q(W){const U=(ce,se)=>W(se).update(T(ce)).digest(),F=W({});return U.outputLen=F.outputLen,U.blockLen=F.blockLen,U.create=ce=>W(ce),U}e.wrapConstructorWithOpts=q;function z(W){const U=(ce,se)=>W(se).update(T(ce)).digest(),F=W({});return U.outputLen=F.outputLen,U.blockLen=F.blockLen,U.create=ce=>W(ce),U}e.wrapXOFConstructorWithOpts=z;function Y(W=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(W));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=Y})(Xp)),Xp}var t1;function JH(){if(t1)return Cn;t1=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.HashMD=Cn.Maj=Cn.Chi=void 0;const e=Q_(),t=tu();function r(s,o,u,l){if(typeof s.setBigUint64=="function")return s.setBigUint64(o,u,l);const c=BigInt(32),d=BigInt(4294967295),p=Number(u>>c&d),f=Number(u&d),_=l?4:0,R=l?0:4;s.setUint32(o+_,p,l),s.setUint32(o+R,f,l)}const n=(s,o,u)=>s&o^~s&u;Cn.Chi=n;const i=(s,o,u)=>s&o^s&u^o&u;Cn.Maj=i;class a extends t.Hash{constructor(o,u,l,c){super(),this.blockLen=o,this.outputLen=u,this.padOffset=l,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(o),this.view=(0,t.createView)(this.buffer)}update(o){(0,e.exists)(this);const{view:u,buffer:l,blockLen:c}=this;o=(0,t.toBytes)(o);const d=o.length;for(let p=0;p<d;){const f=Math.min(c-this.pos,d-p);if(f===c){const _=(0,t.createView)(o);for(;c<=d-p;p+=c)this.process(_,p);continue}l.set(o.subarray(p,p+f),this.pos),this.pos+=f,p+=f,this.pos===c&&(this.process(u,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){(0,e.exists)(this),(0,e.output)(o,this),this.finished=!0;const{buffer:u,view:l,blockLen:c,isLE:d}=this;let{pos:p}=this;u[p++]=128,this.buffer.subarray(p).fill(0),this.padOffset>c-p&&(this.process(l,0),p=0);for(let O=p;O<c;O++)u[O]=0;r(l,c-8,BigInt(this.length*8),d),this.process(l,0);const f=(0,t.createView)(o),_=this.outputLen;if(_%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const R=_/4,w=this.get();if(R>w.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O<R;O++)f.setUint32(4*O,w[O],d)}digest(){const{buffer:o,outputLen:u}=this;this.digestInto(o);const l=o.slice(0,u);return this.destroy(),l}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:u,buffer:l,length:c,finished:d,destroyed:p,pos:f}=this;return o.length=c,o.pos=f,o.finished=d,o.destroyed=p,c%u&&o.buffer.set(l),o}}return Cn.HashMD=a,Cn}var r1;function QH(){if(r1)return Mi;r1=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.sha224=Mi.sha256=void 0;const e=JH(),t=tu(),r=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class a extends e.HashMD{constructor(){super(64,32,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0,this.F=n[5]|0,this.G=n[6]|0,this.H=n[7]|0}get(){const{A:u,B:l,C:c,D:d,E:p,F:f,G:_,H:R}=this;return[u,l,c,d,p,f,_,R]}set(u,l,c,d,p,f,_,R){this.A=u|0,this.B=l|0,this.C=c|0,this.D=d|0,this.E=p|0,this.F=f|0,this.G=_|0,this.H=R|0}process(u,l){for(let h=0;h<16;h++,l+=4)i[h]=u.getUint32(l,!1);for(let h=16;h<64;h++){const T=i[h-15],b=i[h-2],m=(0,t.rotr)(T,7)^(0,t.rotr)(T,18)^T>>>3,v=(0,t.rotr)(b,17)^(0,t.rotr)(b,19)^b>>>10;i[h]=v+i[h-7]+m+i[h-16]|0}let{A:c,B:d,C:p,D:f,E:_,F:R,G:w,H:O}=this;for(let h=0;h<64;h++){const T=(0,t.rotr)(_,6)^(0,t.rotr)(_,11)^(0,t.rotr)(_,25),b=O+T+(0,e.Chi)(_,R,w)+r[h]+i[h]|0,v=((0,t.rotr)(c,2)^(0,t.rotr)(c,13)^(0,t.rotr)(c,22))+(0,e.Maj)(c,d,p)|0;O=w,w=R,R=_,_=f+b|0,f=p,p=d,d=c,c=b+v|0}c=c+this.A|0,d=d+this.B|0,p=p+this.C|0,f=f+this.D|0,_=_+this.E|0,R=R+this.F|0,w=w+this.G|0,O=O+this.H|0,this.set(c,d,p,f,_,R,w,O)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class s extends a{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return Mi.sha256=(0,t.wrapConstructor)(()=>new a),Mi.sha224=(0,t.wrapConstructor)(()=>new s),Mi}var Vs={},Jp={},n1;function ZH(){return n1||(n1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Q_(),r=tu();class n extends r.Hash{constructor(s,o){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(s);const u=(0,r.toBytes)(o);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const l=this.blockLen,c=new Uint8Array(l);c.set(u.length>l?s.create().update(u).digest():u);for(let d=0;d<c.length;d++)c[d]^=54;this.iHash.update(c),this.oHash=s.create();for(let d=0;d<c.length;d++)c[d]^=106;this.oHash.update(c),c.fill(0)}update(s){return(0,t.exists)(this),this.iHash.update(s),this}digestInto(s){(0,t.exists)(this),(0,t.bytes)(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:o,iHash:u,finished:l,destroyed:c,blockLen:d,outputLen:p}=this;return s=s,s.finished=l,s.destroyed=c,s.blockLen=d,s.outputLen=p,s.oHash=o._cloneInto(s.oHash),s.iHash=u._cloneInto(s.iHash),s}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const i=(a,s,o)=>new n(a,s).update(o).digest();e.hmac=i,e.hmac.create=(a,s)=>new n(a,s)})(Jp)),Jp}var Qp={},Gs={},Lt={},Mt={},i1;function ls(){if(i1)return Mt;i1=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.bitMask=void 0,Mt.isBytes=n,Mt.abytes=i,Mt.bytesToHex=s,Mt.numberToHexUnpadded=o,Mt.hexToNumber=u,Mt.hexToBytes=d,Mt.bytesToNumberBE=p,Mt.bytesToNumberLE=f,Mt.numberToBytesBE=_,Mt.numberToBytesLE=R,Mt.numberToVarBytesBE=w,Mt.ensureBytes=O,Mt.concatBytes=h,Mt.equalBytes=T,Mt.utf8ToBytes=b,Mt.bitLen=m,Mt.bitGet=v,Mt.bitSet=A,Mt.createHmacDrbg=Y,Mt.validateObject=U;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=BigInt(0),t=BigInt(1),r=BigInt(2);function n(F){return F instanceof Uint8Array||F!=null&&typeof F=="object"&&F.constructor.name==="Uint8Array"}function i(F){if(!n(F))throw new Error("Uint8Array expected")}const a=Array.from({length:256},(F,ce)=>ce.toString(16).padStart(2,"0"));function s(F){i(F);let ce="";for(let se=0;se<F.length;se++)ce+=a[F[se]];return ce}function o(F){const ce=F.toString(16);return ce.length&1?`0${ce}`:ce}function u(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);return BigInt(F===""?"0":`0x${F}`)}const l={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function c(F){if(F>=l._0&&F<=l._9)return F-l._0;if(F>=l._A&&F<=l._F)return F-(l._A-10);if(F>=l._a&&F<=l._f)return F-(l._a-10)}function d(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);const ce=F.length,se=ce/2;if(ce%2)throw new Error("padded hex string expected, got unpadded hex of length "+ce);const ne=new Uint8Array(se);for(let X=0,x=0;X<se;X++,x+=2){const L=c(F.charCodeAt(x)),D=c(F.charCodeAt(x+1));if(L===void 0||D===void 0){const $=F[x]+F[x+1];throw new Error('hex string expected, got non-hex character "'+$+'" at index '+x)}ne[X]=L*16+D}return ne}function p(F){return u(s(F))}function f(F){return i(F),u(s(Uint8Array.from(F).reverse()))}function _(F,ce){return d(F.toString(16).padStart(ce*2,"0"))}function R(F,ce){return _(F,ce).reverse()}function w(F){return d(o(F))}function O(F,ce,se){let ne;if(typeof ce=="string")try{ne=d(ce)}catch(x){throw new Error(`${F} must be valid hex string, got "${ce}". Cause: ${x}`)}else if(n(ce))ne=Uint8Array.from(ce);else throw new Error(`${F} must be hex string or Uint8Array`);const X=ne.length;if(typeof se=="number"&&X!==se)throw new Error(`${F} expected ${se} bytes, got ${X}`);return ne}function h(...F){let ce=0;for(let ne=0;ne<F.length;ne++){const X=F[ne];i(X),ce+=X.length}const se=new Uint8Array(ce);for(let ne=0,X=0;ne<F.length;ne++){const x=F[ne];se.set(x,X),X+=x.length}return se}function T(F,ce){if(F.length!==ce.length)return!1;let se=0;for(let ne=0;ne<F.length;ne++)se|=F[ne]^ce[ne];return se===0}function b(F){if(typeof F!="string")throw new Error(`utf8ToBytes expected string, got ${typeof F}`);return new Uint8Array(new TextEncoder().encode(F))}function m(F){let ce;for(ce=0;F>e;F>>=t,ce+=1);return ce}function v(F,ce){return F>>BigInt(ce)&t}function A(F,ce,se){return F|(se?t:e)<<BigInt(ce)}const P=F=>(r<<BigInt(F-1))-t;Mt.bitMask=P;const q=F=>new Uint8Array(F),z=F=>Uint8Array.from(F);function Y(F,ce,se){if(typeof F!="number"||F<2)throw new Error("hashLen must be a number");if(typeof ce!="number"||ce<2)throw new Error("qByteLen must be a number");if(typeof se!="function")throw new Error("hmacFn must be a function");let ne=q(F),X=q(F),x=0;const L=()=>{ne.fill(1),X.fill(0),x=0},D=(...j)=>se(X,ne,...j),$=(j=q())=>{X=D(z([0]),j),ne=D(),j.length!==0&&(X=D(z([1]),j),ne=D())},V=()=>{if(x++>=1e3)throw new Error("drbg: tried 1000 values");let j=0;const Z=[];for(;j<ce;){ne=D();const Ee=ne.slice();Z.push(Ee),j+=ne.length}return h(...Z)};return(j,Z)=>{L(),$(j);let Ee;for(;!(Ee=Z(V()));)$();return L(),Ee}}const W={bigint:F=>typeof F=="bigint",function:F=>typeof F=="function",boolean:F=>typeof F=="boolean",string:F=>typeof F=="string",stringOrUint8Array:F=>typeof F=="string"||n(F),isSafeInteger:F=>Number.isSafeInteger(F),array:F=>Array.isArray(F),field:(F,ce)=>ce.Fp.isValid(F),hash:F=>typeof F=="function"&&Number.isSafeInteger(F.outputLen)};function U(F,ce,se={}){const ne=(X,x,L)=>{const D=W[x];if(typeof D!="function")throw new Error(`Invalid validator "${x}", expected function`);const $=F[X];if(!(L&&$===void 0)&&!D($,F))throw new Error(`Invalid param ${String(X)}=${$} (${typeof $}), expected ${x}`)};for(const[X,x]of Object.entries(ce))ne(X,x,!1);for(const[X,x]of Object.entries(se))ne(X,x,!0);return F}return Mt}var a1;function rd(){if(a1)return Lt;a1=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.isNegativeLE=void 0,Lt.mod=u,Lt.pow=l,Lt.pow2=c,Lt.invert=d,Lt.tonelliShanks=p,Lt.FpSqrt=f,Lt.validateField=w,Lt.FpPow=O,Lt.FpInvertBatch=h,Lt.FpDiv=T,Lt.FpIsSquare=b,Lt.nLength=m,Lt.Field=v,Lt.FpSqrtOdd=A,Lt.FpSqrtEven=P,Lt.hashToPrivateScalar=q,Lt.getFieldBytesLength=z,Lt.getMinHashLength=Y,Lt.mapHashToField=W;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=ls(),t=BigInt(0),r=BigInt(1),n=BigInt(2),i=BigInt(3),a=BigInt(4),s=BigInt(5),o=BigInt(8);BigInt(9),BigInt(16);function u(U,F){const ce=U%F;return ce>=t?ce:F+ce}function l(U,F,ce){if(ce<=t||F<t)throw new Error("Expected power/modulo > 0");if(ce===r)return t;let se=r;for(;F>t;)F&r&&(se=se*U%ce),U=U*U%ce,F>>=r;return se}function c(U,F,ce){let se=U;for(;F-- >t;)se*=se,se%=ce;return se}function d(U,F){if(U===t||F<=t)throw new Error(`invert: expected positive integers, got n=${U} mod=${F}`);let ce=u(U,F),se=F,ne=t,X=r;for(;ce!==t;){const L=se/ce,D=se%ce,$=ne-X*L;se=ce,ce=D,ne=X,X=$}if(se!==r)throw new Error("invert: does not exist");return u(ne,F)}function p(U){const F=(U-r)/n;let ce,se,ne;for(ce=U-r,se=0;ce%n===t;ce/=n,se++);for(ne=n;ne<U&&l(ne,F,U)!==U-r;ne++);if(se===1){const x=(U+r)/a;return function(D,$){const V=D.pow($,x);if(!D.eql(D.sqr(V),$))throw new Error("Cannot find square root");return V}}const X=(ce+r)/n;return function(L,D){if(L.pow(D,F)===L.neg(L.ONE))throw new Error("Cannot find square root");let $=se,V=L.pow(L.mul(L.ONE,ne),ce),N=L.pow(D,X),j=L.pow(D,ce);for(;!L.eql(j,L.ONE);){if(L.eql(j,L.ZERO))return L.ZERO;let Z=1;for(let _e=L.sqr(j);Z<$&&!L.eql(_e,L.ONE);Z++)_e=L.sqr(_e);const Ee=L.pow(V,r<<BigInt($-Z-1));V=L.sqr(Ee),N=L.mul(N,Ee),j=L.mul(j,V),$=Z}return N}}function f(U){if(U%a===i){const F=(U+r)/a;return function(se,ne){const X=se.pow(ne,F);if(!se.eql(se.sqr(X),ne))throw new Error("Cannot find square root");return X}}if(U%o===s){const F=(U-s)/o;return function(se,ne){const X=se.mul(ne,n),x=se.pow(X,F),L=se.mul(ne,x),D=se.mul(se.mul(L,n),x),$=se.mul(L,se.sub(D,se.ONE));if(!se.eql(se.sqr($),ne))throw new Error("Cannot find square root");return $}}return p(U)}const _=(U,F)=>(u(U,F)&r)===r;Lt.isNegativeLE=_;const R=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function w(U){const F={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},ce=R.reduce((se,ne)=>(se[ne]="function",se),F);return(0,e.validateObject)(U,ce)}function O(U,F,ce){if(ce<t)throw new Error("Expected power > 0");if(ce===t)return U.ONE;if(ce===r)return F;let se=U.ONE,ne=F;for(;ce>t;)ce&r&&(se=U.mul(se,ne)),ne=U.sqr(ne),ce>>=r;return se}function h(U,F){const ce=new Array(F.length),se=F.reduce((X,x,L)=>U.is0(x)?X:(ce[L]=X,U.mul(X,x)),U.ONE),ne=U.inv(se);return F.reduceRight((X,x,L)=>U.is0(x)?X:(ce[L]=U.mul(X,ce[L]),U.mul(X,x)),ne),ce}function T(U,F,ce){return U.mul(F,typeof ce=="bigint"?d(ce,U.ORDER):U.inv(ce))}function b(U){const F=(U.ORDER-r)/n;return ce=>{const se=U.pow(ce,F);return U.eql(se,U.ZERO)||U.eql(se,U.ONE)}}function m(U,F){const ce=F!==void 0?F:U.toString(2).length,se=Math.ceil(ce/8);return{nBitLength:ce,nByteLength:se}}function v(U,F,ce=!1,se={}){if(U<=t)throw new Error(`Expected Field ORDER > 0, got ${U}`);const{nBitLength:ne,nByteLength:X}=m(U,F);if(X>2048)throw new Error("Field lengths over 2048 bytes are not supported");const x=f(U),L=Object.freeze({ORDER:U,BITS:ne,BYTES:X,MASK:(0,e.bitMask)(ne),ZERO:t,ONE:r,create:D=>u(D,U),isValid:D=>{if(typeof D!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof D}`);return t<=D&&D<U},is0:D=>D===t,isOdd:D=>(D&r)===r,neg:D=>u(-D,U),eql:(D,$)=>D===$,sqr:D=>u(D*D,U),add:(D,$)=>u(D+$,U),sub:(D,$)=>u(D-$,U),mul:(D,$)=>u(D*$,U),pow:(D,$)=>O(L,D,$),div:(D,$)=>u(D*d($,U),U),sqrN:D=>D*D,addN:(D,$)=>D+$,subN:(D,$)=>D-$,mulN:(D,$)=>D*$,inv:D=>d(D,U),sqrt:se.sqrt||(D=>x(L,D)),invertBatch:D=>h(L,D),cmov:(D,$,V)=>V?$:D,toBytes:D=>ce?(0,e.numberToBytesLE)(D,X):(0,e.numberToBytesBE)(D,X),fromBytes:D=>{if(D.length!==X)throw new Error(`Fp.fromBytes: expected ${X}, got ${D.length}`);return ce?(0,e.bytesToNumberLE)(D):(0,e.bytesToNumberBE)(D)}});return Object.freeze(L)}function A(U,F){if(!U.isOdd)throw new Error("Field doesn't have isOdd");const ce=U.sqrt(F);return U.isOdd(ce)?ce:U.neg(ce)}function P(U,F){if(!U.isOdd)throw new Error("Field doesn't have isOdd");const ce=U.sqrt(F);return U.isOdd(ce)?U.neg(ce):ce}function q(U,F,ce=!1){U=(0,e.ensureBytes)("privateHash",U);const se=U.length,ne=m(F).nByteLength+8;if(ne<24||se<ne||se>1024)throw new Error(`hashToPrivateScalar: expected ${ne}-1024 bytes of input, got ${se}`);const X=ce?(0,e.bytesToNumberLE)(U):(0,e.bytesToNumberBE)(U);return u(X,F-r)+r}function z(U){if(typeof U!="bigint")throw new Error("field order must be bigint");const F=U.toString(2).length;return Math.ceil(F/8)}function Y(U){const F=z(U);return F+Math.ceil(F/2)}function W(U,F,ce=!1){const se=U.length,ne=z(F),X=Y(F);if(se<16||se<X||se>1024)throw new Error(`expected ${X}-1024 bytes of input, got ${se}`);const x=ce?(0,e.bytesToNumberBE)(U):(0,e.bytesToNumberLE)(U),L=u(x,F-r)+r;return ce?(0,e.numberToBytesLE)(L,ne):(0,e.numberToBytesBE)(L,ne)}return Lt}var s1;function eV(){if(s1)return Gs;s1=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.wNAF=i,Gs.validateBasic=a;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=rd(),t=ls(),r=BigInt(0),n=BigInt(1);function i(s,o){const u=(c,d)=>{const p=d.negate();return c?p:d},l=c=>{const d=Math.ceil(o/c)+1,p=2**(c-1);return{windows:d,windowSize:p}};return{constTimeNegate:u,unsafeLadder(c,d){let p=s.ZERO,f=c;for(;d>r;)d&n&&(p=p.add(f)),f=f.double(),d>>=n;return p},precomputeWindow(c,d){const{windows:p,windowSize:f}=l(d),_=[];let R=c,w=R;for(let O=0;O<p;O++){w=R,_.push(w);for(let h=1;h<f;h++)w=w.add(R),_.push(w);R=w.double()}return _},wNAF(c,d,p){const{windows:f,windowSize:_}=l(c);let R=s.ZERO,w=s.BASE;const O=BigInt(2**c-1),h=2**c,T=BigInt(c);for(let b=0;b<f;b++){const m=b*_;let v=Number(p&O);p>>=T,v>_&&(v-=h,p+=n);const A=m,P=m+Math.abs(v)-1,q=b%2!==0,z=v<0;v===0?w=w.add(u(q,d[A])):R=R.add(u(z,d[P]))}return{p:R,f:w}},wNAFCached(c,d,p,f){const _=c._WINDOW_SIZE||1;let R=d.get(c);return R||(R=this.precomputeWindow(c,_),_!==1&&d.set(c,f(R))),this.wNAF(_,R,p)}}}function a(s){return(0,e.validateField)(s.Fp),(0,t.validateObject)(s,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(s.n,s.nBitLength),...s,p:s.Fp.ORDER})}return Gs}var o1;function SC(){return o1||(o1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=f,e.weierstrass=R,e.SWUFpSqrtRatio=w,e.mapToCurveSimpleSWU=O;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=eV(),r=rd(),n=ls(),i=ls();function a(h){const T=(0,t.validateBasic)(h);n.validateObject(T,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:b,Fp:m,a:v}=T;if(b){if(!m.eql(v,m.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof b!="object"||typeof b.beta!="bigint"||typeof b.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...T})}const{bytesToNumberBE:s,hexToBytes:o}=n;e.DER={Err:class extends Error{constructor(T=""){super(T)}},_parseInt(h){const{Err:T}=e.DER;if(h.length<2||h[0]!==2)throw new T("Invalid signature integer tag");const b=h[1],m=h.subarray(2,b+2);if(!b||m.length!==b)throw new T("Invalid signature integer: wrong length");if(m[0]&128)throw new T("Invalid signature integer: negative");if(m[0]===0&&!(m[1]&128))throw new T("Invalid signature integer: unnecessary leading zero");return{d:s(m),l:h.subarray(b+2)}},toSig(h){const{Err:T}=e.DER,b=typeof h=="string"?o(h):h;n.abytes(b);let m=b.length;if(m<2||b[0]!=48)throw new T("Invalid signature tag");if(b[1]!==m-2)throw new T("Invalid signature: incorrect length");const{d:v,l:A}=e.DER._parseInt(b.subarray(2)),{d:P,l:q}=e.DER._parseInt(A);if(q.length)throw new T("Invalid signature: left bytes after parsing");return{r:v,s:P}},hexFromSig(h){const T=Y=>Number.parseInt(Y[0],16)&8?"00"+Y:Y,b=Y=>{const W=Y.toString(16);return W.length&1?`0${W}`:W},m=T(b(h.s)),v=T(b(h.r)),A=m.length/2,P=v.length/2,q=b(A),z=b(P);return`30${b(P+A+4)}02${z}${v}02${q}${m}`}};const u=BigInt(0),l=BigInt(1),c=BigInt(2),d=BigInt(3),p=BigInt(4);function f(h){const T=a(h),{Fp:b}=T,m=T.toBytes||((se,ne,X)=>{const x=ne.toAffine();return n.concatBytes(Uint8Array.from([4]),b.toBytes(x.x),b.toBytes(x.y))}),v=T.fromBytes||(se=>{const ne=se.subarray(1),X=b.fromBytes(ne.subarray(0,b.BYTES)),x=b.fromBytes(ne.subarray(b.BYTES,2*b.BYTES));return{x:X,y:x}});function A(se){const{a:ne,b:X}=T,x=b.sqr(se),L=b.mul(x,se);return b.add(b.add(L,b.mul(se,ne)),X)}if(!b.eql(b.sqr(T.Gy),A(T.Gx)))throw new Error("bad generator point: equation left != right");function P(se){return typeof se=="bigint"&&u<se&&se<T.n}function q(se){if(!P(se))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function z(se){const{allowedPrivateKeyLengths:ne,nByteLength:X,wrapPrivateKey:x,n:L}=T;if(ne&&typeof se!="bigint"){if(n.isBytes(se)&&(se=n.bytesToHex(se)),typeof se!="string"||!ne.includes(se.length))throw new Error("Invalid key");se=se.padStart(X*2,"0")}let D;try{D=typeof se=="bigint"?se:n.bytesToNumberBE((0,i.ensureBytes)("private key",se,X))}catch{throw new Error(`private key must be ${X} bytes, hex or bigint, not ${typeof se}`)}return x&&(D=r.mod(D,L)),q(D),D}const Y=new Map;function W(se){if(!(se instanceof U))throw new Error("ProjectivePoint expected")}class U{constructor(ne,X,x){if(this.px=ne,this.py=X,this.pz=x,ne==null||!b.isValid(ne))throw new Error("x required");if(X==null||!b.isValid(X))throw new Error("y required");if(x==null||!b.isValid(x))throw new Error("z required")}static fromAffine(ne){const{x:X,y:x}=ne||{};if(!ne||!b.isValid(X)||!b.isValid(x))throw new Error("invalid affine point");if(ne instanceof U)throw new Error("projective point not allowed");const L=D=>b.eql(D,b.ZERO);return L(X)&&L(x)?U.ZERO:new U(X,x,b.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ne){const X=b.invertBatch(ne.map(x=>x.pz));return ne.map((x,L)=>x.toAffine(X[L])).map(U.fromAffine)}static fromHex(ne){const X=U.fromAffine(v((0,i.ensureBytes)("pointHex",ne)));return X.assertValidity(),X}static fromPrivateKey(ne){return U.BASE.multiply(z(ne))}_setWindowSize(ne){this._WINDOW_SIZE=ne,Y.delete(this)}assertValidity(){if(this.is0()){if(T.allowInfinityPoint&&!b.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:ne,y:X}=this.toAffine();if(!b.isValid(ne)||!b.isValid(X))throw new Error("bad point: x or y not FE");const x=b.sqr(X),L=A(ne);if(!b.eql(x,L))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:ne}=this.toAffine();if(b.isOdd)return!b.isOdd(ne);throw new Error("Field doesn't support isOdd")}equals(ne){W(ne);const{px:X,py:x,pz:L}=this,{px:D,py:$,pz:V}=ne,N=b.eql(b.mul(X,V),b.mul(D,L)),j=b.eql(b.mul(x,V),b.mul($,L));return N&&j}negate(){return new U(this.px,b.neg(this.py),this.pz)}double(){const{a:ne,b:X}=T,x=b.mul(X,d),{px:L,py:D,pz:$}=this;let V=b.ZERO,N=b.ZERO,j=b.ZERO,Z=b.mul(L,L),Ee=b.mul(D,D),_e=b.mul($,$),Se=b.mul(L,D);return Se=b.add(Se,Se),j=b.mul(L,$),j=b.add(j,j),V=b.mul(ne,j),N=b.mul(x,_e),N=b.add(V,N),V=b.sub(Ee,N),N=b.add(Ee,N),N=b.mul(V,N),V=b.mul(Se,V),j=b.mul(x,j),_e=b.mul(ne,_e),Se=b.sub(Z,_e),Se=b.mul(ne,Se),Se=b.add(Se,j),j=b.add(Z,Z),Z=b.add(j,Z),Z=b.add(Z,_e),Z=b.mul(Z,Se),N=b.add(N,Z),_e=b.mul(D,$),_e=b.add(_e,_e),Z=b.mul(_e,Se),V=b.sub(V,Z),j=b.mul(_e,Ee),j=b.add(j,j),j=b.add(j,j),new U(V,N,j)}add(ne){W(ne);const{px:X,py:x,pz:L}=this,{px:D,py:$,pz:V}=ne;let N=b.ZERO,j=b.ZERO,Z=b.ZERO;const Ee=T.a,_e=b.mul(T.b,d);let Se=b.mul(X,D),Ie=b.mul(x,$),ie=b.mul(L,V),le=b.add(X,x),fe=b.add(D,$);le=b.mul(le,fe),fe=b.add(Se,Ie),le=b.sub(le,fe),fe=b.add(X,L);let me=b.add(D,V);return fe=b.mul(fe,me),me=b.add(Se,ie),fe=b.sub(fe,me),me=b.add(x,L),N=b.add($,V),me=b.mul(me,N),N=b.add(Ie,ie),me=b.sub(me,N),Z=b.mul(Ee,fe),N=b.mul(_e,ie),Z=b.add(N,Z),N=b.sub(Ie,Z),Z=b.add(Ie,Z),j=b.mul(N,Z),Ie=b.add(Se,Se),Ie=b.add(Ie,Se),ie=b.mul(Ee,ie),fe=b.mul(_e,fe),Ie=b.add(Ie,ie),ie=b.sub(Se,ie),ie=b.mul(Ee,ie),fe=b.add(fe,ie),Se=b.mul(Ie,fe),j=b.add(j,Se),Se=b.mul(me,fe),N=b.mul(le,N),N=b.sub(N,Se),Se=b.mul(le,Ie),Z=b.mul(me,Z),Z=b.add(Z,Se),new U(N,j,Z)}subtract(ne){return this.add(ne.negate())}is0(){return this.equals(U.ZERO)}wNAF(ne){return ce.wNAFCached(this,Y,ne,X=>{const x=b.invertBatch(X.map(L=>L.pz));return X.map((L,D)=>L.toAffine(x[D])).map(U.fromAffine)})}multiplyUnsafe(ne){const X=U.ZERO;if(ne===u)return X;if(q(ne),ne===l)return this;const{endo:x}=T;if(!x)return ce.unsafeLadder(this,ne);let{k1neg:L,k1:D,k2neg:$,k2:V}=x.splitScalar(ne),N=X,j=X,Z=this;for(;D>u||V>u;)D&l&&(N=N.add(Z)),V&l&&(j=j.add(Z)),Z=Z.double(),D>>=l,V>>=l;return L&&(N=N.negate()),$&&(j=j.negate()),j=new U(b.mul(j.px,x.beta),j.py,j.pz),N.add(j)}multiply(ne){q(ne);let X=ne,x,L;const{endo:D}=T;if(D){const{k1neg:$,k1:V,k2neg:N,k2:j}=D.splitScalar(X);let{p:Z,f:Ee}=this.wNAF(V),{p:_e,f:Se}=this.wNAF(j);Z=ce.constTimeNegate($,Z),_e=ce.constTimeNegate(N,_e),_e=new U(b.mul(_e.px,D.beta),_e.py,_e.pz),x=Z.add(_e),L=Ee.add(Se)}else{const{p:$,f:V}=this.wNAF(X);x=$,L=V}return U.normalizeZ([x,L])[0]}multiplyAndAddUnsafe(ne,X,x){const L=U.BASE,D=(V,N)=>N===u||N===l||!V.equals(L)?V.multiplyUnsafe(N):V.multiply(N),$=D(this,X).add(D(ne,x));return $.is0()?void 0:$}toAffine(ne){const{px:X,py:x,pz:L}=this,D=this.is0();ne==null&&(ne=D?b.ONE:b.inv(L));const $=b.mul(X,ne),V=b.mul(x,ne),N=b.mul(L,ne);if(D)return{x:b.ZERO,y:b.ZERO};if(!b.eql(N,b.ONE))throw new Error("invZ was invalid");return{x:$,y:V}}isTorsionFree(){const{h:ne,isTorsionFree:X}=T;if(ne===l)return!0;if(X)return X(U,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ne,clearCofactor:X}=T;return ne===l?this:X?X(U,this):this.multiplyUnsafe(T.h)}toRawBytes(ne=!0){return this.assertValidity(),m(U,this,ne)}toHex(ne=!0){return n.bytesToHex(this.toRawBytes(ne))}}U.BASE=new U(T.Gx,T.Gy,b.ONE),U.ZERO=new U(b.ZERO,b.ONE,b.ZERO);const F=T.nBitLength,ce=(0,t.wNAF)(U,T.endo?Math.ceil(F/2):F);return{CURVE:T,ProjectivePoint:U,normPrivateKeyToScalar:z,weierstrassEquation:A,isWithinCurveOrder:P}}function _(h){const T=(0,t.validateBasic)(h);return n.validateObject(T,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...T})}function R(h){const T=_(h),{Fp:b,n:m}=T,v=b.BYTES+1,A=2*b.BYTES+1;function P(fe){return u<fe&&fe<b.ORDER}function q(fe){return r.mod(fe,m)}function z(fe){return r.invert(fe,m)}const{ProjectivePoint:Y,normPrivateKeyToScalar:W,weierstrassEquation:U,isWithinCurveOrder:F}=f({...T,toBytes(fe,me,Te){const we=me.toAffine(),Fe=b.toBytes(we.x),xe=n.concatBytes;return Te?xe(Uint8Array.from([me.hasEvenY()?2:3]),Fe):xe(Uint8Array.from([4]),Fe,b.toBytes(we.y))},fromBytes(fe){const me=fe.length,Te=fe[0],we=fe.subarray(1);if(me===v&&(Te===2||Te===3)){const Fe=n.bytesToNumberBE(we);if(!P(Fe))throw new Error("Point is not on curve");const xe=U(Fe);let tt;try{tt=b.sqrt(xe)}catch($t){const vt=$t instanceof Error?": "+$t.message:"";throw new Error("Point is not on curve"+vt)}const Xe=(tt&l)===l;return(Te&1)===1!==Xe&&(tt=b.neg(tt)),{x:Fe,y:tt}}else if(me===A&&Te===4){const Fe=b.fromBytes(we.subarray(0,b.BYTES)),xe=b.fromBytes(we.subarray(b.BYTES,2*b.BYTES));return{x:Fe,y:xe}}else throw new Error(`Point of length ${me} was invalid. Expected ${v} compressed bytes or ${A} uncompressed bytes`)}}),ce=fe=>n.bytesToHex(n.numberToBytesBE(fe,T.nByteLength));function se(fe){const me=m>>l;return fe>me}function ne(fe){return se(fe)?q(-fe):fe}const X=(fe,me,Te)=>n.bytesToNumberBE(fe.slice(me,Te));class x{constructor(me,Te,we){this.r=me,this.s=Te,this.recovery=we,this.assertValidity()}static fromCompact(me){const Te=T.nByteLength;return me=(0,i.ensureBytes)("compactSignature",me,Te*2),new x(X(me,0,Te),X(me,Te,2*Te))}static fromDER(me){const{r:Te,s:we}=e.DER.toSig((0,i.ensureBytes)("DER",me));return new x(Te,we)}assertValidity(){if(!F(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!F(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(me){return new x(this.r,this.s,me)}recoverPublicKey(me){const{r:Te,s:we,recovery:Fe}=this,xe=j((0,i.ensureBytes)("msgHash",me));if(Fe==null||![0,1,2,3].includes(Fe))throw new Error("recovery id invalid");const tt=Fe===2||Fe===3?Te+T.n:Te;if(tt>=b.ORDER)throw new Error("recovery id 2 or 3 invalid");const Xe=(Fe&1)===0?"02":"03",ut=Y.fromHex(Xe+ce(tt)),$t=z(tt),vt=q(-xe*$t),zt=q(we*$t),bt=Y.BASE.multiplyAndAddUnsafe(ut,vt,zt);if(!bt)throw new Error("point at infinify");return bt.assertValidity(),bt}hasHighS(){return se(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,q(-this.s),this.recovery):this}toDERRawBytes(){return n.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return n.hexToBytes(this.toCompactHex())}toCompactHex(){return ce(this.r)+ce(this.s)}}const L={isValidPrivateKey(fe){try{return W(fe),!0}catch{return!1}},normPrivateKeyToScalar:W,randomPrivateKey:()=>{const fe=r.getMinHashLength(T.n);return r.mapHashToField(T.randomBytes(fe),T.n)},precompute(fe=8,me=Y.BASE){return me._setWindowSize(fe),me.multiply(BigInt(3)),me}};function D(fe,me=!0){return Y.fromPrivateKey(fe).toRawBytes(me)}function $(fe){const me=n.isBytes(fe),Te=typeof fe=="string",we=(me||Te)&&fe.length;return me?we===v||we===A:Te?we===2*v||we===2*A:fe instanceof Y}function V(fe,me,Te=!0){if($(fe))throw new Error("first arg must be private key");if(!$(me))throw new Error("second arg must be public key");return Y.fromHex(me).multiply(W(fe)).toRawBytes(Te)}const N=T.bits2int||function(fe){const me=n.bytesToNumberBE(fe),Te=fe.length*8-T.nBitLength;return Te>0?me>>BigInt(Te):me},j=T.bits2int_modN||function(fe){return q(N(fe))},Z=n.bitMask(T.nBitLength);function Ee(fe){if(typeof fe!="bigint")throw new Error("bigint expected");if(!(u<=fe&&fe<Z))throw new Error(`bigint expected < 2^${T.nBitLength}`);return n.numberToBytesBE(fe,T.nByteLength)}function _e(fe,me,Te=Se){if(["recovered","canonical"].some(nr=>nr in Te))throw new Error("sign() legacy options not supported");const{hash:we,randomBytes:Fe}=T;let{lowS:xe,prehash:tt,extraEntropy:Xe}=Te;xe==null&&(xe=!0),fe=(0,i.ensureBytes)("msgHash",fe),tt&&(fe=(0,i.ensureBytes)("prehashed msgHash",we(fe)));const ut=j(fe),$t=W(me),vt=[Ee($t),Ee(ut)];if(Xe!=null&&Xe!==!1){const nr=Xe===!0?Fe(b.BYTES):Xe;vt.push((0,i.ensureBytes)("extraEntropy",nr))}const zt=n.concatBytes(...vt),bt=ut;function rr(nr){const ht=N(nr);if(!F(ht))return;const wr=z(ht),M=Y.BASE.multiply(ht).toAffine(),E=q(M.x);if(E===u)return;const I=q(wr*q(bt+E*$t));if(I===u)return;let G=(M.x===E?0:2)|Number(M.y&l),de=I;return xe&&se(I)&&(de=ne(I),G^=1),new x(E,de,G)}return{seed:zt,k2sig:rr}}const Se={lowS:T.lowS,prehash:!1},Ie={lowS:T.lowS,prehash:!1};function ie(fe,me,Te=Se){const{seed:we,k2sig:Fe}=_e(fe,me,Te),xe=T;return n.createHmacDrbg(xe.hash.outputLen,xe.nByteLength,xe.hmac)(we,Fe)}Y.BASE._setWindowSize(8);function le(fe,me,Te,we=Ie){var M;const Fe=fe;if(me=(0,i.ensureBytes)("msgHash",me),Te=(0,i.ensureBytes)("publicKey",Te),"strict"in we)throw new Error("options.strict was renamed to lowS");const{lowS:xe,prehash:tt}=we;let Xe,ut;try{if(typeof Fe=="string"||n.isBytes(Fe))try{Xe=x.fromDER(Fe)}catch(E){if(!(E instanceof e.DER.Err))throw E;Xe=x.fromCompact(Fe)}else if(typeof Fe=="object"&&typeof Fe.r=="bigint"&&typeof Fe.s=="bigint"){const{r:E,s:I}=Fe;Xe=new x(E,I)}else throw new Error("PARSE");ut=Y.fromHex(Te)}catch(E){if(E.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(xe&&Xe.hasHighS())return!1;tt&&(me=T.hash(me));const{r:$t,s:vt}=Xe,zt=j(me),bt=z(vt),rr=q(zt*bt),nr=q($t*bt),ht=(M=Y.BASE.multiplyAndAddUnsafe(ut,rr,nr))==null?void 0:M.toAffine();return ht?q(ht.x)===$t:!1}return{CURVE:T,getPublicKey:D,getSharedSecret:V,sign:ie,verify:le,ProjectivePoint:Y,Signature:x,utils:L}}function w(h,T){const b=h.ORDER;let m=u;for(let se=b-l;se%c===u;se/=c)m+=l;const v=m,A=c<<v-l-l,P=A*c,q=(b-l)/P,z=(q-l)/c,Y=P-l,W=A,U=h.pow(T,q),F=h.pow(T,(q+l)/c);let ce=(se,ne)=>{let X=U,x=h.pow(ne,Y),L=h.sqr(x);L=h.mul(L,ne);let D=h.mul(se,L);D=h.pow(D,z),D=h.mul(D,x),x=h.mul(D,ne),L=h.mul(D,se);let $=h.mul(L,x);D=h.pow($,W);let V=h.eql(D,h.ONE);x=h.mul(L,F),D=h.mul($,X),L=h.cmov(x,L,V),$=h.cmov(D,$,V);for(let N=v;N>l;N--){let j=N-c;j=c<<j-l;let Z=h.pow($,j);const Ee=h.eql(Z,h.ONE);x=h.mul(L,X),X=h.mul(X,X),Z=h.mul($,X),L=h.cmov(x,L,Ee),$=h.cmov(Z,$,Ee)}return{isValid:V,value:L}};if(h.ORDER%p===d){const se=(h.ORDER-d)/p,ne=h.sqrt(h.neg(T));ce=(X,x)=>{let L=h.sqr(x);const D=h.mul(X,x);L=h.mul(L,D);let $=h.pow(L,se);$=h.mul($,D);const V=h.mul($,ne),N=h.mul(h.sqr($),x),j=h.eql(N,X);let Z=h.cmov(V,$,j);return{isValid:j,value:Z}}}return ce}function O(h,T){if(r.validateField(h),!h.isValid(T.A)||!h.isValid(T.B)||!h.isValid(T.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const b=w(h,T.Z);if(!h.isOdd)throw new Error("Fp.isOdd is not implemented!");return m=>{let v,A,P,q,z,Y,W,U;v=h.sqr(m),v=h.mul(v,T.Z),A=h.sqr(v),A=h.add(A,v),P=h.add(A,h.ONE),P=h.mul(P,T.B),q=h.cmov(T.Z,h.neg(A),!h.eql(A,h.ZERO)),q=h.mul(q,T.A),A=h.sqr(P),Y=h.sqr(q),z=h.mul(Y,T.A),A=h.add(A,z),A=h.mul(A,P),Y=h.mul(Y,q),z=h.mul(Y,T.B),A=h.add(A,z),W=h.mul(v,P);const{isValid:F,value:ce}=b(A,Y);U=h.mul(v,m),U=h.mul(U,ce),W=h.cmov(W,P,F),U=h.cmov(U,ce,F);const se=h.isOdd(m)===h.isOdd(U);return U=h.cmov(h.neg(U),U,se),W=h.div(W,q),{x:W,y:U}}}})(Qp)),Qp}var u1;function tV(){if(u1)return Vs;u1=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.getHash=n,Vs.createCurve=i;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=ZH(),t=tu(),r=SC();function n(a){return{hash:a,hmac:(s,...o)=>(0,e.hmac)(a,s,(0,t.concatBytes)(...o)),randomBytes:t.randomBytes}}function i(a,s){const o=u=>(0,r.weierstrass)({...a,...n(u)});return Object.freeze({...o(s),create:o})}return Vs}var Xn={},c1;function rV(){if(c1)return Xn;c1=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.expand_message_xmd=s,Xn.expand_message_xof=o,Xn.hash_to_field=u,Xn.isogenyMap=l,Xn.createHasher=c;const e=rd(),t=ls(),r=t.bytesToNumberBE;function n(d,p){if(d<0||d>=1<<8*p)throw new Error(`bad I2OSP call: value=${d} length=${p}`);const f=Array.from({length:p}).fill(0);for(let _=p-1;_>=0;_--)f[_]=d&255,d>>>=8;return new Uint8Array(f)}function i(d,p){const f=new Uint8Array(d.length);for(let _=0;_<d.length;_++)f[_]=d[_]^p[_];return f}function a(d){if(!Number.isSafeInteger(d))throw new Error("number expected")}function s(d,p,f,_){(0,t.abytes)(d),(0,t.abytes)(p),a(f),p.length>255&&(p=_((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),p)));const{outputLen:R,blockLen:w}=_,O=Math.ceil(f/R);if(O>255)throw new Error("Invalid xmd length");const h=(0,t.concatBytes)(p,n(p.length,1)),T=n(0,w),b=n(f,2),m=new Array(O),v=_((0,t.concatBytes)(T,d,b,n(0,1),h));m[0]=_((0,t.concatBytes)(v,n(1,1),h));for(let P=1;P<=O;P++){const q=[i(v,m[P-1]),n(P+1,1),h];m[P]=_((0,t.concatBytes)(...q))}return(0,t.concatBytes)(...m).slice(0,f)}function o(d,p,f,_,R){if((0,t.abytes)(d),(0,t.abytes)(p),a(f),p.length>255){const w=Math.ceil(2*_/8);p=R.create({dkLen:w}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(p).digest()}if(f>65535||p.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return R.create({dkLen:f}).update(d).update(n(f,2)).update(p).update(n(p.length,1)).digest()}function u(d,p,f){(0,t.validateObject)(f,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:_,k:R,m:w,hash:O,expand:h,DST:T}=f;(0,t.abytes)(d),a(p);const b=typeof T=="string"?(0,t.utf8ToBytes)(T):T,m=_.toString(2).length,v=Math.ceil((m+R)/8),A=p*w*v;let P;if(h==="xmd")P=s(d,b,A,O);else if(h==="xof")P=o(d,b,A,R,O);else if(h==="_internal_pass")P=d;else throw new Error('expand must be "xmd" or "xof"');const q=new Array(p);for(let z=0;z<p;z++){const Y=new Array(w);for(let W=0;W<w;W++){const U=v*(W+z*w),F=P.subarray(U,U+v);Y[W]=(0,e.mod)(r(F),_)}q[z]=Y}return q}function l(d,p){const f=p.map(_=>Array.from(_).reverse());return(_,R)=>{const[w,O,h,T]=f.map(b=>b.reduce((m,v)=>d.add(d.mul(m,_),v)));return _=d.div(w,O),R=d.mul(R,d.div(h,T)),{x:_,y:R}}}function c(d,p,f){if(typeof p!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(_,R){const w=u(_,2,{...f,DST:f.DST,...R}),O=d.fromAffine(p(w[0])),h=d.fromAffine(p(w[1])),T=O.add(h).clearCofactor();return T.assertValidity(),T},encodeToCurve(_,R){const w=u(_,1,{...f,DST:f.encodeDST,...R}),O=d.fromAffine(p(w[0])).clearCofactor();return O.assertValidity(),O},mapToCurve(_){if(!Array.isArray(_))throw new Error("mapToCurve: expected array of bigints");for(const w of _)if(typeof w!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${w} in array`);const R=d.fromAffine(p(_)).clearCofactor();return R.assertValidity(),R}}}return Xn}var l1;function nV(){return l1||(l1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=QH(),r=tu(),n=tV(),i=rV(),a=rd(),s=ls(),o=SC(),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),l=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),c=BigInt(1),d=BigInt(2),p=(x,L)=>(x+L/d)/L;function f(x){const L=u,D=BigInt(3),$=BigInt(6),V=BigInt(11),N=BigInt(22),j=BigInt(23),Z=BigInt(44),Ee=BigInt(88),_e=x*x*x%L,Se=_e*_e*x%L,Ie=(0,a.pow2)(Se,D,L)*Se%L,ie=(0,a.pow2)(Ie,D,L)*Se%L,le=(0,a.pow2)(ie,d,L)*_e%L,fe=(0,a.pow2)(le,V,L)*le%L,me=(0,a.pow2)(fe,N,L)*fe%L,Te=(0,a.pow2)(me,Z,L)*me%L,we=(0,a.pow2)(Te,Ee,L)*Te%L,Fe=(0,a.pow2)(we,Z,L)*me%L,xe=(0,a.pow2)(Fe,D,L)*Se%L,tt=(0,a.pow2)(xe,j,L)*fe%L,Xe=(0,a.pow2)(tt,$,L)*_e%L,ut=(0,a.pow2)(Xe,d,L);if(!_.eql(_.sqr(ut),x))throw new Error("Cannot find square root");return ut}const _=(0,a.Field)(u,void 0,void 0,{sqrt:f});e.secp256k1=(0,n.createCurve)({a:BigInt(0),b:BigInt(7),Fp:_,n:l,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:x=>{const L=l,D=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),$=-c*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),V=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),N=D,j=BigInt("0x100000000000000000000000000000000"),Z=p(N*x,L),Ee=p(-$*x,L);let _e=(0,a.mod)(x-Z*D-Ee*V,L),Se=(0,a.mod)(-Z*$-Ee*N,L);const Ie=_e>j,ie=Se>j;if(Ie&&(_e=L-_e),ie&&(Se=L-Se),_e>j||Se>j)throw new Error("splitScalar: Endomorphism failed, k="+x);return{k1neg:Ie,k1:_e,k2neg:ie,k2:Se}}}},t.sha256);const R=BigInt(0),w=x=>typeof x=="bigint"&&R<x&&x<u,O=x=>typeof x=="bigint"&&R<x&&x<l,h={};function T(x,...L){let D=h[x];if(D===void 0){const $=(0,t.sha256)(Uint8Array.from(x,V=>V.charCodeAt(0)));D=(0,s.concatBytes)($,$),h[x]=D}return(0,t.sha256)((0,s.concatBytes)(D,...L))}const b=x=>x.toRawBytes(!0).slice(1),m=x=>(0,s.numberToBytesBE)(x,32),v=x=>(0,a.mod)(x,u),A=x=>(0,a.mod)(x,l),P=e.secp256k1.ProjectivePoint,q=(x,L,D)=>P.BASE.multiplyAndAddUnsafe(x,L,D);function z(x){let L=e.secp256k1.utils.normPrivateKeyToScalar(x),D=P.fromPrivateKey(L);return{scalar:D.hasEvenY()?L:A(-L),bytes:b(D)}}function Y(x){if(!w(x))throw new Error("bad x: need 0 < x < p");const L=v(x*x),D=v(L*x+BigInt(7));let $=f(D);$%d!==R&&($=v(-$));const V=new P(x,$,c);return V.assertValidity(),V}function W(...x){return A((0,s.bytesToNumberBE)(T("BIP0340/challenge",...x)))}function U(x){return z(x).bytes}function F(x,L,D=(0,r.randomBytes)(32)){const $=(0,s.ensureBytes)("message",x),{bytes:V,scalar:N}=z(L),j=(0,s.ensureBytes)("auxRand",D,32),Z=m(N^(0,s.bytesToNumberBE)(T("BIP0340/aux",j))),Ee=T("BIP0340/nonce",Z,V,$),_e=A((0,s.bytesToNumberBE)(Ee));if(_e===R)throw new Error("sign failed: k is zero");const{bytes:Se,scalar:Ie}=z(_e),ie=W(Se,V,$),le=new Uint8Array(64);if(le.set(Se,0),le.set(m(A(Ie+ie*N)),32),!ce(le,$,V))throw new Error("sign: Invalid signature produced");return le}function ce(x,L,D){const $=(0,s.ensureBytes)("signature",x,64),V=(0,s.ensureBytes)("message",L),N=(0,s.ensureBytes)("publicKey",D,32);try{const j=Y((0,s.bytesToNumberBE)(N)),Z=(0,s.bytesToNumberBE)($.subarray(0,32));if(!w(Z))return!1;const Ee=(0,s.bytesToNumberBE)($.subarray(32,64));if(!O(Ee))return!1;const _e=W(m(Z),b(j),V),Se=q(j,Ee,A(-_e));return!(!Se||!Se.hasEvenY()||Se.toAffine().x!==Z)}catch{return!1}}e.schnorr={getPublicKey:U,sign:F,verify:ce,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:Y,pointToBytes:b,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:T,mod:a.mod}};const se=(0,i.isogenyMap)(_,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(x=>x.map(L=>BigInt(L)))),ne=(0,o.mapToCurveSimpleSWU)(_,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:_.create(BigInt("-11"))}),X=(0,i.createHasher)(e.secp256k1.ProjectivePoint,x=>{const{x:L,y:D}=ne(_.create(x[0]));return se(L,D)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:_.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=X.hashToCurve,e.encodeToCurve=X.encodeToCurve})(Kp)),Kp}var d1;function iV(){return d1||(d1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=nV();Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(xp)),xp}var f1;function aV(){if(f1)return fn;f1=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.recoverPublicKey=r,fn.recoverAddressFromEthSignature=i,fn.sign=a,fn.createEthereumMessageHash=s,fn.ethSign=o,fn.computeAddress=u,fn.createUnsafeIdentity=l;const e=td(),t=iV();function r(c,d){if(c.length!==65)throw new Error("Invalid signature length "+c.length);const p=c[64];if(p!==27&&p!==28)throw new Error(`Invalid signature recovery value: ${p}. Expected 27 or 28.`);const f=c.slice(0,c.length-1),_=p===28?1:0;return t.secp256k1.Signature.fromCompact(f).addRecoveryBit(_).recoverPublicKey(d).toRawBytes(!1).slice(1)}function n(c){if(c.length!==65)throw new Error("Invalid ethereum signature");const d=c[64];if(d===0||d===1){const p=new Uint8Array(c);return p[64]=d+27,p}return c}function i(c,d){if(typeof c=="string"){if((0,e.isHex)(c))return i((0,e.hexToBytes)(c),d);throw new Error("String signatures must be encoded in hex")}return u(r(n(c),s(d)))}function a(c,d){const p=t.secp256k1.sign(d,c),f=p.recovery===1?"1c":"1b";return"0x"+p.toCompactHex()+f}function s(c){const d=typeof c=="string"?(0,e.stringToUtf8Bytes)(c):c,p=(0,e.concatBytes)((0,e.stringToUtf8Bytes)(`Ethereum Signed Message:
|
|
69
|
+
*/(function(y){(function(){var S="input is invalid type",C=typeof window=="object",K=C?window:{};K.JS_SHA3_NO_WINDOW&&(C=!1);var ee=!C&&typeof self=="object";!K.JS_SHA3_NO_NODE_JS&&typeof yl=="object"&&yl.versions&&yl.versions.node?K=sg:ee&&(K=self);var oe=!K.JS_SHA3_NO_COMMON_JS&&y.exports,ve=!K.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",Pe="0123456789abcdef".split(""),He=[4,1024,262144,67108864],Ge=[0,8,16,24],cr=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],qt=[224,256,384,512],De=[128,256],Kt=["hex","buffer","arrayBuffer","array","digest"],It={128:168,256:136};!K.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),!ve||!K.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});for(var Rt=function(g,B,Q){return function(H){return new lt(g,B,g).update(H)[Q]()}},ir=function(g,B,Q){return function(H,te){return new lt(g,B,te).update(H)[Q]()}},In=function(g,B,Q){return function(H,te,re,ae){return Xt["cshake"+g].update(H,te,re,ae)[Q]()}},on=function(g,B,Q){return function(H,te,re,ae){return Xt["kmac"+g].update(H,te,re,ae)[Q]()}},ar=function(g,B,Q,H){for(var te=0;te<Kt.length;++te){var re=Kt[te];g[re]=B(Q,H,re)}return g},un=function(g,B){var Q=Rt(g,B,"hex");return Q.create=function(){return new lt(g,B,g)},Q.update=function(H){return Q.create().update(H)},ar(Q,Rt,g,B)},Gn=[{name:"keccak",padding:[1,256,65536,16777216],bits:qt,createMethod:un},{name:"sha3",padding:[6,1536,393216,100663296],bits:qt,createMethod:un},{name:"shake",padding:[31,7936,2031616,520093696],bits:De,createMethod:function(g,B){var Q=ir(g,B,"hex");return Q.create=function(H){return new lt(g,B,H)},Q.update=function(H,te){return Q.create(te).update(H)},ar(Q,ir,g,B)}},{name:"cshake",padding:He,bits:De,createMethod:function(g,B){var Q=It[g],H=In(g,0,"hex");return H.create=function(te,re,ae){return re||ae?new lt(g,B,te).bytepad([re,ae],Q):Xt["shake"+g].create(te)},H.update=function(te,re,ae,pe){return H.create(re,ae,pe).update(te)},ar(H,In,g,B)}},{name:"kmac",padding:He,bits:De,createMethod:function(g,B){var Q=It[g],H=on(g,0,"hex");return H.create=function(te,re,ae){return new Ar(g,B,re).bytepad(["KMAC",ae],Q).bytepad([te],Q)},H.update=function(te,re,ae,pe){return H.create(te,ae,pe).update(re)},ar(H,on,g,B)}}],Xt={},Rn=[],sr=0;sr<Gn.length;++sr)for(var cn=Gn[sr],Ae=cn.bits,wn=0;wn<Ae.length;++wn){var Na=cn.name+"_"+Ae[wn];if(Rn.push(Na),Xt[Na]=cn.createMethod(Ae[wn],cn.padding),cn.name!=="sha3"){var Pa=cn.name+Ae[wn];Rn.push(Pa),Xt[Pa]=Xt[Na]}}function lt(g,B,Q){this.blocks=[],this.s=[],this.padding=B,this.outputBits=Q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(g<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Q>>5,this.extraBytes=(31&Q)>>3;for(var H=0;H<50;++H)this.s[H]=0}function Ar(g,B,Q){lt.call(this,g,B,Q)}lt.prototype.update=function(g){if(this.finalized)throw new Error("finalize already called");var B,Q=typeof g;if(Q!=="string"){if(Q!=="object")throw new Error(S);if(g===null)throw new Error(S);if(ve&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!(Array.isArray(g)||ve&&ArrayBuffer.isView(g)))throw new Error(S);B=!0}for(var H,te,re=this.blocks,ae=this.byteCount,pe=g.length,ye=this.blockCount,he=0,Ce=this.s;he<pe;){if(this.reset)for(this.reset=!1,re[0]=this.block,H=1;H<ye+1;++H)re[H]=0;if(B)for(H=this.start;he<pe&&H<ae;++he)re[H>>2]|=g[he]<<Ge[3&H++];else for(H=this.start;he<pe&&H<ae;++he)(te=g.charCodeAt(he))<128?re[H>>2]|=te<<Ge[3&H++]:te<2048?(re[H>>2]|=(192|te>>6)<<Ge[3&H++],re[H>>2]|=(128|63&te)<<Ge[3&H++]):te<55296||te>=57344?(re[H>>2]|=(224|te>>12)<<Ge[3&H++],re[H>>2]|=(128|te>>6&63)<<Ge[3&H++],re[H>>2]|=(128|63&te)<<Ge[3&H++]):(te=65536+((1023&te)<<10|1023&g.charCodeAt(++he)),re[H>>2]|=(240|te>>18)<<Ge[3&H++],re[H>>2]|=(128|te>>12&63)<<Ge[3&H++],re[H>>2]|=(128|te>>6&63)<<Ge[3&H++],re[H>>2]|=(128|63&te)<<Ge[3&H++]);if(this.lastByteIndex=H,H>=ae){for(this.start=H-ae,this.block=re[ye],H=0;H<ye;++H)Ce[H]^=re[H];k(Ce),this.reset=!0}else this.start=H}return this},lt.prototype.encode=function(g,B){var Q=255&g,H=1,te=[Q];for(Q=255&(g>>=8);Q>0;)te.unshift(Q),Q=255&(g>>=8),++H;return B?te.push(H):te.unshift(H),this.update(te),te.length},lt.prototype.encodeString=function(g){var B,Q=typeof g;if(Q!=="string"){if(Q!=="object")throw new Error(S);if(g===null)throw new Error(S);if(ve&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!(Array.isArray(g)||ve&&ArrayBuffer.isView(g)))throw new Error(S);B=!0}var H=0,te=g.length;if(B)H=te;else for(var re=0;re<g.length;++re){var ae=g.charCodeAt(re);ae<128?H+=1:ae<2048?H+=2:ae<55296||ae>=57344?H+=3:(ae=65536+((1023&ae)<<10|1023&g.charCodeAt(++re)),H+=4)}return H+=this.encode(8*H),this.update(g),H},lt.prototype.bytepad=function(g,B){for(var Q=this.encode(B),H=0;H<g.length;++H)Q+=this.encodeString(g[H]);var te=B-Q%B,re=[];return re.length=te,this.update(re),this},lt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,B=this.lastByteIndex,Q=this.blockCount,H=this.s;if(g[B>>2]|=this.padding[3&B],this.lastByteIndex===this.byteCount)for(g[0]=g[Q],B=1;B<Q+1;++B)g[B]=0;for(g[Q-1]|=2147483648,B=0;B<Q;++B)H[B]^=g[B];k(H)}},lt.prototype.toString=lt.prototype.hex=function(){this.finalize();for(var g,B=this.blockCount,Q=this.s,H=this.outputBlocks,te=this.extraBytes,re=0,ae=0,pe="";ae<H;){for(re=0;re<B&&ae<H;++re,++ae)g=Q[re],pe+=Pe[g>>4&15]+Pe[15&g]+Pe[g>>12&15]+Pe[g>>8&15]+Pe[g>>20&15]+Pe[g>>16&15]+Pe[g>>28&15]+Pe[g>>24&15];ae%B==0&&(k(Q),re=0)}return te&&(g=Q[re],pe+=Pe[g>>4&15]+Pe[15&g],te>1&&(pe+=Pe[g>>12&15]+Pe[g>>8&15]),te>2&&(pe+=Pe[g>>20&15]+Pe[g>>16&15])),pe},lt.prototype.arrayBuffer=function(){this.finalize();var g,B=this.blockCount,Q=this.s,H=this.outputBlocks,te=this.extraBytes,re=0,ae=0,pe=this.outputBits>>3;g=te?new ArrayBuffer(H+1<<2):new ArrayBuffer(pe);for(var ye=new Uint32Array(g);ae<H;){for(re=0;re<B&&ae<H;++re,++ae)ye[ae]=Q[re];ae%B==0&&k(Q)}return te&&(ye[re]=Q[re],g=g.slice(0,pe)),g},lt.prototype.buffer=lt.prototype.arrayBuffer,lt.prototype.digest=lt.prototype.array=function(){this.finalize();for(var g,B,Q=this.blockCount,H=this.s,te=this.outputBlocks,re=this.extraBytes,ae=0,pe=0,ye=[];pe<te;){for(ae=0;ae<Q&&pe<te;++ae,++pe)g=pe<<2,B=H[ae],ye[g]=255&B,ye[g+1]=B>>8&255,ye[g+2]=B>>16&255,ye[g+3]=B>>24&255;pe%Q==0&&k(H)}return re&&(g=pe<<2,B=H[ae],ye[g]=255&B,re>1&&(ye[g+1]=B>>8&255),re>2&&(ye[g+2]=B>>16&255)),ye},Ar.prototype=new lt,Ar.prototype.finalize=function(){return this.encode(this.outputBits,!0),lt.prototype.finalize.call(this)};var k=function(g){var B,Q,H,te,re,ae,pe,ye,he,Ce,Ve,Ye,it,wt,jt,et,dt,Ut,An,zn,Wn,lr,ln,Jt,Ft,St,lu,du,fu,pu,mu,hu,yu,gu,_u,Eu,vu,bu,Tu,Su,Iu,Ru,wu,Au,Ou,Nu,Pu,Cu,Mu,Du,ju,Lu,$u,qu,Bu,ku,Uu,Fu,Hu,Vu,Gu,zu,Wu;for(H=0;H<48;H+=2)te=g[0]^g[10]^g[20]^g[30]^g[40],re=g[1]^g[11]^g[21]^g[31]^g[41],ae=g[2]^g[12]^g[22]^g[32]^g[42],pe=g[3]^g[13]^g[23]^g[33]^g[43],ye=g[4]^g[14]^g[24]^g[34]^g[44],he=g[5]^g[15]^g[25]^g[35]^g[45],Ce=g[6]^g[16]^g[26]^g[36]^g[46],Ve=g[7]^g[17]^g[27]^g[37]^g[47],B=(Ye=g[8]^g[18]^g[28]^g[38]^g[48])^(ae<<1|pe>>>31),Q=(it=g[9]^g[19]^g[29]^g[39]^g[49])^(pe<<1|ae>>>31),g[0]^=B,g[1]^=Q,g[10]^=B,g[11]^=Q,g[20]^=B,g[21]^=Q,g[30]^=B,g[31]^=Q,g[40]^=B,g[41]^=Q,B=te^(ye<<1|he>>>31),Q=re^(he<<1|ye>>>31),g[2]^=B,g[3]^=Q,g[12]^=B,g[13]^=Q,g[22]^=B,g[23]^=Q,g[32]^=B,g[33]^=Q,g[42]^=B,g[43]^=Q,B=ae^(Ce<<1|Ve>>>31),Q=pe^(Ve<<1|Ce>>>31),g[4]^=B,g[5]^=Q,g[14]^=B,g[15]^=Q,g[24]^=B,g[25]^=Q,g[34]^=B,g[35]^=Q,g[44]^=B,g[45]^=Q,B=ye^(Ye<<1|it>>>31),Q=he^(it<<1|Ye>>>31),g[6]^=B,g[7]^=Q,g[16]^=B,g[17]^=Q,g[26]^=B,g[27]^=Q,g[36]^=B,g[37]^=Q,g[46]^=B,g[47]^=Q,B=Ce^(te<<1|re>>>31),Q=Ve^(re<<1|te>>>31),g[8]^=B,g[9]^=Q,g[18]^=B,g[19]^=Q,g[28]^=B,g[29]^=Q,g[38]^=B,g[39]^=Q,g[48]^=B,g[49]^=Q,wt=g[0],jt=g[1],Nu=g[11]<<4|g[10]>>>28,Pu=g[10]<<4|g[11]>>>28,du=g[20]<<3|g[21]>>>29,fu=g[21]<<3|g[20]>>>29,Vu=g[31]<<9|g[30]>>>23,Gu=g[30]<<9|g[31]>>>23,Ru=g[40]<<18|g[41]>>>14,wu=g[41]<<18|g[40]>>>14,gu=g[2]<<1|g[3]>>>31,_u=g[3]<<1|g[2]>>>31,et=g[13]<<12|g[12]>>>20,dt=g[12]<<12|g[13]>>>20,Cu=g[22]<<10|g[23]>>>22,Mu=g[23]<<10|g[22]>>>22,pu=g[33]<<13|g[32]>>>19,mu=g[32]<<13|g[33]>>>19,zu=g[42]<<2|g[43]>>>30,Wu=g[43]<<2|g[42]>>>30,qu=g[5]<<30|g[4]>>>2,Bu=g[4]<<30|g[5]>>>2,Eu=g[14]<<6|g[15]>>>26,vu=g[15]<<6|g[14]>>>26,Ut=g[25]<<11|g[24]>>>21,An=g[24]<<11|g[25]>>>21,Du=g[34]<<15|g[35]>>>17,ju=g[35]<<15|g[34]>>>17,hu=g[45]<<29|g[44]>>>3,yu=g[44]<<29|g[45]>>>3,Jt=g[6]<<28|g[7]>>>4,Ft=g[7]<<28|g[6]>>>4,ku=g[17]<<23|g[16]>>>9,Uu=g[16]<<23|g[17]>>>9,bu=g[26]<<25|g[27]>>>7,Tu=g[27]<<25|g[26]>>>7,zn=g[36]<<21|g[37]>>>11,Wn=g[37]<<21|g[36]>>>11,Lu=g[47]<<24|g[46]>>>8,$u=g[46]<<24|g[47]>>>8,Au=g[8]<<27|g[9]>>>5,Ou=g[9]<<27|g[8]>>>5,St=g[18]<<20|g[19]>>>12,lu=g[19]<<20|g[18]>>>12,Fu=g[29]<<7|g[28]>>>25,Hu=g[28]<<7|g[29]>>>25,Su=g[38]<<8|g[39]>>>24,Iu=g[39]<<8|g[38]>>>24,lr=g[48]<<14|g[49]>>>18,ln=g[49]<<14|g[48]>>>18,g[0]=wt^~et&Ut,g[1]=jt^~dt&An,g[10]=Jt^~St&du,g[11]=Ft^~lu&fu,g[20]=gu^~Eu&bu,g[21]=_u^~vu&Tu,g[30]=Au^~Nu&Cu,g[31]=Ou^~Pu&Mu,g[40]=qu^~ku&Fu,g[41]=Bu^~Uu&Hu,g[2]=et^~Ut&zn,g[3]=dt^~An&Wn,g[12]=St^~du&pu,g[13]=lu^~fu&mu,g[22]=Eu^~bu&Su,g[23]=vu^~Tu&Iu,g[32]=Nu^~Cu&Du,g[33]=Pu^~Mu&ju,g[42]=ku^~Fu&Vu,g[43]=Uu^~Hu&Gu,g[4]=Ut^~zn&lr,g[5]=An^~Wn&ln,g[14]=du^~pu&hu,g[15]=fu^~mu&yu,g[24]=bu^~Su&Ru,g[25]=Tu^~Iu&wu,g[34]=Cu^~Du&Lu,g[35]=Mu^~ju&$u,g[44]=Fu^~Vu&zu,g[45]=Hu^~Gu&Wu,g[6]=zn^~lr&wt,g[7]=Wn^~ln&jt,g[16]=pu^~hu&Jt,g[17]=mu^~yu&Ft,g[26]=Su^~Ru&gu,g[27]=Iu^~wu&_u,g[36]=Du^~Lu&Au,g[37]=ju^~$u&Ou,g[46]=Vu^~zu&qu,g[47]=Gu^~Wu&Bu,g[8]=lr^~wt&et,g[9]=ln^~jt&dt,g[18]=hu^~Jt&St,g[19]=yu^~Ft&lu,g[28]=Ru^~gu&Eu,g[29]=wu^~_u&vu,g[38]=Lu^~Au&Nu,g[39]=$u^~Ou&Pu,g[48]=zu^~qu&ku,g[49]=Wu^~Bu&Uu,g[0]^=cr[H],g[1]^=cr[H+1]};if(oe)y.exports=Xt;else for(sr=0;sr<Rn.length;++sr)K[Rn[sr]]=Xt[Rn[sr]]})()})(o);var u=o.exports,l=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,c=Math.ceil,d=Math.floor,p="[BigNumber Error] ",f=p+"Number primitive has more than 15 significant digits: ",_=1e14,R=14,w=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,T=1e9;function b(y){var S=0|y;return y>0||y===S?S:S-1}function m(y){for(var S,C,K=1,ee=y.length,oe=y[0]+"";K<ee;){for(S=y[K++]+"",C=R-S.length;C--;S="0"+S);oe+=S}for(ee=oe.length;oe.charCodeAt(--ee)===48;);return oe.slice(0,ee+1||1)}function v(y,S){var C,K,ee=y.c,oe=S.c,ve=y.s,Pe=S.s,He=y.e,Ge=S.e;if(!ve||!Pe)return null;if(C=ee&&!ee[0],K=oe&&!oe[0],C||K)return C?K?0:-Pe:ve;if(ve!=Pe)return ve;if(C=ve<0,K=He==Ge,!ee||!oe)return K?0:!ee^C?1:-1;if(!K)return He>Ge^C?1:-1;for(Pe=(He=ee.length)<(Ge=oe.length)?He:Ge,ve=0;ve<Pe;ve++)if(ee[ve]!=oe[ve])return ee[ve]>oe[ve]^C?1:-1;return He==Ge?0:He>Ge^C?1:-1}function A(y,S,C,K){if(y<S||y>C||y!==d(y))throw Error(p+(K||"Argument")+(typeof y=="number"?y<S||y>C?" out of range: ":" not an integer: ":" not a primitive number: ")+String(y))}function P(y){var S=y.c.length-1;return b(y.e/R)==S&&y.c[S]%2!=0}function q(y,S){return(y.length>1?y.charAt(0)+"."+y.slice(1):y)+(S<0?"e":"e+")+S}function z(y,S,C){var K,ee;if(S<0){for(ee=C+".";++S;ee+=C);y=ee+y}else if(++S>(K=y.length)){for(ee=C,S-=K;--S;ee+=C);y+=ee}else S<K&&(y=y.slice(0,S)+"."+y.slice(S));return y}var Y=(function y(S){var C,K,ee,oe,ve,Pe,He,Ge,cr,qt,De=Ae.prototype={constructor:Ae,toString:null,valueOf:null},Kt=new Ae(1),It=20,Rt=4,ir=-7,In=21,on=-1e7,ar=1e7,un=!1,Gn=1,Xt=0,Rn={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},sr="0123456789abcdefghijklmnopqrstuvwxyz",cn=!0;function Ae(k,g){var B,Q,H,te,re,ae,pe,ye,he=this;if(!(he instanceof Ae))return new Ae(k,g);if(g==null){if(k&&k._isBigNumber===!0)return he.s=k.s,void(!k.c||k.e>ar?he.c=he.e=null:k.e<on?he.c=[he.e=0]:(he.e=k.e,he.c=k.c.slice()));if((ae=typeof k=="number")&&0*k==0){if(he.s=1/k<0?(k=-k,-1):1,k===~~k){for(te=0,re=k;re>=10;re/=10,te++);return void(te>ar?he.c=he.e=null:(he.e=te,he.c=[k]))}ye=String(k)}else{if(!l.test(ye=String(k)))return ee(he,ye,ae);he.s=ye.charCodeAt(0)==45?(ye=ye.slice(1),-1):1}(te=ye.indexOf("."))>-1&&(ye=ye.replace(".","")),(re=ye.search(/e/i))>0?(te<0&&(te=re),te+=+ye.slice(re+1),ye=ye.substring(0,re)):te<0&&(te=ye.length)}else{if(A(g,2,sr.length,"Base"),g==10&&cn)return lt(he=new Ae(k),It+he.e+1,Rt);if(ye=String(k),ae=typeof k=="number"){if(0*k!=0)return ee(he,ye,ae,g);if(he.s=1/k<0?(ye=ye.slice(1),-1):1,Ae.DEBUG&&ye.replace(/^0\.0*|\./,"").length>15)throw Error(f+k)}else he.s=ye.charCodeAt(0)===45?(ye=ye.slice(1),-1):1;for(B=sr.slice(0,g),te=re=0,pe=ye.length;re<pe;re++)if(B.indexOf(Q=ye.charAt(re))<0){if(Q=="."){if(re>te){te=pe;continue}}else if(!H&&(ye==ye.toUpperCase()&&(ye=ye.toLowerCase())||ye==ye.toLowerCase()&&(ye=ye.toUpperCase()))){H=!0,re=-1,te=0;continue}return ee(he,String(k),ae,g)}ae=!1,(te=(ye=K(ye,g,10,he.s)).indexOf("."))>-1?ye=ye.replace(".",""):te=ye.length}for(re=0;ye.charCodeAt(re)===48;re++);for(pe=ye.length;ye.charCodeAt(--pe)===48;);if(ye=ye.slice(re,++pe)){if(pe-=re,ae&&Ae.DEBUG&&pe>15&&(k>w||k!==d(k)))throw Error(f+he.s*k);if((te=te-re-1)>ar)he.c=he.e=null;else if(te<on)he.c=[he.e=0];else{if(he.e=te,he.c=[],re=(te+1)%R,te<0&&(re+=R),re<pe){for(re&&he.c.push(+ye.slice(0,re)),pe-=R;re<pe;)he.c.push(+ye.slice(re,re+=R));re=R-(ye=ye.slice(re)).length}else re-=pe;for(;re--;ye+="0");he.c.push(+ye)}}else he.c=[he.e=0]}function wn(k,g,B,Q){var H,te,re,ae,pe;if(B==null?B=Rt:A(B,0,8),!k.c)return k.toString();if(H=k.c[0],re=k.e,g==null)pe=m(k.c),pe=Q==1||Q==2&&(re<=ir||re>=In)?q(pe,re):z(pe,re,"0");else if(te=(k=lt(new Ae(k),g,B)).e,ae=(pe=m(k.c)).length,Q==1||Q==2&&(g<=te||te<=ir)){for(;ae<g;pe+="0",ae++);pe=q(pe,te)}else if(g-=re,pe=z(pe,te,"0"),te+1>ae){if(--g>0)for(pe+=".";g--;pe+="0");}else if((g+=te-ae)>0)for(te+1==ae&&(pe+=".");g--;pe+="0");return k.s<0&&H?"-"+pe:pe}function Na(k,g){for(var B,Q=1,H=new Ae(k[0]);Q<k.length;Q++){if(!(B=new Ae(k[Q])).s){H=B;break}g.call(H,B)&&(H=B)}return H}function Pa(k,g,B){for(var Q=1,H=g.length;!g[--H];g.pop());for(H=g[0];H>=10;H/=10,Q++);return(B=Q+B*R-1)>ar?k.c=k.e=null:B<on?k.c=[k.e=0]:(k.e=B,k.c=g),k}function lt(k,g,B,Q){var H,te,re,ae,pe,ye,he,Ce=k.c,Ve=O;if(Ce){e:{for(H=1,ae=Ce[0];ae>=10;ae/=10,H++);if((te=g-H)<0)te+=R,re=g,he=(pe=Ce[ye=0])/Ve[H-re-1]%10|0;else if((ye=c((te+1)/R))>=Ce.length){if(!Q)break e;for(;Ce.length<=ye;Ce.push(0));pe=he=0,H=1,re=(te%=R)-R+1}else{for(pe=ae=Ce[ye],H=1;ae>=10;ae/=10,H++);he=(re=(te%=R)-R+H)<0?0:pe/Ve[H-re-1]%10|0}if(Q=Q||g<0||Ce[ye+1]!=null||(re<0?pe:pe%Ve[H-re-1]),Q=B<4?(he||Q)&&(B==0||B==(k.s<0?3:2)):he>5||he==5&&(B==4||Q||B==6&&(te>0?re>0?pe/Ve[H-re]:0:Ce[ye-1])%10&1||B==(k.s<0?8:7)),g<1||!Ce[0])return Ce.length=0,Q?(g-=k.e+1,Ce[0]=Ve[(R-g%R)%R],k.e=-g||0):Ce[0]=k.e=0,k;if(te==0?(Ce.length=ye,ae=1,ye--):(Ce.length=ye+1,ae=Ve[R-te],Ce[ye]=re>0?d(pe/Ve[H-re]%Ve[re])*ae:0),Q)for(;;){if(ye==0){for(te=1,re=Ce[0];re>=10;re/=10,te++);for(re=Ce[0]+=ae,ae=1;re>=10;re/=10,ae++);te!=ae&&(k.e++,Ce[0]==_&&(Ce[0]=1));break}if(Ce[ye]+=ae,Ce[ye]!=_)break;Ce[ye--]=0,ae=1}for(te=Ce.length;Ce[--te]===0;Ce.pop());}k.e>ar?k.c=k.e=null:k.e<on&&(k.c=[k.e=0])}return k}function Ar(k){var g,B=k.e;return B===null?k.toString():(g=m(k.c),g=B<=ir||B>=In?q(g,B):z(g,B,"0"),k.s<0?"-"+g:g)}return Ae.clone=y,Ae.ROUND_UP=0,Ae.ROUND_DOWN=1,Ae.ROUND_CEIL=2,Ae.ROUND_FLOOR=3,Ae.ROUND_HALF_UP=4,Ae.ROUND_HALF_DOWN=5,Ae.ROUND_HALF_EVEN=6,Ae.ROUND_HALF_CEIL=7,Ae.ROUND_HALF_FLOOR=8,Ae.EUCLID=9,Ae.config=Ae.set=function(k){var g,B;if(k!=null){if(typeof k!="object")throw Error(p+"Object expected: "+k);if(k.hasOwnProperty(g="DECIMAL_PLACES")&&(A(B=k[g],0,T,g),It=B),k.hasOwnProperty(g="ROUNDING_MODE")&&(A(B=k[g],0,8,g),Rt=B),k.hasOwnProperty(g="EXPONENTIAL_AT")&&((B=k[g])&&B.pop?(A(B[0],-T,0,g),A(B[1],0,T,g),ir=B[0],In=B[1]):(A(B,-T,T,g),ir=-(In=B<0?-B:B))),k.hasOwnProperty(g="RANGE"))if((B=k[g])&&B.pop)A(B[0],-T,-1,g),A(B[1],1,T,g),on=B[0],ar=B[1];else{if(A(B,-T,T,g),!B)throw Error(p+g+" cannot be zero: "+B);on=-(ar=B<0?-B:B)}if(k.hasOwnProperty(g="CRYPTO")){if((B=k[g])!==!!B)throw Error(p+g+" not true or false: "+B);if(B){if(typeof crypto>"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw un=!B,Error(p+"crypto unavailable");un=B}else un=B}if(k.hasOwnProperty(g="MODULO_MODE")&&(A(B=k[g],0,9,g),Gn=B),k.hasOwnProperty(g="POW_PRECISION")&&(A(B=k[g],0,T,g),Xt=B),k.hasOwnProperty(g="FORMAT")){if(typeof(B=k[g])!="object")throw Error(p+g+" not an object: "+B);Rn=B}if(k.hasOwnProperty(g="ALPHABET")){if(typeof(B=k[g])!="string"||/^.?$|[+\-.\s]|(.).*\1/.test(B))throw Error(p+g+" invalid: "+B);cn=B.slice(0,10)=="0123456789",sr=B}}return{DECIMAL_PLACES:It,ROUNDING_MODE:Rt,EXPONENTIAL_AT:[ir,In],RANGE:[on,ar],CRYPTO:un,MODULO_MODE:Gn,POW_PRECISION:Xt,FORMAT:Rn,ALPHABET:sr}},Ae.isBigNumber=function(k){if(!k||k._isBigNumber!==!0)return!1;if(!Ae.DEBUG)return!0;var g,B,Q=k.c,H=k.e,te=k.s;e:if({}.toString.call(Q)=="[object Array]"){if((te===1||te===-1)&&H>=-T&&H<=T&&H===d(H)){if(Q[0]===0){if(H===0&&Q.length===1)return!0;break e}if((g=(H+1)%R)<1&&(g+=R),String(Q[0]).length==g){for(g=0;g<Q.length;g++)if((B=Q[g])<0||B>=_||B!==d(B))break e;if(B!==0)return!0}}}else if(Q===null&&H===null&&(te===null||te===1||te===-1))return!0;throw Error(p+"Invalid BigNumber: "+k)},Ae.maximum=Ae.max=function(){return Na(arguments,De.lt)},Ae.minimum=Ae.min=function(){return Na(arguments,De.gt)},Ae.random=(oe=9007199254740992,ve=Math.random()*oe&2097151?function(){return d(Math.random()*oe)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(k){var g,B,Q,H,te,re=0,ae=[],pe=new Ae(Kt);if(k==null?k=It:A(k,0,T),H=c(k/R),un)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(H*=2));re<H;)(te=131072*g[re]+(g[re+1]>>>11))>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),g[re]=B[0],g[re+1]=B[1]):(ae.push(te%1e14),re+=2);re=H/2}else{if(!crypto.randomBytes)throw un=!1,Error(p+"crypto unavailable");for(g=crypto.randomBytes(H*=7);re<H;)(te=281474976710656*(31&g[re])+1099511627776*g[re+1]+4294967296*g[re+2]+16777216*g[re+3]+(g[re+4]<<16)+(g[re+5]<<8)+g[re+6])>=9e15?crypto.randomBytes(7).copy(g,re):(ae.push(te%1e14),re+=7);re=H/7}if(!un)for(;re<H;)(te=ve())<9e15&&(ae[re++]=te%1e14);for(H=ae[--re],k%=R,H&&k&&(te=O[R-k],ae[re]=d(H/te)*te);ae[re]===0;ae.pop(),re--);if(re<0)ae=[Q=0];else{for(Q=-1;ae[0]===0;ae.splice(0,1),Q-=R);for(re=1,te=ae[0];te>=10;te/=10,re++);re<R&&(Q-=R-re)}return pe.e=Q,pe.c=ae,pe}),Ae.sum=function(){for(var k=1,g=arguments,B=new Ae(g[0]);k<g.length;)B=B.plus(g[k++]);return B},K=(function(){var k="0123456789";function g(B,Q,H,te){for(var re,ae,pe=[0],ye=0,he=B.length;ye<he;){for(ae=pe.length;ae--;pe[ae]*=Q);for(pe[0]+=te.indexOf(B.charAt(ye++)),re=0;re<pe.length;re++)pe[re]>H-1&&(pe[re+1]==null&&(pe[re+1]=0),pe[re+1]+=pe[re]/H|0,pe[re]%=H)}return pe.reverse()}return function(B,Q,H,te,re){var ae,pe,ye,he,Ce,Ve,Ye,it,wt=B.indexOf("."),jt=It,et=Rt;for(wt>=0&&(he=Xt,Xt=0,B=B.replace(".",""),Ve=(it=new Ae(Q)).pow(B.length-wt),Xt=he,it.c=g(z(m(Ve.c),Ve.e,"0"),10,H,k),it.e=it.c.length),ye=he=(Ye=g(B,Q,H,re?(ae=sr,k):(ae=k,sr))).length;Ye[--he]==0;Ye.pop());if(!Ye[0])return ae.charAt(0);if(wt<0?--ye:(Ve.c=Ye,Ve.e=ye,Ve.s=te,Ye=(Ve=C(Ve,it,jt,et,H)).c,Ce=Ve.r,ye=Ve.e),wt=Ye[pe=ye+jt+1],he=H/2,Ce=Ce||pe<0||Ye[pe+1]!=null,Ce=et<4?(wt!=null||Ce)&&(et==0||et==(Ve.s<0?3:2)):wt>he||wt==he&&(et==4||Ce||et==6&&1&Ye[pe-1]||et==(Ve.s<0?8:7)),pe<1||!Ye[0])B=Ce?z(ae.charAt(1),-jt,ae.charAt(0)):ae.charAt(0);else{if(Ye.length=pe,Ce)for(--H;++Ye[--pe]>H;)Ye[pe]=0,pe||(++ye,Ye=[1].concat(Ye));for(he=Ye.length;!Ye[--he];);for(wt=0,B="";wt<=he;B+=ae.charAt(Ye[wt++]));B=z(B,ye,ae.charAt(0))}return B}})(),C=(function(){function k(Q,H,te){var re,ae,pe,ye,he=0,Ce=Q.length,Ve=H%h,Ye=H/h|0;for(Q=Q.slice();Ce--;)he=((ae=Ve*(pe=Q[Ce]%h)+(re=Ye*pe+(ye=Q[Ce]/h|0)*Ve)%h*h+he)/te|0)+(re/h|0)+Ye*ye,Q[Ce]=ae%te;return he&&(Q=[he].concat(Q)),Q}function g(Q,H,te,re){var ae,pe;if(te!=re)pe=te>re?1:-1;else for(ae=pe=0;ae<te;ae++)if(Q[ae]!=H[ae]){pe=Q[ae]>H[ae]?1:-1;break}return pe}function B(Q,H,te,re){for(var ae=0;te--;)Q[te]-=ae,ae=Q[te]<H[te]?1:0,Q[te]=ae*re+Q[te]-H[te];for(;!Q[0]&&Q.length>1;Q.splice(0,1));}return function(Q,H,te,re,ae){var pe,ye,he,Ce,Ve,Ye,it,wt,jt,et,dt,Ut,An,zn,Wn,lr,ln,Jt=Q.s==H.s?1:-1,Ft=Q.c,St=H.c;if(!(Ft&&Ft[0]&&St&&St[0]))return new Ae(Q.s&&H.s&&(Ft?!St||Ft[0]!=St[0]:St)?Ft&&Ft[0]==0||!St?0*Jt:Jt/0:NaN);for(jt=(wt=new Ae(Jt)).c=[],Jt=te+(ye=Q.e-H.e)+1,ae||(ae=_,ye=b(Q.e/R)-b(H.e/R),Jt=Jt/R|0),he=0;St[he]==(Ft[he]||0);he++);if(St[he]>(Ft[he]||0)&&ye--,Jt<0)jt.push(1),Ce=!0;else{for(zn=Ft.length,lr=St.length,he=0,Jt+=2,(Ve=d(ae/(St[0]+1)))>1&&(St=k(St,Ve,ae),Ft=k(Ft,Ve,ae),lr=St.length,zn=Ft.length),An=lr,dt=(et=Ft.slice(0,lr)).length;dt<lr;et[dt++]=0);ln=St.slice(),ln=[0].concat(ln),Wn=St[0],St[1]>=ae/2&&Wn++;do{if(Ve=0,(pe=g(St,et,lr,dt))<0){if(Ut=et[0],lr!=dt&&(Ut=Ut*ae+(et[1]||0)),(Ve=d(Ut/Wn))>1)for(Ve>=ae&&(Ve=ae-1),it=(Ye=k(St,Ve,ae)).length,dt=et.length;g(Ye,et,it,dt)==1;)Ve--,B(Ye,lr<it?ln:St,it,ae),it=Ye.length,pe=1;else Ve==0&&(pe=Ve=1),it=(Ye=St.slice()).length;if(it<dt&&(Ye=[0].concat(Ye)),B(et,Ye,dt,ae),dt=et.length,pe==-1)for(;g(St,et,lr,dt)<1;)Ve++,B(et,lr<dt?ln:St,dt,ae),dt=et.length}else pe===0&&(Ve++,et=[0]);jt[he++]=Ve,et[0]?et[dt++]=Ft[An]||0:(et=[Ft[An]],dt=1)}while((An++<zn||et[0]!=null)&&Jt--);Ce=et[0]!=null,jt[0]||jt.splice(0,1)}if(ae==_){for(he=1,Jt=jt[0];Jt>=10;Jt/=10,he++);lt(wt,te+(wt.e=he+ye*R-1)+1,re,Ce)}else wt.e=ye,wt.r=+Ce;return wt}})(),Pe=/^(-?)0([xbo])(?=\w[\w.]*$)/i,He=/^([^.]+)\.$/,Ge=/^\.([^.]+)$/,cr=/^-?(Infinity|NaN)$/,qt=/^\s*\+(?=[\w.])|^\s+|\s+$/g,ee=function(k,g,B,Q){var H,te=B?g:g.replace(qt,"");if(cr.test(te))k.s=isNaN(te)?null:te<0?-1:1;else{if(!B&&(te=te.replace(Pe,(function(re,ae,pe){return H=(pe=pe.toLowerCase())=="x"?16:pe=="b"?2:8,Q&&Q!=H?re:ae})),Q&&(H=Q,te=te.replace(He,"$1").replace(Ge,"0.$1")),g!=te))return new Ae(te,H);if(Ae.DEBUG)throw Error(p+"Not a"+(Q?" base "+Q:"")+" number: "+g);k.s=null}k.c=k.e=null},De.absoluteValue=De.abs=function(){var k=new Ae(this);return k.s<0&&(k.s=1),k},De.comparedTo=function(k,g){return v(this,new Ae(k,g))},De.decimalPlaces=De.dp=function(k,g){var B,Q,H,te=this;if(k!=null)return A(k,0,T),g==null?g=Rt:A(g,0,8),lt(new Ae(te),k+te.e+1,g);if(!(B=te.c))return null;if(Q=((H=B.length-1)-b(this.e/R))*R,H=B[H])for(;H%10==0;H/=10,Q--);return Q<0&&(Q=0),Q},De.dividedBy=De.div=function(k,g){return C(this,new Ae(k,g),It,Rt)},De.dividedToIntegerBy=De.idiv=function(k,g){return C(this,new Ae(k,g),0,1)},De.exponentiatedBy=De.pow=function(k,g){var B,Q,H,te,re,ae,pe,ye,he=this;if((k=new Ae(k)).c&&!k.isInteger())throw Error(p+"Exponent not an integer: "+Ar(k));if(g!=null&&(g=new Ae(g)),re=k.e>14,!he.c||!he.c[0]||he.c[0]==1&&!he.e&&he.c.length==1||!k.c||!k.c[0])return ye=new Ae(Math.pow(+Ar(he),re?k.s*(2-P(k)):+Ar(k))),g?ye.mod(g):ye;if(ae=k.s<0,g){if(g.c?!g.c[0]:!g.s)return new Ae(NaN);(Q=!ae&&he.isInteger()&&g.isInteger())&&(he=he.mod(g))}else{if(k.e>9&&(he.e>0||he.e<-1||(he.e==0?he.c[0]>1||re&&he.c[1]>=24e7:he.c[0]<8e13||re&&he.c[0]<=9999975e7)))return te=he.s<0&&P(k)?-0:0,he.e>-1&&(te=1/te),new Ae(ae?1/te:te);Xt&&(te=c(Xt/R+2))}for(re?(B=new Ae(.5),ae&&(k.s=1),pe=P(k)):pe=(H=Math.abs(+Ar(k)))%2,ye=new Ae(Kt);;){if(pe){if(!(ye=ye.times(he)).c)break;te?ye.c.length>te&&(ye.c.length=te):Q&&(ye=ye.mod(g))}if(H){if((H=d(H/2))===0)break;pe=H%2}else if(lt(k=k.times(B),k.e+1,1),k.e>14)pe=P(k);else{if((H=+Ar(k))==0)break;pe=H%2}he=he.times(he),te?he.c&&he.c.length>te&&(he.c.length=te):Q&&(he=he.mod(g))}return Q?ye:(ae&&(ye=Kt.div(ye)),g?ye.mod(g):te?lt(ye,Xt,Rt,void 0):ye)},De.integerValue=function(k){var g=new Ae(this);return k==null?k=Rt:A(k,0,8),lt(g,g.e+1,k)},De.isEqualTo=De.eq=function(k,g){return v(this,new Ae(k,g))===0},De.isFinite=function(){return!!this.c},De.isGreaterThan=De.gt=function(k,g){return v(this,new Ae(k,g))>0},De.isGreaterThanOrEqualTo=De.gte=function(k,g){return(g=v(this,new Ae(k,g)))===1||g===0},De.isInteger=function(){return!!this.c&&b(this.e/R)>this.c.length-2},De.isLessThan=De.lt=function(k,g){return v(this,new Ae(k,g))<0},De.isLessThanOrEqualTo=De.lte=function(k,g){return(g=v(this,new Ae(k,g)))===-1||g===0},De.isNaN=function(){return!this.s},De.isNegative=function(){return this.s<0},De.isPositive=function(){return this.s>0},De.isZero=function(){return!!this.c&&this.c[0]==0},De.minus=function(k,g){var B,Q,H,te,re=this,ae=re.s;if(g=(k=new Ae(k,g)).s,!ae||!g)return new Ae(NaN);if(ae!=g)return k.s=-g,re.plus(k);var pe=re.e/R,ye=k.e/R,he=re.c,Ce=k.c;if(!pe||!ye){if(!he||!Ce)return he?(k.s=-g,k):new Ae(Ce?re:NaN);if(!he[0]||!Ce[0])return Ce[0]?(k.s=-g,k):new Ae(he[0]?re:Rt==3?-0:0)}if(pe=b(pe),ye=b(ye),he=he.slice(),ae=pe-ye){for((te=ae<0)?(ae=-ae,H=he):(ye=pe,H=Ce),H.reverse(),g=ae;g--;H.push(0));H.reverse()}else for(Q=(te=(ae=he.length)<(g=Ce.length))?ae:g,ae=g=0;g<Q;g++)if(he[g]!=Ce[g]){te=he[g]<Ce[g];break}if(te&&(H=he,he=Ce,Ce=H,k.s=-k.s),(g=(Q=Ce.length)-(B=he.length))>0)for(;g--;he[B++]=0);for(g=_-1;Q>ae;){if(he[--Q]<Ce[Q]){for(B=Q;B&&!he[--B];he[B]=g);--he[B],he[Q]+=_}he[Q]-=Ce[Q]}for(;he[0]==0;he.splice(0,1),--ye);return he[0]?Pa(k,he,ye):(k.s=Rt==3?-1:1,k.c=[k.e=0],k)},De.modulo=De.mod=function(k,g){var B,Q,H=this;return k=new Ae(k,g),!H.c||!k.s||k.c&&!k.c[0]?new Ae(NaN):!k.c||H.c&&!H.c[0]?new Ae(H):(Gn==9?(Q=k.s,k.s=1,B=C(H,k,0,3),k.s=Q,B.s*=Q):B=C(H,k,0,Gn),(k=H.minus(B.times(k))).c[0]||Gn!=1||(k.s=H.s),k)},De.multipliedBy=De.times=function(k,g){var B,Q,H,te,re,ae,pe,ye,he,Ce,Ve,Ye,it,wt,jt,et=this,dt=et.c,Ut=(k=new Ae(k,g)).c;if(!(dt&&Ut&&dt[0]&&Ut[0]))return!et.s||!k.s||dt&&!dt[0]&&!Ut||Ut&&!Ut[0]&&!dt?k.c=k.e=k.s=null:(k.s*=et.s,dt&&Ut?(k.c=[0],k.e=0):k.c=k.e=null),k;for(Q=b(et.e/R)+b(k.e/R),k.s*=et.s,(pe=dt.length)<(Ce=Ut.length)&&(it=dt,dt=Ut,Ut=it,H=pe,pe=Ce,Ce=H),H=pe+Ce,it=[];H--;it.push(0));for(wt=_,jt=h,H=Ce;--H>=0;){for(B=0,Ve=Ut[H]%jt,Ye=Ut[H]/jt|0,te=H+(re=pe);te>H;)B=((ye=Ve*(ye=dt[--re]%jt)+(ae=Ye*ye+(he=dt[re]/jt|0)*Ve)%jt*jt+it[te]+B)/wt|0)+(ae/jt|0)+Ye*he,it[te--]=ye%wt;it[te]=B}return B?++Q:it.splice(0,1),Pa(k,it,Q)},De.negated=function(){var k=new Ae(this);return k.s=-k.s||null,k},De.plus=function(k,g){var B,Q=this,H=Q.s;if(g=(k=new Ae(k,g)).s,!H||!g)return new Ae(NaN);if(H!=g)return k.s=-g,Q.minus(k);var te=Q.e/R,re=k.e/R,ae=Q.c,pe=k.c;if(!te||!re){if(!ae||!pe)return new Ae(H/0);if(!ae[0]||!pe[0])return pe[0]?k:new Ae(ae[0]?Q:0*H)}if(te=b(te),re=b(re),ae=ae.slice(),H=te-re){for(H>0?(re=te,B=pe):(H=-H,B=ae),B.reverse();H--;B.push(0));B.reverse()}for((H=ae.length)-(g=pe.length)<0&&(B=pe,pe=ae,ae=B,g=H),H=0;g;)H=(ae[--g]=ae[g]+pe[g]+H)/_|0,ae[g]=_===ae[g]?0:ae[g]%_;return H&&(ae=[H].concat(ae),++re),Pa(k,ae,re)},De.precision=De.sd=function(k,g){var B,Q,H,te=this;if(k!=null&&k!==!!k)return A(k,1,T),g==null?g=Rt:A(g,0,8),lt(new Ae(te),k,g);if(!(B=te.c))return null;if(Q=(H=B.length-1)*R+1,H=B[H]){for(;H%10==0;H/=10,Q--);for(H=B[0];H>=10;H/=10,Q++);}return k&&te.e+1>Q&&(Q=te.e+1),Q},De.shiftedBy=function(k){return A(k,-9007199254740991,w),this.times("1e"+k)},De.squareRoot=De.sqrt=function(){var k,g,B,Q,H,te=this,re=te.c,ae=te.s,pe=te.e,ye=It+4,he=new Ae("0.5");if(ae!==1||!re||!re[0])return new Ae(!ae||ae<0&&(!re||re[0])?NaN:re?te:1/0);if((ae=Math.sqrt(+Ar(te)))==0||ae==1/0?(((g=m(re)).length+pe)%2==0&&(g+="0"),ae=Math.sqrt(+g),pe=b((pe+1)/2)-(pe<0||pe%2),B=new Ae(g=ae==1/0?"5e"+pe:(g=ae.toExponential()).slice(0,g.indexOf("e")+1)+pe)):B=new Ae(ae+""),B.c[0]){for((ae=(pe=B.e)+ye)<3&&(ae=0);;)if(H=B,B=he.times(H.plus(C(te,H,ye,1))),m(H.c).slice(0,ae)===(g=m(B.c)).slice(0,ae)){if(B.e<pe&&--ae,(g=g.slice(ae-3,ae+1))!="9999"&&(Q||g!="4999")){+g&&(+g.slice(1)||g.charAt(0)!="5")||(lt(B,B.e+It+2,1),k=!B.times(B).eq(te));break}if(!Q&&(lt(H,H.e+It+2,0),H.times(H).eq(te))){B=H;break}ye+=4,ae+=4,Q=1}}return lt(B,B.e+It+1,Rt,k)},De.toExponential=function(k,g){return k!=null&&(A(k,0,T),k++),wn(this,k,g,1)},De.toFixed=function(k,g){return k!=null&&(A(k,0,T),k=k+this.e+1),wn(this,k,g)},De.toFormat=function(k,g,B){var Q,H=this;if(B==null)k!=null&&g&&typeof g=="object"?(B=g,g=null):k&&typeof k=="object"?(B=k,k=g=null):B=Rn;else if(typeof B!="object")throw Error(p+"Argument not an object: "+B);if(Q=H.toFixed(k,g),H.c){var te,re=Q.split("."),ae=+B.groupSize,pe=+B.secondaryGroupSize,ye=B.groupSeparator||"",he=re[0],Ce=re[1],Ve=H.s<0,Ye=Ve?he.slice(1):he,it=Ye.length;if(pe&&(te=ae,ae=pe,pe=te,it-=te),ae>0&&it>0){for(te=it%ae||ae,he=Ye.substr(0,te);te<it;te+=ae)he+=ye+Ye.substr(te,ae);pe>0&&(he+=ye+Ye.slice(te)),Ve&&(he="-"+he)}Q=Ce?he+(B.decimalSeparator||"")+((pe=+B.fractionGroupSize)?Ce.replace(new RegExp("\\d{"+pe+"}\\B","g"),"$&"+(B.fractionGroupSeparator||"")):Ce):he}return(B.prefix||"")+Q+(B.suffix||"")},De.toFraction=function(k){var g,B,Q,H,te,re,ae,pe,ye,he,Ce,Ve,Ye=this,it=Ye.c;if(k!=null&&(!(ae=new Ae(k)).isInteger()&&(ae.c||ae.s!==1)||ae.lt(Kt)))throw Error(p+"Argument "+(ae.isInteger()?"out of range: ":"not an integer: ")+Ar(ae));if(!it)return new Ae(Ye);for(g=new Ae(Kt),ye=B=new Ae(Kt),Q=pe=new Ae(Kt),Ve=m(it),te=g.e=Ve.length-Ye.e-1,g.c[0]=O[(re=te%R)<0?R+re:re],k=!k||ae.comparedTo(g)>0?te>0?g:ye:ae,re=ar,ar=1/0,ae=new Ae(Ve),pe.c[0]=0;he=C(ae,g,0,1),(H=B.plus(he.times(Q))).comparedTo(k)!=1;)B=Q,Q=H,ye=pe.plus(he.times(H=ye)),pe=H,g=ae.minus(he.times(H=g)),ae=H;return H=C(k.minus(B),Q,0,1),pe=pe.plus(H.times(ye)),B=B.plus(H.times(Q)),pe.s=ye.s=Ye.s,Ce=C(ye,Q,te*=2,Rt).minus(Ye).abs().comparedTo(C(pe,B,te,Rt).minus(Ye).abs())<1?[ye,Q]:[pe,B],ar=re,Ce},De.toNumber=function(){return+Ar(this)},De.toPrecision=function(k,g){return k!=null&&A(k,1,T),wn(this,k,g,2)},De.toString=function(k){var g,B=this,Q=B.s,H=B.e;return H===null?Q?(g="Infinity",Q<0&&(g="-"+g)):g="NaN":(k==null?g=H<=ir||H>=In?q(m(B.c),H):z(m(B.c),H,"0"):k===10&&cn?g=z(m((B=lt(new Ae(B),It+H+1,Rt)).c),B.e,"0"):(A(k,2,sr.length,"Base"),g=K(z(m(B.c),H,"0"),10,k,Q,!0)),Q<0&&B.c[0]&&(g="-"+g)),g},De.valueOf=De.toJSON=function(){return Ar(this)},De._isBigNumber=!0,De[Symbol.toStringTag]="BigNumber",De[Symbol.for("nodejs.util.inspect.custom")]=De.valueOf,S!=null&&Ae.set(S),Ae})();const W={ROUNDING_MODE:Y.ROUND_DOWN};function U(y){return new TextEncoder().encode(y)}function F(y){return typeof y=="string"?F(X(y)):new TextDecoder().decode(y)}Y.config(W);const ce="UNKNOWN_ERROR",se="INVALID_ARGUMENT";function ne(y,S=ce,C={}){const K=[];Object.keys(C).forEach((ve=>{try{K.push(ve+"="+JSON.stringify(C[ve]))}catch{K.push(ve+"="+JSON.stringify(C[ve].toString()))}}));const ee=y;K.length&&(y+=" ("+K.join(", ")+")");const oe=new Error(y);return oe.reason=ee,oe.code=S,Object.keys(C).forEach((function(ve){oe[ve]=C[ve]})),oe}function X(y){if(typeof y!="string")throw new Error("hexToBytes only accept strings, got: "+typeof y);if(y.substr(0,2)==="0x")return X(y.substr(2));const S=new Uint8Array(Math.ceil(y.length/2));let C=0;for(let K=0;K<y.length;K+=2){const ee=parseInt(y.substr(K,2),16);if(isNaN(ee))throw new Error("Cannot read hex string:"+JSON.stringify(y));S[C]=ee,C++}return S}function x(y){return Array.from(y).map((S=>S.toString(16).padStart(2,"0"))).join("")}function L(y,S){if(typeof y=="string"){if(S&&S.encoding==="hex"&&typeof y=="string"){let C=y;C.length>2&&C.substr(0,2)==="0x"&&(C=C.substr(2));const K=X(C);return u.keccak256(K)}return u.keccak256(U(y))}return u.keccak256(y)}const D={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function $(y,S,C){return new Array(S-y.length+1).join(C||"0")+y}function V(y){let S="",C=0;const K=y.length;for(y.substring(0,2)==="0x"&&(C=2);C<K;C+=2){const ee=parseInt(y.substr(C,2),16);S+=String.fromCharCode(ee)}return S}function N(y){return I(y)&&y.name&&y.name.indexOf("(")!==-1?y.name:y.name+"("+Z(!1,y.inputs||[]).join(",")+")"}function j(...y){const S=y.reduce(((ee,oe)=>ee+oe.length),0),C=new Uint8Array(S);let K=0;for(const ee of y)C.set(ee,K),K+=ee.length;return C}function Z(y,S){const C=[];return S.forEach((function(K){if(typeof K.components=="object"){if(K.type.substring(0,5)!=="tuple")throw new Error("components found but type is not tuple; report on GitHub");let ee="";const oe=K.type.indexOf("[");oe>=0&&(ee=K.type.substring(oe));const ve=Z(y,K.components);C.push("("+ve.join(",")+")"+ee)}else C.push(K.type)})),C}function Ee(y){const S=y.indexOf("("),C=y.indexOf(")");return S!==-1&&C!==-1?y.substr(0,S):y}function _e(y){const S=y.indexOf("("),C=y.indexOf(")");return S!==-1&&C!==-1?y.substr(S+1,C-S-1).replace(" ",""):""}function Se(y){return y==null?y:xe(y).toNumber()}function Ie(y){return xe(y).toNumber()}function ie(y){return M(y)?y.toString(10):""+y}function le(y){return typeof y=="string"&&!y.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y)?"0x"+y:we(y)}function fe(y){if(typeof y=="string")return y.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y)?we(y):"0x"+x(U(y));if(y instanceof Uint8Array)return"0x"+x(y);throw new Error(`toStringData: Error trying to convert ${y} (${typeof y}) to a hex string.`)}function me(y){return typeof y=="boolean"?y:xe(y).toNumber()!==0}function Te(y){const S=xe(y),C=S.toString(16);return S.isLessThan(0)?"-0x"+C.substr(1):"0x"+C}function we(y){if(G(y))return Te(+y);if(M(y))return Te(y);if(E(y)){const S=y;if(S.indexOf("-0x")===0)return Te(S);if(S.indexOf("0x")===0)return S;if(!isFinite(S))return x(U(S))}if(y instanceof Uint8Array)return"0x"+x(y);if(de(y)||I(y))throw new Error("toHex can only be called with scalar values, not objects or arrays");return Te(y)}function Fe(y){const S=y?y.toLowerCase():"ether",C=D[S];if(C===void 0)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(D,null,2));return new Y(C,10)}function xe(y){let S=y||0;return M(S)?S:(typeof S=="string"&&(S=S.trim()),typeof S!="string"||S.indexOf("0x")!==0&&S.indexOf("-0x")!==0?S instanceof Uint8Array?new Y(x(S),16):new Y(S,10):new Y(S.replace("0x","").toLowerCase(),16))}function tt(y){return new Y(new Array(y).fill("1").join(""),2)}function Xe(y,S=256){const C=xe(y).integerValue();return C.isLessThan(0)?tt(S).plus(C).plus(1):C}function ut(y,S){return $(y.toString(2),S,"0")[0]==="1"}function $t(y){if(typeof y!="string")throw ne("invalid address",se,{arg:"address",value:y});if(y.trim().match(/^(0x)?[0-9a-fA-F]{40}$/))return y.trim().substring(0,2)!=="0x"&&(y="0x"+y),nr(y);throw ne("invalid address",se,{arg:"address",value:y})}function vt(y,S=256){if(ut(y,S)){const C=tt(S);return y.minus(C).minus(1)}return y}function zt(y){return/^0x[0-9a-f]{40}$/i.test(y)}function bt(y){return!!/^(0x)?[0-9a-f]{40}$/i.test(y)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(y)&&!/^(0x)?[0-9A-F]{40}$/.test(y))||rr(y))}function rr(y){const S=y.replace("0x",""),C=L(S.toLowerCase());for(let K=0;K<40;K++)if(parseInt(C[K],16)>7&&S[K].toUpperCase()!==S[K]||parseInt(C[K],16)<=7&&S[K].toLowerCase()!==S[K])return!1;return!0}function nr(y){if(y===void 0)return"";const S=y.toLowerCase().replace("0x",""),C=L(S);let K="0x";for(let ee=0;ee<S.length;ee++)parseInt(C[ee],16)>7?K+=S[ee].toUpperCase():K+=S[ee];return K}function ht(y){if(!Array.isArray(y))throw new Error(`Value was not an array: ${JSON.stringify(y)}`);return y}function wr(y){return zt(y)?y:/^[0-9a-f]{40}$/.test(y)?"0x"+y:"0x"+$(we(y).substr(2),40)}function M(y){return y instanceof Y}function E(y){return typeof y=="string"||y&&y.constructor&&y.constructor.name==="String"}function I(y){return y!==null&&!Array.isArray(y)&&typeof y=="object"}function G(y){return typeof y=="boolean"}function de(y){return Array.isArray(y)}var ge,be;function Qe(y,S){if(!y)throw new Error("jsonrpc method should be specified!");if(typeof y!="string")throw new Error(`jsonrpc must be a string, got ${typeof y}!`);return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:y,params:S||[]}}function Pt(y){return Array.isArray(y)?y.every(S):S(y);function S(C){return!!C&&(C.error===void 0||C.error===null)&&C.jsonrpc==="2.0"&&C.id!==null&&"result"in C&&C.result!==void 0}}r.TransactionStatus=void 0,(ge=r.TransactionStatus||(r.TransactionStatus={})).pending="pending",ge.confirmed="confirmed",ge.failed="failed",r.TransactionType=void 0,(be=r.TransactionType||(r.TransactionType={})).queued="queued",be.dropped="dropped",be.replaced="replaced",be.pending="pending",be.reverted="reverted",be.confirmed="confirmed",r.messageId=0;function Tt(y){return xe(y)}function Ct(y){return y==="latest"||y==="pending"||y==="earliest"}function nt(y){return y===void 0?"latest":Wt(y)}function Wt(y){return y==null?null:Ct(y)?y:we(y)}function fd(y){return y.from&&(y.from=vr(y.from)),y.to&&(y.to=vr(y.to)),y.gasPrice!==void 0&&(y.gasPrice=Te(y.gasPrice)),y.gas!==void 0&&(y.gas=Te(y.gas)),y.value!==void 0&&(y.value=Te(y.value)),y.nonce!==void 0&&(y.nonce=Te(y.nonce)),y.data&&!y.data.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y.data)&&(y.data="0x"+y.data),y}function Oa(y){if(typeof y!="string")throw new Error("The provided input for transactionId is not a string, got: "+JSON.stringify(y));if(y.indexOf("0x")!==0)throw new Error("TransactionID must start with 0x, got: "+JSON.stringify(y));if(y.length!==66)throw new Error("TransactionID must be a 32 byte hex, got: "+JSON.stringify(y));return y}function pd(y){if(typeof y!="object")throw new Error("Did not provide transaction options");if(!y.from)throw new Error('Missing "from" in transaction options');return y.from=vr(y.from),y.to&&(y.to=vr(y.to)),y.gasPrice!==void 0&&(y.gasPrice=Te(y.gasPrice)),y.gas!==void 0&&(y.gas=Te(y.gas)),y.value!==void 0&&(y.value=Te(y.value)),y.nonce!==void 0&&(y.nonce=Te(y.nonce)),y.data&&!y.data.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(y.data)&&(y.data="0x"+y.data),y}function Os(y){return y?(y.blockNumber!==null&&(y.blockNumber=Ie(y.blockNumber)),y.transactionIndex!==null&&(y.transactionIndex=Ie(y.transactionIndex)),y.nonce=Ie(y.nonce),y.gas=Ie(y.gas),y.gasPrice=xe(y.gasPrice),y.value=xe(y.value),y):null}function IE(y){return y?(y.blockNumber!==null&&(y.blockNumber=Ie(y.blockNumber)),y.transactionIndex!==null&&(y.transactionIndex=Ie(y.transactionIndex)),y.cumulativeGasUsed=Ie(y.cumulativeGasUsed),y.gasUsed=Ie(y.gasUsed),y.effectiveGasPrice!==void 0&&y.effectiveGasPrice!==null&&(y.effectiveGasPrice=Ie(y.effectiveGasPrice)),y.logs&&de(y.logs)&&(y.logs=y.logs.map((function(S){return su(S)}))),y.status=Ie(y.status||""),y):null}function Ns(y){return y?(y.gasLimit=Ie(y.gasLimit),y.gasUsed=Ie(y.gasUsed),y.size=Ie(y.size),y.timestamp=Ie(y.timestamp),y.number!==null&&(y.number=Ie(y.number)),y.difficulty=xe(y.difficulty),y.totalDifficulty=xe(y.totalDifficulty),de(y.transactions)&&y.transactions.forEach((function(S,C){E(S)||(y.transactions[C]=Os(S)||y.transactions[C])})),y):null}function su(y){return y&&(y.blockNumber&&(y.blockNumber=Ie(y.blockNumber)),y.transactionIndex&&(y.transactionIndex=Ie(y.transactionIndex)),y.logIndex&&(y.logIndex=Ie(y.logIndex)),y)}function vr(y){if(zt(y))return y;if(bt(y))return"0x"+y;throw new Error(`Invalid address: ${JSON.stringify(y)}`)}function RE(y){return y}function wE(y){return y&&(y.startingBlock=Ie(y.startingBlock),y.currentBlock=Ie(y.currentBlock),y.highestBlock=Ie(y.highestBlock),y.knownStates&&(y.knownStates=Ie(y.knownStates),y.pulledStates=Ie(y.pulledStates)),y)}function md(y){if(y===null)throw ne("cannot convert null value to array",se,{arg:"value",value:y});if(y instanceof Uint8Array)return new Uint8Array(y);if(typeof y=="string"){const S=y.match(/^(0x)?[0-9a-fA-F]*$/);if(!S)throw ne("invalid hexidecimal string",se,{arg:"value",value:y});if(S[1]!=="0x")throw ne("hex string must have 0x prefix",se,{arg:"value",value:y});(y=y.substring(2)).length%2&&(y="0"+y);const C=[];for(let K=0;K<y.length;K+=2)C.push(parseInt(y.substr(K,2),16));return new Uint8Array(C)}if((function(S){if(!S||parseInt(String(S.length))!==S.length||typeof S=="string")return!1;for(let C=0;C<S.length;C++){const K=S[C];if(K<0||K>=256||parseInt(String(K))!==K)return!1}return!0})(y))return new Uint8Array(y);throw ne("invalid arrayify value",void 0,{arg:"value",value:y,type:typeof y})}function AE(y,S,C){Object.defineProperty(y,S,{enumerable:!0,value:C,writable:!1})}const AD=new Y(-1),OD=new Y(0),ND=new Y(1),OE=new Y("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function NE(y){return(function(S,C){function K(ve){return new Error('unexpected character "'+S[ve]+'" at position '+ve+' in "'+S+'"')}const ee={type:"",name:"",state:{allowType:!0}};let oe=ee;for(let ve=0;ve<S.length;ve++){const Pe=S[ve];switch(Pe){case"(":if(!oe.state.allowParams)throw K(ve);oe.state.allowType=!1,oe.type=Ps(oe.type),oe.components=[{type:"",name:"",parent:oe,state:{allowType:!0}}],oe=oe.components[0];break;case")":delete oe.state,oe.name==="indexed"&&(oe.indexed=!0,oe.name=""),oe.type=Ps(oe.type);const He=oe;if(oe=oe.parent,!oe)throw K(ve);delete He.parent,oe.state.allowParams=!1,oe.state.allowName=!0,oe.state.allowArray=!0;break;case",":delete oe.state,oe.name==="indexed"&&(oe.indexed=!0,oe.name=""),oe.type=Ps(oe.type);const Ge={type:"",name:"",parent:oe.parent,state:{allowType:!0}};oe.parent.components.push(Ge),delete oe.parent,oe=Ge;break;case" ":oe.state.allowType&&oe.type!==""&&(oe.type=Ps(oe.type),delete oe.state.allowType,oe.state.allowName=!0,oe.state.allowParams=!0),oe.state.allowName&&oe.name!==""&&(oe.name==="indexed"?(oe.indexed=!0,oe.name=""):oe.state.allowName=!1);break;case"[":if(!oe.state.allowArray)throw K(ve);oe.type+=Pe,oe.state.allowArray=!1,oe.state.allowName=!1,oe.state.readArray=!0;break;case"]":if(!oe.state.readArray)throw K(ve);oe.type+=Pe,oe.state.readArray=!1,oe.state.allowArray=!0,oe.state.allowName=!0;break;default:if(oe.state.allowType)oe.type+=Pe,oe.state.allowParams=!0,oe.state.allowArray=!0;else if(oe.state.allowName)oe.name+=Pe,delete oe.state.allowArray;else{if(!oe.state.readArray)throw K(ve);oe.type+=Pe}}}if(oe.parent)throw new Error("unexpected eof");return delete ee.state,oe.name==="indexed"&&(oe.indexed=!0,oe.name=""),ee.type=Ps(ee.type),ee})(y)}function Ps(y){return y.match(/^uint($|[^1-9])/)?y="uint256"+y.substring(4):y.match(/^int($|[^1-9])/)&&(y="int256"+y.substring(3)),y}const PD=new RegExp(/^bytes([0-9]*)$/),PE=new RegExp(/^(u?int)([0-9]*)$/),CD=new RegExp(/^(.*)\[([0-9]*)\]$/),MD=function(y,S){const C=y.match(PE);return C&&parseInt(C[2])<=48?S.toNumber():S};class sn{constructor(S,C,K,ee="",oe){this.coerceFunc=S,this.name=C,this.type=K,this.localName=ee,this.dynamic=oe}}class DD extends sn{constructor(S){super(S.coerceFunc,S.name,S.type,void 0,S.dynamic),AE(this,"coder",S)}encode(S){return this.coder.encode(S)}decode(S,C){return this.coder.decode(S,C)}}class jD extends sn{constructor(S,C){super(S,"null","",C,!1)}encode(S){return md([])}decode(S,C){if(C>S.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}}}function ou(y,S){return new Y(y.toString(2).substr(-S),2)}class CE extends sn{constructor(S,C,K,ee){const oe=(K?"int":"uint")+8*C;super(S,oe,oe,ee,!1),this.size=C,this.signed=K}encode(S){try{let C=xe(S);if(this.signed){let ee=ou(OE,8*this.size-1);if(C.gt(ee))throw new Error("out-of-bounds");if(ee=ee.plus(ND).multipliedBy(AD),C.lt(ee))throw new Error("out-of-bounds")}else if(C.lt(OD)||C.gt(ou(OE,8*this.size)))throw new Error("out-of-bounds");C=ou(Xe(C,8*this.size),8*this.size),this.signed&&(C=Xe(vt(C,8*this.size),256));const K=$(Xe(C).toString(16),64);if(K.indexOf("NaN")!==-1)throw ne("invalid number value, NaN",se,{arg:this.localName,coderType:this.name,value:S,v:C,twosComplement:Xe(C),twosComplement16:Xe(C).toString(16),pad:$(Xe(C).toString(16),64),size:this.size});return X(K)}catch(C){throw ne("invalid number value",se,{arg:this.localName,coderType:this.name,value:S,message:C.toString()})}}decode(S,C){if(S.length<C+32)throw ne("insufficient data for "+this.name+" type",se,{arg:this.localName,coderType:this.name,value:we(S.slice(C,C+32))});const K=32-this.size;let ee=new Y(x(S.slice(C+K,C+32)),16);return ee=this.signed?vt(ee,8*this.size):ou(ee,8*this.size),{consumed:32,value:this.coerceFunc(this.name,ee)}}}const Sn=new CE((function(y,S){return S}),32,!1,"none");class ME extends sn{constructor(S,C,K){const ee="bytes"+C;super(S,ee,ee,K,!1),this.length=C}encode(S){const C=new Uint8Array(32);try{if(typeof S=="string"&&S.length%2!=0)throw new Error("hex string cannot be odd-length");const K=md(S);if(K.length>this.length)throw new Error("incorrect data length");C.set(K)}catch(K){throw ne("invalid "+this.name+" value. Use hex strings or Uint8Array",se,{arg:this.localName,coderType:this.name,value:K.value||S,details:K.message})}return C}decode(S,C){if(S.length<C+32)throw ne("insufficient data for "+this.name+" type",se,{arg:this.localName,coderType:this.name,value:we(S.slice(C,C+32))});return{consumed:32,value:this.coerceFunc(this.name,S.slice(C,C+this.length))}}}function DE(y){const S=32*Math.ceil(y.length/32),C=new Uint8Array(S-y.length);return j(Sn.encode(y.length),y,C)}function jE(y,S,C){if(y.length<S+32)throw ne("insufficient data for dynamicBytes length",se,{arg:C,coderType:"dynamicBytes",value:we(y.slice(S,S+32))});let K=Sn.decode(y,S).value;try{K=K.toNumber()}catch(ee){throw ee("dynamic bytes count too large",se,{arg:C,coderType:"dynamicBytes",value:K.toString()})}if(y.length<S+32+K)throw ne("insufficient data for dynamicBytes type",se,{arg:C,coderType:"dynamicBytes",value:we(y.slice(S,S+32+K))});return{consumed:32+32*Math.ceil(K/32),value:y.slice(S+32,S+32+K)}}function uu(y){return 32*Math.ceil(y/32)}function LE(y,S){if(!Array.isArray(S)){if(!S||typeof S!="object")throw ne("invalid tuple value",se,{coderType:"tuple",value:S});{const He=[];y.forEach((function(Ge){He.push(S[Ge.localName])})),S=He}}if(y.length!==S.length)throw ne("types/value length mismatch",se,{coderType:"tuple",value:S});const C=[];y.forEach((function(He,Ge){C.push({dynamic:He.dynamic,value:He.encode(S[Ge])})}));let K=0,ee=0;C.forEach((function(He){He.dynamic?(K+=32,ee+=uu(He.value.length)):K+=uu(He.value.length)}));let oe=0,ve=K;const Pe=new Uint8Array(K+ee);return C.forEach((function(He){He.dynamic?(Pe.set(Sn.encode(ve),oe),oe+=32,Pe.set(He.value,ve),ve+=uu(He.value.length)):(Pe.set(He.value,oe),oe+=uu(He.value.length))})),Pe}class LD extends Array{}class $D extends sn{constructor(S,C,K,ee){super(S,"array",C.type+"["+(K>=0?K:"")+"]",ee,K===-1||C.dynamic),this.coder=C,this.length=K}encode(S){if(!Array.isArray(S))throw ne("expected array value",se,{arg:this.localName,coderType:"array",value:S});let C=this.length,K=new Uint8Array(0);C===-1&&(C=S.length,K=Sn.encode(C)),(function(oe,ve,Pe){if(Pe||(Pe=""),oe<ve)throw ne("missing argument"+Pe,"MISSING_ARGUMENT",{count:oe,expectedCount:ve});if(oe>ve)throw ne("too many arguments"+Pe,"UNEXPECTED_ARGUMENT",{count:oe,expectedCount:ve})})(C,S.length,"in coder array"+(this.localName?" "+this.localName:""));const ee=[];for(let oe=0;oe<S.length;oe++)ee.push(this.coder);return j(K,LE(ee,S))}decode(S,C){let K=0,ee=this.length;if(ee===-1){let Pe;try{Pe=Sn.decode(S,C)}catch(He){throw ne("insufficient data for dynamic array length",se,{arg:this.localName,coderType:"array",value:He.value})}try{ee=Pe.value.toNumber()}catch{throw ne("array count too large",se,{arg:this.localName,coderType:"array",value:Pe.value.toString()})}K+=Pe.consumed,C+=Pe.consumed}const oe=[];for(let Pe=0;Pe<ee;Pe++)oe.push(new DD(this.coder));const ve=(function(Pe,He,Ge){const cr=Ge;let qt=0;const De=[];return Pe.forEach((function(Kt){let It;if(Kt.dynamic){const Rt=Sn.decode(He,Ge);It=Kt.decode(He,cr+Rt.value.toNumber()),It.consumed=Rt.consumed}else It=Kt.decode(He,Ge);It.value!==void 0&&De.push(It.value),Ge+=It.consumed,qt+=It.consumed})),{value:De,consumed:qt}})(oe,S,C);return ve.consumed+=K,ve.value=this.coerceFunc(this.type,ve.value),ve}}class hd extends sn{constructor(S,C,K){let ee=!1;const oe=[];C.forEach((function(ve){ve.dynamic&&(ee=!0),oe.push(ve.type)})),super(S,"tuple","tuple("+oe.join(",")+")",K,ee),this.coders=C}encode(S){return LE(this.coders,S)}decode(S,C){const K=(function(ee,oe,ve){const Pe=ve;let He=0;const Ge=new LD;return ee.forEach((function(cr){let qt;if(cr.dynamic){const De=Sn.decode(oe,ve);qt=cr.decode(oe,Pe+De.value.toNumber()),qt.consumed=De.consumed}else qt=cr.decode(oe,ve);qt.value!==void 0&&Ge.push(qt.value),ve+=qt.consumed,He+=qt.consumed})),ee.forEach((function(cr,qt){let De=cr.localName;De&&(De==="length"&&(De="_length"),Ge[De]!==null&&Ge[De]!==void 0||(Ge[De]=Ge[qt]))})),{value:Ge,consumed:He}})(this.coders,S,C);return K.value=this.coerceFunc(this.type,K.value),K}}const qD={address:class extends sn{constructor(y,S){super(y,"address","address",S,!1)}encode(y){const S=new Uint8Array(32),C=y.trim();if(!bt(C))throw ne("invalid address format",se,{arg:this.localName,coderType:"address",value:y});try{S.set(X(vr(C)),12)}catch(K){throw ne(`invalid address (${K.message})`,se,{arg:this.localName,coderType:"address",value:y})}return S}decode(y,S){if(y.length<S+32)throw ne("insufficuent data for address type",se,{arg:this.localName,coderType:"address",value:we(y.slice(S,S+32)),missingBytes:S+32-y.length});return{consumed:32,value:this.coerceFunc("address",$t(we(y.slice(S+12,S+32))))}}},bool:class extends sn{constructor(y,S){super(y,"bool","bool",S,!1)}encode(y){return Sn.encode(y?1:0)}decode(y,S){try{const C=Sn.decode(y,S);return{consumed:C.consumed,value:this.coerceFunc("bool",!C.value.isZero())}}catch(C){throw C.reason==="insufficient data for uint256 type"?ne("insufficient data for boolean type",se,{arg:this.localName,coderType:"boolean",value:C.value}):C}}},string:class extends sn{constructor(y,S){super(y,"string","string",S,!0)}encode(y){if(typeof y!="string")throw ne("invalid string value",se,{arg:this.localName,coderType:"string",value:y});return DE(U(y))}decode(y,S){const C=jE(y,S,this.localName);return C.value=this.coerceFunc("string",F(C.value)),C}},bytes:class extends sn{constructor(y,S){super(y,"bytes","bytes",S,!0)}encode(y){try{return DE(md(y))}catch(S){throw S("invalid bytes value",se,{arg:this.localName,coderType:"bytes",value:S.value})}}decode(y,S){const C=jE(y,S,this.localName);return C.value=this.coerceFunc("bytes",C.value),C}},function:class extends ME{constructor(y,S){super(y,24,S)}}};function cu(y,S){const C=qD[S.type];if(C)return new C(y,S.name);let K=S.type.match(PE);if(K){const ee=parseInt(K[2]||"256");if(ee===0||ee>256||ee%8!=0)throw ne("invalid "+K[1]+" bit length",se,{arg:"param",value:S});return new CE(y,ee/8,K[1]==="int",S.name)}if(K=S.type.match(PD),K){const ee=parseInt(K[1]);if(ee===0||ee>32)throw ne("invalid bytes length",se,{arg:"param",value:S});return new ME(y,ee,S.name)}if(K=S.type.match(CD),K){const ee=Object.assign({},S),oe=parseInt(K[2]||"-1");return ee.type=K[1],new $D(y,cu(y,ee),oe,S.name)}if(S.type.substring(0,5)==="tuple")return(function(ee,oe,ve){oe||(oe=[]);const Pe=oe.map((He=>cu(ee,He)));return new hd(ee,Pe,ve)})(y,S.components,S.name);if(S.type==="")return new jD(y,S.name);throw ne("invalid type",se,{arg:"type",value:S.type,fullType:S})}class yd{constructor(S){(function(C,K){if(!(C instanceof K))throw ne("missing new","MISSING_NEW",{name:K.name})})(this,yd),S||(S=MD),AE(this,"coerceFunc",S)}encode(S,C){if(S.length!==C.length)throw ne("types/values length mismatch",se,{count:{types:S.length,values:C.length},value:{types:S,values:C}});const K=S.map((ee=>typeof ee=="string"?NE(ee):ee)).map((ee=>cu(this.coerceFunc,ee)));return new hd(this.coerceFunc,K,"_").encode(C)}decode(S,C){const K=S.map((ee=>typeof ee=="string"?NE(ee):ee)).map((ee=>cu(this.coerceFunc,ee)));return new hd(this.coerceFunc,K,"_").decode(C,0).value}}const $E=new yd;var qE,$e;function Be(y,S,C,K){var ee,oe=arguments.length,ve=oe<3?S:K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ve=Reflect.decorate(y,S,C,K);else for(var Pe=y.length-1;Pe>=0;Pe--)(ee=y[Pe])&&(ve=(oe<3?ee(ve):oe>3?ee(S,C,ve):ee(S,C))||ve);return oe>3&&ve&&Object.defineProperty(S,C,ve),ve}function ke(y,S){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(y,S)}r.coder=void 0,(qE=r.coder||(r.coder={})).encodeParams=function(y,S){return x($E.encode(y,S))},qE.decodeParams=function(y,S){if(y.length>0&&(!S||S==="0x"||S==="0X"))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return $E.decode(y,X("0x"+S.replace(/0x/i,"")))},typeof SuppressedError=="function"&&SuppressedError;class ze{constructor(S){this.callName=S.callName,this.params=S.params||0,this.inputFormatter=S.inputFormatter||null,this.outputFormatter=S.outputFormatter}validateArgs(S){if(S.length!==this.params)throw C=this.callName,K=S.length,ee=this.params,new Error(`Invalid number of input parameters to RPC method "${C}" given: ${K}, expected: ${ee}`);var C,K,ee}formatInput(S){return this.inputFormatter?this.inputFormatter.map((function(C,K){return C?C(S[K]):S[K]})):S}formatOutput(S){return S!==null?this.outputFormatter(S):null}toPayload(S){const C=this.formatInput(S);return this.validateArgs(C),{method:this.callName,params:C}}async execute(S,...C){const K=this.toPayload(C);if(!S)throw new Error("Missing RequestManager in method#exec");const ee=await S.sendAsync(K);return this.formatOutput(ee)}}class br{constructor(S){this.getter=S.getter,this.outputFormatter=S.outputFormatter}formatOutput(S){return this.outputFormatter(S)}async execute(S,...C){const K=await S.sendAsync({method:this.getter,params:[]});return this.formatOutput(K)}}function BE(y){return new Promise((S=>setTimeout(S,y)))}r.eth=void 0,($e=r.eth||(r.eth={})).eth_getBalance=new ze({callName:"eth_getBalance",params:2,inputFormatter:[vr,nt],outputFormatter:Tt}),$e.eth_getStorageAt=new ze({callName:"eth_getStorageAt",params:3,inputFormatter:[vr,we,nt],outputFormatter:le}),$e.eth_getCode=new ze({callName:"eth_getCode",params:2,inputFormatter:[vr,nt],outputFormatter:le}),$e.eth_getBlockByHash=new ze({callName:"eth_getBlockByHash",params:2,inputFormatter:[Wt,function(y){return!!y}],outputFormatter:Ns}),$e.eth_getBlockByNumber=new ze({callName:"eth_getBlockByNumber",params:2,inputFormatter:[Wt,function(y){return!!y}],outputFormatter:Ns}),$e.eth_getUncleByBlockHashAndIndex=new ze({callName:"eth_getUncleByBlockHashAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Ns}),$e.eth_getUncleByBlockNumberAndIndex=new ze({callName:"eth_getUncleByBlockNumberAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Ns}),$e.eth_getBlockTransactionCountByHash=new ze({callName:"eth_getBlockTransactionCountByHash",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getBlockTransactionCountByNumber=new ze({callName:"eth_getBlockTransactionCountByNumber",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getUncleCountByBlockHash=new ze({callName:"eth_getUncleCountByBlockHash",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getUncleCountByBlockNumber=new ze({callName:"eth_getUncleCountByBlockNumber",params:1,inputFormatter:[Wt],outputFormatter:Ie}),$e.eth_getTransactionByHash=new ze({callName:"eth_getTransactionByHash",params:1,inputFormatter:[Oa],outputFormatter:Os}),$e.eth_getTransactionByBlockHashAndIndex=new ze({callName:"eth_getTransactionByBlockHashAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Os}),$e.eth_getTransactionByBlockNumberAndIndex=new ze({callName:"eth_getTransactionByBlockNumberAndIndex",params:2,inputFormatter:[Wt,we],outputFormatter:Os}),$e.eth_getTransactionReceipt=new ze({callName:"eth_getTransactionReceipt",params:1,inputFormatter:[Oa],outputFormatter:IE}),$e.eth_getTransactionCount=new ze({callName:"eth_getTransactionCount",params:2,inputFormatter:[vr,nt],outputFormatter:Ie}),$e.eth_sendRawTransaction=new ze({callName:"eth_sendRawTransaction",params:1,inputFormatter:[null],outputFormatter:le}),$e.web3_sha3=new ze({callName:"web3_sha3",params:1,inputFormatter:[null],outputFormatter:le}),$e.eth_sendTransaction=new ze({callName:"eth_sendTransaction",params:1,inputFormatter:[pd],outputFormatter:le}),$e.eth_sign=new ze({callName:"eth_sign",params:2,inputFormatter:[vr,null],outputFormatter:le}),$e.eth_call=new ze({callName:"eth_call",params:2,inputFormatter:[fd,nt],outputFormatter:le}),$e.eth_estimateGas=new ze({callName:"eth_estimateGas",params:1,inputFormatter:[fd],outputFormatter:Ie}),$e.eth_submitWork=new ze({callName:"eth_submitWork",params:3,inputFormatter:[null,null,null],outputFormatter:me}),$e.eth_getWork=new ze({callName:"eth_getWork",params:0,inputFormatter:[],outputFormatter:ht}),$e.eth_coinbase=new br({getter:"eth_coinbase",outputFormatter:wr}),$e.eth_mining=new br({getter:"eth_mining",outputFormatter:me}),$e.eth_hashrate=new br({getter:"eth_hashrate",outputFormatter:Ie}),$e.eth_syncing=new br({getter:"eth_syncing",outputFormatter:wE}),$e.eth_gasPrice=new br({getter:"eth_gasPrice",outputFormatter:Tt}),$e.eth_accounts=new br({getter:"eth_accounts",outputFormatter:ht}),$e.eth_blockNumber=new br({getter:"eth_blockNumber",outputFormatter:Ie}),$e.eth_protocolVersion=new br({getter:"eth_protocolVersion",outputFormatter:Ie}),$e.web3_clientVersion=new br({getter:"web3_clientVersion",outputFormatter:ie}),$e.net_version=new br({getter:"net_version",outputFormatter:ie}),$e.shh_version=new ze({callName:"shh_version",params:0,inputFormatter:[],outputFormatter:Ie}),$e.shh_post=new ze({callName:"shh_post",params:1,inputFormatter:[null],outputFormatter:me}),$e.personal_newAccount=new ze({callName:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:wr}),$e.personal_importRawKey=new ze({callName:"personal_importRawKey",params:2,inputFormatter:[null,null],outputFormatter:wr}),$e.personal_sign=new ze({callName:"personal_sign",params:3,inputFormatter:[fe,vr,null],outputFormatter:le}),$e.personal_ecRecover=new ze({callName:"personal_ecRecover",params:2,inputFormatter:[fe,null],outputFormatter:wr}),$e.personal_unlockAccount=new ze({callName:"personal_unlockAccount",params:3,inputFormatter:[vr,null,Se],outputFormatter:me}),$e.personal_sendTransaction=new ze({callName:"personal_sendTransaction",params:2,inputFormatter:[pd,null],outputFormatter:le}),$e.personal_lockAccount=new ze({callName:"personal_lockAccount",params:1,inputFormatter:[vr],outputFormatter:me}),$e.personal_listAccounts=new br({getter:"personal_listAccounts",outputFormatter:ht}),$e.net_listening=new br({getter:"net_listening",outputFormatter:me}),$e.net_peerCount=new br({getter:"net_peerCount",outputFormatter:Ie}),$e.eth_newFilter=new ze({callName:"eth_newFilter",params:1,inputFormatter:[RE],outputFormatter:we}),$e.eth_getLogs=new ze({callName:"eth_getLogs",params:1,inputFormatter:[ht],outputFormatter:ht}),$e.eth_newBlockFilter=new ze({callName:"eth_newBlockFilter",params:0,inputFormatter:[],outputFormatter:we}),$e.eth_newPendingTransactionFilter=new ze({callName:"eth_newPendingTransactionFilter",params:0,inputFormatter:[],outputFormatter:we}),$e.eth_uninstallFilter=new ze({callName:"eth_uninstallFilter",params:1,inputFormatter:[we],outputFormatter:me}),$e.eth_getFilterLogs=new ze({callName:"eth_getFilterLogs",params:1,inputFormatter:[we],outputFormatter:ht}),$e.eth_getFilterChanges=new ze({callName:"eth_getFilterChanges",params:1,inputFormatter:[we],outputFormatter:ht}),$e.eth_submitHashrate=new ze({callName:"eth_submitHashrate",params:2,inputFormatter:[null,null],outputFormatter:me}),$e.shh_newIdentity=new ze({callName:"shh_newIdentity",params:0,inputFormatter:[],outputFormatter:le}),$e.shh_hasIdentity=new ze({callName:"shh_hasIdentity",params:1,inputFormatter:[null],outputFormatter:me}),$e.shh_newGroup=new ze({callName:"shh_newGroup",params:0,inputFormatter:[],outputFormatter:le}),$e.shh_addToGroup=new ze({callName:"shh_addToGroup",params:1,inputFormatter:[null],outputFormatter:me}),$e.shh_newFilter=new ze({callName:"shh_newFilter",params:1,inputFormatter:[null],outputFormatter:we}),$e.shh_uninstallFilter=new ze({callName:"shh_uninstallFilter",params:1,inputFormatter:[null],outputFormatter:me}),$e.shh_getLogs=new ze({callName:"shh_getLogs",params:1,inputFormatter:[null],outputFormatter:ht}),$e.shh_getFilterMessages=new ze({callName:"shh_getFilterMessages",params:1,inputFormatter:[null],outputFormatter:ht}),$e.shh_getFilterChanges=new ze({callName:"shh_getFilterChanges",params:1,inputFormatter:[null],outputFormatter:ht}),$e.shh_getMessages=new ze({callName:"shh_getMessages",params:1,inputFormatter:[null],outputFormatter:ht});function Ue(y,S){const C=r.eth[S];if(!C)throw new Error(`Could not find the method/property named ${S.toString()}`);Object.defineProperty(y,S,{value:function(...K){return C.execute(this,...K)}})}class Le{constructor(S){this.provider=S,this.requests=new Map}async sendAsync(S){const C=await this.provider;if(!C)throw new Error("Provider not set or invalid");const K=Qe(S.method,S.params),ee=s();return this.requests.set(K.id,ee),C.sendAsync(K,((oe,ve)=>{this.requests.delete(K.id),oe?ee.reject(oe):Pt(ve)?ee.resolve(ve.result):ee.reject((function(Pe){const He=Pe&&Pe.error&&Pe.error.message?Pe.error.message:"Invalid JSON RPC response: "+JSON.stringify(Pe);return new Error(He)})(ve))})),ee}setProvider(S){this.provider=S}async getConfirmedTransaction(S){const C=await this.waitForCompletion(S);if(this.isFailure(C))throw new Error(`Transaction "${S}" failed`);return C}async waitForCompletion(S,C){const K=Oa(S);if(await this.isTxDropped(K,C)){const ee=await this.getTransactionAndReceipt(K);return Object.assign(Object.assign({},ee),{status:r.TransactionStatus.failed})}for(;;){const ee=await this.getTransactionAndReceipt(K);if(!this.isPending(ee)&&ee.receipt)return Object.assign(Object.assign({},ee),{status:this.isFailure(ee)?r.TransactionStatus.failed:r.TransactionStatus.confirmed});await BE(2e3)}}async getTransaction(S){let C,K=null;const ee=Oa(S);try{const ve=(await this.eth_accounts())[0];ve&&(K=await this.eth_getTransactionCount(ve,"latest"))}catch{K=null}try{if(C=await this.eth_getTransactionByHash(ee),C===null)return null}catch{return null}if(C.blockNumber===null){if(K!==null){if(C.nonce<K)return{hash:ee,type:r.TransactionType.replaced,nonce:C.nonce};if(C.nonce>K)return{hash:ee,type:r.TransactionType.queued,nonce:C.nonce}}return Object.assign({type:r.TransactionType.pending},C)}let oe;try{if(oe=await this.eth_getTransactionReceipt(ee),oe===null||oe.status===0)return Object.assign({type:r.TransactionType.reverted},C)}catch{return null}return Object.assign(Object.assign({type:r.TransactionType.confirmed},C),{receipt:oe})}async isTxDropped(S,C=15){let K=C;for(;K>0;){if(await this.getTransactionAndReceipt(S)!==null)return!1;K-=1,await BE(2e3)}return!0}async getTransactionAndReceipt(S){S=Oa(S);const[C,K]=await Promise.all([this.eth_getTransactionByHash(S),this.eth_getTransactionReceipt(S)]);return Object.assign(Object.assign({},C),{receipt:K})}isPending(S){return S&&S.blockNumber===null}isFailure(S){return S&&(!S.receipt||S.receipt.status===0)}}Be([Ue,ke("design:type",Function)],Le.prototype,"web3_clientVersion",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"web3_sha3",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"net_version",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"net_peerCount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"net_listening",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_protocolVersion",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_syncing",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_coinbase",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_mining",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_hashrate",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_gasPrice",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_accounts",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_blockNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBalance",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getStorageAt",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionCount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockTransactionCountByHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockTransactionCountByNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleCountByBlockHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleCountByBlockNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getCode",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_sign",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_sendTransaction",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_sendRawTransaction",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_call",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_estimateGas",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockByHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getBlockByNumber",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionByHash",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionByBlockHashAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionByBlockNumberAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getTransactionReceipt",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleByBlockHashAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getUncleByBlockNumberAndIndex",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_newFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_newBlockFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_newPendingTransactionFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_uninstallFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getFilterChanges",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getFilterLogs",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getLogs",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_getWork",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_submitWork",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"eth_submitHashrate",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_post",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_version",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_newIdentity",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_hasIdentity",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_newGroup",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_addToGroup",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_newFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_uninstallFilter",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_getFilterChanges",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"shh_getMessages",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_unlockAccount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_newAccount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_listAccounts",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_lockAccount",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_importRawKey",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_sendTransaction",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_sign",void 0),Be([Ue,ke("design:type",Function)],Le.prototype,"personal_ecRecover",void 0);class kE{constructor(S){this.json=S,this._inputTypes=S.inputs||[],this._outputTypes=S.outputs||[],this._constant=!!S.constant,this._payable=!!S.payable||S.stateMutability==="payable",this.needsToBeTransaction=this._payable||"constant"in S&&!S.constant||S.stateMutability==="nonpayable",this._name=N(S)}extractDefaultBlock(S){return S.length>this._inputTypes.length&&!I(S[S.length-1])&&nt(S.pop())||"latest"}validateArgs(S){if(S.some((oe=>oe===void 0)))throw new Error("Invalid call, some arguments are undefined");const C=S.filter((function(oe){return!(I(oe)===!0&&de(oe)===!1&&M(oe)===!1&&!(oe instanceof Uint8Array))}));if(C.length!==this._inputTypes.length)throw K=C.length,ee=this._inputTypes.length,new Error(`Invalid number of arguments to Solidity function. given: ${K}, expected: ${ee}`);var K,ee}toPayload(S){let C={to:void 0,data:void 0,value:void 0,from:void 0};S.length>this._inputTypes.length&&I(S[S.length-1])&&(C=S.pop()),this.validateArgs(S);const K=this.signature();let ee=r.coder.encodeParams(this._inputTypes,S);return ee.indexOf("0x")===0&&(ee=ee.substr(2)),C.data="0x"+K+ee,C}signature(){return L(this._name).slice(0,8)}unpackOutput(S){if(!S)return;const C=S.length>=2?S.slice(2):S,K=r.coder.decodeParams(this._outputTypes,C);return K.length===1?K[0]:K}async execute(S,C,...K){if(!S)throw new Error(`Cannot call function ${this.displayName()} because there is no requestManager`);if(this.needsToBeTransaction){const ee=this.toPayload(K);if(ee.to=C,ee.value>0&&!this._payable)throw new Error("Cannot send value to non-payable function");if(!ee.from)throw new Error('Missing "from" in transaction options');return await S.eth_sendTransaction(ee)}{const ee=this.extractDefaultBlock(K),oe=this.toPayload(K);oe.to=C;const ve=await S.eth_call(oe,ee);return this.unpackOutput(ve)}}estimateGas(S,C,...K){if(!(S instanceof Le))throw new Error("estimateGas needs to receive a RequestManager as first argument");const ee=this.toPayload(K);return ee.to=C,S.eth_estimateGas(ee)}displayName(){return Ee(this._name)}typeName(){return _e(this._name)||"void"}attachToContract(S){const C=this.displayName(),K=Object.assign(((...ee)=>this.execute(S.requestManager,S.address,...ee)),{estimateGas:this.estimateGas.bind(this,S.requestManager,S.address),toPayload:(...ee)=>this.toPayload(ee),toRPCMessage:(...ee)=>{const oe=this.extractDefaultBlock(ee),ve=this.toPayload(ee);return ve.to=S.address,{method:"eth_call",params:[ve,oe]}},unpackOutput:ee=>this.unpackOutput(ee)});S[C]||(S[C]=K),S[C][this.typeName()]=K}}function UE(y){if(y==null)return null;const S=String(y).toString();return S.indexOf("0x")===0?S:x(U(S))}class gd{constructor(S){this.requestManager=S,this.isStarted=!1,this.isDisposed=!1,this.formatter=C=>C,this.filterId=s(),this.callbacks=[],this.stopSemaphore=s()}async watch(S){if(this.isDisposed)throw new Error("The filter was disposed");S&&(this.callbacks.push(S),this.isStarted||await this.start())}async start(){if(this.isDisposed)throw new Error("The filter was disposed");if(!this.isStarted){this.isStarted=!0;try{const S=await this.getNewFilter();if(!S)throw new Error("Could not create a filter, response: "+JSON.stringify(S));this.filterId.resolve(S)}catch(S){throw S}this.stopSemaphore=s(),await this.poll()}}async stop(){if(!this.isStarted||this.isDisposed)return;this.isDisposed=!0;const S=await this.filterId;if(this.isStarted=!1,this.stopSemaphore&&await this.stopSemaphore,await this.uninstall()!==!0)throw new Error(`Couldn't stop the eth filter: ${S}`)}async poll(){if(this.isStarted){if(this.callbacks.length){const C=await this.getChanges();C&&this.callbacks.forEach((K=>{this.formatter?C.forEach((ee=>{K(this.formatter(ee))})):C.forEach((ee=>K(ee)))}))}this.stopSemaphore.resolve(1),this.isStarted&&(this.stopSemaphore=s(),setTimeout((S=()=>this.poll(),function(){S().catch((C=>console.error(C)))}),500))}else this.stopSemaphore.resolve(1);var S}}class Cs extends gd{constructor(S,C,K=(ee=>ee)){super(S),this.requestManager=S,this.options=C,this.formatter=K,this.options=this.options||{},this.options.topics=this.options.topics||[],this.options.topics=this.options.topics.map((function(ee){return UE(ee)})),this.options={topics:this.options.topics,address:this.options.address?this.options.address:void 0,fromBlock:typeof this.options.fromBlock=="number"||typeof this.options.fromBlock=="string"?Wt(this.options.fromBlock)||void 0:"latest",toBlock:typeof this.options.toBlock=="number"||typeof this.options.toBlock=="string"?Wt(this.options.toBlock)||void 0:"latest"}}async getLogs(){this.isStarted||await this.start();const S=await this.filterId;return this.requestManager.eth_getFilterLogs(S)}async getNewFilter(){return this.requestManager.eth_newFilter(this.options)}async getChanges(){const S=await this.filterId;return this.requestManager.eth_getFilterChanges(S)}async uninstall(){const S=await this.filterId;return this.requestManager.eth_uninstallFilter(S)}}class _d{constructor(S,C,K){this.requestManager=S,this.address=K,this._anonymous=!1,this._params=C.inputs||[],this._name=N(C),this._anonymous=C.anonymous||!1}types(S){return this._params.filter((function(C){return C.indexed===S}))}displayName(){return Ee(this._name)}typeName(){return _e(this._name)||"void"}signature(){return L(this._name)}encode(S={},C={}){const K={topics:[],address:this.address};C.fromBlock!==void 0&&(K.fromBlock=Wt(C.fromBlock)||void 0),C.toBlock!==void 0&&(K.toBlock=Wt(C.toBlock)||void 0),K.topics=K.topics||[],this._anonymous||K.topics.push("0x"+this.signature());const ee=this._params.filter((function(oe){return oe.indexed===!0})).map((function(oe){const ve=S[oe.name];return ve==null?null:de(ve)?ve.map((function(Pe){return"0x"+r.coder.encodeParams([oe],[Pe])})):"0x"+r.coder.encodeParams([oe],[ve])}));return K.topics=K.topics.concat(ee),K}decode(S){S.data=S.data||"",S.topics=S.topics||[];const C=(this._anonymous?S.topics:S.topics.slice(1)).map((function(Pe){return Pe.slice(2)})).join(""),K=r.coder.decodeParams(this.types(!0),C),ee=S.data.slice(2),oe=r.coder.decodeParams(this.types(!1),ee),ve=this._params.reduce((function(Pe,He){return Pe[He.name]=He.indexed?K.shift():oe.shift(),Pe}),{});return Object.assign(Object.assign({},su(S)),{event:this.displayName(),address:S.address,args:ve})}async execute(S,C){const K=this.encode(S,C),ee=this.decode.bind(this);return new Cs(this.requestManager,K,ee)}attachToContract(S){const C=this.execute.bind(this),K=this.displayName();S.events[K]||(S.events[K]=C),S.events[K][this.typeName()]=this.execute.bind(this,S)}}class BD{constructor(S,C,K){this._requestManager=S,this._json=C,this._address=K}encode(S={}){const C={address:this._address};return S.fromBlock!==void 0&&(C.fromBlock=Wt(S.fromBlock)||void 0),S.toBlock!==void 0&&(C.toBlock=Wt(S.toBlock)||void 0),C}decode(S){S.data=S.data||"";const C=de(S.topics)&&E(S.topics[0])?S.topics[0].slice(2):"",K=this._json.filter((function(ee){return C===L(N(ee))}))[0];return K?new _d(this._requestManager,K,this._address).decode(S):su(S)}async execute(S){const C=this.encode(S),K=this.decode.bind(this);return new Cs(this._requestManager,C,K)}getAllEventsFunction(){return this.execute.bind(this)}}class FE{constructor(S,C,K){var ee;this.requestManager=S,this.abi=C,this.address=K,this.events={},this.transactionHash=null,this.address=K,this.abi=C,(ee=this).abi.filter((function(oe){return oe.type==="function"})).map((function(oe){return new kE(oe)})).forEach((function(oe){oe.attachToContract(ee)})),this.allEvents=(function(oe){const ve=oe.abi.filter((function(He){return He.type==="event"})),Pe=new BD(oe.requestManager,ve,oe.address);return ve.map((function(He){return new _d(oe.requestManager,He,oe.address)})).forEach((function(He){He.attachToContract(oe)})),Pe.getAllEventsFunction()})(this)}}r.AbstractFilter=gd,r.BigNumber=Y,r.Contract=FE,r.ContractFactory=class{constructor(y,S){this.requestManager=y,this.abi=S}async deploy(...y){let S;const C=y[y.length-1];if(I(C)&&!de(C)&&(S=y.pop()),!S)throw new Error("Missing options object");if(!S.data||typeof S.data!="string")throw new Error("Invalid options.data");if(Ie(S.value)>0&&!(this.abi.filter((function(Ge){return Ge.type==="constructor"&&Ge.inputs.length===y.length}))[0]||{}).payable)throw new Error("Cannot send value to non-payable constructor");const K=(ee=this.abi,oe=y,ee.filter((function(Ge){return Ge.type==="constructor"&&Ge.inputs&&Ge.inputs.length===oe.length})).map((function(Ge){return Ge.inputs||[]})).map((function(Ge){return r.coder.encodeParams(Ge,oe)}))[0]||"");var ee,oe;S.data+=K,S.gas||(S.gas=await this.requestManager.eth_estimateGas(S));const ve=await this.requestManager.eth_sendTransaction(S);if(!ve)throw new Error("Error while sending contract creation transaction. A TxHash was not retrieved");const Pe=await(async function(Ge,cr){const qt=s();let De=0;const Kt=()=>{De++,De>50?qt.reject(new Error("Contract transaction couldn't be found after 50 blocks")):Ge.eth_getTransactionReceipt(cr).then((ir=>{ir&&ir.blockHash?qt.resolve(ir):setTimeout(Kt,1e3)}),(ir=>qt.reject(ir)))};Kt();const It=await qt,Rt=await Ge.eth_getCode(It.contractAddress,"latest");if(Rt&&Rt.length>3)return It.contractAddress;throw Object.assign(new Error("The contract code couldn't be stored, please check your gas amount."),{response:Rt,receipt:It})})(this.requestManager,ve),He=await this.at(Pe);return He.transactionHash=ve,He}async at(y){if(!bt(y))throw new TypeError(`Invalid address ${JSON.stringify(y)}`);return new FE(this.requestManager,this.abi,y)}},r.EthBlockFilter=class extends Cs{constructor(y){super(y,{})}async getNewFilter(){return this.requestManager.eth_newBlockFilter()}},r.EthFilter=Cs,r.EthPendingTransactionFilter=class extends Cs{constructor(y){super(y,{})}async getNewFilter(){return this.requestManager.eth_newPendingTransactionFilter()}},r.HTTPProvider=class{constructor(y,S={}){this.host=y,this.options=S,this.debug=!1,this.host=y||"http://localhost:8545"}send(){throw new Error("Sync requests are deprecated")}sendAsync(y,S){try{let C=null;C=y instanceof Array?y.map((oe=>n(oe))):n(y);const K=this.options.fetch||globalThis.fetch;if(K===void 0)throw new Error("There is no global fetch object nor it was provided. Please install and import isomorphic-fetch");const ee={body:JSON.stringify(C),method:"POST",headers:Object.assign(Object.assign({},this.options.headers),{"Content-Type":"application/json"})};this.debug&&console.log("SEND >> "+ee.body),K(this.host,ee).then((async oe=>{if(oe.ok){const ve=await oe.json();this.debug&&console.log("RECV << "+JSON.stringify(ve)),ve.error?S(Object.assign(new Error(ve.error.json||ve.error),ve.error)):S(null,ve)}else{const ve=(typeof oe.text=="function"?await oe.text().catch((()=>"")):"").trim().slice(0,512),Pe="External error. response code: "+oe.status+(ve?" — "+ve:"");this.debug&&console.log("ERR << "+Pe),S(new Error(Pe))}}),(oe=>{this.debug&&console.log("ERR << "+JSON.stringify(oe)),S(oe)}))}catch(C){this.debug&&console.log("ERR << "+JSON.stringify(C)),S(C)}}},r.Method=ze,r.Property=br,r.RequestManager=Le,r.SHHFilter=class extends gd{constructor(y,S){super(y),this.requestManager=y,this.options=S,this.options=this.options||{topics:[]},this.options.topics=this.options.topics||[],this.options.topics=this.options.topics.map((function(C){return UE(C)})),this.options={topics:this.options.topics,to:this.options.to}}async getMessages(){const y=await this.filterId;return this.requestManager.shh_getMessages(y)}async getNewFilter(){return this.requestManager.shh_newFilter(this.options)}async getChanges(){const y=await this.filterId;return this.requestManager.shh_getFilterChanges(y)}async uninstall(){const y=await this.filterId;return this.requestManager.shh_uninstallFilter(y)}},r.SolidityEvent=_d,r.SolidityFunction=kE,r.WebSocketProvider=class{constructor(y,S={}){this.url=y,this.options=S,this.isDisposed=!1,this.responseCallbacks=new Map,this.notificationCallbacks=new Set,this.debug=!1,this.lastChunk="",this.connect()}dispose(){this.isDisposed=!0;const y=this.connection;this.timeout(new Error("Provider disposed.")),y.then((S=>S.close())).catch((S=>{this.debug&&console.error(S)}))}send(){throw new Error("Sync requests are deprecated")}sendAsync(y,S){const C=[];let K;if(y instanceof Array)K=Promise.all(y.map((ee=>{const oe=s();try{const ve=n(ee);C.push(ve),this.responseCallbacks.set(ve.id,oe)}catch(ve){oe.reject(ve)}return oe})));else{const ee=s();try{const oe=n(y);C.push(oe),this.responseCallbacks.set(oe.id,ee)}catch(oe){ee.reject(oe)}K=ee}K.then((ee=>S(null,ee)),(ee=>S(ee))),this.connection.then((ee=>{C.forEach((oe=>{const ve=JSON.stringify(oe);this.debug&&console.log("SEND >> "+ve),ee.send(ve)}))}),(ee=>{S(ee)}))}parseResponse(y){const S=[];return y.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((C=>{let K=C;this.lastChunk&&(K=this.lastChunk+K);let ee=null;try{ee=JSON.parse(K)}catch{return this.lastChunk=K,clearTimeout(this.lastChunkTimeout),void(this.lastChunkTimeout=setTimeout((()=>{this.timeout()}),15e3))}clearTimeout(this.lastChunkTimeout),this.lastChunk="",ee&&S.push(ee)})),S}processMessage(y){if("id"in y){const S=y.id,C=this.responseCallbacks.get(S);if(!C)return void console.error("Error: Received a response for an unknown request",y);this.responseCallbacks.delete(S),y.error!==void 0&&y.error!==null?C.reject(Object.assign(new Error(y.error.message||y.error),y.error)):"result"in y&&C.resolve(y)}else this.notificationCallbacks.forEach((S=>S(null,y)))}timeout(y){this.connection&&this.connection.isPending||(this.connection=s());const S=y||new Error("Connection timeout");this.responseCallbacks.forEach((C=>C.reject(S))),this.responseCallbacks.clear(),this.isDisposed||setTimeout((()=>this.connect()),1e3)}connect(){this.connection&&!this.connection.isPending&&this.connection.then((C=>C.close())).catch((C=>{this.debug&&console.error(C)})),this.connection&&this.connection.isPending||(this.connection=s()),this.lastChunk="";const y=this.options.WebSocketConstructor||(typeof WebSocket<"u"?WebSocket:void 0);if(!y)throw new Error("Please provide a WebSocketConstructor");const S=new y(this.url,this.options.protocol);S.onopen=()=>{this.connection.resolve(S)},S.onerror=C=>{const K=new Error("Error in web socket");K.data=C,this.timeout(K)},S.onclose=C=>{this.timeout(new Error(`Connection closed (${C&&C.reason||"Unknown reason"})`))},S.onmessage=C=>{const K=typeof C.data=="string"?C.data:"";this.debug&&console.log("RECV << "+C.data),this.parseResponse(K).forEach((ee=>{ee instanceof Array?ee.forEach((oe=>this.processMessage(oe))):this.processMessage(ee)}))}}},r.bytesToHex=x,r.bytesToUtf8String=F,r.concatBytes=j,r.default=Le,r.extractDisplayName=Ee,r.extractTypeName=_e,r.fromAscii=function(y,S=0){let C="";for(let K=0;K<y.length;K++){const ee=y.charCodeAt(K).toString(16);C+=ee.length<2?"0"+ee:ee}return"0x"+C.padEnd(S,"0")},r.fromDecimal=Te,r.fromTwosComplement=vt,r.fromWei=function(y,S){const C=xe(y).dividedBy(Fe(S));return M(y)?C:C.toString(10)},r.getAddress=$t,r.getValueOfUnit=Fe,r.hexToBytes=X,r.inputAddressFormatter=vr,r.inputBlockNumberFormatter=Wt,r.inputCallFormatter=fd,r.inputDefaultBlockNumberFormatter=nt,r.inputFilterOptions=RE,r.inputPostFormatter=function(y){return y?(y.ttl=Te(y.ttl),y.workToProve=Te(y.workToProve),y.priority=Te(y.priority),de(y.topics)||(y.topics=y.topics?[y.topics]:[]),y.topics=y.topics.map((function(S){return S.indexOf("0x")===0?S:"0x"+x(U(S))})),y):null},r.inputTransactionFormatter=pd,r.inputTransactionId=Oa,r.isAddress=bt,r.isArray=de,r.isBigNumber=M,r.isBloom=function(y){return!!/^(0x)?[0-9a-f]{512}$/i.test(y)&&!!/^(0x)?[0-9a-f]{512}$/i.test(y)},r.isBoolean=G,r.isChecksumAddress=rr,r.isFunction=function(y){return typeof y=="function"},r.isHex=function(y){return typeof y=="string"&&/^0x[0-9a-fA-F]+$/.test(y)},r.isJson=function(y){try{return!!JSON.parse(y)}catch{return!1}},r.isObject=I,r.isPredefinedBlockNumber=Ct,r.isStrictAddress=zt,r.isString=E,r.isTopic=function(y){return!!/^(0x)?[0-9a-f]{64}$/i.test(y)&&!!/^(0x)?[0-9a-f]{64}$/i.test(y)},r.isValidResponse=Pt,r.outputBigNumberFormatter=Tt,r.outputBlockFormatter=Ns,r.outputLogFormatter=su,r.outputPostFormatter=function(y){return y?(y.expiry=Ie(y.expiry),y.sent=Ie(y.sent),y.ttl=Ie(y.ttl),y.workProved=Ie(y.workProved),y.topics||(y.topics=[]),y.topics=y.topics.map((function(S){return V(S)})),y):null},r.outputSyncingFormatter=wE,r.outputTransactionFormatter=Os,r.outputTransactionReceiptFormatter=IE,r.padLeft=$,r.padRight=function(y,S,C){return y+new Array(S-y.length+1).join(C||"0")},r.sha3=L,r.signedIsNegative=ut,r.stringToUtf8Bytes=U,r.toAddress=wr,r.toArray=ht,r.toAscii=V,r.toBatchPayload=function(y){return y.map((function(S){return Qe(S.method,S.params)}))},r.toBigNumber=xe,r.toBoolean=me,r.toChecksumAddress=nr,r.toData=le,r.toDecimal=Ie,r.toHex=we,r.toJsonRpcRequest=Qe,r.toNullDecimal=Se,r.toString=ie,r.toStringData=fe,r.toTwosComplement=Xe,r.toWei=function(y,S){const C=xe(y).times(Fe(S));return M(y)?C:C.toString(10)},r.transformToFullName=N,Object.defineProperty(r,"__esModule",{value:!0})}))})(So,So.exports)),So.exports}var nl={},JI;function KH(){if(JI)return nl;JI=1,Object.defineProperty(nl,"__esModule",{value:!0}),nl.SignatureValidator=t;const e=td();async function t(r,n){const i=[{constant:!0,inputs:[{name:"hash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"magicValue",type:"bytes4"}],payable:!1,stateMutability:"view",type:"function"}];return await new e.ContractFactory(r,i).at(n)}return nl}var fn={},xp={},Kp={},Mi={},Cn={},Yt={},QI;function Q_(){if(QI)return Yt;QI=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.output=Yt.exists=Yt.hash=Yt.bytes=Yt.bool=Yt.number=Yt.isBytes=void 0;function e(u){if(!Number.isSafeInteger(u)||u<0)throw new Error(`positive integer expected, not ${u}`)}Yt.number=e;function t(u){if(typeof u!="boolean")throw new Error(`boolean expected, not ${u}`)}Yt.bool=t;function r(u){return u instanceof Uint8Array||u!=null&&typeof u=="object"&&u.constructor.name==="Uint8Array"}Yt.isBytes=r;function n(u,...l){if(!r(u))throw new Error("Uint8Array expected");if(l.length>0&&!l.includes(u.length))throw new Error(`Uint8Array expected of length ${l}, not of length=${u.length}`)}Yt.bytes=n;function i(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");e(u.outputLen),e(u.blockLen)}Yt.hash=i;function a(u,l=!0){if(u.destroyed)throw new Error("Hash instance has been destroyed");if(l&&u.finished)throw new Error("Hash#digest() has already been called")}Yt.exists=a;function s(u,l){n(u);const c=l.outputLen;if(u.length<c)throw new Error(`digestInto() expects output buffer of length at least ${c}`)}Yt.output=s;const o={number:e,bool:t,bytes:n,hash:i,exists:a,output:s};return Yt.default=o,Yt}var Xp={},Hs={},ZI;function XH(){return ZI||(ZI=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.crypto=void 0,Hs.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Hs}var e1;function tu(){return e1||(e1=1,(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.byteSwap32=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=e.isBytes=void 0;const t=XH(),r=Q_();function n(W){return W instanceof Uint8Array||W!=null&&typeof W=="object"&&W.constructor.name==="Uint8Array"}e.isBytes=n;const i=W=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength);e.u8=i;const a=W=>new Uint32Array(W.buffer,W.byteOffset,Math.floor(W.byteLength/4));e.u32=a;const s=W=>new DataView(W.buffer,W.byteOffset,W.byteLength);e.createView=s;const o=(W,U)=>W<<32-U|W>>>U;e.rotr=o;const u=(W,U)=>W<<U|W>>>32-U>>>0;e.rotl=u,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const l=W=>W<<24&4278190080|W<<8&16711680|W>>>8&65280|W>>>24&255;e.byteSwap=l,e.byteSwapIfBE=e.isLE?W=>W:W=>(0,e.byteSwap)(W);function c(W){for(let U=0;U<W.length;U++)W[U]=(0,e.byteSwap)(W[U])}e.byteSwap32=c;const d=Array.from({length:256},(W,U)=>U.toString(16).padStart(2,"0"));function p(W){(0,r.bytes)(W);let U="";for(let F=0;F<W.length;F++)U+=d[W[F]];return U}e.bytesToHex=p;const f={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function _(W){if(W>=f._0&&W<=f._9)return W-f._0;if(W>=f._A&&W<=f._F)return W-(f._A-10);if(W>=f._a&&W<=f._f)return W-(f._a-10)}function R(W){if(typeof W!="string")throw new Error("hex string expected, got "+typeof W);const U=W.length,F=U/2;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);const ce=new Uint8Array(F);for(let se=0,ne=0;se<F;se++,ne+=2){const X=_(W.charCodeAt(ne)),x=_(W.charCodeAt(ne+1));if(X===void 0||x===void 0){const L=W[ne]+W[ne+1];throw new Error('hex string expected, got non-hex character "'+L+'" at index '+ne)}ce[se]=X*16+x}return ce}e.hexToBytes=R;const w=async()=>{};e.nextTick=w;async function O(W,U,F){let ce=Date.now();for(let se=0;se<W;se++){F(se);const ne=Date.now()-ce;ne>=0&&ne<U||(await(0,e.nextTick)(),ce+=ne)}}e.asyncLoop=O;function h(W){if(typeof W!="string")throw new Error(`utf8ToBytes expected string, got ${typeof W}`);return new Uint8Array(new TextEncoder().encode(W))}e.utf8ToBytes=h;function T(W){return typeof W=="string"&&(W=h(W)),(0,r.bytes)(W),W}e.toBytes=T;function b(...W){let U=0;for(let ce=0;ce<W.length;ce++){const se=W[ce];(0,r.bytes)(se),U+=se.length}const F=new Uint8Array(U);for(let ce=0,se=0;ce<W.length;ce++){const ne=W[ce];F.set(ne,se),se+=ne.length}return F}e.concatBytes=b;class m{clone(){return this._cloneInto()}}e.Hash=m;const v={}.toString;function A(W,U){if(U!==void 0&&v.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(W,U)}e.checkOpts=A;function P(W){const U=ce=>W().update(T(ce)).digest(),F=W();return U.outputLen=F.outputLen,U.blockLen=F.blockLen,U.create=()=>W(),U}e.wrapConstructor=P;function q(W){const U=(ce,se)=>W(se).update(T(ce)).digest(),F=W({});return U.outputLen=F.outputLen,U.blockLen=F.blockLen,U.create=ce=>W(ce),U}e.wrapConstructorWithOpts=q;function z(W){const U=(ce,se)=>W(se).update(T(ce)).digest(),F=W({});return U.outputLen=F.outputLen,U.blockLen=F.blockLen,U.create=ce=>W(ce),U}e.wrapXOFConstructorWithOpts=z;function Y(W=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(W));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=Y})(Xp)),Xp}var t1;function JH(){if(t1)return Cn;t1=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.HashMD=Cn.Maj=Cn.Chi=void 0;const e=Q_(),t=tu();function r(s,o,u,l){if(typeof s.setBigUint64=="function")return s.setBigUint64(o,u,l);const c=BigInt(32),d=BigInt(4294967295),p=Number(u>>c&d),f=Number(u&d),_=l?4:0,R=l?0:4;s.setUint32(o+_,p,l),s.setUint32(o+R,f,l)}const n=(s,o,u)=>s&o^~s&u;Cn.Chi=n;const i=(s,o,u)=>s&o^s&u^o&u;Cn.Maj=i;class a extends t.Hash{constructor(o,u,l,c){super(),this.blockLen=o,this.outputLen=u,this.padOffset=l,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(o),this.view=(0,t.createView)(this.buffer)}update(o){(0,e.exists)(this);const{view:u,buffer:l,blockLen:c}=this;o=(0,t.toBytes)(o);const d=o.length;for(let p=0;p<d;){const f=Math.min(c-this.pos,d-p);if(f===c){const _=(0,t.createView)(o);for(;c<=d-p;p+=c)this.process(_,p);continue}l.set(o.subarray(p,p+f),this.pos),this.pos+=f,p+=f,this.pos===c&&(this.process(u,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){(0,e.exists)(this),(0,e.output)(o,this),this.finished=!0;const{buffer:u,view:l,blockLen:c,isLE:d}=this;let{pos:p}=this;u[p++]=128,this.buffer.subarray(p).fill(0),this.padOffset>c-p&&(this.process(l,0),p=0);for(let O=p;O<c;O++)u[O]=0;r(l,c-8,BigInt(this.length*8),d),this.process(l,0);const f=(0,t.createView)(o),_=this.outputLen;if(_%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const R=_/4,w=this.get();if(R>w.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O<R;O++)f.setUint32(4*O,w[O],d)}digest(){const{buffer:o,outputLen:u}=this;this.digestInto(o);const l=o.slice(0,u);return this.destroy(),l}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:u,buffer:l,length:c,finished:d,destroyed:p,pos:f}=this;return o.length=c,o.pos=f,o.finished=d,o.destroyed=p,c%u&&o.buffer.set(l),o}}return Cn.HashMD=a,Cn}var r1;function QH(){if(r1)return Mi;r1=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.sha224=Mi.sha256=void 0;const e=JH(),t=tu(),r=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class a extends e.HashMD{constructor(){super(64,32,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0,this.F=n[5]|0,this.G=n[6]|0,this.H=n[7]|0}get(){const{A:u,B:l,C:c,D:d,E:p,F:f,G:_,H:R}=this;return[u,l,c,d,p,f,_,R]}set(u,l,c,d,p,f,_,R){this.A=u|0,this.B=l|0,this.C=c|0,this.D=d|0,this.E=p|0,this.F=f|0,this.G=_|0,this.H=R|0}process(u,l){for(let h=0;h<16;h++,l+=4)i[h]=u.getUint32(l,!1);for(let h=16;h<64;h++){const T=i[h-15],b=i[h-2],m=(0,t.rotr)(T,7)^(0,t.rotr)(T,18)^T>>>3,v=(0,t.rotr)(b,17)^(0,t.rotr)(b,19)^b>>>10;i[h]=v+i[h-7]+m+i[h-16]|0}let{A:c,B:d,C:p,D:f,E:_,F:R,G:w,H:O}=this;for(let h=0;h<64;h++){const T=(0,t.rotr)(_,6)^(0,t.rotr)(_,11)^(0,t.rotr)(_,25),b=O+T+(0,e.Chi)(_,R,w)+r[h]+i[h]|0,v=((0,t.rotr)(c,2)^(0,t.rotr)(c,13)^(0,t.rotr)(c,22))+(0,e.Maj)(c,d,p)|0;O=w,w=R,R=_,_=f+b|0,f=p,p=d,d=c,c=b+v|0}c=c+this.A|0,d=d+this.B|0,p=p+this.C|0,f=f+this.D|0,_=_+this.E|0,R=R+this.F|0,w=w+this.G|0,O=O+this.H|0,this.set(c,d,p,f,_,R,w,O)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class s extends a{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return Mi.sha256=(0,t.wrapConstructor)(()=>new a),Mi.sha224=(0,t.wrapConstructor)(()=>new s),Mi}var Vs={},Jp={},n1;function ZH(){return n1||(n1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Q_(),r=tu();class n extends r.Hash{constructor(s,o){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(s);const u=(0,r.toBytes)(o);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const l=this.blockLen,c=new Uint8Array(l);c.set(u.length>l?s.create().update(u).digest():u);for(let d=0;d<c.length;d++)c[d]^=54;this.iHash.update(c),this.oHash=s.create();for(let d=0;d<c.length;d++)c[d]^=106;this.oHash.update(c),c.fill(0)}update(s){return(0,t.exists)(this),this.iHash.update(s),this}digestInto(s){(0,t.exists)(this),(0,t.bytes)(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:o,iHash:u,finished:l,destroyed:c,blockLen:d,outputLen:p}=this;return s=s,s.finished=l,s.destroyed=c,s.blockLen=d,s.outputLen=p,s.oHash=o._cloneInto(s.oHash),s.iHash=u._cloneInto(s.iHash),s}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const i=(a,s,o)=>new n(a,s).update(o).digest();e.hmac=i,e.hmac.create=(a,s)=>new n(a,s)})(Jp)),Jp}var Qp={},Gs={},Lt={},Mt={},i1;function ls(){if(i1)return Mt;i1=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.bitMask=void 0,Mt.isBytes=n,Mt.abytes=i,Mt.bytesToHex=s,Mt.numberToHexUnpadded=o,Mt.hexToNumber=u,Mt.hexToBytes=d,Mt.bytesToNumberBE=p,Mt.bytesToNumberLE=f,Mt.numberToBytesBE=_,Mt.numberToBytesLE=R,Mt.numberToVarBytesBE=w,Mt.ensureBytes=O,Mt.concatBytes=h,Mt.equalBytes=T,Mt.utf8ToBytes=b,Mt.bitLen=m,Mt.bitGet=v,Mt.bitSet=A,Mt.createHmacDrbg=Y,Mt.validateObject=U;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=BigInt(0),t=BigInt(1),r=BigInt(2);function n(F){return F instanceof Uint8Array||F!=null&&typeof F=="object"&&F.constructor.name==="Uint8Array"}function i(F){if(!n(F))throw new Error("Uint8Array expected")}const a=Array.from({length:256},(F,ce)=>ce.toString(16).padStart(2,"0"));function s(F){i(F);let ce="";for(let se=0;se<F.length;se++)ce+=a[F[se]];return ce}function o(F){const ce=F.toString(16);return ce.length&1?`0${ce}`:ce}function u(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);return BigInt(F===""?"0":`0x${F}`)}const l={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function c(F){if(F>=l._0&&F<=l._9)return F-l._0;if(F>=l._A&&F<=l._F)return F-(l._A-10);if(F>=l._a&&F<=l._f)return F-(l._a-10)}function d(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);const ce=F.length,se=ce/2;if(ce%2)throw new Error("padded hex string expected, got unpadded hex of length "+ce);const ne=new Uint8Array(se);for(let X=0,x=0;X<se;X++,x+=2){const L=c(F.charCodeAt(x)),D=c(F.charCodeAt(x+1));if(L===void 0||D===void 0){const $=F[x]+F[x+1];throw new Error('hex string expected, got non-hex character "'+$+'" at index '+x)}ne[X]=L*16+D}return ne}function p(F){return u(s(F))}function f(F){return i(F),u(s(Uint8Array.from(F).reverse()))}function _(F,ce){return d(F.toString(16).padStart(ce*2,"0"))}function R(F,ce){return _(F,ce).reverse()}function w(F){return d(o(F))}function O(F,ce,se){let ne;if(typeof ce=="string")try{ne=d(ce)}catch(x){throw new Error(`${F} must be valid hex string, got "${ce}". Cause: ${x}`)}else if(n(ce))ne=Uint8Array.from(ce);else throw new Error(`${F} must be hex string or Uint8Array`);const X=ne.length;if(typeof se=="number"&&X!==se)throw new Error(`${F} expected ${se} bytes, got ${X}`);return ne}function h(...F){let ce=0;for(let ne=0;ne<F.length;ne++){const X=F[ne];i(X),ce+=X.length}const se=new Uint8Array(ce);for(let ne=0,X=0;ne<F.length;ne++){const x=F[ne];se.set(x,X),X+=x.length}return se}function T(F,ce){if(F.length!==ce.length)return!1;let se=0;for(let ne=0;ne<F.length;ne++)se|=F[ne]^ce[ne];return se===0}function b(F){if(typeof F!="string")throw new Error(`utf8ToBytes expected string, got ${typeof F}`);return new Uint8Array(new TextEncoder().encode(F))}function m(F){let ce;for(ce=0;F>e;F>>=t,ce+=1);return ce}function v(F,ce){return F>>BigInt(ce)&t}function A(F,ce,se){return F|(se?t:e)<<BigInt(ce)}const P=F=>(r<<BigInt(F-1))-t;Mt.bitMask=P;const q=F=>new Uint8Array(F),z=F=>Uint8Array.from(F);function Y(F,ce,se){if(typeof F!="number"||F<2)throw new Error("hashLen must be a number");if(typeof ce!="number"||ce<2)throw new Error("qByteLen must be a number");if(typeof se!="function")throw new Error("hmacFn must be a function");let ne=q(F),X=q(F),x=0;const L=()=>{ne.fill(1),X.fill(0),x=0},D=(...j)=>se(X,ne,...j),$=(j=q())=>{X=D(z([0]),j),ne=D(),j.length!==0&&(X=D(z([1]),j),ne=D())},V=()=>{if(x++>=1e3)throw new Error("drbg: tried 1000 values");let j=0;const Z=[];for(;j<ce;){ne=D();const Ee=ne.slice();Z.push(Ee),j+=ne.length}return h(...Z)};return(j,Z)=>{L(),$(j);let Ee;for(;!(Ee=Z(V()));)$();return L(),Ee}}const W={bigint:F=>typeof F=="bigint",function:F=>typeof F=="function",boolean:F=>typeof F=="boolean",string:F=>typeof F=="string",stringOrUint8Array:F=>typeof F=="string"||n(F),isSafeInteger:F=>Number.isSafeInteger(F),array:F=>Array.isArray(F),field:(F,ce)=>ce.Fp.isValid(F),hash:F=>typeof F=="function"&&Number.isSafeInteger(F.outputLen)};function U(F,ce,se={}){const ne=(X,x,L)=>{const D=W[x];if(typeof D!="function")throw new Error(`Invalid validator "${x}", expected function`);const $=F[X];if(!(L&&$===void 0)&&!D($,F))throw new Error(`Invalid param ${String(X)}=${$} (${typeof $}), expected ${x}`)};for(const[X,x]of Object.entries(ce))ne(X,x,!1);for(const[X,x]of Object.entries(se))ne(X,x,!0);return F}return Mt}var a1;function rd(){if(a1)return Lt;a1=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.isNegativeLE=void 0,Lt.mod=u,Lt.pow=l,Lt.pow2=c,Lt.invert=d,Lt.tonelliShanks=p,Lt.FpSqrt=f,Lt.validateField=w,Lt.FpPow=O,Lt.FpInvertBatch=h,Lt.FpDiv=T,Lt.FpIsSquare=b,Lt.nLength=m,Lt.Field=v,Lt.FpSqrtOdd=A,Lt.FpSqrtEven=P,Lt.hashToPrivateScalar=q,Lt.getFieldBytesLength=z,Lt.getMinHashLength=Y,Lt.mapHashToField=W;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=ls(),t=BigInt(0),r=BigInt(1),n=BigInt(2),i=BigInt(3),a=BigInt(4),s=BigInt(5),o=BigInt(8);BigInt(9),BigInt(16);function u(U,F){const ce=U%F;return ce>=t?ce:F+ce}function l(U,F,ce){if(ce<=t||F<t)throw new Error("Expected power/modulo > 0");if(ce===r)return t;let se=r;for(;F>t;)F&r&&(se=se*U%ce),U=U*U%ce,F>>=r;return se}function c(U,F,ce){let se=U;for(;F-- >t;)se*=se,se%=ce;return se}function d(U,F){if(U===t||F<=t)throw new Error(`invert: expected positive integers, got n=${U} mod=${F}`);let ce=u(U,F),se=F,ne=t,X=r;for(;ce!==t;){const L=se/ce,D=se%ce,$=ne-X*L;se=ce,ce=D,ne=X,X=$}if(se!==r)throw new Error("invert: does not exist");return u(ne,F)}function p(U){const F=(U-r)/n;let ce,se,ne;for(ce=U-r,se=0;ce%n===t;ce/=n,se++);for(ne=n;ne<U&&l(ne,F,U)!==U-r;ne++);if(se===1){const x=(U+r)/a;return function(D,$){const V=D.pow($,x);if(!D.eql(D.sqr(V),$))throw new Error("Cannot find square root");return V}}const X=(ce+r)/n;return function(L,D){if(L.pow(D,F)===L.neg(L.ONE))throw new Error("Cannot find square root");let $=se,V=L.pow(L.mul(L.ONE,ne),ce),N=L.pow(D,X),j=L.pow(D,ce);for(;!L.eql(j,L.ONE);){if(L.eql(j,L.ZERO))return L.ZERO;let Z=1;for(let _e=L.sqr(j);Z<$&&!L.eql(_e,L.ONE);Z++)_e=L.sqr(_e);const Ee=L.pow(V,r<<BigInt($-Z-1));V=L.sqr(Ee),N=L.mul(N,Ee),j=L.mul(j,V),$=Z}return N}}function f(U){if(U%a===i){const F=(U+r)/a;return function(se,ne){const X=se.pow(ne,F);if(!se.eql(se.sqr(X),ne))throw new Error("Cannot find square root");return X}}if(U%o===s){const F=(U-s)/o;return function(se,ne){const X=se.mul(ne,n),x=se.pow(X,F),L=se.mul(ne,x),D=se.mul(se.mul(L,n),x),$=se.mul(L,se.sub(D,se.ONE));if(!se.eql(se.sqr($),ne))throw new Error("Cannot find square root");return $}}return p(U)}const _=(U,F)=>(u(U,F)&r)===r;Lt.isNegativeLE=_;const R=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function w(U){const F={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},ce=R.reduce((se,ne)=>(se[ne]="function",se),F);return(0,e.validateObject)(U,ce)}function O(U,F,ce){if(ce<t)throw new Error("Expected power > 0");if(ce===t)return U.ONE;if(ce===r)return F;let se=U.ONE,ne=F;for(;ce>t;)ce&r&&(se=U.mul(se,ne)),ne=U.sqr(ne),ce>>=r;return se}function h(U,F){const ce=new Array(F.length),se=F.reduce((X,x,L)=>U.is0(x)?X:(ce[L]=X,U.mul(X,x)),U.ONE),ne=U.inv(se);return F.reduceRight((X,x,L)=>U.is0(x)?X:(ce[L]=U.mul(X,ce[L]),U.mul(X,x)),ne),ce}function T(U,F,ce){return U.mul(F,typeof ce=="bigint"?d(ce,U.ORDER):U.inv(ce))}function b(U){const F=(U.ORDER-r)/n;return ce=>{const se=U.pow(ce,F);return U.eql(se,U.ZERO)||U.eql(se,U.ONE)}}function m(U,F){const ce=F!==void 0?F:U.toString(2).length,se=Math.ceil(ce/8);return{nBitLength:ce,nByteLength:se}}function v(U,F,ce=!1,se={}){if(U<=t)throw new Error(`Expected Field ORDER > 0, got ${U}`);const{nBitLength:ne,nByteLength:X}=m(U,F);if(X>2048)throw new Error("Field lengths over 2048 bytes are not supported");const x=f(U),L=Object.freeze({ORDER:U,BITS:ne,BYTES:X,MASK:(0,e.bitMask)(ne),ZERO:t,ONE:r,create:D=>u(D,U),isValid:D=>{if(typeof D!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof D}`);return t<=D&&D<U},is0:D=>D===t,isOdd:D=>(D&r)===r,neg:D=>u(-D,U),eql:(D,$)=>D===$,sqr:D=>u(D*D,U),add:(D,$)=>u(D+$,U),sub:(D,$)=>u(D-$,U),mul:(D,$)=>u(D*$,U),pow:(D,$)=>O(L,D,$),div:(D,$)=>u(D*d($,U),U),sqrN:D=>D*D,addN:(D,$)=>D+$,subN:(D,$)=>D-$,mulN:(D,$)=>D*$,inv:D=>d(D,U),sqrt:se.sqrt||(D=>x(L,D)),invertBatch:D=>h(L,D),cmov:(D,$,V)=>V?$:D,toBytes:D=>ce?(0,e.numberToBytesLE)(D,X):(0,e.numberToBytesBE)(D,X),fromBytes:D=>{if(D.length!==X)throw new Error(`Fp.fromBytes: expected ${X}, got ${D.length}`);return ce?(0,e.bytesToNumberLE)(D):(0,e.bytesToNumberBE)(D)}});return Object.freeze(L)}function A(U,F){if(!U.isOdd)throw new Error("Field doesn't have isOdd");const ce=U.sqrt(F);return U.isOdd(ce)?ce:U.neg(ce)}function P(U,F){if(!U.isOdd)throw new Error("Field doesn't have isOdd");const ce=U.sqrt(F);return U.isOdd(ce)?U.neg(ce):ce}function q(U,F,ce=!1){U=(0,e.ensureBytes)("privateHash",U);const se=U.length,ne=m(F).nByteLength+8;if(ne<24||se<ne||se>1024)throw new Error(`hashToPrivateScalar: expected ${ne}-1024 bytes of input, got ${se}`);const X=ce?(0,e.bytesToNumberLE)(U):(0,e.bytesToNumberBE)(U);return u(X,F-r)+r}function z(U){if(typeof U!="bigint")throw new Error("field order must be bigint");const F=U.toString(2).length;return Math.ceil(F/8)}function Y(U){const F=z(U);return F+Math.ceil(F/2)}function W(U,F,ce=!1){const se=U.length,ne=z(F),X=Y(F);if(se<16||se<X||se>1024)throw new Error(`expected ${X}-1024 bytes of input, got ${se}`);const x=ce?(0,e.bytesToNumberBE)(U):(0,e.bytesToNumberLE)(U),L=u(x,F-r)+r;return ce?(0,e.numberToBytesLE)(L,ne):(0,e.numberToBytesBE)(L,ne)}return Lt}var s1;function eV(){if(s1)return Gs;s1=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.wNAF=i,Gs.validateBasic=a;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=rd(),t=ls(),r=BigInt(0),n=BigInt(1);function i(s,o){const u=(c,d)=>{const p=d.negate();return c?p:d},l=c=>{const d=Math.ceil(o/c)+1,p=2**(c-1);return{windows:d,windowSize:p}};return{constTimeNegate:u,unsafeLadder(c,d){let p=s.ZERO,f=c;for(;d>r;)d&n&&(p=p.add(f)),f=f.double(),d>>=n;return p},precomputeWindow(c,d){const{windows:p,windowSize:f}=l(d),_=[];let R=c,w=R;for(let O=0;O<p;O++){w=R,_.push(w);for(let h=1;h<f;h++)w=w.add(R),_.push(w);R=w.double()}return _},wNAF(c,d,p){const{windows:f,windowSize:_}=l(c);let R=s.ZERO,w=s.BASE;const O=BigInt(2**c-1),h=2**c,T=BigInt(c);for(let b=0;b<f;b++){const m=b*_;let v=Number(p&O);p>>=T,v>_&&(v-=h,p+=n);const A=m,P=m+Math.abs(v)-1,q=b%2!==0,z=v<0;v===0?w=w.add(u(q,d[A])):R=R.add(u(z,d[P]))}return{p:R,f:w}},wNAFCached(c,d,p,f){const _=c._WINDOW_SIZE||1;let R=d.get(c);return R||(R=this.precomputeWindow(c,_),_!==1&&d.set(c,f(R))),this.wNAF(_,R,p)}}}function a(s){return(0,e.validateField)(s.Fp),(0,t.validateObject)(s,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(s.n,s.nBitLength),...s,p:s.Fp.ORDER})}return Gs}var o1;function SC(){return o1||(o1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=f,e.weierstrass=R,e.SWUFpSqrtRatio=w,e.mapToCurveSimpleSWU=O;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=eV(),r=rd(),n=ls(),i=ls();function a(h){const T=(0,t.validateBasic)(h);n.validateObject(T,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:b,Fp:m,a:v}=T;if(b){if(!m.eql(v,m.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof b!="object"||typeof b.beta!="bigint"||typeof b.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...T})}const{bytesToNumberBE:s,hexToBytes:o}=n;e.DER={Err:class extends Error{constructor(T=""){super(T)}},_parseInt(h){const{Err:T}=e.DER;if(h.length<2||h[0]!==2)throw new T("Invalid signature integer tag");const b=h[1],m=h.subarray(2,b+2);if(!b||m.length!==b)throw new T("Invalid signature integer: wrong length");if(m[0]&128)throw new T("Invalid signature integer: negative");if(m[0]===0&&!(m[1]&128))throw new T("Invalid signature integer: unnecessary leading zero");return{d:s(m),l:h.subarray(b+2)}},toSig(h){const{Err:T}=e.DER,b=typeof h=="string"?o(h):h;n.abytes(b);let m=b.length;if(m<2||b[0]!=48)throw new T("Invalid signature tag");if(b[1]!==m-2)throw new T("Invalid signature: incorrect length");const{d:v,l:A}=e.DER._parseInt(b.subarray(2)),{d:P,l:q}=e.DER._parseInt(A);if(q.length)throw new T("Invalid signature: left bytes after parsing");return{r:v,s:P}},hexFromSig(h){const T=Y=>Number.parseInt(Y[0],16)&8?"00"+Y:Y,b=Y=>{const W=Y.toString(16);return W.length&1?`0${W}`:W},m=T(b(h.s)),v=T(b(h.r)),A=m.length/2,P=v.length/2,q=b(A),z=b(P);return`30${b(P+A+4)}02${z}${v}02${q}${m}`}};const u=BigInt(0),l=BigInt(1),c=BigInt(2),d=BigInt(3),p=BigInt(4);function f(h){const T=a(h),{Fp:b}=T,m=T.toBytes||((se,ne,X)=>{const x=ne.toAffine();return n.concatBytes(Uint8Array.from([4]),b.toBytes(x.x),b.toBytes(x.y))}),v=T.fromBytes||(se=>{const ne=se.subarray(1),X=b.fromBytes(ne.subarray(0,b.BYTES)),x=b.fromBytes(ne.subarray(b.BYTES,2*b.BYTES));return{x:X,y:x}});function A(se){const{a:ne,b:X}=T,x=b.sqr(se),L=b.mul(x,se);return b.add(b.add(L,b.mul(se,ne)),X)}if(!b.eql(b.sqr(T.Gy),A(T.Gx)))throw new Error("bad generator point: equation left != right");function P(se){return typeof se=="bigint"&&u<se&&se<T.n}function q(se){if(!P(se))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function z(se){const{allowedPrivateKeyLengths:ne,nByteLength:X,wrapPrivateKey:x,n:L}=T;if(ne&&typeof se!="bigint"){if(n.isBytes(se)&&(se=n.bytesToHex(se)),typeof se!="string"||!ne.includes(se.length))throw new Error("Invalid key");se=se.padStart(X*2,"0")}let D;try{D=typeof se=="bigint"?se:n.bytesToNumberBE((0,i.ensureBytes)("private key",se,X))}catch{throw new Error(`private key must be ${X} bytes, hex or bigint, not ${typeof se}`)}return x&&(D=r.mod(D,L)),q(D),D}const Y=new Map;function W(se){if(!(se instanceof U))throw new Error("ProjectivePoint expected")}class U{constructor(ne,X,x){if(this.px=ne,this.py=X,this.pz=x,ne==null||!b.isValid(ne))throw new Error("x required");if(X==null||!b.isValid(X))throw new Error("y required");if(x==null||!b.isValid(x))throw new Error("z required")}static fromAffine(ne){const{x:X,y:x}=ne||{};if(!ne||!b.isValid(X)||!b.isValid(x))throw new Error("invalid affine point");if(ne instanceof U)throw new Error("projective point not allowed");const L=D=>b.eql(D,b.ZERO);return L(X)&&L(x)?U.ZERO:new U(X,x,b.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ne){const X=b.invertBatch(ne.map(x=>x.pz));return ne.map((x,L)=>x.toAffine(X[L])).map(U.fromAffine)}static fromHex(ne){const X=U.fromAffine(v((0,i.ensureBytes)("pointHex",ne)));return X.assertValidity(),X}static fromPrivateKey(ne){return U.BASE.multiply(z(ne))}_setWindowSize(ne){this._WINDOW_SIZE=ne,Y.delete(this)}assertValidity(){if(this.is0()){if(T.allowInfinityPoint&&!b.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:ne,y:X}=this.toAffine();if(!b.isValid(ne)||!b.isValid(X))throw new Error("bad point: x or y not FE");const x=b.sqr(X),L=A(ne);if(!b.eql(x,L))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:ne}=this.toAffine();if(b.isOdd)return!b.isOdd(ne);throw new Error("Field doesn't support isOdd")}equals(ne){W(ne);const{px:X,py:x,pz:L}=this,{px:D,py:$,pz:V}=ne,N=b.eql(b.mul(X,V),b.mul(D,L)),j=b.eql(b.mul(x,V),b.mul($,L));return N&&j}negate(){return new U(this.px,b.neg(this.py),this.pz)}double(){const{a:ne,b:X}=T,x=b.mul(X,d),{px:L,py:D,pz:$}=this;let V=b.ZERO,N=b.ZERO,j=b.ZERO,Z=b.mul(L,L),Ee=b.mul(D,D),_e=b.mul($,$),Se=b.mul(L,D);return Se=b.add(Se,Se),j=b.mul(L,$),j=b.add(j,j),V=b.mul(ne,j),N=b.mul(x,_e),N=b.add(V,N),V=b.sub(Ee,N),N=b.add(Ee,N),N=b.mul(V,N),V=b.mul(Se,V),j=b.mul(x,j),_e=b.mul(ne,_e),Se=b.sub(Z,_e),Se=b.mul(ne,Se),Se=b.add(Se,j),j=b.add(Z,Z),Z=b.add(j,Z),Z=b.add(Z,_e),Z=b.mul(Z,Se),N=b.add(N,Z),_e=b.mul(D,$),_e=b.add(_e,_e),Z=b.mul(_e,Se),V=b.sub(V,Z),j=b.mul(_e,Ee),j=b.add(j,j),j=b.add(j,j),new U(V,N,j)}add(ne){W(ne);const{px:X,py:x,pz:L}=this,{px:D,py:$,pz:V}=ne;let N=b.ZERO,j=b.ZERO,Z=b.ZERO;const Ee=T.a,_e=b.mul(T.b,d);let Se=b.mul(X,D),Ie=b.mul(x,$),ie=b.mul(L,V),le=b.add(X,x),fe=b.add(D,$);le=b.mul(le,fe),fe=b.add(Se,Ie),le=b.sub(le,fe),fe=b.add(X,L);let me=b.add(D,V);return fe=b.mul(fe,me),me=b.add(Se,ie),fe=b.sub(fe,me),me=b.add(x,L),N=b.add($,V),me=b.mul(me,N),N=b.add(Ie,ie),me=b.sub(me,N),Z=b.mul(Ee,fe),N=b.mul(_e,ie),Z=b.add(N,Z),N=b.sub(Ie,Z),Z=b.add(Ie,Z),j=b.mul(N,Z),Ie=b.add(Se,Se),Ie=b.add(Ie,Se),ie=b.mul(Ee,ie),fe=b.mul(_e,fe),Ie=b.add(Ie,ie),ie=b.sub(Se,ie),ie=b.mul(Ee,ie),fe=b.add(fe,ie),Se=b.mul(Ie,fe),j=b.add(j,Se),Se=b.mul(me,fe),N=b.mul(le,N),N=b.sub(N,Se),Se=b.mul(le,Ie),Z=b.mul(me,Z),Z=b.add(Z,Se),new U(N,j,Z)}subtract(ne){return this.add(ne.negate())}is0(){return this.equals(U.ZERO)}wNAF(ne){return ce.wNAFCached(this,Y,ne,X=>{const x=b.invertBatch(X.map(L=>L.pz));return X.map((L,D)=>L.toAffine(x[D])).map(U.fromAffine)})}multiplyUnsafe(ne){const X=U.ZERO;if(ne===u)return X;if(q(ne),ne===l)return this;const{endo:x}=T;if(!x)return ce.unsafeLadder(this,ne);let{k1neg:L,k1:D,k2neg:$,k2:V}=x.splitScalar(ne),N=X,j=X,Z=this;for(;D>u||V>u;)D&l&&(N=N.add(Z)),V&l&&(j=j.add(Z)),Z=Z.double(),D>>=l,V>>=l;return L&&(N=N.negate()),$&&(j=j.negate()),j=new U(b.mul(j.px,x.beta),j.py,j.pz),N.add(j)}multiply(ne){q(ne);let X=ne,x,L;const{endo:D}=T;if(D){const{k1neg:$,k1:V,k2neg:N,k2:j}=D.splitScalar(X);let{p:Z,f:Ee}=this.wNAF(V),{p:_e,f:Se}=this.wNAF(j);Z=ce.constTimeNegate($,Z),_e=ce.constTimeNegate(N,_e),_e=new U(b.mul(_e.px,D.beta),_e.py,_e.pz),x=Z.add(_e),L=Ee.add(Se)}else{const{p:$,f:V}=this.wNAF(X);x=$,L=V}return U.normalizeZ([x,L])[0]}multiplyAndAddUnsafe(ne,X,x){const L=U.BASE,D=(V,N)=>N===u||N===l||!V.equals(L)?V.multiplyUnsafe(N):V.multiply(N),$=D(this,X).add(D(ne,x));return $.is0()?void 0:$}toAffine(ne){const{px:X,py:x,pz:L}=this,D=this.is0();ne==null&&(ne=D?b.ONE:b.inv(L));const $=b.mul(X,ne),V=b.mul(x,ne),N=b.mul(L,ne);if(D)return{x:b.ZERO,y:b.ZERO};if(!b.eql(N,b.ONE))throw new Error("invZ was invalid");return{x:$,y:V}}isTorsionFree(){const{h:ne,isTorsionFree:X}=T;if(ne===l)return!0;if(X)return X(U,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ne,clearCofactor:X}=T;return ne===l?this:X?X(U,this):this.multiplyUnsafe(T.h)}toRawBytes(ne=!0){return this.assertValidity(),m(U,this,ne)}toHex(ne=!0){return n.bytesToHex(this.toRawBytes(ne))}}U.BASE=new U(T.Gx,T.Gy,b.ONE),U.ZERO=new U(b.ZERO,b.ONE,b.ZERO);const F=T.nBitLength,ce=(0,t.wNAF)(U,T.endo?Math.ceil(F/2):F);return{CURVE:T,ProjectivePoint:U,normPrivateKeyToScalar:z,weierstrassEquation:A,isWithinCurveOrder:P}}function _(h){const T=(0,t.validateBasic)(h);return n.validateObject(T,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...T})}function R(h){const T=_(h),{Fp:b,n:m}=T,v=b.BYTES+1,A=2*b.BYTES+1;function P(fe){return u<fe&&fe<b.ORDER}function q(fe){return r.mod(fe,m)}function z(fe){return r.invert(fe,m)}const{ProjectivePoint:Y,normPrivateKeyToScalar:W,weierstrassEquation:U,isWithinCurveOrder:F}=f({...T,toBytes(fe,me,Te){const we=me.toAffine(),Fe=b.toBytes(we.x),xe=n.concatBytes;return Te?xe(Uint8Array.from([me.hasEvenY()?2:3]),Fe):xe(Uint8Array.from([4]),Fe,b.toBytes(we.y))},fromBytes(fe){const me=fe.length,Te=fe[0],we=fe.subarray(1);if(me===v&&(Te===2||Te===3)){const Fe=n.bytesToNumberBE(we);if(!P(Fe))throw new Error("Point is not on curve");const xe=U(Fe);let tt;try{tt=b.sqrt(xe)}catch($t){const vt=$t instanceof Error?": "+$t.message:"";throw new Error("Point is not on curve"+vt)}const Xe=(tt&l)===l;return(Te&1)===1!==Xe&&(tt=b.neg(tt)),{x:Fe,y:tt}}else if(me===A&&Te===4){const Fe=b.fromBytes(we.subarray(0,b.BYTES)),xe=b.fromBytes(we.subarray(b.BYTES,2*b.BYTES));return{x:Fe,y:xe}}else throw new Error(`Point of length ${me} was invalid. Expected ${v} compressed bytes or ${A} uncompressed bytes`)}}),ce=fe=>n.bytesToHex(n.numberToBytesBE(fe,T.nByteLength));function se(fe){const me=m>>l;return fe>me}function ne(fe){return se(fe)?q(-fe):fe}const X=(fe,me,Te)=>n.bytesToNumberBE(fe.slice(me,Te));class x{constructor(me,Te,we){this.r=me,this.s=Te,this.recovery=we,this.assertValidity()}static fromCompact(me){const Te=T.nByteLength;return me=(0,i.ensureBytes)("compactSignature",me,Te*2),new x(X(me,0,Te),X(me,Te,2*Te))}static fromDER(me){const{r:Te,s:we}=e.DER.toSig((0,i.ensureBytes)("DER",me));return new x(Te,we)}assertValidity(){if(!F(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!F(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(me){return new x(this.r,this.s,me)}recoverPublicKey(me){const{r:Te,s:we,recovery:Fe}=this,xe=j((0,i.ensureBytes)("msgHash",me));if(Fe==null||![0,1,2,3].includes(Fe))throw new Error("recovery id invalid");const tt=Fe===2||Fe===3?Te+T.n:Te;if(tt>=b.ORDER)throw new Error("recovery id 2 or 3 invalid");const Xe=(Fe&1)===0?"02":"03",ut=Y.fromHex(Xe+ce(tt)),$t=z(tt),vt=q(-xe*$t),zt=q(we*$t),bt=Y.BASE.multiplyAndAddUnsafe(ut,vt,zt);if(!bt)throw new Error("point at infinify");return bt.assertValidity(),bt}hasHighS(){return se(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,q(-this.s),this.recovery):this}toDERRawBytes(){return n.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return n.hexToBytes(this.toCompactHex())}toCompactHex(){return ce(this.r)+ce(this.s)}}const L={isValidPrivateKey(fe){try{return W(fe),!0}catch{return!1}},normPrivateKeyToScalar:W,randomPrivateKey:()=>{const fe=r.getMinHashLength(T.n);return r.mapHashToField(T.randomBytes(fe),T.n)},precompute(fe=8,me=Y.BASE){return me._setWindowSize(fe),me.multiply(BigInt(3)),me}};function D(fe,me=!0){return Y.fromPrivateKey(fe).toRawBytes(me)}function $(fe){const me=n.isBytes(fe),Te=typeof fe=="string",we=(me||Te)&&fe.length;return me?we===v||we===A:Te?we===2*v||we===2*A:fe instanceof Y}function V(fe,me,Te=!0){if($(fe))throw new Error("first arg must be private key");if(!$(me))throw new Error("second arg must be public key");return Y.fromHex(me).multiply(W(fe)).toRawBytes(Te)}const N=T.bits2int||function(fe){const me=n.bytesToNumberBE(fe),Te=fe.length*8-T.nBitLength;return Te>0?me>>BigInt(Te):me},j=T.bits2int_modN||function(fe){return q(N(fe))},Z=n.bitMask(T.nBitLength);function Ee(fe){if(typeof fe!="bigint")throw new Error("bigint expected");if(!(u<=fe&&fe<Z))throw new Error(`bigint expected < 2^${T.nBitLength}`);return n.numberToBytesBE(fe,T.nByteLength)}function _e(fe,me,Te=Se){if(["recovered","canonical"].some(nr=>nr in Te))throw new Error("sign() legacy options not supported");const{hash:we,randomBytes:Fe}=T;let{lowS:xe,prehash:tt,extraEntropy:Xe}=Te;xe==null&&(xe=!0),fe=(0,i.ensureBytes)("msgHash",fe),tt&&(fe=(0,i.ensureBytes)("prehashed msgHash",we(fe)));const ut=j(fe),$t=W(me),vt=[Ee($t),Ee(ut)];if(Xe!=null&&Xe!==!1){const nr=Xe===!0?Fe(b.BYTES):Xe;vt.push((0,i.ensureBytes)("extraEntropy",nr))}const zt=n.concatBytes(...vt),bt=ut;function rr(nr){const ht=N(nr);if(!F(ht))return;const wr=z(ht),M=Y.BASE.multiply(ht).toAffine(),E=q(M.x);if(E===u)return;const I=q(wr*q(bt+E*$t));if(I===u)return;let G=(M.x===E?0:2)|Number(M.y&l),de=I;return xe&&se(I)&&(de=ne(I),G^=1),new x(E,de,G)}return{seed:zt,k2sig:rr}}const Se={lowS:T.lowS,prehash:!1},Ie={lowS:T.lowS,prehash:!1};function ie(fe,me,Te=Se){const{seed:we,k2sig:Fe}=_e(fe,me,Te),xe=T;return n.createHmacDrbg(xe.hash.outputLen,xe.nByteLength,xe.hmac)(we,Fe)}Y.BASE._setWindowSize(8);function le(fe,me,Te,we=Ie){var M;const Fe=fe;if(me=(0,i.ensureBytes)("msgHash",me),Te=(0,i.ensureBytes)("publicKey",Te),"strict"in we)throw new Error("options.strict was renamed to lowS");const{lowS:xe,prehash:tt}=we;let Xe,ut;try{if(typeof Fe=="string"||n.isBytes(Fe))try{Xe=x.fromDER(Fe)}catch(E){if(!(E instanceof e.DER.Err))throw E;Xe=x.fromCompact(Fe)}else if(typeof Fe=="object"&&typeof Fe.r=="bigint"&&typeof Fe.s=="bigint"){const{r:E,s:I}=Fe;Xe=new x(E,I)}else throw new Error("PARSE");ut=Y.fromHex(Te)}catch(E){if(E.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(xe&&Xe.hasHighS())return!1;tt&&(me=T.hash(me));const{r:$t,s:vt}=Xe,zt=j(me),bt=z(vt),rr=q(zt*bt),nr=q($t*bt),ht=(M=Y.BASE.multiplyAndAddUnsafe(ut,rr,nr))==null?void 0:M.toAffine();return ht?q(ht.x)===$t:!1}return{CURVE:T,getPublicKey:D,getSharedSecret:V,sign:ie,verify:le,ProjectivePoint:Y,Signature:x,utils:L}}function w(h,T){const b=h.ORDER;let m=u;for(let se=b-l;se%c===u;se/=c)m+=l;const v=m,A=c<<v-l-l,P=A*c,q=(b-l)/P,z=(q-l)/c,Y=P-l,W=A,U=h.pow(T,q),F=h.pow(T,(q+l)/c);let ce=(se,ne)=>{let X=U,x=h.pow(ne,Y),L=h.sqr(x);L=h.mul(L,ne);let D=h.mul(se,L);D=h.pow(D,z),D=h.mul(D,x),x=h.mul(D,ne),L=h.mul(D,se);let $=h.mul(L,x);D=h.pow($,W);let V=h.eql(D,h.ONE);x=h.mul(L,F),D=h.mul($,X),L=h.cmov(x,L,V),$=h.cmov(D,$,V);for(let N=v;N>l;N--){let j=N-c;j=c<<j-l;let Z=h.pow($,j);const Ee=h.eql(Z,h.ONE);x=h.mul(L,X),X=h.mul(X,X),Z=h.mul($,X),L=h.cmov(x,L,Ee),$=h.cmov(Z,$,Ee)}return{isValid:V,value:L}};if(h.ORDER%p===d){const se=(h.ORDER-d)/p,ne=h.sqrt(h.neg(T));ce=(X,x)=>{let L=h.sqr(x);const D=h.mul(X,x);L=h.mul(L,D);let $=h.pow(L,se);$=h.mul($,D);const V=h.mul($,ne),N=h.mul(h.sqr($),x),j=h.eql(N,X);let Z=h.cmov(V,$,j);return{isValid:j,value:Z}}}return ce}function O(h,T){if(r.validateField(h),!h.isValid(T.A)||!h.isValid(T.B)||!h.isValid(T.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const b=w(h,T.Z);if(!h.isOdd)throw new Error("Fp.isOdd is not implemented!");return m=>{let v,A,P,q,z,Y,W,U;v=h.sqr(m),v=h.mul(v,T.Z),A=h.sqr(v),A=h.add(A,v),P=h.add(A,h.ONE),P=h.mul(P,T.B),q=h.cmov(T.Z,h.neg(A),!h.eql(A,h.ZERO)),q=h.mul(q,T.A),A=h.sqr(P),Y=h.sqr(q),z=h.mul(Y,T.A),A=h.add(A,z),A=h.mul(A,P),Y=h.mul(Y,q),z=h.mul(Y,T.B),A=h.add(A,z),W=h.mul(v,P);const{isValid:F,value:ce}=b(A,Y);U=h.mul(v,m),U=h.mul(U,ce),W=h.cmov(W,P,F),U=h.cmov(U,ce,F);const se=h.isOdd(m)===h.isOdd(U);return U=h.cmov(h.neg(U),U,se),W=h.div(W,q),{x:W,y:U}}}})(Qp)),Qp}var u1;function tV(){if(u1)return Vs;u1=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.getHash=n,Vs.createCurve=i;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=ZH(),t=tu(),r=SC();function n(a){return{hash:a,hmac:(s,...o)=>(0,e.hmac)(a,s,(0,t.concatBytes)(...o)),randomBytes:t.randomBytes}}function i(a,s){const o=u=>(0,r.weierstrass)({...a,...n(u)});return Object.freeze({...o(s),create:o})}return Vs}var Xn={},c1;function rV(){if(c1)return Xn;c1=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.expand_message_xmd=s,Xn.expand_message_xof=o,Xn.hash_to_field=u,Xn.isogenyMap=l,Xn.createHasher=c;const e=rd(),t=ls(),r=t.bytesToNumberBE;function n(d,p){if(d<0||d>=1<<8*p)throw new Error(`bad I2OSP call: value=${d} length=${p}`);const f=Array.from({length:p}).fill(0);for(let _=p-1;_>=0;_--)f[_]=d&255,d>>>=8;return new Uint8Array(f)}function i(d,p){const f=new Uint8Array(d.length);for(let _=0;_<d.length;_++)f[_]=d[_]^p[_];return f}function a(d){if(!Number.isSafeInteger(d))throw new Error("number expected")}function s(d,p,f,_){(0,t.abytes)(d),(0,t.abytes)(p),a(f),p.length>255&&(p=_((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),p)));const{outputLen:R,blockLen:w}=_,O=Math.ceil(f/R);if(O>255)throw new Error("Invalid xmd length");const h=(0,t.concatBytes)(p,n(p.length,1)),T=n(0,w),b=n(f,2),m=new Array(O),v=_((0,t.concatBytes)(T,d,b,n(0,1),h));m[0]=_((0,t.concatBytes)(v,n(1,1),h));for(let P=1;P<=O;P++){const q=[i(v,m[P-1]),n(P+1,1),h];m[P]=_((0,t.concatBytes)(...q))}return(0,t.concatBytes)(...m).slice(0,f)}function o(d,p,f,_,R){if((0,t.abytes)(d),(0,t.abytes)(p),a(f),p.length>255){const w=Math.ceil(2*_/8);p=R.create({dkLen:w}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(p).digest()}if(f>65535||p.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return R.create({dkLen:f}).update(d).update(n(f,2)).update(p).update(n(p.length,1)).digest()}function u(d,p,f){(0,t.validateObject)(f,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:_,k:R,m:w,hash:O,expand:h,DST:T}=f;(0,t.abytes)(d),a(p);const b=typeof T=="string"?(0,t.utf8ToBytes)(T):T,m=_.toString(2).length,v=Math.ceil((m+R)/8),A=p*w*v;let P;if(h==="xmd")P=s(d,b,A,O);else if(h==="xof")P=o(d,b,A,R,O);else if(h==="_internal_pass")P=d;else throw new Error('expand must be "xmd" or "xof"');const q=new Array(p);for(let z=0;z<p;z++){const Y=new Array(w);for(let W=0;W<w;W++){const U=v*(W+z*w),F=P.subarray(U,U+v);Y[W]=(0,e.mod)(r(F),_)}q[z]=Y}return q}function l(d,p){const f=p.map(_=>Array.from(_).reverse());return(_,R)=>{const[w,O,h,T]=f.map(b=>b.reduce((m,v)=>d.add(d.mul(m,_),v)));return _=d.div(w,O),R=d.mul(R,d.div(h,T)),{x:_,y:R}}}function c(d,p,f){if(typeof p!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(_,R){const w=u(_,2,{...f,DST:f.DST,...R}),O=d.fromAffine(p(w[0])),h=d.fromAffine(p(w[1])),T=O.add(h).clearCofactor();return T.assertValidity(),T},encodeToCurve(_,R){const w=u(_,1,{...f,DST:f.encodeDST,...R}),O=d.fromAffine(p(w[0])).clearCofactor();return O.assertValidity(),O},mapToCurve(_){if(!Array.isArray(_))throw new Error("mapToCurve: expected array of bigints");for(const w of _)if(typeof w!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${w} in array`);const R=d.fromAffine(p(_)).clearCofactor();return R.assertValidity(),R}}}return Xn}var l1;function nV(){return l1||(l1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=QH(),r=tu(),n=tV(),i=rV(),a=rd(),s=ls(),o=SC(),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),l=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),c=BigInt(1),d=BigInt(2),p=(x,L)=>(x+L/d)/L;function f(x){const L=u,D=BigInt(3),$=BigInt(6),V=BigInt(11),N=BigInt(22),j=BigInt(23),Z=BigInt(44),Ee=BigInt(88),_e=x*x*x%L,Se=_e*_e*x%L,Ie=(0,a.pow2)(Se,D,L)*Se%L,ie=(0,a.pow2)(Ie,D,L)*Se%L,le=(0,a.pow2)(ie,d,L)*_e%L,fe=(0,a.pow2)(le,V,L)*le%L,me=(0,a.pow2)(fe,N,L)*fe%L,Te=(0,a.pow2)(me,Z,L)*me%L,we=(0,a.pow2)(Te,Ee,L)*Te%L,Fe=(0,a.pow2)(we,Z,L)*me%L,xe=(0,a.pow2)(Fe,D,L)*Se%L,tt=(0,a.pow2)(xe,j,L)*fe%L,Xe=(0,a.pow2)(tt,$,L)*_e%L,ut=(0,a.pow2)(Xe,d,L);if(!_.eql(_.sqr(ut),x))throw new Error("Cannot find square root");return ut}const _=(0,a.Field)(u,void 0,void 0,{sqrt:f});e.secp256k1=(0,n.createCurve)({a:BigInt(0),b:BigInt(7),Fp:_,n:l,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:x=>{const L=l,D=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),$=-c*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),V=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),N=D,j=BigInt("0x100000000000000000000000000000000"),Z=p(N*x,L),Ee=p(-$*x,L);let _e=(0,a.mod)(x-Z*D-Ee*V,L),Se=(0,a.mod)(-Z*$-Ee*N,L);const Ie=_e>j,ie=Se>j;if(Ie&&(_e=L-_e),ie&&(Se=L-Se),_e>j||Se>j)throw new Error("splitScalar: Endomorphism failed, k="+x);return{k1neg:Ie,k1:_e,k2neg:ie,k2:Se}}}},t.sha256);const R=BigInt(0),w=x=>typeof x=="bigint"&&R<x&&x<u,O=x=>typeof x=="bigint"&&R<x&&x<l,h={};function T(x,...L){let D=h[x];if(D===void 0){const $=(0,t.sha256)(Uint8Array.from(x,V=>V.charCodeAt(0)));D=(0,s.concatBytes)($,$),h[x]=D}return(0,t.sha256)((0,s.concatBytes)(D,...L))}const b=x=>x.toRawBytes(!0).slice(1),m=x=>(0,s.numberToBytesBE)(x,32),v=x=>(0,a.mod)(x,u),A=x=>(0,a.mod)(x,l),P=e.secp256k1.ProjectivePoint,q=(x,L,D)=>P.BASE.multiplyAndAddUnsafe(x,L,D);function z(x){let L=e.secp256k1.utils.normPrivateKeyToScalar(x),D=P.fromPrivateKey(L);return{scalar:D.hasEvenY()?L:A(-L),bytes:b(D)}}function Y(x){if(!w(x))throw new Error("bad x: need 0 < x < p");const L=v(x*x),D=v(L*x+BigInt(7));let $=f(D);$%d!==R&&($=v(-$));const V=new P(x,$,c);return V.assertValidity(),V}function W(...x){return A((0,s.bytesToNumberBE)(T("BIP0340/challenge",...x)))}function U(x){return z(x).bytes}function F(x,L,D=(0,r.randomBytes)(32)){const $=(0,s.ensureBytes)("message",x),{bytes:V,scalar:N}=z(L),j=(0,s.ensureBytes)("auxRand",D,32),Z=m(N^(0,s.bytesToNumberBE)(T("BIP0340/aux",j))),Ee=T("BIP0340/nonce",Z,V,$),_e=A((0,s.bytesToNumberBE)(Ee));if(_e===R)throw new Error("sign failed: k is zero");const{bytes:Se,scalar:Ie}=z(_e),ie=W(Se,V,$),le=new Uint8Array(64);if(le.set(Se,0),le.set(m(A(Ie+ie*N)),32),!ce(le,$,V))throw new Error("sign: Invalid signature produced");return le}function ce(x,L,D){const $=(0,s.ensureBytes)("signature",x,64),V=(0,s.ensureBytes)("message",L),N=(0,s.ensureBytes)("publicKey",D,32);try{const j=Y((0,s.bytesToNumberBE)(N)),Z=(0,s.bytesToNumberBE)($.subarray(0,32));if(!w(Z))return!1;const Ee=(0,s.bytesToNumberBE)($.subarray(32,64));if(!O(Ee))return!1;const _e=W(m(Z),b(j),V),Se=q(j,Ee,A(-_e));return!(!Se||!Se.hasEvenY()||Se.toAffine().x!==Z)}catch{return!1}}e.schnorr={getPublicKey:U,sign:F,verify:ce,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:Y,pointToBytes:b,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:T,mod:a.mod}};const se=(0,i.isogenyMap)(_,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(x=>x.map(L=>BigInt(L)))),ne=(0,o.mapToCurveSimpleSWU)(_,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:_.create(BigInt("-11"))}),X=(0,i.createHasher)(e.secp256k1.ProjectivePoint,x=>{const{x:L,y:D}=ne(_.create(x[0]));return se(L,D)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:_.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=X.hashToCurve,e.encodeToCurve=X.encodeToCurve})(Kp)),Kp}var d1;function iV(){return d1||(d1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=nV();Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(xp)),xp}var f1;function aV(){if(f1)return fn;f1=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.recoverPublicKey=r,fn.recoverAddressFromEthSignature=i,fn.sign=a,fn.createEthereumMessageHash=s,fn.ethSign=o,fn.computeAddress=u,fn.createUnsafeIdentity=l;const e=td(),t=iV();function r(c,d){if(c.length!==65)throw new Error("Invalid signature length "+c.length);const p=c[64];if(p!==27&&p!==28)throw new Error(`Invalid signature recovery value: ${p}. Expected 27 or 28.`);const f=c.slice(0,c.length-1),_=p===28?1:0;return t.secp256k1.Signature.fromCompact(f).addRecoveryBit(_).recoverPublicKey(d).toRawBytes(!1).slice(1)}function n(c){if(c.length!==65)throw new Error("Invalid ethereum signature");const d=c[64];if(d===0||d===1){const p=new Uint8Array(c);return p[64]=d+27,p}return c}function i(c,d){if(typeof c=="string"){if((0,e.isHex)(c))return i((0,e.hexToBytes)(c),d);throw new Error("String signatures must be encoded in hex")}return u(r(n(c),s(d)))}function a(c,d){const p=t.secp256k1.sign(d,c),f=p.recovery===1?"1c":"1b";return"0x"+p.toCompactHex()+f}function s(c){const d=typeof c=="string"?(0,e.stringToUtf8Bytes)(c):c,p=(0,e.concatBytes)((0,e.stringToUtf8Bytes)(`Ethereum Signed Message:
|
|
70
70
|
`),(0,e.stringToUtf8Bytes)(String(d.length)),d);return(0,e.hexToBytes)((0,e.sha3)(p))}function o(c,d){return a(c,s(d))}function u(c){let d;if(c.length===65&&c[0]===4)d=c.slice(1);else if(c.length===64)d=c;else throw new Error(`Invalid public key length: ${c.length}. Expected 64 bytes, or 65 bytes with a leading 0x04 uncompressed prefix.`);return(0,e.getAddress)((0,e.sha3)(d).substring(24))}function l(){const c=t.secp256k1.utils.randomPrivateKey(),d=t.secp256k1.getPublicKey(c,!1).slice(1),p=u(d);return{privateKey:(0,e.bytesToHex)(c),publicKey:(0,e.bytesToHex)(d),address:p}}return fn}var il={},p1;function sV(){if(p1)return il;p1=1,Object.defineProperty(il,"__esModule",{value:!0});const e=td();class t{constructor(n,i=!0){Yn(this,"requestManager");Yn(this,"checkedBlocks");Yn(this,"saveBlocks");Yn(this,"savedBlocks");Yn(this,"requests");Yn(this,"blockTime");Yn(this,"firstTimestamp");this.requestManager=n,this.checkedBlocks={},this.saveBlocks=i,this.savedBlocks={},this.requests=0}async fillBlockTime(){const n=await this.getBlockWrapper("latest"),i=await this.getBlockWrapper(1);return this.blockTime=(n.timestamp-i.timestamp)/(Number(n.number)-1),this.firstTimestamp=i.timestamp,{blockTime:this.blockTime,firstTimestamp:this.firstTimestamp}}async getDate(n,i=!0){const a=n/1e3,s=Date.now()/1e3;let o=this.firstTimestamp,u=this.blockTime;if((o===void 0||u===void 0)&&({firstTimestamp:o,blockTime:u}=await this.fillBlockTime()),a<o)return{block:1,timestamp:a};const l=this.savedBlocks.latest;if(a>=s||l&&a>l.timestamp)return{block:(0,e.toBigNumber)(await this.requestManager.eth_blockNumber()).toNumber(),timestamp:a};this.checkedBlocks[a]=[];const c=await this.getBlockWrapper(Math.ceil((a-o)/u));return{block:await this.findBetter(a,c,i,u),timestamp:a}}async findBetter(n,i,a,s){let o=s??this.blockTime??(await this.fillBlockTime()).blockTime;if(await this.isBetterBlock(n,i,a))return i.number;const u=n-i.timestamp;let l=Math.ceil(u/o);l===0&&(l=u<0?-1:1);const c=await this.getBlockWrapper(this.getNextBlock(n,i.number,l));return o=Math.abs((i.timestamp-c.timestamp)/(i.number-c.number)),this.findBetter(n,c,a,o)}async isBetterBlock(n,i,a){const s=i.timestamp;if(a){if(s<n)return!1;const o=await this.getBlockWrapper(i.number-1);if(s>=n&&o.timestamp<n)return!0}else{if(s>=n)return!1;const o=await this.getBlockWrapper(i.number+1);if(s<n&&o.timestamp>=n)return!0}return!1}getNextBlock(n,i,a){const s=i+a;if(this.checkedBlocks[n].includes(s)){const o=a<0?a+1:a-1;if(o===0)throw new Error(`Could not find an unchecked block for timestamp ${n}`);return this.getNextBlock(n,i,o)}return this.checkedBlocks[n].push(s),s}async getBlockWrapper(n){if(!this.saveBlocks){const s=await this.requestManager.eth_getBlockByNumber(n,!1);return{number:(0,e.toBigNumber)(s.number).toNumber(),timestamp:(0,e.toBigNumber)(s.timestamp).toNumber()}}const i=n.toString();if(this.savedBlocks[i])return this.savedBlocks[i];if(typeof n=="number"&&this.savedBlocks.latest&&this.savedBlocks.latest.number<=n)return this.savedBlocks.latest;const{timestamp:a}=await this.requestManager.eth_getBlockByNumber(n,!1);return this.savedBlocks[i]={number:(0,e.toBigNumber)(n==="latest"?await this.requestManager.eth_blockNumber():n).toNumber(),timestamp:(0,e.toBigNumber)(a).toNumber()},this.requests++,this.savedBlocks[i]}}return il.default=t,il}var al={},m1;function oV(){if(m1)return al;m1=1,Object.defineProperty(al,"__esModule",{value:!0}),al.moveMinutes=e;function e(t){const r=new Date;return r.setMinutes(r.getMinutes()+t),r}return al}var Zp={},Vr={},Di={},ji={},em={},Gr={},h1;function Ne(){if(h1)return Gr;h1=1;var e=Gr&&Gr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.validateType=Gr.generateLazyValidator=Gr.Ajv=void 0;const t=e(F_());Gr.Ajv=t.default;const r=e(KP()),n=e(XP());function i(s,o){let u=null;const l=(c,d)=>{if(!u){const p=new t.default({$data:!0,allErrors:!0});(0,r.default)(p),(0,n.default)(p,{singleError:!0}),o==null||o.forEach(f=>p.addKeyword(f)),u=p.compile(s),Object.defineProperty(l,"errors",{get(){return u==null?void 0:u.errors}})}return u(c,d)};return l}Gr.generateLazyValidator=i;function a(s,o){return s.validate(o)}return Gr.validateType=a,Gr}var y1;function uV(){return y1||(y1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SceneUpdate=e.SCENE_UPDATE=void 0;const t=Ne();e.SCENE_UPDATE="SCENE_UPDATE",(function(r){r.schema={type:"object",properties:{type:{type:"string",enum:[e.SCENE_UPDATE]},payload:{type:"object",properties:{sceneId:{type:"string"},sceneType:{type:"string"}},additionalProperties:!1,required:["sceneId","sceneType"]}},required:["payload","type"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.SceneUpdate||(e.SceneUpdate={}))})(em)),em}var tm={},g1;function cV(){return g1||(g1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Update=e.UPDATE=void 0;const t=Ne();e.UPDATE="update",(function(r){r.schema={type:"object",properties:{type:{type:"string",enum:[e.UPDATE]}},required:["type"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Update||(e.Update={}))})(tm)),tm}var _1;function lV(){return _1||(_1=1,(function(e){var t=ji&&ji.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=ji&&ji.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(uV(),e),r(cV(),e)})(ji)),ji}var Li={},rm={},E1;function dV(){return E1||(E1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectType=void 0;const t=Ne();(function(r){r.SCENE="scene",r.SMART_ITEM="smart-item",r.PORTABLE_EXPERIENCE="portable-experience",r.LIBRARY="library"})(e.ProjectType||(e.ProjectType={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.ProjectType||(e.ProjectType={}))})(rm)),rm}var nm={},im={},v1;function nd(){return v1||(v1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Rarity=void 0;const t=Ne();(function(r){r.UNIQUE="unique",r.MYTHIC="mythic",r.EXOTIC="exotic",r.LEGENDARY="legendary",r.EPIC="epic",r.RARE="rare",r.UNCOMMON="uncommon",r.COMMON="common"})(e.Rarity||(e.Rarity={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema);const n={[r.UNIQUE]:1,[r.MYTHIC]:10,[r.EXOTIC]:50,[r.LEGENDARY]:100,[r.EPIC]:1e3,[r.RARE]:5e3,[r.UNCOMMON]:1e4,[r.COMMON]:1e5},i={[r.UNIQUE]:"#FFE617",[r.MYTHIC]:"#FB7DE3",[r.EXOTIC]:"#E4FFB8",[r.LEGENDARY]:"#A657ED",[r.EPIC]:"#6397F2",[r.RARE]:"#3AD682",[r.UNCOMMON]:"#FF8563",[r.COMMON]:"#D4E0E0"},a={[r.UNIQUE]:"#FFB626",[r.MYTHIC]:"#FF63E1",[r.EXOTIC]:"#CAFF73",[r.LEGENDARY]:"#842DDA",[r.EPIC]:"#3D85E6",[r.RARE]:"#36CF75",[r.UNCOMMON]:"#ED6D4F",[r.COMMON]:"#ABC1C1"};function s(c){return n[c]}r.getMaxSupply=s;function o(c){return a[c]}r.getColor=o;function u(){return[r.UNIQUE,r.MYTHIC,r.EXOTIC,r.LEGENDARY,r.EPIC,r.RARE,r.UNCOMMON,r.COMMON]}r.getRarities=u;function l(c){return[i[c],a[c]]}r.getGradient=l})(e.Rarity||(e.Rarity={}))})(im)),im}var am={},b1;function Sa(){return b1||(b1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WearableCategory=void 0;const t=Ne();(function(r){r.EYEBROWS="eyebrows",r.EYES="eyes",r.FACIAL_HAIR="facial_hair",r.HAIR="hair",r.BODY_SHAPE="body_shape",r.MOUTH="mouth",r.UPPER_BODY="upper_body",r.LOWER_BODY="lower_body",r.FEET="feet",r.EARRING="earring",r.EYEWEAR="eyewear",r.HAT="hat",r.HELMET="helmet",r.MASK="mask",r.TIARA="tiara",r.TOP_HEAD="top_head",r.SKIN="skin",r.HANDS_WEAR="hands_wear"})(e.WearableCategory||(e.WearableCategory={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.WearableCategory||(e.WearableCategory={}))})(am)),am}var sm={},om={},T1;function Z_(){return T1||(T1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BodyShape=void 0;const t=Ne();(function(r){r.MALE="urn:decentraland:off-chain:base-avatars:BaseMale",r.FEMALE="urn:decentraland:off-chain:base-avatars:BaseFemale"})(e.BodyShape||(e.BodyShape={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.BodyShape||(e.BodyShape={}))})(om)),om}var um={},cm={},S1;function IC(){return S1||(S1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BodyPartCategory=void 0;const t=Ne();(function(r){r.HEAD="head",r.HANDS="hands"})(e.BodyPartCategory||(e.BodyPartCategory={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.BodyPartCategory||(e.BodyPartCategory={}))})(cm)),cm}var I1;function eE(){return I1||(I1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HideableWearableCategory=void 0;const t=Sa(),r=Ne(),n=IC();(function(i){i.schema={oneOf:[Object.assign({},t.WearableCategory.schema),Object.assign({},n.BodyPartCategory.schema)]},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.HideableWearableCategory||(e.HideableWearableCategory={}))})(um)),um}var R1;function tE(){return R1||(R1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WearableRepresentation=void 0;const t=Ne(),r=Z_(),n=eE();(function(i){i.schema={type:"object",properties:{bodyShapes:{type:"array",items:r.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}}},overrideHides:{type:"array",items:n.HideableWearableCategory.schema},overrideReplaces:{type:"array",items:n.HideableWearableCategory.schema}},required:["bodyShapes","mainFile","contents","overrideHides","overrideReplaces"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.WearableRepresentation||(e.WearableRepresentation={}))})(sm)),sm}var $i={},qi={},lm={},dm={},w1;function Ia(){return w1||(w1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IPFSv1=e.IPFSv2=e.EthAddress=e.Color3=void 0;const t=Ne();(function(r){r.schema={type:"object",required:["r","g","b"],properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}}};const n=(0,t.generateLazyValidator)(r.schema);r.validate=i=>n(i)})(e.Color3||(e.Color3={})),(function(r){r.schema={type:"string",pattern:"^0x[a-fA-F0-9]{40}$"};const n=new RegExp(r.schema.pattern);r.validate=i=>n.test(i)})(e.EthAddress||(e.EthAddress={})),(function(r){r.schema={type:"string",pattern:"^(ba)[a-zA-Z0-9]{57}$"};const n=new RegExp(r.schema.pattern);r.validate=i=>n.test(i)})(e.IPFSv2||(e.IPFSv2={})),(function(r){r.schema={type:"string",pattern:"^(Qm)[a-zA-Z0-9]{44}$"};const n=new RegExp(r.schema.pattern);r.validate=i=>n.test(i)})(e.IPFSv1||(e.IPFSv1={}))})(dm)),dm}var A1;function RC(){return A1||(A1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Avatar=e.Link=e.LinkUrl=e.AvatarInfo=e.Snapshots=void 0;const t=Sa(),r=Ia(),n=Ne();var i;(function(u){u.schema={type:"object",required:["face256","body"],properties:{face256:r.IPFSv2.schema,body:r.IPFSv2.schema}},u.validate=(0,n.generateLazyValidator)(u.schema)})(i=e.Snapshots||(e.Snapshots={}));var a;(function(u){u.schema={type:"object",required:["bodyShape","eyes","hair","skin"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:r.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:r.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:r.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:t.WearableCategory.schema},emotes:{type:"array",items:{type:"object",properties:{slot:{type:"number"},urn:{type:"string"}},required:["slot","urn"]},nullable:!0},snapshots:Object.assign(Object.assign({},i.schema),{nullable:!0})},additionalProperties:!0},u.validate=(0,n.generateLazyValidator)(u.schema)})(a=e.AvatarInfo||(e.AvatarInfo={}));var s;(function(u){u.schema={type:"string",maxLength:2083,pattern:"^(?:https?):\\/\\/[^\\s/$.?#].[^\\s]*$"};const l=new RegExp(u.schema.pattern,"i");u.validate=c=>l.test(c)})(s=e.LinkUrl||(e.LinkUrl={}));var o;(function(u){u.schema={type:"object",required:["title","url"],properties:{title:{type:"string"},url:s.schema}}})(o=e.Link||(e.Link={})),(function(u){u.schema={type:"object",required:["name","description","ethAddress","version","tutorialStep","avatar","hasClaimedName"],properties:{userId:{type:"string"},name:{type:"string"},nameColor:Object.assign(Object.assign({},r.Color3.schema),{nullable:!0}),description:{type:"string"},links:{type:"array",maxItems:5,items:o.schema,nullable:!0},country:{nullable:!0,type:"string"},employmentStatus:{nullable:!0,type:"string"},gender:{nullable:!0,type:"string"},pronouns:{nullable:!0,type:"string"},relationshipStatus:{nullable:!0,type:"string"},sexualOrientation:{nullable:!0,type:"string"},language:{nullable:!0,type:"string"},profession:{nullable:!0,type:"string"},birthdate:{nullable:!0,type:"number"},realName:{nullable:!0,type:"string"},hobbies:{nullable:!0,type:"string"},ethAddress:r.EthAddress.schema,version:{type:"number"},tutorialStep:{type:"number"},email:{type:"string",nullable:!0},blocked:{type:"array",items:{type:"string"},nullable:!0},muted:{type:"array",items:{type:"string"},nullable:!0},interests:{type:"array",items:{type:"string"},nullable:!0},hasClaimedName:{type:"boolean"},hasConnectedWeb3:{type:"boolean",nullable:!0},avatar:a.schema},additionalProperties:!0},u.validate=(0,n.generateLazyValidator)(u.schema)})(e.Avatar||(e.Avatar={}))})(lm)),lm}var fm={},O1;function fV(){return O1||(O1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Profile=void 0;const t=Ne(),r=RC();(function(n){n.schema={type:"object",required:["avatars"],properties:{avatars:{type:"array",items:r.Avatar.schema}},additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.Profile||(e.Profile={}))})(fm)),fm}var N1;function pV(){return N1||(N1=1,(function(e){var t=qi&&qi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=qi&&qi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(RC(),e),r(fV(),e)})(qi)),qi}var pm={},mm={},P1;function wC(){return P1||(P1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureToggles=e.portableExperiencesToggles=e.toggles=void 0;const t=Ne();e.toggles=["enabled","disabled"],e.portableExperiencesToggles=[...e.toggles,"hideUi"],(function(r){r.schema={type:"object",properties:{voiceChat:{type:"string",enum:e.toggles,nullable:!0},portableExperiences:{type:"string",enum:e.portableExperiencesToggles,nullable:!0,errorMessage:`valid options are ${e.portableExperiencesToggles.join(", ")}`}},errorMessage:`valid options are ${e.toggles.join(", ")}`,required:[]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.FeatureToggles||(e.FeatureToggles={}))})(mm)),mm}var hm={},C1;function AC(){return C1||(C1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorldConfiguration=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{name:{type:"string",nullable:!0},skybox:{type:"number",nullable:!0},minimapVisible:{type:"boolean",nullable:!0},miniMapConfig:{type:"object",nullable:!0,properties:{visible:{type:"boolean",nullable:!0},dataImage:{type:"string",nullable:!0},estateImage:{type:"string",nullable:!0}}},skyboxConfig:{type:"object",nullable:!0,properties:{fixedTime:{type:"number",nullable:!0},textures:{type:"array",nullable:!0,items:{type:"string"},oneOf:[{minItems:0,maxItems:0},{minItems:1,maxItems:1},{minItems:6,maxItems:6}],errorMessage:"customSkybox must be an array of 0, 1 or 6 strings"}}},fixedAdapter:{type:"string",nullable:!0},placesConfig:{type:"object",nullable:!0,properties:{optOut:{type:"boolean",nullable:!0}}}},required:[]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.WorldConfiguration||(e.WorldConfiguration={}))})(hm)),hm}var ym={},M1;function OC(){return M1||(M1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SceneParcels=void 0;const t=Ne();(function(r){r.schema={description:'Describes a scene, a set of parcels whose content is treated as the same entity. A list of parcels is listed, for which one of them is considered the "base" for positioning purposes.',type:"object",properties:{base:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},parcels:{type:"array",items:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},minItems:1}},additionalProperties:!0,required:["base","parcels"]},r.schemaValidator=(0,t.generateLazyValidator)(r.schema),r.validate=n=>r.schemaValidator(n)&&n.parcels.includes(n.base)})(e.SceneParcels||(e.SceneParcels={}))})(ym)),ym}var gm={},zs={},D1;function rE(){return D1||(D1=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.displayableProperties=void 0,zs.displayableProperties={menuBarIcon:{description:"Name of the file used as icon for the MenuBar",type:"string",nullable:!0}}),zs}var _m={},j1;function NC(){return j1||(j1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Source=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{version:{type:"number",nullable:!0},origin:{type:"string"},projectId:{type:"string"},point:{type:"object",properties:{x:{type:"integer"},y:{type:"integer"}},nullable:!0,required:["x","y"]},rotation:{type:"string",enum:["north","east","south","west"],nullable:!0},layout:{type:"object",properties:{rows:{type:"integer"},cols:{type:"integer"}},nullable:!0,required:["rows","cols"]},isEmpty:{type:"boolean",nullable:!0}},additionalProperties:!0,required:["origin","projectId"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Source||(e.Source={}))})(_m)),_m}var Em={},L1;function PC(){return L1||(L1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpawnPoint=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{name:{type:"string",nullable:!0},position:{type:"object",oneOf:[{$ref:"#single-position"},{$ref:"#multi-position"}],required:["x","y","z"]},default:{type:"boolean",nullable:!0},cameraTarget:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],nullable:!0}},required:["position"],definitions:{"single-position":{$id:"#single-position",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"]},"multi-position":{$id:"#multi-position",type:"object",properties:{x:{type:"array",items:{type:"number"},minItems:1},y:{type:"array",items:{type:"number"},minItems:1},z:{type:"array",items:{type:"number"},minItems:1}},required:["x","y","z"]}}},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.SpawnPoint||(e.SpawnPoint={}))})(Em)),Em}var $1;function mV(){return $1||($1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=e.RequiredPermission=void 0;const t=Ne(),r=rE(),n=wC(),i=OC(),a=NC(),s=PC(),o=AC();var u;(function(l){l.ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE="ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE",l.ALLOW_TO_TRIGGER_AVATAR_EMOTE="ALLOW_TO_TRIGGER_AVATAR_EMOTE",l.ALLOW_MEDIA_HOSTNAMES="ALLOW_MEDIA_HOSTNAMES",l.USE_WEB3_API="USE_WEB3_API",l.USE_FETCH="USE_FETCH",l.USE_WEBSOCKET="USE_WEBSOCKET",l.OPEN_EXTERNAL_LINK="OPEN_EXTERNAL_LINK"})(u=e.RequiredPermission||(e.RequiredPermission={})),(function(l){l.schema={type:"object",properties:Object.assign(Object.assign({isPortableExperience:{description:"Define the current scene as a Portable Experience",type:"boolean",nullable:!0},main:{description:"File that contains the entry point of the scene's code",type:"string",minLength:1},scene:i.SceneParcels.schema},r.displayableProperties),{display:{description:"Information related to how should this land be displayed apart from the normal rendering of the scene",type:"object",properties:{title:{description:"A name so other users can identify what the contents of this land should be",type:"string",nullable:!0},favicon:{description:"DEPRECATED. Allow the land owner to set up a favicon to this land",type:"string",nullable:!0},description:{description:"A description that will be shown on client's nav map when the scene is selected",type:"string",nullable:!0},navmapThumbnail:{type:"string",nullable:!0}},nullable:!0,required:[]},owner:{type:"string",nullable:!0},creator:{type:"string",nullable:!0,description:"Wallet address of the creator of the scene",pattern:"^(0x[a-fA-F0-9]{40})?$",errorMessage:"Creator must be a valid wallet address"},contact:{description:"Describe different ways of contacting the land owner",type:"object",properties:{name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},im:{type:"string",nullable:!0},url:{type:"string",nullable:!0}},nullable:!0,required:[]},tags:{type:"array",items:{type:"string",minLength:1},nullable:!0},source:Object.assign(Object.assign({},a.Source.schema),{nullable:!0}),spawnPoints:{type:"array",items:s.SpawnPoint.schema,nullable:!0},requiredPermissions:{type:"array",items:{type:"string",enum:Object.values(u)},uniqueItems:!0,nullable:!0},featureToggles:Object.assign(Object.assign({},n.FeatureToggles.schema),{nullable:!0}),worldConfiguration:Object.assign(Object.assign({},o.WorldConfiguration.schema),{nullable:!0}),allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!0}}),additionalProperties:!0,required:["main","scene"],dependencies:{requiredPermissions:{if:{properties:{requiredPermissions:{type:"array",contains:{const:u.ALLOW_MEDIA_HOSTNAMES}}}},then:{properties:{allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!1,minItems:1}},required:["allowedMediaHostnames"]},else:{properties:{allowedMediaHostnames:{type:["null","array"],nullable:!0,maxItems:0}}}}}},l.validate=(0,t.generateLazyValidator)(l.schema)})(e.Scene||(e.Scene={}))})(gm)),gm}var q1;function hV(){return q1||(q1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpawnPoint=e.Source=e.RequiredPermission=e.Scene=e.SceneParcels=e.WorldConfiguration=e.FeatureToggles=void 0;var t=wC();Object.defineProperty(e,"FeatureToggles",{enumerable:!0,get:function(){return t.FeatureToggles}});var r=AC();Object.defineProperty(e,"WorldConfiguration",{enumerable:!0,get:function(){return r.WorldConfiguration}});var n=OC();Object.defineProperty(e,"SceneParcels",{enumerable:!0,get:function(){return n.SceneParcels}});var i=mV();Object.defineProperty(e,"Scene",{enumerable:!0,get:function(){return i.Scene}}),Object.defineProperty(e,"RequiredPermission",{enumerable:!0,get:function(){return i.RequiredPermission}});var a=NC();Object.defineProperty(e,"Source",{enumerable:!0,get:function(){return a.Source}});var s=PC();Object.defineProperty(e,"SpawnPoint",{enumerable:!0,get:function(){return s.SpawnPoint}})})(pm)),pm}var Bi={},vm={},bm={},B1;function CC(){return B1||(B1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Locale=void 0;const t=Ne();(function(r){r.EN="en",r.ES="es"})(e.Locale||(e.Locale={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Locale||(e.Locale={}))})(bm)),bm}var k1;function MC(){return k1||(k1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.I18N=void 0;const t=Ne(),r=CC();(function(n){n.schema={type:"object",properties:{code:r.Locale.schema,text:{type:"string"}},additionalProperties:!0,required:["code","text"]},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.I18N||(e.I18N={}))})(vm)),vm}var Tm={},U1;function DC(){return U1||(U1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metrics=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{triangles:{type:"number"},materials:{type:"number"},textures:{type:"number"},meshes:{type:"number"},bodies:{type:"number"},entities:{type:"number"}},required:["triangles","materials","textures","meshes","bodies","entities"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Metrics||(e.Metrics={}))})(Tm)),Tm}var Sm={},F1;function nE(){return F1||(F1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isStandard=e.standardProperties=void 0;const t=nd(),r=Ne();e.standardProperties={collectionAddress:{type:"string",nullable:!1},rarity:t.Rarity.schema};const n={type:"object",properties:Object.assign({},e.standardProperties),required:["collectionAddress","rarity"]},i=(0,r.generateLazyValidator)(n);function a(s){return i(s)}e.isStandard=a})(Sm)),Sm}var Im={},ki={},Rm={},H1;function yV(){return H1||(H1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MerkleProof=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{proof:{type:"array",items:{type:"string"}},index:{type:"number"},hashingKeys:{type:"array",items:{type:"string"}},entityHash:{type:"string"}},required:["entityHash","hashingKeys","index","proof"],additionalProperties:!0},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.MerkleProof||(e.MerkleProof={}))})(Rm)),Rm}var V1;function jC(){return V1||(V1=1,(function(e){var t=ki&&ki.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=ki&&ki.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(yV(),e)})(ki)),ki}var wm={},G1;function iE(){return G1||(G1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMappingsHelper=e.AddMappingError=e.Mappings=e.Mapping=e.MultipleMapping=e.RangeMapping=e.AnyMapping=e.SingleMapping=e.ContractNetwork=e.MappingType=void 0;const t=Ne();var r;(function(d){d.SINGLE="single",d.ANY="any",d.MULTIPLE="multiple",d.RANGE="range"})(r=e.MappingType||(e.MappingType={}));var n;(function(d){d.MAINNET="mainnet",d.BASE_MAINNET="base_mainnet",d.BASE_SEPOLIA="base_sepolia",d.MONAD_MAINNET="monad_mainnet",d.MONAD_TESTNET="monad_testnet",d.APE_MAINNET="ape_mainnet",d.APE_CALDERA="ape_caldera",d.MATIC="matic",d.SEPOLIA="sepolia",d.AMOY="amoy"})(n=e.ContractNetwork||(e.ContractNetwork={}));var i;(function(d){d.schema={type:"object",properties:{type:{type:"string",const:r.SINGLE},id:{type:"string",pattern:"^[0-9]+$"}},required:["type","id"],additionalProperties:!1},d.validate=(0,t.generateLazyValidator)(d.schema)})(i=e.SingleMapping||(e.SingleMapping={}));var a;(function(d){d.schema={type:"object",properties:{type:{type:"string",const:r.ANY}},required:["type"],additionalProperties:!1},d.validate=(0,t.generateLazyValidator)(d.schema)})(a=e.AnyMapping||(e.AnyMapping={}));var s;(function(d){d._fromLessThanOrEqualTo={keyword:"_fromLessThanOrEqualTo",validate:function(f,_){if(!_||!_.from||!_.to)return!1;let{to:R,from:w}=_;return(typeof w!="bigint"||typeof R!="bigint")&&(w=BigInt(w),R=BigInt(R)),w<=R},errors:!1},d.schema={type:"object",properties:{type:{type:"string",const:r.RANGE},from:{type:"string",pattern:"^[0-9]+$"},to:{type:"string",pattern:"^[0-9]+$"}},required:["type","from","to"],additionalProperties:!1,_fromLessThanOrEqualTo:!0},d.validate=(0,t.generateLazyValidator)(d.schema,[d._fromLessThanOrEqualTo])})(s=e.RangeMapping||(e.RangeMapping={}));var o;(function(d){d.schema={type:"object",properties:{type:{type:"string",const:r.MULTIPLE},ids:{type:"array",items:{type:"string",pattern:"^[0-9]+$"},minItems:1,uniqueItems:!0}},required:["type","ids"],additionalProperties:!1},d.validate=(0,t.generateLazyValidator)(d.schema)})(o=e.MultipleMapping||(e.MultipleMapping={}));var u;(function(d){d.schema={type:"object",properties:{type:{type:"string",enum:Object.values(r)}},required:["type"],oneOf:[i.schema,a.schema,s.schema,o.schema]},d.validate=(0,t.generateLazyValidator)(d.schema,[s._fromLessThanOrEqualTo])})(u=e.Mapping||(e.Mapping={})),(function(d){d._isMappingsValid={keyword:"_isMappingsValid",validate:function(f,_){try{c(_)}catch{return!1}return!0},errors:!1},d.innerSchema={type:"object",patternProperties:{"^0x[0-9a-fA-F]{40}$":{type:"array",items:u.schema}},minProperties:1,required:[],additionalProperties:!1};const p=Object.values(n).reduce((f,_)=>(f[_]=d.innerSchema,f),{});d.schema={type:"object",properties:p,minProperties:1,additionalProperties:!1,_isMappingsValid:!0},d.validate=(0,t.generateLazyValidator)(d.schema,[s._fromLessThanOrEqualTo,d._isMappingsValid])})(e.Mappings||(e.Mappings={}));class l extends Error{constructor(p,f,_){super(p),this.existingMapping=f,this.conflictingMapping=_}}e.AddMappingError=l;function c(d={}){const p={};for(const[m,v]of Object.entries(d)){p[m]={};for(const[A,P]of Object.entries(v))for(const q of P)T(m,A,q)}function f(){return JSON.parse(JSON.stringify(p))}function _(m,v,A){const P=BigInt(m);return P>=BigInt(v)&&P<=BigInt(A)}function R(m,v){switch(v.type){case r.SINGLE:return m.id===v.id;case r.MULTIPLE:return v.ids.includes(m.id);case r.RANGE:return _(m.id,v.from,v.to);default:return!1}}function w(m,v){switch(v.type){case r.SINGLE:return m.ids.includes(v.id);case r.MULTIPLE:return m.ids.some(A=>v.ids.includes(A));case r.RANGE:return m.ids.some(A=>_(A,v.from,v.to));default:return!1}}function O(m,v){switch(v.type){case r.SINGLE:return _(v.id,m.from,m.to);case r.MULTIPLE:return v.ids.some(A=>_(A,m.from,m.to));case r.RANGE:return BigInt(m.from)<=BigInt(v.to)&&BigInt(m.to)>=BigInt(v.from)}}function h(m,v){if(m.type===r.ANY||v.type===r.ANY)return!0;switch(m.type){case r.SINGLE:return R(m,v);case r.MULTIPLE:return w(m,v);case r.RANGE:return O(m,v)}}function T(m,v,A){var P,q;const z=v.toLowerCase();p[m]=(P=p[m])!==null&&P!==void 0?P:{},p[m][z]=(q=p[m][z])!==null&&q!==void 0?q:[];for(const Y of p[m][z])if(h(Y,A))throw new l(`Cannot add mapping to contract ${z} on network ${m} because it overlaps with existing mapping`,Y,A);p[m][z].push(A)}function b(m,v,A){var P;return!((P=p[m])===null||P===void 0)&&P[v]?p[m][v].some(q=>{switch(q.type){case r.SINGLE:return q.id===A;case r.ANY:return!0;case r.MULTIPLE:return q.ids.includes(A);case r.RANGE:return BigInt(A)>=BigInt(q.from)&&BigInt(A)<=BigInt(q.to)}}):!1}return{addMapping:T,getMappings:f,includesNft:b}}e.createMappingsHelper=c})(wm)),wm}var z1;function aE(){return z1||(z1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isThirdParty=e.schema=void 0;const t=Ne(),r=jC(),n=iE();e.schema={type:"object",properties:{merkleProof:r.MerkleProof.schema,content:{type:"object",nullable:!1,additionalProperties:{type:"string"},required:[]},mappings:Object.assign({nullable:!0},n.Mappings.schema)},required:["merkleProof","content"],_containsHashingKeys:!0};const i={keyword:"_containsHashingKeys",validate:function(o,u){var l;const c=u;return!((l=c==null?void 0:c.merkleProof)===null||l===void 0)&&l.hashingKeys?c.merkleProof.hashingKeys.every(d=>c.hasOwnProperty(d)):!1},errors:!1},a=(0,t.generateLazyValidator)(e.schema,[i,n.RangeMapping._fromLessThanOrEqualTo,n.Mappings._isMappingsValid]);function s(o){return a(o)}e.isThirdParty=s})(Im)),Im}var Am={},Om={},zr={},W1;function LC(){if(W1)return zr;W1=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.isBaseEmote=zr.isBaseAvatar=zr.requiredBaseItemProps=zr.baseItemProperties=void 0;const e=MC(),t=DC(),r=rE();zr.baseItemProperties=Object.assign(Object.assign({},r.displayableProperties),{id:{type:"string"},name:{type:"string"},description:{type:"string"},i18n:{type:"array",items:e.I18N.schema,minItems:1,uniqueItemProperties:["code"],errorMessage:'${0#} array should not have duplicates for "code"'},thumbnail:{type:"string"},image:{type:"string"},metrics:Object.assign(Object.assign({},t.Metrics.schema),{nullable:!0})}),zr.requiredBaseItemProps=["id","name","description","i18n","thumbnail","image"];function n(a){if(!a||!a.id)return!1;const s=a.id.split(":"),o=s[1]==="decentraland",u=s[3]==="base-avatars";return s.length===5&&o&&u}zr.isBaseAvatar=n;function i(a){if(!a||!a.id)return!1;const s=a.id.split(":");return s.length===5&&s[1]==="decentraland"&&s[3]==="base-emotes"}return zr.isBaseEmote=i,zr}var Y1;function gV(){return Y1||(Y1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Wearable=void 0;const t=Ne(),r=Sa(),n=tE(),i=LC(),a=nE(),s=aE(),o=eE(),u=iE();(function(l){l.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},i.baseItemProperties),a.standardProperties),s.schema.properties.thirdPartyProps),{data:{type:"object",properties:{replaces:{type:"array",items:o.HideableWearableCategory.schema},hides:{type:"array",items:o.HideableWearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:n.WearableRepresentation.schema,minItems:1},category:r.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:o.HideableWearableCategory.schema},blockVrmExport:{type:"boolean",nullable:!0},outlineCompatible:{type:"boolean",nullable:!0}},required:["replaces","hides","tags","representations","category"]}}),additionalProperties:!0,required:[],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity","mappings"],_isBaseAvatar:!0},{required:[...i.requiredBaseItemProps,"data","collectionAddress","rarity"],prohibited:["merkleProof","content","mappings"]},{required:[...i.requiredBaseItemProps,"data","merkleProof","content"],prohibited:["collectionAddress","rarity"],_isThirdParty:!0}],errorMessage:{oneOf:"either standard XOR thirdparty properties conditions must be met"}};const c={keyword:"_isThirdParty",validate:(p,f)=>!p||(0,s.isThirdParty)(f),errors:!1},d={keyword:"_isBaseAvatar",validate:(p,f)=>!p||(0,i.isBaseAvatar)(f),errors:!1};l.validate=(0,t.generateLazyValidator)(l.schema,[c,d,u.RangeMapping._fromLessThanOrEqualTo,u.Mappings._isMappingsValid])})(e.Wearable||(e.Wearable={}))})(Om)),Om}var x1;function _V(){return x1||(x1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HideableWearableCategory=e.BodyPartCategory=e.WearableCategory=e.Wearable=e.WearableRepresentation=void 0;var t=tE();Object.defineProperty(e,"WearableRepresentation",{enumerable:!0,get:function(){return t.WearableRepresentation}});var r=gV();Object.defineProperty(e,"Wearable",{enumerable:!0,get:function(){return r.Wearable}});var n=Sa();Object.defineProperty(e,"WearableCategory",{enumerable:!0,get:function(){return n.WearableCategory}});var i=IC();Object.defineProperty(e,"BodyPartCategory",{enumerable:!0,get:function(){return i.BodyPartCategory}});var a=eE();Object.defineProperty(e,"HideableWearableCategory",{enumerable:!0,get:function(){return a.HideableWearableCategory}})})(Am)),Am}var Nm={},Pm={},Cm={},Mm={},K1;function $C(){return K1||(K1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmoteCategory=void 0;const t=Ne();(function(r){r.DANCE="dance",r.STUNT="stunt",r.GREETINGS="greetings",r.FUN="fun",r.POSES="poses",r.REACTIONS="reactions",r.HORROR="horror",r.MISCELLANEOUS="miscellaneous"})(e.EmoteCategory||(e.EmoteCategory={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.EmoteCategory||(e.EmoteCategory={}))})(Mm)),Mm}var Dm={},X1;function qC(){return X1||(X1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmoteRepresentationADR74=void 0;const t=Ne(),r=Z_();(function(n){n.schema={type:"object",properties:{bodyShapes:{type:"array",items:r.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}},errorMessage:{contains:"contents should contain mainFile: ${1/mainFile}"}}},required:["bodyShapes","mainFile","contents"]},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.EmoteRepresentationADR74||(e.EmoteRepresentationADR74={}))})(Dm)),Dm}var jm={},J1;function BC(){return J1||(J1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OutcomeGroup=e.StartAnimation=e.EmoteClip=e.ArmatureId=void 0;const t=Ne();var r;(function(i){i.Armature="Armature",i.Armature_Prop="Armature_Prop",i.Armature_Other="Armature_Other"})(r=e.ArmatureId||(e.ArmatureId={})),(function(i){i.schema={type:"string",enum:Object.values(i)},i.validate=(0,t.generateLazyValidator)(i.schema)})(r=e.ArmatureId||(e.ArmatureId={}));var n;(function(i){i.schema={type:"object",properties:{animation:{type:"string",minLength:1,errorMessage:"animation must be a non-empty string (GLB clip name)"}},required:["animation"],additionalProperties:!1,errorMessage:{required:{animation:"animation is required (GLB clip name)"}}},i.validate=(0,t.generateLazyValidator)(i.schema)})(n=e.EmoteClip||(e.EmoteClip={})),(function(i){i.schema={type:"object",properties:{loop:{type:"boolean",errorMessage:"startAnimation.loop must be a boolean"},[r.Armature]:Object.assign(Object.assign({},n.schema),{errorMessage:"startAnimation.Armature is required and must contain valid animation data"}),[r.Armature_Prop]:Object.assign(Object.assign({},n.schema),{nullable:!0,errorMessage:"startAnimation.Armature_Prop must contain valid animation data when provided"}),audio:{type:"string",nullable:!0,errorMessage:"audio must be a string (audio clip filename) when provided"}},required:["loop",r.Armature],additionalProperties:!1,errorMessage:{required:{loop:"startAnimation.loop is required",[r.Armature]:"startAnimation.Armature is required"}}},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.StartAnimation||(e.StartAnimation={})),(function(i){i.schema={type:"object",properties:{title:{type:"string",minLength:1,errorMessage:"outcome.title must be a non-empty string"},loop:{type:"boolean",errorMessage:"outcome.loop must be a boolean"},clips:{type:"object",properties:Object.values(r).reduce((a,s)=>(a[s]=Object.assign(Object.assign({},n.schema),{nullable:!0,errorMessage:`outcome.clips.${s} must contain valid animation data when provided`}),a),{}),additionalProperties:!0,minProperties:1,errorMessage:"outcome.clips must contain at least one armature animation"},audio:{type:"string",nullable:!0,errorMessage:"audio must be a string (audio clip filename) when provided"}},required:["title","loop","clips"],additionalProperties:!1,errorMessage:{required:{title:"outcome.title is required",loop:"outcome.loop is required",clips:"outcome.clips is required"}}},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.OutcomeGroup||(e.OutcomeGroup={}))})(jm)),jm}var Q1;function kC(){return Q1||(Q1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmoteDataADR74=void 0;const t=$C(),r=Ne(),n=qC(),i=BC();(function(a){a.schema={type:"object",properties:{tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:n.EmoteRepresentationADR74.schema,minItems:1},category:t.EmoteCategory.schema,loop:{type:"boolean"},startAnimation:Object.assign(Object.assign({},i.StartAnimation.schema),{nullable:!0}),randomizeOutcomes:{type:"boolean",nullable:!0},outcomes:{type:"array",items:i.OutcomeGroup.schema,minItems:1,maxItems:3,nullable:!0}},required:["category","tags","representations","loop"],dependencies:{startAnimation:["randomizeOutcomes","outcomes"],randomizeOutcomes:["startAnimation","outcomes"],outcomes:["startAnimation","randomizeOutcomes"]},additionalProperties:!0},a.validate=(0,r.generateLazyValidator)(a.schema)})(e.EmoteDataADR74||(e.EmoteDataADR74={}))})(Cm)),Cm}var Z1;function EV(){return Z1||(Z1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emote=void 0;const t=UC(),r=Ne(),n=LC(),i=nE(),a=aE(),s=kC();(function(o){o.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},n.baseItemProperties),i.standardProperties),a.schema.properties),{emoteDataADR74:s.EmoteDataADR74.schema}),additionalProperties:!0,required:[...n.requiredBaseItemProps],oneOf:[{required:["emoteDataADR74"],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity"],_isBaseEmote:!0},{required:["collectionAddress","rarity"],prohibited:["merkleProof","content"],errorMessage:"standard properties conditions are not met"},{required:["merkleProof","content","id","name","description","i18n","image","thumbnail","emoteDataADR74"],_isThirdParty:!0,prohibited:["collectionAddress","rarity"],errorMessage:"thirdparty properties conditions are not met"}],errorMessage:{oneOf:"emote should have either standard or thirdparty properties"}}],errorMessage:{oneOf:'emote should have "emoteDataADR74" and match its schema'}};const u={keyword:"_isThirdParty",validate:(c,d)=>!c||(0,t.isThirdParty)(d),errors:!1},l={keyword:"_isBaseEmote",validate:(c,d)=>!c||(0,n.isBaseEmote)(d),errors:!1};o.validate=(0,r.generateLazyValidator)(o.schema,[u,l,t.RangeMapping._fromLessThanOrEqualTo,t.Mappings._isMappingsValid])})(e.Emote||(e.Emote={}))})(Pm)),Pm}var Lm={},eR;function vV(){return eR||(eR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmotePlayMode=void 0;const t=Ne();(function(r){r.SIMPLE="simple",r.LOOP="loop"})(e.EmotePlayMode||(e.EmotePlayMode={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.EmotePlayMode||(e.EmotePlayMode={}))})(Lm)),Lm}var $m={},tR;function bV(){return tR||(tR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmoteOutcomeType=void 0;const t=Ne();(function(r){r.SIMPLE_OUTCOME="so",r.MULTIPLE_OUTCOME="mo",r.RANDOM_OUTCOME="ro"})(e.EmoteOutcomeType||(e.EmoteOutcomeType={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.EmoteOutcomeType||(e.EmoteOutcomeType={}))})($m)),$m}var rR;function TV(){return rR||(rR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmoteOutcomeType=e.EmotePlayMode=e.EmoteCategory=e.StartAnimation=e.OutcomeGroup=e.EmoteClip=e.ArmatureId=e.EmoteDataADR74=e.EmoteRepresentationADR74=e.Emote=void 0;var t=EV();Object.defineProperty(e,"Emote",{enumerable:!0,get:function(){return t.Emote}});var r=qC();Object.defineProperty(e,"EmoteRepresentationADR74",{enumerable:!0,get:function(){return r.EmoteRepresentationADR74}});var n=kC();Object.defineProperty(e,"EmoteDataADR74",{enumerable:!0,get:function(){return n.EmoteDataADR74}});var i=BC();Object.defineProperty(e,"ArmatureId",{enumerable:!0,get:function(){return i.ArmatureId}}),Object.defineProperty(e,"EmoteClip",{enumerable:!0,get:function(){return i.EmoteClip}}),Object.defineProperty(e,"OutcomeGroup",{enumerable:!0,get:function(){return i.OutcomeGroup}}),Object.defineProperty(e,"StartAnimation",{enumerable:!0,get:function(){return i.StartAnimation}});var a=$C();Object.defineProperty(e,"EmoteCategory",{enumerable:!0,get:function(){return a.EmoteCategory}});var s=vV();Object.defineProperty(e,"EmotePlayMode",{enumerable:!0,get:function(){return s.EmotePlayMode}});var o=bV();Object.defineProperty(e,"EmoteOutcomeType",{enumerable:!0,get:function(){return o.EmoteOutcomeType}})})(Nm)),Nm}var nR;function UC(){return nR||(nR=1,(function(e){var t=Bi&&Bi.__createBinding||(Object.create?(function(l,c,d,p){p===void 0&&(p=d);var f=Object.getOwnPropertyDescriptor(c,d);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(l,p,f)}):(function(l,c,d,p){p===void 0&&(p=d),l[p]=c[d]})),r=Bi&&Bi.__exportStar||function(l,c){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&t(c,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.isThirdParty=e.isStandard=e.BodyShape=e.Metrics=e.Locale=e.I18N=void 0;var n=MC();Object.defineProperty(e,"I18N",{enumerable:!0,get:function(){return n.I18N}});var i=CC();Object.defineProperty(e,"Locale",{enumerable:!0,get:function(){return i.Locale}});var a=DC();Object.defineProperty(e,"Metrics",{enumerable:!0,get:function(){return a.Metrics}});var s=Z_();Object.defineProperty(e,"BodyShape",{enumerable:!0,get:function(){return s.BodyShape}});var o=nE();Object.defineProperty(e,"isStandard",{enumerable:!0,get:function(){return o.isStandard}});var u=aE();Object.defineProperty(e,"isThirdParty",{enumerable:!0,get:function(){return u.isThirdParty}}),r(iE(),e),r(_V(),e),r(TV(),e)})(Bi)),Bi}var qm={},Bm={},iR;function ru(){return iR||(iR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AuthChain=e.AuthLink=e.AuthLinkType=void 0;const t=Ne();var r;(function(i){i.SIGNER="SIGNER",i.ECDSA_PERSONAL_EPHEMERAL="ECDSA_EPHEMERAL",i.ECDSA_PERSONAL_SIGNED_ENTITY="ECDSA_SIGNED_ENTITY",i.ECDSA_EIP_1654_EPHEMERAL="ECDSA_EIP_1654_EPHEMERAL",i.ECDSA_EIP_1654_SIGNED_ENTITY="ECDSA_EIP_1654_SIGNED_ENTITY"})(r=e.AuthLinkType||(e.AuthLinkType={}));var n;(function(i){i.schema={type:"object",properties:{type:{type:"string",enum:Object.values(r)},payload:{type:"string"},signature:{type:"string",nullable:!0}},required:["payload","type"],if:{properties:{type:{not:{const:r.SIGNER}}}},then:{required:["signature"]},else:{oneOf:[{properties:{signature:{type:"string",const:""}},required:["signature"]},{properties:{signature:{type:"null"}}}]}},i.validate=(0,t.generateLazyValidator)(i.schema)})(n=e.AuthLink||(e.AuthLink={})),(function(i){i.schema={type:"array",items:n.schema,minItems:1},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.AuthChain||(e.AuthChain={}))})(Bm)),Bm}var aR;function SV(){return aR||(aR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PointerChangesSyncDeployment=e.SnapshotSyncDeployment=void 0;const t=Ia(),r=ru(),n=Ne();(function(i){i.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:r.AuthChain.schema,entityTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:t.IPFSv1.schema}},{properties:{entityId:t.IPFSv2.schema}}],required:["entityId","entityType","pointers","entityTimestamp","authChain"]},i.validate=(0,n.generateLazyValidator)(i.schema)})(e.SnapshotSyncDeployment||(e.SnapshotSyncDeployment={})),(function(i){i.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:r.AuthChain.schema,entityTimestamp:{type:"number",minimum:0},localTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:t.IPFSv1.schema}},{properties:{entityId:t.IPFSv2.schema}}],required:["entityId","entityType","pointers","localTimestamp","entityTimestamp","authChain"]},i.validate=(0,n.generateLazyValidator)(i.schema)})(e.PointerChangesSyncDeployment||(e.PointerChangesSyncDeployment={}))})(qm)),qm}var km={},Um={},sR;function FC(){return sR||(sR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContentMapping=void 0;const t=Ia(),r=Ne();(function(n){n.schema={type:"object",properties:{file:{type:"string",minLength:1},hash:{type:"string",oneOf:[t.IPFSv1.schema,t.IPFSv2.schema]}},required:["file","hash"]},n.validate=(0,r.generateLazyValidator)(n.schema)})(e.ContentMapping||(e.ContentMapping={}))})(Um)),Um}var oR;function HC(){return oR||(oR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Entity=e.EntityType=void 0;const t=Ia(),r=FC(),n=Ne();(function(i){i.SCENE="scene",i.PROFILE="profile",i.WEARABLE="wearable",i.STORE="store",i.EMOTE="emote",i.OUTFITS="outfits"})(e.EntityType||(e.EntityType={})),(function(i){i.schema={type:"object",properties:{version:{type:"string",enum:["v3"]},id:{type:"string",oneOf:[t.IPFSv1.schema,t.IPFSv2.schema]},type:{type:"string"},pointers:{type:"array",items:{type:"string",minLength:1}},timestamp:{type:"number",minimum:0},content:{type:"array",items:r.ContentMapping.schema},metadata:{type:"object",nullable:!0}},required:["version","id","type","pointers","timestamp","content"]},i.validate=(0,n.generateLazyValidator)(i.schema)})(e.Entity||(e.Entity={}))})(km)),km}var Fm={},uR;function IV(){return uR||(uR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeploymentWithAuthChain=void 0;const t=ru(),r=Ne();(function(n){n.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},localTimestamp:{type:"number",minimum:0},authChain:t.AuthChain.schema},required:["entityId","entityType","pointers","localTimestamp","authChain"]},n.validate=(0,r.generateLazyValidator)(n.schema)})(e.DeploymentWithAuthChain||(e.DeploymentWithAuthChain={}))})(Fm)),Fm}var Ui={},Hm={},cR;function RV(){return cR||(cR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Outfits=e.Outfit=void 0;const t=Sa(),r=Ia(),n=Ne();var i;(function(a){a.schema={type:"object",required:["bodyShape","eyes","hair","skin","wearables"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:r.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:r.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:r.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:t.WearableCategory.schema}},additionalProperties:!0},a.validate=(0,n.generateLazyValidator)(a.schema)})(i=e.Outfit||(e.Outfit={})),(function(a){a.schema={type:"object",required:["outfits","namesForExtraSlots"],properties:{outfits:{type:"array",items:{type:"object",required:["slot","outfit"],properties:{slot:{type:"number"},outfit:i.schema}}},namesForExtraSlots:{type:"array",uniqueItems:!0,items:{type:"string"}}},additionalProperties:!0},a.validate=(0,n.generateLazyValidator)(a.schema)})(e.Outfits||(e.Outfits={}))})(Hm)),Hm}var lR;function wV(){return lR||(lR=1,(function(e){var t=Ui&&Ui.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Ui&&Ui.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(RV(),e)})(Ui)),Ui}var Fi={},Vm={},dR;function VC(){return dR||(dR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationOptOutScope=e.NotificationType=void 0,(function(t){t.BADGE_GRANTED="badge_granted",t.BID_ACCEPTED="bid_accepted",t.BID_RECEIVED="bid_received",t.EVENTS_STARTED="events_started",t.EVENTS_STARTS_SOON="events_starts_soon",t.EVENT_CREATED="event_created",t.GOVERNANCE_ANNOUNCEMENT="governance_announcement",t.GOVERNANCE_AUTHORED_PROPOSAL_FINISHED="governance_authored_proposal_finished",t.GOVERNANCE_COAUTHOR_REQUESTED="governance_coauthor_requested",t.GOVERNANCE_CLIFF_ENDED="governance_cliff_ended",t.GOVERNANCE_NEW_COMMENT_ON_PROJECT_UPDATE="governance_new_comment_on_project_update",t.GOVERNANCE_NEW_COMMENT_ON_PROPOSAL="governance_new_comment_on_proposal",t.GOVERNANCE_PROPOSAL_ENACTED="governance_proposal_enacted",t.GOVERNANCE_VOTING_ENDED_VOTER="governance_voting_ended_voter",t.GOVERNANCE_PITCH_PASSED="governance_pitch_passed",t.GOVERNANCE_TENDER_PASSED="governance_tender_passed",t.GOVERNANCE_WHALE_VOTE="governance_whale_vote",t.GOVERNANCE_VOTED_ON_BEHALF="governance_voted_on_behalf",t.ITEM_SOLD="item_sold",t.ITEM_PUBLISHED="item_published",t.LAND_RENTAL_ENDED="rental_ended",t.LAND_RENTED="rental_started",t.REWARD_ASSIGNED="reward_assignment",t.REWARD_CAMPAIGN_OUT_OF_FUNDS="reward_campaign_out_of_funds",t.REWARD_CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED="reward_campaign_gas_price_higher_than_expected",t.REWARD_CAMPAIGN_OUT_OF_STOCK="reward_campaign_out_of_stock",t.REWARD_DELAYED="reward_delayed",t.REWARD_IN_PROGRESS="reward_in_progress",t.ROYALTIES_EARNED="royalties_earned",t.SOCIAL_SERVICE_FRIENDSHIP_REQUEST="social_service_friendship_request",t.SOCIAL_SERVICE_FRIENDSHIP_ACCEPTED="social_service_friendship_accepted",t.WORLDS_ACCESS_RESTORED="worlds_access_restored",t.WORLDS_ACCESS_RESTRICTED="worlds_access_restricted",t.WORLDS_MISSING_RESOURCES="worlds_missing_resources",t.WORLDS_PERMISSION_GRANTED="worlds_permission_granted",t.WORLDS_PERMISSION_REVOKED="worlds_permission_revoked",t.CREDITS_GOAL_COMPLETED="credits_goal_completed",t.CREDITS_ON_DEMAND_GRANTED="credits_on_demand_granted",t.STREAMING_KEY_RESET="streaming_key_reset",t.STREAMING_KEY_REVOKE="streaming_key_revoke",t.STREAMING_KEY_EXPIRED="streaming_key_expired",t.STREAMING_TIME_EXCEEDED="streaming_time_exceeded",t.STREAMING_PLACE_UPDATED="streaming_place_updated",t.CREDITS_REMINDER_COMPLETE_GOALS="credits_reminder_complete_goals",t.CREDITS_REMINDER_CLAIM_CREDITS="credits_reminder_claim_credits",t.CREDITS_REMINDER_USAGE="credits_reminder_usage",t.CREDITS_REMINDER_USAGE_24_HOURS="credits_reminder_usage_24_hours",t.CREDITS_REMINDER_DO_NOT_MISS_OUT="credits_reminder_do_not_miss_out",t.CREDITS_NEW_SEASON_REMINDER="credits_new_season_reminder",t.REFERRAL_INVITED_USERS_ACCEPTED="referral_invited_users_accepted",t.REFERRAL_NEW_TIER_REACHED="referral_new_tier_reached",t.COMMUNITY_DELETED="community_deleted",t.COMMUNITY_DELETED_CONTENT_VIOLATION="community_deleted_content_violation",t.COMMUNITY_RENAMED="community_renamed",t.COMMUNITY_MEMBER_BANNED="community_member_banned",t.COMMUNITY_MEMBER_REMOVED="community_member_removed",t.COMMUNITY_REQUEST_TO_JOIN_RECEIVED="community_request_to_join_received",t.COMMUNITY_REQUEST_TO_JOIN_ACCEPTED="community_request_to_join_accepted",t.COMMUNITY_INVITE_RECEIVED="community_invite_received",t.COMMUNITY_OWNERSHIP_TRANSFERRED="community_ownership_transferred",t.COMMUNITY_POST_ADDED="community_post_added",t.COMMUNITY_VOICE_CHAT_STARTED="community_voice_chat_started",t.USER_BANNED_FROM_SCENE="user_banned_from_scene",t.USER_UNBANNED_FROM_SCENE="user_unbanned_from_scene",t.TRANSFER_RECEIVED="transfer_received",t.TIP_RECEIVED="tip_received",t.BANNED="banned",t.BAN_WARNING="ban_warning",t.BAN_LIFTED="ban_lifted"})(e.NotificationType||(e.NotificationType={})),(function(t){t.COMMUNITY="community"})(e.NotificationOptOutScope||(e.NotificationOptOutScope={}))})(Vm)),Vm}var Gm={},zm={},fR;function GC(){return fR||(fR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SubscriptionDetails=void 0;const t=Ne(),r=VC(),n={type:"object",required:["email","in_app"],properties:{email:{type:"boolean"},in_app:{type:"boolean"}}},i=Object.values(r.NotificationType).reduce((a,s)=>(a[s]=n,a),{});(function(a){a.schema={type:"object",required:["ignore_all_email","ignore_all_in_app","message_type"],properties:{ignore_all_email:{type:"boolean"},ignore_all_in_app:{type:"boolean"},message_type:{type:"object",required:Object.values(r.NotificationType),additionalProperties:!1,properties:i}}},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.SubscriptionDetails||(e.SubscriptionDetails={}))})(zm)),zm}var Wm={},pR;function zC(){return pR||(pR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Email=void 0,(function(t){t.schema={type:"string",pattern:"^[\\w\\-\\.]+@([\\w-]+\\.)+[\\w-]{2,}$"};const r=new RegExp(t.schema.pattern);t.validate=n=>r.test(n)})(e.Email||(e.Email={}))})(Wm)),Wm}var mR;function AV(){return mR||(mR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Subscription=void 0;const t=Ne(),r=GC(),n=Ia(),i=zC();(function(a){a.schema={type:"object",required:["address","details"],properties:{address:n.EthAddress.schema,email:Object.assign(Object.assign({},i.Email.schema),{nullable:!0}),details:r.SubscriptionDetails.schema}},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.Subscription||(e.Subscription={}))})(Gm)),Gm}var hR;function OV(){return hR||(hR=1,(function(e){var t=Fi&&Fi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Fi&&Fi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(VC(),e),r(AV(),e),r(GC(),e)})(Fi)),Fi}var Hi={},Ym={},yR;function Er(){return yR||(yR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Events=void 0,(function(t){(function(r){r.BLOCKCHAIN="blockchain",r.CATALYST_DEPLOYMENT="catalyst-deployment",r.WORLD="world",r.CLIENT="client",r.WEB="web",r.MARKETPLACE="marketplace",r.REWARDS="rewards",r.BADGE="badge",r.ASSET_BUNDLE="asset-bundle",r.SOCIAL_SERVICE="social-service",r.CREDITS_SERVICE="credits-service",r.STREAMING="streaming",r.COMMS="comms",r.REFERRAL="referral",r.COMMUNITY="community",r.CAMERA="camera",r.EVENT="event",r.GOVERNANCE="governance",r.MODERATION="moderation"})(t.Type||(t.Type={})),(function(r){(function(n){n.BID_ACCEPTED="bid-accepted",n.ITEM_SOLD="item-sold",n.RENTAL_ENDED="land-rental-ended",n.RENTAL_STARTED="land-rental-started",n.ROYALTIES_EARNED="royalties-earned",n.COLLECTION_CREATED="collection-created",n.ITEM_PUBLISHED="item-published",n.TRANSFER_RECEIVED="transfer-received",n.TIP_RECEIVED="tip-received"})(r.Blockchain||(r.Blockchain={})),(function(n){n.BID_RECEIVED="bid-received"})(r.Marketplace||(r.Marketplace={})),(function(n){n.SCENE="scene",n.PROFILE="profile",n.WEARABLE="wearable",n.STORE="store",n.EMOTE="emote",n.OUTFITS="outfits"})(r.CatalystDeployment||(r.CatalystDeployment={})),(function(n){n.DEPLOYMENT="deployment",n.WORLD_SETTINGS_CHANGED="world_settings_changed",n.WORLD_SCENES_UNDEPLOYMENT="world_scenes_undeployment",n.WORLD_UNDEPLOYMENT="world_undeployment",n.WORLD_SPAWN_COORDINATE_SET="world_spawn_coordinate_set",n.WORLDS_PERMISSION_GRANTED="worlds_permission_granted",n.WORLDS_PERMISSION_REVOKED="worlds_permission_revoked",n.WORLDS_ACCESS_RESTORED="worlds_access_restored",n.WORLDS_ACCESS_RESTRICTED="worlds_access_restricted",n.WORLDS_MISSING_RESOURCES="worlds_missing_resources"})(r.Worlds||(r.Worlds={})),(function(n){n.LOGGED_IN="logged-in",n.LOGGED_IN_CACHED="logged-in-cached",n.MOVE_TO_PARCEL="move-to-parcel",n.USED_EMOTE="used-emote",n.PASSPORT_OPENED="passport-opened",n.WALKED_DISTANCE="walked-distance",n.VERTICAL_HEIGHT_REACHED="vertical-height-reached"})(r.Client||(r.Client={})),(function(n){n.AUTH_IDENTIFY="auth-identify"})(r.Web||(r.Web={})),(function(n){n.REWARD_IN_PROGRESS="reward-in-progress",n.REWARD_ASSIGNED="reward-assigned",n.CAMPAIGN_OUT_OF_FUNDS="campaign-out-of-funds",n.CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED="campaign-gas-price-higher-than-expected",n.CAMPAIGN_OUT_OF_STOCK="campaign-out-of-stock",n.REWARD_DELAYED="reward-delayed"})(r.Rewards||(r.Rewards={})),(function(n){n.GRANTED="badge-granted"})(r.Badge||(r.Badge={})),(function(n){n.CONVERTED="converted",n.MANUALLY_QUEUED="manually-queued"})(r.AssetBundle||(r.AssetBundle={})),(function(n){n.FRIENDSHIP_REQUEST="friendship-request",n.FRIENDSHIP_ACCEPTED="friendship-accepted"})(r.SocialService||(r.SocialService={})),(function(n){n.CREDITS_GOAL_COMPLETED="credits-goal-completed",n.COMPLETE_GOALS_REMINDER="complete-goals-reminder",n.CLAIM_CREDITS_REMINDER="claim-credits-reminder",n.DO_NOT_MISS_OUT_REMINDER="do-not-miss-out-reminder",n.USAGE_REMINDER="usage-reminder",n.USAGE_24_HOURS_REMINDER="usage-24-hours-reminder",n.ON_DEMAND_CREDITS_GRANTED="on-demand-credits-granted",n.NEW_SEASON_REMINDER="new-season-reminder"})(r.CreditsService||(r.CreditsService={})),(function(n){n.STREAMING_KEY_RESET="streaming-key-reset",n.STREAMING_KEY_REVOKE="streaming-key-revoke",n.STREAMING_KEY_EXPIRED="streaming-key-expired",n.STREAMING_TIME_EXCEEDED="streaming-time-exceeded",n.STREAMING_PLACE_UPDATED="streaming-place-updated",n.COMMUNITY_STREAMING_ENDED="community-streaming-ended"})(r.Streaming||(r.Streaming={})),(function(n){n.USER_JOINED_ROOM="user-joined-room",n.USER_LEFT_ROOM="user-left-room",n.USER_BANNED_FROM_SCENE="user-banned-from-scene",n.USER_UNBANNED_FROM_SCENE="user-unbanned-from-scene"})(r.Comms||(r.Comms={})),(function(n){n.REFERRAL_INVITED_USERS_ACCEPTED="referral-invited-users-accepted",n.REFERRAL_NEW_TIER_REACHED="referral-new-tier-reached"})(r.Referral||(r.Referral={})),(function(n){n.DELETED="community-deleted",n.DELETED_CONTENT_VIOLATION="community-deleted-content-violation",n.RENAMED="community-renamed",n.MEMBER_BANNED="community-member-banned",n.MEMBER_LEFT="community-member-left",n.MEMBER_REMOVED="community-member-removed",n.REQUEST_TO_JOIN_RECEIVED="community-request-to-join-received",n.REQUEST_TO_JOIN_ACCEPTED="community-request-to-join-accepted",n.INVITE_RECEIVED="community-invite-received",n.OWNERSHIP_TRANSFERRED="community-ownership-transferred",n.POST_ADDED="community-post-added",n.VOICE_CHAT_STARTED="community-voice-chat-started"})(r.Community||(r.Community={})),(function(n){n.PHOTO_TAKEN="photo-taken",n.PHOTO_PRIVACY_CHANGED="photo-privacy-changed"})(r.Camera||(r.Camera={})),(function(n){n.EVENT_CREATED="event-created",n.EVENT_STARTS_SOON="event-starts-soon",n.EVENT_STARTED="event-started",n.EVENT_ENDED="event-ended"})(r.Event||(r.Event={})),(function(n){n.PROPOSAL_ENACTED="governance_proposal_enacted",n.COAUTHOR_REQUESTED="governance_coauthor_requested",n.PITCH_PASSED="governance_pitch_passed",n.TENDER_PASSED="governance_tender_passed",n.AUTHORED_PROPOSAL_FINISHED="governance_authored_proposal_finished",n.VOTING_ENDED_VOTER="governance_voting_ended_voter",n.NEW_COMMENT_ON_PROPOSAL="governance_new_comment_on_proposal",n.NEW_COMMENT_ON_PROJECT_UPDATED="governance_new_comment_on_project_update",n.WHALE_VOTE="governance_whale_vote",n.VOTED_ON_BEHALF="governance_voted_on_behalf",n.CLIFF_ENDED="governance_cliff_ended"})(r.Governance||(r.Governance={})),(function(n){n.USER_BAN_CREATED="user-ban-created",n.USER_BAN_LIFTED="user-ban-lifted",n.USER_WARNING_CREATED="user-warning-created"})(r.Moderation||(r.Moderation={}))})(t.SubType||(t.SubType={}))})(e.Events||(e.Events={}))})(Ym)),Ym}var xm={},gR;function NV(){return gR||(gR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TipReceivedEvent=e.TransferReceivedEvent=e.CollectionCreatedEvent=e.RoyaltiesEarnedEvent=e.RentalStartedEvent=e.RentalEndedEvent=e.ItemPublishedEvent=e.ItemSoldEvent=e.BidAcceptedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.BID_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},price:{type:"string"},title:{type:"string"},description:{type:"string"},network:{type:"string"}},required:["address","image","seller","category","link","price","title","network"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.BidAcceptedEvent||(e.BidAcceptedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.ITEM_SOLD},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},buyer:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},tokenId:{type:"string"},network:{type:"string"},title:{type:"string"},description:{type:"string"}},required:["address","image","seller","category","link","network","title","description"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.ItemSoldEvent||(e.ItemSoldEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.ITEM_PUBLISHED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creator:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},itemId:{type:"string"},network:{type:"string"},urn:{type:"string"}},required:["creator","category","itemId","network","urn"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.ItemPublishedEvent||(e.ItemPublishedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.RENTAL_ENDED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},contract:{type:"string"},land:{type:"string",nullable:!0},lessor:{type:"string"},tenant:{type:"string"},operator:{type:"string"},startedAt:{type:"string"},endedAt:{type:"string"},tokenId:{type:"string"},link:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","contract","lessor","tenant","operator","startedAt","endedAt","tokenId","link","title"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.RentalEndedEvent||(e.RentalEndedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.RENTAL_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},contract:{type:"string"},land:{type:"string",nullable:!0},lessor:{type:"string"},tenant:{type:"string"},operator:{type:"string"},startedAt:{type:"string"},endedAt:{type:"string"},tokenId:{type:"string"},link:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","contract","lessor","tenant","operator","startedAt","endedAt","tokenId","link","title"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.RentalStartedEvent||(e.RentalStartedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.ROYALTIES_EARNED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},royaltiesCut:{type:"string"},royaltiesCollector:{type:"string"},network:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","image","category","link","royaltiesCut","royaltiesCollector","network","title"]}},required:["type","subType","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.RoyaltiesEarnedEvent||(e.RoyaltiesEarnedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.COLLECTION_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creator:{type:"string"},name:{type:"string"}},required:["creator","name"]}},required:["type","subType","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CollectionCreatedEvent||(e.CollectionCreatedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.TRANSFER_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{senderAddress:{type:"string"},receiverAddress:{type:"string"},tokenUri:{type:"string",nullable:!0}},required:["senderAddress","receiverAddress"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.TransferReceivedEvent||(e.TransferReceivedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BLOCKCHAIN},subType:{type:"string",const:r.Events.SubType.Blockchain.TIP_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{senderAddress:{type:"string"},receiverAddress:{type:"string"},amount:{type:"string"}},required:["senderAddress","receiverAddress","amount"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.TipReceivedEvent||(e.TipReceivedEvent={}))})(xm)),xm}var Km={},_R;function PV(){return _R||(_R=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CatalystDeploymentEvent=void 0;const t=ru(),r=Ne(),n=HC(),i=Er();(function(a){a.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.CATALYST_DEPLOYMENT},subType:{type:"string",enum:Object.values(i.Events.SubType.CatalystDeployment)},key:{type:"string"},timestamp:{type:"number",minimum:1},entity:n.Entity.schema,authChain:t.AuthChain.schema},required:["type","subType","entity","authChain","key","timestamp"],additionalProperties:!1},a.validate=(0,r.generateLazyValidator)(a.schema)})(e.CatalystDeploymentEvent||(e.CatalystDeploymentEvent={}))})(Km)),Km}var Xm={},ER;function CV(){return ER||(ER=1,Object.defineProperty(Xm,"__esModule",{value:!0})),Xm}var Jm={},vR;function MV(){return vR||(vR=1,Object.defineProperty(Jm,"__esModule",{value:!0})),Jm}var Qm={},bR;function DV(){return bR||(bR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BidReceivedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.MARKETPLACE},subType:{type:"string",const:r.Events.SubType.Marketplace.BID_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},price:{type:"string"},title:{type:"string"},description:{type:"string"},network:{type:"string"}},required:["address","image","seller","category","link","price","title","network"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.BidReceivedEvent||(e.BidReceivedEvent={}))})(Qm)),Qm}var Zm={},Ws={},TR;function id(){if(TR)return Ws;TR=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.createEventSchema=void 0;function e(t,r,n){return{type:"object",properties:{type:{type:"string",const:t},subType:{type:"string",const:r},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:n},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1}}return Ws.createEventSchema=e,Ws}var SR;function jV(){return SR||(SR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RewardDelayedEvent=e.CampaignOutOfStockEvent=e.CampaignGasPriceHigherThanExpectedEvent=e.CampaignOutOfFundsEvent=e.RewardAssignedEvent=e.RewardInProgressEvent=void 0;const t=Ne(),r=Er(),n=id(),i={type:"object",properties:{title:{type:"string"},description:{type:"string"},link:{type:"string",nullable:!0},beneficiary:{type:"string"},tokenName:{type:"string"},tokenImage:{type:"string"},tokenRarity:{type:"string",nullable:!0},tokenCategory:{type:"string",nullable:!0}},required:["title","description","beneficiary","tokenName","tokenImage"],additionalProperties:!1},a={type:"object",properties:{title:{type:"string"},description:{type:"string"},link:{type:"string",nullable:!0},owner:{type:"string"},campaignId:{type:"string"},campaignName:{type:"string"}},required:["title","description","owner","campaignId","campaignName"],additionalProperties:!1};(function(s){s.schema=(0,n.createEventSchema)(r.Events.Type.REWARDS,r.Events.SubType.Rewards.REWARD_IN_PROGRESS,i),s.validate=(0,t.generateLazyValidator)(s.schema)})(e.RewardInProgressEvent||(e.RewardInProgressEvent={})),(function(s){s.schema=(0,n.createEventSchema)(r.Events.Type.REWARDS,r.Events.SubType.Rewards.REWARD_ASSIGNED,i),s.validate=(0,t.generateLazyValidator)(s.schema)})(e.RewardAssignedEvent||(e.RewardAssignedEvent={})),(function(s){s.schema=(0,n.createEventSchema)(r.Events.Type.REWARDS,r.Events.SubType.Rewards.CAMPAIGN_OUT_OF_FUNDS,a),s.validate=(0,t.generateLazyValidator)(s.schema)})(e.CampaignOutOfFundsEvent||(e.CampaignOutOfFundsEvent={})),(function(s){s.schema=(0,n.createEventSchema)(r.Events.Type.REWARDS,r.Events.SubType.Rewards.CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED,a),s.validate=(0,t.generateLazyValidator)(s.schema)})(e.CampaignGasPriceHigherThanExpectedEvent||(e.CampaignGasPriceHigherThanExpectedEvent={})),(function(s){s.schema=(0,n.createEventSchema)(r.Events.Type.REWARDS,r.Events.SubType.Rewards.CAMPAIGN_OUT_OF_STOCK,a),s.validate=(0,t.generateLazyValidator)(s.schema)})(e.CampaignOutOfStockEvent||(e.CampaignOutOfStockEvent={})),(function(s){s.schema=(0,n.createEventSchema)(r.Events.Type.REWARDS,r.Events.SubType.Rewards.REWARD_DELAYED,i),s.validate=(0,t.generateLazyValidator)(s.schema)})(e.RewardDelayedEvent||(e.RewardDelayedEvent={}))})(Zm)),Zm}var eh={},IR;function LV(){return IR||(IR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CreditsClaimReminderEvent=e.CreditsDoNotMissOutReminderEvent=e.CreditsUsage24HoursReminderEvent=e.CreditsNewSeasonReminderEvent=e.CreditsUsageReminderEvent=e.CreditsCompleteGoalsReminderEvent=e.CreditsGoalCompletedEvent=e.CreditsOnDemandEvent=e.FriendshipAcceptedEvent=e.FriendshipRequestEvent=e.AssetBundleConversionManuallyQueuedEvent=e.AssetBundleConversionFinishedEvent=e.BadgeGrantedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.BADGE},subType:{type:"string",const:r.Events.SubType.Badge.GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{badgeId:{type:"string"},badgeTierName:{type:"string",nullable:!0},badgeName:{type:"string"},badgeImageUrl:{type:"string"},address:{type:"string"}},required:["badgeId","badgeName","badgeImageUrl","address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.BadgeGrantedEvent||(e.BadgeGrantedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.ASSET_BUNDLE},subType:{type:"string",const:r.Events.SubType.AssetBundle.CONVERTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{entityId:{type:"string"},platform:{type:"string",enum:["windows","mac","webgl"]},statusCode:{type:"number"},isLods:{type:"boolean"},isWorld:{type:"boolean"},version:{type:"string"}},required:["entityId","platform","statusCode","isLods","isWorld","version"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.AssetBundleConversionFinishedEvent||(e.AssetBundleConversionFinishedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.ASSET_BUNDLE},subType:{type:"string",const:r.Events.SubType.AssetBundle.MANUALLY_QUEUED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{entityId:{type:"string"},platform:{type:"string",enum:["windows","mac","webgl"]},isLods:{type:"boolean"},isPriority:{type:"boolean"},version:{type:"string"}},required:["entityId","platform","isLods"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.AssetBundleConversionManuallyQueuedEvent||(e.AssetBundleConversionManuallyQueuedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.SOCIAL_SERVICE},subType:{type:"string",const:r.Events.SubType.SocialService.FRIENDSHIP_REQUEST},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{requestId:{type:"string"},sender:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},receiver:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},message:{type:"string",nullable:!0}},required:["requestId","sender","receiver"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.FriendshipRequestEvent||(e.FriendshipRequestEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.SOCIAL_SERVICE},subType:{type:"string",const:r.Events.SubType.SocialService.FRIENDSHIP_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{requestId:{type:"string"},sender:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},receiver:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]}},required:["requestId","sender","receiver"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.FriendshipAcceptedEvent||(e.FriendshipAcceptedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.ON_DEMAND_CREDITS_GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creditsGranted:{type:"number",minimum:1},address:{type:"string"},granterAddress:{type:"string"}},required:["creditsGranted","address","granterAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsOnDemandEvent||(e.CreditsOnDemandEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.CREDITS_GOAL_COMPLETED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{goalId:{type:"string"},creditsObtained:{type:"number",minimum:0},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1},address:{type:"string"}},required:["goalId","creditsObtained","seasonId","weekNumber","address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsGoalCompletedEvent||(e.CreditsGoalCompletedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.COMPLETE_GOALS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1},pendingGoalIds:{type:"array",items:{type:"string"},minItems:1}},required:["address","seasonId","weekNumber","pendingGoalIds"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsCompleteGoalsReminderEvent||(e.CreditsCompleteGoalsReminderEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.USAGE_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},creditsAmount:{type:"number",minimum:1},expirationDate:{type:"string"},expirationDay:{type:"string"}},required:["address","creditsAmount","expirationDate","expirationDay"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsUsageReminderEvent||(e.CreditsUsageReminderEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.NEW_SEASON_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{addresses:{type:"array",items:{type:"string"}},seasonName:{type:"string"},startDate:{type:"string"},endDate:{type:"string"}},required:["addresses","seasonName","startDate","endDate"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsNewSeasonReminderEvent||(e.CreditsNewSeasonReminderEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.USAGE_24_HOURS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},creditsAmount:{type:"number",minimum:1},expirationDate:{type:"string"}},required:["address","creditsAmount","expirationDate"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsUsage24HoursReminderEvent||(e.CreditsUsage24HoursReminderEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.DO_NOT_MISS_OUT_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"}},required:["address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsDoNotMissOutReminderEvent||(e.CreditsDoNotMissOutReminderEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:r.Events.SubType.CreditsService.CLAIM_CREDITS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1}},required:["address","seasonId","weekNumber"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CreditsClaimReminderEvent||(e.CreditsClaimReminderEvent={}))})(eh)),eh}var th={},RR;function $V(){return RR||(RR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CommunityStreamingEndedEvent=e.StreamingPlaceUpdatedEvent=e.StreamingTimeExceededEvent=e.StreamingKeyExpiredEvent=e.StreamingKeyRevokeEvent=e.StreamingKeyResetEvent=void 0;const t=Ne(),r=Er(),n=id(),i={type:"object",properties:{title:{type:"string"},description:{type:"string"},position:{type:"string"},worldName:{type:"string",nullable:!0},isWorld:{type:"boolean"},url:{type:"string"},address:{type:"string"},image:{type:"string"}},required:["position","isWorld","url","title","description","address","image"],additionalProperties:!1};(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.STREAMING,r.Events.SubType.Streaming.STREAMING_KEY_RESET,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.StreamingKeyResetEvent||(e.StreamingKeyResetEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.STREAMING,r.Events.SubType.Streaming.STREAMING_KEY_REVOKE,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.StreamingKeyRevokeEvent||(e.StreamingKeyRevokeEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.STREAMING,r.Events.SubType.Streaming.STREAMING_KEY_EXPIRED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.StreamingKeyExpiredEvent||(e.StreamingKeyExpiredEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.STREAMING,r.Events.SubType.Streaming.STREAMING_TIME_EXCEEDED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.StreamingTimeExceededEvent||(e.StreamingTimeExceededEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.STREAMING,r.Events.SubType.Streaming.STREAMING_PLACE_UPDATED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.StreamingPlaceUpdatedEvent||(e.StreamingPlaceUpdatedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.STREAMING,r.Events.SubType.Streaming.COMMUNITY_STREAMING_ENDED,{type:"object",properties:{communityId:{type:"string"},totalParticipants:{type:"number"}},required:["communityId","totalParticipants"],additionalProperties:!1}),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.CommunityStreamingEndedEvent||(e.CommunityStreamingEndedEvent={}))})(th)),th}var rh={},wR;function qV(){return wR||(wR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UserUnbannedFromSceneEvent=e.UserBannedFromSceneEvent=e.UserLeftRoomEvent=e.UserJoinedRoomEvent=e.RoomType=void 0;const t=Ne(),r=Er();var n;(function(i){i.PRIVATE_MESSAGE="private-message",i.VOICE_CHAT="voice-chat",i.COMMUNITY_VOICE_CHAT="community-voice-chat",i.ISLAND="island",i.SCENE="scene",i.WORLD="world",i.UNKNOWN="unknown"})(n=e.RoomType||(e.RoomType={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMS},subType:{type:"string",const:r.Events.SubType.Comms.USER_JOINED_ROOM},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{parcel:{type:"string"},sceneId:{type:"string"},userAddress:{type:"string"},realmName:{type:"string"},islandName:{type:"string",nullable:!0},communityId:{type:"string",nullable:!0},voiceChatId:{type:"string",nullable:!0},isWorld:{type:"boolean"},roomType:{type:"string",enum:Object.values(n)}},required:["parcel","sceneId","userAddress","realmName","isWorld","roomType"]}},required:["type","subType","key","timestamp","metadata"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.UserJoinedRoomEvent||(e.UserJoinedRoomEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMS},subType:{type:"string",const:r.Events.SubType.Comms.USER_LEFT_ROOM},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{userAddress:{type:"string"},realmName:{type:"string"},isWorld:{type:"boolean"},roomType:{type:"string",enum:Object.values(n)},sceneId:{type:"string",nullable:!0},islandName:{type:"string",nullable:!0},communityId:{type:"string",nullable:!0},voiceChatId:{type:"string",nullable:!0}},required:["isWorld","userAddress","realmName","roomType"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.UserLeftRoomEvent||(e.UserLeftRoomEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMS},subType:{type:"string",const:r.Events.SubType.Comms.USER_BANNED_FROM_SCENE},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{placeTitle:{type:"string"},userAddress:{type:"string"}},required:["placeTitle","userAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.UserBannedFromSceneEvent||(e.UserBannedFromSceneEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMS},subType:{type:"string",const:r.Events.SubType.Comms.USER_UNBANNED_FROM_SCENE},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{placeTitle:{type:"string"},userAddress:{type:"string"}},required:["placeTitle","userAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.UserUnbannedFromSceneEvent||(e.UserUnbannedFromSceneEvent={}))})(rh)),rh}var nh={},AR;function BV(){return AR||(AR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReferralNewTierReachedEvent=e.ReferralInvitedUsersAcceptedEvent=void 0;const t=Ne(),r=Er(),n=id(),i={type:"object",properties:{title:{type:"string"},description:{type:"string"},address:{type:"string"},tier:{type:"number",minimum:1},url:{type:"string"},image:{type:"string"},invitedUserAddress:{type:"string"},invitedUsers:{type:"number",minimum:1},rarity:{type:"string",nullable:!0}},required:["address","tier","url","title","description","image","invitedUserAddress"],additionalProperties:!1};(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.REFERRAL,r.Events.SubType.Referral.REFERRAL_INVITED_USERS_ACCEPTED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.ReferralInvitedUsersAcceptedEvent||(e.ReferralInvitedUsersAcceptedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.REFERRAL,r.Events.SubType.Referral.REFERRAL_NEW_TIER_REACHED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.ReferralNewTierReachedEvent||(e.ReferralNewTierReachedEvent={}))})(nh)),nh}var ih={},OR;function kV(){return OR||(OR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CommunityVoiceChatStartedEvent=e.CommunityOwnershipTransferredEvent=e.CommunityPostAddedEvent=e.CommunityInviteReceivedEvent=e.CommunityRequestToJoinAcceptedEvent=e.CommunityRequestToJoinReceivedEvent=e.CommunityMemberRemovedEvent=e.CommunityMemberLeftEvent=e.CommunityMemberBannedEvent=e.CommunityRenamedEvent=e.CommunityDeletedContentViolationEvent=e.CommunityDeletedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.DELETED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddresses:{type:"array",items:{type:"string"}},thumbnailUrl:{type:"string"}},required:["id","name","memberAddresses","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityDeletedEvent||(e.CommunityDeletedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.DELETED_CONTENT_VIOLATION},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},ownerAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","ownerAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityDeletedContentViolationEvent||(e.CommunityDeletedContentViolationEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.RENAMED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},oldName:{type:"string"},newName:{type:"string"},memberAddresses:{type:"array",items:{type:"string"}},thumbnailUrl:{type:"string"}},required:["id","oldName","newName","memberAddresses","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityRenamedEvent||(e.CommunityRenamedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.MEMBER_BANNED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityMemberBannedEvent||(e.CommunityMemberBannedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.MEMBER_LEFT},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},memberAddress:{type:"string"}},required:["id","memberAddress"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityMemberLeftEvent||(e.CommunityMemberLeftEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.MEMBER_REMOVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityMemberRemovedEvent||(e.CommunityMemberRemovedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.REQUEST_TO_JOIN_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},memberName:{type:"string"},thumbnailUrl:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["communityId","communityName","memberAddress","memberName","thumbnailUrl","addressesToNotify"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityRequestToJoinReceivedEvent||(e.CommunityRequestToJoinReceivedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.REQUEST_TO_JOIN_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityRequestToJoinAcceptedEvent||(e.CommunityRequestToJoinAcceptedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.INVITE_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityInviteReceivedEvent||(e.CommunityInviteReceivedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.POST_ADDED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},thumbnailUrl:{type:"string"},postId:{type:"string"},authorAddress:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["addressesToNotify","communityId","communityName","thumbnailUrl","postId","authorAddress"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityPostAddedEvent||(e.CommunityPostAddedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.OWNERSHIP_TRANSFERRED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},oldOwnerAddress:{type:"string"},newOwnerAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","oldOwnerAddress","newOwnerAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityOwnershipTransferredEvent||(e.CommunityOwnershipTransferredEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.COMMUNITY},subType:{type:"string",const:r.Events.SubType.Community.VOICE_CHAT_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},thumbnailUrl:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["communityId","communityName","thumbnailUrl","addressesToNotify"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.CommunityVoiceChatStartedEvent||(e.CommunityVoiceChatStartedEvent={}))})(ih)),ih}var ah={},NR;function UV(){return NR||(NR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PhotoTakenEvent=e.PhotoPrivacyChangedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CAMERA},subType:{type:"string",const:r.Events.SubType.Camera.PHOTO_PRIVACY_CHANGED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{userAddress:{type:"string"},photoId:{type:"string"},isPublic:{type:"boolean"}},required:["userAddress","photoId","isPublic"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.PhotoPrivacyChangedEvent||(e.PhotoPrivacyChangedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CAMERA},subType:{type:"string",const:r.Events.SubType.Camera.PHOTO_TAKEN},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{sceneId:{type:"string"},userAddress:{type:"string"},realm:{type:"string"},photoId:{type:"string"},isPublic:{type:"boolean"},users:{type:"array",items:{type:"object",properties:{address:{type:"string"},isEmoting:{type:"boolean"}},required:["address","isEmoting"],additionalProperties:!1}},placeId:{type:"string",nullable:!0}},required:["userAddress","realm","photoId","isPublic","users"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.PhotoTakenEvent||(e.PhotoTakenEvent={}))})(ah)),ah}var sh={},PR;function FV(){return PR||(PR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EventEndedEvent=e.EventCreatedEvent=e.EventStartsSoonEvent=e.EventStartedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.EVENT},subType:{type:"string",const:r.Events.SubType.Event.EVENT_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},link:{type:"string"},communityId:{type:"string"},communityThumbnail:{type:"string",nullable:!0},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image","link"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.EventStartedEvent||(e.EventStartedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.EVENT},subType:{type:"string",const:r.Events.SubType.Event.EVENT_STARTS_SOON},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},link:{type:"string"},startsAt:{type:"string"},endsAt:{type:"string"},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image","link","startsAt","endsAt"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.EventStartsSoonEvent||(e.EventStartsSoonEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.EVENT},subType:{type:"string",const:r.Events.SubType.Event.EVENT_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},communityId:{type:"string"},communityName:{type:"string"},communityThumbnail:{type:"string",nullable:!0},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.EventCreatedEvent||(e.EventCreatedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.EVENT},subType:{type:"string",const:r.Events.SubType.Event.EVENT_ENDED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{communityId:{type:"string",nullable:!0},totalAttendees:{type:"number"}},required:["totalAttendees"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.EventEndedEvent||(e.EventEndedEvent={}))})(sh)),sh}var oh={},CR;function HV(){return CR||(CR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GovernanceCliffEndedEvent=e.GovernanceVotedOnBehalfEvent=e.GovernanceWhaleVoteEvent=e.GovernanceNewCommentOnProjectUpdatedEvent=e.GovernanceNewCommentOnProposalEvent=e.GovernanceVotingEndedVoterEvent=e.GovernanceAuthoredProposalFinishedEvent=e.GovernanceTenderPassedEvent=e.GovernancePitchPassedEvent=e.GovernanceCoauthorRequestedEvent=e.GovernanceProposalEnactedEvent=void 0;const t=Ne(),r=Er(),n=id(),i={type:"object",properties:{proposalId:{type:"string"},proposalTitle:{type:"string"},title:{type:"string"},description:{type:"string"},link:{type:"string"},address:{type:"string"}},required:["proposalId","proposalTitle","title","description","link","address"],additionalProperties:!1};(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.PROPOSAL_ENACTED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceProposalEnactedEvent||(e.GovernanceProposalEnactedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.COAUTHOR_REQUESTED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceCoauthorRequestedEvent||(e.GovernanceCoauthorRequestedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.PITCH_PASSED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernancePitchPassedEvent||(e.GovernancePitchPassedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.TENDER_PASSED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceTenderPassedEvent||(e.GovernanceTenderPassedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.AUTHORED_PROPOSAL_FINISHED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceAuthoredProposalFinishedEvent||(e.GovernanceAuthoredProposalFinishedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.VOTING_ENDED_VOTER,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceVotingEndedVoterEvent||(e.GovernanceVotingEndedVoterEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.NEW_COMMENT_ON_PROPOSAL,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceNewCommentOnProposalEvent||(e.GovernanceNewCommentOnProposalEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.NEW_COMMENT_ON_PROJECT_UPDATED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceNewCommentOnProjectUpdatedEvent||(e.GovernanceNewCommentOnProjectUpdatedEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.WHALE_VOTE,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceWhaleVoteEvent||(e.GovernanceWhaleVoteEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.VOTED_ON_BEHALF,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceVotedOnBehalfEvent||(e.GovernanceVotedOnBehalfEvent={})),(function(a){a.schema=(0,n.createEventSchema)(r.Events.Type.GOVERNANCE,r.Events.SubType.Governance.CLIFF_ENDED,i),a.validate=(0,t.generateLazyValidator)(a.schema)})(e.GovernanceCliffEndedEvent||(e.GovernanceCliffEndedEvent={}))})(oh)),oh}var uh={},MR;function VV(){return MR||(MR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorldsMissingResourcesEvent=e.WorldsAccessRestrictedEvent=e.WorldsPermissionGrantedEvent=e.WorldsPermissionRevokedEvent=e.WorldsAccessRestoredEvent=e.WorldDeploymentEvent=e.WorldUndeploymentEvent=e.WorldScenesUndeploymentEvent=e.WorldSpawnCoordinateSetEvent=e.WorldSettingsChangedEvent=void 0;const t=ru(),r=Ne(),n=Er();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLD_SETTINGS_CHANGED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{worldName:{type:"string"},title:{type:"string",nullable:!0},description:{type:"string",nullable:!0},contentRating:{type:"string",nullable:!0},skyboxTime:{type:"number",nullable:!0},categories:{type:"array",items:{type:"string"},nullable:!0},singlePlayer:{type:"boolean",nullable:!0},showInPlaces:{type:"boolean",nullable:!0},thumbnailUrl:{type:"string",nullable:!0},accessType:{type:"string",nullable:!0}},required:["worldName"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1}})(e.WorldSettingsChangedEvent||(e.WorldSettingsChangedEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLD_SPAWN_COORDINATE_SET},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z0-9_-]+\\.dcl\\.eth|[a-zA-Z0-9_-]+\\.eth$"},oldCoordinate:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1,nullable:!0},newCoordinate:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1}},required:["name","oldCoordinate","newCoordinate"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldSpawnCoordinateSetEvent||(e.WorldSpawnCoordinateSetEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLD_SCENES_UNDEPLOYMENT},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{worldName:{type:"string"},scenes:{type:"array",items:{type:"object",properties:{entityId:{type:"string"},baseParcel:{type:"string"}},required:["entityId","baseParcel"],additionalProperties:!1},minItems:1}},required:["worldName","scenes"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldScenesUndeploymentEvent||(e.WorldScenesUndeploymentEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLD_UNDEPLOYMENT},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{worldName:{type:"string"}},required:["worldName"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldUndeploymentEvent||(e.WorldUndeploymentEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.DEPLOYMENT},key:{type:"string"},timestamp:{type:"number",minimum:0},entity:{type:"object",properties:{entityId:{type:"string"},authChain:t.AuthChain.schema},additionalProperties:!0,required:["entityId","authChain"]},contentServerUrls:{type:"array",items:{type:"string"},nullable:!0},force:{type:"boolean",nullable:!0},animation:{type:"string",nullable:!0},lods:{type:"array",items:{type:"string"},nullable:!0}},required:["type","subType","key","timestamp","entity"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldDeploymentEvent||(e.WorldDeploymentEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLDS_ACCESS_RESTORED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},url:{type:"string"},attendee:{type:"string"}},required:["title","description","url","attendee"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldsAccessRestoredEvent||(e.WorldsAccessRestoredEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLDS_PERMISSION_REVOKED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},world:{type:"string"},permissions:{type:"array",items:{type:"string"}},url:{type:"string"},address:{type:"string"}},required:["title","description","world","permissions","url","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldsPermissionRevokedEvent||(e.WorldsPermissionRevokedEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLDS_PERMISSION_GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},world:{type:"string"},permissions:{type:"array",items:{type:"string"}},url:{type:"string"},address:{type:"string"}},required:["title","description","world","permissions","url","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldsPermissionGrantedEvent||(e.WorldsPermissionGrantedEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLDS_ACCESS_RESTRICTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},when:{type:"number"},address:{type:"string"}},required:["title","description","when","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldsAccessRestrictedEvent||(e.WorldsAccessRestrictedEvent={})),(function(i){i.schema={type:"object",properties:{type:{type:"string",const:n.Events.Type.WORLD},subType:{type:"string",const:n.Events.SubType.Worlds.WORLDS_MISSING_RESOURCES},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},url:{type:"string"},when:{type:"number"},address:{type:"string"}},required:["title","description","url","when","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,r.generateLazyValidator)(i.schema)})(e.WorldsMissingResourcesEvent||(e.WorldsMissingResourcesEvent={}))})(uh)),uh}var ch={},DR;function GV(){return DR||(DR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UserWarningCreatedEvent=e.UserBanLiftedEvent=e.UserBanCreatedEvent=void 0;const t=Ne(),r=Er();(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.MODERATION},subType:{type:"string",const:r.Events.SubType.Moderation.USER_BAN_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{id:{type:"string"},bannedAddress:{type:"string"},bannedBy:{type:"string"},reason:{type:"string"},bannedAt:{type:"number",minimum:0},expiresAt:{type:"number",nullable:!0,minimum:0},customMessage:{type:"string",nullable:!0}},required:["id","bannedAddress","bannedBy","reason","bannedAt","expiresAt"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.UserBanCreatedEvent||(e.UserBanCreatedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.MODERATION},subType:{type:"string",const:r.Events.SubType.Moderation.USER_BAN_LIFTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{id:{type:"string"},bannedAddress:{type:"string"},liftedBy:{type:"string"},liftedAt:{type:"number",minimum:0}},required:["id","bannedAddress","liftedBy","liftedAt"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.UserBanLiftedEvent||(e.UserBanLiftedEvent={})),(function(n){n.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.MODERATION},subType:{type:"string",const:r.Events.SubType.Moderation.USER_WARNING_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{id:{type:"string"},warnedAddress:{type:"string"},warnedBy:{type:"string"},reason:{type:"string"},warnedAt:{type:"number",minimum:0}},required:["id","warnedAddress","warnedBy","reason","warnedAt"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.UserWarningCreatedEvent||(e.UserWarningCreatedEvent={}))})(ch)),ch}var jR;function zV(){return jR||(jR=1,(function(e){var t=Hi&&Hi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Hi&&Hi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Er(),e),r(NV(),e),r(PV(),e),r(CV(),e),r(MV(),e),r(DV(),e),r(jV(),e),r(LV(),e),r($V(),e),r(qV(),e),r(BV(),e),r(kV(),e),r(UV(),e),r(FV(),e),r(HV(),e),r(VV(),e),r(GV(),e)})(Hi)),Hi}var LR;function sE(){return LR||(LR=1,(function(e){var t=$i&&$i.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=$i&&$i.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(pV(),e),r(hV(),e),r(UC(),e),r(rE(),e),r(jC(),e),r(SV(),e),r(HC(),e),r(IV(),e),r(wV(),e),r(OV(),e),r(zV(),e)})($i)),$i}var $R;function WV(){return $R||($R=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WearableJson=void 0;const t=nd(),r=Sa(),n=tE(),i=Ne(),a=sE();(function(s){s.schema={type:"object",properties:{description:{type:"string"},rarity:Object.assign(Object.assign({},t.Rarity.schema),{nullable:!0}),name:{type:"string"},data:{type:"object",properties:{replaces:{type:"array",items:r.WearableCategory.schema},hides:{type:"array",items:r.WearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:n.WearableRepresentation.schema,minItems:1},category:r.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:a.HideableWearableCategory.schema},blockVrmExport:{type:"boolean",nullable:!0},outlineCompatible:{type:"boolean",nullable:!0}},required:["replaces","hides","tags","representations","category"]}},additionalProperties:!0,required:["description","name","data"]},s.validate=(0,i.generateLazyValidator)(s.schema)})(e.WearableJson||(e.WearableJson={}))})(nm)),nm}var qR;function YV(){return qR||(qR=1,(function(e){var t=Li&&Li.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Li&&Li.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(dV(),e),r(WV(),e)})(Li)),Li}var BR;function xV(){return BR||(BR=1,(function(e){var t=Di&&Di.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Di&&Di.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(lV(),e),r(YV(),e)})(Di)),Di}var Vi={},lh={},kR;function KV(){return kR||(kR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Account=e.AccountSortBy=void 0;const t=Ne();(function(r){r.MOST_SALES="most_sales",r.MOST_PURCHASES="most_purchases",r.MOST_SPENT="most_spent",r.MOST_EARNED="most_earned",r.MOST_ROYALTIES="most_royalties",r.MOST_COLLECTIONS="most_collections"})(e.AccountSortBy||(e.AccountSortBy={})),(function(r){r.schema={type:"object",properties:{id:{type:"string"},address:{type:"string"},sales:{type:"integer"},purchases:{type:"integer"},spent:{type:"string"},earned:{type:"string"},royalties:{type:"string"},collections:{type:"number"}},required:["id","address","sales","purchases","spent","earned","royalties","collections"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Account||(e.Account={}))})(lh)),lh}var dh={},fh={},UR;function WC(){return UR||(UR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getChainId=e.ChainName=void 0;const t=Ne(),r=nn();var n;(function(a){a.ETHEREUM_MAINNET="Ethereum Mainnet",a.ETHEREUM_ROPSTEN="Ropsten",a.ETHEREUM_RINKEBY="Rinkeby",a.ETHEREUM_GOERLI="Goerli",a.ETHEREUM_KOVAN="Kovan",a.ETHEREUM_SEPOLIA="Sepolia",a.MATIC_MAINNET="Polygon",a.MATIC_MUMBAI="Mumbai",a.MATIC_AMOY="Amoy",a.AVALANCHE_MAINNET="Avalanche",a.BINANCE_MAINNET="Binance Smart Chain",a.ARBITRUM_MAINNET="Arbitrum",a.OPTIMISM_MAINNET="Optimism",a.FANTOM_MAINNET="Fantom"})(n=e.ChainName||(e.ChainName={}));function i(a){switch(a){case n.ETHEREUM_MAINNET:return r.ChainId.ETHEREUM_MAINNET;case n.ETHEREUM_ROPSTEN:return r.ChainId.ETHEREUM_ROPSTEN;case n.ETHEREUM_RINKEBY:return r.ChainId.ETHEREUM_RINKEBY;case n.ETHEREUM_GOERLI:return r.ChainId.ETHEREUM_GOERLI;case n.ETHEREUM_KOVAN:return r.ChainId.ETHEREUM_KOVAN;case n.ETHEREUM_SEPOLIA:return r.ChainId.ETHEREUM_SEPOLIA;case n.MATIC_MAINNET:return r.ChainId.MATIC_MAINNET;case n.MATIC_MUMBAI:return r.ChainId.MATIC_MUMBAI;case n.MATIC_AMOY:return r.ChainId.MATIC_AMOY;case n.AVALANCHE_MAINNET:return r.ChainId.AVALANCHE_MAINNET;case n.BINANCE_MAINNET:return r.ChainId.BSC_MAINNET;case n.ARBITRUM_MAINNET:return r.ChainId.ARBITRUM_MAINNET;case n.OPTIMISM_MAINNET:return r.ChainId.OPTIMISM_MAINNET;case n.FANTOM_MAINNET:return r.ChainId.FANTOM_MAINNET;default:return null}}e.getChainId=i,(function(a){a.schema={type:"string",enum:Object.values(a)},a.validate=(0,t.generateLazyValidator)(a.schema)})(n=e.ChainName||(e.ChainName={}))})(fh)),fh}var ph={},FR;function rn(){return FR||(FR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Network=void 0;const t=Ne();(function(r){r.ETHEREUM="ETHEREUM",r.MATIC="MATIC",r.AVALANCHE="AVALANCHE",r.BSC="BINANCE SMART CHAIN",r.OPTIMISM="OPTIMISM",r.ARBITRUM="ARBITRUM",r.FANTOM="FANTOM"})(e.Network||(e.Network={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Network||(e.Network={}))})(ph)),ph}var HR;function nn(){return HR||(HR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getNetwork=e.getNetworkMapping=e.getURNProtocol=e.getChainName=e.ChainId=void 0;const t=Ne(),r=WC(),n=rn();var i;(function(l){l[l.ETHEREUM_MAINNET=1]="ETHEREUM_MAINNET",l[l.ETHEREUM_ROPSTEN=3]="ETHEREUM_ROPSTEN",l[l.ETHEREUM_RINKEBY=4]="ETHEREUM_RINKEBY",l[l.ETHEREUM_GOERLI=5]="ETHEREUM_GOERLI",l[l.ETHEREUM_KOVAN=42]="ETHEREUM_KOVAN",l[l.ETHEREUM_SEPOLIA=11155111]="ETHEREUM_SEPOLIA",l[l.MATIC_MAINNET=137]="MATIC_MAINNET",l[l.MATIC_MUMBAI=80001]="MATIC_MUMBAI",l[l.MATIC_AMOY=80002]="MATIC_AMOY",l[l.BSC_MAINNET=56]="BSC_MAINNET",l[l.OPTIMISM_MAINNET=10]="OPTIMISM_MAINNET",l[l.ARBITRUM_MAINNET=42161]="ARBITRUM_MAINNET",l[l.FANTOM_MAINNET=250]="FANTOM_MAINNET",l[l.AVALANCHE_MAINNET=43114]="AVALANCHE_MAINNET"})(i=e.ChainId||(e.ChainId={}));function a(l){switch(l){case i.ETHEREUM_MAINNET:return r.ChainName.ETHEREUM_MAINNET;case i.ETHEREUM_ROPSTEN:return r.ChainName.ETHEREUM_ROPSTEN;case i.ETHEREUM_RINKEBY:return r.ChainName.ETHEREUM_RINKEBY;case i.ETHEREUM_GOERLI:return r.ChainName.ETHEREUM_GOERLI;case i.ETHEREUM_KOVAN:return r.ChainName.ETHEREUM_KOVAN;case i.ETHEREUM_SEPOLIA:return r.ChainName.ETHEREUM_SEPOLIA;case i.MATIC_MAINNET:return r.ChainName.MATIC_MAINNET;case i.MATIC_MUMBAI:return r.ChainName.MATIC_MUMBAI;case i.MATIC_AMOY:return r.ChainName.MATIC_AMOY;case i.BSC_MAINNET:return r.ChainName.BINANCE_MAINNET;case i.ARBITRUM_MAINNET:return r.ChainName.ARBITRUM_MAINNET;case i.OPTIMISM_MAINNET:return r.ChainName.OPTIMISM_MAINNET;case i.FANTOM_MAINNET:return r.ChainName.FANTOM_MAINNET;case i.AVALANCHE_MAINNET:return r.ChainName.AVALANCHE_MAINNET;default:return null}}e.getChainName=a;function s(l){switch(l){case i.ETHEREUM_MAINNET:return"ethereum";case i.ETHEREUM_ROPSTEN:return"ropsten";case i.ETHEREUM_RINKEBY:return"rinkeby";case i.ETHEREUM_GOERLI:return"goerli";case i.ETHEREUM_KOVAN:return"kovan";case i.ETHEREUM_SEPOLIA:return"sepolia";case i.MATIC_MAINNET:return"matic";case i.MATIC_MUMBAI:return"mumbai";case i.MATIC_AMOY:return"amoy";default:return""}}e.getURNProtocol=s;function o(l){const c={[n.Network.BSC]:i.BSC_MAINNET,[n.Network.OPTIMISM]:i.OPTIMISM_MAINNET,[n.Network.ARBITRUM]:i.ARBITRUM_MAINNET,[n.Network.FANTOM]:i.FANTOM_MAINNET,[n.Network.AVALANCHE]:i.AVALANCHE_MAINNET};switch(l){case i.ETHEREUM_MAINNET:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_MAINNET,[n.Network.MATIC]:i.MATIC_MAINNET},c);case i.ETHEREUM_ROPSTEN:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_ROPSTEN,[n.Network.MATIC]:i.MATIC_MUMBAI},c);case i.ETHEREUM_RINKEBY:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_RINKEBY,[n.Network.MATIC]:i.MATIC_MUMBAI},c);case i.ETHEREUM_GOERLI:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_GOERLI,[n.Network.MATIC]:i.MATIC_MUMBAI},c);case i.ETHEREUM_KOVAN:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_KOVAN,[n.Network.MATIC]:i.MATIC_MUMBAI},c);case i.ETHEREUM_SEPOLIA:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_SEPOLIA,[n.Network.MATIC]:i.MATIC_AMOY},c);case i.MATIC_MAINNET:return Object.assign({[n.Network.ETHEREUM]:i.MATIC_MAINNET,[n.Network.MATIC]:i.MATIC_MAINNET},c);case i.MATIC_MUMBAI:return Object.assign({[n.Network.ETHEREUM]:i.MATIC_MUMBAI,[n.Network.MATIC]:i.MATIC_MUMBAI},c);case i.MATIC_AMOY:return Object.assign({[n.Network.ETHEREUM]:i.MATIC_AMOY,[n.Network.MATIC]:i.MATIC_AMOY},c);default:return Object.assign({[n.Network.ETHEREUM]:i.ETHEREUM_MAINNET,[n.Network.MATIC]:i.MATIC_MAINNET},c)}}e.getNetworkMapping=o;function u(l){switch(l){case i.ETHEREUM_MAINNET:case i.ETHEREUM_ROPSTEN:case i.ETHEREUM_GOERLI:case i.ETHEREUM_KOVAN:case i.ETHEREUM_RINKEBY:case i.ETHEREUM_SEPOLIA:return n.Network.ETHEREUM;case i.MATIC_MAINNET:case i.MATIC_MUMBAI:case i.MATIC_AMOY:return n.Network.MATIC;case i.BSC_MAINNET:return n.Network.BSC;case i.OPTIMISM_MAINNET:return n.Network.OPTIMISM;case i.ARBITRUM_MAINNET:return n.Network.ARBITRUM;case i.FANTOM_MAINNET:return n.Network.FANTOM;case i.AVALANCHE_MAINNET:return n.Network.AVALANCHE}}e.getNetwork=u,(function(l){l.schema={type:"number",enum:Object.values(l)},l.validate=(0,t.generateLazyValidator)(l.schema)})(i=e.ChainId||(e.ChainId={}))})(dh)),dh}var mh={},VR;function XV(){return VR||(VR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Collection=e.CollectionSortBy=void 0;const t=Ne(),r=nn(),n=rn();(function(i){i.NEWEST="newest",i.NAME="name",i.RECENTLY_REVIEWED="recently_reviewed",i.RECENTLY_LISTED="recently_listed",i.SIZE="size"})(e.CollectionSortBy||(e.CollectionSortBy={})),(function(i){i.schema={type:"object",properties:{urn:{type:"string"},creator:{type:"string"},name:{type:"string"},contractAddress:{type:"string"},size:{type:"integer"},isOnSale:{type:"boolean"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},network:n.Network.schema,chainId:r.ChainId.schema,firstListedAt:{type:"integer",nullable:!0}},required:["urn","creator","name","contractAddress","isOnSale","size","createdAt","updatedAt","reviewedAt","network","chainId"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.Collection||(e.Collection={}))})(mh)),mh}var hh={},yh={},GR;function ad(){return GR||(GR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NFTCategory=void 0;const t=Ne();(function(r){r.PARCEL="parcel",r.ESTATE="estate",r.WEARABLE="wearable",r.ENS="ens",r.EMOTE="emote"})(e.NFTCategory||(e.NFTCategory={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.NFTCategory||(e.NFTCategory={}))})(yh)),yh}var zR;function JV(){return zR||(zR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Contract=e.ContractSortBy=void 0;const t=Ne(),r=nn(),n=rn(),i=ad();(function(a){a.NAME="name"})(e.ContractSortBy||(e.ContractSortBy={})),(function(a){a.schema={type:"object",properties:{name:{type:"string"},address:{type:"string"},category:i.NFTCategory.schema,network:n.Network.schema,chainId:r.ChainId.schema},required:["name","address","category","network","chainId"]},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.Contract||(e.Contract={}))})(hh)),hh}var gh={},_h={},WR;function YC(){return WR||(WR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NFT=e.NFTSortBy=void 0;const t=Ne(),r=nn(),n=sE(),i=rn(),a=ad(),s=nd(),o=Sa();(function(u){u.NAME="name",u.NEWEST="newest",u.RECENTLY_LISTED="recently_listed",u.RECENTLY_SOLD="recently_sold",u.CHEAPEST="cheapest",u.RENTAL_LISTING_DATE="rental_listing_date",u.RENTAL_DATE="rented_date",u.MAX_RENTAL_PRICE="max_rental_price",u.MIN_RENTAL_PRICE="min_rental_price"})(e.NFTSortBy||(e.NFTSortBy={})),(function(u){u.schema={type:"object",properties:{id:{type:"string"},tokenId:{type:"string"},contractAddress:{type:"string"},activeOrderId:{type:"string",nullable:!0},utility:{type:"string",nullable:!0},openRentalId:{type:"string",nullable:!0},owner:{type:"string"},name:{type:"string"},image:{type:"string"},url:{type:"string"},data:{type:"object",nullable:!1,properties:{parcel:{type:"object",properties:{description:{type:["string"],nullable:!0},x:{type:"string"},y:{type:"string"},estate:{type:"object",properties:{tokenId:{type:"string"},name:{type:"string"}},required:["tokenId","name"],nullable:!0}},required:["description","x","y","estate"],nullable:!0},estate:{type:"object",properties:{description:{type:["string"],nullable:!0},size:{type:"integer"},parcels:{type:"array",items:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"]}}},required:["description","size","parcels"],nullable:!0},wearable:{type:"object",properties:{bodyShapes:{type:"array",items:n.BodyShape.schema},category:o.WearableCategory.schema,description:{type:"string"},rarity:s.Rarity.schema,isSmart:{type:"boolean"}},required:["bodyShapes","category","description","rarity","isSmart"],nullable:!0},ens:{type:"object",properties:{subdomain:{type:"string"}},required:["subdomain"],nullable:!0},emote:{type:"object",properties:{bodyShapes:{type:"array",items:n.BodyShape.schema},category:n.EmoteCategory.schema,description:{type:"string"},rarity:s.Rarity.schema,loop:{type:"boolean"},hasSound:{type:"boolean"},hasGeometry:{type:"boolean"},outcomeType:{type:"string",nullable:!0}},required:["bodyShapes","category","description","rarity","loop"],nullable:!0}},required:[]},issuedId:{type:"string",nullable:!0},itemId:{type:"string",nullable:!0},category:a.NFTCategory.schema,network:i.Network.schema,chainId:r.ChainId.schema,createdAt:{type:"integer"},updatedAt:{type:"integer"},soldAt:{type:"integer"},urn:{type:"string",nullable:!0}},required:["id","tokenId","contractAddress","activeOrderId","openRentalId","owner","name","image","url","data","issuedId","itemId","category","network","chainId","createdAt","updatedAt","soldAt"]},u.validate=(0,t.generateLazyValidator)(u.schema)})(e.NFT||(e.NFT={}))})(_h)),_h}var YR;function QV(){return YR||(YR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Item=e.ItemSortBy=void 0;const t=Ne(),r=nn(),n=rn(),i=YC(),a=ad();(function(s){s.NAME="name",s.NEWEST="newest",s.RECENTLY_REVIEWED="recently_reviewed",s.RECENTLY_SOLD="recently_sold",s.RECENTLY_LISTED="recently_listed",s.CHEAPEST="cheapest"})(e.ItemSortBy||(e.ItemSortBy={})),(function(s){s.schema={type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail:{type:"string"},url:{type:"string"},category:a.NFTCategory.schema,contractAddress:{type:"string"},itemId:{type:"string"},rarity:{type:"string"},price:{type:"string"},available:{type:"integer"},isOnSale:{type:"boolean"},creator:{type:"string"},beneficiary:{type:"string",nullable:!0},tradeId:{type:"string",nullable:!0},tradeContractAddress:{type:"string",nullable:!0},data:i.NFT.schema.properties.data,network:n.Network.schema,chainId:r.ChainId.schema,urn:{type:"string"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},soldAt:{type:"integer"},firstListedAt:{type:"integer",nullable:!0},picks:{type:"object",properties:{pickedByUser:{type:"boolean",nullable:!0},count:{type:"integer"}},required:["count"],nullable:!0},minPrice:{type:"string",nullable:!0},utility:{type:"string",nullable:!0},minListingPrice:{type:"string",nullable:!0},maxListingPrice:{type:"string",nullable:!0},listings:{type:"integer",nullable:!0},owners:{type:"integer",nullable:!0},tradeExpiresAt:{type:"integer",nullable:!0}},required:["id","name","thumbnail","url","category","contractAddress","itemId","rarity","price","available","isOnSale","creator","data","network","chainId","createdAt","updatedAt","soldAt"]},s.validate=(0,t.generateLazyValidator)(s.schema)})(e.Item||(e.Item={}))})(gh)),gh}var Eh={},xR;function oE(){return xR||(xR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ListingStatus=void 0;const t=Ne();(function(r){r.OPEN="open",r.SOLD="sold",r.CANCELLED="cancelled"})(e.ListingStatus||(e.ListingStatus={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.ListingStatus||(e.ListingStatus={}))})(Eh)),Eh}var vh={},KR;function ZV(){return KR||(KR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetaTransaction=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{from:{type:"string"},params:{type:"array",items:[{type:"string"},{type:"string"}],additionalItems:!1,minItems:2}},additionalProperties:!1,required:["from","params"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.MetaTransaction||(e.MetaTransaction={}))})(vh)),vh}var bh={},XR;function eG(){return XR||(XR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Mint=e.MintSortBy=void 0;const t=Ne(),r=nn(),n=rn();(function(i){i.RECENTLY_MINTED="recently_minted",i.MOST_EXPENSIVE="most_expensive"})(e.MintSortBy||(e.MintSortBy={})),(function(i){i.schema={type:"object",properties:{id:{type:"string"},creator:{type:"string"},beneficiary:{type:"string"},minter:{type:"string"},price:{type:"string",nullable:!0},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},issuedId:{type:"string"},timestamp:{type:"integer"},network:n.Network.schema,chainId:r.ChainId.schema},required:["id","creator","beneficiary","minter","itemId","tokenId","issuedId","contractAddress","price","timestamp","network","chainId"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.Mint||(e.Mint={}))})(bh)),bh}var Th={},JR;function tG(){return JR||(JR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CatalogSortDirection=e.CatalogSortBy=void 0,(function(t){t.NEWEST="newest",t.RECENTLY_SOLD="recently_sold",t.CHEAPEST="cheapest",t.MOST_EXPENSIVE="most_expensive",t.RECENTLY_LISTED="recently_listed"})(e.CatalogSortBy||(e.CatalogSortBy={})),(function(t){t.ASC="asc",t.DESC="desc"})(e.CatalogSortDirection||(e.CatalogSortDirection={}))})(Th)),Th}var Sh={},QR;function rG(){return QR||(QR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Order=e.OrderSortBy=void 0;const t=Ne(),r=nn(),n=oE(),i=rn();(function(a){a.RECENTLY_LISTED="recently_listed",a.RECENTLY_UPDATED="recently_updated",a.CHEAPEST="cheapest",a.ISSUED_ID_ASC="issued_id_asc",a.ISSUED_ID_DESC="issued_id_desc",a.OLDEST="oldest"})(e.OrderSortBy||(e.OrderSortBy={})),(function(a){a.schema={type:"object",properties:{id:{type:"string"},marketplaceAddress:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},owner:{type:"string"},buyer:{type:["string"],nullable:!0},price:{type:"string"},status:n.ListingStatus.schema,network:i.Network.schema,chainId:r.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"},issuedId:{type:"string"},tradeId:{type:"string",nullable:!0}},required:["id","marketplaceAddress","contractAddress","tokenId","owner","buyer","price","status","network","chainId","expiresAt","createdAt","updatedAt"]},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.Order||(e.Order={}))})(Sh)),Sh}var Ih={},ZR;function nG(){return ZR||(ZR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderType=void 0;const t=Ne();(function(r){r.INJECTED="injected",r.MAGIC="magic",r.MAGIC_TEST="magic_test",r.FORTMATIC="formatic",r.NETWORK="network",r.WALLET_CONNECT="wallet_connect",r.WALLET_CONNECT_V2="wallet_connect_v2",r.WALLET_LINK="wallet_link",r.METAMASK_MOBILE="metamask_mobile",r.AUTH_SERVER="auth_server",r.THIRDWEB="thirdweb"})(e.ProviderType||(e.ProviderType={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.ProviderType||(e.ProviderType={}))})(Ih)),Ih}var Rh={},ew;function xC(){return ew||(ew=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SaleType=void 0;const t=Ne();(function(r){r.ORDER="order",r.BID="bid",r.MINT="mint"})(e.SaleType||(e.SaleType={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.SaleType||(e.SaleType={}))})(Rh)),Rh}var wh={},tw;function iG(){return tw||(tw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Sale=e.SaleSortBy=void 0;const t=Ne(),r=nn(),n=xC(),i=rn();(function(a){a.RECENTLY_SOLD="recently_sold",a.MOST_EXPENSIVE="most_expensive"})(e.SaleSortBy||(e.SaleSortBy={})),(function(a){a.schema={type:"object",properties:{id:{type:"string"},type:n.SaleType.schema,buyer:{type:"string"},seller:{type:"string"},price:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},txHash:{type:"string"},timestamp:{type:"integer"},network:i.Network.schema,chainId:r.ChainId.schema},required:["id","buyer","seller","itemId","tokenId","price","contractAddress","timestamp","txHash","network","chainId"]},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.Sale||(e.Sale={}))})(wh)),wh}var Ah={},rw;function aG(){return rw||(rw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RentalListingCreation=e.PeriodCreation=e.RentalsListingsSortBy=e.RentalsListingsFilterByCategory=e.RentalsListingSortDirection=e.RentalStatus=void 0;const t=Ne(),r=nn(),n=rn();(function(a){a.OPEN="open",a.CANCELLED="cancelled",a.EXECUTED="executed",a.CLAIMED="claimed"})(e.RentalStatus||(e.RentalStatus={})),(function(a){a.ASC="asc",a.DESC="desc"})(e.RentalsListingSortDirection||(e.RentalsListingSortDirection={})),(function(a){a.PARCEL="parcel",a.ESTATE="estate"})(e.RentalsListingsFilterByCategory||(e.RentalsListingsFilterByCategory={})),(function(a){a.LAND_CREATION_DATE="land_creation_date",a.RENTAL_LISTING_DATE="rental_listing_date",a.RENTAL_DATE="rented_date",a.NAME="name",a.MAX_RENTAL_PRICE="max_rental_price",a.MIN_RENTAL_PRICE="min_rental_price"})(e.RentalsListingsSortBy||(e.RentalsListingsSortBy={}));var i;(function(a){a.schema={type:"object",properties:{minDays:{type:"integer",minimum:0,maximum:2147483647},maxDays:{type:"integer",minimum:0,maximum:2147483647},pricePerDay:{type:"string",pattern:"^[0-9]+$"}},additionalProperties:!1,required:["minDays","maxDays","pricePerDay"]},a.validate=(0,t.generateLazyValidator)(a.schema)})(i=e.PeriodCreation||(e.PeriodCreation={})),(function(a){a.schema={type:"object",properties:{network:n.Network.schema,chainId:r.ChainId.schema,expiration:{type:"number",minimum:0},signature:{type:"string",minLength:1},tokenId:{type:"string",minLength:1},nonces:{type:"array",minItems:3,maxItems:3,items:{minLength:1,type:"string",pattern:"^[0-9]+$"}},contractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},rentalContractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},periods:{type:"array",minItems:1,maxItems:100,uniqueItems:!0,items:i.schema},target:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"}},additionalProperties:!1,required:["network","chainId","expiration","signature","nonces","tokenId","contractAddress","rentalContractAddress","periods","target"]},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.RentalListingCreation||(e.RentalListingCreation={}))})(Ah)),Ah}var Oh={},nw;function sG(){return nw||(nw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnalyticsDayDataSortBy=void 0,(function(t){t.DATE="date",t.MOST_SALES="most_sales"})(e.AnalyticsDayDataSortBy||(e.AnalyticsDayDataSortBy={}))})(Oh)),Oh}var Nh={},iw;function oG(){return iw||(iw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Store=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{id:{type:"string"},version:{type:"number"},owner:{type:"string"},description:{type:"string"},links:{type:"array",items:{type:"object",properties:{name:{type:"string"},url:{type:"string"}},required:["name","url"]}},images:{type:"array",items:{type:"object",properties:{name:{type:"string"},file:{type:"string"}},required:["name","file"]}}},required:["id","version","owner","description","links","images"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.Store||(e.Store={}))})(Nh)),Nh}var Ph={},aw;function uG(){return aw||(aw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GenderFilterOption=e.WearableGender=void 0;const t=Ne();(function(r){r.MALE="male",r.FEMALE="female"})(e.WearableGender||(e.WearableGender={})),(function(r){r.MALE="male",r.FEMALE="female",r.UNISEX="unisex"})(e.GenderFilterOption||(e.GenderFilterOption={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.WearableGender||(e.WearableGender={}))})(Ph)),Ph}var Ch={},sw;function cG(){return sw||(sw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.World=e.isInsideWorldLimits=e.getWorld=void 0;const t=Ne();function r(){return{validWorldRanges:[{xMin:-150,yMin:-150,xMax:150,yMax:150},{xMin:62,yMin:151,xMax:162,yMax:158},{xMin:151,yMin:144,xMax:162,yMax:150},{xMin:151,yMin:59,xMax:163,yMax:143}]}}e.getWorld=r;function n(i,a){const s=r().validWorldRanges;for(const o of s)if(i>=o.xMin&&i<=o.xMax&&a>=o.yMin&&a<=o.yMax)return!0;return!1}e.isInsideWorldLimits=n,(function(i){i.schema={type:"object",required:["validWorldRanges"],properties:{validWorldRanges:{type:"array",default:[{xMin:-150,yMin:-150,xMax:150,yMax:150}],items:{type:"object",required:["xMin","yMin","xMax","yMax"],properties:{xMin:{type:"integer"},yMin:{type:"integer"},xMax:{type:"integer"},yMax:{type:"integer"}}}}},additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(e.World||(e.World={}))})(Ch)),Ch}var Mh={},ow;function lG(){return ow||(ow=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Bid=e.BidSortBy=void 0;const t=Ne(),r=nn(),n=oE(),i=rn();(function(a){a.RECENTLY_OFFERED="recently_offered",a.RECENTLY_UPDATED="recently_updated",a.MOST_EXPENSIVE="most_expensive"})(e.BidSortBy||(e.BidSortBy={})),(function(a){const s={properties:{id:{type:"string"},bidder:{type:"string"},seller:{type:"string"},price:{type:"string"},fingerprint:{type:"string"},status:n.ListingStatus.schema,contractAddress:{type:"string"},network:i.Network.schema,chainId:r.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"}},required:["id","bidder","seller","price","fingerprint","status","contractAddress","network","chainId","expiresAt","createdAt","updatedAt"]};a.schema={type:"object",required:[],oneOf:[{properties:Object.assign(Object.assign({},s.properties),{tradeId:{type:"string"},tokenId:{type:"string"}}),required:[...s.required,"tradeId","tokenId"]},{type:"object",properties:Object.assign(Object.assign({},s.properties),{tradeId:{type:"string"},itemId:{type:"string"}}),required:[...s.required,"tradeId","itemId"]},{type:"object",properties:Object.assign(Object.assign({},s.properties),{bidAddress:{type:"string"},blockchainId:{type:"string"},blockNumber:{type:"string"},tokenId:{type:"string"}}),required:[...s.required,"bidAddress","blockchainId","blockNumber","tokenId"]}]},a.validate=(0,t.generateLazyValidator)(a.schema)})(e.Bid||(e.Bid={}))})(Mh)),Mh}var Dh={},uw;function dG(){return uw||(uw=1,Object.defineProperty(Dh,"__esModule",{value:!0})),Dh}var jh={},cw;function fG(){return cw||(cw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TradeAssetDirection=e.TradeAssetType=e.TradeType=void 0,(function(t){t.BID="bid",t.PUBLIC_NFT_ORDER="public_nft_order",t.PUBLIC_ITEM_ORDER="public_item_order"})(e.TradeType||(e.TradeType={})),(function(t){t[t.ERC20=1]="ERC20",t[t.USD_PEGGED_MANA=2]="USD_PEGGED_MANA",t[t.ERC721=3]="ERC721",t[t.COLLECTION_ITEM=4]="COLLECTION_ITEM"})(e.TradeAssetType||(e.TradeAssetType={})),(function(t){t.SENT="sent",t.RECEIVED="received"})(e.TradeAssetDirection||(e.TradeAssetDirection={}))})(jh)),jh}var Gi={},Lh={},lw;function pG(){return lw||(lw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewCamera=void 0;const t=Ne();(function(r){r.STATIC="static",r.INTERACTIVE="interactive"})(e.PreviewCamera||(e.PreviewCamera={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.PreviewCamera||(e.PreviewCamera={}))})(Lh)),Lh}var $h={},dw;function mG(){return dw||(dw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewUnityMode=void 0,(function(t){t.AUTH="authentication",t.BUILDER="builder",t.MARKETPLACE="marketplace",t.PROFILE="profile",t.CONFIG="configurator",t.JESUS="jesus"})(e.PreviewUnityMode||(e.PreviewUnityMode={}))})($h)),$h}var qh={},fw;function hG(){return fw||(fw=1,Object.defineProperty(qh,"__esModule",{value:!0})),qh}var Bh={},pw;function yG(){return pw||(pw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewEmoteEventType=void 0;const t=Ne();(function(r){r.ANIMATION_PLAY="animation_play",r.ANIMATION_PAUSE="animation_pause",r.ANIMATION_LOOP="animation_loop",r.ANIMATION_END="animation_end",r.ANIMATION_PLAYING="animation_playing"})(e.PreviewEmoteEventType||(e.PreviewEmoteEventType={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.PreviewEmoteEventType||(e.PreviewEmoteEventType={}))})(Bh)),Bh}var kh={},mw;function gG(){return mw||(mw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewEmote=void 0;const t=Ne();(function(r){r.IDLE="idle",r.WALK="walk",r.RUN="run",r.JUMP="jump",r.CLAP="clap",r.DAB="dab",r.DANCE="dance",r.FASHION="fashion",r.FASHION_2="fashion-2",r.FASHION_3="fashion-3",r.FASHION_4="fashion-4",r.LOVE="love",r.MONEY="money",r.FIST_PUMP="fist-pump",r.HEAD_EXPLODE="head-explode",r.WAVE="wave"})(e.PreviewEmote||(e.PreviewEmote={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.PreviewEmote||(e.PreviewEmote={}))})(kh)),kh}var Uh={},hw;function _G(){return hw||(hw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sendMessage=e.PreviewRenderer=e.PreviewMessageType=void 0;const t=Ne();(function(n){n.READY="ready",n.LOAD="load",n.ERROR="error",n.UPDATE="update",n.CONTROLLER_REQUEST="controller_request",n.CONTROLLER_RESPONSE="controller_response",n.EMOTE_EVENT="emote_event"})(e.PreviewMessageType||(e.PreviewMessageType={})),(function(n){n.BABYLON="babylon",n.UNITY="unity"})(e.PreviewRenderer||(e.PreviewRenderer={})),(function(n){n.schema={type:"string",enum:Object.values(n)},n.validate=(0,t.generateLazyValidator)(n.schema)})(e.PreviewMessageType||(e.PreviewMessageType={}));const r=(n,i,a,s="*")=>{const o={type:i,payload:a};n.postMessage(o,s)};e.sendMessage=r})(Uh)),Uh}var Fh={},yw;function EG(){return yw||(yw=1,Object.defineProperty(Fh,"__esModule",{value:!0})),Fh}var Hh={},gw;function vG(){return gw||(gw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewProjection=void 0;const t=Ne();(function(r){r.ORTHOGRAPHIC="orthographic",r.PERSPECTIVE="perspective"})(e.PreviewProjection||(e.PreviewProjection={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.PreviewProjection||(e.PreviewProjection={}))})(Hh)),Hh}var Vh={},_w;function bG(){return _w||(_w=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewType=void 0;const t=Ne();(function(r){r.TEXTURE="texture",r.WEARABLE="wearable",r.AVATAR="avatar"})(e.PreviewType||(e.PreviewType={})),(function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.PreviewType||(e.PreviewType={}))})(Vh)),Vh}var Gh={},Ew;function TG(){return Ew||(Ew=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpringBoneParams=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{stiffness:{type:"number",minimum:0,maximum:5},gravityPower:{type:"number",minimum:0,maximum:10},gravityDir:{type:"array",items:[{type:"number"},{type:"number"},{type:"number"}],minItems:3,maxItems:3},dragForce:{type:"number",minimum:0,maximum:1},center:{type:"integer",minimum:0,nullable:!0}},required:["stiffness","gravityPower","gravityDir","dragForce"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.SpringBoneParams||(e.SpringBoneParams={}))})(Gh)),Gh}var zh={},vw;function SG(){return vw||(vw=1,Object.defineProperty(zh,"__esModule",{value:!0})),zh}var Wh={},bw;function IG(){return bw||(bw=1,Object.defineProperty(Wh,"__esModule",{value:!0})),Wh}var Yh={},Tw;function RG(){return Tw||(Tw=1,Object.defineProperty(Yh,"__esModule",{value:!0})),Yh}var xh={},Sw;function wG(){return Sw||(Sw=1,Object.defineProperty(xh,"__esModule",{value:!0})),xh}var Kh={},Iw;function AG(){return Iw||(Iw=1,Object.defineProperty(Kh,"__esModule",{value:!0})),Kh}var Xh={},Rw;function OG(){return Rw||(Rw=1,Object.defineProperty(Xh,"__esModule",{value:!0})),Xh}var Jh={},ww;function NG(){return ww||(ww=1,Object.defineProperty(Jh,"__esModule",{value:!0})),Jh}var Qh={},Aw;function PG(){return Aw||(Aw=1,Object.defineProperty(Qh,"__esModule",{value:!0})),Qh}var Ow;function CG(){return Ow||(Ow=1,(function(e){var t=Gi&&Gi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Gi&&Gi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(pG(),e),r(mG(),e),r(hG(),e),r(yG(),e),r(gG(),e),r(_G(),e),r(EG(),e),r(vG(),e),r(bG(),e),r(TG(),e),r(SG(),e),r(IG(),e),r(RG(),e),r(wG(),e),r(AG(),e),r(OG(),e),r(NG(),e),r(PG(),e)})(Gi)),Gi}var zi={},Ys={},Nw;function MG(){if(Nw)return Ys;Nw=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.isSysLink=void 0;const e=t=>t!==null&&typeof t=="object"&&"sys"in t&&"id"in t.sys;return Ys.isSysLink=e,Ys}var xs={},Pw;function DG(){if(Pw)return xs;Pw=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.ContentfulLocale=void 0;var e;return(function(t){t.enUS="en-US",t.es="es",t.zh="zh"})(e||(e={})),xs.ContentfulLocale=e,xs}var Zh={},Cw;function jG(){return Cw||(Cw=1,Object.defineProperty(Zh,"__esModule",{value:!0})),Zh}var Mw;function LG(){return Mw||(Mw=1,(function(e){var t=zi&&zi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=zi&&zi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(MG(),e),r(DG(),e),r(jG(),e)})(zi)),zi}var Dw;function $G(){return Dw||(Dw=1,(function(e){var t=Vi&&Vi.__createBinding||(Object.create?(function(z,Y,W,U){U===void 0&&(U=W);var F=Object.getOwnPropertyDescriptor(Y,W);(!F||("get"in F?!Y.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return Y[W]}}),Object.defineProperty(z,U,F)}):(function(z,Y,W,U){U===void 0&&(U=W),z[U]=Y[W]})),r=Vi&&Vi.__exportStar||function(z,Y){for(var W in z)W!=="default"&&!Object.prototype.hasOwnProperty.call(Y,W)&&t(Y,z,W)};Object.defineProperty(e,"__esModule",{value:!0}),e.isInsideWorldLimits=e.getWorld=e.World=e.GenderFilterOption=e.WearableGender=e.Store=e.AnalyticsDayDataSortBy=e.PeriodCreation=e.RentalListingCreation=e.RentalsListingsSortBy=e.RentalsListingsFilterByCategory=e.RentalsListingSortDirection=e.RentalStatus=e.SaleSortBy=e.Sale=e.SaleType=e.Rarity=e.ProviderType=e.OrderSortBy=e.Order=e.CatalogSortDirection=e.CatalogSortBy=e.NFTSortBy=e.NFT=e.NFTCategory=e.Network=e.MintSortBy=e.Mint=e.MetaTransaction=e.ListingStatus=e.ItemSortBy=e.Item=e.ContractSortBy=e.Contract=e.CollectionSortBy=e.Collection=e.getChainId=e.ChainName=e.getURNProtocol=e.getChainName=e.ChainId=e.AccountSortBy=e.Account=void 0;var n=KV();Object.defineProperty(e,"Account",{enumerable:!0,get:function(){return n.Account}}),Object.defineProperty(e,"AccountSortBy",{enumerable:!0,get:function(){return n.AccountSortBy}});var i=nn();Object.defineProperty(e,"ChainId",{enumerable:!0,get:function(){return i.ChainId}}),Object.defineProperty(e,"getChainName",{enumerable:!0,get:function(){return i.getChainName}}),Object.defineProperty(e,"getURNProtocol",{enumerable:!0,get:function(){return i.getURNProtocol}});var a=WC();Object.defineProperty(e,"ChainName",{enumerable:!0,get:function(){return a.ChainName}}),Object.defineProperty(e,"getChainId",{enumerable:!0,get:function(){return a.getChainId}});var s=XV();Object.defineProperty(e,"Collection",{enumerable:!0,get:function(){return s.Collection}}),Object.defineProperty(e,"CollectionSortBy",{enumerable:!0,get:function(){return s.CollectionSortBy}});var o=JV();Object.defineProperty(e,"Contract",{enumerable:!0,get:function(){return o.Contract}}),Object.defineProperty(e,"ContractSortBy",{enumerable:!0,get:function(){return o.ContractSortBy}});var u=QV();Object.defineProperty(e,"Item",{enumerable:!0,get:function(){return u.Item}}),Object.defineProperty(e,"ItemSortBy",{enumerable:!0,get:function(){return u.ItemSortBy}});var l=oE();Object.defineProperty(e,"ListingStatus",{enumerable:!0,get:function(){return l.ListingStatus}});var c=ZV();Object.defineProperty(e,"MetaTransaction",{enumerable:!0,get:function(){return c.MetaTransaction}});var d=eG();Object.defineProperty(e,"Mint",{enumerable:!0,get:function(){return d.Mint}}),Object.defineProperty(e,"MintSortBy",{enumerable:!0,get:function(){return d.MintSortBy}});var p=rn();Object.defineProperty(e,"Network",{enumerable:!0,get:function(){return p.Network}});var f=ad();Object.defineProperty(e,"NFTCategory",{enumerable:!0,get:function(){return f.NFTCategory}});var _=YC();Object.defineProperty(e,"NFT",{enumerable:!0,get:function(){return _.NFT}}),Object.defineProperty(e,"NFTSortBy",{enumerable:!0,get:function(){return _.NFTSortBy}});var R=tG();Object.defineProperty(e,"CatalogSortBy",{enumerable:!0,get:function(){return R.CatalogSortBy}}),Object.defineProperty(e,"CatalogSortDirection",{enumerable:!0,get:function(){return R.CatalogSortDirection}});var w=rG();Object.defineProperty(e,"Order",{enumerable:!0,get:function(){return w.Order}}),Object.defineProperty(e,"OrderSortBy",{enumerable:!0,get:function(){return w.OrderSortBy}});var O=nG();Object.defineProperty(e,"ProviderType",{enumerable:!0,get:function(){return O.ProviderType}});var h=nd();Object.defineProperty(e,"Rarity",{enumerable:!0,get:function(){return h.Rarity}});var T=xC();Object.defineProperty(e,"SaleType",{enumerable:!0,get:function(){return T.SaleType}});var b=iG();Object.defineProperty(e,"Sale",{enumerable:!0,get:function(){return b.Sale}}),Object.defineProperty(e,"SaleSortBy",{enumerable:!0,get:function(){return b.SaleSortBy}});var m=aG();Object.defineProperty(e,"RentalStatus",{enumerable:!0,get:function(){return m.RentalStatus}}),Object.defineProperty(e,"RentalsListingSortDirection",{enumerable:!0,get:function(){return m.RentalsListingSortDirection}}),Object.defineProperty(e,"RentalsListingsFilterByCategory",{enumerable:!0,get:function(){return m.RentalsListingsFilterByCategory}}),Object.defineProperty(e,"RentalsListingsSortBy",{enumerable:!0,get:function(){return m.RentalsListingsSortBy}}),Object.defineProperty(e,"RentalListingCreation",{enumerable:!0,get:function(){return m.RentalListingCreation}}),Object.defineProperty(e,"PeriodCreation",{enumerable:!0,get:function(){return m.PeriodCreation}});var v=sG();Object.defineProperty(e,"AnalyticsDayDataSortBy",{enumerable:!0,get:function(){return v.AnalyticsDayDataSortBy}});var A=oG();Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return A.Store}});var P=uG();Object.defineProperty(e,"WearableGender",{enumerable:!0,get:function(){return P.WearableGender}}),Object.defineProperty(e,"GenderFilterOption",{enumerable:!0,get:function(){return P.GenderFilterOption}});var q=cG();Object.defineProperty(e,"World",{enumerable:!0,get:function(){return q.World}}),Object.defineProperty(e,"getWorld",{enumerable:!0,get:function(){return q.getWorld}}),Object.defineProperty(e,"isInsideWorldLimits",{enumerable:!0,get:function(){return q.isInsideWorldLimits}}),r(lG(),e),r(dG(),e),r(fG(),e),r(CG(),e),r(LG(),e)})(Vi)),Vi}var ey={},jw;function qG(){return jw||(jw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkerAuthorization=void 0;const t=Ne();(function(r){r.schema={type:"object",properties:{name:{type:"string"},desc:{type:"string"},startDate:{type:"string",nullable:!0},endDate:{type:"string",nullable:!0},contactInfo:{type:"object",properties:{name:{type:"string"}},required:["name"]},onlyDev:{type:"boolean",nullable:!0},addresses:{type:"array",items:{type:"string"},minItems:1},plots:{type:"array",items:{type:"string"},minItems:1}},required:["name","desc","contactInfo","addresses","plots"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(e.LinkerAuthorization||(e.LinkerAuthorization={}))})(ey)),ey}var Wi={},ty={},Ks={},Lw;function KC(){if(Lw)return Ks;Lw=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.isInExceptionBlock=void 0;function e(i,a){return i>=62&&i<=150&&a>=151&&a<=158}function t(i,a){return i>=151&&i<=162&&a>=144&&a<=158}function r(i,a){return i>=151&&i<=163&&a>=59&&a<=143}function n(i,a){return e(i,a)||t(i,a)||r(i,a)}return Ks.isInExceptionBlock=n,Ks}var $w;function BG(){return $w||($w=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Parcel=e.PARCEL_LIMITS=void 0;const t=Ne(),r=KC();e.PARCEL_LIMITS={minX:-150,maxX:150,minY:-150,maxY:150},(function(n){n._isInLimits={keyword:"_isInLimits",validate:function(f,_){return!_||typeof _.x!="number"||typeof _.y!="number"?!1:o(_)||(0,r.isInExceptionBlock)(_.x,_.y)},errors:!1},n.schema={type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}},_isInLimits:!0,additionalProperties:!1},n.validate=(0,t.generateLazyValidator)(n.schema,[n._isInLimits]);function i({x:p,y:f}){return`${p},${f}`}n.parcelToString=i;function a(p){const f=p.match(/^(-?\d+),(-?\d+)$/);if(!f)return null;const[,_,R]=f,w=parseInt(_,10),O=parseInt(R,10);return{x:w,y:O}}n.stringToParcel=a;function s(p){const f=a(p);return f?n.validate(f):!1}n.isParcelStringValid=s;function o(p){const{x:f,y:_}=p;return f>=e.PARCEL_LIMITS.minX&&f<=e.PARCEL_LIMITS.maxX&&_>=e.PARCEL_LIMITS.minY&&_<=e.PARCEL_LIMITS.maxY}n.isInStandardBounds=o;function u(p){return(0,r.isInExceptionBlock)(p.x,p.y)}n.isExceptionParcel=u;function l(p){return o(p)||u(p)}n.isInBounds=l;function c(p){return n.validate(p)}n.isValid=c;function d(p){const f=a(p);return f?n.validate(f):!1}n.isValidString=d})(e.Parcel||(e.Parcel={}))})(ty)),ty}var Yi={},qw;function kG(){if(qw)return Yi;qw=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.validateUrlInstance=Yi.validateUrl=void 0;const e={allowLocalhost:!1,allowedPorts:[]};function t(f,_=2){let R=f;for(let w=0;w<_;w++)try{R=decodeURIComponent(R)}catch{break}return R.normalize("NFKC")}function r(f){return/[\u0000-\u001F\u007F-\u009F\u202A-\u202E\u2066-\u2069]/.test(f)}function n(f){return!!(f.username||f.password)}function i(f){return/\\/.test(f)}const a=["80","443"];function s(f,_){return!!f.port&&!_.includes(f.port)}function o(f){const _=f.toLowerCase();return!!(_==="localhost"||_.endsWith(".local")||/^(127\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|169\.254\.)/.test(_)||_==="::1"||_==="[::1]"||_.startsWith("fe80:")||_.startsWith("fc00:"))}function u(f){if(f.startsWith("//"))return null;try{return{url:new URL(f),wasRelative:!1}}catch{try{return{url:new URL(f,"https://example.com"),wasRelative:!0}}catch{return null}}}function l(f){const _=t(String(f).toLowerCase());return!(r(_)||i(_))}function c(f){return!(!f||f.includes("..")||f.includes("//")||r(f)||i(f))}function d(f,_={}){const R=Object.assign(Object.assign({},e),_),w=[...a,...R.allowedPorts];if(!f||f.length===0||f.length>4096||r(f)||i(f))return!1;const O=t(f);if(r(O)||i(O)||f.startsWith("//"))return!1;const h=u(f);if(!h)return!1;const{url:T,wasRelative:b}=h;if(T.protocol!=="http:"&&T.protocol!=="https:"&&T.protocol!==""||n(T)||i(f)||i(T.href)||!b&&(s(T,w)||!R.allowLocalhost&&T.hostname&&o(T.hostname))||!c(T.pathname)||T.pathname.length>2048)return!1;const m=Array.from(T.searchParams.entries());if(m.length>50||(T.search?T.search.startsWith("?")?T.search.length-1:T.search.length:0)>2048)return!1;for(const[A,P]of m)if(A.length===0||!l(A)||!l(P)||A.length>128||P.length>1024)return!1;return!(T.hash&&r(T.hash))}Yi.validateUrl=d;function p(f,_={}){return d(f.toString(),_)}return Yi.validateUrlInstance=p,Yi}var Bw;function UG(){return Bw||(Bw=1,(function(e){var t=Wi&&Wi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Wi&&Wi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(BG(),e),r(KC(),e),r(kG(),e)})(Wi)),Wi}var kw;function FG(){return kw||(kw=1,(function(e){var t=Vr&&Vr.__createBinding||(Object.create?(function(s,o,u,l){l===void 0&&(l=u);var c=Object.getOwnPropertyDescriptor(o,u);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[u]}}),Object.defineProperty(s,l,c)}):(function(s,o,u,l){l===void 0&&(l=u),s[l]=o[u]})),r=Vr&&Vr.__setModuleDefault||(Object.create?(function(s,o){Object.defineProperty(s,"default",{enumerable:!0,value:o})}):function(s,o){s.default=o}),n=Vr&&Vr.__importStar||function(s){if(s&&s.__esModule)return s;var o={};if(s!=null)for(var u in s)u!=="default"&&Object.prototype.hasOwnProperty.call(s,u)&&t(o,s,u);return r(o,s),o},i=Vr&&Vr.__exportStar||function(s,o){for(var u in s)u!=="default"&&!Object.prototype.hasOwnProperty.call(o,u)&&t(o,s,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.sdk=void 0;const a=n(xV());e.sdk=a,i(Ne(),e),i($G(),e),i(sE(),e),i(Ia(),e),i(qG(),e),i(ru(),e),i(FC(),e),i(zC(),e),i(UG(),e)})(Vr)),Vr}var Uw;function XC(){return Uw||(Uw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AuthLink=e.AuthLinkType=e.AuthChain=void 0;const t=FG();Object.defineProperty(e,"AuthChain",{enumerable:!0,get:function(){return t.AuthChain}}),Object.defineProperty(e,"AuthLink",{enumerable:!0,get:function(){return t.AuthLink}}),Object.defineProperty(e,"AuthLinkType",{enumerable:!0,get:function(){return t.AuthLinkType}})})(Zp)),Zp}var Fw;function JC(){return Fw||(Fw=1,(function(e){var t=Hr&&Hr.__createBinding||(Object.create?(function(X,x,L,D){D===void 0&&(D=L);var $=Object.getOwnPropertyDescriptor(x,L);(!$||("get"in $?!x.__esModule:$.writable||$.configurable))&&($={enumerable:!0,get:function(){return x[L]}}),Object.defineProperty(X,D,$)}):(function(X,x,L,D){D===void 0&&(D=L),X[D]=x[L]})),r=Hr&&Hr.__setModuleDefault||(Object.create?(function(X,x){Object.defineProperty(X,"default",{enumerable:!0,value:x})}):function(X,x){X.default=x}),n=Hr&&Hr.__importStar||(function(){var X=function(x){return X=Object.getOwnPropertyNames||function(L){var D=[];for(var $ in L)Object.prototype.hasOwnProperty.call(L,$)&&(D[D.length]=$);return D},X(x)};return function(x){if(x&&x.__esModule)return x;var L={};if(x!=null)for(var D=X(x),$=0;$<D.length;$++)D[$]!=="default"&&t(L,x,D[$]);return r(L,x),L}})(),i=Hr&&Hr.__importDefault||function(X){return X&&X.__esModule?X:{default:X}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseEmphemeralPayload=e.EIP_1654_SIGNED_ENTITY_VALIDATOR=e.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=e.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=e.ECDSA_SIGNED_ENTITY_VALIDATOR=e.SIGNER_VALIDATOR=e.Authenticator=e.createEthereumMessageHash=e.ERC1654_MAGIC_VALUE=e.VALID_SIGNATURE=void 0,e.validateSignature=p,e.isValidAuthChain=f,e.createEIP1271MessageHash=_,e.createSimpleAuthChain=R,e.createAuthChain=w,e.initializeAuthChain=O,e.signPayload=h,e.createSignature=T,e.ownerAddress=b,e.getEphemeralMessage=m,e.getEphemeralSignatureType=W,e.getSignedIdentitySignatureType=U,e.parseEphemeralPayload=F,e.isValidEIP1271Signature=ce;const a=n(td()),s=KH(),o=aV(),u=i(sV()),l=oV(),c=XC();e.VALID_SIGNATURE="VALID_SIGNATURE",e.ERC1654_MAGIC_VALUE="1626ba7e";const d=132;async function p(X,x,L,D=Date.now()){let $="";if(!f(x))return{ok:!1,message:"ERROR: Malformed authChain"};for(const N of x){const j=ne(N.type);try{const{nextAuthority:Z}=await j($,N,{provider:L,dateToValidateExpirationInMillis:D});$=Z||""}catch(Z){const Ee=Z instanceof Error?Z.message:String(Z);return{ok:!1,message:`ERROR. Link type: ${N.type}. ${Ee}.`}}}const V=$===X;return{ok:V,message:V?void 0:`ERROR: Invalid final authority. Expected: ${X}. Current ${$}.`}}function f(X){for(const[x,L]of X.entries())if(x===0&&L.type!==c.AuthLinkType.SIGNER||L.type===c.AuthLinkType.SIGNER&&x!==0)return!1;return!0}function _(X){return(0,a.hexToBytes)((0,a.sha3)((0,a.stringToUtf8Bytes)(X)))}function R(X,x,L){return[{type:c.AuthLinkType.SIGNER,payload:x,signature:""},{type:U(L),payload:X,signature:L}]}function w(X,x,L,D){const $=(0,l.moveMinutes)(L),V=m(x.address,$),N=T(X,V),j=T(x,D);return[{type:c.AuthLinkType.SIGNER,payload:X.address,signature:""},{type:c.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL,payload:V,signature:N},{type:c.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY,payload:D,signature:j}]}async function O(X,x,L,D){const $=(0,l.moveMinutes)(L),V=m(x.address,$),N=await D(V),j=[{type:c.AuthLinkType.SIGNER,payload:X,signature:""},{type:W(N),payload:V,signature:N}];return{ephemeralIdentity:x,expiration:$,authChain:j}}function h(X,x){const L=T(X.ephemeralIdentity,x);return[...X.authChain,{type:c.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY,payload:x,signature:L}]}e.createEthereumMessageHash=o.createEthereumMessageHash;function T(X,x){return(0,o.ethSign)((0,a.hexToBytes)(X.privateKey),x)}function b(X){return X.length>0&&X[0].type===c.AuthLinkType.SIGNER?X[0].payload:"Invalid-Owner-Address"}function m(X,x){return`Decentraland Login
|
|
71
71
|
Ephemeral address: ${X}
|
|
72
72
|
Expiration: ${x.toISOString()}`}e.Authenticator={validateSignature:p,isValidAuthChain:f,createEIP1271MessageHash:_,createSimpleAuthChain:R,createAuthChain:w,initializeAuthChain:O,signPayload:h,createEthereumMessageHash:e.createEthereumMessageHash,createSignature:T,ownerAddress:b,getEphemeralMessage:m};const v=async(X,x)=>({nextAuthority:x.payload});e.SIGNER_VALIDATOR=v;const A=async(X,x)=>{if(!x.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_SIGNED_ENTITY_VALIDATOR'");const L=(0,o.recoverAddressFromEthSignature)(x.signature,x.payload),D=X.toLocaleLowerCase(),$=L.toLocaleLowerCase();if(D===$)return{nextAuthority:x.payload};throw new Error(`Invalid signer address. Expected: ${D}. Actual: ${$}`)};e.ECDSA_SIGNED_ENTITY_VALIDATOR=A;const P=async(X,x,L)=>{if(!x.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_PERSONAL_EPHEMERAL_VALIDATOR'");const{message:D,ephemeralAddress:$,expiration:V}=F(x.payload),N=(L==null?void 0:L.dateToValidateExpirationInMillis)||Date.now();if(V>N){const j=(0,o.recoverAddressFromEthSignature)(x.signature,D),Z=X.toLocaleLowerCase(),Ee=j.toLocaleLowerCase();if(Z===Ee)return{nextAuthority:$};throw new Error(`Invalid signer address. Expected: ${Z}. Actual: ${Ee}`)}throw new Error(`Ephemeral key expired. Expiration: ${V}. Test: ${N}`)};e.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=P;const q=async(X,x,L)=>{if(!x.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_EIP_1654_EPHEMERAL_VALIDATOR'");const{message:D,ephemeralAddress:$,expiration:V}=F(x.payload),N=(L==null?void 0:L.dateToValidateExpirationInMillis)||Date.now();if(V>N&&await se(L==null?void 0:L.provider,X,D,x.signature,N))return{nextAuthority:$};throw new Error(`Ephemeral key expired. Expiration: ${V}. Test: ${N}`)};e.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=q;const z=async(X,x,L)=>{if(!x.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'EIP_1654_SIGNED_ENTITY_VALIDATOR'");if(!L)throw new Error("Missing validation options for 'EIP_1654_SIGNED_ENTITY_VALIDATOR'");if(await se(L.provider,X,x.payload,x.signature,L.dateToValidateExpirationInMillis))return{nextAuthority:x.payload};throw new Error("Invalid validation")};e.EIP_1654_SIGNED_ENTITY_VALIDATOR=z;const Y=async(X,x)=>({error:"Error Validator."});function W(X){return X.length===d?c.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:c.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL}function U(X){return X.length===d?c.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:c.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY}function F(X){const x=X.replace(/\r/g,""),L=x.split(`
|
|
73
73
|
`),D="Ephemeral address: ",$="Expiration: ";if(L.length<3||!L[1].startsWith(D)||!L[2].startsWith($))throw new Error(`Invalid ephemeral payload. Expected 3 lines with "${D}" on line 2 and "${$}" on line 3.`);const V=L[1].substring(D.length),N=L[2].substring($.length),j=Date.parse(N);if(Number.isNaN(j))throw new Error(`Invalid expiration date in ephemeral payload: "${N}"`);return{message:x,ephemeralAddress:V,expiration:j}}e.parseEmphemeralPayload=F;async function ce(X,x,L,D){const $=_(x),V=(0,a.hexToBytes)(L);let N;try{N=(0,a.bytesToHex)(await X.isValidSignature($,V,D))}catch{}if(N===e.ERC1654_MAGIC_VALUE)return!0;const j=(0,o.createEthereumMessageHash)(x);try{N=(0,a.bytesToHex)(await X.isValidSignature(j,V,D))}catch{}return N===e.ERC1654_MAGIC_VALUE}async function se(X,x,L,D,$){if(!X)throw new Error("Missing provider");const V=new a.default(X),N=await(0,s.SignatureValidator)(V,x);let j=await ce(N,L,D);if(j)return!0;const Z=new u.default(V);try{const{block:Ee}=await Z.getDate($,!1);if(j=await ce(N,L,D,Ee),j)return!0}catch(Ee){const _e=Ee instanceof Error?Ee.message:String(Ee);throw new Error(`Invalid validation. Error: ${_e}`)}throw new Error(`Invalid validation. Expected: ${e.ERC1654_MAGIC_VALUE}. Actual: ${j}`)}function ne(X){switch(X){case c.AuthLinkType.SIGNER:return e.SIGNER_VALIDATOR;case c.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:return e.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR;case c.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:return e.ECDSA_SIGNED_ENTITY_VALIDATOR;case c.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL:return e.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR;case c.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY:return e.EIP_1654_SIGNED_ENTITY_VALIDATOR;default:return Y}}})(Hr)),Hr}var Mn={},Hw;function HG(){return Hw||(Hw=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.AUTH_METADATA_HEADER=Mn.AUTH_TIMESTAMP_HEADER=Mn.AUTH_CHAIN_HEADER_PREFIX=void 0,Mn.AUTH_CHAIN_HEADER_PREFIX="x-identity-auth-chain-",Mn.AUTH_TIMESTAMP_HEADER="x-identity-timestamp",Mn.AUTH_METADATA_HEADER="x-identity-metadata"),Mn}var Vw;function VG(){return Vw||(Vw=1,(function(e){var t=Ci&&Ci.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=Ci&&Ci.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(JC(),e),r(HG(),e),r(XC(),e)})(Ci)),Ci}var GG=VG(),xi={},Wr={},sl={exports:{}},ol={exports:{}},Gw;function uE(){return Gw||(Gw=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n){if(n==null)throw new TypeError("Expected a string but received a ".concat(n));if(n.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(n.constructor.name))}e.exports=t.default,e.exports.default=t.default})(ol,ol.exports)),ol.exports}var ul={exports:{}},zw;function zG(){return zw||(zw=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function r(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function n(i,a){for(var s=0;s<a.length;s++){var o=a[s];if(i===o||r(o)&&o.test(i))return!0}return!1}e.exports=t.default,e.exports.default=t.default})(ul,ul.exports)),ul.exports}var cl={exports:{}},Ww;function WG(){return Ww||(Ww=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(i,a){return i.indexOf(a)!==-1};t.default=r,e.exports=t.default,e.exports.default=t.default})(cl,cl.exports)),cl.exports}var ll={exports:{}},dl={exports:{}},Yw;function QC(){return Yw||(Yw=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function r(i){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r(i)}function n(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;(r(i)!=="object"||i===null)&&(i={});for(var s in a)typeof i[s]>"u"&&(i[s]=a[s]);return i}e.exports=t.default,e.exports.default=t.default})(dl,dl.exports)),dl.exports}var xw;function YG(){return xw||(xw=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=i(uE()),n=i(QC());function i(o){return o&&o.__esModule?o:{default:o}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function s(o,u){(0,r.default)(o),u=(0,n.default)(u,a),u.allow_trailing_dot&&o[o.length-1]==="."&&(o=o.substring(0,o.length-1)),u.allow_wildcard===!0&&o.indexOf("*.")===0&&(o=o.substring(2));var l=o.split("."),c=l[l.length-1];return u.require_tld&&(l.length<2||!u.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(c)||/\s/.test(c))||!u.allow_numeric_tld&&/^\d+$/.test(c)?!1:l.every(function(d){return!(d.length>63&&!u.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(d)||/[\uff01-\uff5e]/.test(d)||/^-|-$/.test(d)||!u.allow_underscores&&/_/.test(d))})}e.exports=t.default,e.exports.default=t.default})(ll,ll.exports)),ll.exports}var fl={exports:{}},Kw;function xG(){return Kw||(Kw=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var r=n(uE());function n(d){return d&&d.__esModule?d:{default:d}}function i(d){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},i(d)}var a="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",s="(".concat(a,"[.]){3}").concat(a),o=new RegExp("^".concat(s,"$")),u="(?:[0-9a-fA-F]{1,4})",l=new RegExp("^("+"(?:".concat(u,":){7}(?:").concat(u,"|:)|")+"(?:".concat(u,":){6}(?:").concat(s,"|:").concat(u,"|:)|")+"(?:".concat(u,":){5}(?::").concat(s,"|(:").concat(u,"){1,2}|:)|")+"(?:".concat(u,":){4}(?:(:").concat(u,"){0,1}:").concat(s,"|(:").concat(u,"){1,3}|:)|")+"(?:".concat(u,":){3}(?:(:").concat(u,"){0,2}:").concat(s,"|(:").concat(u,"){1,4}|:)|")+"(?:".concat(u,":){2}(?:(:").concat(u,"){0,3}:").concat(s,"|(:").concat(u,"){1,5}|:)|")+"(?:".concat(u,":){1}(?:(:").concat(u,"){0,4}:").concat(s,"|(:").concat(u,"){1,6}|:)|")+"(?::((?::".concat(u,"){0,5}:").concat(s,"|(?::").concat(u,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function c(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,r.default)(d);var f=(i(p)==="object"?p.version:arguments[1])||"";return f?f.toString()==="4"?o.test(d):f.toString()==="6"?l.test(d):!1:c(d,{version:4})||c(d,{version:6})}e.exports=t.default,e.exports.default=t.default})(fl,fl.exports)),fl.exports}var Xw;function KG(){return Xw||(Xw=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=O;var r=u(uE()),n=u(zG()),i=u(WG()),a=u(YG()),s=u(xG()),o=u(QC());function u(h){return h&&h.__esModule?h:{default:h}}function l(h,T){return _(h)||f(h,T)||d(h,T)||c()}function c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
74
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(h,T){if(h){if(typeof h=="string")return p(h,T);var b={}.toString.call(h).slice(8,-1);return b==="Object"&&h.constructor&&(b=h.constructor.name),b==="Map"||b==="Set"?Array.from(h):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?p(h,T):void 0}}function p(h,T){(T==null||T>h.length)&&(T=h.length);for(var b=0,m=Array(T);b<T;b++)m[b]=h[b];return m}function f(h,T){var b=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(b!=null){var m,v,A,P,q=[],z=!0,Y=!1;try{if(A=(b=b.call(h)).next,T!==0)for(;!(z=(m=A.call(b)).done)&&(q.push(m.value),q.length!==T);z=!0);}catch(W){Y=!0,v=W}finally{try{if(!z&&b.return!=null&&(P=b.return(),Object(P)!==P))return}finally{if(Y)throw v}}return q}}function _(h){if(Array.isArray(h))return h}var R={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},w=/^\[([^\]]+)\](?::([0-9]+))?$/;function O(h,T){if((0,r.default)(h),!h||/[\s<>]/.test(h)||h.indexOf("mailto:")===0||(T=(0,o.default)(T,R),T.validate_length&&h.length>T.max_allowed_length)||!T.allow_fragments&&(0,i.default)(h,"#")||!T.allow_query_components&&((0,i.default)(h,"?")||(0,i.default)(h,"&")))return!1;var b,m,v,A,P,q,z,Y;z=h.split("#"),h=z.shift(),z=h.split("?"),h=z.shift();var W=h.match(/^([a-z][a-z0-9+\-.]*):/i),U=!1,F=function(le){return U=!0,b=le.toLowerCase(),T.require_valid_protocol&&T.protocols.indexOf(b)===-1?!1:h.substring(W[0].length)};if(W){var ce=W[1],se=h.substring(W[0].length),ne=se.slice(0,2)==="//";if(ne){if(h=F(ce),h===!1)return!1}else{var X=se.indexOf("/"),x=X===-1?se:se.substring(0,X),L=x.indexOf("@");if(L!==-1){var D=x.substring(0,L),$=/^[a-zA-Z0-9\-_.%:]*$/,V=$.test(D),N=/%[0-9a-fA-F]{2}/.test(D);if(V&&!N){if(T.require_protocol)return!1}else if(h=F(ce),h===!1)return!1}else{var j=/^[0-9]/.test(se);if(j){if(T.require_protocol)return!1}else if(h=F(ce),h===!1)return!1}}}else if(T.require_protocol)return!1;if(h.slice(0,2)==="//"){if(!U&&!T.allow_protocol_relative_urls)return!1;h=h.slice(2)}if(h==="")return!1;if(z=h.split("/"),h=z.shift(),h===""&&!T.require_host)return!0;if(z=h.split("@"),z.length>1){if(T.disallow_auth||z[0]===""||(m=z.shift(),m.indexOf(":")>=0&&m.split(":").length>2))return!1;var Z=m.split(":"),Ee=l(Z,2),_e=Ee[0],Se=Ee[1];if(_e===""&&Se==="")return!1}A=z.join("@"),q=null,Y=null;var Ie=A.match(w);if(Ie?(v="",Y=Ie[1],q=Ie[2]||null):(z=A.split(":"),v=z.shift(),z.length&&(q=z.join(":"))),q!==null&&q.length>0){if(P=parseInt(q,10),!/^[0-9]+$/.test(q)||P<=0||P>65535)return!1}else if(T.require_port)return!1;return T.host_whitelist?(0,n.default)(v,T.host_whitelist):v===""&&!T.require_host?!0:!(!(0,s.default)(v)&&!(0,a.default)(v,T)&&(!Y||!(0,s.default)(Y,6))||(v=v||Y,T.host_blacklist&&(0,n.default)(v,T.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(sl,sl.exports)),sl.exports}var ry={},Jw;function ZC(){return Jw||(Jw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localStorageClearIdentity=e.localStorageStoreIdentity=e.localStorageGetIdentity=e.createMessage=e.SINGLE_SIGN_ON_TARGET=e.Action=void 0;var t;(function(o){o.GET="get",o.STORE="store",o.CLEAR="clear",o.PING="ping"})(t||(e.Action=t={})),e.SINGLE_SIGN_ON_TARGET="single-sign-on";function r(o){return{target:e.SINGLE_SIGN_ON_TARGET,...o}}e.createMessage=r;function n(o){const u=localStorage.getItem(s(o));if(!u)return null;let l;try{l=JSON.parse(u)}catch{return a(o),null}return l.expiration=new Date(l.expiration),l.expiration.getTime()<=Date.now()?(a(o),null):l}e.localStorageGetIdentity=n;function i(o,u){new Date(u.expiration).getTime()>Date.now()&&localStorage.setItem(s(o),JSON.stringify(u))}e.localStorageStoreIdentity=i;function a(o){localStorage.removeItem(s(o))}e.localStorageClearIdentity=a;function s(o){if(!/^0x[a-fA-F0-9]{40}$/.test(o))throw new Error("User must be a valid ethereum address");return`single-sign-on-${o.toLowerCase()}`}})(ry)),ry}var Qw;function XG(){if(Qw)return Wr;Qw=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.clearIdentity=Wr.storeIdentity=Wr.getIdentity=Wr.init=void 0;const e=KG(),t=ZC(),r=t.SINGLE_SIGN_ON_TARGET,n=500,i=5;let a=0,s="";const o={protocols:["https"],require_protocol:!0};function u(w,O={}){if(!(0,e.default)(w,{...o,...O}))throw new Error(`Invalid url: ${w}`);if(s)throw new Error("Already initialized");const h=document.createElement("iframe");h.id=r,h.src=w,h.style.width="0",h.style.height="0",h.style.border="none",h.style.position="absolute",document.body.appendChild(h),s=w}Wr.init=u;async function l(w){let O;try{O=(await f(await p(),t.Action.GET,{user:w})).identity??null}catch(h){R(h),O=(0,t.localStorageGetIdentity)(w)}return O}Wr.getIdentity=l;async function c(w,O){try{await f(await p(),t.Action.STORE,{user:w,identity:O})}catch(h){R(h),(0,t.localStorageStoreIdentity)(w,O)}}Wr.storeIdentity=c;async function d(w){try{await f(await p(),t.Action.CLEAR,{user:w})}catch(O){R(O),(0,t.localStorageClearIdentity)(w)}}Wr.clearIdentity=d;async function p(){if(!s)throw new Error("Not initialized");for(let w=0;w<i;w++){const O=document.getElementById(r),h=O==null?void 0:O.contentWindow;if(!h){await _(n);continue}try{await f(h,t.Action.PING,{},n)}catch{continue}return h}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function f(w,O,h,T=0){a++;const b=a;let m=null;const v=new Promise((A,P)=>{m=({data:q})=>{!q||q.target!==t.SINGLE_SIGN_ON_TARGET||q.id!==b||(q.error?P(new Error(q.error)):A(q))},window.addEventListener("message",m)});w.postMessage((0,t.createMessage)({id:b,action:O,...h}),s);try{return await(T?Promise.race([v,new Promise((A,P)=>setTimeout(()=>P(new Error("Did not receive a response in time")),T))]):v)}catch(A){throw A}finally{m&&window.removeEventListener("message",m)}}function _(w){return new Promise(O=>setTimeout(O,w))}function R(w){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",w.message)}return Wr}var Zw;function JG(){return Zw||(Zw=1,(function(e){var t=xi&&xi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=xi&&xi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(XG(),e),r(ZC(),e)})(xi)),xi}var zg=JG();function QG(e){const{host:t}=e;return t.endsWith(".org")||t.endsWith(".co")?bn.PRODUCTION:t.endsWith(".today")||t.endsWith(".net")?bn.STAGING:t.endsWith(".io")||t.endsWith(".zone")?bn.DEVELOPMENT:null}function ZG(e){const t=new URLSearchParams(e.search),r=t.get("ENV")||t.get("env");if(r){const n=r.toLowerCase();if(tM(n))return n}return null}var eA={},bn;(function(e){e.DEVELOPMENT="dev",e.STAGING="stg",e.PRODUCTION="prod"})(bn||(bn={}));function eM(){return Object.values(bn)}function tM(e){return eM().includes(e)}function pl(e){if(tM(e))return e;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${e}", possible values are ${eM().map(t=>`"${t}"`).join(", ")}.`)}function e3(e={}){const{DCL_DEFAULT_ENV:t,REACT_APP_DCL_DEFAULT_ENV:r,VITE_DCL_DEFAULT_ENV:n,GATSBY_DCL_DEFAULT_ENV:i}=e;if(t&&r&&t!==r)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(t&&n&&t!==n)throw new Error("You have defined both DCL_DEFAULT_ENV and VITE_DCL_DEFAULT_ENV with different values");if(t&&i&&t!==i)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if(r&&i&&r!==i)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return t?pl(t):r?pl(r):n?pl(n):i?pl(i):bn.PRODUCTION}function t3(e){if(typeof window<"u"){const r=ZG(window.location);if(r)return r;const n=QG(window.location);if(n)return n}return e3(typeof e>"u"&&typeof yl=="object"&&typeof eA=="object"?eA:e)}function r3(e,t){const r=t3(t==null?void 0:t.systemEnvVariables),n=e[r];return{get:(i,a="")=>{if(!n)throw new Error(`Could not find a config for env=${r}`);return i in n?n[i]:a},is:i=>r===i,getEnv:()=>r}}const n3="development",i3="80002",a3="https://marketplace-api.decentraland.zone",s3="https://marketplace-api.decentraland.zone",o3="/auth",u3="https://rpc.decentraland.org/amoy",c3="https://credits.decentraland.zone",l3="https://builder-api.decentraland.zone",d3="https://peer.decentraland.zone",f3="",p3="",m3="",h3="",y3={ENVIRONMENT:n3,CHAIN_ID:i3,MARKETPLACE_SERVER_URL:a3,NFT_API_URL:s3,AUTH_URL:o3,RPC_URL:u3,CREDITS_SERVER_URL:c3,BUILDER_SERVER_URL:l3,PEER_URL:d3,SHOP_SERVER_URL:f3,STRIPE_PUBLISHABLE_KEY:p3,SEGMENT_WRITE_KEY:m3,SENTRY_DSN:h3},g3="staging",_3="80002",E3="https://marketplace-api.decentraland.zone",v3="https://marketplace-api.decentraland.zone",b3="/auth",T3="https://rpc.decentraland.org/amoy",S3="https://credits.decentraland.zone",I3="https://builder-api.decentraland.zone",R3="https://peer.decentraland.zone",w3="",A3="",O3="",N3="",P3={ENVIRONMENT:g3,CHAIN_ID:_3,MARKETPLACE_SERVER_URL:E3,NFT_API_URL:v3,AUTH_URL:b3,RPC_URL:T3,CREDITS_SERVER_URL:S3,BUILDER_SERVER_URL:I3,PEER_URL:R3,SHOP_SERVER_URL:w3,STRIPE_PUBLISHABLE_KEY:A3,SEGMENT_WRITE_KEY:O3,SENTRY_DSN:N3},C3="production",M3="137",D3="https://marketplace-api.decentraland.org",j3="https://marketplace-api.decentraland.org",L3="/auth",$3="https://rpc.decentraland.org/polygon",q3="https://credits.decentraland.org",B3="https://builder-api.decentraland.org",k3="https://peer.decentraland.org",U3="",F3="",H3="",V3="",G3={ENVIRONMENT:C3,CHAIN_ID:M3,MARKETPLACE_SERVER_URL:D3,NFT_API_URL:j3,AUTH_URL:L3,RPC_URL:$3,CREDITS_SERVER_URL:q3,BUILDER_SERVER_URL:B3,PEER_URL:k3,SHOP_SERVER_URL:U3,STRIPE_PUBLISHABLE_KEY:F3,SEGMENT_WRITE_KEY:H3,SENTRY_DSN:V3},z3={},Nr=r3({[bn.DEVELOPMENT]:y3,[bn.STAGING]:P3,[bn.PRODUCTION]:G3},{systemEnvVariables:{VITE_DCL_DEFAULT_ENV:"dev"}}),or=z3,Nt={marketplaceServerUrl:or.VITE_MARKETPLACE_SERVER_URL??Nr.get("MARKETPLACE_SERVER_URL"),nftApiUrl:or.VITE_NFT_API_URL??Nr.get("NFT_API_URL"),chainId:Number(or.VITE_CHAIN_ID??Nr.get("CHAIN_ID")),authUrl:or.VITE_AUTH_URL??Nr.get("AUTH_URL"),rpcUrl:or.VITE_RPC_URL??Nr.get("RPC_URL"),creditsServerUrl:or.VITE_CREDITS_SERVER_URL??Nr.get("CREDITS_SERVER_URL"),builderServerUrl:or.VITE_BUILDER_SERVER_URL??Nr.get("BUILDER_SERVER_URL"),peerUrl:or.VITE_PEER_URL??Nr.get("PEER_URL"),shopServerUrl:or.VITE_SHOP_SERVER_URL??Nr.get("SHOP_SERVER_URL"),stripePublishableKey:or.VITE_STRIPE_PK??Nr.get("STRIPE_PUBLISHABLE_KEY"),segmentWriteKey:or.VITE_SEGMENT_WRITE_KEY??Nr.get("SEGMENT_WRITE_KEY"),sentryDsn:or.VITE_SENTRY_DSN??Nr.get("SENTRY_DSN"),sentryEnvironment:or.VITE_SENTRY_ENVIRONMENT??(Number(or.VITE_CHAIN_ID??Nr.get("CHAIN_ID"))===80002?"dev":"prod"),sentryRelease:or.VITE_SENTRY_RELEASE??`shop@${or.VITE_APP_VERSION??"0.0.0-dev"}`},W3=744*60;async function rM(){return(await Gt(async()=>{const{connection:e}=await import("./index-w4da2I_c.js").then(t=>t.i);return{connection:e}},__vite__mapDeps([8,1]))).connection}async function Y3(e){if(!e.account)throw new Error("No account returned by the wallet");const t=e.account.toLowerCase(),r=new WD(e.provider),n=r.getSigner();let i=zg.localStorageGetIdentity(t);if(!i){const a=YD.createRandom();i=await GG.Authenticator.initializeAuthChain(t,{address:a.address,publicKey:VE(a.publicKey),privateKey:VE(a.privateKey)},W3,s=>n.signMessage(s)),zg.localStorageStoreIdentity(t,i)}return{address:t,chainId:e.chainId,signer:n,web3Provider:r,identity:i,providerType:e.providerType}}function x3(){const e=encodeURIComponent(window.location.href);window.location.replace(`${Nt.authUrl}/login?redirectTo=${e}`)}async function K3(){try{const t=await(await rM()).tryPreviousConnection();return!t.account||!zg.localStorageGetIdentity(t.account.toLowerCase())?null:await Y3(t)}catch{return null}}async function X3(){try{await(await rM()).disconnect()}catch{}}const J3=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`s-${String(performance.now())}`,Q3=Nt.chainId===80002?"amoy":"polygon",Z3=Nt.chainId===80002?"dev":"prod";function cE(){return window.analytics}function e4(){let e=null;try{e=Rs.getState().session}catch{e=null}return{address:(e==null?void 0:e.address)??null,is_signed_in:!!e,session_id:J3,network:Q3,app_env:Z3}}function ci(e,t={}){const r={...e4(),...t},n=cE();n&&n.track(e,r)}function t4(e,t={}){const r=cE();r&&r.identify(e.toLowerCase(),t)}function r4(){const e=cE();e!=null&&e.reset&&e.reset()}function n4(e){ci("Shop Viewed Page",{page:e})}function tA(e){return e===Jr.ProviderType.MAGIC||e===Jr.ProviderType.MAGIC_TEST?"magic":"wallet"}function i4(e){const t=`shop:seen:${e.toLowerCase()}`;try{return localStorage.getItem(t)?!1:(localStorage.setItem(t,"1"),!0)}catch{return!1}}function qo(e){return Math.round(e*10)/100}function lE(e){return!e.tokenId}function c6(e){return{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:e.tokenId??null,trade_id:e.tradeId??null,price_credits:e.priceCredits,price_usd:qo(e.priceCredits),rarity:e.rarity,creator:e.creator||null,is_primary:lE(e)}}function l6(e){const t=e.reduce((n,i)=>n+i.priceCredits,0),r=e.some(lE);return{items:e.map(n=>({item_id:n.itemId??null,contract_address:n.contractAddress,token_id:n.tokenId??null,price_usd:qo(n.priceCredits)})),value_credits:t,value_usd:qo(t),purchase_type:r?"item":"nft_resale",is_primary:r}}function a4(e){const t=e;if((t==null?void 0:t.code)===4001)return"user_rejected";const r=((t==null?void 0:t.message)??"").toLowerCase();return r.includes("reject")||r.includes("denied")||r.includes("cancel")?"user_rejected":r.includes("insufficient")?"insufficient_credits":r.includes("not for sale")||r.includes("no active listing")||r.includes("sold")?"not_for_sale":"unknown"}function d6(e){return a4(e)==="user_rejected"}function s4(e){const t=window;if(t.analytics&&t.analytics.invoked)return;const r=t.analytics||[];r.invoked=!0,r.methods=["track","identify","page","group","alias","ready","on","once","off","reset","setAnonymousId"],r.factory=n=>(...i)=>(r.push([n,...i]),r);for(const n of r.methods)r[n]=r.factory(n);r.load=n=>{const i=document.createElement("script");i.async=!0,i.src=`https://cdn.segment.com/analytics.js/v1/${encodeURIComponent(n)}/analytics.min.js`,document.head.appendChild(i)},t.analytics=r,r.load(e),r.page()}let rA=!1;function o4(){if(rA)return;rA=!0;const e=Nt.segmentWriteKey;e&&s4(e)}let Wg=null;function u4(e){Wg=e}function nA(e,t={}){const r=typeof t.flow=="string"?`error in ${t.flow}`:"error";if(console.error(`[shop] ${r}`,e,t),Wg)try{Wg(e,t)}catch{}}const c4=/0x[a-fA-F0-9]{130}\b/g,l4=/0x[a-fA-F0-9]{64}\b/g,d4=/(sk_[a-z]+_[A-Za-z0-9]+|pi_[A-Za-z0-9]+_secret_[A-Za-z0-9]+|[A-Za-z0-9-]*secret[A-Za-z0-9-]*)/gi,f4=/(signature|private|identity|authchain|auth_chain|ephemeral|token|secret|password|cookie|authorization)/i;function Xs(e){return e.replace(c4,"<signature>").replace(d4,"<secret>").replace(l4,"<hex32>")}function p4(e){var r;e.message&&(e.message=Xs(e.message));for(const n of((r=e.exception)==null?void 0:r.values)??[])n.value&&(n.value=Xs(n.value));for(const n of e.breadcrumbs??[])n.message&&(n.message=Xs(n.message));e.request&&(e.request.url&&(e.request.url=Xs(e.request.url)),delete e.request.cookies,delete e.request.headers);const t=n=>{if(n)for(const i of Object.keys(n)){if(f4.test(i)){delete n[i];continue}typeof n[i]=="string"&&(n[i]=Xs(n[i]))}};return t(e.tags),t(e.extra),e}let iA=!1;function m4(){if(iA)return;const e=Nt.sentryDsn;if(!e)return;iA=!0,rU({dsn:e,environment:Nt.sentryEnvironment,release:Nt.sentryRelease,integrations:[new VB],tracesSampleRate:.01,sendDefaultPii:!1,ignoreErrors:[/user rejected/i,/user denied/i,"ResizeObserver loop limit exceeded"],beforeSend:p4});const t=h4();t&&f$({id:t}),u4((r,n)=>R_(r,{extra:n}))}function h4(){var e;try{return((e=Rs.getState().session)==null?void 0:e.address)??null}catch{return null}}const aA="shop-favorites";let vl=null;const nM=e=>e?`${aA}:${e.toLowerCase()}`:aA;function sA(e){var t;try{const r=localStorage.getItem(nM(e));if(!r)return{};const n=JSON.parse(r);if(!n||typeof n!="object")return{};const i="state"in n&&((t=n.state)!=null&&t.items)?n.state.items:n;return i&&typeof i=="object"?i:{}}catch{return{}}}function oA(e){try{localStorage.setItem(nM(vl),JSON.stringify(e))}catch{}}const Dl=Is(e=>({items:sA(vl),toggle:t=>e(r=>{const n={...r.items};return n[t.id]?delete n[t.id]:n[t.id]=t,oA(n),{items:n}}),remove:t=>e(r=>{const n={...r.items};return delete n[t],oA(n),{items:n}}),reloadFor:t=>{vl=t?t.toLowerCase():null,e({items:sA(vl)})}})),uA="shop:followed-creators:v1",y4=200;let dE=null;const iM=e=>e?`${uA}:${e.toLowerCase()}`:uA;function cA(){try{const e=localStorage.getItem(iM(dE));if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(r=>typeof r=="string"):[]}catch{return[]}}function lA(e){try{localStorage.setItem(iM(dE),JSON.stringify(e))}catch{}}const Yg=Is((e,t)=>({followed:cA(),isFollowing:r=>t().followed.includes(r.toLowerCase()),follow:r=>{const n=r.toLowerCase();if(!n||t().followed.includes(n))return;const i=[n,...t().followed].slice(0,y4);lA(i),e({followed:i}),ci("Shop Followed Creator",{creator_address:n,following_count:i.length})},unfollow:r=>{const n=r.toLowerCase();if(!t().followed.includes(n))return;const i=t().followed.filter(a=>a!==n);lA(i),e({followed:i}),ci("Shop Unfollowed Creator",{creator_address:n,following_count:i.length})},toggle:r=>t().isFollowing(r)?t().unfollow(r):t().follow(r),reloadFor:r=>{dE=r?r.toLowerCase():null,e({followed:cA()})}})),ny="shop:signing_in",Rs=Is(e=>({session:null,connecting:!1,error:null,signIn:()=>{try{sessionStorage.setItem(ny,"1")}catch{}x3()},disconnect:async()=>{ci("Shop Signed Out");try{await X3()}catch(t){nA(t,{flow:"wallet",step:"disconnect"})}r4(),Dl.getState().reloadFor(null),Yg.getState().reloadFor(null),e({session:null})},restore:async()=>{let t;try{t=await K3()}catch(n){nA(n,{flow:"wallet",step:"restore"});return}if(!t)return;e({session:t}),Dl.getState().reloadFor(t.address),Yg.getState().reloadFor(t.address),t4(t.address,{sign_in_method:tA(t.providerType)});let r=!1;try{r=sessionStorage.getItem(ny)==="1",r&&sessionStorage.removeItem(ny)}catch{}r&&ci("Shop Signed In",{method:tA(t.providerType),is_new_user:i4(t.address)})}})),g4=Nt.peerUrl;function fE(e){return Ll({queryKey:["profile",e],enabled:!!e,staleTime:5*6e4,queryFn:async()=>{var n;const t=await fetch(`${g4}/lambdas/profiles/${e.toLowerCase()}`);if(!t.ok)return;const r=await t.json();return(n=r==null?void 0:r.avatars)==null?void 0:n[0]}})}var Dn={},iy={},dA;function aM(){return dA||(dA=1,Object.defineProperty(iy,"__esModule",{value:!0})),iy}var jn={},pn={},La={},Ki={},fA={},Js,pA;function an(){if(pA)return Js;pA=1;var e=function(t){return t&&t.Math===Math&&t};return Js=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof sg=="object"&&sg)||e(typeof Js=="object"&&Js)||(function(){return this})()||Function("return this")(),Js}var ay,mA;function Ra(){return mA||(mA=1,ay=function(e){try{return!!e()}catch{return!0}}),ay}var sy,hA;function sd(){if(hA)return sy;hA=1;var e=Ra();return sy=!e(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),sy}var oy,yA;function _4(){if(yA)return oy;yA=1;var e=sd(),t=Function.prototype,r=t.apply,n=t.call;return oy=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(r):function(){return n.apply(r,arguments)}),oy}var uy,gA;function ws(){if(gA)return uy;gA=1;var e=sd(),t=Function.prototype,r=t.call,n=e&&t.bind.bind(r,r);return uy=e?n:function(i){return function(){return r.apply(i,arguments)}},uy}var cy,_A;function sM(){if(_A)return cy;_A=1;var e=ws(),t=e({}.toString),r=e("".slice);return cy=function(n){return r(t(n),8,-1)},cy}var ly,EA;function oM(){if(EA)return ly;EA=1;var e=sM(),t=ws();return ly=function(r){if(e(r)==="Function")return t(r)},ly}var dy,vA;function wa(){if(vA)return dy;vA=1;var e=typeof document=="object"&&document.all;return dy=typeof e>"u"&&e!==void 0?function(t){return typeof t=="function"||t===e}:function(t){return typeof t=="function"},dy}var fy={},py,bA;function nu(){if(bA)return py;bA=1;var e=Ra();return py=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),py}var my,TA;function pE(){if(TA)return my;TA=1;var e=sd(),t=Function.prototype.call;return my=e?t.bind(t):function(){return t.apply(t,arguments)},my}var hy={},SA;function E4(){if(SA)return hy;SA=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,r=t&&!e.call({1:2},1);return hy.f=r?function(i){var a=t(this,i);return!!a&&a.enumerable}:e,hy}var yy,IA;function uM(){return IA||(IA=1,yy=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}),yy}var gy,RA;function v4(){if(RA)return gy;RA=1;var e=ws(),t=Ra(),r=sM(),n=Object,i=e("".split);return gy=t(function(){return!n("z").propertyIsEnumerable(0)})?function(a){return r(a)==="String"?i(a,""):n(a)}:n,gy}var _y,wA;function cM(){return wA||(wA=1,_y=function(e){return e==null}),_y}var Ey,AA;function lM(){if(AA)return Ey;AA=1;var e=cM(),t=TypeError;return Ey=function(r){if(e(r))throw new t("Can't call method on "+r);return r},Ey}var vy,OA;function b4(){if(OA)return vy;OA=1;var e=v4(),t=lM();return vy=function(r){return e(t(r))},vy}var by,NA;function od(){if(NA)return by;NA=1;var e=wa();return by=function(t){return typeof t=="object"?t!==null:e(t)},by}var Ty,PA;function dM(){return PA||(PA=1,Ty={}),Ty}var Sy,CA;function T4(){if(CA)return Sy;CA=1;var e=dM(),t=an(),r=wa(),n=function(i){return r(i)?i:void 0};return Sy=function(i,a){return arguments.length<2?n(e[i])||n(t[i]):e[i]&&e[i][a]||t[i]&&t[i][a]},Sy}var Iy,MA;function S4(){if(MA)return Iy;MA=1;var e=ws();return Iy=e({}.isPrototypeOf),Iy}var Ry,DA;function I4(){if(DA)return Ry;DA=1;var e=an(),t=e.navigator,r=t&&t.userAgent;return Ry=r?String(r):"",Ry}var wy,jA;function R4(){if(jA)return wy;jA=1;var e=an(),t=I4(),r=e.process,n=e.Deno,i=r&&r.versions||n&&n.version,a=i&&i.v8,s,o;return a&&(s=a.split("."),o=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!o&&t&&(s=t.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=t.match(/Chrome\/(\d+)/),s&&(o=+s[1]))),wy=o,wy}var Ay,LA;function fM(){if(LA)return Ay;LA=1;var e=R4(),t=Ra(),r=an(),n=r.String;return Ay=!!Object.getOwnPropertySymbols&&!t(function(){var i=Symbol("symbol detection");return!n(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Ay}var Oy,$A;function pM(){if($A)return Oy;$A=1;var e=fM();return Oy=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Oy}var Ny,qA;function mM(){if(qA)return Ny;qA=1;var e=T4(),t=wa(),r=S4(),n=pM(),i=Object;return Ny=n?function(a){return typeof a=="symbol"}:function(a){var s=e("Symbol");return t(s)&&r(s.prototype,i(a))},Ny}var Py,BA;function w4(){if(BA)return Py;BA=1;var e=String;return Py=function(t){try{return e(t)}catch{return"Object"}},Py}var Cy,kA;function hM(){if(kA)return Cy;kA=1;var e=wa(),t=w4(),r=TypeError;return Cy=function(n){if(e(n))return n;throw new r(t(n)+" is not a function")},Cy}var My,UA;function A4(){if(UA)return My;UA=1;var e=hM(),t=cM();return My=function(r,n){var i=r[n];return t(i)?void 0:e(i)},My}var Dy,FA;function O4(){if(FA)return Dy;FA=1;var e=pE(),t=wa(),r=od(),n=TypeError;return Dy=function(i,a){var s,o;if(a==="string"&&t(s=i.toString)&&!r(o=e(s,i))||t(s=i.valueOf)&&!r(o=e(s,i))||a!=="string"&&t(s=i.toString)&&!r(o=e(s,i)))return o;throw new n("Can't convert object to primitive value")},Dy}var jy={exports:{}},Ly,HA;function N4(){return HA||(HA=1,Ly=!0),Ly}var $y,VA;function P4(){if(VA)return $y;VA=1;var e=an(),t=Object.defineProperty;return $y=function(r,n){try{t(e,r,{value:n,configurable:!0,writable:!0})}catch{e[r]=n}return n},$y}var GA;function C4(){if(GA)return jy.exports;GA=1;var e=N4(),t=an(),r=P4(),n="__core-js_shared__",i=jy.exports=t[n]||r(n,{});return(i.versions||(i.versions=[])).push({version:"3.49.0",mode:e?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"}),jy.exports}var qy,zA;function M4(){if(zA)return qy;zA=1;var e=C4();return qy=function(t,r){return e[t]||(e[t]=r||{})},qy}var By,WA;function D4(){if(WA)return By;WA=1;var e=lM(),t=Object;return By=function(r){return t(e(r))},By}var ky,YA;function mE(){if(YA)return ky;YA=1;var e=ws(),t=D4(),r=e({}.hasOwnProperty);return ky=Object.hasOwn||function(i,a){return r(t(i),a)},ky}var Uy,xA;function j4(){if(xA)return Uy;xA=1;var e=ws(),t=0,r=Math.random(),n=e(1.1.toString);return Uy=function(i){return"Symbol("+(i===void 0?"":i)+")_"+n(++t+r,36)},Uy}var Fy,KA;function L4(){if(KA)return Fy;KA=1;var e=an(),t=M4(),r=mE(),n=j4(),i=fM(),a=pM(),s=e.Symbol,o=t("wks"),u=a?s.for||s:s&&s.withoutSetter||n;return Fy=function(l){return r(o,l)||(o[l]=i&&r(s,l)?s[l]:u("Symbol."+l)),o[l]},Fy}var Hy,XA;function $4(){if(XA)return Hy;XA=1;var e=pE(),t=od(),r=mM(),n=A4(),i=O4(),a=L4(),s=TypeError,o=a("toPrimitive");return Hy=function(u,l){if(!t(u)||r(u))return u;var c=n(u,o),d;if(c){if(l===void 0&&(l="default"),d=e(c,u,l),!t(d)||r(d))return d;throw new s("Can't convert object to primitive value")}return l===void 0&&(l="number"),i(u,l)},Hy}var Vy,JA;function yM(){if(JA)return Vy;JA=1;var e=$4(),t=mM();return Vy=function(r){var n=e(r,"string");return t(n)?n:n+""},Vy}var Gy,QA;function q4(){if(QA)return Gy;QA=1;var e=an(),t=od(),r=e.document,n=t(r)&&t(r.createElement);return Gy=function(i){return n?r.createElement(i):{}},Gy}var zy,ZA;function gM(){if(ZA)return zy;ZA=1;var e=nu(),t=Ra(),r=q4();return zy=!e&&!t(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),zy}var eO;function B4(){if(eO)return fy;eO=1;var e=nu(),t=pE(),r=E4(),n=uM(),i=b4(),a=yM(),s=mE(),o=gM(),u=Object.getOwnPropertyDescriptor;return fy.f=e?u:function(c,d){if(c=i(c),d=a(d),o)try{return u(c,d)}catch{}if(s(c,d))return n(!t(r.f,c,d),c[d])},fy}var Wy,tO;function k4(){if(tO)return Wy;tO=1;var e=Ra(),t=wa(),r=/#|\.prototype\./,n=function(u,l){var c=a[i(u)];return c===o?!0:c===s?!1:t(l)?e(l):!!l},i=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},a=n.data={},s=n.NATIVE="N",o=n.POLYFILL="P";return Wy=n,Wy}var Yy,rO;function U4(){if(rO)return Yy;rO=1;var e=oM(),t=hM(),r=sd(),n=e(e.bind);return Yy=function(i,a){return t(i),a===void 0?i:r?n(i,a):function(){return i.apply(a,arguments)}},Yy}var xy={},Ky,nO;function F4(){if(nO)return Ky;nO=1;var e=nu(),t=Ra();return Ky=e&&t(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ky}var Xy,iO;function H4(){if(iO)return Xy;iO=1;var e=od(),t=String,r=TypeError;return Xy=function(n){if(e(n))return n;throw new r(t(n)+" is not an object")},Xy}var aO;function V4(){if(aO)return xy;aO=1;var e=nu(),t=gM(),r=F4(),n=H4(),i=yM(),a=TypeError,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return xy.f=e?r?function(p,f,_){if(n(p),f=i(f),n(_),typeof p=="function"&&f==="prototype"&&"value"in _&&c in _&&!_[c]){var R=o(p,f);R&&R[c]&&(p[f]=_.value,_={configurable:l in _?_[l]:R[l],enumerable:u in _?_[u]:R[u],writable:!1})}return s(p,f,_)}:s:function(p,f,_){if(n(p),f=i(f),n(_),t)try{return s(p,f,_)}catch{}if("get"in _||"set"in _)throw new a("Accessors not supported");return"value"in _&&(p[f]=_.value),p},xy}var Jy,sO;function G4(){if(sO)return Jy;sO=1;var e=nu(),t=V4(),r=uM();return Jy=e?function(n,i,a){return t.f(n,i,r(1,a))}:function(n,i,a){return n[i]=a,n},Jy}var Qy,oO;function z4(){if(oO)return Qy;oO=1;var e=an(),t=_4(),r=oM(),n=wa(),i=B4().f,a=k4(),s=dM(),o=U4(),u=G4(),l=mE(),c=function(d){var p=function(f,_,R){if(this instanceof p){switch(arguments.length){case 0:return new d;case 1:return new d(f);case 2:return new d(f,_)}return new d(f,_,R)}return t(d,this,arguments)};return p.prototype=d.prototype,p};return Qy=function(d,p){var f=d.target,_=d.global,R=d.stat,w=d.proto,O=_?e:R?e[f]:e[f]&&e[f].prototype,h=_?s:s[f]||u(s,f,{})[f],T=h.prototype,b,m,v,A,P,q,z,Y,W;for(A in p)b=a(_?A:f+(R?".":"#")+A,d.forced),m=!b&&O&&l(O,A),q=h[A],m&&(d.dontCallGetSet?(W=i(O,A),z=W&&W.value):z=O[A]),P=m&&z?z:p[A],!(!b&&!w&&typeof q==typeof P)&&(d.bind&&m?Y=o(P,e):d.wrap&&m?Y=c(P):w&&n(P)?Y=r(P):Y=P,(d.sham||P&&P.sham||q&&q.sham)&&u(Y,"sham",!0),u(h,A,Y),w&&(v=f+"Prototype",l(s,v)||u(s,v,{}),u(s[v],A,P),d.real&&T&&(b||!T[A])&&u(T,A,P)))},Qy}var uO;function W4(){if(uO)return fA;uO=1;var e=z4(),t=an();return e({global:!0,forced:t.globalThis!==t},{globalThis:t}),fA}var Zy,cO;function Y4(){return cO||(cO=1,W4(),Zy=an()),Zy}var eg,lO;function x4(){if(lO)return eg;lO=1;var e=Y4();return eg=e,eg}var dO;function _M(){if(dO)return Ki;dO=1;var e=Ki&&Ki.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.getImplementation=void 0;var t=e(x4());function r(n,i){var a,s=(a=n[i])!==null&&a!==void 0?a:t.default[i];if(!s)throw new ReferenceError('"'+i+'" is not defined');return s}return Ki.getImplementation=r,Ki}var fO;function EM(){if(fO)return La;fO=1;var e=La&&La.__values||function(o){var u=typeof Symbol=="function"&&Symbol.iterator,l=u&&o[u],c=0;if(l)return l.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&c>=o.length&&(o=void 0),{value:o&&o[c++],done:!o}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(La,"__esModule",{value:!0});var t=JC(),r=_M(),n="x-identity-auth-chain-",i="x-identity-timestamp",a="x-identity-metadata";function s(o){o===void 0&&(o={});var u=(0,r.getImplementation)(o,"Headers");return function(c,d,p,f,_){var R,w,O=new u(_),h=String(Date.now()),T=JSON.stringify(f),b=[d,p,h,T].join(":").toLowerCase(),m=0,v=t.Authenticator.signPayload(c,b);try{for(var A=e(v),P=A.next();!P.done;P=A.next()){var q=P.value;O.set(n+m,JSON.stringify(q)),m++}}catch(z){R={error:z}}finally{try{P&&!P.done&&(w=A.return)&&w.call(A)}finally{if(R)throw R.error}}return O.set(i,h),O.set(a,T),O}}return La.default=s,La}var pO;function vM(){if(pO)return pn;pO=1;var e=pn&&pn.__assign||function(){return e=Object.assign||function(s){for(var o,u=1,l=arguments.length;u<l;u++){o=arguments[u];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(s[c]=o[c])}return s},e.apply(this,arguments)},t=pn&&pn.__rest||function(s,o){var u={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&o.indexOf(l)<0&&(u[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,l=Object.getOwnPropertySymbols(s);c<l.length;c++)o.indexOf(l[c])<0&&Object.prototype.propertyIsEnumerable.call(s,l[c])&&(u[l[c]]=s[l[c]]);return u},r=pn&&pn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(pn,"__esModule",{value:!0});var n=r(EM()),i=_M();function a(s){s===void 0&&(s={});var o=(0,n.default)(s),u=(0,i.getImplementation)(s,"URL"),l=(0,i.getImplementation)(s,"Request"),c=(0,i.getImplementation)(s,"fetch");return function(p,f){if(f&&f.identity){var _=f.identity,R=f.metadata,w=t(f,["identity","metadata"]);if(typeof p=="string"||p instanceof u||globalThis.URL&&p instanceof globalThis.URL){var O=typeof p=="string"?new u(p):p,h=new l(O.toString(),e(e({},w),{headers:o(_,f.method||"GET",O.pathname,R||{},w==null?void 0:w.headers)}));return c(h)}var T=new u(p.url),b=new l(p),m=o(_,p.method||"GET",T.pathname,R||{});return m.forEach(function(v,A){b.headers.set(A,v)}),c(b)}return c(p,f)}}return pn.default=a,pn}var mO;function K4(){return mO||(mO=1,(function(e){var t=jn&&jn.__createBinding||(Object.create?(function(s,o,u,l){l===void 0&&(l=u),Object.defineProperty(s,l,{enumerable:!0,get:function(){return o[u]}})}):(function(s,o,u,l){l===void 0&&(l=u),s[l]=o[u]})),r=jn&&jn.__exportStar||function(s,o){for(var u in s)u!=="default"&&!Object.prototype.hasOwnProperty.call(o,u)&&t(o,s,u)},n=jn&&jn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.signedHeaderFactory=e.signedFetchFactory=void 0,r(aM(),e);var i=vM();Object.defineProperty(e,"signedFetchFactory",{enumerable:!0,get:function(){return n(i).default}});var a=EM();Object.defineProperty(e,"signedHeaderFactory",{enumerable:!0,get:function(){return n(a).default}})})(jn)),jn}var hO;function X4(){return hO||(hO=1,(function(e){var t=Dn&&Dn.__createBinding||(Object.create?(function(a,s,o,u){u===void 0&&(u=o),Object.defineProperty(a,u,{enumerable:!0,get:function(){return s[o]}})}):(function(a,s,o,u){u===void 0&&(u=o),a[u]=s[o]})),r=Dn&&Dn.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,a,o)},n=Dn&&Dn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),r(aM(),e),r(K4(),e);var i=n(vM());e.default=(0,i.default)()})(Dn)),Dn}var J4=X4();const ud=WO(J4);async function Q4(e,t){const r=`${Nt.creditsServerUrl}/users/${e.toLowerCase()}/credits`,n=await ud(r,{method:"GET",identity:t,metadata:{}});if(!n.ok)throw new Error(`getUserCredits ${n.status}: ${await n.text()}`);return n.json()}async function Z4(e,t){const{usd:r}=await Q4(e,t);return r??{balanceCents:0,credits:0}}async function f6(e,t,r){const n=`${Nt.creditsServerUrl}/credits/authorize`,i=await ud(n,{method:"POST",identity:e,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({usdPriceCents:t,tradeId:r})});if(!i.ok)throw new Error(`authorizeUsdCredit ${i.status}: ${await i.text()}`);return i.json()}async function p6(e,t,r){const n=new URLSearchParams;n.set("status","all"),n.set("limit",String(r.first)),(r==null?void 0:r.skip)!=null&&n.set("offset",String(r.skip));const i=n.toString(),a=`${Nt.creditsServerUrl}/users/${e.toLowerCase()}/purchases${i?`?${i}`:""}`,s=await ud(a,{method:"GET",identity:t,metadata:{}});if(!s.ok)throw new Error(`fetchUserPurchases ${s.status}: ${await s.text()}`);const o=await s.json(),u=o.purchases??[],l=(r==null?void 0:r.skip)??0,c=r==null?void 0:r.first,d=typeof o.total=="number"?o.total:l+u.length+(u.length>=c?1:0);return{items:u,total:d}}async function m6(e,t){if(t.length===0)return 0;const r=`${Nt.creditsServerUrl}/credits/authorize/cancel`,n=await ud(r,{method:"POST",identity:e,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({salts:t})});if(!n.ok)throw new Error(`cancelUsdIntents ${n.status}: ${await n.text()}`);return(await n.json()).released??0}async function h6(e,t=1e3){const r=await fetch(`${Nt.creditsServerUrl}/dev/mint-usd`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:e.toLowerCase(),usdCents:t})});if(!r.ok)throw new Error(`devMintUsd ${r.status}: ${await r.text()}`);return r.json()}function ez(e){return Ll({queryKey:["usd-balance",e==null?void 0:e.address],enabled:!!e,staleTime:3e4,queryFn:async()=>Z4(e.address,e.identity)})}const tz=e=>qo(e.reduce((t,r)=>t+r.priceCredits,0)),Kr=Is((e,t)=>({items:[],open:!1,fittingOpen:!1,add:(r,n="grid")=>{const i=t().items.some(s=>s.id===r.id);if(e(s=>i?{open:!0}:{items:[...s.items,r],open:!0}),i)return;const a=t().items;ci("Shop Added To Cart",{item_id:r.itemId??null,contract_address:r.contractAddress,price_credits:r.priceCredits,price_usd:qo(r.priceCredits),is_primary:!r.tokenId,source:n,cart_size:a.length,cart_value_usd:tz(a)})},remove:r=>{const n=t().items.find(i=>i.id===r);e(i=>({items:i.items.filter(a=>a.id!==r)})),n&&ci("Shop Removed From Cart",{item_id:n.itemId??null,cart_size:t().items.length})},clear:()=>e({items:[]}),setOpen:r=>e({open:r}),setFittingOpen:r=>e(r?{fittingOpen:r,open:!1}:{fittingOpen:r})})),ds={name:"credits",nameSingular:"credit",symbol:"◈",iconClass:"ico-credits"};function y6(e){return`${e} ${e===1?ds.nameSingular:ds.name}`}function Un({className:e}){return J.jsx("span",{className:`ico ${ds.iconClass}${e?` ${e}`:""}`,"aria-hidden":!0})}function rz(){const e=Kr(s=>s.items),t=Kr(s=>s.open),r=Kr(s=>s.setOpen),n=Kr(s=>s.setFittingOpen),i=De.useRef(null),a=e.reduce((s,o)=>s+o.priceCredits,0);return De.useEffect(()=>{if(!t)return;const s=setTimeout(()=>r(!1),4500),o=u=>{i.current&&!i.current.contains(u.target)&&r(!1)};return document.addEventListener("mousedown",o),()=>{clearTimeout(s),document.removeEventListener("mousedown",o)}},[t,e.length,r]),!t||e.length===0?null:J.jsxs("div",{className:"cart-pop",ref:i,role:"dialog","aria-label":"Cart",children:[J.jsxs("div",{className:"cart-pop__head",children:[J.jsx("span",{className:"ico ico-cart","aria-hidden":!0})," Added to cart"]}),J.jsx("div",{className:"cart-pop__list",children:e.slice(-4).map(s=>J.jsxs("div",{className:"cart-pop__row",children:[J.jsx("div",{className:"cart-pop__thumb",children:s.thumbnail?J.jsx("img",{src:s.thumbnail,alt:s.name}):null}),J.jsx("div",{className:"cart-pop__name",title:s.name,children:s.name}),J.jsxs("div",{className:"cart-pop__price",children:[J.jsx(Un,{className:"ccy-mark"})," ",s.priceCredits]})]},s.id))}),J.jsxs("div",{className:"cart-pop__foot",children:[J.jsxs("span",{className:"cart-pop__total",children:[e.length," item",e.length>1?"s":""," · ",J.jsxs("strong",{children:[J.jsx(Un,{className:"ccy-mark"})," ",a]})]}),J.jsxs("div",{className:"cart-pop__actions",children:[J.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n(!0),children:"Try on"}),J.jsx(Oo,{className:"btn btn--purple btn--sm",to:"/cart",onClick:()=>r(!1),children:"Checkout"})]})]})]})}var xg=function(e,t){return xg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},xg(e,t)};function Mr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xg(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var qe=function(){return qe=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},qe.apply(this,arguments)};function As(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function bM(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(a=(i<3?s(a):i>3?s(t,r,a):s(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function TM(e,t){return function(r,n){t(r,n,e)}}function SM(e,t,r,n,i,a){function s(O){if(O!==void 0&&typeof O!="function")throw new TypeError("Function expected");return O}for(var o=n.kind,u=o==="getter"?"get":o==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,p=!1,f=r.length-1;f>=0;f--){var _={};for(var R in n)_[R]=R==="access"?{}:n[R];for(var R in n.access)_.access[R]=n.access[R];_.addInitializer=function(O){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(O||null))};var w=(0,r[f])(o==="accessor"?{get:c.get,set:c.set}:c[u],_);if(o==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(d=s(w.get))&&(c.get=d),(d=s(w.set))&&(c.set=d),(d=s(w.init))&&i.unshift(d)}else(d=s(w))&&(o==="field"?i.unshift(d):c[u]=d)}l&&Object.defineProperty(l,n.name,c),p=!0}function IM(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function RM(e){return typeof e=="symbol"?e:"".concat(e)}function wM(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function AM(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function OM(e,t,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(d){s(d)}}function u(c){try{l(n.throw(c))}catch(d){s(d)}}function l(c){c.done?a(c.value):i(c.value).then(o,u)}l((n=n.apply(e,t||[])).next())})}function NM(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var cd=Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]});function PM(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&cd(t,e,r)}function jl(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hE(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function CM(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hE(arguments[t]));return e}function MM(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n}function er(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function fs(e){return this instanceof fs?(this.v=e,this):new fs(e)}function DM(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(f){return function(_){return Promise.resolve(_).then(f,d)}}function o(f,_){n[f]&&(i[f]=function(R){return new Promise(function(w,O){a.push([f,R,w,O])>1||u(f,R)})},_&&(i[f]=_(i[f])))}function u(f,_){try{l(n[f](_))}catch(R){p(a[0][3],R)}}function l(f){f.value instanceof fs?Promise.resolve(f.value.v).then(c,d):p(a[0][2],f)}function c(f){u("next",f)}function d(f){u("throw",f)}function p(f,_){f(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function jM(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,a){t[i]=e[i]?function(s){return(r=!r)?{value:fs(e[i](s)),done:!1}:a?a(s):s}:a}}function LM(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof jl=="function"?jl(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(s){return new Promise(function(o,u){s=e[a](s),i(o,u,s.done,s.value)})}}function i(a,s,o,u){Promise.resolve(u).then(function(l){a({value:l,done:o})},s)}}function $M(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var nz=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Kg=function(e){return Kg=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Kg(e)};function qM(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Kg(e),n=0;n<r.length;n++)r[n]!=="default"&&cd(t,e,r[n]);return nz(t,e),t}function BM(e){return e&&e.__esModule?e:{default:e}}function kM(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function UM(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function FM(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function HM(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var iz=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function VM(e){function t(a){e.error=e.hasError?new iz(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var r,n=0;function i(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(i,function(s){return t(s),i()})}else n|=1}catch(s){t(s)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return i()}function GM(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,a,s){return n?t?".jsx":".js":i&&(!a||!s)?r:i+a+"."+s.toLowerCase()+"js"}):e}const az={__extends:Mr,__assign:qe,__rest:As,__decorate:bM,__param:TM,__esDecorate:SM,__runInitializers:IM,__propKey:RM,__setFunctionName:wM,__metadata:AM,__awaiter:OM,__generator:NM,__createBinding:cd,__exportStar:PM,__values:jl,__read:hE,__spread:CM,__spreadArrays:MM,__spreadArray:er,__await:fs,__asyncGenerator:DM,__asyncDelegator:jM,__asyncValues:LM,__makeTemplateObject:$M,__importStar:qM,__importDefault:BM,__classPrivateFieldGet:kM,__classPrivateFieldSet:UM,__classPrivateFieldIn:FM,__addDisposableResource:HM,__disposeResources:VM,__rewriteRelativeImportExtension:GM},g6=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:HM,get __assign(){return qe},__asyncDelegator:jM,__asyncGenerator:DM,__asyncValues:LM,__await:fs,__awaiter:OM,__classPrivateFieldGet:kM,__classPrivateFieldIn:FM,__classPrivateFieldSet:UM,__createBinding:cd,__decorate:bM,__disposeResources:VM,__esDecorate:SM,__exportStar:PM,__extends:Mr,__generator:NM,__importDefault:BM,__importStar:qM,__makeTemplateObject:$M,__metadata:AM,__param:TM,__propKey:RM,__read:hE,__rest:As,__rewriteRelativeImportExtension:GM,__runInitializers:IM,__setFunctionName:wM,__spread:CM,__spreadArray:er,__spreadArrays:MM,__values:jl,default:az},Symbol.toStringTag,{value:"Module"}));function hr(e,t){var r=t&&t.cache?t.cache:dz,n=t&&t.serializer?t.serializer:lz,i=t&&t.strategy?t.strategy:uz;return i(e,{cache:r,serializer:n})}function sz(e){return e==null||typeof e=="number"||typeof e=="boolean"}function oz(e,t,r,n){var i=sz(n)?n:r(n),a=t.get(i);return typeof a>"u"&&(a=e.call(this,n),t.set(i,a)),a}function zM(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),a=t.get(i);return typeof a>"u"&&(a=e.apply(this,n),t.set(i,a)),a}function WM(e,t,r,n,i){return r.bind(t,e,n,i)}function uz(e,t){var r=e.length===1?oz:zM;return WM(e,this,r,t.cache.create(),t.serializer)}function cz(e,t){return WM(e,this,zM,t.cache.create(),t.serializer)}var lz=function(){return JSON.stringify(arguments)};function yE(){this.cache=Object.create(null)}yE.prototype.get=function(e){return this.cache[e]};yE.prototype.set=function(e,t){this.cache[e]=t};var dz={create:function(){return new yE}},yr={variadic:cz};function YM(e,t,r){if(r===void 0&&(r=Error),!e)throw new r(t)}hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.Locale).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.ListFormat).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});var at;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(at||(at={}));var Dt;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(Dt||(Dt={}));var ps;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(ps||(ps={}));function yO(e){return e.type===Dt.literal}function fz(e){return e.type===Dt.argument}function xM(e){return e.type===Dt.number}function KM(e){return e.type===Dt.date}function XM(e){return e.type===Dt.time}function JM(e){return e.type===Dt.select}function QM(e){return e.type===Dt.plural}function pz(e){return e.type===Dt.pound}function ZM(e){return e.type===Dt.tag}function eD(e){return!!(e&&typeof e=="object"&&e.type===ps.number)}function Xg(e){return!!(e&&typeof e=="object"&&e.type===ps.dateTime)}var tD=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,mz=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function hz(e){var t={};return e.replace(mz,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"long":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var yz=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function gz(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(yz).filter(function(p){return p.length>0}),r=[],n=0,i=t;n<i.length;n++){var a=i[n],s=a.split("/");if(s.length===0)throw new Error("Invalid number skeleton");for(var o=s[0],u=s.slice(1),l=0,c=u;l<c.length;l++){var d=c[l];if(d.length===0)throw new Error("Invalid number skeleton")}r.push({stem:o,options:u})}return r}function _z(e){return e.replace(/^(.*?)-/,"")}var gO=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,rD=/^(@+)?(\+|#+)?[rs]?$/g,Ez=/(\*)(0+)|(#+)(0+)|(0+)/g,nD=/^(0+)$/;function _O(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(rD,function(r,n,i){return typeof i!="string"?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):i==="+"?t.minimumSignificantDigits=n.length:n[0]==="#"?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof i=="string"?i.length:0)),""}),t}function iD(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function vz(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if(r==="+!"?(t.signDisplay="always",e=e.slice(2)):r==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!nD.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function EO(e){var t={},r=iD(e);return r||t}function bz(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=_z(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=qe(qe(qe({},t),{notation:"scientific"}),i.options.reduce(function(u,l){return qe(qe({},u),EO(l))},{}));continue;case"engineering":t=qe(qe(qe({},t),{notation:"engineering"}),i.options.reduce(function(u,l){return qe(qe({},u),EO(l))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Ez,function(u,l,c,d,p,f){if(l)t.minimumIntegerDigits=c.length;else{if(d&&p)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(nD.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(gO.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(gO,function(u,l,c,d,p,f){return c==="*"?t.minimumFractionDigits=l.length:d&&d[0]==="#"?t.maximumFractionDigits=d.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var a=i.options[0];a==="w"?t=qe(qe({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=qe(qe({},t),_O(a)));continue}if(rD.test(i.stem)){t=qe(qe({},t),_O(i.stem));continue}var s=iD(i.stem);s&&(t=qe(qe({},t),s));var o=vz(i.stem);o&&(t=qe(qe({},t),o))}return t}var ml={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Tz(e,t){for(var r="",n=0;n<e.length;n++){var i=e.charAt(n);if(i==="j"){for(var a=0;n+1<e.length&&e.charAt(n+1)===i;)a++,n++;var s=1+(a&1),o=a<2?1:3+(a>>1),u="a",l=Sz(t);for((l=="H"||l=="k")&&(o=0);o-- >0;)r+=u;for(;s-- >0;)r=l+r}else i==="J"?r+="H":r+=i}return r}function Sz(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var i=ml[n||""]||ml[r||""]||ml["".concat(r,"-001")]||ml["001"];return i[0]}var tg,Iz=new RegExp("^".concat(tD.source,"*")),Rz=new RegExp("".concat(tD.source,"*$"));function ct(e,t){return{start:e,end:t}}var wz=!!String.prototype.startsWith&&"_a".startsWith("a",1),Az=!!String.fromCodePoint,Oz=!!Object.fromEntries,Nz=!!String.prototype.codePointAt,Pz=!!String.prototype.trimStart,Cz=!!String.prototype.trimEnd,Mz=!!Number.isSafeInteger,Dz=Mz?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Jg=!0;try{var jz=sD("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Jg=((tg=jz.exec("a"))===null||tg===void 0?void 0:tg[0])==="a"}catch{Jg=!1}var vO=wz?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Qg=Az?String.fromCodePoint:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n="",i=t.length,a=0,s;i>a;){if(s=t[a++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},bO=Oz?Object.fromEntries:function(t){for(var r={},n=0,i=t;n<i.length;n++){var a=i[n],s=a[0],o=a[1];r[s]=o}return r},aD=Nz?function(t,r){return t.codePointAt(r)}:function(t,r){var n=t.length;if(!(r<0||r>=n)){var i=t.charCodeAt(r),a;return i<55296||i>56319||r+1===n||(a=t.charCodeAt(r+1))<56320||a>57343?i:(i-55296<<10)+(a-56320)+65536}},Lz=Pz?function(t){return t.trimStart()}:function(t){return t.replace(Iz,"")},$z=Cz?function(t){return t.trimEnd()}:function(t){return t.replace(Rz,"")};function sD(e,t){return new RegExp(e,t)}var Zg;if(Jg){var TO=sD("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Zg=function(t,r){var n;TO.lastIndex=r;var i=TO.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else Zg=function(t,r){for(var n=[];;){var i=aD(t,r);if(i===void 0||oD(i)||Uz(i))break;n.push(i),r+=i>=65536?2:1}return Qg.apply(void 0,n)};var qz=(function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var a=this.char();if(a===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(a===125&&t>0)break;if(a===35&&(r==="plural"||r==="selectordinal")){var o=this.clonePosition();this.bump(),i.push({type:Dt.pound,location:ct(o,this.clonePosition())})}else if(a===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(at.UNMATCHED_CLOSING_TAG,ct(this.clonePosition(),this.clonePosition()))}else if(a===60&&!this.ignoreTag&&e_(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Dt.literal,value:"<".concat(i,"/>"),location:ct(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,r,!0);if(a.err)return a;var s=a.val,o=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!e_(this.char()))return this.error(at.INVALID_TAG,ct(o,this.clonePosition()));var u=this.clonePosition(),l=this.parseTagName();return i!==l?this.error(at.UNMATCHED_CLOSING_TAG,ct(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Dt.tag,value:i,children:s,location:ct(n,this.clonePosition())},err:null}:this.error(at.INVALID_TAG,ct(o,this.clonePosition())))}else return this.error(at.UNCLOSED_TAG,ct(n,this.clonePosition()))}else return this.error(at.INVALID_TAG,ct(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&kz(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var a=this.tryParseQuote(r);if(a){i+=a;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){i+=o;continue}break}var u=ct(n,this.clonePosition());return{val:{type:Dt.literal,value:i,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Bz(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Qg.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Qg(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(at.EMPTY_ARGUMENT,ct(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(at.MALFORMED_ARGUMENT,ct(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Dt.argument,value:i,location:ct(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(at.MALFORMED_ARGUMENT,ct(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Zg(this.message,r),i=r+n.length;this.bumpTo(i);var a=this.clonePosition(),s=ct(t,a);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var a,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(o){case"":return this.error(at.EXPECT_ARGUMENT_TYPE,ct(s,u));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition(),d=this.parseSimpleArgStyleIfPossible();if(d.err)return d;var p=$z(d.val);if(p.length===0)return this.error(at.EXPECT_ARGUMENT_STYLE,ct(this.clonePosition(),this.clonePosition()));var f=ct(c,this.clonePosition());l={style:p,styleLocation:f}}var _=this.tryParseArgumentClose(i);if(_.err)return _;var R=ct(i,this.clonePosition());if(l&&vO(l==null?void 0:l.style,"::",0)){var w=Lz(l.style.slice(2));if(o==="number"){var d=this.parseNumberSkeletonFromString(w,l.styleLocation);return d.err?d:{val:{type:Dt.number,value:n,location:R,style:d.val},err:null}}else{if(w.length===0)return this.error(at.EXPECT_DATE_TIME_SKELETON,R);var O=w;this.locale&&(O=Tz(w,this.locale));var p={type:ps.dateTime,pattern:O,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?hz(O):{}},h=o==="date"?Dt.date:Dt.time;return{val:{type:h,value:n,location:R,style:p},err:null}}}return{val:{type:o==="number"?Dt.number:o==="date"?Dt.date:Dt.time,value:n,location:R,style:(a=l==null?void 0:l.style)!==null&&a!==void 0?a:null},err:null}}case"plural":case"selectordinal":case"select":{var T=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(at.EXPECT_SELECT_ARGUMENT_OPTIONS,ct(T,qe({},T)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),m=0;if(o!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(at.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ct(this.clonePosition(),this.clonePosition()));this.bumpSpace();var d=this.tryParseDecimalInteger(at.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,at.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(d.err)return d;this.bumpSpace(),b=this.parseIdentifierIfPossible(),m=d.val}var v=this.tryParsePluralOrSelectOptions(t,o,r,b);if(v.err)return v;var _=this.tryParseArgumentClose(i);if(_.err)return _;var A=ct(i,this.clonePosition());return o==="select"?{val:{type:Dt.select,value:n,options:bO(v.val),location:A},err:null}:{val:{type:Dt.plural,value:n,options:bO(v.val),offset:m,pluralType:o==="plural"?"cardinal":"ordinal",location:A},err:null}}default:return this.error(at.INVALID_ARGUMENT_TYPE,ct(s,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(at.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,ct(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=gz(t)}catch{return this.error(at.INVALID_NUMBER_SKELETON,r)}return{val:{type:ps.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?bz(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var a,s=!1,o=[],u=new Set,l=i.value,c=i.location;;){if(l.length===0){var d=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var p=this.tryParseDecimalInteger(at.EXPECT_PLURAL_ARGUMENT_SELECTOR,at.INVALID_PLURAL_ARGUMENT_SELECTOR);if(p.err)return p;c=ct(d,this.clonePosition()),l=this.message.slice(d.offset,this.offset())}else break}if(u.has(l))return this.error(r==="select"?at.DUPLICATE_SELECT_ARGUMENT_SELECTOR:at.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);l==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?at.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:at.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,ct(this.clonePosition(),this.clonePosition()));var _=this.parseMessage(t+1,r,n);if(_.err)return _;var R=this.tryParseArgumentClose(f);if(R.err)return R;o.push([l,{value:_.val,location:ct(f,this.clonePosition())}]),u.add(l),this.bumpSpace(),a=this.parseIdentifierIfPossible(),l=a.value,c=a.location}return o.length===0?this.error(r==="select"?at.EXPECT_SELECT_ARGUMENT_SELECTOR:at.EXPECT_PLURAL_ARGUMENT_SELECTOR,ct(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(at.MISSING_OTHER_CLAUSE,ct(this.clonePosition(),this.clonePosition())):{val:o,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var a=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)a=!0,s=s*10+(o-48),this.bump();else break}var u=ct(i,this.clonePosition());return a?(s*=n,Dz(s)?{val:s,err:null}:this.error(r,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=aD(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(vO(this.message,t,this.offset())){for(var r=0;r<t.length;r++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var r=this.offset(),n=this.message.indexOf(t,r);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&oD(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e})();function e_(e){return e>=97&&e<=122||e>=65&&e<=90}function Bz(e){return e_(e)||e===47}function kz(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function oD(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Uz(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function t_(e){e.forEach(function(t){if(delete t.location,JM(t)||QM(t))for(var r in t.options)delete t.options[r].location,t_(t.options[r].value);else xM(t)&&eD(t.style)||(KM(t)||XM(t))&&Xg(t.style)?delete t.style.location:ZM(t)&&t_(t.children)})}function Fz(e,t){t===void 0&&(t={}),t=qe({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new qz(e,t).parse();if(r.err){var n=SyntaxError(at[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t!=null&&t.captureLocation||t_(r.val),r.val}var Tn;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Tn||(Tn={}));var di=(function(e){Mr(t,e);function t(r,n,i){var a=e.call(this,r)||this;return a.code=n,a.originalMessage=i,a}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error),SO=(function(e){Mr(t,e);function t(r,n,i,a){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Tn.INVALID_VALUE,a)||this}return t})(di),Hz=(function(e){Mr(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Tn.INVALID_VALUE,i)||this}return t})(di),Vz=(function(e){Mr(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Tn.MISSING_VALUE,n)||this}return t})(di),mr;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(mr||(mr={}));function Gz(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==mr.literal||r.type!==mr.literal?t.push(r):n.value+=r.value,t},[])}function uD(e){return typeof e=="function"}function bl(e,t,r,n,i,a,s){if(e.length===1&&yO(e[0]))return[{type:mr.literal,value:e[0].value}];for(var o=[],u=0,l=e;u<l.length;u++){var c=l[u];if(yO(c)){o.push({type:mr.literal,value:c.value});continue}if(pz(c)){typeof a=="number"&&o.push({type:mr.literal,value:r.getNumberFormat(t).format(a)});continue}var d=c.value;if(!(i&&d in i))throw new Vz(d,s);var p=i[d];if(fz(c)){(!p||typeof p=="string"||typeof p=="number")&&(p=typeof p=="string"||typeof p=="number"?String(p):""),o.push({type:typeof p=="string"?mr.literal:mr.object,value:p});continue}if(KM(c)){var f=typeof c.style=="string"?n.date[c.style]:Xg(c.style)?c.style.parsedOptions:void 0;o.push({type:mr.literal,value:r.getDateTimeFormat(t,f).format(p)});continue}if(XM(c)){var f=typeof c.style=="string"?n.time[c.style]:Xg(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:mr.literal,value:r.getDateTimeFormat(t,f).format(p)});continue}if(xM(c)){var f=typeof c.style=="string"?n.number[c.style]:eD(c.style)?c.style.parsedOptions:void 0;f&&f.scale&&(p=p*(f.scale||1)),o.push({type:mr.literal,value:r.getNumberFormat(t,f).format(p)});continue}if(ZM(c)){var _=c.children,R=c.value,w=i[R];if(!uD(w))throw new Hz(R,"function",s);var O=bl(_,t,r,n,i,a),h=w(O.map(function(m){return m.value}));Array.isArray(h)||(h=[h]),o.push.apply(o,h.map(function(m){return{type:typeof m=="string"?mr.literal:mr.object,value:m}}))}if(JM(c)){var T=c.options[p]||c.options.other;if(!T)throw new SO(c.value,p,Object.keys(c.options),s);o.push.apply(o,bl(T.value,t,r,n,i));continue}if(QM(c)){var T=c.options["=".concat(p)];if(!T){if(!Intl.PluralRules)throw new di(`Intl.PluralRules is not available in this environment.
|
|
74
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(h,T){if(h){if(typeof h=="string")return p(h,T);var b={}.toString.call(h).slice(8,-1);return b==="Object"&&h.constructor&&(b=h.constructor.name),b==="Map"||b==="Set"?Array.from(h):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?p(h,T):void 0}}function p(h,T){(T==null||T>h.length)&&(T=h.length);for(var b=0,m=Array(T);b<T;b++)m[b]=h[b];return m}function f(h,T){var b=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(b!=null){var m,v,A,P,q=[],z=!0,Y=!1;try{if(A=(b=b.call(h)).next,T!==0)for(;!(z=(m=A.call(b)).done)&&(q.push(m.value),q.length!==T);z=!0);}catch(W){Y=!0,v=W}finally{try{if(!z&&b.return!=null&&(P=b.return(),Object(P)!==P))return}finally{if(Y)throw v}}return q}}function _(h){if(Array.isArray(h))return h}var R={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},w=/^\[([^\]]+)\](?::([0-9]+))?$/;function O(h,T){if((0,r.default)(h),!h||/[\s<>]/.test(h)||h.indexOf("mailto:")===0||(T=(0,o.default)(T,R),T.validate_length&&h.length>T.max_allowed_length)||!T.allow_fragments&&(0,i.default)(h,"#")||!T.allow_query_components&&((0,i.default)(h,"?")||(0,i.default)(h,"&")))return!1;var b,m,v,A,P,q,z,Y;z=h.split("#"),h=z.shift(),z=h.split("?"),h=z.shift();var W=h.match(/^([a-z][a-z0-9+\-.]*):/i),U=!1,F=function(le){return U=!0,b=le.toLowerCase(),T.require_valid_protocol&&T.protocols.indexOf(b)===-1?!1:h.substring(W[0].length)};if(W){var ce=W[1],se=h.substring(W[0].length),ne=se.slice(0,2)==="//";if(ne){if(h=F(ce),h===!1)return!1}else{var X=se.indexOf("/"),x=X===-1?se:se.substring(0,X),L=x.indexOf("@");if(L!==-1){var D=x.substring(0,L),$=/^[a-zA-Z0-9\-_.%:]*$/,V=$.test(D),N=/%[0-9a-fA-F]{2}/.test(D);if(V&&!N){if(T.require_protocol)return!1}else if(h=F(ce),h===!1)return!1}else{var j=/^[0-9]/.test(se);if(j){if(T.require_protocol)return!1}else if(h=F(ce),h===!1)return!1}}}else if(T.require_protocol)return!1;if(h.slice(0,2)==="//"){if(!U&&!T.allow_protocol_relative_urls)return!1;h=h.slice(2)}if(h==="")return!1;if(z=h.split("/"),h=z.shift(),h===""&&!T.require_host)return!0;if(z=h.split("@"),z.length>1){if(T.disallow_auth||z[0]===""||(m=z.shift(),m.indexOf(":")>=0&&m.split(":").length>2))return!1;var Z=m.split(":"),Ee=l(Z,2),_e=Ee[0],Se=Ee[1];if(_e===""&&Se==="")return!1}A=z.join("@"),q=null,Y=null;var Ie=A.match(w);if(Ie?(v="",Y=Ie[1],q=Ie[2]||null):(z=A.split(":"),v=z.shift(),z.length&&(q=z.join(":"))),q!==null&&q.length>0){if(P=parseInt(q,10),!/^[0-9]+$/.test(q)||P<=0||P>65535)return!1}else if(T.require_port)return!1;return T.host_whitelist?(0,n.default)(v,T.host_whitelist):v===""&&!T.require_host?!0:!(!(0,s.default)(v)&&!(0,a.default)(v,T)&&(!Y||!(0,s.default)(Y,6))||(v=v||Y,T.host_blacklist&&(0,n.default)(v,T.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(sl,sl.exports)),sl.exports}var ry={},Jw;function ZC(){return Jw||(Jw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localStorageClearIdentity=e.localStorageStoreIdentity=e.localStorageGetIdentity=e.createMessage=e.SINGLE_SIGN_ON_TARGET=e.Action=void 0;var t;(function(o){o.GET="get",o.STORE="store",o.CLEAR="clear",o.PING="ping"})(t||(e.Action=t={})),e.SINGLE_SIGN_ON_TARGET="single-sign-on";function r(o){return{target:e.SINGLE_SIGN_ON_TARGET,...o}}e.createMessage=r;function n(o){const u=localStorage.getItem(s(o));if(!u)return null;let l;try{l=JSON.parse(u)}catch{return a(o),null}return l.expiration=new Date(l.expiration),l.expiration.getTime()<=Date.now()?(a(o),null):l}e.localStorageGetIdentity=n;function i(o,u){new Date(u.expiration).getTime()>Date.now()&&localStorage.setItem(s(o),JSON.stringify(u))}e.localStorageStoreIdentity=i;function a(o){localStorage.removeItem(s(o))}e.localStorageClearIdentity=a;function s(o){if(!/^0x[a-fA-F0-9]{40}$/.test(o))throw new Error("User must be a valid ethereum address");return`single-sign-on-${o.toLowerCase()}`}})(ry)),ry}var Qw;function XG(){if(Qw)return Wr;Qw=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.clearIdentity=Wr.storeIdentity=Wr.getIdentity=Wr.init=void 0;const e=KG(),t=ZC(),r=t.SINGLE_SIGN_ON_TARGET,n=500,i=5;let a=0,s="";const o={protocols:["https"],require_protocol:!0};function u(w,O={}){if(!(0,e.default)(w,{...o,...O}))throw new Error(`Invalid url: ${w}`);if(s)throw new Error("Already initialized");const h=document.createElement("iframe");h.id=r,h.src=w,h.style.width="0",h.style.height="0",h.style.border="none",h.style.position="absolute",document.body.appendChild(h),s=w}Wr.init=u;async function l(w){let O;try{O=(await f(await p(),t.Action.GET,{user:w})).identity??null}catch(h){R(h),O=(0,t.localStorageGetIdentity)(w)}return O}Wr.getIdentity=l;async function c(w,O){try{await f(await p(),t.Action.STORE,{user:w,identity:O})}catch(h){R(h),(0,t.localStorageStoreIdentity)(w,O)}}Wr.storeIdentity=c;async function d(w){try{await f(await p(),t.Action.CLEAR,{user:w})}catch(O){R(O),(0,t.localStorageClearIdentity)(w)}}Wr.clearIdentity=d;async function p(){if(!s)throw new Error("Not initialized");for(let w=0;w<i;w++){const O=document.getElementById(r),h=O==null?void 0:O.contentWindow;if(!h){await _(n);continue}try{await f(h,t.Action.PING,{},n)}catch{continue}return h}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function f(w,O,h,T=0){a++;const b=a;let m=null;const v=new Promise((A,P)=>{m=({data:q})=>{!q||q.target!==t.SINGLE_SIGN_ON_TARGET||q.id!==b||(q.error?P(new Error(q.error)):A(q))},window.addEventListener("message",m)});w.postMessage((0,t.createMessage)({id:b,action:O,...h}),s);try{return await(T?Promise.race([v,new Promise((A,P)=>setTimeout(()=>P(new Error("Did not receive a response in time")),T))]):v)}catch(A){throw A}finally{m&&window.removeEventListener("message",m)}}function _(w){return new Promise(O=>setTimeout(O,w))}function R(w){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",w.message)}return Wr}var Zw;function JG(){return Zw||(Zw=1,(function(e){var t=xi&&xi.__createBinding||(Object.create?(function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}):(function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]})),r=xi&&xi.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(XG(),e),r(ZC(),e)})(xi)),xi}var zg=JG();function QG(e){const{host:t}=e;return t.endsWith(".org")||t.endsWith(".co")?bn.PRODUCTION:t.endsWith(".today")||t.endsWith(".net")?bn.STAGING:t.endsWith(".io")||t.endsWith(".zone")?bn.DEVELOPMENT:null}function ZG(e){const t=new URLSearchParams(e.search),r=t.get("ENV")||t.get("env");if(r){const n=r.toLowerCase();if(tM(n))return n}return null}var eA={},bn;(function(e){e.DEVELOPMENT="dev",e.STAGING="stg",e.PRODUCTION="prod"})(bn||(bn={}));function eM(){return Object.values(bn)}function tM(e){return eM().includes(e)}function pl(e){if(tM(e))return e;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${e}", possible values are ${eM().map(t=>`"${t}"`).join(", ")}.`)}function e3(e={}){const{DCL_DEFAULT_ENV:t,REACT_APP_DCL_DEFAULT_ENV:r,VITE_DCL_DEFAULT_ENV:n,GATSBY_DCL_DEFAULT_ENV:i}=e;if(t&&r&&t!==r)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(t&&n&&t!==n)throw new Error("You have defined both DCL_DEFAULT_ENV and VITE_DCL_DEFAULT_ENV with different values");if(t&&i&&t!==i)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if(r&&i&&r!==i)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return t?pl(t):r?pl(r):n?pl(n):i?pl(i):bn.PRODUCTION}function t3(e){if(typeof window<"u"){const r=ZG(window.location);if(r)return r;const n=QG(window.location);if(n)return n}return e3(typeof e>"u"&&typeof yl=="object"&&typeof eA=="object"?eA:e)}function r3(e,t){const r=t3(t==null?void 0:t.systemEnvVariables),n=e[r];return{get:(i,a="")=>{if(!n)throw new Error(`Could not find a config for env=${r}`);return i in n?n[i]:a},is:i=>r===i,getEnv:()=>r}}const n3="development",i3="80002",a3="https://marketplace-api.decentraland.zone",s3="https://marketplace-api.decentraland.zone",o3="/auth",u3="https://rpc.decentraland.org/amoy",c3="https://credits.decentraland.zone",l3="https://builder-api.decentraland.zone",d3="https://peer.decentraland.zone",f3="",p3="",m3="",h3="",y3={ENVIRONMENT:n3,CHAIN_ID:i3,MARKETPLACE_SERVER_URL:a3,NFT_API_URL:s3,AUTH_URL:o3,RPC_URL:u3,CREDITS_SERVER_URL:c3,BUILDER_SERVER_URL:l3,PEER_URL:d3,SHOP_SERVER_URL:f3,STRIPE_PUBLISHABLE_KEY:p3,SEGMENT_WRITE_KEY:m3,SENTRY_DSN:h3},g3="staging",_3="80002",E3="https://marketplace-api.decentraland.zone",v3="https://marketplace-api.decentraland.zone",b3="/auth",T3="https://rpc.decentraland.org/amoy",S3="https://credits.decentraland.zone",I3="https://builder-api.decentraland.zone",R3="https://peer.decentraland.zone",w3="",A3="",O3="",N3="",P3={ENVIRONMENT:g3,CHAIN_ID:_3,MARKETPLACE_SERVER_URL:E3,NFT_API_URL:v3,AUTH_URL:b3,RPC_URL:T3,CREDITS_SERVER_URL:S3,BUILDER_SERVER_URL:I3,PEER_URL:R3,SHOP_SERVER_URL:w3,STRIPE_PUBLISHABLE_KEY:A3,SEGMENT_WRITE_KEY:O3,SENTRY_DSN:N3},C3="production",M3="137",D3="https://marketplace-api.decentraland.org",j3="https://marketplace-api.decentraland.org",L3="/auth",$3="https://rpc.decentraland.org/polygon",q3="https://credits.decentraland.org",B3="https://builder-api.decentraland.org",k3="https://peer.decentraland.org",U3="",F3="",H3="",V3="",G3={ENVIRONMENT:C3,CHAIN_ID:M3,MARKETPLACE_SERVER_URL:D3,NFT_API_URL:j3,AUTH_URL:L3,RPC_URL:$3,CREDITS_SERVER_URL:q3,BUILDER_SERVER_URL:B3,PEER_URL:k3,SHOP_SERVER_URL:U3,STRIPE_PUBLISHABLE_KEY:F3,SEGMENT_WRITE_KEY:H3,SENTRY_DSN:V3},z3={},Nr=r3({[bn.DEVELOPMENT]:y3,[bn.STAGING]:P3,[bn.PRODUCTION]:G3},{systemEnvVariables:{VITE_DCL_DEFAULT_ENV:"dev"}}),or=z3,Nt={marketplaceServerUrl:or.VITE_MARKETPLACE_SERVER_URL??Nr.get("MARKETPLACE_SERVER_URL"),nftApiUrl:or.VITE_NFT_API_URL??Nr.get("NFT_API_URL"),chainId:Number(or.VITE_CHAIN_ID??Nr.get("CHAIN_ID")),authUrl:or.VITE_AUTH_URL??Nr.get("AUTH_URL"),rpcUrl:or.VITE_RPC_URL??Nr.get("RPC_URL"),creditsServerUrl:or.VITE_CREDITS_SERVER_URL??Nr.get("CREDITS_SERVER_URL"),builderServerUrl:or.VITE_BUILDER_SERVER_URL??Nr.get("BUILDER_SERVER_URL"),peerUrl:or.VITE_PEER_URL??Nr.get("PEER_URL"),shopServerUrl:or.VITE_SHOP_SERVER_URL??Nr.get("SHOP_SERVER_URL"),stripePublishableKey:or.VITE_STRIPE_PK??Nr.get("STRIPE_PUBLISHABLE_KEY"),segmentWriteKey:or.VITE_SEGMENT_WRITE_KEY??Nr.get("SEGMENT_WRITE_KEY"),sentryDsn:or.VITE_SENTRY_DSN??Nr.get("SENTRY_DSN"),sentryEnvironment:or.VITE_SENTRY_ENVIRONMENT??(Number(or.VITE_CHAIN_ID??Nr.get("CHAIN_ID"))===80002?"dev":"prod"),sentryRelease:or.VITE_SENTRY_RELEASE??`shop@${or.VITE_APP_VERSION??"0.0.0-dev"}`},W3=744*60;async function rM(){return(await Gt(async()=>{const{connection:e}=await import("./index-MrwyliNz.js").then(t=>t.i);return{connection:e}},__vite__mapDeps([8,1]))).connection}async function Y3(e){if(!e.account)throw new Error("No account returned by the wallet");const t=e.account.toLowerCase(),r=new WD(e.provider),n=r.getSigner();let i=zg.localStorageGetIdentity(t);if(!i){const a=YD.createRandom();i=await GG.Authenticator.initializeAuthChain(t,{address:a.address,publicKey:VE(a.publicKey),privateKey:VE(a.privateKey)},W3,s=>n.signMessage(s)),zg.localStorageStoreIdentity(t,i)}return{address:t,chainId:e.chainId,signer:n,web3Provider:r,identity:i,providerType:e.providerType}}function x3(){const e=encodeURIComponent(window.location.href);window.location.replace(`${Nt.authUrl}/login?redirectTo=${e}`)}async function K3(){try{const t=await(await rM()).tryPreviousConnection();return!t.account||!zg.localStorageGetIdentity(t.account.toLowerCase())?null:await Y3(t)}catch{return null}}async function X3(){try{await(await rM()).disconnect()}catch{}}const J3=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`s-${String(performance.now())}`,Q3=Nt.chainId===80002?"amoy":"polygon",Z3=Nt.chainId===80002?"dev":"prod";function cE(){return window.analytics}function e4(){let e=null;try{e=Rs.getState().session}catch{e=null}return{address:(e==null?void 0:e.address)??null,is_signed_in:!!e,session_id:J3,network:Q3,app_env:Z3}}function ci(e,t={}){const r={...e4(),...t},n=cE();n&&n.track(e,r)}function t4(e,t={}){const r=cE();r&&r.identify(e.toLowerCase(),t)}function r4(){const e=cE();e!=null&&e.reset&&e.reset()}function n4(e){ci("Shop Viewed Page",{page:e})}function tA(e){return e===Jr.ProviderType.MAGIC||e===Jr.ProviderType.MAGIC_TEST?"magic":"wallet"}function i4(e){const t=`shop:seen:${e.toLowerCase()}`;try{return localStorage.getItem(t)?!1:(localStorage.setItem(t,"1"),!0)}catch{return!1}}function qo(e){return Math.round(e*10)/100}function lE(e){return!e.tokenId}function d6(e){return{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:e.tokenId??null,trade_id:e.tradeId??null,price_credits:e.priceCredits,price_usd:qo(e.priceCredits),rarity:e.rarity,creator:e.creator||null,is_primary:lE(e)}}function f6(e){const t=e.reduce((n,i)=>n+i.priceCredits,0),r=e.some(lE);return{items:e.map(n=>({item_id:n.itemId??null,contract_address:n.contractAddress,token_id:n.tokenId??null,price_usd:qo(n.priceCredits)})),value_credits:t,value_usd:qo(t),purchase_type:r?"item":"nft_resale",is_primary:r}}function a4(e){const t=e;if((t==null?void 0:t.code)===4001)return"user_rejected";const r=((t==null?void 0:t.message)??"").toLowerCase();return r.includes("reject")||r.includes("denied")||r.includes("cancel")?"user_rejected":r.includes("insufficient")?"insufficient_credits":r.includes("not for sale")||r.includes("no active listing")||r.includes("sold")?"not_for_sale":"unknown"}function p6(e){return a4(e)==="user_rejected"}function s4(e){const t=window;if(t.analytics&&t.analytics.invoked)return;const r=t.analytics||[];r.invoked=!0,r.methods=["track","identify","page","group","alias","ready","on","once","off","reset","setAnonymousId"],r.factory=n=>(...i)=>(r.push([n,...i]),r);for(const n of r.methods)r[n]=r.factory(n);r.load=n=>{const i=document.createElement("script");i.async=!0,i.src=`https://cdn.segment.com/analytics.js/v1/${encodeURIComponent(n)}/analytics.min.js`,document.head.appendChild(i)},t.analytics=r,r.load(e),r.page()}let rA=!1;function o4(){if(rA)return;rA=!0;const e=Nt.segmentWriteKey;e&&s4(e)}let Wg=null;function u4(e){Wg=e}function nA(e,t={}){const r=typeof t.flow=="string"?`error in ${t.flow}`:"error";if(console.error(`[shop] ${r}`,e,t),Wg)try{Wg(e,t)}catch{}}const c4=/0x[a-fA-F0-9]{130}\b/g,l4=/0x[a-fA-F0-9]{64}\b/g,d4=/(sk_[a-z]+_[A-Za-z0-9]+|pi_[A-Za-z0-9]+_secret_[A-Za-z0-9]+|[A-Za-z0-9-]*secret[A-Za-z0-9-]*)/gi,f4=/(signature|private|identity|authchain|auth_chain|ephemeral|token|secret|password|cookie|authorization)/i;function Xs(e){return e.replace(c4,"<signature>").replace(d4,"<secret>").replace(l4,"<hex32>")}function p4(e){var r;e.message&&(e.message=Xs(e.message));for(const n of((r=e.exception)==null?void 0:r.values)??[])n.value&&(n.value=Xs(n.value));for(const n of e.breadcrumbs??[])n.message&&(n.message=Xs(n.message));e.request&&(e.request.url&&(e.request.url=Xs(e.request.url)),delete e.request.cookies,delete e.request.headers);const t=n=>{if(n)for(const i of Object.keys(n)){if(f4.test(i)){delete n[i];continue}typeof n[i]=="string"&&(n[i]=Xs(n[i]))}};return t(e.tags),t(e.extra),e}let iA=!1;function m4(){if(iA)return;const e=Nt.sentryDsn;if(!e)return;iA=!0,rU({dsn:e,environment:Nt.sentryEnvironment,release:Nt.sentryRelease,integrations:[new VB],tracesSampleRate:.01,sendDefaultPii:!1,ignoreErrors:[/user rejected/i,/user denied/i,"ResizeObserver loop limit exceeded"],beforeSend:p4});const t=h4();t&&f$({id:t}),u4((r,n)=>R_(r,{extra:n}))}function h4(){var e;try{return((e=Rs.getState().session)==null?void 0:e.address)??null}catch{return null}}const aA="shop-favorites";let vl=null;const nM=e=>e?`${aA}:${e.toLowerCase()}`:aA;function sA(e){var t;try{const r=localStorage.getItem(nM(e));if(!r)return{};const n=JSON.parse(r);if(!n||typeof n!="object")return{};const i="state"in n&&((t=n.state)!=null&&t.items)?n.state.items:n;return i&&typeof i=="object"?i:{}}catch{return{}}}function oA(e){try{localStorage.setItem(nM(vl),JSON.stringify(e))}catch{}}const Dl=Is(e=>({items:sA(vl),toggle:t=>e(r=>{const n={...r.items};return n[t.id]?delete n[t.id]:n[t.id]=t,oA(n),{items:n}}),remove:t=>e(r=>{const n={...r.items};return delete n[t],oA(n),{items:n}}),reloadFor:t=>{vl=t?t.toLowerCase():null,e({items:sA(vl)})}})),uA="shop:followed-creators:v1",y4=200;let dE=null;const iM=e=>e?`${uA}:${e.toLowerCase()}`:uA;function cA(){try{const e=localStorage.getItem(iM(dE));if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(r=>typeof r=="string"):[]}catch{return[]}}function lA(e){try{localStorage.setItem(iM(dE),JSON.stringify(e))}catch{}}const Yg=Is((e,t)=>({followed:cA(),isFollowing:r=>t().followed.includes(r.toLowerCase()),follow:r=>{const n=r.toLowerCase();if(!n||t().followed.includes(n))return;const i=[n,...t().followed].slice(0,y4);lA(i),e({followed:i}),ci("Shop Followed Creator",{creator_address:n,following_count:i.length})},unfollow:r=>{const n=r.toLowerCase();if(!t().followed.includes(n))return;const i=t().followed.filter(a=>a!==n);lA(i),e({followed:i}),ci("Shop Unfollowed Creator",{creator_address:n,following_count:i.length})},toggle:r=>t().isFollowing(r)?t().unfollow(r):t().follow(r),reloadFor:r=>{dE=r?r.toLowerCase():null,e({followed:cA()})}})),ny="shop:signing_in",Rs=Is(e=>({session:null,connecting:!1,error:null,signIn:()=>{try{sessionStorage.setItem(ny,"1")}catch{}x3()},disconnect:async()=>{ci("Shop Signed Out");try{await X3()}catch(t){nA(t,{flow:"wallet",step:"disconnect"})}r4(),Dl.getState().reloadFor(null),Yg.getState().reloadFor(null),e({session:null})},restore:async()=>{let t;try{t=await K3()}catch(n){nA(n,{flow:"wallet",step:"restore"});return}if(!t)return;e({session:t}),Dl.getState().reloadFor(t.address),Yg.getState().reloadFor(t.address),t4(t.address,{sign_in_method:tA(t.providerType)});let r=!1;try{r=sessionStorage.getItem(ny)==="1",r&&sessionStorage.removeItem(ny)}catch{}r&&ci("Shop Signed In",{method:tA(t.providerType),is_new_user:i4(t.address)})}})),g4=Nt.peerUrl;function fE(e){return Ll({queryKey:["profile",e],enabled:!!e,staleTime:5*6e4,queryFn:async()=>{var n;const t=await fetch(`${g4}/lambdas/profiles/${e.toLowerCase()}`);if(!t.ok)return;const r=await t.json();return(n=r==null?void 0:r.avatars)==null?void 0:n[0]}})}var Dn={},iy={},dA;function aM(){return dA||(dA=1,Object.defineProperty(iy,"__esModule",{value:!0})),iy}var jn={},pn={},La={},Ki={},fA={},Js,pA;function an(){if(pA)return Js;pA=1;var e=function(t){return t&&t.Math===Math&&t};return Js=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof sg=="object"&&sg)||e(typeof Js=="object"&&Js)||(function(){return this})()||Function("return this")(),Js}var ay,mA;function Ra(){return mA||(mA=1,ay=function(e){try{return!!e()}catch{return!0}}),ay}var sy,hA;function sd(){if(hA)return sy;hA=1;var e=Ra();return sy=!e(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),sy}var oy,yA;function _4(){if(yA)return oy;yA=1;var e=sd(),t=Function.prototype,r=t.apply,n=t.call;return oy=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(r):function(){return n.apply(r,arguments)}),oy}var uy,gA;function ws(){if(gA)return uy;gA=1;var e=sd(),t=Function.prototype,r=t.call,n=e&&t.bind.bind(r,r);return uy=e?n:function(i){return function(){return r.apply(i,arguments)}},uy}var cy,_A;function sM(){if(_A)return cy;_A=1;var e=ws(),t=e({}.toString),r=e("".slice);return cy=function(n){return r(t(n),8,-1)},cy}var ly,EA;function oM(){if(EA)return ly;EA=1;var e=sM(),t=ws();return ly=function(r){if(e(r)==="Function")return t(r)},ly}var dy,vA;function wa(){if(vA)return dy;vA=1;var e=typeof document=="object"&&document.all;return dy=typeof e>"u"&&e!==void 0?function(t){return typeof t=="function"||t===e}:function(t){return typeof t=="function"},dy}var fy={},py,bA;function nu(){if(bA)return py;bA=1;var e=Ra();return py=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),py}var my,TA;function pE(){if(TA)return my;TA=1;var e=sd(),t=Function.prototype.call;return my=e?t.bind(t):function(){return t.apply(t,arguments)},my}var hy={},SA;function E4(){if(SA)return hy;SA=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,r=t&&!e.call({1:2},1);return hy.f=r?function(i){var a=t(this,i);return!!a&&a.enumerable}:e,hy}var yy,IA;function uM(){return IA||(IA=1,yy=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}),yy}var gy,RA;function v4(){if(RA)return gy;RA=1;var e=ws(),t=Ra(),r=sM(),n=Object,i=e("".split);return gy=t(function(){return!n("z").propertyIsEnumerable(0)})?function(a){return r(a)==="String"?i(a,""):n(a)}:n,gy}var _y,wA;function cM(){return wA||(wA=1,_y=function(e){return e==null}),_y}var Ey,AA;function lM(){if(AA)return Ey;AA=1;var e=cM(),t=TypeError;return Ey=function(r){if(e(r))throw new t("Can't call method on "+r);return r},Ey}var vy,OA;function b4(){if(OA)return vy;OA=1;var e=v4(),t=lM();return vy=function(r){return e(t(r))},vy}var by,NA;function od(){if(NA)return by;NA=1;var e=wa();return by=function(t){return typeof t=="object"?t!==null:e(t)},by}var Ty,PA;function dM(){return PA||(PA=1,Ty={}),Ty}var Sy,CA;function T4(){if(CA)return Sy;CA=1;var e=dM(),t=an(),r=wa(),n=function(i){return r(i)?i:void 0};return Sy=function(i,a){return arguments.length<2?n(e[i])||n(t[i]):e[i]&&e[i][a]||t[i]&&t[i][a]},Sy}var Iy,MA;function S4(){if(MA)return Iy;MA=1;var e=ws();return Iy=e({}.isPrototypeOf),Iy}var Ry,DA;function I4(){if(DA)return Ry;DA=1;var e=an(),t=e.navigator,r=t&&t.userAgent;return Ry=r?String(r):"",Ry}var wy,jA;function R4(){if(jA)return wy;jA=1;var e=an(),t=I4(),r=e.process,n=e.Deno,i=r&&r.versions||n&&n.version,a=i&&i.v8,s,o;return a&&(s=a.split("."),o=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!o&&t&&(s=t.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=t.match(/Chrome\/(\d+)/),s&&(o=+s[1]))),wy=o,wy}var Ay,LA;function fM(){if(LA)return Ay;LA=1;var e=R4(),t=Ra(),r=an(),n=r.String;return Ay=!!Object.getOwnPropertySymbols&&!t(function(){var i=Symbol("symbol detection");return!n(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Ay}var Oy,$A;function pM(){if($A)return Oy;$A=1;var e=fM();return Oy=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Oy}var Ny,qA;function mM(){if(qA)return Ny;qA=1;var e=T4(),t=wa(),r=S4(),n=pM(),i=Object;return Ny=n?function(a){return typeof a=="symbol"}:function(a){var s=e("Symbol");return t(s)&&r(s.prototype,i(a))},Ny}var Py,BA;function w4(){if(BA)return Py;BA=1;var e=String;return Py=function(t){try{return e(t)}catch{return"Object"}},Py}var Cy,kA;function hM(){if(kA)return Cy;kA=1;var e=wa(),t=w4(),r=TypeError;return Cy=function(n){if(e(n))return n;throw new r(t(n)+" is not a function")},Cy}var My,UA;function A4(){if(UA)return My;UA=1;var e=hM(),t=cM();return My=function(r,n){var i=r[n];return t(i)?void 0:e(i)},My}var Dy,FA;function O4(){if(FA)return Dy;FA=1;var e=pE(),t=wa(),r=od(),n=TypeError;return Dy=function(i,a){var s,o;if(a==="string"&&t(s=i.toString)&&!r(o=e(s,i))||t(s=i.valueOf)&&!r(o=e(s,i))||a!=="string"&&t(s=i.toString)&&!r(o=e(s,i)))return o;throw new n("Can't convert object to primitive value")},Dy}var jy={exports:{}},Ly,HA;function N4(){return HA||(HA=1,Ly=!0),Ly}var $y,VA;function P4(){if(VA)return $y;VA=1;var e=an(),t=Object.defineProperty;return $y=function(r,n){try{t(e,r,{value:n,configurable:!0,writable:!0})}catch{e[r]=n}return n},$y}var GA;function C4(){if(GA)return jy.exports;GA=1;var e=N4(),t=an(),r=P4(),n="__core-js_shared__",i=jy.exports=t[n]||r(n,{});return(i.versions||(i.versions=[])).push({version:"3.49.0",mode:e?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"}),jy.exports}var qy,zA;function M4(){if(zA)return qy;zA=1;var e=C4();return qy=function(t,r){return e[t]||(e[t]=r||{})},qy}var By,WA;function D4(){if(WA)return By;WA=1;var e=lM(),t=Object;return By=function(r){return t(e(r))},By}var ky,YA;function mE(){if(YA)return ky;YA=1;var e=ws(),t=D4(),r=e({}.hasOwnProperty);return ky=Object.hasOwn||function(i,a){return r(t(i),a)},ky}var Uy,xA;function j4(){if(xA)return Uy;xA=1;var e=ws(),t=0,r=Math.random(),n=e(1.1.toString);return Uy=function(i){return"Symbol("+(i===void 0?"":i)+")_"+n(++t+r,36)},Uy}var Fy,KA;function L4(){if(KA)return Fy;KA=1;var e=an(),t=M4(),r=mE(),n=j4(),i=fM(),a=pM(),s=e.Symbol,o=t("wks"),u=a?s.for||s:s&&s.withoutSetter||n;return Fy=function(l){return r(o,l)||(o[l]=i&&r(s,l)?s[l]:u("Symbol."+l)),o[l]},Fy}var Hy,XA;function $4(){if(XA)return Hy;XA=1;var e=pE(),t=od(),r=mM(),n=A4(),i=O4(),a=L4(),s=TypeError,o=a("toPrimitive");return Hy=function(u,l){if(!t(u)||r(u))return u;var c=n(u,o),d;if(c){if(l===void 0&&(l="default"),d=e(c,u,l),!t(d)||r(d))return d;throw new s("Can't convert object to primitive value")}return l===void 0&&(l="number"),i(u,l)},Hy}var Vy,JA;function yM(){if(JA)return Vy;JA=1;var e=$4(),t=mM();return Vy=function(r){var n=e(r,"string");return t(n)?n:n+""},Vy}var Gy,QA;function q4(){if(QA)return Gy;QA=1;var e=an(),t=od(),r=e.document,n=t(r)&&t(r.createElement);return Gy=function(i){return n?r.createElement(i):{}},Gy}var zy,ZA;function gM(){if(ZA)return zy;ZA=1;var e=nu(),t=Ra(),r=q4();return zy=!e&&!t(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),zy}var eO;function B4(){if(eO)return fy;eO=1;var e=nu(),t=pE(),r=E4(),n=uM(),i=b4(),a=yM(),s=mE(),o=gM(),u=Object.getOwnPropertyDescriptor;return fy.f=e?u:function(c,d){if(c=i(c),d=a(d),o)try{return u(c,d)}catch{}if(s(c,d))return n(!t(r.f,c,d),c[d])},fy}var Wy,tO;function k4(){if(tO)return Wy;tO=1;var e=Ra(),t=wa(),r=/#|\.prototype\./,n=function(u,l){var c=a[i(u)];return c===o?!0:c===s?!1:t(l)?e(l):!!l},i=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},a=n.data={},s=n.NATIVE="N",o=n.POLYFILL="P";return Wy=n,Wy}var Yy,rO;function U4(){if(rO)return Yy;rO=1;var e=oM(),t=hM(),r=sd(),n=e(e.bind);return Yy=function(i,a){return t(i),a===void 0?i:r?n(i,a):function(){return i.apply(a,arguments)}},Yy}var xy={},Ky,nO;function F4(){if(nO)return Ky;nO=1;var e=nu(),t=Ra();return Ky=e&&t(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ky}var Xy,iO;function H4(){if(iO)return Xy;iO=1;var e=od(),t=String,r=TypeError;return Xy=function(n){if(e(n))return n;throw new r(t(n)+" is not an object")},Xy}var aO;function V4(){if(aO)return xy;aO=1;var e=nu(),t=gM(),r=F4(),n=H4(),i=yM(),a=TypeError,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return xy.f=e?r?function(p,f,_){if(n(p),f=i(f),n(_),typeof p=="function"&&f==="prototype"&&"value"in _&&c in _&&!_[c]){var R=o(p,f);R&&R[c]&&(p[f]=_.value,_={configurable:l in _?_[l]:R[l],enumerable:u in _?_[u]:R[u],writable:!1})}return s(p,f,_)}:s:function(p,f,_){if(n(p),f=i(f),n(_),t)try{return s(p,f,_)}catch{}if("get"in _||"set"in _)throw new a("Accessors not supported");return"value"in _&&(p[f]=_.value),p},xy}var Jy,sO;function G4(){if(sO)return Jy;sO=1;var e=nu(),t=V4(),r=uM();return Jy=e?function(n,i,a){return t.f(n,i,r(1,a))}:function(n,i,a){return n[i]=a,n},Jy}var Qy,oO;function z4(){if(oO)return Qy;oO=1;var e=an(),t=_4(),r=oM(),n=wa(),i=B4().f,a=k4(),s=dM(),o=U4(),u=G4(),l=mE(),c=function(d){var p=function(f,_,R){if(this instanceof p){switch(arguments.length){case 0:return new d;case 1:return new d(f);case 2:return new d(f,_)}return new d(f,_,R)}return t(d,this,arguments)};return p.prototype=d.prototype,p};return Qy=function(d,p){var f=d.target,_=d.global,R=d.stat,w=d.proto,O=_?e:R?e[f]:e[f]&&e[f].prototype,h=_?s:s[f]||u(s,f,{})[f],T=h.prototype,b,m,v,A,P,q,z,Y,W;for(A in p)b=a(_?A:f+(R?".":"#")+A,d.forced),m=!b&&O&&l(O,A),q=h[A],m&&(d.dontCallGetSet?(W=i(O,A),z=W&&W.value):z=O[A]),P=m&&z?z:p[A],!(!b&&!w&&typeof q==typeof P)&&(d.bind&&m?Y=o(P,e):d.wrap&&m?Y=c(P):w&&n(P)?Y=r(P):Y=P,(d.sham||P&&P.sham||q&&q.sham)&&u(Y,"sham",!0),u(h,A,Y),w&&(v=f+"Prototype",l(s,v)||u(s,v,{}),u(s[v],A,P),d.real&&T&&(b||!T[A])&&u(T,A,P)))},Qy}var uO;function W4(){if(uO)return fA;uO=1;var e=z4(),t=an();return e({global:!0,forced:t.globalThis!==t},{globalThis:t}),fA}var Zy,cO;function Y4(){return cO||(cO=1,W4(),Zy=an()),Zy}var eg,lO;function x4(){if(lO)return eg;lO=1;var e=Y4();return eg=e,eg}var dO;function _M(){if(dO)return Ki;dO=1;var e=Ki&&Ki.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.getImplementation=void 0;var t=e(x4());function r(n,i){var a,s=(a=n[i])!==null&&a!==void 0?a:t.default[i];if(!s)throw new ReferenceError('"'+i+'" is not defined');return s}return Ki.getImplementation=r,Ki}var fO;function EM(){if(fO)return La;fO=1;var e=La&&La.__values||function(o){var u=typeof Symbol=="function"&&Symbol.iterator,l=u&&o[u],c=0;if(l)return l.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&c>=o.length&&(o=void 0),{value:o&&o[c++],done:!o}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(La,"__esModule",{value:!0});var t=JC(),r=_M(),n="x-identity-auth-chain-",i="x-identity-timestamp",a="x-identity-metadata";function s(o){o===void 0&&(o={});var u=(0,r.getImplementation)(o,"Headers");return function(c,d,p,f,_){var R,w,O=new u(_),h=String(Date.now()),T=JSON.stringify(f),b=[d,p,h,T].join(":").toLowerCase(),m=0,v=t.Authenticator.signPayload(c,b);try{for(var A=e(v),P=A.next();!P.done;P=A.next()){var q=P.value;O.set(n+m,JSON.stringify(q)),m++}}catch(z){R={error:z}}finally{try{P&&!P.done&&(w=A.return)&&w.call(A)}finally{if(R)throw R.error}}return O.set(i,h),O.set(a,T),O}}return La.default=s,La}var pO;function vM(){if(pO)return pn;pO=1;var e=pn&&pn.__assign||function(){return e=Object.assign||function(s){for(var o,u=1,l=arguments.length;u<l;u++){o=arguments[u];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(s[c]=o[c])}return s},e.apply(this,arguments)},t=pn&&pn.__rest||function(s,o){var u={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&o.indexOf(l)<0&&(u[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,l=Object.getOwnPropertySymbols(s);c<l.length;c++)o.indexOf(l[c])<0&&Object.prototype.propertyIsEnumerable.call(s,l[c])&&(u[l[c]]=s[l[c]]);return u},r=pn&&pn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(pn,"__esModule",{value:!0});var n=r(EM()),i=_M();function a(s){s===void 0&&(s={});var o=(0,n.default)(s),u=(0,i.getImplementation)(s,"URL"),l=(0,i.getImplementation)(s,"Request"),c=(0,i.getImplementation)(s,"fetch");return function(p,f){if(f&&f.identity){var _=f.identity,R=f.metadata,w=t(f,["identity","metadata"]);if(typeof p=="string"||p instanceof u||globalThis.URL&&p instanceof globalThis.URL){var O=typeof p=="string"?new u(p):p,h=new l(O.toString(),e(e({},w),{headers:o(_,f.method||"GET",O.pathname,R||{},w==null?void 0:w.headers)}));return c(h)}var T=new u(p.url),b=new l(p),m=o(_,p.method||"GET",T.pathname,R||{});return m.forEach(function(v,A){b.headers.set(A,v)}),c(b)}return c(p,f)}}return pn.default=a,pn}var mO;function K4(){return mO||(mO=1,(function(e){var t=jn&&jn.__createBinding||(Object.create?(function(s,o,u,l){l===void 0&&(l=u),Object.defineProperty(s,l,{enumerable:!0,get:function(){return o[u]}})}):(function(s,o,u,l){l===void 0&&(l=u),s[l]=o[u]})),r=jn&&jn.__exportStar||function(s,o){for(var u in s)u!=="default"&&!Object.prototype.hasOwnProperty.call(o,u)&&t(o,s,u)},n=jn&&jn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.signedHeaderFactory=e.signedFetchFactory=void 0,r(aM(),e);var i=vM();Object.defineProperty(e,"signedFetchFactory",{enumerable:!0,get:function(){return n(i).default}});var a=EM();Object.defineProperty(e,"signedHeaderFactory",{enumerable:!0,get:function(){return n(a).default}})})(jn)),jn}var hO;function X4(){return hO||(hO=1,(function(e){var t=Dn&&Dn.__createBinding||(Object.create?(function(a,s,o,u){u===void 0&&(u=o),Object.defineProperty(a,u,{enumerable:!0,get:function(){return s[o]}})}):(function(a,s,o,u){u===void 0&&(u=o),a[u]=s[o]})),r=Dn&&Dn.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,a,o)},n=Dn&&Dn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),r(aM(),e),r(K4(),e);var i=n(vM());e.default=(0,i.default)()})(Dn)),Dn}var J4=X4();const ud=WO(J4);async function Q4(e,t){const r=`${Nt.creditsServerUrl}/users/${e.toLowerCase()}/credits`,n=await ud(r,{method:"GET",identity:t,metadata:{}});if(!n.ok)throw new Error(`getUserCredits ${n.status}: ${await n.text()}`);return n.json()}async function Z4(e,t){const{usd:r}=await Q4(e,t);return r??{balanceCents:0,credits:0}}async function m6(e,t,r){const n=`${Nt.creditsServerUrl}/credits/authorize`,i=await ud(n,{method:"POST",identity:e,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({usdPriceCents:t,tradeId:r})});if(!i.ok)throw new Error(`authorizeUsdCredit ${i.status}: ${await i.text()}`);return i.json()}async function h6(e,t,r){const n=new URLSearchParams;n.set("status","all"),n.set("limit",String(r.first)),(r==null?void 0:r.skip)!=null&&n.set("offset",String(r.skip));const i=n.toString(),a=`${Nt.creditsServerUrl}/users/${e.toLowerCase()}/purchases${i?`?${i}`:""}`,s=await ud(a,{method:"GET",identity:t,metadata:{}});if(!s.ok)throw new Error(`fetchUserPurchases ${s.status}: ${await s.text()}`);const o=await s.json(),u=o.purchases??[],l=(r==null?void 0:r.skip)??0,c=r==null?void 0:r.first,d=typeof o.total=="number"?o.total:l+u.length+(u.length>=c?1:0);return{items:u,total:d}}async function y6(e,t){if(t.length===0)return 0;const r=`${Nt.creditsServerUrl}/credits/authorize/cancel`,n=await ud(r,{method:"POST",identity:e,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({salts:t})});if(!n.ok)throw new Error(`cancelUsdIntents ${n.status}: ${await n.text()}`);return(await n.json()).released??0}async function g6(e,t=1e3){const r=await fetch(`${Nt.creditsServerUrl}/dev/mint-usd`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:e.toLowerCase(),usdCents:t})});if(!r.ok)throw new Error(`devMintUsd ${r.status}: ${await r.text()}`);return r.json()}function ez(e){return Ll({queryKey:["usd-balance",e==null?void 0:e.address],enabled:!!e,staleTime:3e4,queryFn:async()=>Z4(e.address,e.identity)})}const tz=e=>qo(e.reduce((t,r)=>t+r.priceCredits,0)),Kr=Is((e,t)=>({items:[],open:!1,fittingOpen:!1,add:(r,n="grid")=>{const i=t().items.some(s=>s.id===r.id);if(e(s=>i?{open:!0}:{items:[...s.items,r],open:!0}),i)return;const a=t().items;ci("Shop Added To Cart",{item_id:r.itemId??null,contract_address:r.contractAddress,price_credits:r.priceCredits,price_usd:qo(r.priceCredits),is_primary:!r.tokenId,source:n,cart_size:a.length,cart_value_usd:tz(a)})},remove:r=>{const n=t().items.find(i=>i.id===r);e(i=>({items:i.items.filter(a=>a.id!==r)})),n&&ci("Shop Removed From Cart",{item_id:n.itemId??null,cart_size:t().items.length})},clear:()=>e({items:[]}),setOpen:r=>e({open:r}),setFittingOpen:r=>e(r?{fittingOpen:r,open:!1}:{fittingOpen:r})})),ds={name:"credits",nameSingular:"credit",symbol:"◈",iconClass:"ico-credits"};function _6(e){return`${e} ${e===1?ds.nameSingular:ds.name}`}function Un({className:e}){return J.jsx("span",{className:`ico ${ds.iconClass}${e?` ${e}`:""}`,"aria-hidden":!0})}function rz(){const e=Kr(s=>s.items),t=Kr(s=>s.open),r=Kr(s=>s.setOpen),n=Kr(s=>s.setFittingOpen),i=Me.useRef(null),a=e.reduce((s,o)=>s+o.priceCredits,0);return Me.useEffect(()=>{if(!t)return;const s=setTimeout(()=>r(!1),4500),o=u=>{i.current&&!i.current.contains(u.target)&&r(!1)};return document.addEventListener("mousedown",o),()=>{clearTimeout(s),document.removeEventListener("mousedown",o)}},[t,e.length,r]),!t||e.length===0?null:J.jsxs("div",{className:"cart-pop",ref:i,role:"dialog","aria-label":"Cart",children:[J.jsxs("div",{className:"cart-pop__head",children:[J.jsx("span",{className:"ico ico-cart","aria-hidden":!0})," Added to cart"]}),J.jsx("div",{className:"cart-pop__list",children:e.slice(-4).map(s=>J.jsxs("div",{className:"cart-pop__row",children:[J.jsx("div",{className:"cart-pop__thumb",children:s.thumbnail?J.jsx("img",{src:s.thumbnail,alt:s.name}):null}),J.jsx("div",{className:"cart-pop__name",title:s.name,children:s.name}),J.jsxs("div",{className:"cart-pop__price",children:[J.jsx(Un,{className:"ccy-mark"})," ",s.priceCredits]})]},s.id))}),J.jsxs("div",{className:"cart-pop__foot",children:[J.jsxs("span",{className:"cart-pop__total",children:[e.length," item",e.length>1?"s":""," · ",J.jsxs("strong",{children:[J.jsx(Un,{className:"ccy-mark"})," ",a]})]}),J.jsxs("div",{className:"cart-pop__actions",children:[J.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>n(!0),children:"Try on"}),J.jsx(Oo,{className:"btn btn--purple btn--sm",to:"/cart",onClick:()=>r(!1),children:"Checkout"})]})]})]})}var xg=function(e,t){return xg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},xg(e,t)};function Mr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xg(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var qe=function(){return qe=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},qe.apply(this,arguments)};function As(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function bM(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(a=(i<3?s(a):i>3?s(t,r,a):s(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function TM(e,t){return function(r,n){t(r,n,e)}}function SM(e,t,r,n,i,a){function s(O){if(O!==void 0&&typeof O!="function")throw new TypeError("Function expected");return O}for(var o=n.kind,u=o==="getter"?"get":o==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,p=!1,f=r.length-1;f>=0;f--){var _={};for(var R in n)_[R]=R==="access"?{}:n[R];for(var R in n.access)_.access[R]=n.access[R];_.addInitializer=function(O){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(O||null))};var w=(0,r[f])(o==="accessor"?{get:c.get,set:c.set}:c[u],_);if(o==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(d=s(w.get))&&(c.get=d),(d=s(w.set))&&(c.set=d),(d=s(w.init))&&i.unshift(d)}else(d=s(w))&&(o==="field"?i.unshift(d):c[u]=d)}l&&Object.defineProperty(l,n.name,c),p=!0}function IM(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function RM(e){return typeof e=="symbol"?e:"".concat(e)}function wM(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function AM(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function OM(e,t,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(d){s(d)}}function u(c){try{l(n.throw(c))}catch(d){s(d)}}function l(c){c.done?a(c.value):i(c.value).then(o,u)}l((n=n.apply(e,t||[])).next())})}function NM(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var cd=Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]});function PM(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&cd(t,e,r)}function jl(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hE(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function CM(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hE(arguments[t]));return e}function MM(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n}function er(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function fs(e){return this instanceof fs?(this.v=e,this):new fs(e)}function DM(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(f){return function(_){return Promise.resolve(_).then(f,d)}}function o(f,_){n[f]&&(i[f]=function(R){return new Promise(function(w,O){a.push([f,R,w,O])>1||u(f,R)})},_&&(i[f]=_(i[f])))}function u(f,_){try{l(n[f](_))}catch(R){p(a[0][3],R)}}function l(f){f.value instanceof fs?Promise.resolve(f.value.v).then(c,d):p(a[0][2],f)}function c(f){u("next",f)}function d(f){u("throw",f)}function p(f,_){f(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function jM(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,a){t[i]=e[i]?function(s){return(r=!r)?{value:fs(e[i](s)),done:!1}:a?a(s):s}:a}}function LM(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof jl=="function"?jl(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(s){return new Promise(function(o,u){s=e[a](s),i(o,u,s.done,s.value)})}}function i(a,s,o,u){Promise.resolve(u).then(function(l){a({value:l,done:o})},s)}}function $M(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var nz=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Kg=function(e){return Kg=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Kg(e)};function qM(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Kg(e),n=0;n<r.length;n++)r[n]!=="default"&&cd(t,e,r[n]);return nz(t,e),t}function BM(e){return e&&e.__esModule?e:{default:e}}function kM(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function UM(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function FM(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function HM(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var iz=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function VM(e){function t(a){e.error=e.hasError?new iz(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var r,n=0;function i(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(i,function(s){return t(s),i()})}else n|=1}catch(s){t(s)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return i()}function GM(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,a,s){return n?t?".jsx":".js":i&&(!a||!s)?r:i+a+"."+s.toLowerCase()+"js"}):e}const az={__extends:Mr,__assign:qe,__rest:As,__decorate:bM,__param:TM,__esDecorate:SM,__runInitializers:IM,__propKey:RM,__setFunctionName:wM,__metadata:AM,__awaiter:OM,__generator:NM,__createBinding:cd,__exportStar:PM,__values:jl,__read:hE,__spread:CM,__spreadArrays:MM,__spreadArray:er,__await:fs,__asyncGenerator:DM,__asyncDelegator:jM,__asyncValues:LM,__makeTemplateObject:$M,__importStar:qM,__importDefault:BM,__classPrivateFieldGet:kM,__classPrivateFieldSet:UM,__classPrivateFieldIn:FM,__addDisposableResource:HM,__disposeResources:VM,__rewriteRelativeImportExtension:GM},E6=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:HM,get __assign(){return qe},__asyncDelegator:jM,__asyncGenerator:DM,__asyncValues:LM,__await:fs,__awaiter:OM,__classPrivateFieldGet:kM,__classPrivateFieldIn:FM,__classPrivateFieldSet:UM,__createBinding:cd,__decorate:bM,__disposeResources:VM,__esDecorate:SM,__exportStar:PM,__extends:Mr,__generator:NM,__importDefault:BM,__importStar:qM,__makeTemplateObject:$M,__metadata:AM,__param:TM,__propKey:RM,__read:hE,__rest:As,__rewriteRelativeImportExtension:GM,__runInitializers:IM,__setFunctionName:wM,__spread:CM,__spreadArray:er,__spreadArrays:MM,__values:jl,default:az},Symbol.toStringTag,{value:"Module"}));function hr(e,t){var r=t&&t.cache?t.cache:dz,n=t&&t.serializer?t.serializer:lz,i=t&&t.strategy?t.strategy:uz;return i(e,{cache:r,serializer:n})}function sz(e){return e==null||typeof e=="number"||typeof e=="boolean"}function oz(e,t,r,n){var i=sz(n)?n:r(n),a=t.get(i);return typeof a>"u"&&(a=e.call(this,n),t.set(i,a)),a}function zM(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),a=t.get(i);return typeof a>"u"&&(a=e.apply(this,n),t.set(i,a)),a}function WM(e,t,r,n,i){return r.bind(t,e,n,i)}function uz(e,t){var r=e.length===1?oz:zM;return WM(e,this,r,t.cache.create(),t.serializer)}function cz(e,t){return WM(e,this,zM,t.cache.create(),t.serializer)}var lz=function(){return JSON.stringify(arguments)};function yE(){this.cache=Object.create(null)}yE.prototype.get=function(e){return this.cache[e]};yE.prototype.set=function(e,t){this.cache[e]=t};var dz={create:function(){return new yE}},yr={variadic:cz};function YM(e,t,r){if(r===void 0&&(r=Error),!e)throw new r(t)}hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.Locale).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});hr(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.ListFormat).bind.apply(e,er([void 0],t,!1)))},{strategy:yr.variadic});var at;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(at||(at={}));var Dt;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(Dt||(Dt={}));var ps;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(ps||(ps={}));function yO(e){return e.type===Dt.literal}function fz(e){return e.type===Dt.argument}function xM(e){return e.type===Dt.number}function KM(e){return e.type===Dt.date}function XM(e){return e.type===Dt.time}function JM(e){return e.type===Dt.select}function QM(e){return e.type===Dt.plural}function pz(e){return e.type===Dt.pound}function ZM(e){return e.type===Dt.tag}function eD(e){return!!(e&&typeof e=="object"&&e.type===ps.number)}function Xg(e){return!!(e&&typeof e=="object"&&e.type===ps.dateTime)}var tD=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,mz=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function hz(e){var t={};return e.replace(mz,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"long":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var yz=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function gz(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(yz).filter(function(p){return p.length>0}),r=[],n=0,i=t;n<i.length;n++){var a=i[n],s=a.split("/");if(s.length===0)throw new Error("Invalid number skeleton");for(var o=s[0],u=s.slice(1),l=0,c=u;l<c.length;l++){var d=c[l];if(d.length===0)throw new Error("Invalid number skeleton")}r.push({stem:o,options:u})}return r}function _z(e){return e.replace(/^(.*?)-/,"")}var gO=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,rD=/^(@+)?(\+|#+)?[rs]?$/g,Ez=/(\*)(0+)|(#+)(0+)|(0+)/g,nD=/^(0+)$/;function _O(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(rD,function(r,n,i){return typeof i!="string"?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):i==="+"?t.minimumSignificantDigits=n.length:n[0]==="#"?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof i=="string"?i.length:0)),""}),t}function iD(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function vz(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if(r==="+!"?(t.signDisplay="always",e=e.slice(2)):r==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!nD.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function EO(e){var t={},r=iD(e);return r||t}function bz(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=_z(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=qe(qe(qe({},t),{notation:"scientific"}),i.options.reduce(function(u,l){return qe(qe({},u),EO(l))},{}));continue;case"engineering":t=qe(qe(qe({},t),{notation:"engineering"}),i.options.reduce(function(u,l){return qe(qe({},u),EO(l))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Ez,function(u,l,c,d,p,f){if(l)t.minimumIntegerDigits=c.length;else{if(d&&p)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(nD.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(gO.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(gO,function(u,l,c,d,p,f){return c==="*"?t.minimumFractionDigits=l.length:d&&d[0]==="#"?t.maximumFractionDigits=d.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var a=i.options[0];a==="w"?t=qe(qe({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=qe(qe({},t),_O(a)));continue}if(rD.test(i.stem)){t=qe(qe({},t),_O(i.stem));continue}var s=iD(i.stem);s&&(t=qe(qe({},t),s));var o=vz(i.stem);o&&(t=qe(qe({},t),o))}return t}var ml={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Tz(e,t){for(var r="",n=0;n<e.length;n++){var i=e.charAt(n);if(i==="j"){for(var a=0;n+1<e.length&&e.charAt(n+1)===i;)a++,n++;var s=1+(a&1),o=a<2?1:3+(a>>1),u="a",l=Sz(t);for((l=="H"||l=="k")&&(o=0);o-- >0;)r+=u;for(;s-- >0;)r=l+r}else i==="J"?r+="H":r+=i}return r}function Sz(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var i=ml[n||""]||ml[r||""]||ml["".concat(r,"-001")]||ml["001"];return i[0]}var tg,Iz=new RegExp("^".concat(tD.source,"*")),Rz=new RegExp("".concat(tD.source,"*$"));function ct(e,t){return{start:e,end:t}}var wz=!!String.prototype.startsWith&&"_a".startsWith("a",1),Az=!!String.fromCodePoint,Oz=!!Object.fromEntries,Nz=!!String.prototype.codePointAt,Pz=!!String.prototype.trimStart,Cz=!!String.prototype.trimEnd,Mz=!!Number.isSafeInteger,Dz=Mz?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Jg=!0;try{var jz=sD("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Jg=((tg=jz.exec("a"))===null||tg===void 0?void 0:tg[0])==="a"}catch{Jg=!1}var vO=wz?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Qg=Az?String.fromCodePoint:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n="",i=t.length,a=0,s;i>a;){if(s=t[a++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},bO=Oz?Object.fromEntries:function(t){for(var r={},n=0,i=t;n<i.length;n++){var a=i[n],s=a[0],o=a[1];r[s]=o}return r},aD=Nz?function(t,r){return t.codePointAt(r)}:function(t,r){var n=t.length;if(!(r<0||r>=n)){var i=t.charCodeAt(r),a;return i<55296||i>56319||r+1===n||(a=t.charCodeAt(r+1))<56320||a>57343?i:(i-55296<<10)+(a-56320)+65536}},Lz=Pz?function(t){return t.trimStart()}:function(t){return t.replace(Iz,"")},$z=Cz?function(t){return t.trimEnd()}:function(t){return t.replace(Rz,"")};function sD(e,t){return new RegExp(e,t)}var Zg;if(Jg){var TO=sD("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Zg=function(t,r){var n;TO.lastIndex=r;var i=TO.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else Zg=function(t,r){for(var n=[];;){var i=aD(t,r);if(i===void 0||oD(i)||Uz(i))break;n.push(i),r+=i>=65536?2:1}return Qg.apply(void 0,n)};var qz=(function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var a=this.char();if(a===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(a===125&&t>0)break;if(a===35&&(r==="plural"||r==="selectordinal")){var o=this.clonePosition();this.bump(),i.push({type:Dt.pound,location:ct(o,this.clonePosition())})}else if(a===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(at.UNMATCHED_CLOSING_TAG,ct(this.clonePosition(),this.clonePosition()))}else if(a===60&&!this.ignoreTag&&e_(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Dt.literal,value:"<".concat(i,"/>"),location:ct(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,r,!0);if(a.err)return a;var s=a.val,o=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!e_(this.char()))return this.error(at.INVALID_TAG,ct(o,this.clonePosition()));var u=this.clonePosition(),l=this.parseTagName();return i!==l?this.error(at.UNMATCHED_CLOSING_TAG,ct(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Dt.tag,value:i,children:s,location:ct(n,this.clonePosition())},err:null}:this.error(at.INVALID_TAG,ct(o,this.clonePosition())))}else return this.error(at.UNCLOSED_TAG,ct(n,this.clonePosition()))}else return this.error(at.INVALID_TAG,ct(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&kz(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var a=this.tryParseQuote(r);if(a){i+=a;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){i+=o;continue}break}var u=ct(n,this.clonePosition());return{val:{type:Dt.literal,value:i,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Bz(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Qg.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Qg(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(at.EMPTY_ARGUMENT,ct(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(at.MALFORMED_ARGUMENT,ct(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Dt.argument,value:i,location:ct(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(at.MALFORMED_ARGUMENT,ct(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Zg(this.message,r),i=r+n.length;this.bumpTo(i);var a=this.clonePosition(),s=ct(t,a);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var a,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(o){case"":return this.error(at.EXPECT_ARGUMENT_TYPE,ct(s,u));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition(),d=this.parseSimpleArgStyleIfPossible();if(d.err)return d;var p=$z(d.val);if(p.length===0)return this.error(at.EXPECT_ARGUMENT_STYLE,ct(this.clonePosition(),this.clonePosition()));var f=ct(c,this.clonePosition());l={style:p,styleLocation:f}}var _=this.tryParseArgumentClose(i);if(_.err)return _;var R=ct(i,this.clonePosition());if(l&&vO(l==null?void 0:l.style,"::",0)){var w=Lz(l.style.slice(2));if(o==="number"){var d=this.parseNumberSkeletonFromString(w,l.styleLocation);return d.err?d:{val:{type:Dt.number,value:n,location:R,style:d.val},err:null}}else{if(w.length===0)return this.error(at.EXPECT_DATE_TIME_SKELETON,R);var O=w;this.locale&&(O=Tz(w,this.locale));var p={type:ps.dateTime,pattern:O,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?hz(O):{}},h=o==="date"?Dt.date:Dt.time;return{val:{type:h,value:n,location:R,style:p},err:null}}}return{val:{type:o==="number"?Dt.number:o==="date"?Dt.date:Dt.time,value:n,location:R,style:(a=l==null?void 0:l.style)!==null&&a!==void 0?a:null},err:null}}case"plural":case"selectordinal":case"select":{var T=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(at.EXPECT_SELECT_ARGUMENT_OPTIONS,ct(T,qe({},T)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),m=0;if(o!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(at.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ct(this.clonePosition(),this.clonePosition()));this.bumpSpace();var d=this.tryParseDecimalInteger(at.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,at.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(d.err)return d;this.bumpSpace(),b=this.parseIdentifierIfPossible(),m=d.val}var v=this.tryParsePluralOrSelectOptions(t,o,r,b);if(v.err)return v;var _=this.tryParseArgumentClose(i);if(_.err)return _;var A=ct(i,this.clonePosition());return o==="select"?{val:{type:Dt.select,value:n,options:bO(v.val),location:A},err:null}:{val:{type:Dt.plural,value:n,options:bO(v.val),offset:m,pluralType:o==="plural"?"cardinal":"ordinal",location:A},err:null}}default:return this.error(at.INVALID_ARGUMENT_TYPE,ct(s,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(at.EXPECT_ARGUMENT_CLOSING_BRACE,ct(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(at.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,ct(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=gz(t)}catch{return this.error(at.INVALID_NUMBER_SKELETON,r)}return{val:{type:ps.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?bz(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var a,s=!1,o=[],u=new Set,l=i.value,c=i.location;;){if(l.length===0){var d=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var p=this.tryParseDecimalInteger(at.EXPECT_PLURAL_ARGUMENT_SELECTOR,at.INVALID_PLURAL_ARGUMENT_SELECTOR);if(p.err)return p;c=ct(d,this.clonePosition()),l=this.message.slice(d.offset,this.offset())}else break}if(u.has(l))return this.error(r==="select"?at.DUPLICATE_SELECT_ARGUMENT_SELECTOR:at.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);l==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?at.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:at.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,ct(this.clonePosition(),this.clonePosition()));var _=this.parseMessage(t+1,r,n);if(_.err)return _;var R=this.tryParseArgumentClose(f);if(R.err)return R;o.push([l,{value:_.val,location:ct(f,this.clonePosition())}]),u.add(l),this.bumpSpace(),a=this.parseIdentifierIfPossible(),l=a.value,c=a.location}return o.length===0?this.error(r==="select"?at.EXPECT_SELECT_ARGUMENT_SELECTOR:at.EXPECT_PLURAL_ARGUMENT_SELECTOR,ct(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(at.MISSING_OTHER_CLAUSE,ct(this.clonePosition(),this.clonePosition())):{val:o,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var a=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)a=!0,s=s*10+(o-48),this.bump();else break}var u=ct(i,this.clonePosition());return a?(s*=n,Dz(s)?{val:s,err:null}:this.error(r,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=aD(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(vO(this.message,t,this.offset())){for(var r=0;r<t.length;r++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var r=this.offset(),n=this.message.indexOf(t,r);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&oD(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e})();function e_(e){return e>=97&&e<=122||e>=65&&e<=90}function Bz(e){return e_(e)||e===47}function kz(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function oD(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Uz(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function t_(e){e.forEach(function(t){if(delete t.location,JM(t)||QM(t))for(var r in t.options)delete t.options[r].location,t_(t.options[r].value);else xM(t)&&eD(t.style)||(KM(t)||XM(t))&&Xg(t.style)?delete t.style.location:ZM(t)&&t_(t.children)})}function Fz(e,t){t===void 0&&(t={}),t=qe({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new qz(e,t).parse();if(r.err){var n=SyntaxError(at[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t!=null&&t.captureLocation||t_(r.val),r.val}var Tn;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Tn||(Tn={}));var di=(function(e){Mr(t,e);function t(r,n,i){var a=e.call(this,r)||this;return a.code=n,a.originalMessage=i,a}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error),SO=(function(e){Mr(t,e);function t(r,n,i,a){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Tn.INVALID_VALUE,a)||this}return t})(di),Hz=(function(e){Mr(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Tn.INVALID_VALUE,i)||this}return t})(di),Vz=(function(e){Mr(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Tn.MISSING_VALUE,n)||this}return t})(di),mr;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(mr||(mr={}));function Gz(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==mr.literal||r.type!==mr.literal?t.push(r):n.value+=r.value,t},[])}function uD(e){return typeof e=="function"}function bl(e,t,r,n,i,a,s){if(e.length===1&&yO(e[0]))return[{type:mr.literal,value:e[0].value}];for(var o=[],u=0,l=e;u<l.length;u++){var c=l[u];if(yO(c)){o.push({type:mr.literal,value:c.value});continue}if(pz(c)){typeof a=="number"&&o.push({type:mr.literal,value:r.getNumberFormat(t).format(a)});continue}var d=c.value;if(!(i&&d in i))throw new Vz(d,s);var p=i[d];if(fz(c)){(!p||typeof p=="string"||typeof p=="number")&&(p=typeof p=="string"||typeof p=="number"?String(p):""),o.push({type:typeof p=="string"?mr.literal:mr.object,value:p});continue}if(KM(c)){var f=typeof c.style=="string"?n.date[c.style]:Xg(c.style)?c.style.parsedOptions:void 0;o.push({type:mr.literal,value:r.getDateTimeFormat(t,f).format(p)});continue}if(XM(c)){var f=typeof c.style=="string"?n.time[c.style]:Xg(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:mr.literal,value:r.getDateTimeFormat(t,f).format(p)});continue}if(xM(c)){var f=typeof c.style=="string"?n.number[c.style]:eD(c.style)?c.style.parsedOptions:void 0;f&&f.scale&&(p=p*(f.scale||1)),o.push({type:mr.literal,value:r.getNumberFormat(t,f).format(p)});continue}if(ZM(c)){var _=c.children,R=c.value,w=i[R];if(!uD(w))throw new Hz(R,"function",s);var O=bl(_,t,r,n,i,a),h=w(O.map(function(m){return m.value}));Array.isArray(h)||(h=[h]),o.push.apply(o,h.map(function(m){return{type:typeof m=="string"?mr.literal:mr.object,value:m}}))}if(JM(c)){var T=c.options[p]||c.options.other;if(!T)throw new SO(c.value,p,Object.keys(c.options),s);o.push.apply(o,bl(T.value,t,r,n,i));continue}if(QM(c)){var T=c.options["=".concat(p)];if(!T){if(!Intl.PluralRules)throw new di(`Intl.PluralRules is not available in this environment.
|
|
75
75
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
76
76
|
`,Tn.MISSING_INTL_API,s);var b=r.getPluralRules(t,{type:c.pluralType}).select(p-(c.offset||0));T=c.options[b]||c.options.other}if(!T)throw new SO(c.value,p,Object.keys(c.options),s);o.push.apply(o,bl(T.value,t,r,n,i,p-(c.offset||0)));continue}}return Gz(o)}function zz(e,t){return t?qe(qe(qe({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=qe(qe({},e[n]),t[n]||{}),r},{})):e}function Wz(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=zz(e[n],t[n]),r},qe({},e)):e}function rg(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Yz(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:hr(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.NumberFormat).bind.apply(t,er([void 0],r,!1)))},{cache:rg(e.number),strategy:yr.variadic}),getDateTimeFormat:hr(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.DateTimeFormat).bind.apply(t,er([void 0],r,!1)))},{cache:rg(e.dateTime),strategy:yr.variadic}),getPluralRules:hr(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.PluralRules).bind.apply(t,er([void 0],r,!1)))},{cache:rg(e.pluralRules),strategy:yr.variadic})}}var cD=(function(){function e(t,r,n,i){r===void 0&&(r=e.defaultLocale);var a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var l=a.formatToParts(u);if(l.length===1)return l[0].value;var c=l.reduce(function(d,p){return!d.length||p.type!==mr.literal||typeof d[d.length-1]!="string"?d.push(p.value):d[d.length-1]+=p.value,d},[]);return c.length<=1?c[0]||"":c},this.formatToParts=function(u){return bl(a.ast,a.locales,a.formatters,a.formats,u,void 0,a.message)},this.resolvedOptions=function(){var u;return{locale:((u=a.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=r,this.resolvedLocale=e.resolveLocale(r),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=i||{};s.formatters;var o=As(s,["formatters"]);this.ast=e.__parse(t,qe(qe({},o),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Wz(e.formats,n),this.formatters=i&&i.formatters||Yz(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Fz,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})(),ma;(function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"})(ma||(ma={}));var iu=(function(e){Mr(t,e);function t(r,n,i){var a=this,s=i?i instanceof Error?i:new Error(String(i)):void 0;return a=e.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,`
|
|
77
77
|
`).concat(s?`
|
|
@@ -92,4 +92,4 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
92
92
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
93
93
|
`,Tn.MISSING_INTL_API));try{return p8(e,t,i).format(r,n)}catch(s){e.onError(new qr("Error formatting relative time.",e.locale,s))}return String(r)}var h8=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function mD(e,t,r){var n=e.locale,i=e.formats,a=e.onError;r===void 0&&(r={});var s=r.format,o=s&&gE(i,"number",s,a)||{},u=Aa(r,h8,o);return t(n,u)}function y8(e,t,r,n){n===void 0&&(n={});try{return mD(e,t,n).format(r)}catch(i){e.onError(new qr("Error formatting number.",e.locale,i))}return String(r)}function g8(e,t,r,n){n===void 0&&(n={});try{return mD(e,t,n).formatToParts(r)}catch(i){e.onError(new qr("Error formatting number.",e.locale,i))}return[]}function _8(e){var t=e?e[Object.keys(e)[0]]:void 0;return typeof t=="string"}function E8(e){e.onWarn&&e.defaultRichTextElements&&_8(e.messages||{})&&e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
94
94
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
95
|
-
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function v8(e,t){var r=Zz(t),n=qe(qe({},lD),e),i=n.locale,a=n.defaultLocale,s=n.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&s?s(new IO('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&s&&s(new IO('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(s&&s(new Kz('"locale" was not configured, using "'.concat(a,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),E8(n),qe(qe({},n),{formatters:r,formatNumber:y8.bind(null,n,r.getNumberFormat),formatNumberToParts:g8.bind(null,n,r.getNumberFormat),formatRelativeTime:m8.bind(null,n,r.getRelativeTimeFormat),formatDate:e8.bind(null,n,r.getDateTimeFormat),formatDateToParts:n8.bind(null,n,r.getDateTimeFormat),formatTime:t8.bind(null,n,r.getDateTimeFormat),formatDateTimeRange:r8.bind(null,n,r.getDateTimeFormat),formatTimeToParts:i8.bind(null,n,r.getDateTimeFormat),formatPlural:d8.bind(null,n,r.getPluralRules),formatMessage:r_.bind(null,n,r),$t:r_.bind(null,n,r),formatList:c8.bind(null,n,r.getListFormat),formatListToParts:pD.bind(null,n,r.getListFormat),formatDisplayName:s8.bind(null,n,r.getDisplayNames)})}function b8(e){YM(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var T8=qe(qe({},lD),{textComponent:De.Fragment});function S8(e){return function(t){return e(De.Children.toArray(t))}}var _E=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=De.createContext(null)):De.createContext(null);_E.Consumer;var I8=_E.Provider,R8=I8,w8=_E;function hD(){var e=De.useContext(w8);return b8(e),e}var n_;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(n_||(n_={}));var i_;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(i_||(i_={}));function yD(e){var t=function(r){var n=hD(),i=r.value,a=r.children,s=As(r,["value","children"]),o=typeof i=="string"?new Date(i||0):i,u=e==="formatDate"?n.formatDateToParts(o,s):n.formatTimeToParts(o,s);return a(u)};return t.displayName=i_[e],t}function au(e){var t=function(r){var n=hD(),i=r.value,a=r.children,s=As(r,["value","children"]),o=n[e](i,s);if(typeof a=="function")return a(o);var u=n.textComponent||De.Fragment;return De.createElement(u,null,o)};return t.displayName=n_[e],t}function gD(e){return e&&Object.keys(e).reduce(function(t,r){var n=e[r];return t[r]=uD(n)?S8(n):n,t},{})}var OO=function(e,t,r,n){for(var i=[],a=4;a<arguments.length;a++)i[a-4]=arguments[a];var s=gD(n),o=r_.apply(void 0,er([e,t,r,s],i,!1));return Array.isArray(o)?De.Children.toArray(o):o},A8=function(e,t){var r=e.defaultRichTextElements,n=As(e,["defaultRichTextElements"]),i=gD(r),a=v8(qe(qe(qe({},T8),n),{defaultRichTextElements:i}),t),s={locale:a.locale,timeZone:a.timeZone,fallbackOnEmptyString:a.fallbackOnEmptyString,formats:a.formats,defaultLocale:a.defaultLocale,defaultFormats:a.defaultFormats,messages:a.messages,onError:a.onError,defaultRichTextElements:i};return qe(qe({},a),{formatMessage:OO.bind(null,s,a.formatters),$t:OO.bind(null,s,a.formatters)})};au("formatDate");au("formatTime");au("formatNumber");au("formatList");au("formatDisplayName");yD("formatDate");yD("formatTime");const O8={overview:"Overview",collectibles:"Collectibles",market:"Market",myAssets:"My Assets",myFavorites:"My Favorites",myPurchases:"My Purchases",searchPlaceholder:"Search items, creators, collections…",searchAria:"Search the shop",yourBalance:"Your {currency}",getCredits:"Get {currency}",cart:"Cart"},N8={title:"Page not found",body:"The page you’re looking for isn’t here. Let’s get you back to the shop.",cta:"Browse Collectibles"},P8={empty:{title:"Your cart is empty",body:"Find something you love and it’ll show up here.",cta:"Browse Collectibles"}},C8={nav:O8,notFound:N8,cart:P8},M8={overview:"Inicio",collectibles:"Coleccionables",market:"Mercado",myAssets:"Mis artículos",myFavorites:"Mis favoritos",myPurchases:"Mis compras",searchPlaceholder:"Buscá artículos, creadores, colecciones…",searchAria:"Buscar en la tienda",yourBalance:"Tus {currency}",getCredits:"Conseguir {currency}",cart:"Carrito"},D8={title:"Página no encontrada",body:"La página que buscás no está acá. Volvamos a la tienda.",cta:"Ver coleccionables"},j8={empty:{title:"Tu carrito está vacío",body:"Encontrá algo que te guste y va a aparecer acá.",cta:"Ver coleccionables"}},L8={nav:M8,notFound:D8,cart:j8},Tl=["en","es"];function a_(e,t="",r={}){for(const[n,i]of Object.entries(e)){const a=t?`${t}.${n}`:n;i&&typeof i=="object"&&!Array.isArray(i)?a_(i,a,r):r[a]=String(i)}return r}const $8={en:a_(C8),es:a_(L8)},q8=dD(),ig={};function EE(e){return ig[e]||(ig[e]=A8({locale:e,defaultLocale:"en",messages:$8[e],onError:()=>{}},q8)),ig[e]}let _D=EE("en");function B8(e){_D=EE(e)}function Yr(e,t){return _D.formatMessage({id:e},t)}function k8(){const{session:e,connecting:t,signIn:r,disconnect:n,restore:i}=Rs(),a=e==null?void 0:e.address,{data:s,isLoading:o}=fE(a),{data:u}=ez(e),l=Kr(w=>w.items.length),c=c_(),[d,p]=De.useState(""),f=De.useRef();De.useEffect(()=>{i()},[i]);function _(w){c(w.trim()?`/assets?q=${encodeURIComponent(w.trim())}`:"/assets",{replace:!0})}function R(w){p(w),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>_(w),300)}return J.jsxs(J.Fragment,{children:[J.jsx(lU,{activePage:"shop",isSignedIn:!!e,isSigningIn:t,isLoadingProfile:!!e&&o,address:a,avatar:s,onClickSignIn:()=>r(),onClickSignOut:()=>void n()}),J.jsxs("div",{className:"subnav",children:[J.jsxs("nav",{className:"subnav__tabs",children:[J.jsx(xn,{to:"/overview",children:Yr("nav.overview")}),J.jsx(xn,{to:"/assets",children:Yr("nav.collectibles")}),J.jsx(xn,{to:"/market",children:Yr("nav.market")}),J.jsx(xn,{to:"/my-assets",children:Yr("nav.myAssets")}),J.jsx(xn,{to:"/my-favorites",children:Yr("nav.myFavorites")}),e?J.jsx(xn,{to:"/my-purchases",children:Yr("nav.myPurchases")}):null]}),J.jsxs("div",{className:"subnav__search",children:[J.jsx("span",{className:"ico ico-search subnav__search-ico","aria-hidden":!0}),J.jsx("input",{value:d,"aria-label":Yr("nav.searchAria"),placeholder:Yr("nav.searchPlaceholder"),onChange:w=>R(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(f.current&&clearTimeout(f.current),_(d))}})]}),e?J.jsxs("span",{className:"subnav__balance",title:Yr("nav.yourBalance",{currency:ds.name}),children:[J.jsx(Un,{className:"subnav__balance-ico"}),(u==null?void 0:u.credits)??0]}):null,J.jsxs(xn,{to:"/credits",className:"subnav__credits",children:[J.jsx(Un,{className:"subnav__credits-ico"}),Yr("nav.getCredits",{currency:ds.name})]}),J.jsxs("div",{className:"subnav__cart-wrap",children:[J.jsxs(xn,{to:"/cart",className:"subnav__cart","aria-label":Yr("nav.cart"),children:[J.jsx("span",{className:"ico ico-cart","aria-hidden":!0}),l>0?J.jsx("span",{className:"subnav__cart-badge",children:l}):null]}),J.jsx(rz,{})]})]})]})}let U8=0;const Ao=Is(e=>({toasts:[],push:t=>{const r=++U8;return e(n=>({toasts:[...n.toasts,{...t,id:r}]})),r},dismiss:t=>e(r=>({toasts:r.toasts.filter(n=>n.id!==t)}))})),_6={success:e=>Ao.getState().push({message:e,kind:"success"}),error:e=>Ao.getState().push({message:e,kind:"error"}),info:e=>Ao.getState().push({message:e,kind:"info"})},F8={success:"✓",error:"!",info:"i"};function H8({t:e}){const t=Ao(r=>r.dismiss);return De.useEffect(()=>{const r=setTimeout(()=>t(e.id),4500);return()=>clearTimeout(r)},[e.id,t]),J.jsxs("div",{className:`toast toast--${e.kind}`,role:e.kind==="error"?"alert":"status",onClick:()=>t(e.id),children:[J.jsx("span",{className:"toast__icon","aria-hidden":!0,children:F8[e.kind]}),J.jsx("span",{className:"toast__msg",children:e.message})]})}function V8(){const e=Ao(t=>t.toasts);return e.length===0?null:J.jsx("div",{className:"toaster","aria-live":"polite",children:e.map(t=>J.jsx(H8,{t},t.id))})}const G8=De.lazy(()=>Gt(()=>import("./index-DBgz21lR.js"),__vite__mapDeps([9,1,10,5,11,4,12,13,7,3,14])).then(e=>({default:e.WearablePreview})));function vE(e){return J.jsx(De.Suspense,{fallback:null,children:J.jsx(G8,{...e})})}function z8(e){return e.itemId?`urn:decentraland:${Nt.chainId===80002?"amoy":"matic"}:collections-v2:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}const Ga=Jr.BodyShape.MALE,za=Jr.BodyShape.FEMALE;function s_(e){if(e.category==="emote")return[Ga,za];switch(e.gender){case"male":return[Ga];case"female":return[za];default:return[Ga,za]}}function W8(e){var r;const t=(r=e==null?void 0:e.avatar)==null?void 0:r.bodyShape;return t?t.includes("BaseFemale")?za:Ga:null}function bE(e,t){return t==null||s_(e).includes(t)}function NO(e){return e===za?"Female":"Male"}function Y8(e){let t=0,r=0;for(const n of e)n.category!=="emote"&&(n.gender==="male"?t++:n.gender==="female"&&r++);return t===0&&r===0?null:r>t?za:Ga}function ua(e){return e.category!=="emote"}function ms(e){return ua(e)?e.wearableCategory??`unknown:${e.id}`:null}const x8=new Set(["hat","helmet","mask","tiara","top_head","hair","facial_hair","eyewear","earring","eyes","eyebrows","mouth"]);function K8(e){if(!ua(e))return"item";const t=e.wearableCategory;return t?x8.has(t)?"head":t==="upper_body"?"upper":t==="lower_body"?"lower":t==="feet"?"feet":t==="hands"||t==="hands_wear"?"hands":"item":"item"}function PO(e,t=null){const r=new Set,n=new Set;for(const i of e){const a=ms(i);a==null||n.has(a)||bE(i,t)&&(n.add(a),r.add(i.id))}return r}function X8(e,t,r){if(!ua(t))return e;const n=new Set(e);if(n.has(t.id))return n.delete(t.id),n;const i=ms(t);if(i!=null)for(const a of r)a.id!==t.id&&n.has(a.id)&&ms(a)===i&&n.delete(a.id);return n.add(t.id),n}function J8(e){const t=new Map;for(const n of e){const i=ms(n);if(i==null)continue;const a=t.get(i)??[];a.push(n.id),t.set(i,a)}const r=new Set;for(const n of t.values())n.length>1&&n.forEach(i=>r.add(i));return r}function Q8(e,t,r=null){const n=[];for(const i of e){if(!t.has(i.id)||!ua(i)||!bE(i,r))continue;const a=z8(i);a&&n.push(a)}return n}const Z8=De.lazy(()=>Gt(()=>import("./AnimatedBackground-CYPw0X0a.js"),__vite__mapDeps([15,1,16])));function CO(e){return!e||e.startsWith("unknown:")?"Wearable":e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g," ")}function eW(){const e=Kr(m=>m.fittingOpen),t=Kr(m=>m.setFittingOpen),r=Kr(m=>m.items),n=Kr(m=>m.remove),i=c_(),a=Rs(m=>{var v;return(v=m.session)==null?void 0:v.address}),{data:s,isFetched:o}=fE(a),u=!a||o,l=!!a&&!!s,c=l?a:"default",d=W8(s)??Y8(r)??Ga,[p,f]=De.useState(()=>PO(r,d)),[_,R]=De.useState(!1);De.useEffect(()=>{e&&f(PO(r,d))},[e,d]),De.useEffect(()=>{const m=new Set(r.map(v=>v.id));f(v=>{const A=new Set([...v].filter(P=>m.has(P)));return A.size===v.size?v:A})},[r]);const w=De.useMemo(()=>J8(r),[r]),O=De.useMemo(()=>Q8(r,p,d),[r,p,d]),h=r.reduce((m,v)=>m+v.priceCredits,0),T=O.join(",");De.useEffect(()=>{R(!1)},[T,c]);const b=De.useRef(!1);return De.useEffect(()=>{if(!e){b.current=!1;return}b.current||(b.current=!0,ci("Shop Tried On Outfit",{cart_size:r.length,wearables:r.filter(ua).length,emotes:r.filter(m=>!ua(m)).length,cart_value_credits:h}))},[e,r,h]),De.useEffect(()=>{if(!e)return;const m=v=>{v.key==="Escape"&&t(!1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),!e||r.length===0?null:J.jsxs("div",{className:"fitting",role:"dialog","aria-modal":"true","aria-label":"Fitting room",children:[J.jsx("div",{className:"fitting__scrim",onClick:()=>t(!1)}),J.jsxs("div",{className:"fitting__panel",children:[J.jsx("button",{className:"fitting__close",onClick:()=>t(!1),"aria-label":"Close",children:"×"}),J.jsxs("div",{className:"fitting__stage",children:[J.jsx(De.Suspense,{fallback:null,children:J.jsx(Z8,{})}),u?O.length>0?J.jsxs(J.Fragment,{children:[J.jsx(vE,{profile:c,bodyShape:l?void 0:d,urns:O,type:Jr.PreviewType.AVATAR,emote:Jr.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:Nt.chainId===80002,onLoad:()=>R(!0)},c),_?null:J.jsx("div",{className:"fitting__loading","aria-hidden":!0,children:J.jsx("span",{className:"fitting__spinner"})})]}):J.jsxs("div",{className:"fitting__empty-stage",children:[J.jsx("p",{children:"Nothing on right now."}),J.jsx("p",{className:"muted",children:"Turn on an item from the list to try it."})]}):J.jsx("div",{className:"fitting__loading","aria-hidden":!0,children:J.jsx("span",{className:"fitting__spinner"})})]}),J.jsxs("div",{className:"fitting__side",children:[J.jsxs("div",{className:"fitting__head",children:[J.jsx("h2",{className:"fitting__title",children:"Fitting room"}),J.jsx("p",{className:"fitting__sub muted",children:"Mix and match your cart. Turn items on and off to see the look."})]}),J.jsx("div",{className:"fitting__items",children:r.map(m=>{const v=ua(m),A=v&&!bE(m,d),P=p.has(m.id),q=w.has(m.id);return J.jsxs("div",{className:`fitting-row${P?" is-on":""}${A?" is-incompatible":""}`,children:[J.jsxs("label",{className:"fitting-row__toggle",children:[J.jsx("input",{type:"checkbox",checked:P,disabled:!v||A,onChange:()=>f(z=>X8(z,m,r))}),J.jsx("span",{className:"fitting-row__box","aria-hidden":!0})]}),J.jsx("div",{className:"fitting-row__thumb",children:m.thumbnail?J.jsx("img",{src:m.thumbnail,alt:m.name}):null}),J.jsxs("div",{className:"fitting-row__info",children:[J.jsx("div",{className:"fitting-row__name",title:m.name,children:m.name}),J.jsxs("div",{className:"fitting-row__meta",children:[J.jsx("span",{className:`ico ico-slot-${v?K8(m):"item"} fitting-row__slot-ico`,title:v?CO(ms(m)):"Emote",role:"img","aria-label":v?CO(ms(m)):"Emote"}),q&&!A?J.jsx("span",{className:"fitting-row__conflict",title:"Only one item per slot can be worn",children:"1 per slot"}):null,A?J.jsxs("span",{className:"fitting-row__incompat",title:`This item is made for the ${NO(s_(m)[0])} body shape`,children:[NO(s_(m)[0])," only"]}):null]})]}),J.jsxs("div",{className:"fitting-row__price",children:[J.jsx(Un,{className:"fitting-row__diamond"}),m.priceCredits]}),J.jsx("button",{className:"fitting-row__remove",onClick:()=>n(m.id),"aria-label":`Remove ${m.name} from cart`,title:"Remove",children:J.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},m.id)})}),J.jsxs("div",{className:"fitting__foot",children:[J.jsxs("div",{className:"fitting__total",children:[r.length," item",r.length>1?"s":""," · ",J.jsxs("strong",{children:[ds.symbol," ",h]})]}),J.jsx("button",{className:"btn btn--purple fitting__checkout",onClick:()=>{t(!1),i("/cart")},children:"Checkout"})]})]})]})]})}const ED="shop:locale";function tW(){var e;try{const t=new URLSearchParams(window.location.search).get("lang");if(t&&Tl.includes(t))return t;const r=localStorage.getItem(ED);if(r&&Tl.includes(r))return r;const n=(e=navigator.language)==null?void 0:e.slice(0,2);if(n&&Tl.includes(n))return n}catch{}return"en"}const o_=Is(e=>({locale:tW(),setLocale:t=>{try{localStorage.setItem(ED,t)}catch{}e({locale:t})}})),rW=De.lazy(()=>Gt(()=>import("./ShopFooterInner-DZ0k_kvA.js"),__vite__mapDeps([17,1,5,6,14,11,4,3,7])));function nW(){const e=o_(r=>r.locale),t=o_(r=>r.setLocale);return J.jsx("div",{className:"shop-footer",children:J.jsx(De.Suspense,{fallback:null,children:J.jsx(rW,{locale:e,onChange:r=>{Tl.includes(r)&&t(r)}})})})}function iW(){const[e,t]=De.useState(!1);return De.useEffect(()=>{if(typeof window.requestIdleCallback=="function"){const n=window.requestIdleCallback(()=>t(!0),{timeout:3e3});return()=>window.cancelIdleCallback(n)}const r=window.setTimeout(()=>t(!0),1500);return()=>window.clearTimeout(r)},[]),e?J.jsx("div",{"aria-hidden":!0,style:{position:"fixed",left:-9999,top:-9999,width:2,height:2,opacity:0,overflow:"hidden",pointerEvents:"none"},children:J.jsx(vE,{id:"preview-warmer",profile:"default",dev:Nt.chainId===80002,disableBackground:!0,disableFadeEffect:!0})}):null}function aW(){const e=Rs(t=>t.session);De.useEffect(()=>{if(!e||e.providerType!==Jr.ProviderType.INJECTED)return;const t=e.web3Provider.provider;if(!(t!=null&&t.on)||!t.removeListener)return;const r=e.address.toLowerCase(),n=(...i)=>{var o;((o=(i[0]??[])[0])==null?void 0:o.toLowerCase())!==r&&window.location.reload()};return t.on("accountsChanged",n),()=>{var i;return(i=t.removeListener)==null?void 0:i.call(t,"accountsChanged",n)}},[e])}const TE=`${Nt.nftApiUrl}/v1`;function vD(e){if(!e)return 0;try{return Math.ceil(Number(xO(e))*10)}catch{return 0}}function E6(e){if(!e)return 0;try{const t=BigInt(e),r=10n**16n;return Number((t+r-1n)/r)}catch{return 0}}async function v6(e,t){var n,i,a;const r=new URLSearchParams({contractAddresses:e,itemId:t,first:"1"});try{const s=await fetch(`${Nt.nftApiUrl}/v2/catalog?${r.toString()}`);if(!s.ok)return"";const{data:o}=await s.json(),u=(n=o==null?void 0:o[0])==null?void 0:n.data;return(((i=u==null?void 0:u.wearable)==null?void 0:i.description)??((a=u==null?void 0:u.emote)==null?void 0:a.description)??"").trim()}catch{return""}}async function b6(e){const{listings:t}=await dd({contractAddress:e,first:200}),r={};for(const n of t)n.listingType!=="primary"||n.itemId==null||(r[String(n.itemId)]={isOnSale:!0,priceCredits:n.priceCredits,tradeId:n.tradeId});return r}async function sW(e,t){var a;const r=new URLSearchParams({contractAddress:e,tokenId:t,first:"1"}),n=await fetch(`${TE}/nfts?${r.toString()}`);if(!n.ok)return null;const{data:i}=await n.json();return((a=i==null?void 0:i[0])==null?void 0:a.nft)??null}function bD(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,tokenId:e.tokenId??void 0,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:e.priceCredits,gender:null,compareAtCredits:e.compareAtCredits!=null&&e.compareAtCredits>e.priceCredits?e.compareAtCredits:void 0,saleEndsAt:e.saleEndsAt!=null?e.saleEndsAt*1e3:void 0}}async function dd(e){var i,a;const t=new URLSearchParams;(e.category==="wearable"||e.category==="emote")&&t.set("category",e.category),e.first!=null&&t.set("first",String(e.first)),e.skip!=null&&t.set("skip",String(e.skip)),e.contractAddress&&t.set("contractAddress",e.contractAddress),e.itemId!=null&&t.set("itemId",e.itemId),(i=e.rarities)!=null&&i.length&&t.set("rarity",e.rarities.join(",")),(a=e.wearableCategories)!=null&&a.length&&t.set("wearableCategory",e.wearableCategories.join(",")),e.minPriceCredits!=null&&t.set("minPriceCredits",String(e.minPriceCredits)),e.maxPriceCredits!=null&&t.set("maxPriceCredits",String(e.maxPriceCredits)),e.search&&t.set("search",e.search),e.sortBy&&t.set("sortBy",e.sortBy);const r=await fetch(`${Nt.marketplaceServerUrl}/v3/catalog/shop?${t.toString()}`);if(!r.ok)throw new Error(`fetchShopListings ${r.status}`);const n=await r.json();return{listings:n.data??[],total:n.total??0}}async function T6(e,t){const{listings:r}=await dd({contractAddress:e,itemId:t,first:1});return r[0]?bD(r[0]):null}async function oW({first:e=100,...t}={}){const{listings:r,total:n}=await dd({...t,first:e});return{items:r.map(bD),total:n}}function uW(e){return{tradeId:e.tradeId,listingType:"primary",contractAddress:e.contractAddress,itemId:e.itemId??"",name:e.name??"",thumbnail:e.thumbnail??"",rarity:e.rarity??"common",category:e.category??"wearable",wearableCategory:e.wearableCategory??null,creator:e.creator??"",manaWei:e.manaWei,available:e.available??0,network:e.network??"MATIC",chainId:e.chainId??Nt.chainId,createdAt:e.createdAt??0}}async function S6({first:e=100,...t}={}){var s,o;const r=new URLSearchParams;(t.category==="wearable"||t.category==="emote")&&r.set("category",t.category),r.set("first",String(e)),t.skip!=null&&r.set("skip",String(t.skip)),(s=t.rarities)!=null&&s.length&&r.set("rarity",t.rarities.join(",")),(o=t.wearableCategories)!=null&&o.length&&r.set("wearableCategory",t.wearableCategories.join(",")),t.search&&r.set("search",t.search),t.sortBy&&r.set("sortBy",t.sortBy);const n=await fetch(`${Nt.marketplaceServerUrl}/v3/catalog/legacy?${r.toString()}`);if(!n.ok)throw new Error(`fetchLegacyListings ${n.status}`);const i=await n.json(),a=i.data??[];return{items:a.map(uW),total:i.total??a.length}}async function I6(e,{category:t="wearable",first:r=48,skip:n=0}={}){const i=new URLSearchParams({owner:e.toLowerCase(),category:t,first:String(r),skip:String(n),sortBy:"newest",orderDirection:"desc"}),a=await fetch(`${TE}/nfts?${i.toString()}`);if(!a.ok)throw new Error(`Failed to fetch assets (${a.status})`);const{data:s,total:o}=await a.json();return{assets:s.map(l=>{var c,d,p,f,_;return{id:l.nft.id,contractAddress:l.nft.contractAddress,tokenId:l.nft.tokenId,itemId:l.nft.itemId??null,name:l.nft.name,category:l.nft.category,image:l.nft.image,rarity:((d=(c=l.nft.data)==null?void 0:c.wearable)==null?void 0:d.rarity)??((f=(p=l.nft.data)==null?void 0:p.emote)==null?void 0:f.rarity),network:l.nft.network,chainId:l.nft.chainId,isOnSale:l.order!=null,listingPrice:l.order?vD(l.order.price):void 0,tradeId:(_=l.order)==null?void 0:_.tradeId}}),total:o}}const cW="dcl:marketplace";async function R6(e,t){const{TradeService:r}=await Gt(async()=>{const{TradeService:i}=await import("./TradeService-CFsfszzf.js");return{TradeService:i}},__vite__mapDeps([18,7,1,19,2,8]));return new r(cW,Nt.marketplaceServerUrl,()=>t).addTrade(e)}async function TD(e){const t=await fetch(`${Nt.marketplaceServerUrl}/v1/trades/${e}`);if(!t.ok)throw new Error(`fetchTrade ${t.status}`);const r=await t.json();return r.data??r}async function lW(e,t){const r=new URLSearchParams({contractAddress:e,itemId:t,first:"1"}),n=await fetch(`${TE}/items?${r.toString()}`);if(!n.ok)return null;const{data:i}=await n.json();return(i==null?void 0:i[0])??null}async function w6(e){var u,l;let t;try{t=await TD(e)}catch{return null}const r=(u=t.sent)==null?void 0:u[0],n=(l=t.received)==null?void 0:l[0],i=vD(n==null?void 0:n.amount),a=(r==null?void 0:r.contractAddress)??"",s=(r==null?void 0:r.value)??"";if(!a)return{name:"Item",thumbnail:"",credits:i,contractAddress:""};if((r==null?void 0:r.assetType)===Jr.TradeAssetType.COLLECTION_ITEM){const c=await lW(a,s);return{name:(c==null?void 0:c.name)??"Item",thumbnail:(c==null?void 0:c.thumbnail)??"",credits:i,contractAddress:a,itemId:s}}const o=await sW(a,s);return{name:(o==null?void 0:o.name)??`#${s}`,thumbnail:(o==null?void 0:o.image)??"",credits:i,contractAddress:a,tokenId:s}}async function A6(e,t){var i;const{listings:r}=await dd({contractAddress:e,itemId:t,first:1}),n=(i=r[0])==null?void 0:i.tradeId;return n?TD(n):null}function dW(e,t){return!t||!e.creator?!1:lE(e)&&e.creator.toLowerCase()===t.toLowerCase()}function O6(e,t){return!!e.signer&&!!t&&e.signer.toLowerCase()===t.toLowerCase()}function fW(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?`${e.slice(0,6)}…${e.slice(-4)}`:e}function pW({address:e,className:t,linkToProfile:r}){var u,l;const n=c_(),{data:i}=fE(e);if(!e)return null;const a=(i==null?void 0:i.name)||fW(e),s=(l=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:l.face256,o=J.jsxs(J.Fragment,{children:[s?J.jsx("img",{className:"creator__ava",src:s,alt:"",loading:"lazy"}):J.jsx("span",{className:"creator__ava creator__ava--ph","aria-hidden":!0}),J.jsxs("span",{className:"creator__name",children:["By ",a]})]});return r?J.jsx("button",{className:`creator creator--link${t?` ${t}`:""}`,title:`View ${a}`,onClick:c=>{c.stopPropagation(),n(`/creator/${e}`)},children:o}):J.jsx("span",{className:`creator${t?` ${t}`:""}`,children:o})}const ag="#a09ba8";function MO(e){if(!e)return ag;try{return Jr.Rarity.getColor(e.toLowerCase())||ag}catch{return ag}}function mW(e){const t=typeof e=="string"?e.replace("#",""):"";if(t.length<6)return"#161518";const r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return .299*r+.587*n+.114*i>150?"#161518":"#ffffff"}function hW(e,t=Date.now()){const{priceCredits:r,compareAtCredits:n,saleEndsAt:i}=e;return!(n==null||!(n>r)||i!=null&&i<=t)}function yW(e,t){if(!(e>0)||!(t>=0)||t>=e)return 0;const r=Math.round((1-t/e)*100);return Math.min(99,Math.max(1,r))}function Io(e,t=Date.now()){return e==null?1/0:Math.max(0,e-t)}function gW(e){if(!isFinite(e)||e<=0)return"";const t=Math.floor(e/1e3),r=Math.floor(t/86400),n=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return r>0?n>0?`${r}d ${n}h`:`${r}d`:n>0?`${n}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function DO(e){return!isFinite(e)||e<=0?0:e<36e5?1e3:6e4}function _W({endsAt:e,className:t}){const[r,n]=De.useState(()=>Io(e));De.useEffect(()=>{if(n(Io(e)),e==null)return;let a;const s=()=>{const u=Io(e);n(u);const l=DO(u);l>0&&(a=setTimeout(s,l))},o=DO(Io(e));return o>0&&(a=setTimeout(s,o)),()=>clearTimeout(a)},[e]);const i=gW(r);return i?J.jsxs("span",{className:t??"sale-countdown",children:[J.jsx("span",{className:"ico ico-clock sale-countdown__ico","aria-hidden":!0}),i]}):null}function EW(e){const[,t]=De.useState(0);return De.useEffect(()=>{const r=Io(e.saleEndsAt);if(!isFinite(r)||r<=0||r>2147483647)return;const n=setTimeout(()=>t(i=>i+1),r+1);return()=>clearTimeout(n)},[e.saleEndsAt]),hW(e)}const vW=120,bW=250;function TW(e){return e==="male"?"♂":e==="female"?"♀":e==="unisex"?"⚥":""}function SE(e){const{item:t}=e,r=e.mode==="market",[n,i]=De.useState(!1),[a,s]=De.useState(!1),o=De.useRef(),u=De.useRef(),l=Kr(z=>z.add),c=Kr(z=>z.items.some(Y=>Y.id===t.id)),d=Rs(z=>{var Y;return(Y=z.session)==null?void 0:Y.address}),p=dW(t,d),f=Dl(z=>z.toggle),_=Dl(z=>!!z.items[t.id]),R=!!t.contractAddress&&!!t.itemId,w=t.tokenId??t.itemId,O=!r&&!!t.contractAddress&&!!w,h=`/item/${t.contractAddress}/${w}`;function T(){o.current&&clearTimeout(o.current),u.current&&clearTimeout(u.current),s(!1),o.current=setTimeout(()=>i(!0),vW)}function b(){o.current&&clearTimeout(o.current),u.current&&clearTimeout(u.current),i(!1),s(!1)}function m(){u.current&&clearTimeout(u.current),u.current=setTimeout(()=>s(!0),bW)}const v=TW(t.gender),A=EW({priceCredits:t.priceCredits,compareAtCredits:t.compareAtCredits,saleEndsAt:t.saleEndsAt}),P=!r&&A,q=P?yW(t.compareAtCredits,t.priceCredits):0;return J.jsxs("article",{className:`card${n?" card--hover":""}`,style:O?{cursor:"pointer"}:void 0,onMouseEnter:T,onMouseLeave:b,children:[O?J.jsx(Oo,{className:"card__link",to:h,state:{item:t,tradeId:t.tradeId},"aria-label":t.name}):null,J.jsxs("div",{className:"card__media",children:[P?J.jsxs("span",{className:"card__sale-badge",children:["SALE",q>0?` -${q}%`:""]}):null,J.jsx("button",{className:`card__fav${_?" is-on":""}`,onClick:z=>{z.stopPropagation(),f(t)},"aria-label":_?"Remove from favorites":"Add to favorites",children:J.jsx("span",{className:"ico ico-heart","aria-hidden":!0})}),t.thumbnail?J.jsx("img",{className:`card__img${n&&a?" card__img--hidden":""}`,src:t.thumbnail,alt:t.name,loading:"lazy"}):null,n&&R?J.jsxs(J.Fragment,{children:[J.jsx("div",{className:`card__preview${a?" is-ready":""}`,children:J.jsx(vE,{contractAddress:t.contractAddress,itemId:t.itemId??void 0,profile:"default",type:t.category==="emote"?void 0:Jr.PreviewType.AVATAR,emote:t.category==="emote"?void 0:Jr.PreviewEmote.FASHION,dev:Nt.chainId===80002,disableBackground:!0,disableFadeEffect:!0,onLoad:m})}),J.jsx("span",{className:"card__preview-shield","aria-hidden":!0}),a?null:J.jsx("span",{className:"card__loadbar","aria-hidden":!0})]}):null]}),J.jsxs("div",{className:"card__body",children:[J.jsxs("div",{className:"card__desc",children:[J.jsx("div",{className:"card__name",title:t.name,children:t.name}),t.creator?J.jsx(pW,{address:t.creator,className:"card__creator",linkToProfile:!0}):J.jsx("div",{className:"card__creator",children:" "})]}),J.jsxs("div",{className:"card__meta",children:[r&&e.mode==="market"?J.jsxs("div",{className:"card__price card__price--market",children:[J.jsx("span",{className:"card__approx","aria-hidden":!0,children:"≈"}),J.jsx(Un,{className:"card__diamond"}),e.marketPriceCredits==null?"—":e.marketPriceCredits,J.jsx("span",{className:"chip card__market-chip",children:"Market price"})]}):P?J.jsxs("div",{className:"card__price card__price--sale",children:[J.jsxs("span",{className:"card__price-now",children:[J.jsx(Un,{className:"card__diamond"}),t.priceCredits]}),J.jsxs("span",{className:"card__price-was",children:[J.jsx(Un,{className:"card__diamond card__diamond--was"}),t.compareAtCredits]}),J.jsx(_W,{endsAt:t.saleEndsAt,className:"card__countdown"})]}):J.jsxs("div",{className:"card__price",children:[J.jsx(Un,{className:"card__diamond"}),t.priceCredits]}),J.jsxs("div",{className:"card__chips",children:[J.jsx("span",{className:"chip chip--rarity",style:{background:MO(t.rarity),color:mW(MO(t.rarity))},children:t.rarity}),t.category==="wearable"?J.jsx("span",{className:"chip chip--icon",children:J.jsx("span",{className:"ico ico-eyewear","aria-hidden":!0})}):null,v?J.jsx("span",{className:"chip chip--icon",children:v}):null]})]}),r&&e.mode==="market"?J.jsx("button",{className:"card__cart",onClick:z=>{z.stopPropagation(),e.onBuyNow(t)},disabled:e.marketPriceCredits==null,children:e.marketPriceCredits==null?"Unavailable":"Buy now"}):J.jsxs("button",{className:`card__cart${c?" is-in":""}`,onClick:z=>{z.stopPropagation(),p||l(t,"grid")},disabled:c||p,children:[p?null:J.jsx("span",{className:"ico ico-cart-solid card__cart-ico","aria-hidden":!0}),p?"Your item":c?"In cart":"Add to cart"]})]})]})}function SW(e){if(!e)return 0;try{return Math.ceil(Number(xO(e))*10)}catch{return 0}}function IW(e){if(!e||e.length===0)return null;const t=e.some(n=>n.includes("Male")),r=e.some(n=>n.includes("Female"));return t&&r?"unisex":t?"male":r?"female":null}function SD(e){var t,r,n,i,a,s;return{id:e.id,name:e.name,creator:e.creator??"",contractAddress:e.contractAddress,itemId:e.itemId??null,category:e.category,wearableCategory:((r=(t=e.data)==null?void 0:t.wearable)==null?void 0:r.category)??((i=(n=e.data)==null?void 0:n.emote)==null?void 0:i.category),rarity:e.rarity??"common",network:e.network,chainId:e.chainId,thumbnail:e.thumbnail??"",priceCredits:SW(e.price??e.minPrice),gender:IW((s=(a=e.data)==null?void 0:a.wearable)==null?void 0:s.bodyShapes)}}async function N6(e,{first:t=20,skip:r=0}={}){const n=new URLSearchParams({contractAddress:e,first:String(t),skip:String(r),includeSocialEmotes:"false"}),i=await fetch(`${Nt.nftApiUrl}/v1/items?${n.toString()}`);if(!i.ok)throw new Error(`fetchCollectionItems ${i.status}`);const{data:a,total:s}=await i.json(),o=(a??[]).map(SD);return{items:o,total:s??r+o.length}}async function RW(e,{first:t=60,skip:r=0}={}){const n=new URLSearchParams({creator:e,first:String(t),skip:String(r),includeSocialEmotes:"false"}),i=await fetch(`${Nt.nftApiUrl}/v1/items?${n.toString()}`);if(!i.ok)throw new Error(`fetchCreatorItems ${i.status}`);const{data:a,total:s}=await i.json(),o=(a??[]).map(SD);return{items:o,total:s??r+o.length}}const wW=8,AW=8,OW=12;function NW(){const t=Yg(i=>i.followed).slice(0,wW),{data:r=[],isLoading:n}=Ll({queryKey:["followed-creators-row",t.join(",")],enabled:t.length>0,queryFn:async()=>{const i=await Promise.all(t.map(a=>RW(a,{first:AW}).then(s=>s.items).catch(()=>[])));return PW(i).filter(a=>a.priceCredits>0).slice(0,OW)}});return t.length===0||!n&&r.length===0?null:J.jsxs("section",{className:"row",children:[J.jsx("div",{className:"row__head",children:J.jsx("h2",{className:"row__title",children:"From creators you follow"})}),J.jsx("div",{className:"row__track",children:n?Array.from({length:6}).map((i,a)=>J.jsx("div",{className:"card card--skeleton"},a)):r.map(i=>J.jsx(SE,{item:i},i.id))})]})}function PW(e){const t=[],r=new Set,n=e.reduce((i,a)=>Math.max(i,a.length),0);for(let i=0;i<n;i++)for(const a of e){const s=a[i];s&&!r.has(s.id)&&(r.add(s.id),t.push(s))}return t}const ID="shop:recently-viewed",RD=12;function wD(){try{const e=localStorage.getItem(ID);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.slice(0,RD):[]}catch{return[]}}function P6(e){if(e!=null&&e.id)try{const t=[e,...wD().filter(r=>r.id!==e.id)].slice(0,RD);localStorage.setItem(ID,JSON.stringify(t))}catch{}}function CW({excludeId:e}){const t=De.useMemo(()=>wD().filter(r=>r.id!==e),[e]);return t.length===0?null:J.jsxs("section",{className:"row",children:[J.jsx("div",{className:"row__head",children:J.jsx("h2",{className:"row__title",children:"Recently viewed"})}),J.jsx("div",{className:"row__track",children:t.map(r=>J.jsx(SE,{item:r},r.id))})]})}function jO({title:e,items:t,loading:r}){return J.jsxs("section",{className:"row",children:[J.jsxs("div",{className:"row__head",children:[J.jsx("h2",{className:"row__title",children:e}),J.jsxs(Oo,{className:"row__viewall",to:"/assets",children:["View all ",J.jsx("span",{className:"ico ico-viewall","aria-hidden":!0})]})]}),J.jsx("div",{className:"row__track",children:r?Array.from({length:6}).map((n,i)=>J.jsx("div",{className:"card card--skeleton"},i)):t.map(n=>J.jsx(SE,{item:n},n.id))})]})}function MW(){const{data:e,isLoading:t}=Ll({queryKey:["overview-listings"],queryFn:()=>oW({first:24})}),r=(e==null?void 0:e.items)??[];return J.jsxs("div",{className:"overview",children:[J.jsx("section",{className:"hero",children:J.jsxs("div",{className:"hero__inner",children:[J.jsx("h1",{className:"hero__title",children:"FASHION WEEK OUTFITS"}),J.jsx(Oo,{className:"btn btn--purple",to:"/assets",children:"EXPLORE COLLECTION"})]})}),J.jsx(NW,{}),J.jsx(CW,{}),t||r.length>0?J.jsxs(J.Fragment,{children:[J.jsx(jO,{title:"Featured",items:r.slice(0,12),loading:t}),r.length>12?J.jsx(jO,{title:"New Creations",items:r.slice(12,24),loading:!1}):null]}):J.jsxs("div",{className:"overview__empty",children:[J.jsx("p",{className:"overview__empty-title",children:"New drops are on the way"}),J.jsx("p",{className:"muted",children:"There are no items on sale right now — check back soon."}),J.jsx(Oo,{className:"btn btn--purple",to:"/assets",children:"Browse Collectibles"})]})]})}const DW={"/overview":"overview","/assets":"assets","/market":"market","/my-assets":"my_assets","/my-favorites":"favorites","/my-purchases":"my_purchases","/import":"import","/cart":"cart","/credits":"credits","/success":"success"},jW=De.lazy(()=>Gt(()=>import("./Assets-DxS2faEZ.js"),__vite__mapDeps([20,1,21,22,23,24,7])).then(e=>({default:e.Assets}))),LW=De.lazy(()=>Gt(()=>import("./Market-WU7aF7sI.js"),__vite__mapDeps([25,1,26,19,7,21,22,23,27,28,24])).then(e=>({default:e.Market}))),$W=De.lazy(()=>Gt(()=>import("./ItemDetail-I6d0cFBS.js"),__vite__mapDeps([29,1,27,19,7,28,30])).then(e=>({default:e.ItemDetail}))),qW=De.lazy(()=>Gt(()=>import("./Collection-CYi23kK5.js"),__vite__mapDeps([31,1,32,33,22,23,24,7])).then(e=>({default:e.Collection}))),BW=De.lazy(()=>Gt(()=>import("./Creator-qLB6WcFI.js"),__vite__mapDeps([34,1,32,33,22,23,24,7])).then(e=>({default:e.Creator}))),kW=De.lazy(()=>Gt(()=>import("./MyAssets-3d8acYU5.js"),__vite__mapDeps([35,1,36,27,19,7,26,37,23,24,38])).then(e=>({default:e.MyAssets}))),UW=De.lazy(()=>Gt(()=>import("./MyFavorites-B_cD0Nva.js"),__vite__mapDeps([39,1,23,7])).then(e=>({default:e.MyFavorites}))),FW=De.lazy(()=>Gt(()=>import("./MyPurchases-BKjDwmLs.js"),__vite__mapDeps([40,1,23,24,7])).then(e=>({default:e.MyPurchases}))),HW=De.lazy(()=>Gt(()=>import("./ImportListings-40JsDT9M.js"),__vite__mapDeps([41,1,36,27,19,7,26,37,42])).then(e=>({default:e.ImportListings}))),VW=De.lazy(()=>Gt(()=>import("./Cart-D-1Cw1Sr.js"),__vite__mapDeps([43,1,27,19,7,28])).then(e=>({default:e.Cart}))),GW=De.lazy(()=>Gt(()=>import("./GetCredits-DPE-aWPu.js"),__vite__mapDeps([44,1,12,5,7])).then(e=>({default:e.GetCredits}))),zW=De.lazy(()=>Gt(()=>import("./Success-Dg5SGZJd.js"),__vite__mapDeps([45,1,37,7])).then(e=>({default:e.Success}))),WW=De.lazy(()=>Gt(()=>import("./NotFound-lbzVYbwO.js"),__vite__mapDeps([46,1,7])).then(e=>({default:e.NotFound})));function YW(){return J.jsx("div",{className:"page-loading","aria-busy":"true",children:J.jsx("span",{className:"spinner","aria-hidden":!0})})}function xW(){return J.jsxs("div",{className:"overview__empty",children:[J.jsx("p",{className:"overview__empty-title",children:"Something went wrong"}),J.jsx("p",{className:"muted",children:"This page hit an unexpected error. Try reloading."}),J.jsx("button",{className:"btn btn--purple",onClick:()=>window.location.reload(),children:"Reload"})]})}function KW(){aW();const e=FD();return De.useEffect(()=>{o4()},[]),De.useEffect(()=>{const t=e.pathname,r=DW[t]??(t.startsWith("/item/")?"item":t.startsWith("/collection/")?"collection":t.startsWith("/creator/")?"creator":"other");n4(r)},[e.pathname]),J.jsxs(J.Fragment,{children:[J.jsx(V8,{}),J.jsx(iW,{}),J.jsx(eW,{}),J.jsx(k8,{}),J.jsx("main",{className:"page",children:J.jsx(Cl,{fallback:J.jsx(xW,{}),children:J.jsx(De.Suspense,{fallback:J.jsx(YW,{}),children:J.jsxs(HD,{children:[J.jsx(dr,{path:"/",element:J.jsx(VD,{to:"/overview",replace:!0})}),J.jsx(dr,{path:"/overview",element:J.jsx(MW,{})}),J.jsx(dr,{path:"/assets",element:J.jsx(jW,{})}),J.jsx(dr,{path:"/market",element:J.jsx(LW,{})}),J.jsx(dr,{path:"/item/:contractAddress/:tokenId",element:J.jsx($W,{})}),J.jsx(dr,{path:"/collection/:contractAddress",element:J.jsx(qW,{})}),J.jsx(dr,{path:"/creator/:address",element:J.jsx(BW,{})}),J.jsx(dr,{path:"/my-assets",element:J.jsx(kW,{})}),J.jsx(dr,{path:"/my-favorites",element:J.jsx(UW,{})}),J.jsx(dr,{path:"/my-purchases",element:J.jsx(FW,{})}),J.jsx(dr,{path:"/import",element:J.jsx(HW,{})}),J.jsx(dr,{path:"/cart",element:J.jsx(VW,{})}),J.jsx(dr,{path:"/credits",element:J.jsx(GW,{})}),J.jsx(dr,{path:"/success",element:J.jsx(zW,{})}),J.jsx(dr,{path:"*",element:J.jsx(WW,{})})]})})})}),J.jsx(Cl,{fallback:J.jsx(J.Fragment,{}),children:J.jsx(nW,{})})]})}function XW({children:e}){const t=o_(r=>r.locale);return B8(t),J.jsx(R8,{value:EE(t),children:e},t)}m4();const JW=new _j({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),QW=["localhost","127.0.0.1"].includes(window.location.hostname),ZW=QW?void 0:"/shop";GD.createRoot(document.getElementById("root")).render(J.jsx(YO.StrictMode,{children:J.jsx(vj,{client:JW,children:J.jsx(XW,{children:J.jsx(zD,{basename:ZW,children:J.jsx(KW,{})})})})}));export{r3 as $,SE as A,v0 as B,pW as C,nA as D,f6 as E,l6 as F,d6 as G,a4 as H,m6 as I,A6 as J,fE as K,z8 as L,W8 as M,bE as N,Y8 as O,Ga as P,y6 as Q,S6 as R,dj as S,a6 as T,i6 as U,Cj as V,vE as W,n6 as X,ud as Y,h6 as Z,Gt as _,Rs as a,bn as a0,s_ as a1,NO as a2,EW as a3,c6 as a4,P6 as a5,yW as a6,_W as a7,T6 as a8,v6 as a9,I6 as aa,b6 as ab,tn as ac,cH as ad,J4 as ae,tu as af,Q_ as ag,g6 as ah,F_ as ai,KP as aj,XP as ak,qH as al,TH as am,p6 as b,Ll as c,Un as d,w6 as e,N6 as f,TD as g,Nt as h,Jr as i,ci as j,ds as k,oW as l,Yg as m,RW as n,Kr as o,R6 as p,dW as q,en as r,_6 as s,Yr as t,Dl as u,O6 as v,E6 as w,ez as x,Ej as y,qo as z};
|
|
95
|
+
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function v8(e,t){var r=Zz(t),n=qe(qe({},lD),e),i=n.locale,a=n.defaultLocale,s=n.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&s?s(new IO('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&s&&s(new IO('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(s&&s(new Kz('"locale" was not configured, using "'.concat(a,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),E8(n),qe(qe({},n),{formatters:r,formatNumber:y8.bind(null,n,r.getNumberFormat),formatNumberToParts:g8.bind(null,n,r.getNumberFormat),formatRelativeTime:m8.bind(null,n,r.getRelativeTimeFormat),formatDate:e8.bind(null,n,r.getDateTimeFormat),formatDateToParts:n8.bind(null,n,r.getDateTimeFormat),formatTime:t8.bind(null,n,r.getDateTimeFormat),formatDateTimeRange:r8.bind(null,n,r.getDateTimeFormat),formatTimeToParts:i8.bind(null,n,r.getDateTimeFormat),formatPlural:d8.bind(null,n,r.getPluralRules),formatMessage:r_.bind(null,n,r),$t:r_.bind(null,n,r),formatList:c8.bind(null,n,r.getListFormat),formatListToParts:pD.bind(null,n,r.getListFormat),formatDisplayName:s8.bind(null,n,r.getDisplayNames)})}function b8(e){YM(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var T8=qe(qe({},lD),{textComponent:Me.Fragment});function S8(e){return function(t){return e(Me.Children.toArray(t))}}var _E=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=Me.createContext(null)):Me.createContext(null);_E.Consumer;var I8=_E.Provider,R8=I8,w8=_E;function hD(){var e=Me.useContext(w8);return b8(e),e}var n_;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(n_||(n_={}));var i_;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(i_||(i_={}));function yD(e){var t=function(r){var n=hD(),i=r.value,a=r.children,s=As(r,["value","children"]),o=typeof i=="string"?new Date(i||0):i,u=e==="formatDate"?n.formatDateToParts(o,s):n.formatTimeToParts(o,s);return a(u)};return t.displayName=i_[e],t}function au(e){var t=function(r){var n=hD(),i=r.value,a=r.children,s=As(r,["value","children"]),o=n[e](i,s);if(typeof a=="function")return a(o);var u=n.textComponent||Me.Fragment;return Me.createElement(u,null,o)};return t.displayName=n_[e],t}function gD(e){return e&&Object.keys(e).reduce(function(t,r){var n=e[r];return t[r]=uD(n)?S8(n):n,t},{})}var OO=function(e,t,r,n){for(var i=[],a=4;a<arguments.length;a++)i[a-4]=arguments[a];var s=gD(n),o=r_.apply(void 0,er([e,t,r,s],i,!1));return Array.isArray(o)?Me.Children.toArray(o):o},A8=function(e,t){var r=e.defaultRichTextElements,n=As(e,["defaultRichTextElements"]),i=gD(r),a=v8(qe(qe(qe({},T8),n),{defaultRichTextElements:i}),t),s={locale:a.locale,timeZone:a.timeZone,fallbackOnEmptyString:a.fallbackOnEmptyString,formats:a.formats,defaultLocale:a.defaultLocale,defaultFormats:a.defaultFormats,messages:a.messages,onError:a.onError,defaultRichTextElements:i};return qe(qe({},a),{formatMessage:OO.bind(null,s,a.formatters),$t:OO.bind(null,s,a.formatters)})};au("formatDate");au("formatTime");au("formatNumber");au("formatList");au("formatDisplayName");yD("formatDate");yD("formatTime");const O8={overview:"Overview",collectibles:"Collectibles",market:"Market",myAssets:"My Assets",myFavorites:"My Favorites",myPurchases:"My Purchases",searchPlaceholder:"Search items, creators, collections…",searchAria:"Search the shop",yourBalance:"Your {currency}",getCredits:"Get {currency}",cart:"Cart"},N8={title:"Page not found",body:"The page you’re looking for isn’t here. Let’s get you back to the shop.",cta:"Browse Collectibles"},P8={empty:{title:"Your cart is empty",body:"Find something you love and it’ll show up here.",cta:"Browse Collectibles"}},C8={nav:O8,notFound:N8,cart:P8},M8={overview:"Inicio",collectibles:"Coleccionables",market:"Mercado",myAssets:"Mis artículos",myFavorites:"Mis favoritos",myPurchases:"Mis compras",searchPlaceholder:"Buscá artículos, creadores, colecciones…",searchAria:"Buscar en la tienda",yourBalance:"Tus {currency}",getCredits:"Conseguir {currency}",cart:"Carrito"},D8={title:"Página no encontrada",body:"La página que buscás no está acá. Volvamos a la tienda.",cta:"Ver coleccionables"},j8={empty:{title:"Tu carrito está vacío",body:"Encontrá algo que te guste y va a aparecer acá.",cta:"Ver coleccionables"}},L8={nav:M8,notFound:D8,cart:j8},Tl=["en","es"];function a_(e,t="",r={}){for(const[n,i]of Object.entries(e)){const a=t?`${t}.${n}`:n;i&&typeof i=="object"&&!Array.isArray(i)?a_(i,a,r):r[a]=String(i)}return r}const $8={en:a_(C8),es:a_(L8)},q8=dD(),ig={};function EE(e){return ig[e]||(ig[e]=A8({locale:e,defaultLocale:"en",messages:$8[e],onError:()=>{}},q8)),ig[e]}let _D=EE("en");function B8(e){_D=EE(e)}function Yr(e,t){return _D.formatMessage({id:e},t)}function k8(){const{session:e,connecting:t,signIn:r,disconnect:n,restore:i}=Rs(),a=e==null?void 0:e.address,{data:s,isLoading:o}=fE(a),{data:u}=ez(e),l=Kr(w=>w.items.length),c=c_(),[d,p]=Me.useState(""),f=Me.useRef();Me.useEffect(()=>{i()},[i]);function _(w){c(w.trim()?`/assets?q=${encodeURIComponent(w.trim())}`:"/assets",{replace:!0})}function R(w){p(w),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>_(w),300)}return J.jsxs(J.Fragment,{children:[J.jsx(lU,{activePage:"shop",isSignedIn:!!e,isSigningIn:t,isLoadingProfile:!!e&&o,address:a,avatar:s,onClickSignIn:()=>r(),onClickSignOut:()=>void n()}),J.jsxs("div",{className:"subnav",children:[J.jsxs("nav",{className:"subnav__tabs",children:[J.jsx(xn,{to:"/overview",children:Yr("nav.overview")}),J.jsx(xn,{to:"/assets",children:Yr("nav.collectibles")}),J.jsx(xn,{to:"/market",children:Yr("nav.market")}),J.jsx(xn,{to:"/my-assets",children:Yr("nav.myAssets")}),J.jsx(xn,{to:"/my-favorites",children:Yr("nav.myFavorites")}),e?J.jsx(xn,{to:"/my-purchases",children:Yr("nav.myPurchases")}):null]}),J.jsxs("div",{className:"subnav__search",children:[J.jsx("span",{className:"ico ico-search subnav__search-ico","aria-hidden":!0}),J.jsx("input",{value:d,"aria-label":Yr("nav.searchAria"),placeholder:Yr("nav.searchPlaceholder"),onChange:w=>R(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(f.current&&clearTimeout(f.current),_(d))}})]}),e?J.jsxs("span",{className:"subnav__balance",title:Yr("nav.yourBalance",{currency:ds.name}),children:[J.jsx(Un,{className:"subnav__balance-ico"}),(u==null?void 0:u.credits)??0]}):null,J.jsxs(xn,{to:"/credits",className:"subnav__credits",children:[J.jsx(Un,{className:"subnav__credits-ico"}),Yr("nav.getCredits",{currency:ds.name})]}),J.jsxs("div",{className:"subnav__cart-wrap",children:[J.jsxs(xn,{to:"/cart",className:"subnav__cart","aria-label":Yr("nav.cart"),children:[J.jsx("span",{className:"ico ico-cart","aria-hidden":!0}),l>0?J.jsx("span",{className:"subnav__cart-badge",children:l}):null]}),J.jsx(rz,{})]})]})]})}let U8=0;const Ao=Is(e=>({toasts:[],push:t=>{const r=++U8;return e(n=>({toasts:[...n.toasts,{...t,id:r}]})),r},dismiss:t=>e(r=>({toasts:r.toasts.filter(n=>n.id!==t)}))})),v6={success:e=>Ao.getState().push({message:e,kind:"success"}),error:e=>Ao.getState().push({message:e,kind:"error"}),info:e=>Ao.getState().push({message:e,kind:"info"})},F8={success:"✓",error:"!",info:"i"};function H8({t:e}){const t=Ao(r=>r.dismiss);return Me.useEffect(()=>{const r=setTimeout(()=>t(e.id),4500);return()=>clearTimeout(r)},[e.id,t]),J.jsxs("div",{className:`toast toast--${e.kind}`,role:e.kind==="error"?"alert":"status",onClick:()=>t(e.id),children:[J.jsx("span",{className:"toast__icon","aria-hidden":!0,children:F8[e.kind]}),J.jsx("span",{className:"toast__msg",children:e.message})]})}function V8(){const e=Ao(t=>t.toasts);return e.length===0?null:J.jsx("div",{className:"toaster","aria-live":"polite",children:e.map(t=>J.jsx(H8,{t},t.id))})}const G8=Me.lazy(()=>Gt(()=>import("./index-CXZsKw11.js"),__vite__mapDeps([9,1,10,5,11,4,12,13,7,3,14])).then(e=>({default:e.WearablePreview})));function vE(e){return J.jsx(Me.Suspense,{fallback:null,children:J.jsx(G8,{...e})})}function z8(e){return e.itemId?`urn:decentraland:${Nt.chainId===80002?"amoy":"matic"}:collections-v2:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}const Ga=Jr.BodyShape.MALE,za=Jr.BodyShape.FEMALE;function s_(e){if(e.category==="emote")return[Ga,za];switch(e.gender){case"male":return[Ga];case"female":return[za];default:return[Ga,za]}}function W8(e){var r;const t=(r=e==null?void 0:e.avatar)==null?void 0:r.bodyShape;return t?t.includes("BaseFemale")?za:Ga:null}function bE(e,t){return t==null||s_(e).includes(t)}function NO(e){return e===za?"Female":"Male"}function Y8(e){let t=0,r=0;for(const n of e)n.category!=="emote"&&(n.gender==="male"?t++:n.gender==="female"&&r++);return t===0&&r===0?null:r>t?za:Ga}function ua(e){return e.category!=="emote"}function ms(e){return ua(e)?e.wearableCategory??`unknown:${e.id}`:null}const x8=new Set(["hat","helmet","mask","tiara","top_head","hair","facial_hair","eyewear","earring","eyes","eyebrows","mouth"]);function K8(e){if(!ua(e))return"item";const t=e.wearableCategory;return t?x8.has(t)?"head":t==="upper_body"?"upper":t==="lower_body"?"lower":t==="feet"?"feet":t==="hands"||t==="hands_wear"?"hands":"item":"item"}function PO(e,t=null){const r=new Set,n=new Set;for(const i of e){const a=ms(i);a==null||n.has(a)||bE(i,t)&&(n.add(a),r.add(i.id))}return r}function X8(e,t,r){if(!ua(t))return e;const n=new Set(e);if(n.has(t.id))return n.delete(t.id),n;const i=ms(t);if(i!=null)for(const a of r)a.id!==t.id&&n.has(a.id)&&ms(a)===i&&n.delete(a.id);return n.add(t.id),n}function J8(e){const t=new Map;for(const n of e){const i=ms(n);if(i==null)continue;const a=t.get(i)??[];a.push(n.id),t.set(i,a)}const r=new Set;for(const n of t.values())n.length>1&&n.forEach(i=>r.add(i));return r}function Q8(e,t,r=null){const n=[];for(const i of e){if(!t.has(i.id)||!ua(i)||!bE(i,r))continue;const a=z8(i);a&&n.push(a)}return n}const Z8=Me.lazy(()=>Gt(()=>import("./AnimatedBackground-D8118Htr.js"),__vite__mapDeps([15,1,16])));function CO(e){return!e||e.startsWith("unknown:")?"Wearable":e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g," ")}function eW(){const e=Kr(m=>m.fittingOpen),t=Kr(m=>m.setFittingOpen),r=Kr(m=>m.items),n=Kr(m=>m.remove),i=c_(),a=Rs(m=>{var v;return(v=m.session)==null?void 0:v.address}),{data:s,isFetched:o}=fE(a),u=!a||o,l=!!a&&!!s,c=l?a:"default",d=W8(s)??Y8(r)??Ga,[p,f]=Me.useState(()=>PO(r,d)),[_,R]=Me.useState(!1);Me.useEffect(()=>{e&&f(PO(r,d))},[e,d]),Me.useEffect(()=>{const m=new Set(r.map(v=>v.id));f(v=>{const A=new Set([...v].filter(P=>m.has(P)));return A.size===v.size?v:A})},[r]);const w=Me.useMemo(()=>J8(r),[r]),O=Me.useMemo(()=>Q8(r,p,d),[r,p,d]),h=r.reduce((m,v)=>m+v.priceCredits,0),T=O.join(",");Me.useEffect(()=>{R(!1)},[T,c]);const b=Me.useRef(!1);return Me.useEffect(()=>{if(!e){b.current=!1;return}b.current||(b.current=!0,ci("Shop Tried On Outfit",{cart_size:r.length,wearables:r.filter(ua).length,emotes:r.filter(m=>!ua(m)).length,cart_value_credits:h}))},[e,r,h]),Me.useEffect(()=>{if(!e)return;const m=v=>{v.key==="Escape"&&t(!1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),!e||r.length===0?null:J.jsxs("div",{className:"fitting",role:"dialog","aria-modal":"true","aria-label":"Fitting room",children:[J.jsx("div",{className:"fitting__scrim",onClick:()=>t(!1)}),J.jsxs("div",{className:"fitting__panel",children:[J.jsx("button",{className:"fitting__close",onClick:()=>t(!1),"aria-label":"Close",children:"×"}),J.jsxs("div",{className:"fitting__stage",children:[J.jsx(Me.Suspense,{fallback:null,children:J.jsx(Z8,{})}),u?O.length>0?J.jsxs(J.Fragment,{children:[J.jsx(vE,{profile:c,bodyShape:l?void 0:d,urns:O,type:Jr.PreviewType.AVATAR,emote:Jr.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:Nt.chainId===80002,onLoad:()=>R(!0)},c),_?null:J.jsx("div",{className:"fitting__loading","aria-hidden":!0,children:J.jsx("span",{className:"fitting__spinner"})})]}):J.jsxs("div",{className:"fitting__empty-stage",children:[J.jsx("p",{children:"Nothing on right now."}),J.jsx("p",{className:"muted",children:"Turn on an item from the list to try it."})]}):J.jsx("div",{className:"fitting__loading","aria-hidden":!0,children:J.jsx("span",{className:"fitting__spinner"})})]}),J.jsxs("div",{className:"fitting__side",children:[J.jsxs("div",{className:"fitting__head",children:[J.jsx("h2",{className:"fitting__title",children:"Fitting room"}),J.jsx("p",{className:"fitting__sub muted",children:"Mix and match your cart. Turn items on and off to see the look."})]}),J.jsx("div",{className:"fitting__items",children:r.map(m=>{const v=ua(m),A=v&&!bE(m,d),P=p.has(m.id),q=w.has(m.id);return J.jsxs("div",{className:`fitting-row${P?" is-on":""}${A?" is-incompatible":""}`,children:[J.jsxs("label",{className:"fitting-row__toggle",children:[J.jsx("input",{type:"checkbox",checked:P,disabled:!v||A,onChange:()=>f(z=>X8(z,m,r))}),J.jsx("span",{className:"fitting-row__box","aria-hidden":!0})]}),J.jsx("div",{className:"fitting-row__thumb",children:m.thumbnail?J.jsx("img",{src:m.thumbnail,alt:m.name}):null}),J.jsxs("div",{className:"fitting-row__info",children:[J.jsx("div",{className:"fitting-row__name",title:m.name,children:m.name}),J.jsxs("div",{className:"fitting-row__meta",children:[J.jsx("span",{className:`ico ico-slot-${v?K8(m):"item"} fitting-row__slot-ico`,title:v?CO(ms(m)):"Emote",role:"img","aria-label":v?CO(ms(m)):"Emote"}),q&&!A?J.jsx("span",{className:"fitting-row__conflict",title:"Only one item per slot can be worn",children:"1 per slot"}):null,A?J.jsxs("span",{className:"fitting-row__incompat",title:`This item is made for the ${NO(s_(m)[0])} body shape`,children:[NO(s_(m)[0])," only"]}):null]})]}),J.jsxs("div",{className:"fitting-row__price",children:[J.jsx(Un,{className:"fitting-row__diamond"}),m.priceCredits]}),J.jsx("button",{className:"fitting-row__remove",onClick:()=>n(m.id),"aria-label":`Remove ${m.name} from cart`,title:"Remove",children:J.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},m.id)})}),J.jsxs("div",{className:"fitting__foot",children:[J.jsxs("div",{className:"fitting__total",children:[r.length," item",r.length>1?"s":""," · ",J.jsxs("strong",{children:[ds.symbol," ",h]})]}),J.jsx("button",{className:"btn btn--purple fitting__checkout",onClick:()=>{t(!1),i("/cart")},children:"Checkout"})]})]})]})]})}const ED="shop:locale";function tW(){var e;try{const t=new URLSearchParams(window.location.search).get("lang");if(t&&Tl.includes(t))return t;const r=localStorage.getItem(ED);if(r&&Tl.includes(r))return r;const n=(e=navigator.language)==null?void 0:e.slice(0,2);if(n&&Tl.includes(n))return n}catch{}return"en"}const o_=Is(e=>({locale:tW(),setLocale:t=>{try{localStorage.setItem(ED,t)}catch{}e({locale:t})}})),rW=Me.lazy(()=>Gt(()=>import("./ShopFooterInner-D-Q5vmHv.js"),__vite__mapDeps([17,1,5,6,14,11,4,3,7])));function nW(){const e=o_(r=>r.locale),t=o_(r=>r.setLocale);return J.jsx("div",{className:"shop-footer",children:J.jsx(Me.Suspense,{fallback:null,children:J.jsx(rW,{locale:e,onChange:r=>{Tl.includes(r)&&t(r)}})})})}function iW(){const[e,t]=Me.useState(!1);return Me.useEffect(()=>{if(typeof window.requestIdleCallback=="function"){const n=window.requestIdleCallback(()=>t(!0),{timeout:3e3});return()=>window.cancelIdleCallback(n)}const r=window.setTimeout(()=>t(!0),1500);return()=>window.clearTimeout(r)},[]),e?J.jsx("div",{"aria-hidden":!0,style:{position:"fixed",left:-9999,top:-9999,width:2,height:2,opacity:0,overflow:"hidden",pointerEvents:"none"},children:J.jsx(vE,{id:"preview-warmer",profile:"default",dev:Nt.chainId===80002,disableBackground:!0,disableFadeEffect:!0})}):null}function aW(){const e=Rs(t=>t.session);Me.useEffect(()=>{if(!e||e.providerType!==Jr.ProviderType.INJECTED)return;const t=e.web3Provider.provider;if(!(t!=null&&t.on)||!t.removeListener)return;const r=e.address.toLowerCase(),n=(...i)=>{var o;((o=(i[0]??[])[0])==null?void 0:o.toLowerCase())!==r&&window.location.reload()};return t.on("accountsChanged",n),()=>{var i;return(i=t.removeListener)==null?void 0:i.call(t,"accountsChanged",n)}},[e])}const TE=`${Nt.nftApiUrl}/v1`;function vD(e){if(!e)return 0;try{return Math.ceil(Number(xO(e))*10)}catch{return 0}}function b6(e){if(!e)return 0;try{const t=BigInt(e),r=10n**16n;return Number((t+r-1n)/r)}catch{return 0}}async function T6(e,t){var n,i,a;const r=new URLSearchParams({contractAddresses:e,itemId:t,first:"1"});try{const s=await fetch(`${Nt.nftApiUrl}/v2/catalog?${r.toString()}`);if(!s.ok)return"";const{data:o}=await s.json(),u=(n=o==null?void 0:o[0])==null?void 0:n.data;return(((i=u==null?void 0:u.wearable)==null?void 0:i.description)??((a=u==null?void 0:u.emote)==null?void 0:a.description)??"").trim()}catch{return""}}async function S6(e){const{listings:t}=await dd({contractAddress:e,first:200}),r={};for(const n of t)n.listingType!=="primary"||n.itemId==null||(r[String(n.itemId)]={isOnSale:!0,priceCredits:n.priceCredits,tradeId:n.tradeId});return r}async function sW(e,t){var a;const r=new URLSearchParams({contractAddress:e,tokenId:t,first:"1"}),n=await fetch(`${TE}/nfts?${r.toString()}`);if(!n.ok)return null;const{data:i}=await n.json();return((a=i==null?void 0:i[0])==null?void 0:a.nft)??null}function bD(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,tokenId:e.tokenId??void 0,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:e.priceCredits,gender:null,compareAtCredits:e.compareAtCredits!=null&&e.compareAtCredits>e.priceCredits?e.compareAtCredits:void 0,saleEndsAt:e.saleEndsAt!=null?e.saleEndsAt*1e3:void 0}}async function dd(e){var i,a;const t=new URLSearchParams;(e.category==="wearable"||e.category==="emote")&&t.set("category",e.category),e.first!=null&&t.set("first",String(e.first)),e.skip!=null&&t.set("skip",String(e.skip)),e.contractAddress&&t.set("contractAddress",e.contractAddress),e.itemId!=null&&t.set("itemId",e.itemId),(i=e.rarities)!=null&&i.length&&t.set("rarity",e.rarities.join(",")),(a=e.wearableCategories)!=null&&a.length&&t.set("wearableCategory",e.wearableCategories.join(",")),e.minPriceCredits!=null&&t.set("minPriceCredits",String(e.minPriceCredits)),e.maxPriceCredits!=null&&t.set("maxPriceCredits",String(e.maxPriceCredits)),e.search&&t.set("search",e.search),e.sortBy&&t.set("sortBy",e.sortBy);const r=await fetch(`${Nt.marketplaceServerUrl}/v3/catalog/shop?${t.toString()}`);if(!r.ok)throw new Error(`fetchShopListings ${r.status}`);const n=await r.json();return{listings:n.data??[],total:n.total??0}}async function I6(e,t){const{listings:r}=await dd({contractAddress:e,itemId:t,first:1});return r[0]?bD(r[0]):null}async function oW({first:e=100,...t}={}){const{listings:r,total:n}=await dd({...t,first:e});return{items:r.map(bD),total:n}}function uW(e){return{tradeId:e.tradeId,listingType:"primary",contractAddress:e.contractAddress,itemId:e.itemId??"",name:e.name??"",thumbnail:e.thumbnail??"",rarity:e.rarity??"common",category:e.category??"wearable",wearableCategory:e.wearableCategory??null,creator:e.creator??"",manaWei:e.manaWei,available:e.available??0,network:e.network??"MATIC",chainId:e.chainId??Nt.chainId,createdAt:e.createdAt??0}}async function R6({first:e=100,...t}={}){var s,o;const r=new URLSearchParams;(t.category==="wearable"||t.category==="emote")&&r.set("category",t.category),r.set("first",String(e)),t.skip!=null&&r.set("skip",String(t.skip)),(s=t.rarities)!=null&&s.length&&r.set("rarity",t.rarities.join(",")),(o=t.wearableCategories)!=null&&o.length&&r.set("wearableCategory",t.wearableCategories.join(",")),t.search&&r.set("search",t.search),t.sortBy&&r.set("sortBy",t.sortBy);const n=await fetch(`${Nt.marketplaceServerUrl}/v3/catalog/legacy?${r.toString()}`);if(!n.ok)throw new Error(`fetchLegacyListings ${n.status}`);const i=await n.json(),a=i.data??[];return{items:a.map(uW),total:i.total??a.length}}async function w6(e,{category:t="wearable",first:r=48,skip:n=0}={}){const i=new URLSearchParams({owner:e.toLowerCase(),category:t,first:String(r),skip:String(n),sortBy:"newest",orderDirection:"desc"}),a=await fetch(`${TE}/nfts?${i.toString()}`);if(!a.ok)throw new Error(`Failed to fetch assets (${a.status})`);const{data:s,total:o}=await a.json();return{assets:s.map(l=>{var c,d,p,f,_;return{id:l.nft.id,contractAddress:l.nft.contractAddress,tokenId:l.nft.tokenId,itemId:l.nft.itemId??null,name:l.nft.name,category:l.nft.category,image:l.nft.image,rarity:((d=(c=l.nft.data)==null?void 0:c.wearable)==null?void 0:d.rarity)??((f=(p=l.nft.data)==null?void 0:p.emote)==null?void 0:f.rarity),network:l.nft.network,chainId:l.nft.chainId,isOnSale:l.order!=null,listingPrice:l.order?vD(l.order.price):void 0,tradeId:(_=l.order)==null?void 0:_.tradeId}}),total:o}}const cW="dcl:marketplace";async function A6(e,t){const{TradeService:r}=await Gt(async()=>{const{TradeService:i}=await import("./TradeService-DgGPCq3X.js");return{TradeService:i}},__vite__mapDeps([18,7,1,19,2,8]));return new r(cW,Nt.marketplaceServerUrl,()=>t).addTrade(e)}async function TD(e){const t=await fetch(`${Nt.marketplaceServerUrl}/v1/trades/${e}`);if(!t.ok)throw new Error(`fetchTrade ${t.status}`);const r=await t.json();return r.data??r}async function lW(e,t){const r=new URLSearchParams({contractAddress:e,itemId:t,first:"1"}),n=await fetch(`${TE}/items?${r.toString()}`);if(!n.ok)return null;const{data:i}=await n.json();return(i==null?void 0:i[0])??null}async function O6(e){var u,l;let t;try{t=await TD(e)}catch{return null}const r=(u=t.sent)==null?void 0:u[0],n=(l=t.received)==null?void 0:l[0],i=vD(n==null?void 0:n.amount),a=(r==null?void 0:r.contractAddress)??"",s=(r==null?void 0:r.value)??"";if(!a)return{name:"Item",thumbnail:"",credits:i,contractAddress:""};if((r==null?void 0:r.assetType)===Jr.TradeAssetType.COLLECTION_ITEM){const c=await lW(a,s);return{name:(c==null?void 0:c.name)??"Item",thumbnail:(c==null?void 0:c.thumbnail)??"",credits:i,contractAddress:a,itemId:s}}const o=await sW(a,s);return{name:(o==null?void 0:o.name)??`#${s}`,thumbnail:(o==null?void 0:o.image)??"",credits:i,contractAddress:a,tokenId:s}}async function N6(e,t){var i;const{listings:r}=await dd({contractAddress:e,itemId:t,first:1}),n=(i=r[0])==null?void 0:i.tradeId;return n?TD(n):null}function dW(e,t){return!t||!e.creator?!1:lE(e)&&e.creator.toLowerCase()===t.toLowerCase()}function P6(e,t){return!!e.signer&&!!t&&e.signer.toLowerCase()===t.toLowerCase()}function fW(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?`${e.slice(0,6)}…${e.slice(-4)}`:e}function pW(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)>>>0;return`hsl(${t%360}, 52%, 45%)`}function mW(e,t){var r;return(((r=e==null?void 0:e.trim())==null?void 0:r[0])||t.replace(/^0x/i,"")[0]||"?").toUpperCase()}function hW({address:e,className:t,linkToProfile:r}){var p,f;const n=c_(),{data:i}=fE(e),a=(f=(p=i==null?void 0:i.avatar)==null?void 0:p.snapshots)==null?void 0:f.face256,[s,o]=Me.useState(!1);if(Me.useEffect(()=>o(!1),[a]),!e)return null;const u=(i==null?void 0:i.name)||fW(e),c=!!a&&!s?J.jsx("img",{className:"creator__ava",src:a,alt:"",loading:"lazy",onError:()=>o(!0)}):J.jsx("span",{className:"creator__ava creator__ava--letter",style:{backgroundColor:pW(e)},"aria-hidden":!0,children:mW(i==null?void 0:i.name,e)}),d=J.jsxs(J.Fragment,{children:[c,J.jsxs("span",{className:"creator__name",children:["By ",u]})]});return r?J.jsx("button",{className:`creator creator--link${t?` ${t}`:""}`,title:`View ${u}`,onClick:_=>{_.stopPropagation(),n(`/creator/${e}`)},children:d}):J.jsx("span",{className:`creator${t?` ${t}`:""}`,children:d})}const ag="#a09ba8";function MO(e){if(!e)return ag;try{return Jr.Rarity.getColor(e.toLowerCase())||ag}catch{return ag}}function yW(e){const t=typeof e=="string"?e.replace("#",""):"";if(t.length<6)return"#161518";const r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return .299*r+.587*n+.114*i>150?"#161518":"#ffffff"}function gW(e,t=Date.now()){const{priceCredits:r,compareAtCredits:n,saleEndsAt:i}=e;return!(n==null||!(n>r)||i!=null&&i<=t)}function _W(e,t){if(!(e>0)||!(t>=0)||t>=e)return 0;const r=Math.round((1-t/e)*100);return Math.min(99,Math.max(1,r))}function Io(e,t=Date.now()){return e==null?1/0:Math.max(0,e-t)}function EW(e){if(!isFinite(e)||e<=0)return"";const t=Math.floor(e/1e3),r=Math.floor(t/86400),n=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return r>0?n>0?`${r}d ${n}h`:`${r}d`:n>0?`${n}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function DO(e){return!isFinite(e)||e<=0?0:e<36e5?1e3:6e4}function vW({endsAt:e,className:t}){const[r,n]=Me.useState(()=>Io(e));Me.useEffect(()=>{if(n(Io(e)),e==null)return;let a;const s=()=>{const u=Io(e);n(u);const l=DO(u);l>0&&(a=setTimeout(s,l))},o=DO(Io(e));return o>0&&(a=setTimeout(s,o)),()=>clearTimeout(a)},[e]);const i=EW(r);return i?J.jsxs("span",{className:t??"sale-countdown",children:[J.jsx("span",{className:"ico ico-clock sale-countdown__ico","aria-hidden":!0}),i]}):null}function bW(e){const[,t]=Me.useState(0);return Me.useEffect(()=>{const r=Io(e.saleEndsAt);if(!isFinite(r)||r<=0||r>2147483647)return;const n=setTimeout(()=>t(i=>i+1),r+1);return()=>clearTimeout(n)},[e.saleEndsAt]),gW(e)}const TW=120,SW=250;function IW(e){return e==="male"?"♂":e==="female"?"♀":e==="unisex"?"⚥":""}function SE(e){const{item:t}=e,r=e.mode==="market",[n,i]=Me.useState(!1),[a,s]=Me.useState(!1),o=Me.useRef(),u=Me.useRef(),l=Kr(z=>z.add),c=Kr(z=>z.items.some(Y=>Y.id===t.id)),d=Rs(z=>{var Y;return(Y=z.session)==null?void 0:Y.address}),p=dW(t,d),f=Dl(z=>z.toggle),_=Dl(z=>!!z.items[t.id]),R=!!t.contractAddress&&!!t.itemId,w=t.tokenId??t.itemId,O=!r&&!!t.contractAddress&&!!w,h=`/item/${t.contractAddress}/${w}`;function T(){o.current&&clearTimeout(o.current),u.current&&clearTimeout(u.current),s(!1),o.current=setTimeout(()=>i(!0),TW)}function b(){o.current&&clearTimeout(o.current),u.current&&clearTimeout(u.current),i(!1),s(!1)}function m(){u.current&&clearTimeout(u.current),u.current=setTimeout(()=>s(!0),SW)}const v=IW(t.gender),A=bW({priceCredits:t.priceCredits,compareAtCredits:t.compareAtCredits,saleEndsAt:t.saleEndsAt}),P=!r&&A,q=P?_W(t.compareAtCredits,t.priceCredits):0;return J.jsxs("article",{className:`card${n?" card--hover":""}`,style:O?{cursor:"pointer"}:void 0,onMouseEnter:T,onMouseLeave:b,children:[O?J.jsx(Oo,{className:"card__link",to:h,state:{item:t,tradeId:t.tradeId},"aria-label":t.name}):null,J.jsxs("div",{className:"card__media",children:[P?J.jsxs("span",{className:"card__sale-badge",children:["SALE",q>0?` -${q}%`:""]}):null,J.jsx("button",{className:`card__fav${_?" is-on":""}`,onClick:z=>{z.stopPropagation(),f(t)},"aria-label":_?"Remove from favorites":"Add to favorites",children:J.jsx("span",{className:"ico ico-heart","aria-hidden":!0})}),t.thumbnail?J.jsx("img",{className:`card__img${n&&a?" card__img--hidden":""}`,src:t.thumbnail,alt:t.name,loading:"lazy"}):null,n&&R?J.jsxs(J.Fragment,{children:[J.jsx("div",{className:`card__preview${a?" is-ready":""}`,children:J.jsx(vE,{contractAddress:t.contractAddress,itemId:t.itemId??void 0,profile:"default",type:t.category==="emote"?void 0:Jr.PreviewType.AVATAR,emote:t.category==="emote"?void 0:Jr.PreviewEmote.FASHION,dev:Nt.chainId===80002,disableBackground:!0,disableFadeEffect:!0,onLoad:m})}),J.jsx("span",{className:"card__preview-shield","aria-hidden":!0}),a?null:J.jsx("span",{className:"card__loadbar","aria-hidden":!0})]}):null]}),J.jsxs("div",{className:"card__body",children:[J.jsxs("div",{className:"card__desc",children:[J.jsx("div",{className:"card__name",title:t.name,children:t.name}),t.creator?J.jsx(hW,{address:t.creator,className:"card__creator",linkToProfile:!0}):J.jsx("div",{className:"card__creator",children:" "})]}),J.jsxs("div",{className:"card__meta",children:[r&&e.mode==="market"?J.jsxs("div",{className:"card__price card__price--market",children:[J.jsx("span",{className:"card__approx","aria-hidden":!0,children:"≈"}),J.jsx(Un,{className:"card__diamond"}),e.marketPriceCredits==null?"—":e.marketPriceCredits,J.jsx("span",{className:"chip card__market-chip",children:"Market price"})]}):P?J.jsxs("div",{className:"card__price card__price--sale",children:[J.jsxs("span",{className:"card__price-now",children:[J.jsx(Un,{className:"card__diamond"}),t.priceCredits]}),J.jsxs("span",{className:"card__price-was",children:[J.jsx(Un,{className:"card__diamond card__diamond--was"}),t.compareAtCredits]}),J.jsx(vW,{endsAt:t.saleEndsAt,className:"card__countdown"})]}):J.jsxs("div",{className:"card__price",children:[J.jsx(Un,{className:"card__diamond"}),t.priceCredits]}),J.jsxs("div",{className:"card__chips",children:[J.jsx("span",{className:"chip chip--rarity",style:{background:MO(t.rarity),color:yW(MO(t.rarity))},children:t.rarity}),t.category==="wearable"?J.jsx("span",{className:"chip chip--icon",children:J.jsx("span",{className:"ico ico-eyewear","aria-hidden":!0})}):null,v?J.jsx("span",{className:"chip chip--icon",children:v}):null]})]}),r&&e.mode==="market"?J.jsx("button",{className:"card__cart",onClick:z=>{z.stopPropagation(),e.onBuyNow(t)},disabled:e.marketPriceCredits==null,children:e.marketPriceCredits==null?"Unavailable":"Buy now"}):J.jsxs("button",{className:`card__cart${c?" is-in":""}`,onClick:z=>{z.stopPropagation(),p||l(t,"grid")},disabled:c||p,children:[p?null:J.jsx("span",{className:"ico ico-cart-solid card__cart-ico","aria-hidden":!0}),p?"Your item":c?"In cart":"Add to cart"]})]})]})}function RW(e){if(!e)return 0;try{return Math.ceil(Number(xO(e))*10)}catch{return 0}}function wW(e){if(!e||e.length===0)return null;const t=e.some(n=>n.includes("Male")),r=e.some(n=>n.includes("Female"));return t&&r?"unisex":t?"male":r?"female":null}function SD(e){var t,r,n,i,a,s;return{id:e.id,name:e.name,creator:e.creator??"",contractAddress:e.contractAddress,itemId:e.itemId??null,category:e.category,wearableCategory:((r=(t=e.data)==null?void 0:t.wearable)==null?void 0:r.category)??((i=(n=e.data)==null?void 0:n.emote)==null?void 0:i.category),rarity:e.rarity??"common",network:e.network,chainId:e.chainId,thumbnail:e.thumbnail??"",priceCredits:RW(e.price??e.minPrice),gender:wW((s=(a=e.data)==null?void 0:a.wearable)==null?void 0:s.bodyShapes)}}async function C6(e,{first:t=20,skip:r=0}={}){const n=new URLSearchParams({contractAddress:e,first:String(t),skip:String(r),includeSocialEmotes:"false"}),i=await fetch(`${Nt.nftApiUrl}/v1/items?${n.toString()}`);if(!i.ok)throw new Error(`fetchCollectionItems ${i.status}`);const{data:a,total:s}=await i.json(),o=(a??[]).map(SD);return{items:o,total:s??r+o.length}}async function AW(e,{first:t=60,skip:r=0}={}){const n=new URLSearchParams({creator:e,first:String(t),skip:String(r),includeSocialEmotes:"false"}),i=await fetch(`${Nt.nftApiUrl}/v1/items?${n.toString()}`);if(!i.ok)throw new Error(`fetchCreatorItems ${i.status}`);const{data:a,total:s}=await i.json(),o=(a??[]).map(SD);return{items:o,total:s??r+o.length}}const OW=8,NW=8,PW=12;function CW(){const t=Yg(i=>i.followed).slice(0,OW),{data:r=[],isLoading:n}=Ll({queryKey:["followed-creators-row",t.join(",")],enabled:t.length>0,queryFn:async()=>{const i=await Promise.all(t.map(a=>AW(a,{first:NW}).then(s=>s.items).catch(()=>[])));return MW(i).filter(a=>a.priceCredits>0).slice(0,PW)}});return t.length===0||!n&&r.length===0?null:J.jsxs("section",{className:"row",children:[J.jsx("div",{className:"row__head",children:J.jsx("h2",{className:"row__title",children:"From creators you follow"})}),J.jsx("div",{className:"row__track",children:n?Array.from({length:6}).map((i,a)=>J.jsx("div",{className:"card card--skeleton"},a)):r.map(i=>J.jsx(SE,{item:i},i.id))})]})}function MW(e){const t=[],r=new Set,n=e.reduce((i,a)=>Math.max(i,a.length),0);for(let i=0;i<n;i++)for(const a of e){const s=a[i];s&&!r.has(s.id)&&(r.add(s.id),t.push(s))}return t}const ID="shop:recently-viewed",RD=12;function wD(){try{const e=localStorage.getItem(ID);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.slice(0,RD):[]}catch{return[]}}function M6(e){if(e!=null&&e.id)try{const t=[e,...wD().filter(r=>r.id!==e.id)].slice(0,RD);localStorage.setItem(ID,JSON.stringify(t))}catch{}}function DW({excludeId:e}){const t=Me.useMemo(()=>wD().filter(r=>r.id!==e),[e]);return t.length===0?null:J.jsxs("section",{className:"row",children:[J.jsx("div",{className:"row__head",children:J.jsx("h2",{className:"row__title",children:"Recently viewed"})}),J.jsx("div",{className:"row__track",children:t.map(r=>J.jsx(SE,{item:r},r.id))})]})}function jO({title:e,items:t,loading:r}){return J.jsxs("section",{className:"row",children:[J.jsxs("div",{className:"row__head",children:[J.jsx("h2",{className:"row__title",children:e}),J.jsxs(Oo,{className:"row__viewall",to:"/assets",children:["View all ",J.jsx("span",{className:"ico ico-viewall","aria-hidden":!0})]})]}),J.jsx("div",{className:"row__track",children:r?Array.from({length:6}).map((n,i)=>J.jsx("div",{className:"card card--skeleton"},i)):t.map(n=>J.jsx(SE,{item:n},n.id))})]})}function jW(){const{data:e,isLoading:t}=Ll({queryKey:["overview-listings"],queryFn:()=>oW({first:24})}),r=(e==null?void 0:e.items)??[];return J.jsxs("div",{className:"overview",children:[J.jsx("section",{className:"hero",children:J.jsxs("div",{className:"hero__inner",children:[J.jsx("h1",{className:"hero__title",children:"FASHION WEEK OUTFITS"}),J.jsx(Oo,{className:"btn btn--purple",to:"/assets",children:"EXPLORE COLLECTION"})]})}),J.jsx(CW,{}),J.jsx(DW,{}),t||r.length>0?J.jsxs(J.Fragment,{children:[J.jsx(jO,{title:"Featured",items:r.slice(0,12),loading:t}),r.length>12?J.jsx(jO,{title:"New Creations",items:r.slice(12,24),loading:!1}):null]}):J.jsxs("div",{className:"overview__empty",children:[J.jsx("p",{className:"overview__empty-title",children:"New drops are on the way"}),J.jsx("p",{className:"muted",children:"There are no items on sale right now — check back soon."}),J.jsx(Oo,{className:"btn btn--purple",to:"/assets",children:"Browse Collectibles"})]})]})}const LW={"/overview":"overview","/assets":"assets","/market":"market","/my-assets":"my_assets","/my-favorites":"favorites","/my-purchases":"my_purchases","/import":"import","/cart":"cart","/credits":"credits","/success":"success"},$W=Me.lazy(()=>Gt(()=>import("./Assets-C2ZyKmXZ.js"),__vite__mapDeps([20,1,21,22,23,24,7])).then(e=>({default:e.Assets}))),qW=Me.lazy(()=>Gt(()=>import("./Market-BCmHclZK.js"),__vite__mapDeps([25,1,26,19,7,21,22,23,27,28,24])).then(e=>({default:e.Market}))),BW=Me.lazy(()=>Gt(()=>import("./ItemDetail-Bm_JOK-F.js"),__vite__mapDeps([29,1,27,19,7,28,30])).then(e=>({default:e.ItemDetail}))),kW=Me.lazy(()=>Gt(()=>import("./Collection-C_nk8Cc9.js"),__vite__mapDeps([31,1,32,33,22,23,24,7])).then(e=>({default:e.Collection}))),UW=Me.lazy(()=>Gt(()=>import("./Creator-DVFLJ7iH.js"),__vite__mapDeps([34,1,32,33,22,23,24,7])).then(e=>({default:e.Creator}))),FW=Me.lazy(()=>Gt(()=>import("./MyAssets-DymuAMH5.js"),__vite__mapDeps([35,1,36,27,19,7,26,37,23,24,38])).then(e=>({default:e.MyAssets}))),HW=Me.lazy(()=>Gt(()=>import("./MyFavorites-DWNoEFBD.js"),__vite__mapDeps([39,1,23,7])).then(e=>({default:e.MyFavorites}))),VW=Me.lazy(()=>Gt(()=>import("./MyPurchases-D84T4Vx3.js"),__vite__mapDeps([40,1,23,24,7])).then(e=>({default:e.MyPurchases}))),GW=Me.lazy(()=>Gt(()=>import("./ImportListings-DgxCofmJ.js"),__vite__mapDeps([41,1,36,27,19,7,26,37,42])).then(e=>({default:e.ImportListings}))),zW=Me.lazy(()=>Gt(()=>import("./Cart-ByEfJHct.js"),__vite__mapDeps([43,1,27,19,7,28])).then(e=>({default:e.Cart}))),WW=Me.lazy(()=>Gt(()=>import("./GetCredits-D2iWhTcj.js"),__vite__mapDeps([44,1,12,5,7])).then(e=>({default:e.GetCredits}))),YW=Me.lazy(()=>Gt(()=>import("./Success-Bxdmwj3S.js"),__vite__mapDeps([45,1,37,7])).then(e=>({default:e.Success}))),xW=Me.lazy(()=>Gt(()=>import("./NotFound-Dagrrmzl.js"),__vite__mapDeps([46,1,7])).then(e=>({default:e.NotFound})));function KW(){return J.jsx("div",{className:"page-loading","aria-busy":"true",children:J.jsx("span",{className:"spinner","aria-hidden":!0})})}function XW(){return J.jsxs("div",{className:"overview__empty",children:[J.jsx("p",{className:"overview__empty-title",children:"Something went wrong"}),J.jsx("p",{className:"muted",children:"This page hit an unexpected error. Try reloading."}),J.jsx("button",{className:"btn btn--purple",onClick:()=>window.location.reload(),children:"Reload"})]})}function JW(){aW();const e=FD();return Me.useEffect(()=>{o4()},[]),Me.useEffect(()=>{const t=e.pathname,r=LW[t]??(t.startsWith("/item/")?"item":t.startsWith("/collection/")?"collection":t.startsWith("/creator/")?"creator":"other");n4(r)},[e.pathname]),J.jsxs(J.Fragment,{children:[J.jsx(V8,{}),J.jsx(iW,{}),J.jsx(eW,{}),J.jsx(k8,{}),J.jsx("main",{className:"page",children:J.jsx(Cl,{fallback:J.jsx(XW,{}),children:J.jsx(Me.Suspense,{fallback:J.jsx(KW,{}),children:J.jsxs(HD,{children:[J.jsx(dr,{path:"/",element:J.jsx(VD,{to:"/overview",replace:!0})}),J.jsx(dr,{path:"/overview",element:J.jsx(jW,{})}),J.jsx(dr,{path:"/assets",element:J.jsx($W,{})}),J.jsx(dr,{path:"/market",element:J.jsx(qW,{})}),J.jsx(dr,{path:"/item/:contractAddress/:tokenId",element:J.jsx(BW,{})}),J.jsx(dr,{path:"/collection/:contractAddress",element:J.jsx(kW,{})}),J.jsx(dr,{path:"/creator/:address",element:J.jsx(UW,{})}),J.jsx(dr,{path:"/my-assets",element:J.jsx(FW,{})}),J.jsx(dr,{path:"/my-favorites",element:J.jsx(HW,{})}),J.jsx(dr,{path:"/my-purchases",element:J.jsx(VW,{})}),J.jsx(dr,{path:"/import",element:J.jsx(GW,{})}),J.jsx(dr,{path:"/cart",element:J.jsx(zW,{})}),J.jsx(dr,{path:"/credits",element:J.jsx(WW,{})}),J.jsx(dr,{path:"/success",element:J.jsx(YW,{})}),J.jsx(dr,{path:"*",element:J.jsx(xW,{})})]})})})}),J.jsx(Cl,{fallback:J.jsx(J.Fragment,{}),children:J.jsx(nW,{})})]})}function QW({children:e}){const t=o_(r=>r.locale);return B8(t),J.jsx(R8,{value:EE(t),children:e},t)}m4();const ZW=new _j({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),e6=["localhost","127.0.0.1"].includes(window.location.hostname),t6=e6?void 0:"/shop";GD.createRoot(document.getElementById("root")).render(J.jsx(YO.StrictMode,{children:J.jsx(vj,{client:ZW,children:J.jsx(QW,{children:J.jsx(zD,{basename:t6,children:J.jsx(JW,{})})})})}));export{r3 as $,SE as A,v0 as B,hW as C,nA as D,m6 as E,f6 as F,p6 as G,a4 as H,y6 as I,N6 as J,fE as K,z8 as L,W8 as M,bE as N,Y8 as O,Ga as P,_6 as Q,R6 as R,dj as S,o6 as T,s6 as U,Cj as V,vE as W,a6 as X,ud as Y,g6 as Z,Gt as _,Rs as a,bn as a0,s_ as a1,NO as a2,bW as a3,d6 as a4,M6 as a5,_W as a6,vW as a7,I6 as a8,T6 as a9,w6 as aa,S6 as ab,tn as ac,cH as ad,J4 as ae,tu as af,Q_ as ag,E6 as ah,F_ as ai,KP as aj,XP as ak,qH as al,TH as am,h6 as b,Ll as c,Un as d,O6 as e,C6 as f,TD as g,Nt as h,Jr as i,ci as j,ds as k,oW as l,Yg as m,AW as n,Kr as o,A6 as p,dW as q,en as r,v6 as s,Yr as t,Dl as u,P6 as v,b6 as w,ez as x,Ej as y,qo as z};
|