@dcl/explore-site 0.0.1-24138829632.commit-0946e16 → 0.0.1-24139497769.commit-1069c81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/assets/{HomePage-CbNrtXMa.js → HomePage-CP3D4i9c.js} +3 -3
  2. package/assets/{QueryClientProvider-DUSjZ_J_.js → QueryClientProvider-wu2IqrXs.js} +1 -1
  3. package/assets/{SensorsRounded-Ci-z6t1A.js → SensorsRounded-WVFgO4_x.js} +1 -1
  4. package/assets/{__federation_expose_App-BckrSixU.js → __federation_expose_App-MOR1BmrN.js} +1 -1
  5. package/assets/{__federation_fn_import-WDa0gv1I.js → __federation_fn_import-DHP1HS9A.js} +1 -1
  6. package/assets/__federation_shared_@dcl/{hooks-BmGk-LAU.js → hooks-B6YLUjAN.js} +3 -3
  7. package/assets/__federation_shared_@emotion/react-BJqnrTYH.js +1 -0
  8. package/assets/__federation_shared_@emotion/{styled-YrTPT9q1.js → styled-DJxepagK.js} +1 -1
  9. package/assets/{__federation_shared_decentraland-ui2-D5N7yacO.js → __federation_shared_decentraland-ui2-ZuMMDuwr.js} +4 -4
  10. package/assets/{__federation_shared_react-redux-DMak3BVq.js → __federation_shared_react-redux-wunxthN_.js} +1 -1
  11. package/assets/{__federation_shared_react-router-dom-CSW28ZSI.js → __federation_shared_react-router-dom-W4djHvIn.js} +1 -1
  12. package/assets/{__federation_shared_viem-DsDw7lUr.js → __federation_shared_viem-DarmY_kb.js} +1 -1
  13. package/assets/{__federation_shared_wagmi-h3zhLZbR.js → __federation_shared_wagmi-DWvj6H_x.js} +1 -1
  14. package/assets/{add-Ccyt7YRh.js → add-BCakEKbt.js} +1 -1
  15. package/assets/{all-wallets-BIOtzF11.js → all-wallets-CXkjwEqF.js} +1 -1
  16. package/assets/{app-store-BqACXnTM.js → app-store-BFVxlsNN.js} +1 -1
  17. package/assets/{apple-zIEkvR7h.js → apple-DXjZC7E3.js} +1 -1
  18. package/assets/{arrow-bottom-circle-BjCA11Rn.js → arrow-bottom-circle-DFJJmWcQ.js} +1 -1
  19. package/assets/{arrow-bottom-CxQ54WH1.js → arrow-bottom-pJS57nib.js} +1 -1
  20. package/assets/{arrow-left-CsFQBdFD.js → arrow-left-Cynzu9ZW.js} +1 -1
  21. package/assets/{arrow-right-jT5LSgqq.js → arrow-right-CGX20nmV.js} +1 -1
  22. package/assets/{arrow-top-CA_1oaHw.js → arrow-top-jzt266yO.js} +1 -1
  23. package/assets/{auto-track-UOggKKzv.js → auto-track-O_BrBwhe.js} +1 -1
  24. package/assets/{bank-81NjtLlm.js → bank-BMGgPrPK.js} +1 -1
  25. package/assets/{basic-CvR9b359.js → basic-CM6UVWAr.js} +1 -1
  26. package/assets/{browser-BjIqaPVu.js → browser-DnoUbi8M.js} +1 -1
  27. package/assets/{card-BJomEEgV.js → card-CPfzdBrQ.js} +1 -1
  28. package/assets/{ccip-DotuofV0.js → ccip-BIrr4QNJ.js} +1 -1
  29. package/assets/{checkmark-Cz0VZAkr.js → checkmark-8BBVS9mV.js} +1 -1
  30. package/assets/{checkmark-bold-blkVLUov.js → checkmark-bold-B-hOv8nD.js} +1 -1
  31. package/assets/{chevron-bottom-ClawczSo.js → chevron-bottom-B_y3oaup.js} +1 -1
  32. package/assets/{chevron-left-DfJ9r4mv.js → chevron-left-CjhHB4PY.js} +1 -1
  33. package/assets/{chevron-right-CrxmyW0K.js → chevron-right-DSPiRdQp.js} +1 -1
  34. package/assets/{chevron-top-BVIfb-H3.js → chevron-top-DzuxMZzU.js} +1 -1
  35. package/assets/{chrome-store-Cb5xVI0B.js → chrome-store-BxqIkfMp.js} +1 -1
  36. package/assets/{clock-Bx-Kyhh-.js → clock-DANY2jZR.js} +1 -1
  37. package/assets/{close-DOjpWTZi.js → close-CQGRZC4E.js} +1 -1
  38. package/assets/{coinPlaceholder-BqONZM6Q.js → coinPlaceholder-Bj_cgZAp.js} +1 -1
  39. package/assets/{compass-ByyIpxD6.js → compass-C6LtdRSt.js} +1 -1
  40. package/assets/{copy-BOu2-Xgv.js → copy-DcH6gZ_z.js} +1 -1
  41. package/assets/{core-BGxUaCGc.js → core-CzvI5AHq.js} +3 -3
  42. package/assets/{createClient-CSnZgvsb.js → createClient-CCWiffBP.js} +1 -1
  43. package/assets/{cursor-BqYz2L6D.js → cursor-UwkCsJ2a.js} +1 -1
  44. package/assets/{cursor-transparent-CWCRGDtx.js → cursor-transparent-BwBcOE8i.js} +1 -1
  45. package/assets/{desktop-Cd_vx0kT.js → desktop-D-Y36QoS.js} +1 -1
  46. package/assets/{disconnect-D5AICJhj.js → disconnect-Rv8z66NN.js} +1 -1
  47. package/assets/{discord-26Vqbq7c.js → discord-CCWSVMiz.js} +1 -1
  48. package/assets/{emotion-react.browser.esm-5OnyV0Sh.js → emotion-react.browser.esm-CVN2FXZ4.js} +1 -1
  49. package/assets/{emotion-use-insertion-effect-with-fallbacks.browser.esm-B75LdcJS.js → emotion-use-insertion-effect-with-fallbacks.browser.esm-CmaUBdeL.js} +1 -1
  50. package/assets/{etherscan--DKVcYrP.js → etherscan-DbjOsyUL.js} +1 -1
  51. package/assets/{exclamation-triangle-DOsYf3fQ.js → exclamation-triangle-CpUr7g91.js} +1 -1
  52. package/assets/{extension-DEaO3Zvk.js → extension-BfEjbpkB.js} +1 -1
  53. package/assets/{external-link-DcpG6wpM.js → external-link-DkrVV6h_.js} +1 -1
  54. package/assets/{facebook-ByV0OclL.js → facebook-C_vFokNe.js} +1 -1
  55. package/assets/{farcaster-DI6fsEyh.js → farcaster-N_SOvjsu.js} +1 -1
  56. package/assets/{filters-Djn1aDVs.js → filters-CriWZ1X8.js} +1 -1
  57. package/assets/{github-B3p0LLP5.js → github-Pf6KfVkt.js} +1 -1
  58. package/assets/{google-ae7qga4R.js → google-CX5egUeg.js} +1 -1
  59. package/assets/{help-circle-BmzUA_Be.js → help-circle-Bg9wySiB.js} +1 -1
  60. package/assets/{id-2hYEZqNH.js → id-CT3sHstQ.js} +1 -1
  61. package/assets/{image-mDqi4ffo.js → image-BeRTCwCL.js} +1 -1
  62. package/assets/{index-BzXoRVC1.js → index-BJlYfD1T.js} +1 -1
  63. package/assets/{index-D_fJMF1A.js → index-BwGE7VFa.js} +1 -1
  64. package/assets/{index-DGVKdsht.js → index-C5uwZBLu.js} +1 -1
  65. package/assets/{index-9zCVakoE.js → index-CEXIX8YP.js} +1 -1
  66. package/assets/{index-OQ3TYt4p.js → index-DOSLaa4d.js} +1 -1
  67. package/assets/{index-BKLT1eit.js → index-DSdP4T4T.js} +1 -1
  68. package/assets/index-Dy0yjznp.js +1 -1
  69. package/assets/{index-Ctl4brHr.js → index-NxahoDGS.js} +2 -2
  70. package/assets/index-VfkM29PH.js +1 -1
  71. package/assets/{index-CdOcIHYV.js → index-kumR_dwu.js} +3 -3
  72. package/assets/{index.es-D_4_VpXc.js → index.es-3vuqm7DP.js} +3 -3
  73. package/assets/{info-Bhf5PLdi.js → info-CqJ_nQxF.js} +1 -1
  74. package/assets/{info-circle-CZ5iih32.js → info-circle-IwWDU6qu.js} +1 -1
  75. package/assets/jsx-runtime-B1l0k91v.js +1 -1
  76. package/assets/{lightbulb-CA3e26a0.js → lightbulb-DTyI7zwy.js} +1 -1
  77. package/assets/{localBatchGatewayRequest-vExM5jac.js → localBatchGatewayRequest-CVa1PSOH.js} +1 -1
  78. package/assets/{mail-BktjMbEk.js → mail-CoON8_yY.js} +1 -1
  79. package/assets/{mobile-zfEM0JzU.js → mobile-hiVL2smK.js} +1 -1
  80. package/assets/{more-Dg45xuT9.js → more-CEWjr51n.js} +1 -1
  81. package/assets/{network-placeholder-duQhExzj.js → network-placeholder-B93dK-Wv.js} +1 -1
  82. package/assets/{nftPlaceholder-C3kMYu-p.js → nftPlaceholder-Cv1W78Cm.js} +1 -1
  83. package/assets/{off-Cz636L92.js → off-CfBcNJQq.js} +1 -1
  84. package/assets/{play-store-Cch0eiCp.js → play-store-baeJ6QUq.js} +1 -1
  85. package/assets/{plus-orAhHwVf.js → plus-Cm_DeSMx.js} +1 -1
  86. package/assets/{preload-helper-BrYcp76J.js → preload-helper-CIxxV7Wp.js} +1 -1
  87. package/assets/{qr-code-7plug-hj.js → qr-code-BgEAZWNl.js} +1 -1
  88. package/assets/{recycle-horizontal-B6ivY9Sz.js → recycle-horizontal-JBLMwMyk.js} +1 -1
  89. package/assets/{refresh-CqfvjhXq.js → refresh-D8wfv--n.js} +1 -1
  90. package/assets/remoteEntry.js +1 -1
  91. package/assets/{reown-logo-DGoAljI9.js → reown-logo-DMTh3d1z.js} +1 -1
  92. package/assets/{search-nNK2K8mD.js → search-BTDiU-Z-.js} +1 -1
  93. package/assets/{secp256k1-D6s48BOl.js → secp256k1-D3oIaUVU.js} +1 -1
  94. package/assets/{send-BPz2SBvc.js → send-CnQaiEuX.js} +1 -1
  95. package/assets/{swapHorizontal-TvVHlgjl.js → swapHorizontal-Dv0Bg9L0.js} +1 -1
  96. package/assets/{swapHorizontalBold-BTw_LG1-.js → swapHorizontalBold-CQPcpjgH.js} +1 -1
  97. package/assets/{swapHorizontalMedium-C3jJnFs_.js → swapHorizontalMedium-DV4uRJLw.js} +1 -1
  98. package/assets/{swapHorizontalRoundedBold-nTFwdVeT.js → swapHorizontalRoundedBold-Dx468EVm.js} +1 -1
  99. package/assets/{swapVertical-CHKvPR_7.js → swapVertical-LooYJDwN.js} +1 -1
  100. package/assets/{telegram-C552IoSr.js → telegram-JgoU7_hj.js} +1 -1
  101. package/assets/{three-dots-Nyfa4nYF.js → three-dots-BRI9-Dly.js} +1 -1
  102. package/assets/{twitch-7SJKGXSa.js → twitch-D4ap364K.js} +1 -1
  103. package/assets/{twitterIcon-BBg9ypIU.js → twitterIcon-Cf2xFTkU.js} +1 -1
  104. package/assets/{uid-CX4a_w4r.js → uid-CuZf7FK0.js} +3 -3
  105. package/assets/{verify-filled-BAdDAZxZ.js → verify-filled-BT2Xhbin.js} +1 -1
  106. package/assets/{verify-BwQ9FKM1.js → verify-qGEcCbo_.js} +1 -1
  107. package/assets/{w3m-modal-BqXXR9rX.js → w3m-modal-73pLXDms.js} +1 -1
  108. package/assets/{wallet-DJsa1d3M.js → wallet-CpcVYmnb.js} +1 -1
  109. package/assets/{wallet-placeholder-DPIkQ5vM.js → wallet-placeholder-CEkTf9LX.js} +1 -1
  110. package/assets/{walletconnect-osdnzzVU.js → walletconnect-BSErawNo.js} +1 -1
  111. package/assets/{warning-circle-BQ9uHGTL.js → warning-circle-BOABXvvE.js} +1 -1
  112. package/assets/{webSocket-CIn5Ftst.js → webSocket-BvPqYrD7.js} +1 -1
  113. package/assets/{x-5oycQ-0v.js → x-BRQsrMF4.js} +1 -1
  114. package/index.html +14 -14
  115. package/package.json +3 -3
  116. package/assets/__federation_shared_@emotion/react-oi_M7gMJ.js +0 -1
@@ -1,3 +1,3 @@
1
- const __vite__fileDeps=["assets/index-CVdhIPEJ.js","assets/index-CNMKbeE1.js","assets/index-CGCGB-at.js","assets/index-OQ3TYt4p.js","assets/__federation_fn_import-WDa0gv1I.js","assets/hooks.module-Dz_XB4AG.js","assets/index-CdrMQoR6.js","assets/_commonjsHelpers-C4iS2aBk.js","assets/createClient-CSnZgvsb.js","assets/uid-CX4a_w4r.js","assets/preload-helper-BrYcp76J.js","assets/index-nibyPLVP.js","assets/index-D6O4pjzC.js","assets/___vite-browser-external_commonjs-proxy-BqV5D26a.js","assets/inherits_browser-BlmhoU4v.js","assets/index-JFBsW0Hp.js","assets/tslib.es6-DbvBTznf.js","assets/index.es-D_4_VpXc.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
- import{importShared as N}from"./__federation_fn_import-WDa0gv1I.js";import{j as H}from"./jsx-runtime-B1l0k91v.js";import{c as mr,E as at,r as $n,i as Fn,d as yr}from"./SensorsRounded-Ci-z6t1A.js";import{w as Yt,e as vr,g as Jt,b as wr,h as Wn,i as br,o as Sr,d as Er}from"./reselect-BfUrOuXx.js";import{d as Xe}from"./defineChain-7I0Ce1VT.js";import{_ as Te}from"./preload-helper-BrYcp76J.js";import{c as Mt,C as Ot,P as Xt,i as Cr,S as Hn,M as _r,n as Y,m as Zt,a as re,h as Bn,Q as Ir,b as en,f as Pr,o as tn,r as nn,d as Ar,e as rn,g as sn,p as an,s as Rr,j as Tr}from"./QueryClientProvider-DUSjZ_J_.js";import{c as Le}from"./_commonjsHelpers-C4iS2aBk.js";const Mr=Xe({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Or=Xe({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Dr=Xe({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),xr=Xe({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0});await N("@dcl/schemas");const kr=[Mr,Or],Lr=[xr,Dr],Dt=[...kr,...Lr];function Nr(e){return Dt.some(t=>t.id===e)}const{createConnector:qr}=await N("wagmi"),{ChainId:Ae}=await N("@dcl/schemas"),on={[Ae.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet?project=magic",[Ae.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia?project=magic",[Ae.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon?project=magic",[Ae.MATIC_AMOY]:"https://rpc.decentraland.org/amoy?project=magic"};function Do(e){const{apiKey:t}=e;let n=null,r=null;async function i(o){const{Magic:u}=await Te(async()=>{const{Magic:a}=await import("./index-CVdhIPEJ.js");return{Magic:a}},__vite__mapDeps([0,1])),{OAuthExtension:l}=await Te(async()=>{const{OAuthExtension:a}=await import("./index-CGCGB-at.js");return{OAuthExtension:a}},__vite__mapDeps([2,1])),c=on[o]||on[Ae.ETHEREUM_MAINNET];return new u(t,{extensions:[new l],network:{rpcUrl:c,chainId:o}})}return qr(o=>{async function u(){return r?await r.request({method:"eth_accounts"}):[]}async function l(c){r=await n.wallet.getProvider();const a=await u();return a.length===0?null:(await o.storage?.setItem("magicChainId",c),{accounts:a,chainId:c})}return{id:"magic",name:"Magic",type:"magic",async setup(){const a=await o.storage?.getItem("magicChainId")??o.chains[0]?.id;if(a)try{if(n=await i(a),await n.user.isLoggedIn()){const y=await l(a);y&&o.emitter.emit("connect",y)}}catch{}},async connect({chainId:c}={}){const a=c??o.chains[0].id;if(n||(n=await i(a)),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in. Please authenticate via the auth dapp first.");const y=await l(a);if(!y)throw new Error("Magic: No accounts found");return y},async disconnect(){n&&await n.user.logout(),n=null,r=null,await o.storage?.removeItem("magicChainId")},async getAccounts(){return u()},async getChainId(){return await o.storage?.getItem("magicChainId")??o.chains[0].id},async getProvider(){return!r&&n&&(r=await n.wallet.getProvider()),r},async isAuthorized(){try{if(!n){const a=await o.storage?.getItem("magicChainId")??o.chains[0]?.id;if(!a)return!1;n=await i(a)}return await n.user.isLoggedIn()}catch{return!1}},async switchChain({chainId:c}){const a=o.chains.find(y=>y.id===c);if(!a)throw new Error(`Chain ${c} not configured`);if(n=await i(c),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in");return r=await n.wallet.getProvider(),await o.storage?.setItem("magicChainId",c),o.emitter.emit("change",{chainId:c}),a},onAccountsChanged(c){c.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:c})},onChainChanged(c){const a=Number(c);o.emitter.emit("change",{chainId:a})},onDisconnect(){o.emitter.emit("disconnect"),n=null,r=null}}})}await N("wagmi");await N("@dcl/schemas");function Ur(e){const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const r=e.transports?.[t.id]?.({chain:t});return(r?.value?.transports||[r]).map(({value:o})=>o?.url||n)}const{getAddress:we,numberToHex:He,SwitchChainError:Be,UserRejectedRequestError:be}=await N("viem");Ze.type="coinbaseWallet";function Ze(e={}){return e.version==="3"||e.headlessMode?jr(e):Qr(e)}function Qr(e){let t,n,r,i;return Mt(o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Ze.type,async connect({chainId:u,withCapabilities:l,...c}={}){try{const a=await this.getProvider(),I=(await a.request({method:"eth_requestAccounts",params:"instantOnboarding"in c&&c.instantOnboarding?[{onboarding:"instant"}]:[]})).map(p=>we(p));n||(n=this.onAccountsChanged.bind(this),a.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),a.on("chainChanged",r)),i||(i=this.onDisconnect.bind(this),a.on("disconnect",i));let y=await this.getChainId();return u&&y!==u&&(y=(await this.switchChain({chainId:u}).catch(m=>{if(m.code===be.code)throw m;return{id:y}}))?.id??y),{accounts:l?I.map(p=>({address:p,capabilities:{}})):I,chainId:y}}catch(a){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(a.message)?new be(a):a}},async disconnect(){const u=await this.getProvider();n&&(u.removeListener("accountsChanged",n),n=void 0),r&&(u.removeListener("chainChanged",r),r=void 0),i&&(u.removeListener("disconnect",i),i=void 0),u.disconnect(),u.close?.()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>we(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){if(!t){const u=typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:e.preference?.options??"all"},{createCoinbaseWalletSDK:l}=await Te(async()=>{const{createCoinbaseWalletSDK:a}=await import("./index-OQ3TYt4p.js");return{createCoinbaseWalletSDK:a}},__vite__mapDeps([3,4,5,6,7,8,9,10,11]));t=l({...e,appChainIds:o.chains.map(a=>a.id),preference:u}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:l}){const c=o.chains.find(I=>I.id===l);if(!c)throw new Be(new Ot);const a=await this.getProvider();try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:He(c.id)}]}),c}catch(I){if(I.code===4902)try{let y;u?.blockExplorerUrls?y=u.blockExplorerUrls:y=c.blockExplorers?.default.url?[c.blockExplorers?.default.url]:[];let p;u?.rpcUrls?.length?p=u.rpcUrls:p=[c.rpcUrls.default?.http[0]??""];const m={blockExplorerUrls:y,chainId:He(l),chainName:u?.chainName??c.name,iconUrls:u?.iconUrls,nativeCurrency:u?.nativeCurrency??c.nativeCurrency,rpcUrls:p};return await a.request({method:"wallet_addEthereumChain",params:[m]}),c}catch(y){throw new be(y)}throw new Be(I)}},onAccountsChanged(u){u.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:u.map(l=>we(l))})},onChainChanged(u){const l=Number(u);o.emitter.emit("change",{chainId:l})},async onDisconnect(u){o.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),i&&(l.removeListener("disconnect",i),i=void 0)}}))}function jr(e){let n,r,i,o,u;return Mt(l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Ze.type,async connect({chainId:c,withCapabilities:a}={}){try{const I=await this.getProvider(),y=(await I.request({method:"eth_requestAccounts"})).map(m=>we(m));i||(i=this.onAccountsChanged.bind(this),I.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),I.on("chainChanged",o)),u||(u=this.onDisconnect.bind(this),I.on("disconnect",u));let p=await this.getChainId();return c&&p!==c&&(p=(await this.switchChain({chainId:c}).catch(M=>{if(M.code===be.code)throw M;return{id:p}}))?.id??p),{accounts:a?y.map(m=>({address:m,capabilities:{}})):y,chainId:p}}catch(I){throw/(user closed modal|accounts received is empty|user denied account)/i.test(I.message)?new be(I):I}},async disconnect(){const c=await this.getProvider();i&&(c.removeListener("accountsChanged",i),i=void 0),o&&(c.removeListener("chainChanged",o),o=void 0),u&&(c.removeListener("disconnect",u),u=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>we(a))},async getChainId(){const a=await(await this.getProvider()).request({method:"eth_chainId"});return Number(a)},async getProvider(){if(!r){const c=await(async()=>{const{default:m}=await Te(async()=>{const{default:M}=await import("./index-D6O4pjzC.js").then(A=>A.i);return{default:M}},__vite__mapDeps([12,7,13,6,14,15,5,16]));return typeof m!="function"&&typeof m.default=="function"?m.default:m})();n=new c({...e,reloadOnDisconnect:!1});const a=n.walletExtension?.getChainId(),I=l.chains.find(m=>e.chainId?m.id===e.chainId:m.id===a)||l.chains[0],y=e.chainId||I?.id,p=e.jsonRpcUrl||I?.rpcUrls.default.http[0];r=n.makeWeb3Provider(p,y)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:a}){const I=l.chains.find(p=>p.id===a);if(!I)throw new Be(new Ot);const y=await this.getProvider();try{return await y.request({method:"wallet_switchEthereumChain",params:[{chainId:He(I.id)}]}),I}catch(p){if(p.code===4902)try{let m;c?.blockExplorerUrls?m=c.blockExplorerUrls:m=I.blockExplorers?.default.url?[I.blockExplorers?.default.url]:[];let M;c?.rpcUrls?.length?M=c.rpcUrls:M=[I.rpcUrls.default?.http[0]??""];const A={blockExplorerUrls:m,chainId:He(a),chainName:c?.chainName??I.name,iconUrls:c?.iconUrls,nativeCurrency:c?.nativeCurrency??I.nativeCurrency,rpcUrls:M};return await y.request({method:"wallet_addEthereumChain",params:[A]}),I}catch(m){throw new be(m)}throw new Be(p)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(a=>we(a))})},onChainChanged(c){const a=Number(c);l.emitter.emit("change",{chainId:a})},async onDisconnect(c){l.emitter.emit("disconnect");const a=await this.getProvider();i&&(a.removeListener("accountsChanged",i),i=void 0),o&&(a.removeListener("chainChanged",o),o=void 0),u&&(a.removeListener("disconnect",u),u=void 0)}}))}const{getAddress:ot,numberToHex:cn,SwitchChainError:$r,UserRejectedRequestError:Ne}=await N("viem");xt.type="walletConnect";function xt(e){const t=e.isNewChainsStale??!0;let n,r;const i="eip155";let o,u,l,c,a,I;return Mt(y=>({id:"walletConnect",name:"WalletConnect",type:xt.type,async setup(){const p=await this.getProvider().catch(()=>null);p&&(l||(l=this.onConnect.bind(this),p.on("connect",l)),a||(a=this.onSessionDelete.bind(this),p.on("session_delete",a)))},async connect({chainId:p,withCapabilities:m,...M}={}){try{const A=await this.getProvider();if(!A)throw new Xt;c||(c=this.onDisplayUri,A.on("display_uri",c));let _=p;if(!_){const s=await y.storage?.getItem("state")??{};y.chains.some(S=>S.id===s.chainId)?_=s.chainId:_=y.chains[0]?.id}if(!_)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if(A.session&&P&&await A.disconnect(),!A.session||P){const s=y.chains.filter(v=>v.id!==_).map(v=>v.id);await A.connect({optionalChains:[_,...s],..."pairingTopic"in M?{pairingTopic:M.pairingTopic}:{}}),this.setRequestedChainsIds(y.chains.map(v=>v.id))}const w=(await A.enable()).map(s=>ot(s));let f=await this.getChainId();return p&&f!==p&&(f=(await this.switchChain({chainId:p}).catch(v=>{if(v.code===Ne.code&&v.cause?.message!=="Missing or invalid. request() method: wallet_addEthereumChain")throw v;return{id:f}}))?.id??f),c&&(A.removeListener("display_uri",c),c=void 0),l&&(A.removeListener("connect",l),l=void 0),o||(o=this.onAccountsChanged.bind(this),A.on("accountsChanged",o)),u||(u=this.onChainChanged.bind(this),A.on("chainChanged",u)),I||(I=this.onDisconnect.bind(this),A.on("disconnect",I)),a||(a=this.onSessionDelete.bind(this),A.on("session_delete",a)),{accounts:m?w.map(s=>({address:s,capabilities:{}})):w,chainId:f}}catch(A){throw/(user rejected|connection request reset)/i.test(A?.message)?new Ne(A):A}},async disconnect(){const p=await this.getProvider();try{await p?.disconnect()}catch(m){if(!/No matching key/i.test(m.message))throw m}finally{u&&(p?.removeListener("chainChanged",u),u=void 0),I&&(p?.removeListener("disconnect",I),I=void 0),l||(l=this.onConnect.bind(this),p?.on("connect",l)),o&&(p?.removeListener("accountsChanged",o),o=void 0),a&&(p?.removeListener("session_delete",a),a=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(m=>ot(m))},async getProvider({chainId:p}={}){async function m(){const M=y.chains.map(_=>_.id);if(!M.length)return;const{EthereumProvider:A}=await Te(async()=>{const{EthereumProvider:_}=await import("./index.es-D_4_VpXc.js").then(P=>P.G);return{EthereumProvider:_}},__vite__mapDeps([17,10,7,4,11]));return await A.init({...e,disableProviderPing:!0,optionalChains:M,projectId:e.projectId,rpcMap:Object.fromEntries(y.chains.map(_=>{const[P]=Ur({chain:_,transports:y.transports});return[_.id,P]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=m()),n=await r,n?.events.setMaxListeners(Number.POSITIVE_INFINITY)),p&&await this.switchChain?.({chainId:p}),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[p,m]=await Promise.all([this.getAccounts(),this.getProvider()]);return p.length?await this.isChainsStale()&&m.session?(await m.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:p,chainId:m}){const M=await this.getProvider();if(!M)throw new Xt;const A=y.chains.find(_=>_.id===m);if(!A)throw new $r(new Ot);try{await Promise.all([new Promise(P=>{const w=({chainId:f})=>{f===m&&(y.emitter.off("change",w),P())};y.emitter.on("change",w)}),M.request({method:"wallet_switchEthereumChain",params:[{chainId:cn(m)}]})]);const _=await this.getRequestedChainsIds();return this.setRequestedChainsIds([..._,m]),A}catch(_){const P=_;if(/(user rejected)/i.test(P.message))throw new Ne(P);try{let w;p?.blockExplorerUrls?w=p.blockExplorerUrls:w=A.blockExplorers?.default.url?[A.blockExplorers?.default.url]:[];let f;p?.rpcUrls?.length?f=p.rpcUrls:f=[...A.rpcUrls.default.http];const s={blockExplorerUrls:w,chainId:cn(m),chainName:p?.chainName??A.name,iconUrls:p?.iconUrls,nativeCurrency:p?.nativeCurrency??A.nativeCurrency,rpcUrls:f};await M.request({method:"wallet_addEthereumChain",params:[s]});const v=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...v,m]),A}catch(w){throw new Ne(w)}}},onAccountsChanged(p){p.length===0?this.onDisconnect():y.emitter.emit("change",{accounts:p.map(m=>ot(m))})},onChainChanged(p){const m=Number(p);y.emitter.emit("change",{chainId:m})},async onConnect(p){const m=Number(p.chainId),M=await this.getAccounts();y.emitter.emit("connect",{accounts:M,chainId:m})},async onDisconnect(p){this.setRequestedChainsIds([]),y.emitter.emit("disconnect");const m=await this.getProvider();o&&(m.removeListener("accountsChanged",o),o=void 0),u&&(m.removeListener("chainChanged",u),u=void 0),I&&(m.removeListener("disconnect",I),I=void 0),a&&(m.removeListener("session_delete",a),a=void 0),l||(l=this.onConnect.bind(this),m.on("connect",l))},onDisplayUri(p){y.emitter.emit("message",{type:"display_uri",data:p})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){return n?n.session?.namespaces[i]?.accounts?.map(m=>Number.parseInt(m.split(":")[1]||"",10))??[]:[]},async getRequestedChainsIds(){return await y.storage?.getItem(this.requestedChainsStorageKey)??[]},async isChainsStale(){if(!t)return!1;const p=y.chains.map(A=>A.id),m=this.getNamespaceChainsIds();if(m.length&&!m.some(A=>p.includes(A)))return!1;const M=await this.getRequestedChainsIds();return!p.every(A=>M.includes(A))},async setRequestedChainsIds(p){await y.storage?.setItem(this.requestedChainsStorageKey,p)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}const{createConfig:Fr,http:vt}=await N("wagmi"),{ChainId:qe}=await N("@dcl/schemas"),ge={name:"Decentraland",description:"Decentraland dApp",url:"https://decentraland.org",icons:["https://cdn.decentraland.org/@dcl/marketplace-site/6.41.1/favicon.ico"]},Wr={[qe.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[qe.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[qe.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[qe.MATIC_AMOY]:"https://rpc.decentraland.org/amoy"},Hr=Dt.reduce((e,t)=>{const n=Wr[t.id];return e[t.id]=n?vt(n):vt(),e},{});function Br(e,t){const n=t.trim();if(!n)return e;const r=e.replace(/\/+$/,""),i=n.startsWith("/")?n:`/${n}`;return`${r}${i}`}function zr(e){if(!e)return ge;const t=e.url??(e.urlPath?Br(ge.url,e.urlPath):ge.url);return{name:e.name??ge.name,description:e.description??ge.description,url:t,icons:e.icons??ge.icons}}function xo(e={}){const{walletConnectProjectId:t,appMetadata:n,chains:r=Dt,transports:i,connectors:o={},additionalConnectors:u=[]}=e,l=zr(n),{injected:c=!0,walletConnect:a=!0,coinbaseWallet:I=!0}=o,y=r.reduce((m,M)=>(m[M.id]=i?.[M.id]??Hr[M.id]??vt(),m),{}),p=[];return c&&p.push(Cr()),a&&t&&p.push(xt({projectId:t,metadata:{name:l.name,description:l.description??"",url:l.url??"",icons:l.icons??[]}})),I&&p.push(Ze({appName:l.name})),p.push(...u),Fr({chains:r,transports:y,connectors:p})}function Gr(){if(typeof window>"u"||!window.localStorage)return;const e=[],{localStorage:t}=window;for(let n=0;n<t.length;n++){const r=t.key(n);r?.startsWith("wagmi.")&&e.push(r)}e.forEach(n=>t.removeItem(n))}await N("react");await N("react-redux");await N("wagmi");const xe=e=>e.wallet,Kr=e=>xe(e).address,Vr=e=>xe(e).isConnected,Yr=e=>xe(e).isConnecting,Jr=e=>xe(e).isDisconnecting,Xr=e=>xe(e).error;await N("react-redux");await N("wagmi");const{useCallback:un}=await N("react"),{useSelector:Ee}=await N("react-redux"),{useConnect:Zr,useDisconnect:ei}=await N("wagmi");function zn(){const e=Ee(Kr),t=Ee(Vr),n=Ee(Yr),r=Ee(Jr),i=Ee(Xr),{connect:o,connectors:u,isPending:l}=Zr(),{disconnect:c,isPending:a}=ei(),I=un(p=>{o({connector:p})},[o]),y=un(()=>{c()},[c]);return{address:e,isConnected:t,isConnecting:n||l,isDisconnecting:r||a,error:i,connectors:u,connect:I,disconnect:y}}var ti=class extends Hn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new _r({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ue(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ue(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ue(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ue(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Y.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Zt(t,n))}findAll(e={}){return this.getAll().filter(t=>Zt(e,t))}notify(e){Y.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Y.batch(()=>Promise.all(e.map(t=>t.continue().catch(re))))}};function Ue(e){return e.options.scope?.id}var ni=class extends Hn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Bn(r,t);let o=this.get(i);return o||(o=new Ir({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Y.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>en(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>en(e,n)):t}notify(e){Y.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Y.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Y.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ri=class{#e;#t;#n;#i;#s;#r;#a;#o;constructor(e={}){this.#e=e.queryCache||new ni,this.#t=e.mutationCache||new ti,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=Pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,u=Ar(t,o);if(u!==void 0)return this.#e.build(this,r).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Y.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Y.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Y.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Y.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(re).catch(re)}invalidateQueries(e,t={}){return Y.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Y.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(re)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(re)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(re).catch(re)}fetchInfiniteQuery(e){return e.behavior=rn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(re).catch(re)}ensureInfiniteQueryData(e){return e.behavior=rn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(sn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{an(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(sn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{an(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bn(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===Rr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const{useMemo:ii}=await N("react"),{WagmiProvider:si}=await N("wagmi");function ai(){return new ri({defaultOptions:{queries:{staleTime:1e3*60,retry:1}}})}function ko({config:e,queryClient:t,children:n}){const r=ii(()=>t??ai(),[t]);return H.jsx(si,{config:e,children:H.jsx(Tr,{client:r,children:n})})}const{createSlice:oi}=await N("@reduxjs/toolkit"),ln={chainId:null,isSupportedNetwork:!1,isNetworkSwitching:!1,error:null},ci=oi({name:"network",initialState:ln,reducers:{setChain(e,t){e.chainId=t.payload,e.isSupportedNetwork=t.payload!==null&&Nr(t.payload),e.isNetworkSwitching=!1,e.error=null},setSwitching(e,t){e.isNetworkSwitching=t.payload,t.payload&&(e.error=null)},setError(e,t){e.error=t.payload,e.isNetworkSwitching=!1},reset(){return ln}}}),{actions:ui,reducer:li}=ci,{createSlice:di}=await N("@reduxjs/toolkit"),dn={address:null,isConnected:!1,isConnecting:!1,isDisconnecting:!1,error:null},fi=di({name:"wallet",initialState:dn,reducers:{setAccount(e,t){e.address=t.payload,e.isConnected=t.payload!==null,e.isConnecting=!1,e.error=null},setConnecting(e,t){e.isConnecting=t.payload,t.payload&&(e.error=null)},setDisconnecting(e,t){e.isDisconnecting=t.payload},setError(e,t){e.error=t.payload,e.isConnecting=!1,e.isDisconnecting=!1},reset(){return dn}}}),{actions:ct,reducer:hi}=fi,{useEffect:Qe}=await N("react"),{useDispatch:pi}=await N("react-redux"),{useAccount:gi,useChainId:mi}=await N("wagmi");function Lo({children:e}){const t=pi(),{address:n,isConnecting:r,isConnected:i,isReconnecting:o}=gi(),u=mi();return Qe(()=>{t(ct.setAccount(n??null))},[t,n]),Qe(()=>{t(ct.setConnecting(r||o))},[t,r,o]),Qe(()=>{i||t(ct.reset())},[t,i]),Qe(()=>{t(ui.setChain(i?u:null))},[t,u,i]),H.jsx(H.Fragment,{children:e})}const{createSlice:yi}=await N("@reduxjs/toolkit"),fn={transactions:{},pending:[]},vi=yi({name:"transactions",initialState:fn,reducers:{addTransaction(e,t){const n=t.payload;e.transactions[n.hash]=n,n.status==="pending"&&!e.pending.includes(n.hash)&&e.pending.push(n.hash)},updateTransaction(e,t){const{hash:n,status:r,error:i}=t.payload,o=e.transactions[n];o&&(o.status=r,o.error=i,r!=="pending"&&(e.pending=e.pending.filter(u=>u!==n)))},removeTransaction(e,t){const n=t.payload;delete e.transactions[n],e.pending=e.pending.filter(r=>r!==n)},reset(){return fn}}}),{actions:No,reducer:wi}=vi;var bi=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},Gn=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Gn||{});function hn(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}const{createAction:Se,createSlice:me,createSelector:Si,createAsyncThunk:pn,combineReducers:Ei,createNextState:kt,isAnyOf:ze,isAllOf:ut,isAction:Ci,isPending:Kn,isRejected:Lt,isFulfilled:fe,isRejectedWithValue:Nt,isAsyncThunkAction:gn,prepareAutoBatched:Ce,SHOULD_AUTOBATCH:Vn,isPlainObject:Me,nanoid:Yn}=await N("@reduxjs/toolkit");var mn=Me;function qt(e,t){if(e===t||!(mn(e)&&mn(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const u of n)o[u]=qt(e[u],t[u]),i&&(i=e[u]===o[u]);return i?e:o}var yn=e=>[].concat(...e);function _i(e){return new RegExp("(^|:)//").test(e)}function Ii(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Ut(e){return e!=null}function vn(e){return[...e?.values()??[]].filter(Ut)}function Pi(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Ai=e=>e.replace(/\/$/,""),Ri=e=>e.replace(/^\//,"");function Ti(e,t){if(!e)return t;if(!t)return e;if(_i(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Ai(e),t=Ri(t),`${e}${n}${t}`}function Ge(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var wt=()=>new Map,wn=(...e)=>fetch(...e),Mi=e=>e.status>=200&&e.status<=299,Oi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function bn(e){if(!Me(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Di=e=>typeof e=="object"&&(Me(e)||Array.isArray(e)||typeof e.toJSON=="function");function xi({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:n=wn,paramsSerializer:r,isJsonContentType:i=Oi,jsonContentType:o="application/json",jsonReplacer:u,timeout:l,responseHandler:c,validateStatus:a,...I}={}){return typeof fetch>"u"&&n===wn&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(p,m,M)=>{const{getState:A,extra:_,endpoint:P,forced:w,type:f}=m;let s,{url:v,headers:S=new Headers(I.headers),params:b=void 0,responseHandler:R=c??"json",validateStatus:C=a??Mi,timeout:h=l,...d}=typeof p=="string"?{url:p}:p,g,E=m.signal;h&&(g=new AbortController,m.signal.addEventListener("abort",g.abort),E=g.signal);let T={...I,signal:E,...d};S=new Headers(bn(S)),T.headers=await t(S,{getState:A,arg:p,extra:_,endpoint:P,forced:w,type:f,extraOptions:M})||S;const O=Di(T.body);if(T.body!=null&&!O&&typeof T.body!="string"&&T.headers.delete("content-type"),!T.headers.has("content-type")&&O&&T.headers.set("content-type",o),O&&i(T.headers)&&(T.body=JSON.stringify(T.body,u)),T.headers.has("accept")||(R==="json"?T.headers.set("accept","application/json"):R==="text"&&T.headers.set("accept","text/plain, text/html, */*")),b){const F=~v.indexOf("?")?"&":"?",Q=r?r(b):new URLSearchParams(bn(b));v+=F+Q}v=Ti(e,v);const D=new Request(v,T);s={request:new Request(v,T)};let k,x=!1,q=g&&setTimeout(()=>{x=!0,g.abort()},h);try{k=await n(D)}catch(F){return{error:{status:x?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(F)},meta:s}}finally{q&&clearTimeout(q),g?.signal.removeEventListener("abort",g.abort)}const $=k.clone();s.response=$;let z,W="";try{let F;if(await Promise.all([y(k,R).then(Q=>z=Q,Q=>F=Q),$.text().then(Q=>W=Q,()=>{})]),F)throw F}catch(F){return{error:{status:"PARSING_ERROR",originalStatus:k.status,data:W,error:String(F)},meta:s}}return C(k,z)?{data:z,meta:s}:{error:{status:k.status,data:z},meta:s}};async function y(p,m){if(typeof m=="function")return m(p);if(m==="content-type"&&(m=i(p.headers)?"json":"text"),m==="json"){const M=await p.text();return M.length?JSON.parse(M):null}return p.text()}}var Sn=class{constructor(e,t=void 0){this.value=e,this.meta=t}},et=Se("__rtkq/focused"),Qt=Se("__rtkq/unfocused"),tt=Se("__rtkq/online"),jt=Se("__rtkq/offline"),lt=!1;function ki(e,t){function n(){const r=()=>e(et()),i=()=>e(Qt()),o=()=>e(tt()),u=()=>e(jt()),l=()=>{window.document.visibilityState==="visible"?r():i()};return lt||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",l,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",o,!1),window.addEventListener("offline",u,!1),lt=!0),()=>{window.removeEventListener("focus",r),window.removeEventListener("visibilitychange",l),window.removeEventListener("online",o),window.removeEventListener("offline",u),lt=!1}}return n()}function nt(e){return e.type==="query"}function Li(e){return e.type==="mutation"}function rt(e){return e.type==="infinitequery"}function Ke(e){return nt(e)||rt(e)}function $t(e,t,n,r,i,o){return Ni(e)?e(t,n,r,i).filter(Ut).map(bt).map(o):Array.isArray(e)?e.map(bt).map(o):[]}function Ni(e){return typeof e=="function"}function bt(e){return typeof e=="string"?{type:e}:e}await N("@reduxjs/toolkit");function qi(e,t){return e.catch(t)}var Oe=Symbol("forceQueryFn"),St=e=>typeof e[Oe]=="function";function Ui({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:o,getInternalState:u}){const l=s=>u(s)?.runningQueries,c=s=>u(s)?.runningMutations,{unsubscribeQueryResult:a,removeMutationResult:I,updateSubscriptionOptions:y}=i.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:w,buildInitiateMutation:f,getRunningQueryThunk:p,getRunningMutationThunk:m,getRunningQueriesThunk:M,getRunningMutationsThunk:A};function p(s,v){return S=>{const b=o.endpointDefinitions[s],R=e({queryArgs:v,endpointDefinition:b,endpointName:s});return l(S)?.get(R)}}function m(s,v){return S=>c(S)?.get(v)}function M(){return s=>vn(l(s))}function A(){return s=>vn(c(s))}function _(s,v){const S=(b,{subscribe:R=!0,forceRefetch:C,subscriptionOptions:h,[Oe]:d,...g}={})=>(E,T)=>{const O=e({queryArgs:b,endpointDefinition:v,endpointName:s});let D;const L={...g,type:"query",subscribe:R,forceRefetch:C,subscriptionOptions:h,endpointName:s,originalArgs:b,queryCacheKey:O,[Oe]:d};if(nt(v))D=t(L);else{const{direction:U,initialPageParam:j}=g;D=n({...L,direction:U,initialPageParam:j})}const k=i.endpoints[s].select(b),x=E(D),q=k(T()),{requestId:$,abort:z}=x,W=q.requestId!==$,F=l(E)?.get(O),Q=()=>k(T()),K=Object.assign(d?x.then(Q):W&&!F?Promise.resolve(q):Promise.all([F,x]).then(Q),{arg:b,requestId:$,subscriptionOptions:h,queryCacheKey:O,abort:z,async unwrap(){const U=await K;if(U.isError)throw U.error;return U.data},refetch:()=>E(S(b,{subscribe:!1,forceRefetch:!0})),unsubscribe(){R&&E(a({queryCacheKey:O,requestId:$}))},updateSubscriptionOptions(U){K.subscriptionOptions=U,E(y({endpointName:s,requestId:$,queryCacheKey:O,options:U}))}});if(!F&&!W&&!d){const U=l(E);U.set(O,K),K.then(()=>{U.delete(O)})}return K};return S}function P(s,v){return _(s,v)}function w(s,v){return _(s,v)}function f(s){return(v,{track:S=!0,fixedCacheKey:b}={})=>(R,C)=>{const h=r({type:"mutation",endpointName:s,originalArgs:v,track:S,fixedCacheKey:b}),d=R(h),{requestId:g,abort:E,unwrap:T}=d,O=qi(d.unwrap().then(x=>({data:x})),x=>({error:x})),D=()=>{R(I({requestId:g,fixedCacheKey:b}))},L=Object.assign(O,{arg:d.arg,requestId:g,abort:E,unwrap:T,reset:D}),k=c(R);return k.set(g,L),L.then(()=>{k.delete(g)}),b&&(k.set(b,L),L.then(()=>{k.get(b)===L&&k.delete(b)})),L}}}var Jn=class extends bi{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}},ce=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function ue(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new Jn(i.issues,t,n,r);return i.value}function En(e){return e}var _e=(e={})=>({...e,[Vn]:!0});function Qi({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:o,selectors:u,onSchemaFailure:l,catchSchemaFailure:c,skipSchemaValidation:a}){const I=(d,g,E,T)=>(O,D)=>{const L=n[d],k=r({queryArgs:g,endpointDefinition:L,endpointName:d});if(O(i.internalActions.queryResultPatched({queryCacheKey:k,patches:E})),!T)return;const x=i.endpoints[d].select(g)(D()),q=$t(L.providesTags,x.data,void 0,g,{},o);O(i.internalActions.updateProvidedBy([{queryCacheKey:k,providedTags:q}]))};function y(d,g,E=0){const T=[g,...d];return E&&T.length>E?T.slice(0,-1):T}function p(d,g,E=0){const T=[...d,g];return E&&T.length>E?T.slice(1):T}const m=(d,g,E,T=!0)=>(O,D)=>{const k=i.endpoints[d].select(g)(D()),x={patches:[],inversePatches:[],undo:()=>O(i.util.patchQueryData(d,g,x.inversePatches,T))};if(k.status==="uninitialized")return x;let q;if("data"in k)if(wr(k.data)){const[$,z,W]=Wn(k.data,E);x.patches.push(...z),x.inversePatches.push(...W),q=$}else q=E(k.data),x.patches.push({op:"replace",path:[],value:q}),x.inversePatches.push({op:"replace",path:[],value:k.data});return x.patches.length===0||O(i.util.patchQueryData(d,g,x.patches,T)),x},M=(d,g,E)=>T=>T(i.endpoints[d].initiate(g,{subscribe:!1,forceRefetch:!0,[Oe]:()=>({data:E})})),A=(d,g)=>d.query&&d[g]?d[g]:En,_=async(d,{signal:g,abort:E,rejectWithValue:T,fulfillWithValue:O,dispatch:D,getState:L,extra:k})=>{const x=n[d.endpointName],{metaSchema:q,skipSchemaValidation:$=a}=x;try{let z=En;const W={signal:g,abort:E,dispatch:D,getState:L,extra:k,endpoint:d.endpointName,type:d.type,forced:d.type==="query"?P(d,L()):void 0,queryCacheKey:d.type==="query"?d.queryCacheKey:void 0},F=d.type==="query"?d[Oe]:void 0;let Q;const K=async(j,B,G,oe)=>{if(B==null&&j.pages.length)return Promise.resolve({data:j});const X={queryArg:d.originalArgs,pageParam:B},he=await U(X),Z=oe?y:p;return{data:{pages:Z(j.pages,he.data,G),pageParams:Z(j.pageParams,B,G)},meta:he.meta}};async function U(j){let B;const{extraOptions:G,argSchema:oe,rawResponseSchema:X,responseSchema:he}=x;if(oe&&!ce($,"arg")&&(j=await ue(oe,j,"argSchema",{})),F?B=F():x.query?(z=A(x,"transformResponse"),B=await t(x.query(j),W,G)):B=await x.queryFn(j,W,G,pe=>t(pe,W,G)),typeof process<"u",B.error)throw new Sn(B.error,B.meta);let{data:Z}=B;X&&!ce($,"rawResponse")&&(Z=await ue(X,B.data,"rawResponseSchema",B.meta));let se=await z(Z,B.meta,j);return he&&!ce($,"response")&&(se=await ue(he,se,"responseSchema",B.meta)),{...B,data:se}}if(d.type==="query"&&"infiniteQueryOptions"in x){const{infiniteQueryOptions:j}=x,{maxPages:B=1/0}=j;let G;const oe={pages:[],pageParams:[]},X=u.selectQueryEntry(L(),d.queryCacheKey)?.data,Z=P(d,L())&&!d.direction||!X?oe:X;if("direction"in d&&d.direction&&Z.pages.length){const se=d.direction==="backward",ke=(se?Xn:Et)(j,Z,d.originalArgs);G=await K(Z,ke,B,se)}else{const{initialPageParam:se=j.initialPageParam}=d,pe=X?.pageParams??[],ke=pe[0]??se,Kt=pe.length;G=await K(Z,ke,B),F&&(G={data:G.data.pages[0]});for(let Vt=1;Vt<Kt;Vt++){const gr=Et(j,G.data,d.originalArgs);G=await K(G.data,gr,B)}}Q=G}else Q=await U(d.originalArgs);return q&&!ce($,"meta")&&Q.meta&&(Q.meta=await ue(q,Q.meta,"metaSchema",Q.meta)),O(Q.data,_e({fulfilledTimeStamp:Date.now(),baseQueryMeta:Q.meta}))}catch(z){let W=z;if(W instanceof Sn){let F=A(x,"transformErrorResponse");const{rawErrorResponseSchema:Q,errorResponseSchema:K}=x;let{value:U,meta:j}=W;try{Q&&!ce($,"rawErrorResponse")&&(U=await ue(Q,U,"rawErrorResponseSchema",j)),q&&!ce($,"meta")&&(j=await ue(q,j,"metaSchema",j));let B=await F(U,j,d.originalArgs);return K&&!ce($,"errorResponse")&&(B=await ue(K,B,"errorResponseSchema",j)),T(B,_e({baseQueryMeta:j}))}catch(B){W=B}}try{if(W instanceof Jn){const F={endpoint:d.endpointName,arg:d.originalArgs,type:d.type,queryCacheKey:d.type==="query"?d.queryCacheKey:void 0};x.onSchemaFailure?.(W,F),l?.(W,F);const{catchSchemaFailure:Q=c}=x;if(Q)return T(Q(W,F),_e({baseQueryMeta:W._bqMeta}))}}catch(F){W=F}throw typeof process<"u",console.error(W),W}};function P(d,g){const E=u.selectQueryEntry(g,d.queryCacheKey),T=u.selectConfig(g).refetchOnMountOrArgChange,O=E?.fulfilledTimeStamp,D=d.forceRefetch??(d.subscribe&&T);return D?D===!0||(Number(new Date)-Number(O))/1e3>=D:!1}const w=()=>pn(`${e}/executeQuery`,_,{getPendingMeta({arg:g}){const E=n[g.endpointName];return _e({startedTimeStamp:Date.now(),...rt(E)?{direction:g.direction}:{}})},condition(g,{getState:E}){const T=E(),O=u.selectQueryEntry(T,g.queryCacheKey),D=O?.fulfilledTimeStamp,L=g.originalArgs,k=O?.originalArgs,x=n[g.endpointName],q=g.direction;return St(g)?!0:O?.status==="pending"?!1:P(g,T)||nt(x)&&x?.forceRefetch?.({currentArg:L,previousArg:k,endpointState:O,state:T})?!0:!(D&&!q)},dispatchConditionRejection:!0}),f=w(),s=w(),v=pn(`${e}/executeMutation`,_,{getPendingMeta(){return _e({startedTimeStamp:Date.now()})}}),S=d=>"force"in d,b=d=>"ifOlderThan"in d,R=(d,g,E={})=>(T,O)=>{const D=S(E)&&E.force,L=b(E)&&E.ifOlderThan,k=(q=!0)=>{const $={forceRefetch:q,subscribe:!1};return i.endpoints[d].initiate(g,$)},x=i.endpoints[d].select(g)(O());if(D)T(k());else if(L){const q=x?.fulfilledTimeStamp;if(!q){T(k());return}(Number(new Date)-Number(new Date(q)))/1e3>=L&&T(k())}else T(k(!1))};function C(d){return g=>g?.meta?.arg?.endpointName===d}function h(d,g){return{matchPending:ut(Kn(d),C(g)),matchFulfilled:ut(fe(d),C(g)),matchRejected:ut(Lt(d),C(g))}}return{queryThunk:f,mutationThunk:v,infiniteQueryThunk:s,prefetch:R,updateQueryData:m,upsertQueryData:M,patchQueryData:I,buildMatchThunkActions:h}}function Et(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Xn(e,{pages:t,pageParams:n},r){return e.getPreviousPageParam?.(t[0],t,n[0],n,r)}function Zn(e,t,n,r){return $t(n[e.meta.arg.endpointName][t],fe(e)?e.payload:void 0,Nt(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function je(e,t,n){const r=e[t];r&&n(r)}function De(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Cn(e,t,n){const r=e[De(t)];r&&n(r)}var $e={};function ji({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:u,hasRehydrationInfo:l},assertTagType:c,config:a}){const I=Se(`${e}/resetApiState`);function y(C,h,d,g){C[h.queryCacheKey]??={status:"uninitialized",endpointName:h.endpointName},je(C,h.queryCacheKey,E=>{E.status="pending",E.requestId=d&&E.requestId?E.requestId:g.requestId,h.originalArgs!==void 0&&(E.originalArgs=h.originalArgs),E.startedTimeStamp=g.startedTimeStamp;const T=i[g.arg.endpointName];rt(T)&&"direction"in h&&(E.direction=h.direction)})}function p(C,h,d,g){je(C,h.arg.queryCacheKey,E=>{if(E.requestId!==h.requestId&&!g)return;const{merge:T}=i[h.arg.endpointName];if(E.status="fulfilled",T)if(E.data!==void 0){const{fulfilledTimeStamp:O,arg:D,baseQueryMeta:L,requestId:k}=h;let x=kt(E.data,q=>T(q,d,{arg:D.originalArgs,baseQueryMeta:L,fulfilledTimeStamp:O,requestId:k}));E.data=x}else E.data=d;else E.data=i[h.arg.endpointName].structuralSharing??!0?qt(br(E.data)?Sr(E.data):E.data,d):d;delete E.error,E.fulfilledTimeStamp=h.fulfilledTimeStamp})}const m=me({name:`${e}/queries`,initialState:$e,reducers:{removeQueryResult:{reducer(C,{payload:{queryCacheKey:h}}){delete C[h]},prepare:Ce()},cacheEntriesUpserted:{reducer(C,h){for(const d of h.payload){const{queryDescription:g,value:E}=d;y(C,g,!0,{arg:g,requestId:h.meta.requestId,startedTimeStamp:h.meta.timestamp}),p(C,{arg:g,requestId:h.meta.requestId,fulfilledTimeStamp:h.meta.timestamp,baseQueryMeta:{}},E,!0)}},prepare:C=>({payload:C.map(g=>{const{endpointName:E,arg:T,value:O}=g,D=i[E];return{queryDescription:{type:"query",endpointName:E,originalArgs:g.arg,queryCacheKey:r({queryArgs:T,endpointDefinition:D,endpointName:E})},value:O}}),meta:{[Vn]:!0,requestId:Yn(),timestamp:Date.now()}})},queryResultPatched:{reducer(C,{payload:{queryCacheKey:h,patches:d}}){je(C,h,g=>{g.data=Jt(g.data,d.concat())})},prepare:Ce()}},extraReducers(C){C.addCase(t.pending,(h,{meta:d,meta:{arg:g}})=>{const E=St(g);y(h,g,E,d)}).addCase(t.fulfilled,(h,{meta:d,payload:g})=>{const E=St(d.arg);p(h,d,g,E)}).addCase(t.rejected,(h,{meta:{condition:d,arg:g,requestId:E},error:T,payload:O})=>{je(h,g.queryCacheKey,D=>{if(!d){if(D.requestId!==E)return;D.status="rejected",D.error=O??T}})}).addMatcher(l,(h,d)=>{const{queries:g}=u(d);for(const[E,T]of Object.entries(g))(T?.status==="fulfilled"||T?.status==="rejected")&&(h[E]=T)})}}),M=me({name:`${e}/mutations`,initialState:$e,reducers:{removeMutationResult:{reducer(C,{payload:h}){const d=De(h);d in C&&delete C[d]},prepare:Ce()}},extraReducers(C){C.addCase(n.pending,(h,{meta:d,meta:{requestId:g,arg:E,startedTimeStamp:T}})=>{E.track&&(h[De(d)]={requestId:g,status:"pending",endpointName:E.endpointName,startedTimeStamp:T})}).addCase(n.fulfilled,(h,{payload:d,meta:g})=>{g.arg.track&&Cn(h,g,E=>{E.requestId===g.requestId&&(E.status="fulfilled",E.data=d,E.fulfilledTimeStamp=g.fulfilledTimeStamp)})}).addCase(n.rejected,(h,{payload:d,error:g,meta:E})=>{E.arg.track&&Cn(h,E,T=>{T.requestId===E.requestId&&(T.status="rejected",T.error=d??g)})}).addMatcher(l,(h,d)=>{const{mutations:g}=u(d);for(const[E,T]of Object.entries(g))(T?.status==="fulfilled"||T?.status==="rejected")&&E!==T?.requestId&&(h[E]=T)})}}),A={tags:{},keys:{}},_=me({name:`${e}/invalidation`,initialState:A,reducers:{updateProvidedBy:{reducer(C,h){for(const{queryCacheKey:d,providedTags:g}of h.payload){P(C,d);for(const{type:E,id:T}of g){const O=(C.tags[E]??={})[T||"__internal_without_id"]??=[];O.includes(d)||O.push(d)}C.keys[d]=g}},prepare:Ce()}},extraReducers(C){C.addCase(m.actions.removeQueryResult,(h,{payload:{queryCacheKey:d}})=>{P(h,d)}).addMatcher(l,(h,d)=>{const{provided:g}=u(d);for(const[E,T]of Object.entries(g.tags??{}))for(const[O,D]of Object.entries(T)){const L=(h.tags[E]??={})[O||"__internal_without_id"]??=[];for(const k of D)L.includes(k)||L.push(k),h.keys[k]=g.keys[k]}}).addMatcher(ze(fe(t),Nt(t)),(h,d)=>{w(h,[d])}).addMatcher(m.actions.cacheEntriesUpserted.match,(h,d)=>{const g=d.payload.map(({queryDescription:E,value:T})=>({type:"UNKNOWN",payload:T,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:E}}));w(h,g)})}});function P(C,h){const d=C.keys[h]??[];for(const g of d){const E=g.type,T=g.id??"__internal_without_id",O=C.tags[E]?.[T];O&&(C.tags[E][T]=O.filter(D=>D!==h))}delete C.keys[h]}function w(C,h){const d=h.map(g=>{const E=Zn(g,"providesTags",i,c),{queryCacheKey:T}=g.meta.arg;return{queryCacheKey:T,providedTags:E}});_.caseReducers.updateProvidedBy(C,_.actions.updateProvidedBy(d))}const f=me({name:`${e}/subscriptions`,initialState:$e,reducers:{updateSubscriptionOptions(C,h){},unsubscribeQueryResult(C,h){},internal_getRTKQSubscriptions(){}}}),s=me({name:`${e}/internalSubscriptions`,initialState:$e,reducers:{subscriptionsUpdated:{reducer(C,h){return Jt(C,h.payload)},prepare:Ce()}}}),v=me({name:`${e}/config`,initialState:{online:Pi(),focused:Ii(),middlewareRegistered:!1,...a},reducers:{middlewareRegistered(C,{payload:h}){C.middlewareRegistered=C.middlewareRegistered==="conflict"||o!==h?"conflict":!0}},extraReducers:C=>{C.addCase(tt,h=>{h.online=!0}).addCase(jt,h=>{h.online=!1}).addCase(et,h=>{h.focused=!0}).addCase(Qt,h=>{h.focused=!1}).addMatcher(l,h=>({...h}))}}),S=Ei({queries:m.reducer,mutations:M.reducer,provided:_.reducer,subscriptions:s.reducer,config:v.reducer}),b=(C,h)=>S(I.match(h)?void 0:C,h),R={...v.actions,...m.actions,...f.actions,...s.actions,...M.actions,..._.actions,resetApiState:I};return{reducer:b,actions:R}}var J=Symbol.for("RTKQ/skipToken"),er={status:"uninitialized"},_n=kt(er,()=>{}),In=kt(er,()=>{});function $i({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=f=>_n,i=f=>In;return{buildQuerySelector:p,buildInfiniteQuerySelector:m,buildMutationSelector:M,selectInvalidatedBy:A,selectCachedArgsForQuery:_,selectApiState:u,selectQueries:l,selectMutations:a,selectQueryEntry:c,selectConfig:I};function o(f){return{...f,...hn(f.status)}}function u(f){return f[t]}function l(f){return u(f)?.queries}function c(f,s){return l(f)?.[s]}function a(f){return u(f)?.mutations}function I(f){return u(f)?.config}function y(f,s,v){return S=>{if(S===J)return n(r,v);const b=e({queryArgs:S,endpointDefinition:s,endpointName:f});return n(C=>c(C,b)??_n,v)}}function p(f,s){return y(f,s,o)}function m(f,s){const{infiniteQueryOptions:v}=s;function S(b){const R={...b,...hn(b.status)},{isLoading:C,isError:h,direction:d}=R,g=d==="forward",E=d==="backward";return{...R,hasNextPage:P(v,R.data,R.originalArgs),hasPreviousPage:w(v,R.data,R.originalArgs),isFetchingNextPage:C&&g,isFetchingPreviousPage:C&&E,isFetchNextPageError:h&&g,isFetchPreviousPageError:h&&E}}return y(f,s,S)}function M(){return f=>{let s;return typeof f=="object"?s=De(f)??J:s=f,n(s===J?i:b=>u(b)?.mutations?.[s]??In,o)}}function A(f,s){const v=f[t],S=new Set;for(const b of s.filter(Ut).map(bt)){const R=v.provided.tags[b.type];if(!R)continue;let C=(b.id!==void 0?R[b.id]:yn(Object.values(R)))??[];for(const h of C)S.add(h)}return yn(Array.from(S.values()).map(b=>{const R=v.queries[b];return R?[{queryCacheKey:b,endpointName:R.endpointName,originalArgs:R.originalArgs}]:[]}))}function _(f,s){return Object.values(l(f)).filter(v=>v?.endpointName===s&&v.status!=="uninitialized").map(v=>v.originalArgs)}function P(f,s,v){return s?Et(f,s,v)!=null:!1}function w(f,s,v){return!s||!f.getPreviousPageParam?!1:Xn(f,s,v)!=null}}const{formatProdErrorMessage:Fi,formatProdErrorMessage:qo,formatProdErrorMessage:Uo}=await N("@reduxjs/toolkit");var Pn=WeakMap?new WeakMap:void 0,An=({endpointName:e,queryArgs:t})=>{let n="";const r=Pn?.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,u)=>(u=typeof u=="bigint"?{$bigint:u.toString()}:u,u=Me(u)?Object.keys(u).sort().reduce((l,c)=>(l[c]=u[c],l),{}):u,u));Me(t)&&Pn?.set(t,i),n=i}return`${e}(${n})`};function Wi(...e){return function(n){const r=Yt(a=>n.extractRehydrationInfo?.(a,{reducerPath:n.reducerPath??"api"})),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(a){let I=An;if("serializeQueryArgs"in a.endpointDefinition){const y=a.endpointDefinition.serializeQueryArgs;I=p=>{const m=y(p);return typeof m=="string"?m:An({...p,queryArgs:m})}}else n.serializeQueryArgs&&(I=n.serializeQueryArgs);return I(a)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(a){a()},apiUid:Yn(),extractRehydrationInfo:r,hasRehydrationInfo:Yt(a=>r(a)!=null)},u={injectEndpoints:c,enhanceEndpoints({addTagTypes:a,endpoints:I}){if(a)for(const y of a)i.tagTypes.includes(y)||i.tagTypes.push(y);if(I)for(const[y,p]of Object.entries(I))typeof p=="function"?p(o.endpointDefinitions[y]):Object.assign(o.endpointDefinitions[y]||{},p);return u}},l=e.map(a=>a.init(u,i,o));function c(a){const I=a.endpoints({query:y=>({...y,type:"query"}),mutation:y=>({...y,type:"mutation"}),infiniteQuery:y=>({...y,type:"infinitequery"})});for(const[y,p]of Object.entries(I)){if(a.overrideExisting!==!0&&y in o.endpointDefinitions){if(a.overrideExisting==="throw")throw new Error(Fi(39));typeof process<"u";continue}typeof process<"u",o.endpointDefinitions[y]=p;for(const m of l)m.injectEndpoint(y,p)}return u}return u.injectEndpoints({endpoints:n.endpoints})}}const{formatProdErrorMessage:Hi}=await N("@reduxjs/toolkit");function Bi(){return function(){throw new Error(Hi(33))}}function ne(e,...t){return Object.assign(e,...t)}var zi=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const i=`${e.reducerPath}/subscriptions`;let o=null,u=null;const{updateSubscriptionOptions:l,unsubscribeQueryResult:c}=e.internalActions,a=(A,_)=>{if(l.match(_)){const{queryCacheKey:w,requestId:f,options:s}=_.payload,v=A.get(w);return v?.has(f)&&v.set(f,s),!0}if(c.match(_)){const{queryCacheKey:w,requestId:f}=_.payload,s=A.get(w);return s&&s.delete(f),!0}if(e.internalActions.removeQueryResult.match(_))return A.delete(_.payload.queryCacheKey),!0;if(t.pending.match(_)){const{meta:{arg:w,requestId:f}}=_,s=Ge(A,w.queryCacheKey,wt);return w.subscribe&&s.set(f,w.subscriptionOptions??s.get(f)??{}),!0}let P=!1;if(t.rejected.match(_)){const{meta:{condition:w,arg:f,requestId:s}}=_;if(w&&f.subscribe){const v=Ge(A,f.queryCacheKey,wt);v.set(s,f.subscriptionOptions??v.get(s)??{}),P=!0}}return P},I=()=>n.currentSubscriptions,m={getSubscriptions:I,getSubscriptionCount:A=>I().get(A)?.size??0,isRequestSubscribed:(A,_)=>!!I()?.get(A)?.get(_)};function M(A){return JSON.parse(JSON.stringify(Object.fromEntries([...A].map(([_,P])=>[_,Object.fromEntries(P)]))))}return(A,_)=>{if(o||(o=M(n.currentSubscriptions)),e.util.resetApiState.match(A))return o={},n.currentSubscriptions.clear(),u=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(A))return[!1,m];const P=a(n.currentSubscriptions,A);let w=!0;if(P){u||(u=setTimeout(()=>{const v=M(n.currentSubscriptions),[,S]=Wn(o,()=>v);_.next(e.internalActions.subscriptionsUpdated(S)),o=v,u=null},500));const f=typeof A.type=="string"&&!!A.type.startsWith(i),s=t.rejected.match(A)&&A.meta.condition&&!!A.meta.arg.subscribe;w=!f&&!s}return[w,!1]}},Gi=2147483647/1e3-1,Ki=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:o,selectConfig:u},getRunningQueryThunk:l,mwApi:c})=>{const{removeQueryResult:a,unsubscribeQueryResult:I,cacheEntriesUpserted:y}=t.internalActions,p=ze(I.match,n.fulfilled,n.rejected,y.match);function m(f){const s=i.currentSubscriptions.get(f);return s?s.size>0:!1}const M={};function A(f){for(const s of f.values())s?.abort?.()}const _=(f,s)=>{const v=s.getState(),S=u(v);if(p(f)){let b;if(y.match(f))b=f.payload.map(R=>R.queryDescription.queryCacheKey);else{const{queryCacheKey:R}=I.match(f)?f.payload:f.meta.arg;b=[R]}P(b,s,S)}if(t.util.resetApiState.match(f)){for(const[b,R]of Object.entries(M))R&&clearTimeout(R),delete M[b];A(i.runningQueries),A(i.runningMutations)}if(r.hasRehydrationInfo(f)){const{queries:b}=r.extractRehydrationInfo(f);P(Object.keys(b),s,S)}};function P(f,s,v){const S=s.getState();for(const b of f){const R=o(S,b);R?.endpointName&&w(b,R.endpointName,s,v)}}function w(f,s,v,S){const R=r.endpointDefinitions[s]?.keepUnusedDataFor??S.keepUnusedDataFor;if(R===1/0)return;const C=Math.max(0,Math.min(R,Gi));if(!m(f)){const h=M[f];h&&clearTimeout(h),M[f]=setTimeout(()=>{if(!m(f)){const d=o(v.getState(),f);d?.endpointName&&v.dispatch(l(d.endpointName,d.originalArgs))?.abort(),v.dispatch(a({queryCacheKey:f}))}delete M[f]},C*1e3)}}return _},Rn=new Error("Promise never resolved before cacheEntryRemoved."),Vi=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:u,selectApiState:l}})=>{const c=gn(r),a=gn(i),I=fe(r,i),y={};function p(P,w,f){const s=y[P];s?.valueResolved&&(s.valueResolved({data:w,meta:f}),delete s.valueResolved)}function m(P){const w=y[P];w&&(delete y[P],w.cacheEntryRemoved())}const M=(P,w,f)=>{const s=A(P);function v(S,b,R,C){const h=u(f,b),d=u(w.getState(),b);!h&&d&&_(S,C,b,w,R)}if(r.pending.match(P))v(P.meta.arg.endpointName,s,P.meta.requestId,P.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(P))for(const{queryDescription:S,value:b}of P.payload){const{endpointName:R,originalArgs:C,queryCacheKey:h}=S;v(R,h,P.meta.requestId,C),p(h,b,{})}else if(i.pending.match(P))w.getState()[t].mutations[s]&&_(P.meta.arg.endpointName,P.meta.arg.originalArgs,s,w,P.meta.requestId);else if(I(P))p(s,P.payload,P.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(P)||e.internalActions.removeMutationResult.match(P))m(s);else if(e.util.resetApiState.match(P))for(const S of Object.keys(y))m(S)};function A(P){return c(P)?P.meta.arg.queryCacheKey:a(P)?P.meta.arg.fixedCacheKey??P.meta.requestId:e.internalActions.removeQueryResult.match(P)?P.payload.queryCacheKey:e.internalActions.removeMutationResult.match(P)?De(P.payload):""}function _(P,w,f,s,v){const S=n.endpointDefinitions[P],b=S?.onCacheEntryAdded;if(!b)return;const R={},C=new Promise(O=>{R.cacheEntryRemoved=O}),h=Promise.race([new Promise(O=>{R.valueResolved=O}),C.then(()=>{throw Rn})]);h.catch(()=>{}),y[f]=R;const d=e.endpoints[P].select(Ke(S)?w:f),g=s.dispatch((O,D,L)=>L),E={...s,getCacheEntry:()=>d(s.getState()),requestId:v,extra:g,updateCachedData:Ke(S)?O=>s.dispatch(e.util.updateQueryData(P,w,O)):void 0,cacheDataLoaded:h,cacheEntryRemoved:C},T=b(w,E);Promise.resolve(T).catch(O=>{if(O!==Rn)throw O})}return M},Yi=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Ji=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:u,refetchQuery:l,internalState:c})=>{const{removeQueryResult:a}=o.internalActions,I=ze(fe(r),Nt(r)),y=ze(fe(r,i),Lt(r,i));let p=[];const m=(_,P)=>{I(_)?A(Zn(_,"invalidatesTags",n,u),P):y(_)?A([],P):o.util.invalidateTags.match(_)&&A($t(_.payload,void 0,void 0,void 0,void 0,u),P)};function M(_){const{queries:P,mutations:w}=_;for(const f of[P,w])for(const s in f)if(f[s]?.status==="pending")return!0;return!1}function A(_,P){const w=P.getState(),f=w[e];if(p.push(..._),f.config.invalidationBehavior==="delayed"&&M(f))return;const s=p;if(p=[],s.length===0)return;const v=o.util.selectInvalidatedBy(w,s);t.batch(()=>{const S=Array.from(v.values());for(const{queryCacheKey:b}of S){const R=f.queries[b],C=Ge(c.currentSubscriptions,b,wt);R&&(C.size===0?P.dispatch(a({queryCacheKey:b})):R.status!=="uninitialized"&&P.dispatch(l(R)))}})}return m},Xi=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const{currentPolls:o,currentSubscriptions:u}=i,l=new Set;let c=null;const a=(_,P)=>{(n.internalActions.updateSubscriptionOptions.match(_)||n.internalActions.unsubscribeQueryResult.match(_))&&I(_.payload.queryCacheKey,P),(t.pending.match(_)||t.rejected.match(_)&&_.meta.condition)&&I(_.meta.arg.queryCacheKey,P),(t.fulfilled.match(_)||t.rejected.match(_)&&!_.meta.condition)&&y(_.meta.arg,P),n.util.resetApiState.match(_)&&(M(),c&&(clearTimeout(c),c=null),l.clear())};function I(_,P){l.add(_),c||(c=setTimeout(()=>{for(const w of l)p({queryCacheKey:w},P);l.clear(),c=null},0))}function y({queryCacheKey:_},P){const w=P.getState()[e],f=w.queries[_],s=u.get(_);if(!f||f.status==="uninitialized")return;const{lowestPollingInterval:v,skipPollingIfUnfocused:S}=A(s);if(!Number.isFinite(v))return;const b=o.get(_);b?.timeout&&(clearTimeout(b.timeout),b.timeout=void 0);const R=Date.now()+v;o.set(_,{nextPollTimestamp:R,pollingInterval:v,timeout:setTimeout(()=>{(w.config.focused||!S)&&P.dispatch(r(f)),y({queryCacheKey:_},P)},v)})}function p({queryCacheKey:_},P){const f=P.getState()[e].queries[_],s=u.get(_);if(!f||f.status==="uninitialized")return;const{lowestPollingInterval:v}=A(s);if(!Number.isFinite(v)){m(_);return}const S=o.get(_),b=Date.now()+v;(!S||b<S.nextPollTimestamp)&&y({queryCacheKey:_},P)}function m(_){const P=o.get(_);P?.timeout&&clearTimeout(P.timeout),o.delete(_)}function M(){for(const _ of o.keys())m(_)}function A(_=new Map){let P=!1,w=Number.POSITIVE_INFINITY;for(const f of _.values())f.pollingInterval&&(w=Math.min(f.pollingInterval,w),P=f.skipPollingIfUnfocused||P);return{lowestPollingInterval:w,skipPollingIfUnfocused:P}}return a},Zi=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Kn(n,r),o=Lt(n,r),u=fe(n,r),l={};return(a,I)=>{if(i(a)){const{requestId:y,arg:{endpointName:p,originalArgs:m}}=a.meta,M=t.endpointDefinitions[p],A=M?.onQueryStarted;if(A){const _={},P=new Promise((v,S)=>{_.resolve=v,_.reject=S});P.catch(()=>{}),l[y]=_;const w=e.endpoints[p].select(Ke(M)?m:y),f=I.dispatch((v,S,b)=>b),s={...I,getCacheEntry:()=>w(I.getState()),requestId:y,extra:f,updateCachedData:Ke(M)?v=>I.dispatch(e.util.updateQueryData(p,m,v)):void 0,queryFulfilled:P};A(m,s)}}else if(u(a)){const{requestId:y,baseQueryMeta:p}=a.meta;l[y]?.resolve({data:a.payload,meta:p}),delete l[y]}else if(o(a)){const{requestId:y,rejectedWithValue:p,baseQueryMeta:m}=a.meta;l[y]?.reject({error:a.payload??a.error,isUnhandledError:!p,meta:m}),delete l[y]}}},es=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,u=(c,a)=>{et.match(c)&&l(a,"refetchOnFocus"),tt.match(c)&&l(a,"refetchOnReconnect")};function l(c,a){const I=c.getState()[e],y=I.queries,p=i.currentSubscriptions;t.batch(()=>{for(const m of p.keys()){const M=y[m],A=p.get(m);if(!A||!M)continue;const _=[...A.values()];(_.some(w=>w[a]===!0)||_.every(w=>w[a]===void 0)&&I.config[a])&&(A.size===0?c.dispatch(o({queryCacheKey:m})):M.status!=="uninitialized"&&c.dispatch(r(M)))}})}return u};function ts(e){const{reducerPath:t,queryThunk:n,api:r,context:i,getInternalState:o}=e,{apiUid:u}=i,l={invalidateTags:Se(`${t}/invalidateTags`)},c=p=>p.type.startsWith(`${t}/`),a=[Yi,Ki,Ji,Xi,Vi,Zi];return{middleware:p=>{let m=!1;const M=o(p.dispatch),A={...e,internalState:M,refetchQuery:y,isThisApiSliceAction:c,mwApi:p},_=a.map(f=>f(A)),P=zi(A),w=es(A);return f=>s=>{if(!Ci(s))return f(s);m||(m=!0,p.dispatch(r.internalActions.middlewareRegistered(u)));const v={...p,next:f},S=p.getState(),[b,R]=P(s,v,S);let C;if(b?C=f(s):C=R,p.getState()[t]&&(w(s,v,S),c(s)||i.hasRehydrationInfo(s)))for(const h of _)h(s,v,S);return C}},actions:l};function y(p){return e.api.endpoints[p.endpointName].initiate(p.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Tn=Symbol(),ns=({createSelector:e=Si}={})=>({name:Tn,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:u,refetchOnMountOrArgChange:l,refetchOnFocus:c,refetchOnReconnect:a,invalidationBehavior:I,onSchemaFailure:y,catchSchemaFailure:p,skipSchemaValidation:m},M){vr();const A=U=>(typeof process<"u",U);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:tt,onOffline:jt,onFocus:et,onFocusLost:Qt},util:{}});const _=$i({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:w,buildQuerySelector:f,buildInfiniteQuerySelector:s,buildMutationSelector:v}=_;ne(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:w});const{queryThunk:S,infiniteQueryThunk:b,mutationThunk:R,patchQueryData:C,updateQueryData:h,upsertQueryData:d,prefetch:g,buildMatchThunkActions:E}=Qi({baseQuery:n,reducerPath:i,context:M,api:t,serializeQueryArgs:o,assertTagType:A,selectors:_,onSchemaFailure:y,catchSchemaFailure:p,skipSchemaValidation:m}),{reducer:T,actions:O}=ji({context:M,queryThunk:S,infiniteQueryThunk:b,mutationThunk:R,serializeQueryArgs:o,reducerPath:i,assertTagType:A,config:{refetchOnFocus:c,refetchOnReconnect:a,refetchOnMountOrArgChange:l,keepUnusedDataFor:u,reducerPath:i,invalidationBehavior:I}});ne(t.util,{patchQueryData:C,updateQueryData:h,upsertQueryData:d,prefetch:g,resetApiState:O.resetApiState,upsertQueryEntries:O.cacheEntriesUpserted}),ne(t.internalActions,O);const D=new WeakMap,L=U=>Ge(D,U,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:k,buildInitiateInfiniteQuery:x,buildInitiateMutation:q,getRunningMutationThunk:$,getRunningMutationsThunk:z,getRunningQueriesThunk:W,getRunningQueryThunk:F}=Ui({queryThunk:S,mutationThunk:R,infiniteQueryThunk:b,api:t,serializeQueryArgs:o,context:M,getInternalState:L});ne(t.util,{getRunningMutationThunk:$,getRunningMutationsThunk:z,getRunningQueryThunk:F,getRunningQueriesThunk:W});const{middleware:Q,actions:K}=ts({reducerPath:i,context:M,queryThunk:S,mutationThunk:R,infiniteQueryThunk:b,api:t,assertTagType:A,selectors:_,getRunningQueryThunk:F,getInternalState:L});return ne(t.util,K),ne(t,{reducer:T,middleware:Q}),{name:Tn,injectEndpoint(U,j){const B=t,G=B.endpoints[U]??={};nt(j)&&ne(G,{name:U,select:f(U,j),initiate:k(U,j)},E(S,U)),Li(j)&&ne(G,{name:U,select:v(),initiate:q(U)},E(R,U)),rt(j)&&ne(G,{name:U,select:s(U,j),initiate:x(U,j)},E(S,U))}}}});await N("@reduxjs/toolkit");const{batch:rs,useDispatch:is,useSelector:ss,useStore:as}=await N("react-redux");function Fe(e){return e.replace(e[0],e[0].toUpperCase())}function os(e){return e.type==="query"}function cs(e){return e.type==="mutation"}function tr(e){return e.type==="infinitequery"}function Ie(e,...t){return Object.assign(e,...t)}const{formatProdErrorMessage:Qo,formatProdErrorMessage:us}=await N("@reduxjs/toolkit"),{useCallback:le,useDebugValue:dt,useEffect:ve,useLayoutEffect:ls,useMemo:V,useRef:ye,useState:Mn}=await N("react"),{shallowEqual:ft}=await N("react-redux");var ht=Symbol();const{useEffect:ds,useRef:fs,useMemo:hs}=await N("react");function pt(e){const t=fs(e),n=hs(()=>qt(t.current,e),[e]);return ds(()=>{t.current!==n&&(t.current=n)},[n]),n}const{useEffect:ps,useRef:gs}=await N("react"),{shallowEqual:On}=await N("react-redux");function We(e){const t=gs(e);return ps(()=>{On(t.current,e)||(t.current=e)},[e]),On(t.current,e)?t.current:e}var ms=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ys=ms(),vs=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ws=vs(),bs=()=>ys||ws?ls:ve,Ss=bs(),Dn=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Gn.pending}:e;function gt(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var mt=["data","status","isLoading","isSuccess","isError","error"];function Es({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o,createSelector:u},serializeQueryArgs:l,context:c}){const a=o?s=>s():ve;return{buildQueryHooks:P,buildInfiniteQueryHooks:w,buildMutationHook:f,usePrefetch:p};function I(s,v,S){if(v?.endpointName&&s.isUninitialized){const{endpointName:g}=v,E=c.endpointDefinitions[g];S!==J&&l({queryArgs:v.originalArgs,endpointDefinition:E,endpointName:g})===l({queryArgs:S,endpointDefinition:E,endpointName:g})&&(v=void 0)}let b=s.isSuccess?s.data:v?.data;b===void 0&&(b=s.data);const R=b!==void 0,C=s.isLoading,h=(!v||v.isLoading||v.isUninitialized)&&!R&&C,d=s.isSuccess||R&&(C&&!v?.isError||s.isUninitialized);return{...s,data:b,currentData:s.data,isFetching:C,isLoading:h,isSuccess:d}}function y(s,v,S){if(v?.endpointName&&s.isUninitialized){const{endpointName:g}=v,E=c.endpointDefinitions[g];S!==J&&l({queryArgs:v.originalArgs,endpointDefinition:E,endpointName:g})===l({queryArgs:S,endpointDefinition:E,endpointName:g})&&(v=void 0)}let b=s.isSuccess?s.data:v?.data;b===void 0&&(b=s.data);const R=b!==void 0,C=s.isLoading,h=(!v||v.isLoading||v.isUninitialized)&&!R&&C,d=s.isSuccess||C&&R;return{...s,data:b,currentData:s.data,isFetching:C,isLoading:h,isSuccess:d}}function p(s,v){const S=n(),b=We(v);return le((R,C)=>S(e.util.prefetch(s,R,{...b,...C})),[s,S,b])}function m(s,v,{refetchOnReconnect:S,refetchOnFocus:b,refetchOnMountOrArgChange:R,skip:C=!1,pollingInterval:h=0,skipPollingIfUnfocused:d=!1,...g}={}){const{initiate:E}=e.endpoints[s],T=n(),O=ye(void 0);if(!O.current){const Q=T(e.internalActions.internal_getRTKQSubscriptions());O.current=Q}const D=pt(C?J:v),L=We({refetchOnReconnect:S,refetchOnFocus:b,pollingInterval:h,skipPollingIfUnfocused:d}),k=g.initialPageParam,x=We(k),q=ye(void 0);let{queryCacheKey:$,requestId:z}=q.current||{},W=!1;$&&z&&(W=O.current.isRequestSubscribed($,z));const F=!W&&q.current!==void 0;return a(()=>{F&&(q.current=void 0)},[F]),a(()=>{const Q=q.current;if(typeof process<"u",D===J){Q?.unsubscribe(),q.current=void 0;return}const K=q.current?.subscriptionOptions;if(!Q||Q.arg!==D){Q?.unsubscribe();const U=T(E(D,{subscriptionOptions:L,forceRefetch:R,...tr(c.endpointDefinitions[s])?{initialPageParam:x}:{}}));q.current=U}else L!==K&&Q.updateSubscriptionOptions(L)},[T,E,R,D,L,F,x,s]),[q,T,E,L]}function M(s,v){return(b,{skip:R=!1,selectFromResult:C}={})=>{const{select:h}=e.endpoints[s],d=pt(R?J:b),g=ye(void 0),E=V(()=>u([h(d),(k,x)=>x,k=>d],v,{memoizeOptions:{resultEqualityCheck:ft}}),[h,d]),T=V(()=>C?u([E],C,{devModeChecks:{identityFunctionCheck:"never"}}):E,[E,C]),O=r(k=>T(k,g.current),ft),D=i(),L=E(D.getState(),g.current);return Ss(()=>{g.current=L},[L]),O}}function A(s){ve(()=>()=>{s.current?.unsubscribe?.(),s.current=void 0},[s])}function _(s){if(!s.current)throw new Error(us(38));return s.current.refetch()}function P(s){const v=(R,C={})=>{const[h]=m(s,R,C);return A(h),V(()=>({refetch:()=>_(h)}),[h])},S=({refetchOnReconnect:R,refetchOnFocus:C,pollingInterval:h=0,skipPollingIfUnfocused:d=!1}={})=>{const{initiate:g}=e.endpoints[s],E=n(),[T,O]=Mn(ht),D=ye(void 0),L=We({refetchOnReconnect:R,refetchOnFocus:C,pollingInterval:h,skipPollingIfUnfocused:d});a(()=>{const $=D.current?.subscriptionOptions;L!==$&&D.current?.updateSubscriptionOptions(L)},[L]);const k=ye(L);a(()=>{k.current=L},[L]);const x=le(function($,z=!1){let W;return t(()=>{D.current?.unsubscribe(),D.current=W=E(g($,{subscriptionOptions:k.current,forceRefetch:!z})),O($)}),W},[E,g]),q=le(()=>{D.current?.queryCacheKey&&E(e.internalActions.removeQueryResult({queryCacheKey:D.current?.queryCacheKey}))},[E]);return ve(()=>()=>{D?.current?.unsubscribe()},[]),ve(()=>{T!==ht&&!D.current&&x(T,!0)},[T,x]),V(()=>[x,T,{reset:q}],[x,T,q])},b=M(s,I);return{useQueryState:b,useQuerySubscription:v,useLazyQuerySubscription:S,useLazyQuery(R){const[C,h,{reset:d}]=S(R),g=b(h,{...R,skip:h===ht}),E=V(()=>({lastArg:h}),[h]);return V(()=>[C,{...g,reset:d},E],[C,g,d,E])},useQuery(R,C){const h=v(R,C),d=b(R,{selectFromResult:R===J||C?.skip?void 0:Dn,...C}),g=gt(d,...mt);return dt(g),V(()=>({...d,...h}),[d,h])}}}function w(s){const v=(b,R={})=>{const[C,h,d,g]=m(s,b,R),E=ye(g);a(()=>{E.current=g},[g]);const T=le(function(L,k){let x;return t(()=>{C.current?.unsubscribe(),C.current=x=h(d(L,{subscriptionOptions:E.current,direction:k}))}),x},[C,h,d]);A(C);const O=pt(R.skip?J:b),D=le(()=>_(C),[C]);return V(()=>({trigger:T,refetch:D,fetchNextPage:()=>T(O,"forward"),fetchPreviousPage:()=>T(O,"backward")}),[D,T,O])},S=M(s,y);return{useInfiniteQueryState:S,useInfiniteQuerySubscription:v,useInfiniteQuery(b,R){const{refetch:C,fetchNextPage:h,fetchPreviousPage:d}=v(b,R),g=S(b,{selectFromResult:b===J||R?.skip?void 0:Dn,...R}),E=gt(g,...mt,"hasNextPage","hasPreviousPage");return dt(E),V(()=>({...g,fetchNextPage:h,fetchPreviousPage:d,refetch:C}),[g,h,d,C])}}}function f(s){return({selectFromResult:v,fixedCacheKey:S}={})=>{const{select:b,initiate:R}=e.endpoints[s],C=n(),[h,d]=Mn();ve(()=>()=>{h?.arg.fixedCacheKey||h?.reset()},[h]);const g=le(function($){const z=C(R($,{fixedCacheKey:S}));return d(z),z},[C,R,S]),{requestId:E}=h||{},T=V(()=>b({fixedCacheKey:S,requestId:h?.requestId}),[S,h,b]),O=V(()=>v?u([T],v):T,[v,T]),D=r(O,ft),L=S==null?h?.arg.originalArgs:void 0,k=le(()=>{t(()=>{h&&d(void 0),S&&C(e.internalActions.removeMutationResult({requestId:E,fixedCacheKey:S}))})},[C,S,h,E]),x=gt(D,...mt,"endpointName");dt(x);const q=V(()=>({...D,originalArgs:L,reset:k}),[D,L,k]);return V(()=>[g,q],[g,q])}}}var Cs=Symbol(),_s=({batch:e=rs,hooks:t={useDispatch:is,useSelector:ss,useStore:as},createSelector:n=Er,unstable__sideEffectsInRender:r=!1,...i}={})=>({name:Cs,init(o,{serializeQueryArgs:u},l){const c=o,{buildQueryHooks:a,buildInfiniteQueryHooks:I,buildMutationHook:y,usePrefetch:p}=Es({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:u,context:l});return Ie(c,{usePrefetch:p}),Ie(l,{batch:e}),{injectEndpoint(m,M){if(os(M)){const{useQuery:A,useLazyQuery:_,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:f}=a(m);Ie(c.endpoints[m],{useQuery:A,useLazyQuery:_,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:f}),o[`use${Fe(m)}Query`]=A,o[`useLazy${Fe(m)}Query`]=_}if(cs(M)){const A=y(m);Ie(c.endpoints[m],{useMutation:A}),o[`use${Fe(m)}Mutation`]=A}else if(tr(M)){const{useInfiniteQuery:A,useInfiniteQuerySubscription:_,useInfiniteQueryState:P}=I(m);Ie(c.endpoints[m],{useInfiniteQuery:A,useInfiniteQuerySubscription:_,useInfiniteQueryState:P}),o[`use${Fe(m)}InfiniteQuery`]=A}}}}});await N("@reduxjs/toolkit");await N("react");await N("react");await N("react");await N("react-redux");var nr=Wi(ns(),_s());const Is="/auth",Ps="pk_live_CE856A4938B36648",As="https://notifications.decentraland.zone",Rs="https://peer.decentraland.zone",Ts="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Ms="https://events.decentraland.zone/api",Os="https://realm-provider-ea.decentraland.org/hot-scenes",Ds="61570c542c2d66c659492e5b24a41522",xs={AUTH_URL:Is,MAGIC_API_KEY:Ps,NOTIFICATIONS_API_URL:As,PEER_URL:Rs,SEGMENT_API_KEY:Ts,EVENTS_API_URL:Ms,HOT_SCENES_URL:Os,WALLET_CONNECT_PROJECT_ID:Ds},ks="/auth",Ls="pk_live_212568025B158355",Ns="https://notifications.decentraland.org",qs="https://peer.decentraland.org",Us="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Qs="https://events.decentraland.org/api",js="https://realm-provider-ea.decentraland.org/hot-scenes",$s="61570c542c2d66c659492e5b24a41522",Fs={AUTH_URL:ks,MAGIC_API_KEY:Ls,NOTIFICATIONS_API_URL:Ns,PEER_URL:qs,SEGMENT_API_KEY:Us,EVENTS_API_URL:Qs,HOT_SCENES_URL:js,WALLET_CONNECT_PROJECT_ID:$s},Ws="/auth",Hs="pk_live_CE856A4938B36648",Bs="https://notifications.decentraland.org",zs="https://peer.decentraland.org",Gs="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Ks="https://events.decentraland.org/api",Vs="https://realm-provider-ea.decentraland.org/hot-scenes",Ys="61570c542c2d66c659492e5b24a41522",Js={AUTH_URL:Ws,MAGIC_API_KEY:Hs,NOTIFICATIONS_API_URL:Bs,PEER_URL:zs,SEGMENT_API_KEY:Gs,EVENTS_API_URL:Ks,HOT_SCENES_URL:Vs,WALLET_CONNECT_PROJECT_ID:Ys};var Xs={VITE_REACT_APP_WEBSITE_VERSION:"0.0.1-24138829632.commit-0946e16",VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/explore-site/0.0.1-24138829632.commit-0946e16",BASE_URL:"https://cdn.decentraland.org/@dcl/explore-site/0.0.1-24138829632.commit-0946e16",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Zs=mr({[at.DEVELOPMENT]:xs,[at.STAGING]:Js,[at.PRODUCTION]:Fs},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:Xs.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}}),ae=e=>Zs.get(e),ea=5;function Re(e,t){return`${e},${t}`}function ta(e,t){for(const[n,r]of t){const i=e.get(Re(n,r));if(i)return i}}function rr(e){return e.toLowerCase().includes("genesis plaza")}function na(e){const t=e.find(r=>rr(r.name)),n=t?Re(t.baseCoords[0],t.baseCoords[1]):"0,0";return{id:t?.id??"genesis-plaza",type:"place",title:t?.name??"Genesis Plaza",image:t?.thumbnail??"",users:t?.usersTotalCount??0,coordinates:n,creatorName:"Decentraland Foundation",isGenesisPlaza:!0}}function ra(e,t,n=ea){const r=t.filter(a=>a.usersTotalCount>=n),i=new Map(e.map(a=>[Re(a.x,a.y),a])),o=[],u=new Set,l=new Set;for(const a of r){const I=ta(i,a.parcels);I&&!l.has(I.id)&&(o.push({id:I.id,type:"event",title:I.name,image:I.image||"",users:a.usersTotalCount,coordinates:Re(I.x,I.y),creatorAddress:I.user,creatorName:I.user_name||void 0,isGenesisPlaza:!1}),u.add(a.id),l.add(I.id))}o.sort((a,I)=>I.users-a.users);const c=r.filter(a=>!u.has(a.id)).sort((a,I)=>I.usersTotalCount-a.usersTotalCount);for(const a of c){const I=rr(a.name);o.push({id:a.id,type:"place",title:a.name,image:a.thumbnail,users:a.usersTotalCount,coordinates:Re(a.baseCoords[0],a.baseCoords[1]),...I&&{creatorName:"Decentraland Foundation"},isGenesisPlaza:I})}return o.length===0&&o.push(na(t)),o}function ia(e){const t=new URLSearchParams;for(const[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));return t.toString()}const Ve=nr({reducerPath:"eventsClient",baseQuery:xi({baseUrl:"/"}),tagTypes:["Events","LiveNow"],keepUnusedDataFor:60,endpoints:e=>({getEvents:e.query({queryFn:async t=>{try{const n=ae("EVENTS_API_URL"),r=ia(t),i=await fetch(`${n}/events?${r}`);if(!i.ok)throw new Error(`Events API error: ${i.status}`);return{data:(await i.json()).data??[]}}catch(n){return{error:{status:"FETCH_ERROR",error:n instanceof Error?n.message:"Unknown error"}}}},providesTags:["Events"]}),getLiveNowCards:e.query({queryFn:async t=>{try{const n=ae("EVENTS_API_URL"),r=ae("HOT_SCENES_URL"),[i,o]=await Promise.all([fetch(`${n}/events?list=live&limit=20&order=asc&world=false`),fetch(r)]);if(!i.ok||!o.ok)throw new Error("Failed to fetch live events or hot scenes");const[u,l]=await Promise.all([i.json(),o.json()]),c=t&&"minUsers"in t?t.minUsers:void 0;return{data:ra(u.data??[],l,c)}}catch(n){return{error:{status:"FETCH_ERROR",error:n instanceof Error?n.message:"Unknown error"}}}},providesTags:["LiveNow"]}),getUpcomingEvents:e.query({queryFn:async()=>{try{const t=ae("EVENTS_API_URL"),n=new Date,r=new Date(n.getTime()+24*60*60*1e3),i=await fetch(`${t}/events?list=upcoming&limit=10&order=asc&world=false&from=${n.toISOString()}&to=${r.toISOString()}`);if(!i.ok)throw new Error(`Events API error: ${i.status}`);return{data:(await i.json()).data??[]}}catch(t){return{error:{status:"FETCH_ERROR",error:t instanceof Error?t.message:"Unknown error"}}}},providesTags:["Events"]}),getEventsByDateRange:e.query({queryFn:async({from:t,to:n})=>{try{const r=ae("EVENTS_API_URL"),i=await fetch(`${r}/events?list=all&from=${t}&to=${n}&limit=100&order=asc&world=false`);if(!i.ok)throw new Error(`Events API error: ${i.status}`);return{data:(await i.json()).data??[]}}catch(r){return{error:{status:"FETCH_ERROR",error:r instanceof Error?r.message:"Unknown error"}}}},providesTags:["Events"]})})}),{useGetEventsQuery:jo,useGetLiveNowCardsQuery:sa,useGetUpcomingEventsQuery:$o,useGetEventsByDateRangeQuery:Fo}=Ve;async function aa(e){try{const t=ae("PEER_URL"),n=await fetch(`${t}/lambdas/profiles/${e.toLowerCase()}`);return n.ok?await n.json()??null:null}catch{return null}}const Ye=nr({reducerPath:"profileClient",baseQuery:Bi(),tagTypes:["Profile"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:e=>({getProfile:e.query({queryFn:async t=>{if(!t)return{data:null};try{return{data:await aa(t)}}catch{return{data:null}}},providesTags:(t,n,r)=>r?[{type:"Profile",id:r}]:[]})})}),{useGetProfileQuery:ir}=Ye,{combineReducers:oa,configureStore:ca}=await N("@reduxjs/toolkit"),ua=oa({network:li,transactions:wi,wallet:hi,[Ye.reducerPath]:Ye.reducer,[Ve.reducerPath]:Ve.reducer}),la=ca({reducer:ua,middleware:e=>e().concat(Ye.middleware,Ve.middleware),devTools:!1});ki(la.dispatch);const Wo={"live_now.title":"Live Now"};var Ft={},da=Fn;Object.defineProperty(Ft,"__esModule",{value:!0});var sr=Ft.default=void 0,fa=da($n()),ha=H;sr=Ft.default=(0,fa.default)((0,ha.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var Wt={},pa=Fn;Object.defineProperty(Wt,"__esModule",{value:!0});var ar=Wt.default=void 0,ga=pa($n()),ma=H;ar=Wt.default=(0,ga.default)((0,ma.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");const{memo:ya}=await N("react"),{BadgeGroup:va,EventCard:wa,LiveBadge:ba,UserCountBadge:Sa}=await N("decentraland-ui2"),Ea=`${window.location.origin}/dcl-logo.svg`.replace(/^http:\/\//,"https://");function Ca(e){return`https://play.decentraland.org/?position=${e}`}const or=ya(({card:e})=>{const{data:t}=ir(e.creatorAddress,{skip:!e.creatorAddress||e.isGenesisPlaza}),n=t?.avatars?.[0];let i=n?{name:n.name??"",ethAddress:n.ethAddress??"",avatar:n.avatar}:void 0;return!i&&e.creatorName&&(i={name:e.creatorName,ethAddress:"",...e.isGenesisPlaza&&{avatar:{snapshots:{face256:Ea,body:""}}}}),H.jsx(wa,{image:e.image,sceneName:e.title,coordinates:e.coordinates,avatar:i,onClick:()=>window.open(Ca(e.coordinates),"_blank","noopener,noreferrer"),leftBadge:H.jsxs(va,{children:[e.type==="event"&&H.jsx(ba,{}),H.jsx(Sa,{count:e.users})]}),leftBadgeTransparent:!0,hideLocation:!0})});or.displayName="LiveNowCardItem";const{Box:it,IconButton:_a,Typography:Ia,styled:ie}=await N("decentraland-ui2"),Pa=ie("section")(({theme:e})=>({marginTop:e.spacing(4),padding:e.spacing(4,3),background:"radial-gradient(63.39% 112.69% at 49.33% 50.11%, #A042CD 0%, #32134C 100%)",borderRadius:e.spacing(2),[e.breakpoints.down("sm")]:{padding:e.spacing(3,2)}})),Aa=ie(it)({display:"flex",alignItems:"center",gap:8,marginBottom:24}),Ra=ie(Ia)({fontWeight:600}),xn=62,kn=60,Ta=ie(it)({position:"relative"}),Ln=ie(_a)(({theme:e,side:t})=>({position:"absolute",top:"50%",transform:"translateY(-50%)",[t]:e.spacing(1),zIndex:2,backgroundColor:"rgba(0, 0, 0, 0.5)",color:e.palette.common.white,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.7)"},[e.breakpoints.down("sm")]:{display:"none"}})),Ma=ie(it)(({theme:e,fadeLeft:t,fadeRight:n})=>{const r=[];return t&&r.push(`linear-gradient(to right, transparent, black ${kn}px)`),n&&r.push(`linear-gradient(to left, transparent, black ${kn}px)`),{display:"flex",gap:e.spacing(2),justifyContent:"safe center",alignItems:"stretch",overflowX:"auto",scrollSnapType:"x mandatory",scrollBehavior:"smooth",scrollbarWidth:"none",...r.length>0&&{maskImage:r.join(", "),WebkitMaskImage:r.join(", ")},...r.length>1&&{maskComposite:"intersect",WebkitMaskComposite:"source-in"},"&::-webkit-scrollbar":{display:"none"},"& .MuiCard-root":{minWidth:280,maxWidth:850,maxHeight:420,flex:"1 1 0",containerType:"inline-size",scrollSnapAlign:"start",overflow:"hidden"},"& .MuiCardActionArea-root":{height:"100%"},"&& .MuiCardMedia-root":{height:"min(62.5cqw, 297px)"},"&& .MuiCardActionArea-root:hover .MuiCardMedia-root":{height:"min(62.5cqw, 297px)"},"&& .MuiCardActionArea-root:hover .MuiCardContent-root > div:first-of-type > div:last-child":{marginBottom:0},"& .MuiCardContent-root .MuiTypography-h6":{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",WebkitLineClamp:"unset",WebkitBoxOrient:"unset"},"& .MuiCardContent-root .MuiBox-root .MuiBox-root:has(.MuiAvatar-root)":{maxWidth:"100%"},[e.breakpoints.down("sm")]:{maskImage:"none",WebkitMaskImage:"none","& .MuiCard-root":{minWidth:"unset",maxWidth:"unset",maxHeight:"none",flex:"0 0 100%"},"&& .MuiCardMedia-root":{height:`calc(62.5cqw - ${xn}px)`},"&& .MuiCardActionArea-root:hover .MuiCardMedia-root":{height:`calc(62.5cqw - ${xn}px)`},"&& .MuiCardActionArea-root:hover .MuiCardContent-root > div:first-of-type > div:last-child":{marginBottom:0},"&& .MuiCardContent-root > .MuiBox-root:last-child":{display:"flex",opacity:1,transform:"translateY(0)"}}}}),Oa=ie(yr)({color:"#E00000"}),Da=ie(it)(({theme:e})=>({display:"flex",justifyContent:"center",gap:e.spacing(.75),marginTop:e.spacing(2)})),xa=ie("button")(({theme:e,active:t})=>({width:8,height:8,borderRadius:"50%",border:"none",padding:0,cursor:"pointer",backgroundColor:t?e.palette.common.white:"rgba(255, 255, 255, 0.3)",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short})})),{useCallback:de,useEffect:ka,useMemo:La,useRef:Nn,useState:Pe}=await N("react"),{useTranslation:Na}=await N("@dcl/hooks"),qn=300;function qa(){const{t:e}=Na(),t=La(()=>{const b=new URLSearchParams(window.location.search).get("minUsers");if(b!==null&&!Number.isNaN(Number(b)))return{minUsers:Number(b)}},[]),{data:n=[]}=sa(t,{pollingInterval:6e4}),[r,i]=Pe(0),[o,u]=Pe(!1),[l,c]=Pe(!1),[a,I]=Pe(1),[y,p]=Pe(!1),m=Nn(null),M=Nn({isDown:!1,startX:0,scrollLeft:0}),A=de(()=>{const S=m.current;if(!S)return;const b=S.scrollWidth>S.clientWidth,R=b?Math.ceil(S.scrollWidth/S.clientWidth):1;u(S.scrollLeft>0),c(b&&S.scrollLeft+S.clientWidth<S.scrollWidth-1),I(R);const C=S.scrollWidth-S.clientWidth;if(C<=0)i(0);else{const h=S.scrollLeft/C;i(Math.round(h*(R-1)))}},[]);ka(()=>{const S=m.current;if(!S)return;A();const b=new ResizeObserver(A);return b.observe(S),()=>b.disconnect()},[n.length,A]);const _=de(S=>{const b=m.current;if(!b)return;const R=S==="left"?-qn:qn;b.scrollBy({left:R,behavior:"smooth"})},[]),P=de(S=>{const b=m.current;b&&(M.current={isDown:!0,startX:S.pageX-b.offsetLeft,scrollLeft:b.scrollLeft},p(!1))},[]),w=de(S=>{if(!M.current.isDown)return;const b=m.current;if(!b)return;S.preventDefault();const C=S.pageX-b.offsetLeft-M.current.startX;Math.abs(C)>5&&p(!0),b.scrollLeft=M.current.scrollLeft-C},[]),f=de(()=>{M.current.isDown=!1},[]),s=de(S=>{y&&S.stopPropagation()},[y]),v=de(S=>{const b=m.current;if(!b)return;const R=b.scrollWidth-b.clientWidth,C=a<=1?0:R*S/(a-1);b.scrollTo({left:C,behavior:"smooth"})},[a]);return n.length===0?null:H.jsxs(Pa,{children:[H.jsxs(Aa,{children:[H.jsx(Oa,{}),H.jsx(Ra,{variant:"h5",children:e("live_now.title")})]}),H.jsxs(Ta,{children:[o&&H.jsx(Ln,{side:"left",onClick:()=>_("left"),children:H.jsx(sr,{})}),l&&H.jsx(Ln,{side:"right",onClick:()=>_("right"),children:H.jsx(ar,{})}),H.jsx(Ma,{ref:m,onScroll:A,fadeLeft:o,fadeRight:l,onMouseDown:P,onMouseMove:w,onMouseUp:f,onMouseLeave:f,onClickCapture:s,sx:{cursor:y?"grabbing":"grab"},children:n.map(S=>H.jsx(or,{card:S},S.id))})]}),a>1&&H.jsx(Da,{children:Array.from({length:a},(S,b)=>H.jsx(xa,{active:b===r,onClick:()=>v(b),"aria-label":`Go to page ${b+1}`},b))})]})}const{useCallback:yt,useEffect:Ua,useMemo:Qa,useState:ja}=await N("react"),{useNotifications:$a}=await N("@dcl/hooks"),{NotificationActiveTab:Fa}=await N("decentraland-ui2");function Wa(e){const{identity:t,isConnected:n,locale:r="en"}=e,i=!!(t&&n),[o,u]=ja(!0),l=ae("NOTIFICATIONS_API_URL")??"https://notifications.decentraland.org";Ua(()=>{i||u(!0)},[i]);const c=yt(()=>{i&&u(s=>s&&!1)},[i]),{notifications:a,isLoading:I,isModalOpen:y,isNotificationsOnboarding:p,modalActiveTab:m,handleNotificationsOpen:M,handleOnBegin:A,handleOnChangeModalTab:_}=$a({identity:t??void 0,isNotificationsEnabled:i&&o,initialActiveTab:Fa.NEWEST,notificationsUrl:l,onError:c}),P=yt(()=>{o||u(!0),M()},[M,o]),w=yt((s,v)=>{_(v)},[_]);return{notificationProps:Qa(()=>{if(i)return{locale:r,isLoading:I,isOnboarding:p,isOpen:y,items:a,activeTab:m,onClick:P,onClose:P,onBegin:A,onChangeTab:w}},[i,r,I,p,y,a,m,P,A,w])}}var cr={},ee={},Ct={exports:{}},_t={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){if(r==null)throw new TypeError("Expected a string but received a ".concat(r));if(r.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(r.constructor.name))}e.exports=t.default,e.exports.default=t.default})(_t,_t.exports);var Ht=_t.exports,It={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function r(i,o){for(var u=0;u<o.length;u++){var l=o[u];if(i===l||n(l)&&l.test(i))return!0}return!1}e.exports=t.default,e.exports.default=t.default})(It,It.exports);var Ha=It.exports,Pt={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(i,o){return i.indexOf(o)!==-1};t.default=n,e.exports=t.default,e.exports.default=t.default})(Pt,Pt.exports);var Ba=Pt.exports,At={exports:{}},Rt={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var o in i)typeof r[o]>"u"&&(r[o]=i[o]);return r}e.exports=t.default,e.exports.default=t.default})(Rt,Rt.exports);var ur=Rt.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Ht),r=i(ur);function i(l){return l&&l.__esModule?l:{default:l}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function u(l,c){(0,n.default)(l),c=(0,r.default)(c,o),c.allow_trailing_dot&&l[l.length-1]==="."&&(l=l.substring(0,l.length-1)),c.allow_wildcard===!0&&l.indexOf("*.")===0&&(l=l.substring(2));var a=l.split("."),I=a[a.length-1];return c.require_tld&&(a.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(I)||/\s/.test(I))||!c.allow_numeric_tld&&/^\d+$/.test(I)?!1:a.every(function(y){return!(y.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(y)||/[\uff01-\uff5e]/.test(y)||/^-|-$/.test(y)||!c.allow_underscores&&/_/.test(y))})}e.exports=t.default,e.exports.default=t.default})(At,At.exports);var za=At.exports,Tt={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=I;var n=r(Ht);function r(y){return y&&y.__esModule?y:{default:y}}function i(y){"@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(y)}var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",u="(".concat(o,"[.]){3}").concat(o),l=new RegExp("^".concat(u,"$")),c="(?:[0-9a-fA-F]{1,4})",a=new RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(u,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(u,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(u,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(u,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(u,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(u,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(u,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function I(y){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(y);var m=(i(p)==="object"?p.version:arguments[1])||"";return m?m.toString()==="4"?l.test(y):m.toString()==="6"?a.test(y):!1:I(y,{version:4})||I(y,{version:6})}e.exports=t.default,e.exports.default=t.default})(Tt,Tt.exports);var Ga=Tt.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=P;var n=c(Ht),r=c(Ha),i=c(Ba),o=c(za),u=c(Ga),l=c(ur);function c(w){return w&&w.__esModule?w:{default:w}}function a(w,f){return M(w)||m(w,f)||y(w,f)||I()}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(w,f){if(w){if(typeof w=="string")return p(w,f);var s={}.toString.call(w).slice(8,-1);return s==="Object"&&w.constructor&&(s=w.constructor.name),s==="Map"||s==="Set"?Array.from(w):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?p(w,f):void 0}}function p(w,f){(f==null||f>w.length)&&(f=w.length);for(var s=0,v=Array(f);s<f;s++)v[s]=w[s];return v}function m(w,f){var s=w==null?null:typeof Symbol<"u"&&w[Symbol.iterator]||w["@@iterator"];if(s!=null){var v,S,b,R,C=[],h=!0,d=!1;try{if(b=(s=s.call(w)).next,f!==0)for(;!(h=(v=b.call(s)).done)&&(C.push(v.value),C.length!==f);h=!0);}catch(g){d=!0,S=g}finally{try{if(!h&&s.return!=null&&(R=s.return(),Object(R)!==R))return}finally{if(d)throw S}}return C}}function M(w){if(Array.isArray(w))return w}var A={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},_=/^\[([^\]]+)\](?::([0-9]+))?$/;function P(w,f){if((0,n.default)(w),!w||/[\s<>]/.test(w)||w.indexOf("mailto:")===0||(f=(0,l.default)(f,A),f.validate_length&&w.length>f.max_allowed_length)||!f.allow_fragments&&(0,i.default)(w,"#")||!f.allow_query_components&&((0,i.default)(w,"?")||(0,i.default)(w,"&")))return!1;var s,v,S,b,R,C,h,d;h=w.split("#"),w=h.shift(),h=w.split("?"),w=h.shift();var g=w.match(/^([a-z][a-z0-9+\-.]*):/i),E=!1,T=function(X){return E=!0,s=X.toLowerCase(),f.require_valid_protocol&&f.protocols.indexOf(s)===-1?!1:w.substring(g[0].length)};if(g){var O=g[1],D=w.substring(g[0].length),L=D.slice(0,2)==="//";if(L){if(w=T(O),w===!1)return!1}else{var k=D.indexOf("/"),x=k===-1?D:D.substring(0,k),q=x.indexOf("@");if(q!==-1){var $=x.substring(0,q),z=/^[a-zA-Z0-9\-_.%:]*$/,W=z.test($),F=/%[0-9a-fA-F]{2}/.test($);if(W&&!F){if(f.require_protocol)return!1}else if(w=T(O),w===!1)return!1}else{var Q=/^[0-9]/.test(D);if(Q){if(f.require_protocol)return!1}else if(w=T(O),w===!1)return!1}}}else if(f.require_protocol)return!1;if(w.slice(0,2)==="//"){if(!E&&!f.allow_protocol_relative_urls)return!1;w=w.slice(2)}if(w==="")return!1;if(h=w.split("/"),w=h.shift(),w===""&&!f.require_host)return!0;if(h=w.split("@"),h.length>1){if(f.disallow_auth||h[0]===""||(v=h.shift(),v.indexOf(":")>=0&&v.split(":").length>2))return!1;var K=v.split(":"),U=a(K,2),j=U[0],B=U[1];if(j===""&&B==="")return!1}b=h.join("@"),C=null,d=null;var G=b.match(_);if(G?(S="",d=G[1],C=G[2]||null):(h=b.split(":"),S=h.shift(),h.length&&(C=h.join(":"))),C!==null&&C.length>0){if(R=parseInt(C,10),!/^[0-9]+$/.test(C)||R<=0||R>65535)return!1}else if(f.require_port)return!1;return f.host_whitelist?(0,r.default)(S,f.host_whitelist):S===""&&!f.require_host?!0:!(!(0,u.default)(S)&&!(0,o.default)(S,f)&&(!d||!(0,u.default)(d,6))||(S=S||d,f.host_blacklist&&(0,r.default)(S,f.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(Ct,Ct.exports);var Ka=Ct.exports,Bt={};(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(l){l.GET="get",l.STORE="store",l.CLEAR="clear",l.PING="ping"})(t||(e.Action=t={})),e.SINGLE_SIGN_ON_TARGET="single-sign-on";function n(l){return{target:e.SINGLE_SIGN_ON_TARGET,...l}}e.createMessage=n;function r(l){const c=localStorage.getItem(u(l));if(!c)return null;let a;try{a=JSON.parse(c)}catch{return o(l),null}return a.expiration=new Date(a.expiration),a.expiration.getTime()<=Date.now()?(o(l),null):a}e.localStorageGetIdentity=r;function i(l,c){new Date(c.expiration).getTime()>Date.now()&&localStorage.setItem(u(l),JSON.stringify(c))}e.localStorageStoreIdentity=i;function o(l){localStorage.removeItem(u(l))}e.localStorageClearIdentity=o;function u(l){if(!/^0x[a-fA-F0-9]{40}$/.test(l))throw new Error("User must be a valid ethereum address");return`single-sign-on-${l.toLowerCase()}`}})(Bt);Object.defineProperty(ee,"__esModule",{value:!0});ee.clearIdentity=ee.storeIdentity=ee.getIdentity=ee.init=void 0;const Va=Ka,te=Bt,lr=te.SINGLE_SIGN_ON_TARGET,Un=500,Ya=5;let Qn=0,Je="";const Ja={protocols:["https"],require_protocol:!0};function Xa(e,t={}){if(!(0,Va.default)(e,{...Ja,...t}))throw new Error(`Invalid url: ${e}`);if(Je)throw new Error("Already initialized");const n=document.createElement("iframe");n.id=lr,n.src=e,n.style.width="0",n.style.height="0",n.style.border="none",n.style.position="absolute",document.body.appendChild(n),Je=e}ee.init=Xa;async function Za(e){let t;try{t=(await st(await zt(),te.Action.GET,{user:e})).identity??null}catch(n){Gt(n),t=(0,te.localStorageGetIdentity)(e)}return t}ee.getIdentity=Za;async function eo(e,t){try{await st(await zt(),te.Action.STORE,{user:e,identity:t})}catch(n){Gt(n),(0,te.localStorageStoreIdentity)(e,t)}}ee.storeIdentity=eo;async function to(e){try{await st(await zt(),te.Action.CLEAR,{user:e})}catch(t){Gt(t),(0,te.localStorageClearIdentity)(e)}}ee.clearIdentity=to;async function zt(){if(!Je)throw new Error("Not initialized");for(let e=0;e<Ya;e++){const n=document.getElementById(lr)?.contentWindow;if(!n){await no(Un);continue}try{await st(n,te.Action.PING,{},Un)}catch{continue}return n}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function st(e,t,n,r=0){Qn++;const i=Qn;let o=null;const u=new Promise((l,c)=>{o=({data:a})=>{!a||a.target!==te.SINGLE_SIGN_ON_TARGET||a.id!==i||(a.error?c(new Error(a.error)):l(a))},window.addEventListener("message",o)});e.postMessage((0,te.createMessage)({id:i,action:t,...n}),Je);try{return await(r?Promise.race([u,new Promise((l,c)=>setTimeout(()=>c(new Error("Did not receive a response in time")),r))]):u)}catch(l){throw l}finally{o&&window.removeEventListener("message",o)}}function no(e){return new Promise(t=>setTimeout(t,e))}function Gt(e){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",e.message)}(function(e){var t=Le&&Le.__createBinding||(Object.create?function(r,i,o,u){u===void 0&&(u=o);var l=Object.getOwnPropertyDescriptor(i,o);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,u,l)}:function(r,i,o,u){u===void 0&&(u=o),r[u]=i[o]}),n=Le&&Le.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(ee,e),n(Bt,e)})(cr);const{useEffect:ro,useState:io}=await N("react");function so(){const{address:e}=zn(),t=e||void 0,[n,r]=io(void 0);return ro(()=>{if(!t){r(void 0);return}try{const i=cr.localStorageGetIdentity(t.toLowerCase());r(i??void 0)}catch(i){console.error("[useAuthIdentity] Failed to get identity:",i),r(void 0)}},[t]),{identity:n,hasValidIdentity:!!n,address:t}}function ao(){const e=ae("AUTH_URL")??"/auth";return e.startsWith("http")||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`}function oo(){const e=window.location.pathname,t=window.location.search;return new URLSearchParams(t).get("redirectTo")??`${e}${t}`}function co(e){const t=oo(),n=ao();Gr(),window.location.replace(`${n}/login?redirectTo=${encodeURIComponent(t)}`)}const{Box:dr,styled:fr}=await N("decentraland-ui2"),uo=fr(dr)(()=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:"linear-gradient(180deg, #1A0A2E 0%, #0D0116 100%)"})),lo=fr(dr)({flex:1,width:"100%"}),{useCallback:jn,useMemo:fo}=await N("react"),{useLocation:ho}=await N("react-router-dom"),{usePageTracking:po}=await N("@dcl/hooks"),{Footer:go,FooterLanding:mo,Navbar:yo,NavbarPages:vo,SupportedLanguage:wo}=await N("decentraland-ui2");function bo(e){const{children:t}=e,n=ho(),{address:r,isConnected:i,isConnecting:o,isDisconnecting:u,disconnect:l}=zn();po(n.pathname);const{identity:c}=so(),{notificationProps:a}=Wa({identity:c,isConnected:i,locale:"en"}),{data:I}=ir(r??void 0,{skip:!r}),y=I?.avatars?.[0],p=jn(()=>{co()},[]),m=jn(()=>{l()},[l]),M=fo(()=>({activePage:vo.EXPLORE,isSignedIn:i,isSigningIn:o,isDisconnecting:u,isActivity:!1,address:r||void 0,avatar:y,notifications:a,onClickSignIn:p,onClickSignOut:m,onClickNavbarItem:A=>{const _=A.currentTarget;_?.href&&(window.location.href=_.href)}}),[i,o,u,r,y,a,p,m]);return H.jsxs(uo,{children:[H.jsx(yo,{...M}),H.jsx(lo,{children:t}),H.jsx(mo,{}),H.jsx(go,{languages:[{code:wo.EN,name:"English",flag:"🇺🇸"}],hideSocialNetworks:!0})]})}const So="https://cdn.decentraland.org/@dcl/explore-site/0.0.1-24138829632.commit-0946e16/assets/top_background-Bnd2vX_F.webp",{Box:hr,styled:pr}=await N("decentraland-ui2"),Eo=pr(hr)(({standalone:e,theme:t})=>({position:"relative",background:`url(${So}) no-repeat top center, radial-gradient(61.64% 109.58% at 50% 54.49%, #A042CD 0%, #270537 100%)`,backgroundSize:"100% auto, 100% auto","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%)",pointerEvents:"none"},padding:t.spacing(5,8,2,8),[t.breakpoints.down("lg")]:{padding:t.spacing(5,4,2,4)},[t.breakpoints.down("md")]:{padding:t.spacing(5,3,2,3)},[t.breakpoints.down("sm")]:{padding:t.spacing(3,2,2,2)},...!e&&{paddingTop:0}})),Co=pr(hr)(({standalone:e,theme:t})=>({position:"relative",zIndex:1,display:"flex",flexDirection:"column",gap:t.spacing(4),paddingTop:e?"66px":"96px"}));function Ho({standalone:e=!0}){const t=H.jsx(Eo,{component:"main",standalone:e,children:H.jsx(Co,{standalone:e,children:H.jsx(qa,{})})});return e?H.jsx(bo,{children:t}):t}export{Ho as H,ko as W,Lo as a,xo as c,Wo as e,ae as g,Do as m,la as s};
1
+ const __vite__fileDeps=["assets/index-CVdhIPEJ.js","assets/index-CNMKbeE1.js","assets/index-CGCGB-at.js","assets/index-DOSLaa4d.js","assets/__federation_fn_import-DHP1HS9A.js","assets/hooks.module-Dz_XB4AG.js","assets/index-CdrMQoR6.js","assets/_commonjsHelpers-C4iS2aBk.js","assets/createClient-CCWiffBP.js","assets/uid-CuZf7FK0.js","assets/preload-helper-CIxxV7Wp.js","assets/index-nibyPLVP.js","assets/index-D6O4pjzC.js","assets/___vite-browser-external_commonjs-proxy-BqV5D26a.js","assets/inherits_browser-BlmhoU4v.js","assets/index-JFBsW0Hp.js","assets/tslib.es6-DbvBTznf.js","assets/index.es-3vuqm7DP.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ import{importShared as N}from"./__federation_fn_import-DHP1HS9A.js";import{j as H}from"./jsx-runtime-B1l0k91v.js";import{c as mr,E as at,r as $n,i as Fn,d as yr}from"./SensorsRounded-WVFgO4_x.js";import{w as Yt,e as vr,g as Jt,b as wr,h as Wn,i as br,o as Sr,d as Er}from"./reselect-BfUrOuXx.js";import{d as Xe}from"./defineChain-7I0Ce1VT.js";import{_ as Te}from"./preload-helper-CIxxV7Wp.js";import{c as Mt,C as Ot,P as Xt,i as Cr,S as Hn,M as _r,n as Y,m as Zt,a as re,h as Bn,Q as Ir,b as en,f as Pr,o as tn,r as nn,d as Ar,e as rn,g as sn,p as an,s as Rr,j as Tr}from"./QueryClientProvider-wu2IqrXs.js";import{c as Le}from"./_commonjsHelpers-C4iS2aBk.js";const Mr=Xe({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Or=Xe({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Dr=Xe({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),xr=Xe({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0});await N("@dcl/schemas");const kr=[Mr,Or],Lr=[xr,Dr],Dt=[...kr,...Lr];function Nr(e){return Dt.some(t=>t.id===e)}const{createConnector:qr}=await N("wagmi"),{ChainId:Ae}=await N("@dcl/schemas"),on={[Ae.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet?project=magic",[Ae.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia?project=magic",[Ae.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon?project=magic",[Ae.MATIC_AMOY]:"https://rpc.decentraland.org/amoy?project=magic"};function Do(e){const{apiKey:t}=e;let n=null,r=null;async function i(o){const{Magic:u}=await Te(async()=>{const{Magic:a}=await import("./index-CVdhIPEJ.js");return{Magic:a}},__vite__mapDeps([0,1])),{OAuthExtension:l}=await Te(async()=>{const{OAuthExtension:a}=await import("./index-CGCGB-at.js");return{OAuthExtension:a}},__vite__mapDeps([2,1])),c=on[o]||on[Ae.ETHEREUM_MAINNET];return new u(t,{extensions:[new l],network:{rpcUrl:c,chainId:o}})}return qr(o=>{async function u(){return r?await r.request({method:"eth_accounts"}):[]}async function l(c){r=await n.wallet.getProvider();const a=await u();return a.length===0?null:(await o.storage?.setItem("magicChainId",c),{accounts:a,chainId:c})}return{id:"magic",name:"Magic",type:"magic",async setup(){const a=await o.storage?.getItem("magicChainId")??o.chains[0]?.id;if(a)try{if(n=await i(a),await n.user.isLoggedIn()){const y=await l(a);y&&o.emitter.emit("connect",y)}}catch{}},async connect({chainId:c}={}){const a=c??o.chains[0].id;if(n||(n=await i(a)),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in. Please authenticate via the auth dapp first.");const y=await l(a);if(!y)throw new Error("Magic: No accounts found");return y},async disconnect(){n&&await n.user.logout(),n=null,r=null,await o.storage?.removeItem("magicChainId")},async getAccounts(){return u()},async getChainId(){return await o.storage?.getItem("magicChainId")??o.chains[0].id},async getProvider(){return!r&&n&&(r=await n.wallet.getProvider()),r},async isAuthorized(){try{if(!n){const a=await o.storage?.getItem("magicChainId")??o.chains[0]?.id;if(!a)return!1;n=await i(a)}return await n.user.isLoggedIn()}catch{return!1}},async switchChain({chainId:c}){const a=o.chains.find(y=>y.id===c);if(!a)throw new Error(`Chain ${c} not configured`);if(n=await i(c),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in");return r=await n.wallet.getProvider(),await o.storage?.setItem("magicChainId",c),o.emitter.emit("change",{chainId:c}),a},onAccountsChanged(c){c.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:c})},onChainChanged(c){const a=Number(c);o.emitter.emit("change",{chainId:a})},onDisconnect(){o.emitter.emit("disconnect"),n=null,r=null}}})}await N("wagmi");await N("@dcl/schemas");function Ur(e){const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const r=e.transports?.[t.id]?.({chain:t});return(r?.value?.transports||[r]).map(({value:o})=>o?.url||n)}const{getAddress:we,numberToHex:He,SwitchChainError:Be,UserRejectedRequestError:be}=await N("viem");Ze.type="coinbaseWallet";function Ze(e={}){return e.version==="3"||e.headlessMode?jr(e):Qr(e)}function Qr(e){let t,n,r,i;return Mt(o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Ze.type,async connect({chainId:u,withCapabilities:l,...c}={}){try{const a=await this.getProvider(),I=(await a.request({method:"eth_requestAccounts",params:"instantOnboarding"in c&&c.instantOnboarding?[{onboarding:"instant"}]:[]})).map(p=>we(p));n||(n=this.onAccountsChanged.bind(this),a.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),a.on("chainChanged",r)),i||(i=this.onDisconnect.bind(this),a.on("disconnect",i));let y=await this.getChainId();return u&&y!==u&&(y=(await this.switchChain({chainId:u}).catch(m=>{if(m.code===be.code)throw m;return{id:y}}))?.id??y),{accounts:l?I.map(p=>({address:p,capabilities:{}})):I,chainId:y}}catch(a){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(a.message)?new be(a):a}},async disconnect(){const u=await this.getProvider();n&&(u.removeListener("accountsChanged",n),n=void 0),r&&(u.removeListener("chainChanged",r),r=void 0),i&&(u.removeListener("disconnect",i),i=void 0),u.disconnect(),u.close?.()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>we(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){if(!t){const u=typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:e.preference?.options??"all"},{createCoinbaseWalletSDK:l}=await Te(async()=>{const{createCoinbaseWalletSDK:a}=await import("./index-DOSLaa4d.js");return{createCoinbaseWalletSDK:a}},__vite__mapDeps([3,4,5,6,7,8,9,10,11]));t=l({...e,appChainIds:o.chains.map(a=>a.id),preference:u}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:l}){const c=o.chains.find(I=>I.id===l);if(!c)throw new Be(new Ot);const a=await this.getProvider();try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:He(c.id)}]}),c}catch(I){if(I.code===4902)try{let y;u?.blockExplorerUrls?y=u.blockExplorerUrls:y=c.blockExplorers?.default.url?[c.blockExplorers?.default.url]:[];let p;u?.rpcUrls?.length?p=u.rpcUrls:p=[c.rpcUrls.default?.http[0]??""];const m={blockExplorerUrls:y,chainId:He(l),chainName:u?.chainName??c.name,iconUrls:u?.iconUrls,nativeCurrency:u?.nativeCurrency??c.nativeCurrency,rpcUrls:p};return await a.request({method:"wallet_addEthereumChain",params:[m]}),c}catch(y){throw new be(y)}throw new Be(I)}},onAccountsChanged(u){u.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:u.map(l=>we(l))})},onChainChanged(u){const l=Number(u);o.emitter.emit("change",{chainId:l})},async onDisconnect(u){o.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),i&&(l.removeListener("disconnect",i),i=void 0)}}))}function jr(e){let n,r,i,o,u;return Mt(l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Ze.type,async connect({chainId:c,withCapabilities:a}={}){try{const I=await this.getProvider(),y=(await I.request({method:"eth_requestAccounts"})).map(m=>we(m));i||(i=this.onAccountsChanged.bind(this),I.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),I.on("chainChanged",o)),u||(u=this.onDisconnect.bind(this),I.on("disconnect",u));let p=await this.getChainId();return c&&p!==c&&(p=(await this.switchChain({chainId:c}).catch(M=>{if(M.code===be.code)throw M;return{id:p}}))?.id??p),{accounts:a?y.map(m=>({address:m,capabilities:{}})):y,chainId:p}}catch(I){throw/(user closed modal|accounts received is empty|user denied account)/i.test(I.message)?new be(I):I}},async disconnect(){const c=await this.getProvider();i&&(c.removeListener("accountsChanged",i),i=void 0),o&&(c.removeListener("chainChanged",o),o=void 0),u&&(c.removeListener("disconnect",u),u=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>we(a))},async getChainId(){const a=await(await this.getProvider()).request({method:"eth_chainId"});return Number(a)},async getProvider(){if(!r){const c=await(async()=>{const{default:m}=await Te(async()=>{const{default:M}=await import("./index-D6O4pjzC.js").then(A=>A.i);return{default:M}},__vite__mapDeps([12,7,13,6,14,15,5,16]));return typeof m!="function"&&typeof m.default=="function"?m.default:m})();n=new c({...e,reloadOnDisconnect:!1});const a=n.walletExtension?.getChainId(),I=l.chains.find(m=>e.chainId?m.id===e.chainId:m.id===a)||l.chains[0],y=e.chainId||I?.id,p=e.jsonRpcUrl||I?.rpcUrls.default.http[0];r=n.makeWeb3Provider(p,y)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:a}){const I=l.chains.find(p=>p.id===a);if(!I)throw new Be(new Ot);const y=await this.getProvider();try{return await y.request({method:"wallet_switchEthereumChain",params:[{chainId:He(I.id)}]}),I}catch(p){if(p.code===4902)try{let m;c?.blockExplorerUrls?m=c.blockExplorerUrls:m=I.blockExplorers?.default.url?[I.blockExplorers?.default.url]:[];let M;c?.rpcUrls?.length?M=c.rpcUrls:M=[I.rpcUrls.default?.http[0]??""];const A={blockExplorerUrls:m,chainId:He(a),chainName:c?.chainName??I.name,iconUrls:c?.iconUrls,nativeCurrency:c?.nativeCurrency??I.nativeCurrency,rpcUrls:M};return await y.request({method:"wallet_addEthereumChain",params:[A]}),I}catch(m){throw new be(m)}throw new Be(p)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(a=>we(a))})},onChainChanged(c){const a=Number(c);l.emitter.emit("change",{chainId:a})},async onDisconnect(c){l.emitter.emit("disconnect");const a=await this.getProvider();i&&(a.removeListener("accountsChanged",i),i=void 0),o&&(a.removeListener("chainChanged",o),o=void 0),u&&(a.removeListener("disconnect",u),u=void 0)}}))}const{getAddress:ot,numberToHex:cn,SwitchChainError:$r,UserRejectedRequestError:Ne}=await N("viem");xt.type="walletConnect";function xt(e){const t=e.isNewChainsStale??!0;let n,r;const i="eip155";let o,u,l,c,a,I;return Mt(y=>({id:"walletConnect",name:"WalletConnect",type:xt.type,async setup(){const p=await this.getProvider().catch(()=>null);p&&(l||(l=this.onConnect.bind(this),p.on("connect",l)),a||(a=this.onSessionDelete.bind(this),p.on("session_delete",a)))},async connect({chainId:p,withCapabilities:m,...M}={}){try{const A=await this.getProvider();if(!A)throw new Xt;c||(c=this.onDisplayUri,A.on("display_uri",c));let _=p;if(!_){const s=await y.storage?.getItem("state")??{};y.chains.some(S=>S.id===s.chainId)?_=s.chainId:_=y.chains[0]?.id}if(!_)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if(A.session&&P&&await A.disconnect(),!A.session||P){const s=y.chains.filter(v=>v.id!==_).map(v=>v.id);await A.connect({optionalChains:[_,...s],..."pairingTopic"in M?{pairingTopic:M.pairingTopic}:{}}),this.setRequestedChainsIds(y.chains.map(v=>v.id))}const w=(await A.enable()).map(s=>ot(s));let f=await this.getChainId();return p&&f!==p&&(f=(await this.switchChain({chainId:p}).catch(v=>{if(v.code===Ne.code&&v.cause?.message!=="Missing or invalid. request() method: wallet_addEthereumChain")throw v;return{id:f}}))?.id??f),c&&(A.removeListener("display_uri",c),c=void 0),l&&(A.removeListener("connect",l),l=void 0),o||(o=this.onAccountsChanged.bind(this),A.on("accountsChanged",o)),u||(u=this.onChainChanged.bind(this),A.on("chainChanged",u)),I||(I=this.onDisconnect.bind(this),A.on("disconnect",I)),a||(a=this.onSessionDelete.bind(this),A.on("session_delete",a)),{accounts:m?w.map(s=>({address:s,capabilities:{}})):w,chainId:f}}catch(A){throw/(user rejected|connection request reset)/i.test(A?.message)?new Ne(A):A}},async disconnect(){const p=await this.getProvider();try{await p?.disconnect()}catch(m){if(!/No matching key/i.test(m.message))throw m}finally{u&&(p?.removeListener("chainChanged",u),u=void 0),I&&(p?.removeListener("disconnect",I),I=void 0),l||(l=this.onConnect.bind(this),p?.on("connect",l)),o&&(p?.removeListener("accountsChanged",o),o=void 0),a&&(p?.removeListener("session_delete",a),a=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(m=>ot(m))},async getProvider({chainId:p}={}){async function m(){const M=y.chains.map(_=>_.id);if(!M.length)return;const{EthereumProvider:A}=await Te(async()=>{const{EthereumProvider:_}=await import("./index.es-3vuqm7DP.js").then(P=>P.G);return{EthereumProvider:_}},__vite__mapDeps([17,10,7,4,11]));return await A.init({...e,disableProviderPing:!0,optionalChains:M,projectId:e.projectId,rpcMap:Object.fromEntries(y.chains.map(_=>{const[P]=Ur({chain:_,transports:y.transports});return[_.id,P]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=m()),n=await r,n?.events.setMaxListeners(Number.POSITIVE_INFINITY)),p&&await this.switchChain?.({chainId:p}),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[p,m]=await Promise.all([this.getAccounts(),this.getProvider()]);return p.length?await this.isChainsStale()&&m.session?(await m.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:p,chainId:m}){const M=await this.getProvider();if(!M)throw new Xt;const A=y.chains.find(_=>_.id===m);if(!A)throw new $r(new Ot);try{await Promise.all([new Promise(P=>{const w=({chainId:f})=>{f===m&&(y.emitter.off("change",w),P())};y.emitter.on("change",w)}),M.request({method:"wallet_switchEthereumChain",params:[{chainId:cn(m)}]})]);const _=await this.getRequestedChainsIds();return this.setRequestedChainsIds([..._,m]),A}catch(_){const P=_;if(/(user rejected)/i.test(P.message))throw new Ne(P);try{let w;p?.blockExplorerUrls?w=p.blockExplorerUrls:w=A.blockExplorers?.default.url?[A.blockExplorers?.default.url]:[];let f;p?.rpcUrls?.length?f=p.rpcUrls:f=[...A.rpcUrls.default.http];const s={blockExplorerUrls:w,chainId:cn(m),chainName:p?.chainName??A.name,iconUrls:p?.iconUrls,nativeCurrency:p?.nativeCurrency??A.nativeCurrency,rpcUrls:f};await M.request({method:"wallet_addEthereumChain",params:[s]});const v=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...v,m]),A}catch(w){throw new Ne(w)}}},onAccountsChanged(p){p.length===0?this.onDisconnect():y.emitter.emit("change",{accounts:p.map(m=>ot(m))})},onChainChanged(p){const m=Number(p);y.emitter.emit("change",{chainId:m})},async onConnect(p){const m=Number(p.chainId),M=await this.getAccounts();y.emitter.emit("connect",{accounts:M,chainId:m})},async onDisconnect(p){this.setRequestedChainsIds([]),y.emitter.emit("disconnect");const m=await this.getProvider();o&&(m.removeListener("accountsChanged",o),o=void 0),u&&(m.removeListener("chainChanged",u),u=void 0),I&&(m.removeListener("disconnect",I),I=void 0),a&&(m.removeListener("session_delete",a),a=void 0),l||(l=this.onConnect.bind(this),m.on("connect",l))},onDisplayUri(p){y.emitter.emit("message",{type:"display_uri",data:p})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){return n?n.session?.namespaces[i]?.accounts?.map(m=>Number.parseInt(m.split(":")[1]||"",10))??[]:[]},async getRequestedChainsIds(){return await y.storage?.getItem(this.requestedChainsStorageKey)??[]},async isChainsStale(){if(!t)return!1;const p=y.chains.map(A=>A.id),m=this.getNamespaceChainsIds();if(m.length&&!m.some(A=>p.includes(A)))return!1;const M=await this.getRequestedChainsIds();return!p.every(A=>M.includes(A))},async setRequestedChainsIds(p){await y.storage?.setItem(this.requestedChainsStorageKey,p)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}const{createConfig:Fr,http:vt}=await N("wagmi"),{ChainId:qe}=await N("@dcl/schemas"),ge={name:"Decentraland",description:"Decentraland dApp",url:"https://decentraland.org",icons:["https://cdn.decentraland.org/@dcl/marketplace-site/6.41.1/favicon.ico"]},Wr={[qe.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[qe.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[qe.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[qe.MATIC_AMOY]:"https://rpc.decentraland.org/amoy"},Hr=Dt.reduce((e,t)=>{const n=Wr[t.id];return e[t.id]=n?vt(n):vt(),e},{});function Br(e,t){const n=t.trim();if(!n)return e;const r=e.replace(/\/+$/,""),i=n.startsWith("/")?n:`/${n}`;return`${r}${i}`}function zr(e){if(!e)return ge;const t=e.url??(e.urlPath?Br(ge.url,e.urlPath):ge.url);return{name:e.name??ge.name,description:e.description??ge.description,url:t,icons:e.icons??ge.icons}}function xo(e={}){const{walletConnectProjectId:t,appMetadata:n,chains:r=Dt,transports:i,connectors:o={},additionalConnectors:u=[]}=e,l=zr(n),{injected:c=!0,walletConnect:a=!0,coinbaseWallet:I=!0}=o,y=r.reduce((m,M)=>(m[M.id]=i?.[M.id]??Hr[M.id]??vt(),m),{}),p=[];return c&&p.push(Cr()),a&&t&&p.push(xt({projectId:t,metadata:{name:l.name,description:l.description??"",url:l.url??"",icons:l.icons??[]}})),I&&p.push(Ze({appName:l.name})),p.push(...u),Fr({chains:r,transports:y,connectors:p})}function Gr(){if(typeof window>"u"||!window.localStorage)return;const e=[],{localStorage:t}=window;for(let n=0;n<t.length;n++){const r=t.key(n);r?.startsWith("wagmi.")&&e.push(r)}e.forEach(n=>t.removeItem(n))}await N("react");await N("react-redux");await N("wagmi");const xe=e=>e.wallet,Kr=e=>xe(e).address,Vr=e=>xe(e).isConnected,Yr=e=>xe(e).isConnecting,Jr=e=>xe(e).isDisconnecting,Xr=e=>xe(e).error;await N("react-redux");await N("wagmi");const{useCallback:un}=await N("react"),{useSelector:Ee}=await N("react-redux"),{useConnect:Zr,useDisconnect:ei}=await N("wagmi");function zn(){const e=Ee(Kr),t=Ee(Vr),n=Ee(Yr),r=Ee(Jr),i=Ee(Xr),{connect:o,connectors:u,isPending:l}=Zr(),{disconnect:c,isPending:a}=ei(),I=un(p=>{o({connector:p})},[o]),y=un(()=>{c()},[c]);return{address:e,isConnected:t,isConnecting:n||l,isDisconnecting:r||a,error:i,connectors:u,connect:I,disconnect:y}}var ti=class extends Hn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new _r({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ue(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ue(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ue(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ue(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Y.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Zt(t,n))}findAll(e={}){return this.getAll().filter(t=>Zt(e,t))}notify(e){Y.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Y.batch(()=>Promise.all(e.map(t=>t.continue().catch(re))))}};function Ue(e){return e.options.scope?.id}var ni=class extends Hn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Bn(r,t);let o=this.get(i);return o||(o=new Ir({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Y.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>en(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>en(e,n)):t}notify(e){Y.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Y.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Y.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ri=class{#e;#t;#n;#i;#s;#r;#a;#o;constructor(e={}){this.#e=e.queryCache||new ni,this.#t=e.mutationCache||new ti,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=Pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,u=Ar(t,o);if(u!==void 0)return this.#e.build(this,r).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Y.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Y.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Y.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Y.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(re).catch(re)}invalidateQueries(e,t={}){return Y.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Y.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(re)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(re)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(re).catch(re)}fetchInfiniteQuery(e){return e.behavior=rn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(re).catch(re)}ensureInfiniteQueryData(e){return e.behavior=rn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(sn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{an(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(sn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{an(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bn(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===Rr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const{useMemo:ii}=await N("react"),{WagmiProvider:si}=await N("wagmi");function ai(){return new ri({defaultOptions:{queries:{staleTime:1e3*60,retry:1}}})}function ko({config:e,queryClient:t,children:n}){const r=ii(()=>t??ai(),[t]);return H.jsx(si,{config:e,children:H.jsx(Tr,{client:r,children:n})})}const{createSlice:oi}=await N("@reduxjs/toolkit"),ln={chainId:null,isSupportedNetwork:!1,isNetworkSwitching:!1,error:null},ci=oi({name:"network",initialState:ln,reducers:{setChain(e,t){e.chainId=t.payload,e.isSupportedNetwork=t.payload!==null&&Nr(t.payload),e.isNetworkSwitching=!1,e.error=null},setSwitching(e,t){e.isNetworkSwitching=t.payload,t.payload&&(e.error=null)},setError(e,t){e.error=t.payload,e.isNetworkSwitching=!1},reset(){return ln}}}),{actions:ui,reducer:li}=ci,{createSlice:di}=await N("@reduxjs/toolkit"),dn={address:null,isConnected:!1,isConnecting:!1,isDisconnecting:!1,error:null},fi=di({name:"wallet",initialState:dn,reducers:{setAccount(e,t){e.address=t.payload,e.isConnected=t.payload!==null,e.isConnecting=!1,e.error=null},setConnecting(e,t){e.isConnecting=t.payload,t.payload&&(e.error=null)},setDisconnecting(e,t){e.isDisconnecting=t.payload},setError(e,t){e.error=t.payload,e.isConnecting=!1,e.isDisconnecting=!1},reset(){return dn}}}),{actions:ct,reducer:hi}=fi,{useEffect:Qe}=await N("react"),{useDispatch:pi}=await N("react-redux"),{useAccount:gi,useChainId:mi}=await N("wagmi");function Lo({children:e}){const t=pi(),{address:n,isConnecting:r,isConnected:i,isReconnecting:o}=gi(),u=mi();return Qe(()=>{t(ct.setAccount(n??null))},[t,n]),Qe(()=>{t(ct.setConnecting(r||o))},[t,r,o]),Qe(()=>{i||t(ct.reset())},[t,i]),Qe(()=>{t(ui.setChain(i?u:null))},[t,u,i]),H.jsx(H.Fragment,{children:e})}const{createSlice:yi}=await N("@reduxjs/toolkit"),fn={transactions:{},pending:[]},vi=yi({name:"transactions",initialState:fn,reducers:{addTransaction(e,t){const n=t.payload;e.transactions[n.hash]=n,n.status==="pending"&&!e.pending.includes(n.hash)&&e.pending.push(n.hash)},updateTransaction(e,t){const{hash:n,status:r,error:i}=t.payload,o=e.transactions[n];o&&(o.status=r,o.error=i,r!=="pending"&&(e.pending=e.pending.filter(u=>u!==n)))},removeTransaction(e,t){const n=t.payload;delete e.transactions[n],e.pending=e.pending.filter(r=>r!==n)},reset(){return fn}}}),{actions:No,reducer:wi}=vi;var bi=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},Gn=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Gn||{});function hn(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}const{createAction:Se,createSlice:me,createSelector:Si,createAsyncThunk:pn,combineReducers:Ei,createNextState:kt,isAnyOf:ze,isAllOf:ut,isAction:Ci,isPending:Kn,isRejected:Lt,isFulfilled:fe,isRejectedWithValue:Nt,isAsyncThunkAction:gn,prepareAutoBatched:Ce,SHOULD_AUTOBATCH:Vn,isPlainObject:Me,nanoid:Yn}=await N("@reduxjs/toolkit");var mn=Me;function qt(e,t){if(e===t||!(mn(e)&&mn(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const u of n)o[u]=qt(e[u],t[u]),i&&(i=e[u]===o[u]);return i?e:o}var yn=e=>[].concat(...e);function _i(e){return new RegExp("(^|:)//").test(e)}function Ii(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Ut(e){return e!=null}function vn(e){return[...e?.values()??[]].filter(Ut)}function Pi(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Ai=e=>e.replace(/\/$/,""),Ri=e=>e.replace(/^\//,"");function Ti(e,t){if(!e)return t;if(!t)return e;if(_i(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Ai(e),t=Ri(t),`${e}${n}${t}`}function Ge(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var wt=()=>new Map,wn=(...e)=>fetch(...e),Mi=e=>e.status>=200&&e.status<=299,Oi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function bn(e){if(!Me(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Di=e=>typeof e=="object"&&(Me(e)||Array.isArray(e)||typeof e.toJSON=="function");function xi({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:n=wn,paramsSerializer:r,isJsonContentType:i=Oi,jsonContentType:o="application/json",jsonReplacer:u,timeout:l,responseHandler:c,validateStatus:a,...I}={}){return typeof fetch>"u"&&n===wn&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(p,m,M)=>{const{getState:A,extra:_,endpoint:P,forced:w,type:f}=m;let s,{url:v,headers:S=new Headers(I.headers),params:b=void 0,responseHandler:R=c??"json",validateStatus:C=a??Mi,timeout:h=l,...d}=typeof p=="string"?{url:p}:p,g,E=m.signal;h&&(g=new AbortController,m.signal.addEventListener("abort",g.abort),E=g.signal);let T={...I,signal:E,...d};S=new Headers(bn(S)),T.headers=await t(S,{getState:A,arg:p,extra:_,endpoint:P,forced:w,type:f,extraOptions:M})||S;const O=Di(T.body);if(T.body!=null&&!O&&typeof T.body!="string"&&T.headers.delete("content-type"),!T.headers.has("content-type")&&O&&T.headers.set("content-type",o),O&&i(T.headers)&&(T.body=JSON.stringify(T.body,u)),T.headers.has("accept")||(R==="json"?T.headers.set("accept","application/json"):R==="text"&&T.headers.set("accept","text/plain, text/html, */*")),b){const F=~v.indexOf("?")?"&":"?",Q=r?r(b):new URLSearchParams(bn(b));v+=F+Q}v=Ti(e,v);const D=new Request(v,T);s={request:new Request(v,T)};let k,x=!1,q=g&&setTimeout(()=>{x=!0,g.abort()},h);try{k=await n(D)}catch(F){return{error:{status:x?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(F)},meta:s}}finally{q&&clearTimeout(q),g?.signal.removeEventListener("abort",g.abort)}const $=k.clone();s.response=$;let z,W="";try{let F;if(await Promise.all([y(k,R).then(Q=>z=Q,Q=>F=Q),$.text().then(Q=>W=Q,()=>{})]),F)throw F}catch(F){return{error:{status:"PARSING_ERROR",originalStatus:k.status,data:W,error:String(F)},meta:s}}return C(k,z)?{data:z,meta:s}:{error:{status:k.status,data:z},meta:s}};async function y(p,m){if(typeof m=="function")return m(p);if(m==="content-type"&&(m=i(p.headers)?"json":"text"),m==="json"){const M=await p.text();return M.length?JSON.parse(M):null}return p.text()}}var Sn=class{constructor(e,t=void 0){this.value=e,this.meta=t}},et=Se("__rtkq/focused"),Qt=Se("__rtkq/unfocused"),tt=Se("__rtkq/online"),jt=Se("__rtkq/offline"),lt=!1;function ki(e,t){function n(){const r=()=>e(et()),i=()=>e(Qt()),o=()=>e(tt()),u=()=>e(jt()),l=()=>{window.document.visibilityState==="visible"?r():i()};return lt||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",l,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",o,!1),window.addEventListener("offline",u,!1),lt=!0),()=>{window.removeEventListener("focus",r),window.removeEventListener("visibilitychange",l),window.removeEventListener("online",o),window.removeEventListener("offline",u),lt=!1}}return n()}function nt(e){return e.type==="query"}function Li(e){return e.type==="mutation"}function rt(e){return e.type==="infinitequery"}function Ke(e){return nt(e)||rt(e)}function $t(e,t,n,r,i,o){return Ni(e)?e(t,n,r,i).filter(Ut).map(bt).map(o):Array.isArray(e)?e.map(bt).map(o):[]}function Ni(e){return typeof e=="function"}function bt(e){return typeof e=="string"?{type:e}:e}await N("@reduxjs/toolkit");function qi(e,t){return e.catch(t)}var Oe=Symbol("forceQueryFn"),St=e=>typeof e[Oe]=="function";function Ui({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:o,getInternalState:u}){const l=s=>u(s)?.runningQueries,c=s=>u(s)?.runningMutations,{unsubscribeQueryResult:a,removeMutationResult:I,updateSubscriptionOptions:y}=i.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:w,buildInitiateMutation:f,getRunningQueryThunk:p,getRunningMutationThunk:m,getRunningQueriesThunk:M,getRunningMutationsThunk:A};function p(s,v){return S=>{const b=o.endpointDefinitions[s],R=e({queryArgs:v,endpointDefinition:b,endpointName:s});return l(S)?.get(R)}}function m(s,v){return S=>c(S)?.get(v)}function M(){return s=>vn(l(s))}function A(){return s=>vn(c(s))}function _(s,v){const S=(b,{subscribe:R=!0,forceRefetch:C,subscriptionOptions:h,[Oe]:d,...g}={})=>(E,T)=>{const O=e({queryArgs:b,endpointDefinition:v,endpointName:s});let D;const L={...g,type:"query",subscribe:R,forceRefetch:C,subscriptionOptions:h,endpointName:s,originalArgs:b,queryCacheKey:O,[Oe]:d};if(nt(v))D=t(L);else{const{direction:U,initialPageParam:j}=g;D=n({...L,direction:U,initialPageParam:j})}const k=i.endpoints[s].select(b),x=E(D),q=k(T()),{requestId:$,abort:z}=x,W=q.requestId!==$,F=l(E)?.get(O),Q=()=>k(T()),K=Object.assign(d?x.then(Q):W&&!F?Promise.resolve(q):Promise.all([F,x]).then(Q),{arg:b,requestId:$,subscriptionOptions:h,queryCacheKey:O,abort:z,async unwrap(){const U=await K;if(U.isError)throw U.error;return U.data},refetch:()=>E(S(b,{subscribe:!1,forceRefetch:!0})),unsubscribe(){R&&E(a({queryCacheKey:O,requestId:$}))},updateSubscriptionOptions(U){K.subscriptionOptions=U,E(y({endpointName:s,requestId:$,queryCacheKey:O,options:U}))}});if(!F&&!W&&!d){const U=l(E);U.set(O,K),K.then(()=>{U.delete(O)})}return K};return S}function P(s,v){return _(s,v)}function w(s,v){return _(s,v)}function f(s){return(v,{track:S=!0,fixedCacheKey:b}={})=>(R,C)=>{const h=r({type:"mutation",endpointName:s,originalArgs:v,track:S,fixedCacheKey:b}),d=R(h),{requestId:g,abort:E,unwrap:T}=d,O=qi(d.unwrap().then(x=>({data:x})),x=>({error:x})),D=()=>{R(I({requestId:g,fixedCacheKey:b}))},L=Object.assign(O,{arg:d.arg,requestId:g,abort:E,unwrap:T,reset:D}),k=c(R);return k.set(g,L),L.then(()=>{k.delete(g)}),b&&(k.set(b,L),L.then(()=>{k.get(b)===L&&k.delete(b)})),L}}}var Jn=class extends bi{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}},ce=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function ue(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new Jn(i.issues,t,n,r);return i.value}function En(e){return e}var _e=(e={})=>({...e,[Vn]:!0});function Qi({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:o,selectors:u,onSchemaFailure:l,catchSchemaFailure:c,skipSchemaValidation:a}){const I=(d,g,E,T)=>(O,D)=>{const L=n[d],k=r({queryArgs:g,endpointDefinition:L,endpointName:d});if(O(i.internalActions.queryResultPatched({queryCacheKey:k,patches:E})),!T)return;const x=i.endpoints[d].select(g)(D()),q=$t(L.providesTags,x.data,void 0,g,{},o);O(i.internalActions.updateProvidedBy([{queryCacheKey:k,providedTags:q}]))};function y(d,g,E=0){const T=[g,...d];return E&&T.length>E?T.slice(0,-1):T}function p(d,g,E=0){const T=[...d,g];return E&&T.length>E?T.slice(1):T}const m=(d,g,E,T=!0)=>(O,D)=>{const k=i.endpoints[d].select(g)(D()),x={patches:[],inversePatches:[],undo:()=>O(i.util.patchQueryData(d,g,x.inversePatches,T))};if(k.status==="uninitialized")return x;let q;if("data"in k)if(wr(k.data)){const[$,z,W]=Wn(k.data,E);x.patches.push(...z),x.inversePatches.push(...W),q=$}else q=E(k.data),x.patches.push({op:"replace",path:[],value:q}),x.inversePatches.push({op:"replace",path:[],value:k.data});return x.patches.length===0||O(i.util.patchQueryData(d,g,x.patches,T)),x},M=(d,g,E)=>T=>T(i.endpoints[d].initiate(g,{subscribe:!1,forceRefetch:!0,[Oe]:()=>({data:E})})),A=(d,g)=>d.query&&d[g]?d[g]:En,_=async(d,{signal:g,abort:E,rejectWithValue:T,fulfillWithValue:O,dispatch:D,getState:L,extra:k})=>{const x=n[d.endpointName],{metaSchema:q,skipSchemaValidation:$=a}=x;try{let z=En;const W={signal:g,abort:E,dispatch:D,getState:L,extra:k,endpoint:d.endpointName,type:d.type,forced:d.type==="query"?P(d,L()):void 0,queryCacheKey:d.type==="query"?d.queryCacheKey:void 0},F=d.type==="query"?d[Oe]:void 0;let Q;const K=async(j,B,G,oe)=>{if(B==null&&j.pages.length)return Promise.resolve({data:j});const X={queryArg:d.originalArgs,pageParam:B},he=await U(X),Z=oe?y:p;return{data:{pages:Z(j.pages,he.data,G),pageParams:Z(j.pageParams,B,G)},meta:he.meta}};async function U(j){let B;const{extraOptions:G,argSchema:oe,rawResponseSchema:X,responseSchema:he}=x;if(oe&&!ce($,"arg")&&(j=await ue(oe,j,"argSchema",{})),F?B=F():x.query?(z=A(x,"transformResponse"),B=await t(x.query(j),W,G)):B=await x.queryFn(j,W,G,pe=>t(pe,W,G)),typeof process<"u",B.error)throw new Sn(B.error,B.meta);let{data:Z}=B;X&&!ce($,"rawResponse")&&(Z=await ue(X,B.data,"rawResponseSchema",B.meta));let se=await z(Z,B.meta,j);return he&&!ce($,"response")&&(se=await ue(he,se,"responseSchema",B.meta)),{...B,data:se}}if(d.type==="query"&&"infiniteQueryOptions"in x){const{infiniteQueryOptions:j}=x,{maxPages:B=1/0}=j;let G;const oe={pages:[],pageParams:[]},X=u.selectQueryEntry(L(),d.queryCacheKey)?.data,Z=P(d,L())&&!d.direction||!X?oe:X;if("direction"in d&&d.direction&&Z.pages.length){const se=d.direction==="backward",ke=(se?Xn:Et)(j,Z,d.originalArgs);G=await K(Z,ke,B,se)}else{const{initialPageParam:se=j.initialPageParam}=d,pe=X?.pageParams??[],ke=pe[0]??se,Kt=pe.length;G=await K(Z,ke,B),F&&(G={data:G.data.pages[0]});for(let Vt=1;Vt<Kt;Vt++){const gr=Et(j,G.data,d.originalArgs);G=await K(G.data,gr,B)}}Q=G}else Q=await U(d.originalArgs);return q&&!ce($,"meta")&&Q.meta&&(Q.meta=await ue(q,Q.meta,"metaSchema",Q.meta)),O(Q.data,_e({fulfilledTimeStamp:Date.now(),baseQueryMeta:Q.meta}))}catch(z){let W=z;if(W instanceof Sn){let F=A(x,"transformErrorResponse");const{rawErrorResponseSchema:Q,errorResponseSchema:K}=x;let{value:U,meta:j}=W;try{Q&&!ce($,"rawErrorResponse")&&(U=await ue(Q,U,"rawErrorResponseSchema",j)),q&&!ce($,"meta")&&(j=await ue(q,j,"metaSchema",j));let B=await F(U,j,d.originalArgs);return K&&!ce($,"errorResponse")&&(B=await ue(K,B,"errorResponseSchema",j)),T(B,_e({baseQueryMeta:j}))}catch(B){W=B}}try{if(W instanceof Jn){const F={endpoint:d.endpointName,arg:d.originalArgs,type:d.type,queryCacheKey:d.type==="query"?d.queryCacheKey:void 0};x.onSchemaFailure?.(W,F),l?.(W,F);const{catchSchemaFailure:Q=c}=x;if(Q)return T(Q(W,F),_e({baseQueryMeta:W._bqMeta}))}}catch(F){W=F}throw typeof process<"u",console.error(W),W}};function P(d,g){const E=u.selectQueryEntry(g,d.queryCacheKey),T=u.selectConfig(g).refetchOnMountOrArgChange,O=E?.fulfilledTimeStamp,D=d.forceRefetch??(d.subscribe&&T);return D?D===!0||(Number(new Date)-Number(O))/1e3>=D:!1}const w=()=>pn(`${e}/executeQuery`,_,{getPendingMeta({arg:g}){const E=n[g.endpointName];return _e({startedTimeStamp:Date.now(),...rt(E)?{direction:g.direction}:{}})},condition(g,{getState:E}){const T=E(),O=u.selectQueryEntry(T,g.queryCacheKey),D=O?.fulfilledTimeStamp,L=g.originalArgs,k=O?.originalArgs,x=n[g.endpointName],q=g.direction;return St(g)?!0:O?.status==="pending"?!1:P(g,T)||nt(x)&&x?.forceRefetch?.({currentArg:L,previousArg:k,endpointState:O,state:T})?!0:!(D&&!q)},dispatchConditionRejection:!0}),f=w(),s=w(),v=pn(`${e}/executeMutation`,_,{getPendingMeta(){return _e({startedTimeStamp:Date.now()})}}),S=d=>"force"in d,b=d=>"ifOlderThan"in d,R=(d,g,E={})=>(T,O)=>{const D=S(E)&&E.force,L=b(E)&&E.ifOlderThan,k=(q=!0)=>{const $={forceRefetch:q,subscribe:!1};return i.endpoints[d].initiate(g,$)},x=i.endpoints[d].select(g)(O());if(D)T(k());else if(L){const q=x?.fulfilledTimeStamp;if(!q){T(k());return}(Number(new Date)-Number(new Date(q)))/1e3>=L&&T(k())}else T(k(!1))};function C(d){return g=>g?.meta?.arg?.endpointName===d}function h(d,g){return{matchPending:ut(Kn(d),C(g)),matchFulfilled:ut(fe(d),C(g)),matchRejected:ut(Lt(d),C(g))}}return{queryThunk:f,mutationThunk:v,infiniteQueryThunk:s,prefetch:R,updateQueryData:m,upsertQueryData:M,patchQueryData:I,buildMatchThunkActions:h}}function Et(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Xn(e,{pages:t,pageParams:n},r){return e.getPreviousPageParam?.(t[0],t,n[0],n,r)}function Zn(e,t,n,r){return $t(n[e.meta.arg.endpointName][t],fe(e)?e.payload:void 0,Nt(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function je(e,t,n){const r=e[t];r&&n(r)}function De(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Cn(e,t,n){const r=e[De(t)];r&&n(r)}var $e={};function ji({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:u,hasRehydrationInfo:l},assertTagType:c,config:a}){const I=Se(`${e}/resetApiState`);function y(C,h,d,g){C[h.queryCacheKey]??={status:"uninitialized",endpointName:h.endpointName},je(C,h.queryCacheKey,E=>{E.status="pending",E.requestId=d&&E.requestId?E.requestId:g.requestId,h.originalArgs!==void 0&&(E.originalArgs=h.originalArgs),E.startedTimeStamp=g.startedTimeStamp;const T=i[g.arg.endpointName];rt(T)&&"direction"in h&&(E.direction=h.direction)})}function p(C,h,d,g){je(C,h.arg.queryCacheKey,E=>{if(E.requestId!==h.requestId&&!g)return;const{merge:T}=i[h.arg.endpointName];if(E.status="fulfilled",T)if(E.data!==void 0){const{fulfilledTimeStamp:O,arg:D,baseQueryMeta:L,requestId:k}=h;let x=kt(E.data,q=>T(q,d,{arg:D.originalArgs,baseQueryMeta:L,fulfilledTimeStamp:O,requestId:k}));E.data=x}else E.data=d;else E.data=i[h.arg.endpointName].structuralSharing??!0?qt(br(E.data)?Sr(E.data):E.data,d):d;delete E.error,E.fulfilledTimeStamp=h.fulfilledTimeStamp})}const m=me({name:`${e}/queries`,initialState:$e,reducers:{removeQueryResult:{reducer(C,{payload:{queryCacheKey:h}}){delete C[h]},prepare:Ce()},cacheEntriesUpserted:{reducer(C,h){for(const d of h.payload){const{queryDescription:g,value:E}=d;y(C,g,!0,{arg:g,requestId:h.meta.requestId,startedTimeStamp:h.meta.timestamp}),p(C,{arg:g,requestId:h.meta.requestId,fulfilledTimeStamp:h.meta.timestamp,baseQueryMeta:{}},E,!0)}},prepare:C=>({payload:C.map(g=>{const{endpointName:E,arg:T,value:O}=g,D=i[E];return{queryDescription:{type:"query",endpointName:E,originalArgs:g.arg,queryCacheKey:r({queryArgs:T,endpointDefinition:D,endpointName:E})},value:O}}),meta:{[Vn]:!0,requestId:Yn(),timestamp:Date.now()}})},queryResultPatched:{reducer(C,{payload:{queryCacheKey:h,patches:d}}){je(C,h,g=>{g.data=Jt(g.data,d.concat())})},prepare:Ce()}},extraReducers(C){C.addCase(t.pending,(h,{meta:d,meta:{arg:g}})=>{const E=St(g);y(h,g,E,d)}).addCase(t.fulfilled,(h,{meta:d,payload:g})=>{const E=St(d.arg);p(h,d,g,E)}).addCase(t.rejected,(h,{meta:{condition:d,arg:g,requestId:E},error:T,payload:O})=>{je(h,g.queryCacheKey,D=>{if(!d){if(D.requestId!==E)return;D.status="rejected",D.error=O??T}})}).addMatcher(l,(h,d)=>{const{queries:g}=u(d);for(const[E,T]of Object.entries(g))(T?.status==="fulfilled"||T?.status==="rejected")&&(h[E]=T)})}}),M=me({name:`${e}/mutations`,initialState:$e,reducers:{removeMutationResult:{reducer(C,{payload:h}){const d=De(h);d in C&&delete C[d]},prepare:Ce()}},extraReducers(C){C.addCase(n.pending,(h,{meta:d,meta:{requestId:g,arg:E,startedTimeStamp:T}})=>{E.track&&(h[De(d)]={requestId:g,status:"pending",endpointName:E.endpointName,startedTimeStamp:T})}).addCase(n.fulfilled,(h,{payload:d,meta:g})=>{g.arg.track&&Cn(h,g,E=>{E.requestId===g.requestId&&(E.status="fulfilled",E.data=d,E.fulfilledTimeStamp=g.fulfilledTimeStamp)})}).addCase(n.rejected,(h,{payload:d,error:g,meta:E})=>{E.arg.track&&Cn(h,E,T=>{T.requestId===E.requestId&&(T.status="rejected",T.error=d??g)})}).addMatcher(l,(h,d)=>{const{mutations:g}=u(d);for(const[E,T]of Object.entries(g))(T?.status==="fulfilled"||T?.status==="rejected")&&E!==T?.requestId&&(h[E]=T)})}}),A={tags:{},keys:{}},_=me({name:`${e}/invalidation`,initialState:A,reducers:{updateProvidedBy:{reducer(C,h){for(const{queryCacheKey:d,providedTags:g}of h.payload){P(C,d);for(const{type:E,id:T}of g){const O=(C.tags[E]??={})[T||"__internal_without_id"]??=[];O.includes(d)||O.push(d)}C.keys[d]=g}},prepare:Ce()}},extraReducers(C){C.addCase(m.actions.removeQueryResult,(h,{payload:{queryCacheKey:d}})=>{P(h,d)}).addMatcher(l,(h,d)=>{const{provided:g}=u(d);for(const[E,T]of Object.entries(g.tags??{}))for(const[O,D]of Object.entries(T)){const L=(h.tags[E]??={})[O||"__internal_without_id"]??=[];for(const k of D)L.includes(k)||L.push(k),h.keys[k]=g.keys[k]}}).addMatcher(ze(fe(t),Nt(t)),(h,d)=>{w(h,[d])}).addMatcher(m.actions.cacheEntriesUpserted.match,(h,d)=>{const g=d.payload.map(({queryDescription:E,value:T})=>({type:"UNKNOWN",payload:T,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:E}}));w(h,g)})}});function P(C,h){const d=C.keys[h]??[];for(const g of d){const E=g.type,T=g.id??"__internal_without_id",O=C.tags[E]?.[T];O&&(C.tags[E][T]=O.filter(D=>D!==h))}delete C.keys[h]}function w(C,h){const d=h.map(g=>{const E=Zn(g,"providesTags",i,c),{queryCacheKey:T}=g.meta.arg;return{queryCacheKey:T,providedTags:E}});_.caseReducers.updateProvidedBy(C,_.actions.updateProvidedBy(d))}const f=me({name:`${e}/subscriptions`,initialState:$e,reducers:{updateSubscriptionOptions(C,h){},unsubscribeQueryResult(C,h){},internal_getRTKQSubscriptions(){}}}),s=me({name:`${e}/internalSubscriptions`,initialState:$e,reducers:{subscriptionsUpdated:{reducer(C,h){return Jt(C,h.payload)},prepare:Ce()}}}),v=me({name:`${e}/config`,initialState:{online:Pi(),focused:Ii(),middlewareRegistered:!1,...a},reducers:{middlewareRegistered(C,{payload:h}){C.middlewareRegistered=C.middlewareRegistered==="conflict"||o!==h?"conflict":!0}},extraReducers:C=>{C.addCase(tt,h=>{h.online=!0}).addCase(jt,h=>{h.online=!1}).addCase(et,h=>{h.focused=!0}).addCase(Qt,h=>{h.focused=!1}).addMatcher(l,h=>({...h}))}}),S=Ei({queries:m.reducer,mutations:M.reducer,provided:_.reducer,subscriptions:s.reducer,config:v.reducer}),b=(C,h)=>S(I.match(h)?void 0:C,h),R={...v.actions,...m.actions,...f.actions,...s.actions,...M.actions,..._.actions,resetApiState:I};return{reducer:b,actions:R}}var J=Symbol.for("RTKQ/skipToken"),er={status:"uninitialized"},_n=kt(er,()=>{}),In=kt(er,()=>{});function $i({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=f=>_n,i=f=>In;return{buildQuerySelector:p,buildInfiniteQuerySelector:m,buildMutationSelector:M,selectInvalidatedBy:A,selectCachedArgsForQuery:_,selectApiState:u,selectQueries:l,selectMutations:a,selectQueryEntry:c,selectConfig:I};function o(f){return{...f,...hn(f.status)}}function u(f){return f[t]}function l(f){return u(f)?.queries}function c(f,s){return l(f)?.[s]}function a(f){return u(f)?.mutations}function I(f){return u(f)?.config}function y(f,s,v){return S=>{if(S===J)return n(r,v);const b=e({queryArgs:S,endpointDefinition:s,endpointName:f});return n(C=>c(C,b)??_n,v)}}function p(f,s){return y(f,s,o)}function m(f,s){const{infiniteQueryOptions:v}=s;function S(b){const R={...b,...hn(b.status)},{isLoading:C,isError:h,direction:d}=R,g=d==="forward",E=d==="backward";return{...R,hasNextPage:P(v,R.data,R.originalArgs),hasPreviousPage:w(v,R.data,R.originalArgs),isFetchingNextPage:C&&g,isFetchingPreviousPage:C&&E,isFetchNextPageError:h&&g,isFetchPreviousPageError:h&&E}}return y(f,s,S)}function M(){return f=>{let s;return typeof f=="object"?s=De(f)??J:s=f,n(s===J?i:b=>u(b)?.mutations?.[s]??In,o)}}function A(f,s){const v=f[t],S=new Set;for(const b of s.filter(Ut).map(bt)){const R=v.provided.tags[b.type];if(!R)continue;let C=(b.id!==void 0?R[b.id]:yn(Object.values(R)))??[];for(const h of C)S.add(h)}return yn(Array.from(S.values()).map(b=>{const R=v.queries[b];return R?[{queryCacheKey:b,endpointName:R.endpointName,originalArgs:R.originalArgs}]:[]}))}function _(f,s){return Object.values(l(f)).filter(v=>v?.endpointName===s&&v.status!=="uninitialized").map(v=>v.originalArgs)}function P(f,s,v){return s?Et(f,s,v)!=null:!1}function w(f,s,v){return!s||!f.getPreviousPageParam?!1:Xn(f,s,v)!=null}}const{formatProdErrorMessage:Fi,formatProdErrorMessage:qo,formatProdErrorMessage:Uo}=await N("@reduxjs/toolkit");var Pn=WeakMap?new WeakMap:void 0,An=({endpointName:e,queryArgs:t})=>{let n="";const r=Pn?.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,u)=>(u=typeof u=="bigint"?{$bigint:u.toString()}:u,u=Me(u)?Object.keys(u).sort().reduce((l,c)=>(l[c]=u[c],l),{}):u,u));Me(t)&&Pn?.set(t,i),n=i}return`${e}(${n})`};function Wi(...e){return function(n){const r=Yt(a=>n.extractRehydrationInfo?.(a,{reducerPath:n.reducerPath??"api"})),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(a){let I=An;if("serializeQueryArgs"in a.endpointDefinition){const y=a.endpointDefinition.serializeQueryArgs;I=p=>{const m=y(p);return typeof m=="string"?m:An({...p,queryArgs:m})}}else n.serializeQueryArgs&&(I=n.serializeQueryArgs);return I(a)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(a){a()},apiUid:Yn(),extractRehydrationInfo:r,hasRehydrationInfo:Yt(a=>r(a)!=null)},u={injectEndpoints:c,enhanceEndpoints({addTagTypes:a,endpoints:I}){if(a)for(const y of a)i.tagTypes.includes(y)||i.tagTypes.push(y);if(I)for(const[y,p]of Object.entries(I))typeof p=="function"?p(o.endpointDefinitions[y]):Object.assign(o.endpointDefinitions[y]||{},p);return u}},l=e.map(a=>a.init(u,i,o));function c(a){const I=a.endpoints({query:y=>({...y,type:"query"}),mutation:y=>({...y,type:"mutation"}),infiniteQuery:y=>({...y,type:"infinitequery"})});for(const[y,p]of Object.entries(I)){if(a.overrideExisting!==!0&&y in o.endpointDefinitions){if(a.overrideExisting==="throw")throw new Error(Fi(39));typeof process<"u";continue}typeof process<"u",o.endpointDefinitions[y]=p;for(const m of l)m.injectEndpoint(y,p)}return u}return u.injectEndpoints({endpoints:n.endpoints})}}const{formatProdErrorMessage:Hi}=await N("@reduxjs/toolkit");function Bi(){return function(){throw new Error(Hi(33))}}function ne(e,...t){return Object.assign(e,...t)}var zi=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const i=`${e.reducerPath}/subscriptions`;let o=null,u=null;const{updateSubscriptionOptions:l,unsubscribeQueryResult:c}=e.internalActions,a=(A,_)=>{if(l.match(_)){const{queryCacheKey:w,requestId:f,options:s}=_.payload,v=A.get(w);return v?.has(f)&&v.set(f,s),!0}if(c.match(_)){const{queryCacheKey:w,requestId:f}=_.payload,s=A.get(w);return s&&s.delete(f),!0}if(e.internalActions.removeQueryResult.match(_))return A.delete(_.payload.queryCacheKey),!0;if(t.pending.match(_)){const{meta:{arg:w,requestId:f}}=_,s=Ge(A,w.queryCacheKey,wt);return w.subscribe&&s.set(f,w.subscriptionOptions??s.get(f)??{}),!0}let P=!1;if(t.rejected.match(_)){const{meta:{condition:w,arg:f,requestId:s}}=_;if(w&&f.subscribe){const v=Ge(A,f.queryCacheKey,wt);v.set(s,f.subscriptionOptions??v.get(s)??{}),P=!0}}return P},I=()=>n.currentSubscriptions,m={getSubscriptions:I,getSubscriptionCount:A=>I().get(A)?.size??0,isRequestSubscribed:(A,_)=>!!I()?.get(A)?.get(_)};function M(A){return JSON.parse(JSON.stringify(Object.fromEntries([...A].map(([_,P])=>[_,Object.fromEntries(P)]))))}return(A,_)=>{if(o||(o=M(n.currentSubscriptions)),e.util.resetApiState.match(A))return o={},n.currentSubscriptions.clear(),u=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(A))return[!1,m];const P=a(n.currentSubscriptions,A);let w=!0;if(P){u||(u=setTimeout(()=>{const v=M(n.currentSubscriptions),[,S]=Wn(o,()=>v);_.next(e.internalActions.subscriptionsUpdated(S)),o=v,u=null},500));const f=typeof A.type=="string"&&!!A.type.startsWith(i),s=t.rejected.match(A)&&A.meta.condition&&!!A.meta.arg.subscribe;w=!f&&!s}return[w,!1]}},Gi=2147483647/1e3-1,Ki=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:o,selectConfig:u},getRunningQueryThunk:l,mwApi:c})=>{const{removeQueryResult:a,unsubscribeQueryResult:I,cacheEntriesUpserted:y}=t.internalActions,p=ze(I.match,n.fulfilled,n.rejected,y.match);function m(f){const s=i.currentSubscriptions.get(f);return s?s.size>0:!1}const M={};function A(f){for(const s of f.values())s?.abort?.()}const _=(f,s)=>{const v=s.getState(),S=u(v);if(p(f)){let b;if(y.match(f))b=f.payload.map(R=>R.queryDescription.queryCacheKey);else{const{queryCacheKey:R}=I.match(f)?f.payload:f.meta.arg;b=[R]}P(b,s,S)}if(t.util.resetApiState.match(f)){for(const[b,R]of Object.entries(M))R&&clearTimeout(R),delete M[b];A(i.runningQueries),A(i.runningMutations)}if(r.hasRehydrationInfo(f)){const{queries:b}=r.extractRehydrationInfo(f);P(Object.keys(b),s,S)}};function P(f,s,v){const S=s.getState();for(const b of f){const R=o(S,b);R?.endpointName&&w(b,R.endpointName,s,v)}}function w(f,s,v,S){const R=r.endpointDefinitions[s]?.keepUnusedDataFor??S.keepUnusedDataFor;if(R===1/0)return;const C=Math.max(0,Math.min(R,Gi));if(!m(f)){const h=M[f];h&&clearTimeout(h),M[f]=setTimeout(()=>{if(!m(f)){const d=o(v.getState(),f);d?.endpointName&&v.dispatch(l(d.endpointName,d.originalArgs))?.abort(),v.dispatch(a({queryCacheKey:f}))}delete M[f]},C*1e3)}}return _},Rn=new Error("Promise never resolved before cacheEntryRemoved."),Vi=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:u,selectApiState:l}})=>{const c=gn(r),a=gn(i),I=fe(r,i),y={};function p(P,w,f){const s=y[P];s?.valueResolved&&(s.valueResolved({data:w,meta:f}),delete s.valueResolved)}function m(P){const w=y[P];w&&(delete y[P],w.cacheEntryRemoved())}const M=(P,w,f)=>{const s=A(P);function v(S,b,R,C){const h=u(f,b),d=u(w.getState(),b);!h&&d&&_(S,C,b,w,R)}if(r.pending.match(P))v(P.meta.arg.endpointName,s,P.meta.requestId,P.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(P))for(const{queryDescription:S,value:b}of P.payload){const{endpointName:R,originalArgs:C,queryCacheKey:h}=S;v(R,h,P.meta.requestId,C),p(h,b,{})}else if(i.pending.match(P))w.getState()[t].mutations[s]&&_(P.meta.arg.endpointName,P.meta.arg.originalArgs,s,w,P.meta.requestId);else if(I(P))p(s,P.payload,P.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(P)||e.internalActions.removeMutationResult.match(P))m(s);else if(e.util.resetApiState.match(P))for(const S of Object.keys(y))m(S)};function A(P){return c(P)?P.meta.arg.queryCacheKey:a(P)?P.meta.arg.fixedCacheKey??P.meta.requestId:e.internalActions.removeQueryResult.match(P)?P.payload.queryCacheKey:e.internalActions.removeMutationResult.match(P)?De(P.payload):""}function _(P,w,f,s,v){const S=n.endpointDefinitions[P],b=S?.onCacheEntryAdded;if(!b)return;const R={},C=new Promise(O=>{R.cacheEntryRemoved=O}),h=Promise.race([new Promise(O=>{R.valueResolved=O}),C.then(()=>{throw Rn})]);h.catch(()=>{}),y[f]=R;const d=e.endpoints[P].select(Ke(S)?w:f),g=s.dispatch((O,D,L)=>L),E={...s,getCacheEntry:()=>d(s.getState()),requestId:v,extra:g,updateCachedData:Ke(S)?O=>s.dispatch(e.util.updateQueryData(P,w,O)):void 0,cacheDataLoaded:h,cacheEntryRemoved:C},T=b(w,E);Promise.resolve(T).catch(O=>{if(O!==Rn)throw O})}return M},Yi=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Ji=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:u,refetchQuery:l,internalState:c})=>{const{removeQueryResult:a}=o.internalActions,I=ze(fe(r),Nt(r)),y=ze(fe(r,i),Lt(r,i));let p=[];const m=(_,P)=>{I(_)?A(Zn(_,"invalidatesTags",n,u),P):y(_)?A([],P):o.util.invalidateTags.match(_)&&A($t(_.payload,void 0,void 0,void 0,void 0,u),P)};function M(_){const{queries:P,mutations:w}=_;for(const f of[P,w])for(const s in f)if(f[s]?.status==="pending")return!0;return!1}function A(_,P){const w=P.getState(),f=w[e];if(p.push(..._),f.config.invalidationBehavior==="delayed"&&M(f))return;const s=p;if(p=[],s.length===0)return;const v=o.util.selectInvalidatedBy(w,s);t.batch(()=>{const S=Array.from(v.values());for(const{queryCacheKey:b}of S){const R=f.queries[b],C=Ge(c.currentSubscriptions,b,wt);R&&(C.size===0?P.dispatch(a({queryCacheKey:b})):R.status!=="uninitialized"&&P.dispatch(l(R)))}})}return m},Xi=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const{currentPolls:o,currentSubscriptions:u}=i,l=new Set;let c=null;const a=(_,P)=>{(n.internalActions.updateSubscriptionOptions.match(_)||n.internalActions.unsubscribeQueryResult.match(_))&&I(_.payload.queryCacheKey,P),(t.pending.match(_)||t.rejected.match(_)&&_.meta.condition)&&I(_.meta.arg.queryCacheKey,P),(t.fulfilled.match(_)||t.rejected.match(_)&&!_.meta.condition)&&y(_.meta.arg,P),n.util.resetApiState.match(_)&&(M(),c&&(clearTimeout(c),c=null),l.clear())};function I(_,P){l.add(_),c||(c=setTimeout(()=>{for(const w of l)p({queryCacheKey:w},P);l.clear(),c=null},0))}function y({queryCacheKey:_},P){const w=P.getState()[e],f=w.queries[_],s=u.get(_);if(!f||f.status==="uninitialized")return;const{lowestPollingInterval:v,skipPollingIfUnfocused:S}=A(s);if(!Number.isFinite(v))return;const b=o.get(_);b?.timeout&&(clearTimeout(b.timeout),b.timeout=void 0);const R=Date.now()+v;o.set(_,{nextPollTimestamp:R,pollingInterval:v,timeout:setTimeout(()=>{(w.config.focused||!S)&&P.dispatch(r(f)),y({queryCacheKey:_},P)},v)})}function p({queryCacheKey:_},P){const f=P.getState()[e].queries[_],s=u.get(_);if(!f||f.status==="uninitialized")return;const{lowestPollingInterval:v}=A(s);if(!Number.isFinite(v)){m(_);return}const S=o.get(_),b=Date.now()+v;(!S||b<S.nextPollTimestamp)&&y({queryCacheKey:_},P)}function m(_){const P=o.get(_);P?.timeout&&clearTimeout(P.timeout),o.delete(_)}function M(){for(const _ of o.keys())m(_)}function A(_=new Map){let P=!1,w=Number.POSITIVE_INFINITY;for(const f of _.values())f.pollingInterval&&(w=Math.min(f.pollingInterval,w),P=f.skipPollingIfUnfocused||P);return{lowestPollingInterval:w,skipPollingIfUnfocused:P}}return a},Zi=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Kn(n,r),o=Lt(n,r),u=fe(n,r),l={};return(a,I)=>{if(i(a)){const{requestId:y,arg:{endpointName:p,originalArgs:m}}=a.meta,M=t.endpointDefinitions[p],A=M?.onQueryStarted;if(A){const _={},P=new Promise((v,S)=>{_.resolve=v,_.reject=S});P.catch(()=>{}),l[y]=_;const w=e.endpoints[p].select(Ke(M)?m:y),f=I.dispatch((v,S,b)=>b),s={...I,getCacheEntry:()=>w(I.getState()),requestId:y,extra:f,updateCachedData:Ke(M)?v=>I.dispatch(e.util.updateQueryData(p,m,v)):void 0,queryFulfilled:P};A(m,s)}}else if(u(a)){const{requestId:y,baseQueryMeta:p}=a.meta;l[y]?.resolve({data:a.payload,meta:p}),delete l[y]}else if(o(a)){const{requestId:y,rejectedWithValue:p,baseQueryMeta:m}=a.meta;l[y]?.reject({error:a.payload??a.error,isUnhandledError:!p,meta:m}),delete l[y]}}},es=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,u=(c,a)=>{et.match(c)&&l(a,"refetchOnFocus"),tt.match(c)&&l(a,"refetchOnReconnect")};function l(c,a){const I=c.getState()[e],y=I.queries,p=i.currentSubscriptions;t.batch(()=>{for(const m of p.keys()){const M=y[m],A=p.get(m);if(!A||!M)continue;const _=[...A.values()];(_.some(w=>w[a]===!0)||_.every(w=>w[a]===void 0)&&I.config[a])&&(A.size===0?c.dispatch(o({queryCacheKey:m})):M.status!=="uninitialized"&&c.dispatch(r(M)))}})}return u};function ts(e){const{reducerPath:t,queryThunk:n,api:r,context:i,getInternalState:o}=e,{apiUid:u}=i,l={invalidateTags:Se(`${t}/invalidateTags`)},c=p=>p.type.startsWith(`${t}/`),a=[Yi,Ki,Ji,Xi,Vi,Zi];return{middleware:p=>{let m=!1;const M=o(p.dispatch),A={...e,internalState:M,refetchQuery:y,isThisApiSliceAction:c,mwApi:p},_=a.map(f=>f(A)),P=zi(A),w=es(A);return f=>s=>{if(!Ci(s))return f(s);m||(m=!0,p.dispatch(r.internalActions.middlewareRegistered(u)));const v={...p,next:f},S=p.getState(),[b,R]=P(s,v,S);let C;if(b?C=f(s):C=R,p.getState()[t]&&(w(s,v,S),c(s)||i.hasRehydrationInfo(s)))for(const h of _)h(s,v,S);return C}},actions:l};function y(p){return e.api.endpoints[p.endpointName].initiate(p.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Tn=Symbol(),ns=({createSelector:e=Si}={})=>({name:Tn,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:u,refetchOnMountOrArgChange:l,refetchOnFocus:c,refetchOnReconnect:a,invalidationBehavior:I,onSchemaFailure:y,catchSchemaFailure:p,skipSchemaValidation:m},M){vr();const A=U=>(typeof process<"u",U);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:tt,onOffline:jt,onFocus:et,onFocusLost:Qt},util:{}});const _=$i({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:w,buildQuerySelector:f,buildInfiniteQuerySelector:s,buildMutationSelector:v}=_;ne(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:w});const{queryThunk:S,infiniteQueryThunk:b,mutationThunk:R,patchQueryData:C,updateQueryData:h,upsertQueryData:d,prefetch:g,buildMatchThunkActions:E}=Qi({baseQuery:n,reducerPath:i,context:M,api:t,serializeQueryArgs:o,assertTagType:A,selectors:_,onSchemaFailure:y,catchSchemaFailure:p,skipSchemaValidation:m}),{reducer:T,actions:O}=ji({context:M,queryThunk:S,infiniteQueryThunk:b,mutationThunk:R,serializeQueryArgs:o,reducerPath:i,assertTagType:A,config:{refetchOnFocus:c,refetchOnReconnect:a,refetchOnMountOrArgChange:l,keepUnusedDataFor:u,reducerPath:i,invalidationBehavior:I}});ne(t.util,{patchQueryData:C,updateQueryData:h,upsertQueryData:d,prefetch:g,resetApiState:O.resetApiState,upsertQueryEntries:O.cacheEntriesUpserted}),ne(t.internalActions,O);const D=new WeakMap,L=U=>Ge(D,U,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:k,buildInitiateInfiniteQuery:x,buildInitiateMutation:q,getRunningMutationThunk:$,getRunningMutationsThunk:z,getRunningQueriesThunk:W,getRunningQueryThunk:F}=Ui({queryThunk:S,mutationThunk:R,infiniteQueryThunk:b,api:t,serializeQueryArgs:o,context:M,getInternalState:L});ne(t.util,{getRunningMutationThunk:$,getRunningMutationsThunk:z,getRunningQueryThunk:F,getRunningQueriesThunk:W});const{middleware:Q,actions:K}=ts({reducerPath:i,context:M,queryThunk:S,mutationThunk:R,infiniteQueryThunk:b,api:t,assertTagType:A,selectors:_,getRunningQueryThunk:F,getInternalState:L});return ne(t.util,K),ne(t,{reducer:T,middleware:Q}),{name:Tn,injectEndpoint(U,j){const B=t,G=B.endpoints[U]??={};nt(j)&&ne(G,{name:U,select:f(U,j),initiate:k(U,j)},E(S,U)),Li(j)&&ne(G,{name:U,select:v(),initiate:q(U)},E(R,U)),rt(j)&&ne(G,{name:U,select:s(U,j),initiate:x(U,j)},E(S,U))}}}});await N("@reduxjs/toolkit");const{batch:rs,useDispatch:is,useSelector:ss,useStore:as}=await N("react-redux");function Fe(e){return e.replace(e[0],e[0].toUpperCase())}function os(e){return e.type==="query"}function cs(e){return e.type==="mutation"}function tr(e){return e.type==="infinitequery"}function Ie(e,...t){return Object.assign(e,...t)}const{formatProdErrorMessage:Qo,formatProdErrorMessage:us}=await N("@reduxjs/toolkit"),{useCallback:le,useDebugValue:dt,useEffect:ve,useLayoutEffect:ls,useMemo:V,useRef:ye,useState:Mn}=await N("react"),{shallowEqual:ft}=await N("react-redux");var ht=Symbol();const{useEffect:ds,useRef:fs,useMemo:hs}=await N("react");function pt(e){const t=fs(e),n=hs(()=>qt(t.current,e),[e]);return ds(()=>{t.current!==n&&(t.current=n)},[n]),n}const{useEffect:ps,useRef:gs}=await N("react"),{shallowEqual:On}=await N("react-redux");function We(e){const t=gs(e);return ps(()=>{On(t.current,e)||(t.current=e)},[e]),On(t.current,e)?t.current:e}var ms=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ys=ms(),vs=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ws=vs(),bs=()=>ys||ws?ls:ve,Ss=bs(),Dn=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Gn.pending}:e;function gt(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var mt=["data","status","isLoading","isSuccess","isError","error"];function Es({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o,createSelector:u},serializeQueryArgs:l,context:c}){const a=o?s=>s():ve;return{buildQueryHooks:P,buildInfiniteQueryHooks:w,buildMutationHook:f,usePrefetch:p};function I(s,v,S){if(v?.endpointName&&s.isUninitialized){const{endpointName:g}=v,E=c.endpointDefinitions[g];S!==J&&l({queryArgs:v.originalArgs,endpointDefinition:E,endpointName:g})===l({queryArgs:S,endpointDefinition:E,endpointName:g})&&(v=void 0)}let b=s.isSuccess?s.data:v?.data;b===void 0&&(b=s.data);const R=b!==void 0,C=s.isLoading,h=(!v||v.isLoading||v.isUninitialized)&&!R&&C,d=s.isSuccess||R&&(C&&!v?.isError||s.isUninitialized);return{...s,data:b,currentData:s.data,isFetching:C,isLoading:h,isSuccess:d}}function y(s,v,S){if(v?.endpointName&&s.isUninitialized){const{endpointName:g}=v,E=c.endpointDefinitions[g];S!==J&&l({queryArgs:v.originalArgs,endpointDefinition:E,endpointName:g})===l({queryArgs:S,endpointDefinition:E,endpointName:g})&&(v=void 0)}let b=s.isSuccess?s.data:v?.data;b===void 0&&(b=s.data);const R=b!==void 0,C=s.isLoading,h=(!v||v.isLoading||v.isUninitialized)&&!R&&C,d=s.isSuccess||C&&R;return{...s,data:b,currentData:s.data,isFetching:C,isLoading:h,isSuccess:d}}function p(s,v){const S=n(),b=We(v);return le((R,C)=>S(e.util.prefetch(s,R,{...b,...C})),[s,S,b])}function m(s,v,{refetchOnReconnect:S,refetchOnFocus:b,refetchOnMountOrArgChange:R,skip:C=!1,pollingInterval:h=0,skipPollingIfUnfocused:d=!1,...g}={}){const{initiate:E}=e.endpoints[s],T=n(),O=ye(void 0);if(!O.current){const Q=T(e.internalActions.internal_getRTKQSubscriptions());O.current=Q}const D=pt(C?J:v),L=We({refetchOnReconnect:S,refetchOnFocus:b,pollingInterval:h,skipPollingIfUnfocused:d}),k=g.initialPageParam,x=We(k),q=ye(void 0);let{queryCacheKey:$,requestId:z}=q.current||{},W=!1;$&&z&&(W=O.current.isRequestSubscribed($,z));const F=!W&&q.current!==void 0;return a(()=>{F&&(q.current=void 0)},[F]),a(()=>{const Q=q.current;if(typeof process<"u",D===J){Q?.unsubscribe(),q.current=void 0;return}const K=q.current?.subscriptionOptions;if(!Q||Q.arg!==D){Q?.unsubscribe();const U=T(E(D,{subscriptionOptions:L,forceRefetch:R,...tr(c.endpointDefinitions[s])?{initialPageParam:x}:{}}));q.current=U}else L!==K&&Q.updateSubscriptionOptions(L)},[T,E,R,D,L,F,x,s]),[q,T,E,L]}function M(s,v){return(b,{skip:R=!1,selectFromResult:C}={})=>{const{select:h}=e.endpoints[s],d=pt(R?J:b),g=ye(void 0),E=V(()=>u([h(d),(k,x)=>x,k=>d],v,{memoizeOptions:{resultEqualityCheck:ft}}),[h,d]),T=V(()=>C?u([E],C,{devModeChecks:{identityFunctionCheck:"never"}}):E,[E,C]),O=r(k=>T(k,g.current),ft),D=i(),L=E(D.getState(),g.current);return Ss(()=>{g.current=L},[L]),O}}function A(s){ve(()=>()=>{s.current?.unsubscribe?.(),s.current=void 0},[s])}function _(s){if(!s.current)throw new Error(us(38));return s.current.refetch()}function P(s){const v=(R,C={})=>{const[h]=m(s,R,C);return A(h),V(()=>({refetch:()=>_(h)}),[h])},S=({refetchOnReconnect:R,refetchOnFocus:C,pollingInterval:h=0,skipPollingIfUnfocused:d=!1}={})=>{const{initiate:g}=e.endpoints[s],E=n(),[T,O]=Mn(ht),D=ye(void 0),L=We({refetchOnReconnect:R,refetchOnFocus:C,pollingInterval:h,skipPollingIfUnfocused:d});a(()=>{const $=D.current?.subscriptionOptions;L!==$&&D.current?.updateSubscriptionOptions(L)},[L]);const k=ye(L);a(()=>{k.current=L},[L]);const x=le(function($,z=!1){let W;return t(()=>{D.current?.unsubscribe(),D.current=W=E(g($,{subscriptionOptions:k.current,forceRefetch:!z})),O($)}),W},[E,g]),q=le(()=>{D.current?.queryCacheKey&&E(e.internalActions.removeQueryResult({queryCacheKey:D.current?.queryCacheKey}))},[E]);return ve(()=>()=>{D?.current?.unsubscribe()},[]),ve(()=>{T!==ht&&!D.current&&x(T,!0)},[T,x]),V(()=>[x,T,{reset:q}],[x,T,q])},b=M(s,I);return{useQueryState:b,useQuerySubscription:v,useLazyQuerySubscription:S,useLazyQuery(R){const[C,h,{reset:d}]=S(R),g=b(h,{...R,skip:h===ht}),E=V(()=>({lastArg:h}),[h]);return V(()=>[C,{...g,reset:d},E],[C,g,d,E])},useQuery(R,C){const h=v(R,C),d=b(R,{selectFromResult:R===J||C?.skip?void 0:Dn,...C}),g=gt(d,...mt);return dt(g),V(()=>({...d,...h}),[d,h])}}}function w(s){const v=(b,R={})=>{const[C,h,d,g]=m(s,b,R),E=ye(g);a(()=>{E.current=g},[g]);const T=le(function(L,k){let x;return t(()=>{C.current?.unsubscribe(),C.current=x=h(d(L,{subscriptionOptions:E.current,direction:k}))}),x},[C,h,d]);A(C);const O=pt(R.skip?J:b),D=le(()=>_(C),[C]);return V(()=>({trigger:T,refetch:D,fetchNextPage:()=>T(O,"forward"),fetchPreviousPage:()=>T(O,"backward")}),[D,T,O])},S=M(s,y);return{useInfiniteQueryState:S,useInfiniteQuerySubscription:v,useInfiniteQuery(b,R){const{refetch:C,fetchNextPage:h,fetchPreviousPage:d}=v(b,R),g=S(b,{selectFromResult:b===J||R?.skip?void 0:Dn,...R}),E=gt(g,...mt,"hasNextPage","hasPreviousPage");return dt(E),V(()=>({...g,fetchNextPage:h,fetchPreviousPage:d,refetch:C}),[g,h,d,C])}}}function f(s){return({selectFromResult:v,fixedCacheKey:S}={})=>{const{select:b,initiate:R}=e.endpoints[s],C=n(),[h,d]=Mn();ve(()=>()=>{h?.arg.fixedCacheKey||h?.reset()},[h]);const g=le(function($){const z=C(R($,{fixedCacheKey:S}));return d(z),z},[C,R,S]),{requestId:E}=h||{},T=V(()=>b({fixedCacheKey:S,requestId:h?.requestId}),[S,h,b]),O=V(()=>v?u([T],v):T,[v,T]),D=r(O,ft),L=S==null?h?.arg.originalArgs:void 0,k=le(()=>{t(()=>{h&&d(void 0),S&&C(e.internalActions.removeMutationResult({requestId:E,fixedCacheKey:S}))})},[C,S,h,E]),x=gt(D,...mt,"endpointName");dt(x);const q=V(()=>({...D,originalArgs:L,reset:k}),[D,L,k]);return V(()=>[g,q],[g,q])}}}var Cs=Symbol(),_s=({batch:e=rs,hooks:t={useDispatch:is,useSelector:ss,useStore:as},createSelector:n=Er,unstable__sideEffectsInRender:r=!1,...i}={})=>({name:Cs,init(o,{serializeQueryArgs:u},l){const c=o,{buildQueryHooks:a,buildInfiniteQueryHooks:I,buildMutationHook:y,usePrefetch:p}=Es({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:u,context:l});return Ie(c,{usePrefetch:p}),Ie(l,{batch:e}),{injectEndpoint(m,M){if(os(M)){const{useQuery:A,useLazyQuery:_,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:f}=a(m);Ie(c.endpoints[m],{useQuery:A,useLazyQuery:_,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:f}),o[`use${Fe(m)}Query`]=A,o[`useLazy${Fe(m)}Query`]=_}if(cs(M)){const A=y(m);Ie(c.endpoints[m],{useMutation:A}),o[`use${Fe(m)}Mutation`]=A}else if(tr(M)){const{useInfiniteQuery:A,useInfiniteQuerySubscription:_,useInfiniteQueryState:P}=I(m);Ie(c.endpoints[m],{useInfiniteQuery:A,useInfiniteQuerySubscription:_,useInfiniteQueryState:P}),o[`use${Fe(m)}InfiniteQuery`]=A}}}}});await N("@reduxjs/toolkit");await N("react");await N("react");await N("react");await N("react-redux");var nr=Wi(ns(),_s());const Is="/auth",Ps="pk_live_CE856A4938B36648",As="https://notifications.decentraland.zone",Rs="https://peer.decentraland.zone",Ts="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Ms="https://events.decentraland.zone/api",Os="https://realm-provider-ea.decentraland.org/hot-scenes",Ds="61570c542c2d66c659492e5b24a41522",xs={AUTH_URL:Is,MAGIC_API_KEY:Ps,NOTIFICATIONS_API_URL:As,PEER_URL:Rs,SEGMENT_API_KEY:Ts,EVENTS_API_URL:Ms,HOT_SCENES_URL:Os,WALLET_CONNECT_PROJECT_ID:Ds},ks="/auth",Ls="pk_live_212568025B158355",Ns="https://notifications.decentraland.org",qs="https://peer.decentraland.org",Us="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Qs="https://events.decentraland.org/api",js="https://realm-provider-ea.decentraland.org/hot-scenes",$s="61570c542c2d66c659492e5b24a41522",Fs={AUTH_URL:ks,MAGIC_API_KEY:Ls,NOTIFICATIONS_API_URL:Ns,PEER_URL:qs,SEGMENT_API_KEY:Us,EVENTS_API_URL:Qs,HOT_SCENES_URL:js,WALLET_CONNECT_PROJECT_ID:$s},Ws="/auth",Hs="pk_live_CE856A4938B36648",Bs="https://notifications.decentraland.org",zs="https://peer.decentraland.org",Gs="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Ks="https://events.decentraland.org/api",Vs="https://realm-provider-ea.decentraland.org/hot-scenes",Ys="61570c542c2d66c659492e5b24a41522",Js={AUTH_URL:Ws,MAGIC_API_KEY:Hs,NOTIFICATIONS_API_URL:Bs,PEER_URL:zs,SEGMENT_API_KEY:Gs,EVENTS_API_URL:Ks,HOT_SCENES_URL:Vs,WALLET_CONNECT_PROJECT_ID:Ys};var Xs={VITE_REACT_APP_WEBSITE_VERSION:"0.0.1-24139497769.commit-1069c81",VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/explore-site/0.0.1-24139497769.commit-1069c81",BASE_URL:"https://cdn.decentraland.org/@dcl/explore-site/0.0.1-24139497769.commit-1069c81",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Zs=mr({[at.DEVELOPMENT]:xs,[at.STAGING]:Js,[at.PRODUCTION]:Fs},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:Xs.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}}),ae=e=>Zs.get(e),ea=5;function Re(e,t){return`${e},${t}`}function ta(e,t){for(const[n,r]of t){const i=e.get(Re(n,r));if(i)return i}}function rr(e){return e.toLowerCase().includes("genesis plaza")}function na(e){const t=e.find(r=>rr(r.name)),n=t?Re(t.baseCoords[0],t.baseCoords[1]):"0,0";return{id:t?.id??"genesis-plaza",type:"place",title:t?.name??"Genesis Plaza",image:t?.thumbnail??"",users:t?.usersTotalCount??0,coordinates:n,creatorName:"Decentraland Foundation",isGenesisPlaza:!0}}function ra(e,t,n=ea){const r=t.filter(a=>a.usersTotalCount>=n),i=new Map(e.map(a=>[Re(a.x,a.y),a])),o=[],u=new Set,l=new Set;for(const a of r){const I=ta(i,a.parcels);I&&!l.has(I.id)&&(o.push({id:I.id,type:"event",title:I.name,image:I.image||"",users:a.usersTotalCount,coordinates:Re(I.x,I.y),creatorAddress:I.user,creatorName:I.user_name||void 0,isGenesisPlaza:!1}),u.add(a.id),l.add(I.id))}o.sort((a,I)=>I.users-a.users);const c=r.filter(a=>!u.has(a.id)).sort((a,I)=>I.usersTotalCount-a.usersTotalCount);for(const a of c){const I=rr(a.name);o.push({id:a.id,type:"place",title:a.name,image:a.thumbnail,users:a.usersTotalCount,coordinates:Re(a.baseCoords[0],a.baseCoords[1]),...I&&{creatorName:"Decentraland Foundation"},isGenesisPlaza:I})}return o.length===0&&o.push(na(t)),o}function ia(e){const t=new URLSearchParams;for(const[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));return t.toString()}const Ve=nr({reducerPath:"eventsClient",baseQuery:xi({baseUrl:"/"}),tagTypes:["Events","LiveNow"],keepUnusedDataFor:60,endpoints:e=>({getEvents:e.query({queryFn:async t=>{try{const n=ae("EVENTS_API_URL"),r=ia(t),i=await fetch(`${n}/events?${r}`);if(!i.ok)throw new Error(`Events API error: ${i.status}`);return{data:(await i.json()).data??[]}}catch(n){return{error:{status:"FETCH_ERROR",error:n instanceof Error?n.message:"Unknown error"}}}},providesTags:["Events"]}),getLiveNowCards:e.query({queryFn:async t=>{try{const n=ae("EVENTS_API_URL"),r=ae("HOT_SCENES_URL"),[i,o]=await Promise.all([fetch(`${n}/events?list=live&limit=20&order=asc&world=false`),fetch(r)]);if(!i.ok||!o.ok)throw new Error("Failed to fetch live events or hot scenes");const[u,l]=await Promise.all([i.json(),o.json()]),c=t&&"minUsers"in t?t.minUsers:void 0;return{data:ra(u.data??[],l,c)}}catch(n){return{error:{status:"FETCH_ERROR",error:n instanceof Error?n.message:"Unknown error"}}}},providesTags:["LiveNow"]}),getUpcomingEvents:e.query({queryFn:async()=>{try{const t=ae("EVENTS_API_URL"),n=new Date,r=new Date(n.getTime()+24*60*60*1e3),i=await fetch(`${t}/events?list=upcoming&limit=10&order=asc&world=false&from=${n.toISOString()}&to=${r.toISOString()}`);if(!i.ok)throw new Error(`Events API error: ${i.status}`);return{data:(await i.json()).data??[]}}catch(t){return{error:{status:"FETCH_ERROR",error:t instanceof Error?t.message:"Unknown error"}}}},providesTags:["Events"]}),getEventsByDateRange:e.query({queryFn:async({from:t,to:n})=>{try{const r=ae("EVENTS_API_URL"),i=await fetch(`${r}/events?list=all&from=${t}&to=${n}&limit=100&order=asc&world=false`);if(!i.ok)throw new Error(`Events API error: ${i.status}`);return{data:(await i.json()).data??[]}}catch(r){return{error:{status:"FETCH_ERROR",error:r instanceof Error?r.message:"Unknown error"}}}},providesTags:["Events"]})})}),{useGetEventsQuery:jo,useGetLiveNowCardsQuery:sa,useGetUpcomingEventsQuery:$o,useGetEventsByDateRangeQuery:Fo}=Ve;async function aa(e){try{const t=ae("PEER_URL"),n=await fetch(`${t}/lambdas/profiles/${e.toLowerCase()}`);return n.ok?await n.json()??null:null}catch{return null}}const Ye=nr({reducerPath:"profileClient",baseQuery:Bi(),tagTypes:["Profile"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:e=>({getProfile:e.query({queryFn:async t=>{if(!t)return{data:null};try{return{data:await aa(t)}}catch{return{data:null}}},providesTags:(t,n,r)=>r?[{type:"Profile",id:r}]:[]})})}),{useGetProfileQuery:ir}=Ye,{combineReducers:oa,configureStore:ca}=await N("@reduxjs/toolkit"),ua=oa({network:li,transactions:wi,wallet:hi,[Ye.reducerPath]:Ye.reducer,[Ve.reducerPath]:Ve.reducer}),la=ca({reducer:ua,middleware:e=>e().concat(Ye.middleware,Ve.middleware),devTools:!1});ki(la.dispatch);const Wo={"live_now.title":"Live Now"};var Ft={},da=Fn;Object.defineProperty(Ft,"__esModule",{value:!0});var sr=Ft.default=void 0,fa=da($n()),ha=H;sr=Ft.default=(0,fa.default)((0,ha.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var Wt={},pa=Fn;Object.defineProperty(Wt,"__esModule",{value:!0});var ar=Wt.default=void 0,ga=pa($n()),ma=H;ar=Wt.default=(0,ga.default)((0,ma.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");const{memo:ya}=await N("react"),{BadgeGroup:va,EventCard:wa,LiveBadge:ba,UserCountBadge:Sa}=await N("decentraland-ui2"),Ea=`${window.location.origin}/dcl-logo.svg`.replace(/^http:\/\//,"https://");function Ca(e){return`https://play.decentraland.org/?position=${e}`}const or=ya(({card:e})=>{const{data:t}=ir(e.creatorAddress,{skip:!e.creatorAddress||e.isGenesisPlaza}),n=t?.avatars?.[0];let i=n?{name:n.name??"",ethAddress:n.ethAddress??"",avatar:n.avatar}:void 0;return!i&&e.creatorName&&(i={name:e.creatorName,ethAddress:"",...e.isGenesisPlaza&&{avatar:{snapshots:{face256:Ea,body:""}}}}),H.jsx(wa,{image:e.image,sceneName:e.title,coordinates:e.coordinates,avatar:i,onClick:()=>window.open(Ca(e.coordinates),"_blank","noopener,noreferrer"),leftBadge:H.jsxs(va,{children:[e.type==="event"&&H.jsx(ba,{}),H.jsx(Sa,{count:e.users})]}),leftBadgeTransparent:!0,hideLocation:!0})});or.displayName="LiveNowCardItem";const{Box:it,IconButton:_a,Typography:Ia,styled:ie}=await N("decentraland-ui2"),Pa=ie("section")(({theme:e})=>({marginTop:e.spacing(4),padding:e.spacing(4,3),background:"radial-gradient(63.39% 112.69% at 49.33% 50.11%, #A042CD 0%, #32134C 100%)",borderRadius:e.spacing(2),[e.breakpoints.down("sm")]:{padding:e.spacing(3,2)}})),Aa=ie(it)({display:"flex",alignItems:"center",gap:8,marginBottom:24}),Ra=ie(Ia)({fontWeight:600}),xn=62,kn=60,Ta=ie(it)({position:"relative"}),Ln=ie(_a)(({theme:e,side:t})=>({position:"absolute",top:"50%",transform:"translateY(-50%)",[t]:e.spacing(1),zIndex:2,backgroundColor:"rgba(0, 0, 0, 0.5)",color:e.palette.common.white,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.7)"},[e.breakpoints.down("sm")]:{display:"none"}})),Ma=ie(it)(({theme:e,fadeLeft:t,fadeRight:n})=>{const r=[];return t&&r.push(`linear-gradient(to right, transparent, black ${kn}px)`),n&&r.push(`linear-gradient(to left, transparent, black ${kn}px)`),{display:"flex",gap:e.spacing(2),justifyContent:"safe center",alignItems:"stretch",overflowX:"auto",scrollSnapType:"x mandatory",scrollBehavior:"smooth",scrollbarWidth:"none",...r.length>0&&{maskImage:r.join(", "),WebkitMaskImage:r.join(", ")},...r.length>1&&{maskComposite:"intersect",WebkitMaskComposite:"source-in"},"&::-webkit-scrollbar":{display:"none"},"& .MuiCard-root":{minWidth:280,maxWidth:850,maxHeight:420,flex:"1 1 0",containerType:"inline-size",scrollSnapAlign:"start",overflow:"hidden"},"& .MuiCardActionArea-root":{height:"100%"},"&& .MuiCardMedia-root":{height:"min(62.5cqw, 297px)"},"&& .MuiCardActionArea-root:hover .MuiCardMedia-root":{height:"min(62.5cqw, 297px)"},"&& .MuiCardActionArea-root:hover .MuiCardContent-root > div:first-of-type > div:last-child":{marginBottom:0},"& .MuiCardContent-root .MuiTypography-h6":{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",WebkitLineClamp:"unset",WebkitBoxOrient:"unset"},"& .MuiCardContent-root .MuiBox-root .MuiBox-root:has(.MuiAvatar-root)":{maxWidth:"100%"},[e.breakpoints.down("sm")]:{maskImage:"none",WebkitMaskImage:"none","& .MuiCard-root":{minWidth:"unset",maxWidth:"unset",maxHeight:"none",flex:"0 0 100%"},"&& .MuiCardMedia-root":{height:`calc(62.5cqw - ${xn}px)`},"&& .MuiCardActionArea-root:hover .MuiCardMedia-root":{height:`calc(62.5cqw - ${xn}px)`},"&& .MuiCardActionArea-root:hover .MuiCardContent-root > div:first-of-type > div:last-child":{marginBottom:0},"&& .MuiCardContent-root > .MuiBox-root:last-child":{display:"flex",opacity:1,transform:"translateY(0)"}}}}),Oa=ie(yr)({color:"#E00000"}),Da=ie(it)(({theme:e})=>({display:"flex",justifyContent:"center",gap:e.spacing(.75),marginTop:e.spacing(2)})),xa=ie("button")(({theme:e,active:t})=>({width:8,height:8,borderRadius:"50%",border:"none",padding:0,cursor:"pointer",backgroundColor:t?e.palette.common.white:"rgba(255, 255, 255, 0.3)",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short})})),{useCallback:de,useEffect:ka,useMemo:La,useRef:Nn,useState:Pe}=await N("react"),{useTranslation:Na}=await N("@dcl/hooks"),qn=300;function qa(){const{t:e}=Na(),t=La(()=>{const b=new URLSearchParams(window.location.search).get("minUsers");if(b!==null&&!Number.isNaN(Number(b)))return{minUsers:Number(b)}},[]),{data:n=[]}=sa(t,{pollingInterval:6e4}),[r,i]=Pe(0),[o,u]=Pe(!1),[l,c]=Pe(!1),[a,I]=Pe(1),[y,p]=Pe(!1),m=Nn(null),M=Nn({isDown:!1,startX:0,scrollLeft:0}),A=de(()=>{const S=m.current;if(!S)return;const b=S.scrollWidth>S.clientWidth,R=b?Math.ceil(S.scrollWidth/S.clientWidth):1;u(S.scrollLeft>0),c(b&&S.scrollLeft+S.clientWidth<S.scrollWidth-1),I(R);const C=S.scrollWidth-S.clientWidth;if(C<=0)i(0);else{const h=S.scrollLeft/C;i(Math.round(h*(R-1)))}},[]);ka(()=>{const S=m.current;if(!S)return;A();const b=new ResizeObserver(A);return b.observe(S),()=>b.disconnect()},[n.length,A]);const _=de(S=>{const b=m.current;if(!b)return;const R=S==="left"?-qn:qn;b.scrollBy({left:R,behavior:"smooth"})},[]),P=de(S=>{const b=m.current;b&&(M.current={isDown:!0,startX:S.pageX-b.offsetLeft,scrollLeft:b.scrollLeft},p(!1))},[]),w=de(S=>{if(!M.current.isDown)return;const b=m.current;if(!b)return;S.preventDefault();const C=S.pageX-b.offsetLeft-M.current.startX;Math.abs(C)>5&&p(!0),b.scrollLeft=M.current.scrollLeft-C},[]),f=de(()=>{M.current.isDown=!1},[]),s=de(S=>{y&&S.stopPropagation()},[y]),v=de(S=>{const b=m.current;if(!b)return;const R=b.scrollWidth-b.clientWidth,C=a<=1?0:R*S/(a-1);b.scrollTo({left:C,behavior:"smooth"})},[a]);return n.length===0?null:H.jsxs(Pa,{children:[H.jsxs(Aa,{children:[H.jsx(Oa,{}),H.jsx(Ra,{variant:"h5",children:e("live_now.title")})]}),H.jsxs(Ta,{children:[o&&H.jsx(Ln,{side:"left",onClick:()=>_("left"),children:H.jsx(sr,{})}),l&&H.jsx(Ln,{side:"right",onClick:()=>_("right"),children:H.jsx(ar,{})}),H.jsx(Ma,{ref:m,onScroll:A,fadeLeft:o,fadeRight:l,onMouseDown:P,onMouseMove:w,onMouseUp:f,onMouseLeave:f,onClickCapture:s,sx:{cursor:y?"grabbing":"grab"},children:n.map(S=>H.jsx(or,{card:S},S.id))})]}),a>1&&H.jsx(Da,{children:Array.from({length:a},(S,b)=>H.jsx(xa,{active:b===r,onClick:()=>v(b),"aria-label":`Go to page ${b+1}`},b))})]})}const{useCallback:yt,useEffect:Ua,useMemo:Qa,useState:ja}=await N("react"),{useNotifications:$a}=await N("@dcl/hooks"),{NotificationActiveTab:Fa}=await N("decentraland-ui2");function Wa(e){const{identity:t,isConnected:n,locale:r="en"}=e,i=!!(t&&n),[o,u]=ja(!0),l=ae("NOTIFICATIONS_API_URL")??"https://notifications.decentraland.org";Ua(()=>{i||u(!0)},[i]);const c=yt(()=>{i&&u(s=>s&&!1)},[i]),{notifications:a,isLoading:I,isModalOpen:y,isNotificationsOnboarding:p,modalActiveTab:m,handleNotificationsOpen:M,handleOnBegin:A,handleOnChangeModalTab:_}=$a({identity:t??void 0,isNotificationsEnabled:i&&o,initialActiveTab:Fa.NEWEST,notificationsUrl:l,onError:c}),P=yt(()=>{o||u(!0),M()},[M,o]),w=yt((s,v)=>{_(v)},[_]);return{notificationProps:Qa(()=>{if(i)return{locale:r,isLoading:I,isOnboarding:p,isOpen:y,items:a,activeTab:m,onClick:P,onClose:P,onBegin:A,onChangeTab:w}},[i,r,I,p,y,a,m,P,A,w])}}var cr={},ee={},Ct={exports:{}},_t={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){if(r==null)throw new TypeError("Expected a string but received a ".concat(r));if(r.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(r.constructor.name))}e.exports=t.default,e.exports.default=t.default})(_t,_t.exports);var Ht=_t.exports,It={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function r(i,o){for(var u=0;u<o.length;u++){var l=o[u];if(i===l||n(l)&&l.test(i))return!0}return!1}e.exports=t.default,e.exports.default=t.default})(It,It.exports);var Ha=It.exports,Pt={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(i,o){return i.indexOf(o)!==-1};t.default=n,e.exports=t.default,e.exports.default=t.default})(Pt,Pt.exports);var Ba=Pt.exports,At={exports:{}},Rt={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var o in i)typeof r[o]>"u"&&(r[o]=i[o]);return r}e.exports=t.default,e.exports.default=t.default})(Rt,Rt.exports);var ur=Rt.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Ht),r=i(ur);function i(l){return l&&l.__esModule?l:{default:l}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function u(l,c){(0,n.default)(l),c=(0,r.default)(c,o),c.allow_trailing_dot&&l[l.length-1]==="."&&(l=l.substring(0,l.length-1)),c.allow_wildcard===!0&&l.indexOf("*.")===0&&(l=l.substring(2));var a=l.split("."),I=a[a.length-1];return c.require_tld&&(a.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(I)||/\s/.test(I))||!c.allow_numeric_tld&&/^\d+$/.test(I)?!1:a.every(function(y){return!(y.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(y)||/[\uff01-\uff5e]/.test(y)||/^-|-$/.test(y)||!c.allow_underscores&&/_/.test(y))})}e.exports=t.default,e.exports.default=t.default})(At,At.exports);var za=At.exports,Tt={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=I;var n=r(Ht);function r(y){return y&&y.__esModule?y:{default:y}}function i(y){"@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(y)}var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",u="(".concat(o,"[.]){3}").concat(o),l=new RegExp("^".concat(u,"$")),c="(?:[0-9a-fA-F]{1,4})",a=new RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(u,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(u,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(u,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(u,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(u,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(u,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(u,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function I(y){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(y);var m=(i(p)==="object"?p.version:arguments[1])||"";return m?m.toString()==="4"?l.test(y):m.toString()==="6"?a.test(y):!1:I(y,{version:4})||I(y,{version:6})}e.exports=t.default,e.exports.default=t.default})(Tt,Tt.exports);var Ga=Tt.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=P;var n=c(Ht),r=c(Ha),i=c(Ba),o=c(za),u=c(Ga),l=c(ur);function c(w){return w&&w.__esModule?w:{default:w}}function a(w,f){return M(w)||m(w,f)||y(w,f)||I()}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(w,f){if(w){if(typeof w=="string")return p(w,f);var s={}.toString.call(w).slice(8,-1);return s==="Object"&&w.constructor&&(s=w.constructor.name),s==="Map"||s==="Set"?Array.from(w):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?p(w,f):void 0}}function p(w,f){(f==null||f>w.length)&&(f=w.length);for(var s=0,v=Array(f);s<f;s++)v[s]=w[s];return v}function m(w,f){var s=w==null?null:typeof Symbol<"u"&&w[Symbol.iterator]||w["@@iterator"];if(s!=null){var v,S,b,R,C=[],h=!0,d=!1;try{if(b=(s=s.call(w)).next,f!==0)for(;!(h=(v=b.call(s)).done)&&(C.push(v.value),C.length!==f);h=!0);}catch(g){d=!0,S=g}finally{try{if(!h&&s.return!=null&&(R=s.return(),Object(R)!==R))return}finally{if(d)throw S}}return C}}function M(w){if(Array.isArray(w))return w}var A={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},_=/^\[([^\]]+)\](?::([0-9]+))?$/;function P(w,f){if((0,n.default)(w),!w||/[\s<>]/.test(w)||w.indexOf("mailto:")===0||(f=(0,l.default)(f,A),f.validate_length&&w.length>f.max_allowed_length)||!f.allow_fragments&&(0,i.default)(w,"#")||!f.allow_query_components&&((0,i.default)(w,"?")||(0,i.default)(w,"&")))return!1;var s,v,S,b,R,C,h,d;h=w.split("#"),w=h.shift(),h=w.split("?"),w=h.shift();var g=w.match(/^([a-z][a-z0-9+\-.]*):/i),E=!1,T=function(X){return E=!0,s=X.toLowerCase(),f.require_valid_protocol&&f.protocols.indexOf(s)===-1?!1:w.substring(g[0].length)};if(g){var O=g[1],D=w.substring(g[0].length),L=D.slice(0,2)==="//";if(L){if(w=T(O),w===!1)return!1}else{var k=D.indexOf("/"),x=k===-1?D:D.substring(0,k),q=x.indexOf("@");if(q!==-1){var $=x.substring(0,q),z=/^[a-zA-Z0-9\-_.%:]*$/,W=z.test($),F=/%[0-9a-fA-F]{2}/.test($);if(W&&!F){if(f.require_protocol)return!1}else if(w=T(O),w===!1)return!1}else{var Q=/^[0-9]/.test(D);if(Q){if(f.require_protocol)return!1}else if(w=T(O),w===!1)return!1}}}else if(f.require_protocol)return!1;if(w.slice(0,2)==="//"){if(!E&&!f.allow_protocol_relative_urls)return!1;w=w.slice(2)}if(w==="")return!1;if(h=w.split("/"),w=h.shift(),w===""&&!f.require_host)return!0;if(h=w.split("@"),h.length>1){if(f.disallow_auth||h[0]===""||(v=h.shift(),v.indexOf(":")>=0&&v.split(":").length>2))return!1;var K=v.split(":"),U=a(K,2),j=U[0],B=U[1];if(j===""&&B==="")return!1}b=h.join("@"),C=null,d=null;var G=b.match(_);if(G?(S="",d=G[1],C=G[2]||null):(h=b.split(":"),S=h.shift(),h.length&&(C=h.join(":"))),C!==null&&C.length>0){if(R=parseInt(C,10),!/^[0-9]+$/.test(C)||R<=0||R>65535)return!1}else if(f.require_port)return!1;return f.host_whitelist?(0,r.default)(S,f.host_whitelist):S===""&&!f.require_host?!0:!(!(0,u.default)(S)&&!(0,o.default)(S,f)&&(!d||!(0,u.default)(d,6))||(S=S||d,f.host_blacklist&&(0,r.default)(S,f.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(Ct,Ct.exports);var Ka=Ct.exports,Bt={};(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(l){l.GET="get",l.STORE="store",l.CLEAR="clear",l.PING="ping"})(t||(e.Action=t={})),e.SINGLE_SIGN_ON_TARGET="single-sign-on";function n(l){return{target:e.SINGLE_SIGN_ON_TARGET,...l}}e.createMessage=n;function r(l){const c=localStorage.getItem(u(l));if(!c)return null;let a;try{a=JSON.parse(c)}catch{return o(l),null}return a.expiration=new Date(a.expiration),a.expiration.getTime()<=Date.now()?(o(l),null):a}e.localStorageGetIdentity=r;function i(l,c){new Date(c.expiration).getTime()>Date.now()&&localStorage.setItem(u(l),JSON.stringify(c))}e.localStorageStoreIdentity=i;function o(l){localStorage.removeItem(u(l))}e.localStorageClearIdentity=o;function u(l){if(!/^0x[a-fA-F0-9]{40}$/.test(l))throw new Error("User must be a valid ethereum address");return`single-sign-on-${l.toLowerCase()}`}})(Bt);Object.defineProperty(ee,"__esModule",{value:!0});ee.clearIdentity=ee.storeIdentity=ee.getIdentity=ee.init=void 0;const Va=Ka,te=Bt,lr=te.SINGLE_SIGN_ON_TARGET,Un=500,Ya=5;let Qn=0,Je="";const Ja={protocols:["https"],require_protocol:!0};function Xa(e,t={}){if(!(0,Va.default)(e,{...Ja,...t}))throw new Error(`Invalid url: ${e}`);if(Je)throw new Error("Already initialized");const n=document.createElement("iframe");n.id=lr,n.src=e,n.style.width="0",n.style.height="0",n.style.border="none",n.style.position="absolute",document.body.appendChild(n),Je=e}ee.init=Xa;async function Za(e){let t;try{t=(await st(await zt(),te.Action.GET,{user:e})).identity??null}catch(n){Gt(n),t=(0,te.localStorageGetIdentity)(e)}return t}ee.getIdentity=Za;async function eo(e,t){try{await st(await zt(),te.Action.STORE,{user:e,identity:t})}catch(n){Gt(n),(0,te.localStorageStoreIdentity)(e,t)}}ee.storeIdentity=eo;async function to(e){try{await st(await zt(),te.Action.CLEAR,{user:e})}catch(t){Gt(t),(0,te.localStorageClearIdentity)(e)}}ee.clearIdentity=to;async function zt(){if(!Je)throw new Error("Not initialized");for(let e=0;e<Ya;e++){const n=document.getElementById(lr)?.contentWindow;if(!n){await no(Un);continue}try{await st(n,te.Action.PING,{},Un)}catch{continue}return n}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function st(e,t,n,r=0){Qn++;const i=Qn;let o=null;const u=new Promise((l,c)=>{o=({data:a})=>{!a||a.target!==te.SINGLE_SIGN_ON_TARGET||a.id!==i||(a.error?c(new Error(a.error)):l(a))},window.addEventListener("message",o)});e.postMessage((0,te.createMessage)({id:i,action:t,...n}),Je);try{return await(r?Promise.race([u,new Promise((l,c)=>setTimeout(()=>c(new Error("Did not receive a response in time")),r))]):u)}catch(l){throw l}finally{o&&window.removeEventListener("message",o)}}function no(e){return new Promise(t=>setTimeout(t,e))}function Gt(e){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",e.message)}(function(e){var t=Le&&Le.__createBinding||(Object.create?function(r,i,o,u){u===void 0&&(u=o);var l=Object.getOwnPropertyDescriptor(i,o);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,u,l)}:function(r,i,o,u){u===void 0&&(u=o),r[u]=i[o]}),n=Le&&Le.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(ee,e),n(Bt,e)})(cr);const{useEffect:ro,useState:io}=await N("react");function so(){const{address:e}=zn(),t=e||void 0,[n,r]=io(void 0);return ro(()=>{if(!t){r(void 0);return}try{const i=cr.localStorageGetIdentity(t.toLowerCase());r(i??void 0)}catch(i){console.error("[useAuthIdentity] Failed to get identity:",i),r(void 0)}},[t]),{identity:n,hasValidIdentity:!!n,address:t}}function ao(){const e=ae("AUTH_URL")??"/auth";return e.startsWith("http")||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`}function oo(){const e=window.location.pathname,t=window.location.search;return new URLSearchParams(t).get("redirectTo")??`${e}${t}`}function co(e){const t=oo(),n=ao();Gr(),window.location.replace(`${n}/login?redirectTo=${encodeURIComponent(t)}`)}const{Box:dr,styled:fr}=await N("decentraland-ui2"),uo=fr(dr)(()=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:"linear-gradient(180deg, #1A0A2E 0%, #0D0116 100%)"})),lo=fr(dr)({flex:1,width:"100%"}),{useCallback:jn,useMemo:fo}=await N("react"),{useLocation:ho}=await N("react-router-dom"),{usePageTracking:po}=await N("@dcl/hooks"),{Footer:go,FooterLanding:mo,Navbar:yo,NavbarPages:vo,SupportedLanguage:wo}=await N("decentraland-ui2");function bo(e){const{children:t}=e,n=ho(),{address:r,isConnected:i,isConnecting:o,isDisconnecting:u,disconnect:l}=zn();po(n.pathname);const{identity:c}=so(),{notificationProps:a}=Wa({identity:c,isConnected:i,locale:"en"}),{data:I}=ir(r??void 0,{skip:!r}),y=I?.avatars?.[0],p=jn(()=>{co()},[]),m=jn(()=>{l()},[l]),M=fo(()=>({activePage:vo.EXPLORE,isSignedIn:i,isSigningIn:o,isDisconnecting:u,isActivity:!1,address:r||void 0,avatar:y,notifications:a,onClickSignIn:p,onClickSignOut:m,onClickNavbarItem:A=>{const _=A.currentTarget;_?.href&&(window.location.href=_.href)}}),[i,o,u,r,y,a,p,m]);return H.jsxs(uo,{children:[H.jsx(yo,{...M}),H.jsx(lo,{children:t}),H.jsx(mo,{}),H.jsx(go,{languages:[{code:wo.EN,name:"English",flag:"🇺🇸"}],hideSocialNetworks:!0})]})}const So="https://cdn.decentraland.org/@dcl/explore-site/0.0.1-24139497769.commit-1069c81/assets/top_background-Bnd2vX_F.webp",{Box:hr,styled:pr}=await N("decentraland-ui2"),Eo=pr(hr)(({standalone:e,theme:t})=>({position:"relative",background:`url(${So}) no-repeat top center, radial-gradient(61.64% 109.58% at 50% 54.49%, #A042CD 0%, #270537 100%)`,backgroundSize:"100% auto, 100% auto","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%)",pointerEvents:"none"},padding:t.spacing(5,8,2,8),[t.breakpoints.down("lg")]:{padding:t.spacing(5,4,2,4)},[t.breakpoints.down("md")]:{padding:t.spacing(5,3,2,3)},[t.breakpoints.down("sm")]:{padding:t.spacing(3,2,2,2)},...!e&&{paddingTop:0}})),Co=pr(hr)(({standalone:e,theme:t})=>({position:"relative",zIndex:1,display:"flex",flexDirection:"column",gap:t.spacing(4),paddingTop:e?"66px":"96px"}));function Ho({standalone:e=!0}){const t=H.jsx(Eo,{component:"main",standalone:e,children:H.jsx(Co,{standalone:e,children:H.jsx(qa,{})})});return e?H.jsx(bo,{children:t}):t}export{Ho as H,ko as W,Lo as a,xo as c,Wo as e,ae as g,Do as m,la as s};