From b2702d9a0d70e632f791f414d6301372b70bc90e Mon Sep 17 00:00:00 2001 From: lassejaco Date: Tue, 10 Oct 2023 18:12:31 +0200 Subject: [PATCH] polygon zkevm --- pretix_eth/network/tokens.py | 33 ++++++++++++++++++- pretix_eth/signals.py | 1 + .../pretix_eth/web3modal-dist/manifest.json | 4 +-- ...0.js => web3modal.177d8cabdae10dcc5990.js} | 2 +- ...c.js => web3modal.4411707096ff89c614b4.js} | 4 +-- ...modal.4411707096ff89c614b4.js.LICENSE.txt} | 0 .../static/pretix_eth/web3modal/src/chains.js | 5 ++- 7 files changed, 42 insertions(+), 7 deletions(-) rename pretix_eth/static/pretix_eth/web3modal-dist/{web3modal.7a7a63a03cd530c47640.js => web3modal.177d8cabdae10dcc5990.js} (72%) rename pretix_eth/static/pretix_eth/web3modal-dist/{web3modal.eef51034554448f63acc.js => web3modal.4411707096ff89c614b4.js} (97%) rename pretix_eth/static/pretix_eth/web3modal-dist/{web3modal.eef51034554448f63acc.js.LICENSE.txt => web3modal.4411707096ff89c614b4.js.LICENSE.txt} (100%) diff --git a/pretix_eth/network/tokens.py b/pretix_eth/network/tokens.py index 18207e38..1b62505d 100644 --- a/pretix_eth/network/tokens.py +++ b/pretix_eth/network/tokens.py @@ -415,9 +415,38 @@ class DaiGoerliArbitrum(Arbitrum): CHAIN_ID = 421613 EIP3091_EXPLORER_URL = "https://goerli.arbiscan.io" -# """ ZkSync Networks """ +# """ Polygon zk evm """ +class Polygon(L1): + """ + Implementation for ZkSync networks + """ + + NETWORK_IDENTIFIER = "PolygonZkEVM" + NETWORK_VERBOSE_NAME = "Polygon zkEVM" + CHAIN_ID = 1101 + EIP3091_EXPLORER_URL = "https://zkevm.polygonscan.com/" + + +class ETHPolygonZkEvm(Polygon): + """ + Ethereum on Polygon mainnet Network + """ + + TOKEN_SYMBOL = "ETH" + + +class DaiPolygonZkEvm(Polygon): + """ + DAI on Polygon Mainnet + """ + TOKEN_SYMBOL = "DAI" + IS_NATIVE_ASSET = False + ADDRESS = "0xC5015b9d9161Dca7e18e32f6f25C4aD850731Fd4" + + +# """ ZkSync Networks """ class ZkSync(L1): """ Implementation for ZkSync networks @@ -461,6 +490,8 @@ class DaiZkSync(ZkSync): ETHGoerliArbitrum(), DaiGoerliArbitrum(), ETHZkSync(), + ETHPolygonZkEvm(), + DaiPolygonZkEvm() ] all_network_verbose_names_to_ids = {} for token in registry: diff --git a/pretix_eth/signals.py b/pretix_eth/signals.py index 48f80c56..e11de0c0 100644 --- a/pretix_eth/signals.py +++ b/pretix_eth/signals.py @@ -44,6 +44,7 @@ def signal_process_response(sender, request, response, **kwargs): # Chrome correctly errors out without this CSP 'connect-src': [ "wss://relay.walletconnect.com", + "https://zkevm-rpc.com/", "https://explorer-api.walletconnect.com", "https://rpc.walletconnect.com", "https://zksync2-mainnet.zksync.io/", diff --git a/pretix_eth/static/pretix_eth/web3modal-dist/manifest.json b/pretix_eth/static/pretix_eth/web3modal-dist/manifest.json index 01d7810c..86d827b9 100644 --- a/pretix_eth/static/pretix_eth/web3modal-dist/manifest.json +++ b/pretix_eth/static/pretix_eth/web3modal-dist/manifest.json @@ -1,4 +1,4 @@ { - "main.js": "/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js", - "periodicCheck.js": "/static/pretix_eth/web3modal-dist/web3modal.7a7a63a03cd530c47640.js" + "main.js": "/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js", + "periodicCheck.js": "/static/pretix_eth/web3modal-dist/web3modal.177d8cabdae10dcc5990.js" } \ No newline at end of file diff --git a/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.7a7a63a03cd530c47640.js b/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.177d8cabdae10dcc5990.js similarity index 72% rename from pretix_eth/static/pretix_eth/web3modal-dist/web3modal.7a7a63a03cd530c47640.js rename to pretix_eth/static/pretix_eth/web3modal-dist/web3modal.177d8cabdae10dcc5990.js index 9ee0b099..9650b9b8 100644 --- a/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.7a7a63a03cd530c47640.js +++ b/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.177d8cabdae10dcc5990.js @@ -1 +1 @@ -(()=>{"use strict";const e=[{safeNetworkIdentifier:"mainnet",chain:{id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}},{safeNetworkIdentifier:"goerli",chain:{id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}},{safeNetworkIdentifier:"arbitrum",chain:{id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}},{chain:{id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}},{safeNetworkIdentifier:"optimism",chain:{id:10,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}}}},{chain:{id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0}},{chain:{id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]},public:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}},{chain:{id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}}],t={selectedAccount:null,signedByAccount:null,messageSignature:null,paymentDetails:null,signatureRequested:!1,transactionRequested:!1,transactionHashSubmitted:!1,lastOrderStatus:"",elements:{divPrepare:document.getElementById("prepare"),divError:document.getElementById("message-error"),divSuccess:document.getElementById("success"),divTransactionHash:document.getElementById("pretix-eth-transaction-hash"),aOrderDetailURL:document.getElementById("pretix-order-detail-url"),aNetworkData:document.getElementById("pretix-data-chain-info"),buttonConnect:document.getElementById("btn-connect"),submittedTransactionHash:document.getElementById("pretix-eth-submitted-transaction-hash"),paymentNetworkName:document.getElementById("payment-network-id")},selectors:{paymentSteps:document.querySelectorAll(".pretix-eth-payment-steps")},chains:[],web3Modal:null};async function a(){let e=t.elements.aOrderDetailURL.getAttribute("data-order-detail-url");const a=function(e){e+="=";const t=decodeURIComponent(document.cookie).split(";");for(let a=0;a{const r=t.elements.submittedTransactionHash;if(null!==r){const s=t.elements.aNetworkData.getAttribute("data-chain-id"),i=r.innerText;r.innerHTML=function(t,a){const r=e.filter((e=>e.chain.id===parseInt(t)));let s;r&&(s=r[0].chain);const i=s?.blockExplorers?.etherscan?.url;return i?''+a+"":a}(s,i),await async function(){for(;;)await a(),await new Promise((e=>setTimeout(e,5e3)))}()}}))})(); \ No newline at end of file +(()=>{"use strict";const e=[{safeNetworkIdentifier:"mainnet",chain:{id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}},{safeNetworkIdentifier:"goerli",chain:{id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}},{safeNetworkIdentifier:"arbitrum",chain:{id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}},{chain:{id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}},{safeNetworkIdentifier:"optimism",chain:{id:10,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}}}},{chain:{id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0}},{chain:{id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]},public:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}},{chain:{id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}},{chain:{id:1101,name:"Polygon zkEVM",network:"polygon-zkevm",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]},public:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com"}}}}],t={selectedAccount:null,signedByAccount:null,messageSignature:null,paymentDetails:null,signatureRequested:!1,transactionRequested:!1,transactionHashSubmitted:!1,lastOrderStatus:"",elements:{divPrepare:document.getElementById("prepare"),divError:document.getElementById("message-error"),divSuccess:document.getElementById("success"),divTransactionHash:document.getElementById("pretix-eth-transaction-hash"),aOrderDetailURL:document.getElementById("pretix-order-detail-url"),aNetworkData:document.getElementById("pretix-data-chain-info"),buttonConnect:document.getElementById("btn-connect"),submittedTransactionHash:document.getElementById("pretix-eth-submitted-transaction-hash"),paymentNetworkName:document.getElementById("payment-network-id")},selectors:{paymentSteps:document.querySelectorAll(".pretix-eth-payment-steps")},chains:[],web3Modal:null};async function a(){let e=t.elements.aOrderDetailURL.getAttribute("data-order-detail-url");const a=function(e){e+="=";const t=decodeURIComponent(document.cookie).split(";");for(let a=0;a{const r=t.elements.submittedTransactionHash;if(null!==r){const s=t.elements.aNetworkData.getAttribute("data-chain-id"),i=r.innerText;r.innerHTML=function(t,a){const r=e.filter((e=>e.chain.id===parseInt(t)));let s;r&&(s=r[0].chain);const i=s?.blockExplorers?.etherscan?.url;return i?''+a+"":a}(s,i),await async function(){for(;;)await a(),await new Promise((e=>setTimeout(e,5e3)))}()}}))})(); \ No newline at end of file diff --git a/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js b/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js similarity index 97% rename from pretix_eth/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js rename to pretix_eth/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js index 886b473f..335e7fde 100644 --- a/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js +++ b/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js @@ -1,2 +1,2 @@ -/*! For license information please see web3modal.eef51034554448f63acc.js.LICENSE.txt */ -(()=>{var e={8099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7117);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function l(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function u(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),u(e/4294967296>>>0,t,r),u(e>>>0,t,r+4),t}function p(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e>>>0,t,r),h(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=l,t.writeUint32BE=u,t.writeInt32BE=u,t.writeUint32LE=h,t.writeInt32LE=h,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=l(e,t);return 4294967296*l(e,t+4)+r},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=p,t.writeInt64LE=p,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8099),i=r(7309),o=20;function s(e,t,r){for(var i=1634760805,s=857760878,a=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],u=r[7]<<24|r[6]<<16|r[5]<<8|r[4],h=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],p=r[19]<<24|r[18]<<16|r[17]<<8|r[16],f=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],w=t[3]<<24|t[2]<<16|t[1]<<8|t[0],b=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],y=t[15]<<24|t[14]<<16|t[13]<<8|t[12],x=i,A=s,C=a,E=c,I=l,_=u,P=h,O=d,S=p,k=f,M=m,T=g,N=w,j=b,R=v,L=y,B=0;B>>16|N<<16)|0)>>>20|I<<12,_=(_^=k=k+(j=(j^=A=A+_|0)>>>16|j<<16)|0)>>>20|_<<12,P=(P^=M=M+(R=(R^=C=C+P|0)>>>16|R<<16)|0)>>>20|P<<12,O=(O^=T=T+(L=(L^=E=E+O|0)>>>16|L<<16)|0)>>>20|O<<12,P=(P^=M=M+(R=(R^=C=C+P|0)>>>24|R<<8)|0)>>>25|P<<7,O=(O^=T=T+(L=(L^=E=E+O|0)>>>24|L<<8)|0)>>>25|O<<7,_=(_^=k=k+(j=(j^=A=A+_|0)>>>24|j<<8)|0)>>>25|_<<7,I=(I^=S=S+(N=(N^=x=x+I|0)>>>24|N<<8)|0)>>>25|I<<7,_=(_^=M=M+(L=(L^=x=x+_|0)>>>16|L<<16)|0)>>>20|_<<12,P=(P^=T=T+(N=(N^=A=A+P|0)>>>16|N<<16)|0)>>>20|P<<12,O=(O^=S=S+(j=(j^=C=C+O|0)>>>16|j<<16)|0)>>>20|O<<12,I=(I^=k=k+(R=(R^=E=E+I|0)>>>16|R<<16)|0)>>>20|I<<12,O=(O^=S=S+(j=(j^=C=C+O|0)>>>24|j<<8)|0)>>>25|O<<7,I=(I^=k=k+(R=(R^=E=E+I|0)>>>24|R<<8)|0)>>>25|I<<7,P=(P^=T=T+(N=(N^=A=A+P|0)>>>24|N<<8)|0)>>>25|P<<7,_=(_^=M=M+(L=(L^=x=x+_|0)>>>24|L<<8)|0)>>>25|_<<7;n.writeUint32LE(x+i|0,e,0),n.writeUint32LE(A+s|0,e,4),n.writeUint32LE(C+a|0,e,8),n.writeUint32LE(E+c|0,e,12),n.writeUint32LE(I+l|0,e,16),n.writeUint32LE(_+u|0,e,20),n.writeUint32LE(P+h|0,e,24),n.writeUint32LE(O+d|0,e,28),n.writeUint32LE(S+p|0,e,32),n.writeUint32LE(k+f|0,e,36),n.writeUint32LE(M+m|0,e,40),n.writeUint32LE(T+g|0,e,44),n.writeUint32LE(N+w|0,e,48),n.writeUint32LE(j+b|0,e,52),n.writeUint32LE(R+v|0,e,56),n.writeUint32LE(L+y|0,e,60)}function a(e,t,r,n,o){if(void 0===o&&(o=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,t++;if(n>0)throw new Error("ChaCha: counter overflow")}t.streamXOR=a,t.stream=function(e,t,r,n){return void 0===n&&(n=0),i.wipe(r),a(e,t,r,r,n)}},5501:(e,t,r)=>{"use strict";var n=r(5439),i=r(3027),o=r(7309),s=r(8099),a=r(4153);t.Cv=32,t.WH=12,t.pg=16;var c=new Uint8Array(16),l=function(){function e(e){if(this.nonceLength=t.WH,this.tagLength=t.pg,e.length!==t.Cv)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);n.stream(this._key,s,a,4);var c,l=t.length+this.tagLength;if(i){if(i.length!==l)throw new Error("ChaCha20Poly1305: incorrect destination length");c=i}else c=new Uint8Array(l);return n.streamXOR(this._key,s,t,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),r),o.wipe(s),c},e.prototype.open=function(e,t,r,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&a.update(c.subarray(n.length%16))),a.update(r),r.length%16>0&&a.update(c.subarray(r.length%16));var l=new Uint8Array(8);n&&s.writeUint64LE(n.length,l),a.update(l),s.writeUint64LE(r.length,l),a.update(l);for(var u=a.digest(),h=0;h{"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},1050:(e,t,r)=>{"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0;r(1416);const n=r(3350);r(7309);function i(e){const t=new Float64Array(16);if(e)for(let r=0;r>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,d(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}function f(e){const t=new Uint8Array(32);return p(t,e),1&t[0]}function m(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function g(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function w(e,t,r){let n,i,o=0,s=0,a=0,c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=0,w=0,b=0,v=0,y=0,x=0,A=0,C=0,E=0,I=0,_=0,P=0,O=0,S=0,k=0,M=0,T=0,N=0,j=0,R=0,L=r[0],B=r[1],$=r[2],U=r[3],D=r[4],z=r[5],W=r[6],F=r[7],H=r[8],q=r[9],V=r[10],G=r[11],K=r[12],Z=r[13],Q=r[14],Y=r[15];n=t[0],o+=n*L,s+=n*B,a+=n*$,c+=n*U,l+=n*D,u+=n*z,h+=n*W,d+=n*F,p+=n*H,f+=n*q,m+=n*V,g+=n*G,w+=n*K,b+=n*Z,v+=n*Q,y+=n*Y,n=t[1],s+=n*L,a+=n*B,c+=n*$,l+=n*U,u+=n*D,h+=n*z,d+=n*W,p+=n*F,f+=n*H,m+=n*q,g+=n*V,w+=n*G,b+=n*K,v+=n*Z,y+=n*Q,x+=n*Y,n=t[2],a+=n*L,c+=n*B,l+=n*$,u+=n*U,h+=n*D,d+=n*z,p+=n*W,f+=n*F,m+=n*H,g+=n*q,w+=n*V,b+=n*G,v+=n*K,y+=n*Z,x+=n*Q,A+=n*Y,n=t[3],c+=n*L,l+=n*B,u+=n*$,h+=n*U,d+=n*D,p+=n*z,f+=n*W,m+=n*F,g+=n*H,w+=n*q,b+=n*V,v+=n*G,y+=n*K,x+=n*Z,A+=n*Q,C+=n*Y,n=t[4],l+=n*L,u+=n*B,h+=n*$,d+=n*U,p+=n*D,f+=n*z,m+=n*W,g+=n*F,w+=n*H,b+=n*q,v+=n*V,y+=n*G,x+=n*K,A+=n*Z,C+=n*Q,E+=n*Y,n=t[5],u+=n*L,h+=n*B,d+=n*$,p+=n*U,f+=n*D,m+=n*z,g+=n*W,w+=n*F,b+=n*H,v+=n*q,y+=n*V,x+=n*G,A+=n*K,C+=n*Z,E+=n*Q,I+=n*Y,n=t[6],h+=n*L,d+=n*B,p+=n*$,f+=n*U,m+=n*D,g+=n*z,w+=n*W,b+=n*F,v+=n*H,y+=n*q,x+=n*V,A+=n*G,C+=n*K,E+=n*Z,I+=n*Q,_+=n*Y,n=t[7],d+=n*L,p+=n*B,f+=n*$,m+=n*U,g+=n*D,w+=n*z,b+=n*W,v+=n*F,y+=n*H,x+=n*q,A+=n*V,C+=n*G,E+=n*K,I+=n*Z,_+=n*Q,P+=n*Y,n=t[8],p+=n*L,f+=n*B,m+=n*$,g+=n*U,w+=n*D,b+=n*z,v+=n*W,y+=n*F,x+=n*H,A+=n*q,C+=n*V,E+=n*G,I+=n*K,_+=n*Z,P+=n*Q,O+=n*Y,n=t[9],f+=n*L,m+=n*B,g+=n*$,w+=n*U,b+=n*D,v+=n*z,y+=n*W,x+=n*F,A+=n*H,C+=n*q,E+=n*V,I+=n*G,_+=n*K,P+=n*Z,O+=n*Q,S+=n*Y,n=t[10],m+=n*L,g+=n*B,w+=n*$,b+=n*U,v+=n*D,y+=n*z,x+=n*W,A+=n*F,C+=n*H,E+=n*q,I+=n*V,_+=n*G,P+=n*K,O+=n*Z,S+=n*Q,k+=n*Y,n=t[11],g+=n*L,w+=n*B,b+=n*$,v+=n*U,y+=n*D,x+=n*z,A+=n*W,C+=n*F,E+=n*H,I+=n*q,_+=n*V,P+=n*G,O+=n*K,S+=n*Z,k+=n*Q,M+=n*Y,n=t[12],w+=n*L,b+=n*B,v+=n*$,y+=n*U,x+=n*D,A+=n*z,C+=n*W,E+=n*F,I+=n*H,_+=n*q,P+=n*V,O+=n*G,S+=n*K,k+=n*Z,M+=n*Q,T+=n*Y,n=t[13],b+=n*L,v+=n*B,y+=n*$,x+=n*U,A+=n*D,C+=n*z,E+=n*W,I+=n*F,_+=n*H,P+=n*q,O+=n*V,S+=n*G,k+=n*K,M+=n*Z,T+=n*Q,N+=n*Y,n=t[14],v+=n*L,y+=n*B,x+=n*$,A+=n*U,C+=n*D,E+=n*z,I+=n*W,_+=n*F,P+=n*H,O+=n*q,S+=n*V,k+=n*G,M+=n*K,T+=n*Z,N+=n*Q,j+=n*Y,n=t[15],y+=n*L,x+=n*B,A+=n*$,C+=n*U,E+=n*D,I+=n*z,_+=n*W,P+=n*F,O+=n*H,S+=n*q,k+=n*V,M+=n*G,T+=n*K,N+=n*Z,j+=n*Q,R+=n*Y,o+=38*x,s+=38*A,a+=38*C,c+=38*E,l+=38*I,u+=38*_,h+=38*P,d+=38*O,p+=38*S,f+=38*k,m+=38*M,g+=38*T,w+=38*N,b+=38*j,v+=38*R,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=w+i+65535,i=Math.floor(n/65536),w=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=w+i+65535,i=Math.floor(n/65536),w=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=l,e[5]=u,e[6]=h,e[7]=d,e[8]=p,e[9]=f,e[10]=m,e[11]=g,e[12]=w,e[13]=b,e[14]=v,e[15]=y}function b(e,t){w(e,t,t)}function v(e,t){const r=i(),n=i(),o=i(),s=i(),c=i(),l=i(),u=i(),h=i(),d=i();g(r,e[1],e[0]),g(d,t[1],t[0]),w(r,r,d),m(n,e[0],e[1]),m(d,t[0],t[1]),w(n,n,d),w(o,e[3],t[3]),w(o,o,a),w(s,e[2],t[2]),m(s,s,s),g(c,n,r),g(l,s,o),m(u,s,o),m(h,n,r),w(e[0],c,l),w(e[1],h,u),w(e[2],u,l),w(e[3],c,h)}function y(e,t,r){for(let n=0;n<4;n++)d(e[n],t[n],r)}function x(e,t){const r=i(),n=i(),o=i();(function(e,t){const r=i();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)b(r,r),2!==n&&4!==n&&w(r,r,t);for(n=0;n<16;n++)e[n]=r[n]})(o,t[2]),w(r,t[0],o),w(n,t[1],o),p(e,n),e[31]^=f(r)<<7}function A(e,t){const r=[i(),i(),i(),i()];u(r[0],c),u(r[1],l),u(r[2],s),w(r[3],c,l),function(e,t,r){u(e[0],o),u(e[1],s),u(e[2],s),u(e[3],o);for(let n=255;n>=0;--n){const i=r[n/8|0]>>(7&n)&1;y(e,t,i),v(t,e),v(e,e),y(e,t,i)}}(e,r,t)}t._w=function(e){if(e.length!==t.aP)throw new Error(`ed25519: seed must be ${t.aP} bytes`);const r=(0,n.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const o=new Uint8Array(32),s=[i(),i(),i(),i()];A(s,r),x(o,s);const a=new Uint8Array(64);return a.set(e),a.set(o,32),{publicKey:o,secretKey:a}};const C=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function E(e,t){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>4)*C[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*C[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function I(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;E(e,t)}t.Xx=function(e,t){const r=new Float64Array(64),o=[i(),i(),i(),i()],s=(0,n.hash)(e.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;const a=new Uint8Array(64);a.set(s.subarray(32),32);const c=new n.SHA512;c.update(a.subarray(32)),c.update(t);const l=c.digest();c.clean(),I(l),A(o,l),x(a,o),c.reset(),c.update(a.subarray(0,32)),c.update(e.subarray(32)),c.update(t);const u=c.digest();I(u);for(let e=0;e<32;e++)r[e]=l[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=u[e]*s[t];return E(a.subarray(32),r),a}},9984:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},512:(e,t,r)=>{"use strict";var n=r(5629),i=r(7309),o=function(){function e(e,t,r,i){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=n.hmac(this._hash,r,t);this._hmac=new n.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9984),i=r(4153),o=r(7309),s=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},3027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4153),i=r(7309);t.DIGEST_LENGTH=16;var o=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=e[0]|e[1]<<8;this._r[0]=8191&r;var n=e[2]|e[3]<<8;this._r[1]=8191&(r>>>13|n<<3);var i=e[4]|e[5]<<8;this._r[2]=7939&(n>>>10|i<<6);var o=e[6]|e[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=e[8]|e[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=e[12]|e[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var l=e[14]|e[15]<<8;this._r[8]=8191&(c>>>8|l<<8),this._r[9]=l>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var n=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],l=this._h[5],u=this._h[6],h=this._h[7],d=this._h[8],p=this._h[9],f=this._r[0],m=this._r[1],g=this._r[2],w=this._r[3],b=this._r[4],v=this._r[5],y=this._r[6],x=this._r[7],A=this._r[8],C=this._r[9];r>=16;){var E=e[t+0]|e[t+1]<<8;i+=8191&E;var I=e[t+2]|e[t+3]<<8;o+=8191&(E>>>13|I<<3);var _=e[t+4]|e[t+5]<<8;s+=8191&(I>>>10|_<<6);var P=e[t+6]|e[t+7]<<8;a+=8191&(_>>>7|P<<9);var O=e[t+8]|e[t+9]<<8;c+=8191&(P>>>4|O<<12),l+=O>>>1&8191;var S=e[t+10]|e[t+11]<<8;u+=8191&(O>>>14|S<<2);var k=e[t+12]|e[t+13]<<8;h+=8191&(S>>>11|k<<5);var M=e[t+14]|e[t+15]<<8,T=0,N=T;N+=i*f,N+=o*(5*C),N+=s*(5*A),N+=a*(5*x),T=(N+=c*(5*y))>>>13,N&=8191,N+=l*(5*v),N+=u*(5*b),N+=h*(5*w),N+=(d+=8191&(k>>>8|M<<8))*(5*g);var j=T+=(N+=(p+=M>>>5|n)*(5*m))>>>13;j+=i*m,j+=o*f,j+=s*(5*C),j+=a*(5*A),T=(j+=c*(5*x))>>>13,j&=8191,j+=l*(5*y),j+=u*(5*v),j+=h*(5*b),j+=d*(5*w),T+=(j+=p*(5*g))>>>13,j&=8191;var R=T;R+=i*g,R+=o*m,R+=s*f,R+=a*(5*C),T=(R+=c*(5*A))>>>13,R&=8191,R+=l*(5*x),R+=u*(5*y),R+=h*(5*v),R+=d*(5*b);var L=T+=(R+=p*(5*w))>>>13;L+=i*w,L+=o*g,L+=s*m,L+=a*f,T=(L+=c*(5*C))>>>13,L&=8191,L+=l*(5*A),L+=u*(5*x),L+=h*(5*y),L+=d*(5*v);var B=T+=(L+=p*(5*b))>>>13;B+=i*b,B+=o*w,B+=s*g,B+=a*m,T=(B+=c*f)>>>13,B&=8191,B+=l*(5*C),B+=u*(5*A),B+=h*(5*x),B+=d*(5*y);var $=T+=(B+=p*(5*v))>>>13;$+=i*v,$+=o*b,$+=s*w,$+=a*g,T=($+=c*m)>>>13,$&=8191,$+=l*f,$+=u*(5*C),$+=h*(5*A),$+=d*(5*x);var U=T+=($+=p*(5*y))>>>13;U+=i*y,U+=o*v,U+=s*b,U+=a*w,T=(U+=c*g)>>>13,U&=8191,U+=l*m,U+=u*f,U+=h*(5*C),U+=d*(5*A);var D=T+=(U+=p*(5*x))>>>13;D+=i*x,D+=o*y,D+=s*v,D+=a*b,T=(D+=c*w)>>>13,D&=8191,D+=l*g,D+=u*m,D+=h*f,D+=d*(5*C);var z=T+=(D+=p*(5*A))>>>13;z+=i*A,z+=o*x,z+=s*y,z+=a*v,T=(z+=c*b)>>>13,z&=8191,z+=l*w,z+=u*g,z+=h*m,z+=d*f;var W=T+=(z+=p*(5*C))>>>13;W+=i*C,W+=o*A,W+=s*x,W+=a*y,T=(W+=c*v)>>>13,W&=8191,W+=l*b,W+=u*w,W+=h*g,W+=d*m,i=N=8191&(T=(T=((T+=(W+=p*f)>>>13)<<2)+T|0)+(N&=8191)|0),o=j+=T>>>=13,s=R&=8191,a=L&=8191,c=B&=8191,l=$&=8191,u=U&=8191,h=D&=8191,d=z&=8191,p=W&=8191,t+=16,r-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=l,this._h[6]=u,this._h[7]=h,this._h[8]=d,this._h[9]=p},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,n,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=r,r=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,s[0]=this._h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this._h[o]=this._h[o]&n|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,n=e.length;if(this._leftover){(t=16-this._leftover)>n&&(t=n);for(var i=0;i=16&&(t=n-n%16,this._blocks(e,r,t),r+=t,n-=t),n){for(i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const n=r(6008),i=r(8099),o=r(7309);function s(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const r=s(4,e),n=(0,i.readUint32LE)(r);return(0,o.wipe)(r),n};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let i="";const c=r.length,l=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/l),n);for(let n=0;n0;n++){const o=t[n];o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0,t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const n=r(7309);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(5883);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const n=r(5455),i=r(8871);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},3294:(e,t,r)=>{"use strict";var n=r(8099),i=r(7309);t.k=32,t.cn=64;var o=function(){function e(){this.digestLength=t.k,this.blockSize=t.cn,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.mE=o;var s=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(e,t,r,i,o){for(;o>=64;){for(var a=t[0],c=t[1],l=t[2],u=t[3],h=t[4],d=t[5],p=t[6],f=t[7],m=0;m<16;m++){var g=i+4*m;e[m]=n.readUint32BE(r,g)}for(m=16;m<64;m++){var w=e[m-2],b=(w>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,v=((w=e[m-15])>>>7|w<<25)^(w>>>18|w<<14)^w>>>3;e[m]=(b+e[m-7]|0)+(v+e[m-16]|0)}for(m=0;m<64;m++)b=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&d^~h&p)|0)+(f+(s[m]+e[m]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&l^c&l)|0,f=p,p=d,d=h,h=u+b|0,u=l,l=c,c=a,a=b+v|0;t[0]+=a,t[1]+=c,t[2]+=l,t[3]+=u,t[4]+=h,t[5]+=d,t[6]+=p,t[7]+=f,i+=64,o-=64}return i}t.vp=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},3350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8099),i=r(7309);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,o,a,c){for(var l,u,h,d,p,f,m,g,w=r[0],b=r[1],v=r[2],y=r[3],x=r[4],A=r[5],C=r[6],E=r[7],I=i[0],_=i[1],P=i[2],O=i[3],S=i[4],k=i[5],M=i[6],T=i[7];c>=128;){for(var N=0;N<16;N++){var j=8*N+a;e[N]=n.readUint32BE(o,j),t[N]=n.readUint32BE(o,j+4)}for(N=0;N<80;N++){var R,L,B=w,$=b,U=v,D=y,z=x,W=A,F=C,H=I,q=_,V=P,G=O,K=S,Z=k,Q=M;if(p=65535&(u=T),f=u>>>16,m=65535&(l=E),g=l>>>16,p+=65535&(u=(S>>>14|x<<18)^(S>>>18|x<<14)^(x>>>9|S<<23)),f+=u>>>16,m+=65535&(l=(x>>>14|S<<18)^(x>>>18|S<<14)^(S>>>9|x<<23)),g+=l>>>16,p+=65535&(u=S&k^~S&M),f+=u>>>16,m+=65535&(l=x&A^~x&C),g+=l>>>16,l=s[2*N],p+=65535&(u=s[2*N+1]),f+=u>>>16,m+=65535&l,g+=l>>>16,l=e[N%16],f+=(u=t[N%16])>>>16,m+=65535&l,g+=l>>>16,m+=(f+=(p+=65535&u)>>>16)>>>16,p=65535&(u=d=65535&p|f<<16),f=u>>>16,m=65535&(l=h=65535&m|(g+=m>>>16)<<16),g=l>>>16,p+=65535&(u=(I>>>28|w<<4)^(w>>>2|I<<30)^(w>>>7|I<<25)),f+=u>>>16,m+=65535&(l=(w>>>28|I<<4)^(I>>>2|w<<30)^(I>>>7|w<<25)),g+=l>>>16,f+=(u=I&_^I&P^_&P)>>>16,m+=65535&(l=w&b^w&v^b&v),g+=l>>>16,R=65535&(m+=(f+=(p+=65535&u)>>>16)>>>16)|(g+=m>>>16)<<16,L=65535&p|f<<16,p=65535&(u=G),f=u>>>16,m=65535&(l=D),g=l>>>16,f+=(u=d)>>>16,m+=65535&(l=h),g+=l>>>16,b=B,v=$,y=U,x=D=65535&(m+=(f+=(p+=65535&u)>>>16)>>>16)|(g+=m>>>16)<<16,A=z,C=W,E=F,w=R,_=H,P=q,O=V,S=G=65535&p|f<<16,k=K,M=Z,T=Q,I=L,N%16==15)for(j=0;j<16;j++)l=e[j],p=65535&(u=t[j]),f=u>>>16,m=65535&l,g=l>>>16,l=e[(j+9)%16],p+=65535&(u=t[(j+9)%16]),f+=u>>>16,m+=65535&l,g+=l>>>16,h=e[(j+1)%16],p+=65535&(u=((d=t[(j+1)%16])>>>1|h<<31)^(d>>>8|h<<24)^(d>>>7|h<<25)),f+=u>>>16,m+=65535&(l=(h>>>1|d<<31)^(h>>>8|d<<24)^h>>>7),g+=l>>>16,h=e[(j+14)%16],f+=(u=((d=t[(j+14)%16])>>>19|h<<13)^(h>>>29|d<<3)^(d>>>6|h<<26))>>>16,m+=65535&(l=(h>>>19|d<<13)^(d>>>29|h<<3)^h>>>6),g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,e[j]=65535&m|g<<16,t[j]=65535&p|f<<16}p=65535&(u=I),f=u>>>16,m=65535&(l=w),g=l>>>16,l=r[0],f+=(u=i[0])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[0]=w=65535&m|g<<16,i[0]=I=65535&p|f<<16,p=65535&(u=_),f=u>>>16,m=65535&(l=b),g=l>>>16,l=r[1],f+=(u=i[1])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[1]=b=65535&m|g<<16,i[1]=_=65535&p|f<<16,p=65535&(u=P),f=u>>>16,m=65535&(l=v),g=l>>>16,l=r[2],f+=(u=i[2])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[2]=v=65535&m|g<<16,i[2]=P=65535&p|f<<16,p=65535&(u=O),f=u>>>16,m=65535&(l=y),g=l>>>16,l=r[3],f+=(u=i[3])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[3]=y=65535&m|g<<16,i[3]=O=65535&p|f<<16,p=65535&(u=S),f=u>>>16,m=65535&(l=x),g=l>>>16,l=r[4],f+=(u=i[4])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[4]=x=65535&m|g<<16,i[4]=S=65535&p|f<<16,p=65535&(u=k),f=u>>>16,m=65535&(l=A),g=l>>>16,l=r[5],f+=(u=i[5])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[5]=A=65535&m|g<<16,i[5]=k=65535&p|f<<16,p=65535&(u=M),f=u>>>16,m=65535&(l=C),g=l>>>16,l=r[6],f+=(u=i[6])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[6]=C=65535&m|g<<16,i[6]=M=65535&p|f<<16,p=65535&(u=T),f=u>>>16,m=65535&(l=E),g=l>>>16,l=r[7],f+=(u=i[7])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[7]=E=65535&m|g<<16,i[7]=T=65535&p|f<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},7309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t{"use strict";t.gi=t.Au=t.KS=t.kz=void 0;const n=r(1416),i=r(7309);function o(e){const t=new Float64Array(16);if(e)for(let r=0;r=0;--e){const t=r[e>>>3]>>>(7&e)&1;l(i,s,t),l(f,m,t),u(g,i,f),h(i,i,f),u(f,s,m),h(s,s,m),p(m,g),p(w,i),d(i,f,i),d(f,s,g),u(g,i,f),h(i,i,f),p(s,i),h(f,m,w),d(i,f,a),u(i,i,m),d(f,f,i),d(i,m,w),d(m,s,n),p(s,g),l(i,s,t),l(f,m,t)}for(let e=0;e<16;e++)n[e+16]=i[e],n[e+32]=f[e],n[e+48]=s[e],n[e+64]=m[e];const b=n.subarray(32),v=n.subarray(16);!function(e,t){const r=o();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)p(r,r),2!==e&&4!==e&&d(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(b,b),d(v,v,b);const y=new Uint8Array(32);return function(e,t){const r=o(),n=o();for(let e=0;e<16;e++)n[e]=t[e];c(n),c(n),c(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,l(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}(y,v),y}t.Au=function(e){const r=(0,n.randomBytes)(32,e),o=function(e){if(e.length!==t.KS)throw new Error(`x25519: seed must be ${t.KS} bytes`);const r=new Uint8Array(e);return{publicKey:(n=r,f(n,s)),secretKey:r};var n}(r);return(0,i.wipe)(r),o},t.gi=function(e,r,n=!1){if(e.length!==t.kz)throw new Error("X25519: incorrect secret key length");if(r.length!==t.kz)throw new Error("X25519: incorrect public key length");const i=f(e,r);if(n){let e=0;for(let t=0;t{"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){const e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},8618:(e,t)=>{"use strict";function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function n(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=r,t.isNode=n,t.isBrowser=function(){return!r()&&!n()}},1468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(926),t),n.__exportStar(r(8618),t)},9328:(e,t,r)=>{"use strict";r.d(t,{OPTIONAL_EVENTS:()=>Na,OPTIONAL_METHODS:()=>Ma,default:()=>qa});var n={};r.r(n),r.d(n,{identity:()=>B});var i={};r.r(i),r.d(i,{base2:()=>$});var o={};r.r(o),r.d(o,{base8:()=>U});var s={};r.r(s),r.d(s,{base10:()=>D});var a={};r.r(a),r.d(a,{base16:()=>z,base16upper:()=>W});var c={};r.r(c),r.d(c,{base32:()=>F,base32hex:()=>G,base32hexpad:()=>Z,base32hexpadupper:()=>Q,base32hexupper:()=>K,base32pad:()=>q,base32padupper:()=>V,base32upper:()=>H,base32z:()=>Y});var l={};r.r(l),r.d(l,{base36:()=>J,base36upper:()=>X});var u={};r.r(u),r.d(u,{base58btc:()=>ee,base58flickr:()=>te});var h={};r.r(h),r.d(h,{base64:()=>re,base64pad:()=>ne,base64url:()=>ie,base64urlpad:()=>oe});var d={};r.r(d),r.d(d,{base256emoji:()=>le});var p={};r.r(p),r.d(p,{sha256:()=>Me,sha512:()=>Te});var f={};r.r(f),r.d(f,{identity:()=>je});var m={};r.r(m),r.d(m,{code:()=>Le,decode:()=>$e,encode:()=>Be,name:()=>Re});var g={};r.r(g),r.d(g,{code:()=>We,decode:()=>He,encode:()=>Fe,name:()=>ze});var w=r(7187),b=r.n(w),v=r(5501),y=r(512),x=r(1416),A=r(3294),C=r(7664);function E(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function I(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?E(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function _(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=I(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return E(r)}const P=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var h=0,d=o-1;(0!==u||h>>0,s[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=h,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),m=n;p!==o;)f[m++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var h=t[i],d=0,p=s-1;(0!==h||d>>0,l[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var m=c.repeat(r);f{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class S{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class k{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return T(this,e)}}class M{constructor(e){this.decoders=e}or(e){return T(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const T=(e,t)=>new M({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class N{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new S(e,t,r),this.decoder=new k(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const j=({name:e,prefix:t,encode:r,decode:n})=>new N(e,t,r,n),R=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=P(r,t);return j({prefix:e,name:t,encode:n,decode:e=>O(i(e))})},L=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>j({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<((e,t,r,n)=>{const i={};for(let e=0;e=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),B=j({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)}),$=L({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),U=L({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),D=R({prefix:"9",name:"base10",alphabet:"0123456789"}),z=L({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),W=L({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),F=L({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),H=L({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),q=L({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),V=L({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),G=L({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),K=L({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Z=L({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Q=L({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Y=L({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),J=R({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),X=R({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ee=R({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),te=R({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),re=L({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ne=L({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ie=L({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),oe=L({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),se=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ae=se.reduce(((e,t,r)=>(e[r]=t,e)),[]),ce=se.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),le=j({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+ae[t]),"")},decode:function(e){const t=[];for(const r of e){const e=ce[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var ue=128,he=-128,de=Math.pow(2,31),pe=Math.pow(2,7),fe=Math.pow(2,14),me=Math.pow(2,21),ge=Math.pow(2,28),we=Math.pow(2,35),be=Math.pow(2,42),ve=Math.pow(2,49),ye=Math.pow(2,56),xe=Math.pow(2,63);const Ae=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=de;)r[n++]=255&t|ue,t/=128;for(;t&he;)r[n++]=255&t|ue,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},Ce=function(e){return e(Ae(e,t,r),t),Ie=e=>Ce(e),_e=(e,t)=>{const r=t.byteLength,n=Ie(e),i=n+Ie(r),o=new Uint8Array(i+r);return Ee(e,o,0),Ee(r,o,n),o.set(t,i),new Pe(e,r,t,o)};class Pe{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const Oe=({name:e,code:t,encode:r})=>new Se(e,t,r);class Se{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?_e(this.code,t):t.then((e=>_e(this.code,e)))}throw Error("Unknown type, must be binary type")}}const ke=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Me=Oe({name:"sha2-256",code:18,encode:ke("SHA-256")}),Te=Oe({name:"sha2-512",code:19,encode:ke("SHA-512")}),Ne=O,je={code:0,name:"identity",encode:Ne,digest:e=>_e(0,Ne(e))},Re="raw",Le=85,Be=e=>O(e),$e=e=>O(e),Ue=new TextEncoder,De=new TextDecoder,ze="json",We=512,Fe=e=>Ue.encode(JSON.stringify(e)),He=e=>JSON.parse(De.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const qe={...n,...i,...o,...s,...a,...c,...l,...u,...h,...d};function Ve(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Ge=Ve("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Ke=Ve("ascii","a",(e=>{let t="a";for(let r=0;r{const t=I((e=e.substring(1)).length);for(let r=0;r"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function Et(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var It=Object.defineProperty,_t=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,St=(e,t,r)=>t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kt=(e,t)=>{for(var r in t||(t={}))Pt.call(t,r)&&St(e,r,t[r]);if(_t)for(var r of _t(t))Ot.call(t,r)&&St(e,r,t[r]);return e};const Mt="ReactNative",Tt={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Nt="js";function jt(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Rt(){return!(0,ut.getDocument)()&&!!(0,ut.getNavigator)()&&navigator.product===Mt}function Lt(){return!jt()&&!!(0,ut.getNavigator)()}function Bt(){return Rt()?Tt.reactNative:jt()?Tt.node:Lt()?Tt.browser:Tt.unknown}function $t(e,t,n){const i=function(){if(typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}const e=t?ct(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new nt:"undefined"!=typeof navigator?ct(navigator.userAgent):"undefined"!=typeof process&&process.version?new et(process.version.slice(1)):null;var t;if(null===e)return"unknown";const n=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[n,e.name,e.version].join("-"):[n,e.version].join("-")}(),o=function(){var e;const t=Bt();return t===Tt.browser?[t,(null==(e=(0,ut.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[Nt,n].join("-"),i,o].join("/")}function Ut(e,t){return e.filter((e=>t.includes(e))).length===e.length}function Dt(e){return Object.fromEntries(e.entries())}function zt(e){return new Map(Object.entries(e))}function Wt(e=lt.FIVE_MINUTES,t){const r=(0,lt.toMiliseconds)(e||lt.FIVE_MINUTES);let n,i,o;return{resolve:e=>{o&&n&&(clearTimeout(o),n(e))},reject:e=>{o&&i&&(clearTimeout(o),i(e))},done:()=>new Promise(((e,s)=>{o=setTimeout((()=>{s(new Error(t))}),r),n=e,i=s}))}}function Ft(e,t,r){return new Promise((async(n,i)=>{const o=setTimeout((()=>i(new Error(r))),t);try{n(await e)}catch(e){i(e)}clearTimeout(o)}))}function Ht(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function qt(e){const[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);n.id=Number(r)}return n}function Vt(e,t){return(0,lt.fromMiliseconds)((t||Date.now())+(0,lt.toMiliseconds)(e))}function Gt(e){return Date.now()>=(0,lt.toMiliseconds)(e)}function Kt(e,t){return`${e}${t?`:${t}`:""}`}function Zt(e=[],t=[]){return[...new Set([...e,...t])]}function Qt(e){return e?.relay||{protocol:"irn"}}function Yt(e){const t=pt[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Jt=Object.defineProperty,Xt=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,rr=(e,t,r)=>t in e?Jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function nr(e,t="-"){const r={},n="relay"+t;return Object.keys(e).forEach((t=>{if(t.startsWith(n)){const i=t.replace(n,""),o=e[t];r[i]=o}})),r}function ir(e){return e.startsWith("//")?e.substring(2):e}function or(e){const t=[];return e.forEach((e=>{const[r,n]=e.split(":");t.push(`${r}:${n}`)})),t}function sr(e){return e.includes(":")}function ar(e){return sr(e)?e.split(":")[0]:e}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const cr={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},lr={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ur(e,t){const{message:r,code:n}=lr[e];return{message:t?`${r} ${t}`:r,code:n}}function hr(e,t){const{message:r,code:n}=cr[e];return{message:t?`${r} ${t}`:r,code:n}}function dr(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function pr(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function fr(e){return typeof e>"u"}function mr(e,t){return!(!t||!fr(e))||"string"==typeof e&&!!e.trim().length}function gr(e,t){return!(!t||!fr(e))||"number"==typeof e&&!isNaN(e)}function wr(e){return!(!mr(e,!1)||!e.includes(":"))&&2===e.split(":").length}function br(e){let t=!0;return dr(e)?e.length&&(t=e.every((e=>mr(e,!1)))):t=!1,t}function vr(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const n=function(e,t){let r=null;return br(e?.methods)?br(e?.events)||(r=hr("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=hr("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(e,`${t}, namespace`);n&&(r=n)})),r}function yr(e,t){let r=null;if(e&&pr(e)){const n=vr(e,t);n&&(r=n);const i=function(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const n=function(e,t){let r=null;return dr(e)?e.forEach((e=>{r||function(e){if(mr(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&wr(e)}}return!1}(e)||(r=hr("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))})):r=hr("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}(e?.accounts,`${t} namespace`);n&&(r=n)})),r}(e,t);i&&(r=i)}else r=ur("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function xr(e){return mr(e.protocol,!0)}function Ar(e){return typeof e<"u"&&null!==typeof e}function Cr(e,t){return!(!wr(t)||!function(e){const t=[];return Object.values(e).forEach((e=>{t.push(...or(e.accounts))})),t}(e).includes(t))}function Er(e,t,r){let n=null;const i=function(e){const t={};return Object.keys(e).forEach((r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach((n=>{t[n]={methods:e[r].methods,events:e[r].events}}))})),t}(e),o=function(e){const t={};return Object.keys(e).forEach((r=>{if(r.includes(":"))t[r]=e[r];else{const n=or(e[r].accounts);n?.forEach((n=>{t[n]={accounts:e[r].accounts.filter((e=>e.includes(`${n}:`))),methods:e[r].methods,events:e[r].events}}))}})),t}(t),s=Object.keys(i),a=Object.keys(o),c=Ir(Object.keys(e)),l=Ir(Object.keys(t)),u=c.filter((e=>!l.includes(e)));return u.length&&(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${u.toString()}\n Received: ${Object.keys(t).toString()}`)),Ut(s,a)||(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach((e=>{if(!e.includes(":")||n)return;const i=or(t[e].accounts);i.includes(e)||(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${i.toString()}`))})),s.forEach((e=>{n||(Ut(i[e].methods,o[e].methods)?Ut(i[e].events,o[e].events)||(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))})),n}function Ir(e){return[...new Set(e.map((e=>e.includes(":")?e.split(":")[0]:e)))]}var _r=r(5150),Pr=r(772),Or=r(9107),Sr=r(8200);class kr extends Sr.q{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Mr extends Sr.q{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class Tr{constructor(e,t){this.logger=e,this.core=t}}class Nr extends Sr.q{constructor(e,t){super(),this.relayer=e,this.logger=t}}class jr extends Sr.q{constructor(e){super()}}class Rr{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class Lr extends Sr.q{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Br extends Sr.q{constructor(e,t){super(),this.core=e,this.logger=t}}class $r{constructor(e,t){this.projectId=e,this.logger=t}}class Ur{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class Dr{constructor(e){this.client=e}}const zr=e=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString()+"n":t));function Wr(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return(e=>{const t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,((e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t))})(e)}catch(t){return e}}function Fr(e){return"string"==typeof e?e:zr(e)||""}var Hr=r(1050);const qr="base64url",Vr="utf8",Gr=":",Kr="did",Zr="key",Qr="base58btc",Yr="z",Jr="K36";function Xr(e){return Ye(Qe(Fr(e),Vr),qr)}function en(e){const t=Qe(Jr,Qr),r=Yr+Ye(_([t,e]),Qr);return[Kr,Zr,r].join(Gr)}function tn(e=(0,x.randomBytes)(32)){return Hr._w(e)}r(3014);const rn="INTERNAL_ERROR",nn="SERVER_ERROR",on=[-32700,-32600,-32601,-32602,-32603],sn={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[rn]:{code:-32603,message:"Internal error"},[nn]:{code:-32e3,message:"Server error"}},an=nn;function cn(e){return Object.keys(sn).includes(e)?sn[e]:sn[an]}function ln(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var un=r(1468);function hn(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function dn(e=6){return BigInt(hn(e))}function pn(e,t,r){return{id:r||hn(),jsonrpc:"2.0",method:e,params:t}}function fn(e,t){return{id:e,jsonrpc:"2.0",result:t}}function mn(e,t,r){return{id:e,jsonrpc:"2.0",error:gn(t,r)}}function gn(e,t){return void 0===e?cn(rn):("string"==typeof e&&(e=Object.assign(Object.assign({},cn(nn)),{message:e})),void 0!==t&&(e.data=t),r=e.code,on.includes(r)&&(e=function(e){return Object.values(sn).find((t=>t.code===e))||sn[an]}(e.code)),e);var r}class wn{}class bn extends wn{constructor(){super()}}class vn extends bn{constructor(e){super()}}function yn(e,t){const r=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function xn(e){return yn(e,"^https?:")}function An(e){return yn(e,"^wss?:")}function Cn(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function En(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function In(e){return En(e)&&"method"in e}function _n(e){return En(e)&&(Pn(e)||On(e))}function Pn(e){return"result"in e}function On(e){return"error"in e}class Sn extends vn{constructor(e){super(e),this.events=new w.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(pn(e.method,e.params||[],e.id||dn().toString()),t)}async requestStrict(e,t){return new Promise((async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,(e=>{On(e)?n(e.error):r(e.result)}));try{await this.connection.send(e,t)}catch(e){n(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_n(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(e=>this.onPayload(e))),this.connection.on("close",(e=>this.onClose(e))),this.connection.on("error",(e=>this.events.emit("error",e))),this.connection.on("register_error",(e=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const kn=void 0!==r.g&&void 0!==r.g.WebSocket?r.g.WebSocket:"undefined"!=typeof window&&void 0!==window.WebSocket?window.WebSocket:r(7026);var Mn=r(2307),Tn=r.n(Mn),Nn=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var h=0,d=o-1;(0!==u||h>>0,s[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=h,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),m=n;p!==o;)f[m++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var h=t[i],d=0,p=s-1;(0!==h||d>>0,l[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var m=c.repeat(r);f{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class Rn{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Ln{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return $n(this,e)}}class Bn{constructor(e){this.decoders=e}or(e){return $n(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const $n=(e,t)=>new Bn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Un{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Rn(e,t,r),this.decoder=new Ln(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Dn=({name:e,prefix:t,encode:r,decode:n})=>new Un(e,t,r,n),zn=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Nn(r,t);return Dn({prefix:e,name:t,encode:n,decode:e=>jn(i(e))})},Wn=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Dn({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<((e,t,r,n)=>{const i={};for(let e=0;e=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),Fn=Dn({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var Hn=Object.freeze({__proto__:null,identity:Fn});const qn=Wn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Vn=Object.freeze({__proto__:null,base2:qn});const Gn=Wn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Kn=Object.freeze({__proto__:null,base8:Gn});const Zn=zn({prefix:"9",name:"base10",alphabet:"0123456789"});var Qn=Object.freeze({__proto__:null,base10:Zn});const Yn=Wn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Jn=Wn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Xn=Object.freeze({__proto__:null,base16:Yn,base16upper:Jn});const ei=Wn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ti=Wn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ri=Wn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ni=Wn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ii=Wn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),oi=Wn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),si=Wn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ai=Wn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ci=Wn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var li=Object.freeze({__proto__:null,base32:ei,base32upper:ti,base32pad:ri,base32padupper:ni,base32hex:ii,base32hexupper:oi,base32hexpad:si,base32hexpadupper:ai,base32z:ci});const ui=zn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hi=zn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var di=Object.freeze({__proto__:null,base36:ui,base36upper:hi});const pi=zn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fi=zn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var mi=Object.freeze({__proto__:null,base58btc:pi,base58flickr:fi});const gi=Wn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),wi=Wn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),bi=Wn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),vi=Wn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yi=Object.freeze({__proto__:null,base64:gi,base64pad:wi,base64url:bi,base64urlpad:vi});const xi=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ai=xi.reduce(((e,t,r)=>(e[r]=t,e)),[]),Ci=xi.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),Ei=Dn({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+Ai[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Ci[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Ii=Object.freeze({__proto__:null,base256emoji:Ei}),_i=128,Pi=-128,Oi=Math.pow(2,31),Si=Math.pow(2,7),ki=Math.pow(2,14),Mi=Math.pow(2,21),Ti=Math.pow(2,28),Ni=Math.pow(2,35),ji=Math.pow(2,42),Ri=Math.pow(2,49),Li=Math.pow(2,56),Bi=Math.pow(2,63),$i=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=Oi;)r[n++]=255&t|_i,t/=128;for(;tΠ)r[n++]=255&t|_i,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},Ui=function(e){return e($i(e,t,r),t),zi=e=>Ui(e),Wi=(e,t)=>{const r=t.byteLength,n=zi(e),i=n+zi(r),o=new Uint8Array(i+r);return Di(e,o,0),Di(r,o,n),o.set(t,i),new Fi(e,r,t,o)};class Fi{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const Hi=({name:e,code:t,encode:r})=>new qi(e,t,r);class qi{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Wi(this.code,t):t.then((e=>Wi(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Vi=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Gi=Hi({name:"sha2-256",code:18,encode:Vi("SHA-256")}),Ki=Hi({name:"sha2-512",code:19,encode:Vi("SHA-512")});Object.freeze({__proto__:null,sha256:Gi,sha512:Ki});const Zi=jn,Qi={code:0,name:"identity",encode:Zi,digest:e=>Wi(0,Zi(e))};Object.freeze({__proto__:null,identity:Qi}),new TextEncoder,new TextDecoder;const Yi={...Hn,...Vn,...Kn,...Qn,...Xn,...li,...di,...mi,...yi,...Ii};function Ji(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Xi(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const eo=Xi("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),to=Xi("ascii","a",(e=>{let t="a";for(let r=0;r{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Ji(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=(0,Or.generateChildLogger)(t,this.name)}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Dt(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?zt(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class jo{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),en(tn(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const e=function(){const e=C.Au();return{privateKey:Ye(e.secretKey,gt),publicKey:Ye(e.publicKey,gt)}}();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();const t=tn(await this.getClientSeed()),r=vt(),n=ao;return await async function(e,t,r,n,i=(0,lt.fromMiliseconds)(Date.now())){const o={alg:"EdDSA",typ:"JWT"},s={iss:en(n.publicKey),sub:e,aud:t,iat:i,exp:i+r},a=Qe([Xr((c={header:o,payload:s}).header),Xr(c.payload)].join("."),"utf8");var c;return function(e){return[Xr(e.header),Xr(e.payload),(t=e.signature,Ye(t,qr))].join(".");var t}({header:o,payload:s,signature:Hr.Xx(n.secretKey,a)})}(r,e,n,t)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=C.gi(Qe(e,gt),Qe(t,gt));return Ye(new y.t(A.mE,r).expand(32),gt)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)},this.setSymKey=async(e,t)=>{this.isInitialized();const r=t||function(e){return Ye((0,A.vp)(Qe(e,gt)),gt)}(e);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();const n=Ct(r),i=Fr(t);if(Et(n)){const t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}const o=this.getSymKey(e),{type:s,senderPublicKey:a}=n;return function(e){const t=function(e){return Qe(`${e}`,mt)}(typeof e.type<"u"?e.type:0);if(1===xt(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?Qe(e.senderPublicKey,gt):void 0,n=typeof e.iv<"u"?Qe(e.iv,gt):(0,x.randomBytes)(12);return function(e){if(1===xt(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ye(_([e.type,e.senderPublicKey,e.iv,e.sealed]),wt)}return Ye(_([e.type,e.iv,e.sealed]),wt)}({type:t,sealed:new v.OK(Qe(e.symKey,gt)).seal(n,Qe(e.message,bt)),iv:n,senderPublicKey:r})}({type:s,symKey:o,message:i,senderPublicKey:a})},this.decode=async(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=At(e);return Ct({type:xt(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ye(r.senderPublicKey,gt):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(Et(n)){const t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}const i=function(e){const t=new v.OK(Qe(e.symKey,gt)),{sealed:r,iv:n}=At(e.encoded),i=t.open(n,r);if(null===i)throw new Error("Failed to decrypt");return Ye(i,bt)}({symKey:this.getSymKey(e),encoded:t});return Wr(i)},this.getPayloadType=e=>xt(At(e).type),this.getPayloadSenderPublicKey=e=>{const t=At(e);return t.senderPublicKey?Ye(t.senderPublicKey,gt):void 0},this.core=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.keychain=r||new No(this.core,this.logger)}get context(){return(0,Or.getLoggerContext)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(so)}catch{e=vt(),await this.keychain.set(so,e)}return function(e,t="utf8"){const r=ro[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):Ji(globalThis.Buffer.from(e,"utf-8"))}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Ro extends Tr{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=io,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();const r=yt(t);let n=this.messages.get(e);return typeof n>"u"&&(n={}),typeof n[r]<"u"||(n[r]=t,this.messages.set(e,n),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[yt(t)]<"u"),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=(0,Or.generateChildLogger)(e,this.name),this.core=t}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Dt(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?zt(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Lo extends Nr{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new w.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,lt.toMiliseconds)(lt.TEN_SECONDS),this.queueTimeout=(0,lt.toMiliseconds)(lt.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});try{const n=r?.ttl||co,i=Qt(r),o=r?.prompt||!1,s=r?.tag||0,a=r?.id||dn().toString(),c={topic:e,message:t,opts:{ttl:n,relay:i,prompt:o,tag:s,id:a}},l=setTimeout((()=>this.queue.set(a,c)),this.queueTimeout);try{await await Ft(this.rpcPublish(e,t,n,i,o,s,a),this.publishTimeout),clearTimeout(l),this.relayer.events.emit(wo,c)}catch{return this.logger.debug("Publishing Payload stalled"),void(this.needsTransportRestart=!0)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(e),e}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.registerEventListeners()}get context(){return(0,Or.getLoggerContext)(this.logger)}rpcPublish(e,t,r,n,i,o,s){var a,c,l,u;const h={method:Yt(n.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:o},id:s};return fr(null==(a=h.params)?void 0:a.prompt)&&(null==(c=h.params)||delete c.prompt),fr(null==(l=h.params)?void 0:l.tag)&&(null==(u=h.params)||delete u.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.request(h)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach((async e=>{const{topic:t,message:r,opts:n}=e;await this.publish(t,r,n)}))}registerEventListeners(){this.relayer.core.heartbeat.on(Pr.HEARTBEAT_EVENTS.pulse,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(mo);this.checkQueue()})),this.relayer.on(ho,(e=>{this.onPublish(e.id.toString())}))}}class Bo{constructor(){this.map=new Map,this.set=(e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const n=r.filter((e=>e!==t));n.length?this.map.set(e,n):this.map.delete(e)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var $o=Object.defineProperty,Uo=Object.defineProperties,Do=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,Wo=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,Ho=(e,t,r)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qo=(e,t)=>{for(var r in t||(t={}))Wo.call(t,r)&&Ho(e,r,t[r]);if(zo)for(var r of zo(t))Fo.call(t,r)&&Ho(e,r,t[r]);return e},Vo=(e,t)=>Uo(e,Do(t));class Go extends Lr{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new Bo,this.events=new w.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=io,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const r=Qt(t),n={topic:e,relay:r};this.pending.set(e,n);const i=await this.rpcSubscribe(e,r);return this.onSubscribe(i,n),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}}),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>!!this.topics.includes(e)||await new Promise(((t,r)=>{const n=new lt.Watch;n.start(this.pendingSubscriptionWatchLabel);const i=setInterval((()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(i),n.stop(this.pendingSubscriptionWatchLabel),t(!0)),n.elapsed(this.pendingSubscriptionWatchLabel)>=Co&&(clearInterval(i),n.stop(this.pendingSubscriptionWatchLabel),r(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1)),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.clientId=""}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map((async r=>await this.unsubscribeById(e,r,t))))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const n=Qt(r);await this.rpcUnsubscribe(e,t,n);const i=hr("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t){const r={method:Yt(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await Ft(this.relayer.request(r),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(mo)}return yt(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:Yt(e[0].relay.protocol).batchSubscribe,params:{topics:e.map((e=>e.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await Ft(this.relayer.request(t),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(mo)}}rpcUnsubscribe(e,t,r){const n={method:Yt(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,Vo(qo({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach((e=>{this.setSubscription(e.id,qo({},e)),this.pending.delete(e.topic)}))}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,qo({},t)),this.topicMap.set(t.topic,e),this.events.emit(yo,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(xo,Vo(qo({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit("subscription_sync")}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);dr(t)&&this.onBatchSubscribe(t.map(((t,r)=>Vo(qo({},e[r]),{id:t}))))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach((t=>{e.push(t)})),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Pr.HEARTBEAT_EVENTS.pulse,(async()=>{await this.checkPending()})),this.relayer.on(po,(async()=>{await this.onConnect()})),this.relayer.on(fo,(()=>{this.onDisconnect()})),this.events.on(yo,(async e=>{const t=yo;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})),this.events.on(xo,(async e=>{const t=xo;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise((e=>{const t=setInterval((()=>{this.restartInProgress||(clearInterval(t),e())}),this.pollingInterval)}))}}var Ko=Object.defineProperty,Zo=Object.getOwnPropertySymbols,Qo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Jo=(e,t,r)=>t in e?Ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Xo extends jr{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new w.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async e=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(e)}catch(e){throw this.logger.debug("Failed to Publish Request"),this.logger.error(e),e}},this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?(0,Or.generateChildLogger)(e.logger,this.name):(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e.logger||"error"})),this.messages=new Ro(this.logger,e.core),this.subscriber=new Go(this,this.logger),this.publisher=new Lo(this,this.logger),this.relayUrl=e?.relayUrl||lo,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout((async()=>{0===this.subscriber.topics.length&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)}),1e4)}get context(){return(0,Or.getLoggerContext)(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var r;this.isInitialized();let n=(null==(r=this.subscriber.topicMap.get(e))?void 0:r[0])||"";return n||(await Promise.all([new Promise((t=>{this.subscriber.once(yo,(r=>{r.topic===e&&t()}))})),new Promise((async r=>{n=await this.subscriber.subscribe(e,t),r()}))]),n)}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(go))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise((e=>{this.initialized||e(),this.subscriber.once(Ao,(()=>{e()}))})),await Promise.race([new Promise((async(e,t)=>{await Ft(this.provider.connect(),5e3,"socket stalled").catch((e=>t(e))).then((()=>e())).finally((()=>this.removeListener(go,this.rejectTransportOpen)))})),new Promise((e=>this.once(go,this.rejectTransportOpen)))])])}catch(e){this.logger.error(e);const t=e;if(!this.isConnectionStalled(t.message))throw e;this.events.emit(go)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise((e=>{this.provider.once(bo,(()=>{e()}))})),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some((t=>e.includes(t)))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Sn(new class{constructor(e){if(this.url=e,this.events=new w.EventEmitter,this.registering=!1,!An(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return void 0!==this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise(((e,t)=>{void 0!==this.socket?(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()):t(new Error("Connection already closed"))}))}async send(e,t){void 0===this.socket&&(this.socket=await this.register());try{this.socket.send(Fr(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!An(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),void 0===this.socket)return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)}))}))}return this.url=e,this.registering=!0,new Promise(((t,r)=>{const n=(0,un.isReactNative)()?void 0:{rejectUnauthorized:!Cn(e)},i=new kn(e,[],n);"undefined"!=typeof window?i.onerror=e=>{const t=e;r(this.emitError(t.error))}:i.on("error",(e=>{r(this.emitError(e))})),i.onopen=()=>{this.onOpen(i),t(i)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?Wr(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=mn(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return ln(e,t,"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error((null==e?void 0:e.message)||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",t),t}}(function({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:s}){const a=r.split("?"),c={auth:i,ua:$t(e,t,n),projectId:o,useOnCloseEvent:s||void 0},l=function(e,t){let r=dt.parse(e);return r=kt(kt({},r),t),dt.stringify(r)}(a[1]||"",c);return a[0]+"?"+l}({sdkVersion:"2.8.4",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;return!await this.subscriber.isSubscribed(t)||this.messages.has(t,r)}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),In(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:r,message:n,publishedAt:i}=t.data,o={topic:r,message:n,publishedAt:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(((e,t)=>{for(var r in t||(t={}))Qo.call(t,r)&&Jo(e,r,t[r]);if(Zo)for(var r of Zo(t))Yo.call(t,r)&&Jo(e,r,t[r]);return e})({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else _n(e)&&this.events.emit(ho,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(uo,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=fn(e.id,!0);await this.provider.connection.send(t)}registerProviderListeners(){this.provider.on("payload",(e=>this.onProviderPayload(e))),this.provider.on("connect",(()=>{this.events.emit(po)})),this.provider.on(bo,(()=>{this.onProviderDisconnect()})),this.provider.on("error",(e=>{this.logger.error(e),this.events.emit("relayer_error",e)}))}registerEventListeners(){this.events.on(mo,(async()=>{await this.restartTransport()}))}onProviderDisconnect(){this.events.emit(fo),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout((async()=>{await this.restartTransport()}),(0,lt.toMiliseconds)(vo))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise((e=>{const t=setInterval((()=>{this.connected&&(clearInterval(t),e())}),this.connectionStatusPollingInterval)}));await this.restartTransport()}}}var es=Object.defineProperty,ts=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,is=(e,t,r)=>t in e?es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,os=(e,t)=>{for(var r in t||(t={}))rs.call(t,r)&&is(e,r,t[r]);if(ts)for(var r of ts(t))ns.call(t,r)&&is(e,r,t[r]);return e};class ss extends Rr{constructor(e,t,r,n=io,i=void 0){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=io,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>{this.getKey&&null!==e&&!fr(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return e?.topic}(e)&&this.map.set(e.topic,e)})),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter((t=>Object.keys(e).every((r=>Tn()(t[r],e[r]))))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const r=os(os({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),await this.persist())},this.logger=(0,Or.generateChildLogger)(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class as{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(b()),this.initialized=!1,this.storagePrefix=io,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async()=>{this.isInitialized();const e=vt(),t=await this.core.crypto.setSymKey(e),r=Vt(lt.FIVE_MINUTES),n={protocol:"irn"},i={topic:t,expiry:r,relay:n,active:!1},o=function(e){return`${e.protocol}:${e.topic}@${e.version}?`+dt.stringify(((e,t)=>{for(var r in t||(t={}))er.call(t,r)&&rr(e,r,t[r]);if(Xt)for(var r of Xt(t))tr.call(t,r)&&rr(e,r,t[r]);return e})({symKey:e.symKey},function(e,t="-"){const r={};return Object.keys(e).forEach((n=>{const i="relay"+t+n;e[n]&&(r[i]=e[n])})),r}(e.relay)))}({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:e,relay:n});return await this.pairings.set(t,i),await this.core.relayer.subscribe(t),this.core.expirer.set(t,r),{topic:t,uri:o}},this.pair=async e=>{this.isInitialized(),this.isValidPair(e);const{topic:t,symKey:r,relay:n}=function(e){const t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),i=e.substring(t+1,r).split("@"),o=typeof r<"u"?e.substring(r):"",s=dt.parse(o);return{protocol:n,topic:ir(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:nr(s)}}(e.uri);if(this.pairings.keys.includes(t))throw new Error(`Pairing already exists: ${t}`);if(this.core.crypto.hasKeys(t))throw new Error(`Keychain already exists: ${t}`);const i=Vt(lt.FIVE_MINUTES),o={topic:t,relay:n,expiry:i,active:!1};return await this.pairings.set(t,o),await this.core.crypto.setSymKey(r,t),await this.core.relayer.subscribe(t,{relay:n}),this.core.expirer.set(t,i),e.activatePairing&&await this.activate({topic:t}),o},this.activate=async({topic:e})=>{this.isInitialized();const t=Vt(lt.THIRTY_DAYS);await this.pairings.update(e,{active:!0,expiry:t}),this.core.expirer.set(e,t)},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=Wt();this.events.once(Kt("pairing_ping",e),(({error:e})=>{e?i(e):n()})),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",hr("USER_DISCONNECTED")),await this.deletePairing(t))},this.sendRequest=async(e,t,r)=>{const n=pn(t,r),i=await this.core.crypto.encode(e,n),o=Eo[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,o),n.id},this.sendResult=async(e,t,r)=>{const n=fn(e,r),i=await this.core.crypto.encode(t,n),o=await this.core.history.get(t,e),s=Eo[o.request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)},this.sendError=async(e,t,r)=>{const n=mn(e,r),i=await this.core.crypto.encode(t,n),o=await this.core.history.get(t,e),s=Eo[o.request.method]?Eo[o.request.method].res:Eo.unregistered_method.res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,hr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{const e=this.pairings.getAll().filter((e=>Gt(e.expiry)));await Promise.all(e.map((e=>this.deletePairing(e.topic))))},this.onRelayEventRequest=e=>{const{topic:t,payload:r}=e,n=r.method;if(this.pairings.keys.includes(t))switch(n){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;if(this.pairings.keys.includes(t))return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)},this.onPairingPingRequest=async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit("pairing_ping",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{const{id:r}=t;setTimeout((()=>{Pn(t)?this.events.emit(Kt("pairing_ping",r),{}):On(t)&&this.events.emit(Kt("pairing_ping",r),{error:t.error})}),500)},this.onPairingDeleteRequest=async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit("pairing_delete",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{const{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;const t=hr("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(hr("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`pair() params: ${e}`);throw new Error(t)}if(!function(e){if(mr(e,!1))try{return typeof new URL(e)<"u"}catch{return!1}return!1}(e.uri)){const{message:t}=ur("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw new Error(t)}},this.isValidPing=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!mr(e,!1)){const{message:t}=ur("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=ur("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}},this.core=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.pairings=new ss(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,Or.getLoggerContext)(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(uo,(async e=>{const{topic:t,message:r}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const n=await this.core.crypto.decode(t,r);In(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):_n(n)&&(await this.core.history.resolve(n),this.onRelayEventResponse({topic:t,payload:n}))}))}registerExpirerEvents(){this.core.expirer.on(ko,(async e=>{const{topic:t}=qt(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit("pairing_expire",{topic:t}))}))}}class cs extends Mr{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new w.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=io,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.records.set(e.id,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;const n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r};this.records.set(n.id,n),this.events.emit(Io,n)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=On(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.events.emit(_o,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach((r=>{if(r.topic===e){if(typeof t<"u"&&r.id!==t)return;this.records.delete(r.id),this.events.emit(Po,r)}}))},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=(0,Or.generateChildLogger)(t,this.name)}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach((t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:pn(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)})),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit("history_sync")}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Io,(e=>{const t=Io;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(_o,(e=>{const t=_o;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(Po,(e=>{const t=Po;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ls extends Br{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new w.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=io,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.expirations.set(e.target,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}},this.set=(e,t)=>{this.isInitialized();const r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(Oo,{target:r,expiration:n})},this.get=e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(So,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=(0,Or.generateChildLogger)(t,this.name)}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return Ht("topic",e)}(e);if("number"==typeof e)return function(e){return Ht("id",e)}(e);const{message:t}=ur("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit("expirer_sync")}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:r}=t;(0,lt.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(ko,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((e,t)=>this.checkExpiry(t,e)))}registerEventListeners(){this.core.heartbeat.on(Pr.HEARTBEAT_EVENTS.pulse,(()=>this.checkExpirations())),this.events.on(Oo,(e=>{const t=Oo;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(ko,(e=>{const t=ko;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(So,(e=>{const t=So;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class us extends $r{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Mo,this.initialized=!1,this.init=async e=>{Rt()||!Lt()||(this.verifyUrl=e?.verifyUrl||To,await this.createIframe())},this.register=async e=>{var t;if(this.initialized||await this.init(),this.iframe)try{null==(t=this.iframe.contentWindow)||t.postMessage(e.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${e.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async e=>{var t;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${e.attestationId}`);const r=this.startAbortTimer(lt.FIVE_SECONDS),n=await fetch(`${this.verifyUrl}/attestation/${e.attestationId}`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?null==(t=await n.json())?void 0:t.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise(((e,t)=>{if(document.getElementById(Mo))return e();const r=document.createElement("iframe");r.setAttribute("id",Mo),r.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),r.style.display="none",r.addEventListener("load",(()=>{this.initialized=!0,e()})),r.addEventListener("error",(e=>{t(e)})),document.body.append(r),this.iframe=r})),new Promise((e=>{setTimeout((()=>e("iframe load timeout")),(0,lt.toMiliseconds)(lt.ONE_SECOND/2))}))])}catch(e){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(e)}},this.logger=(0,Or.generateChildLogger)(t,this.name),this.verifyUrl=To,this.abortController=new AbortController,this.isDevEnv=jt()&&process.env.IS_VITEST}get context(){return(0,Or.getLoggerContext)(this.logger)}startAbortTimer(e){return setTimeout((()=>this.abortController.abort()),(0,lt.toMiliseconds)(e))}}var hs=Object.defineProperty,ds=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,fs=Object.prototype.propertyIsEnumerable,ms=(e,t,r)=>t in e?hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gs=(e,t)=>{for(var r in t||(t={}))ps.call(t,r)&&ms(e,r,t[r]);if(ds)for(var r of ds(t))fs.call(t,r)&&ms(e,r,t[r]);return e};class ws extends kr{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=no,this.events=new w.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||lo;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e?.logger||"error"}));this.logger=(0,Or.generateChildLogger)(t,this.name),this.heartbeat=new Pr.HeartBeat,this.crypto=new jo(this,this.logger,e?.keychain),this.history=new cs(this,this.logger),this.expirer=new ls(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new _r.ZP(gs(gs({},oo),e?.storageOptions)),this.relayer=new Xo({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new as(this,this.logger),this.verify=new us(this.projectId||"",this.logger)}static async init(e){const t=new ws(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return(0,Or.getLoggerContext)(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const bs=ws,vs="client",ys=`wc@2:${vs}:`,xs=vs,As="Proposal expired",Cs=lt.SEVEN_DAYS,Es={wc_sessionPropose:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:lt.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:lt.THIRTY_SECONDS,prompt:!1,tag:1115}}},Is={min:lt.FIVE_MINUTES,max:lt.SEVEN_DAYS},_s=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var Ps=Object.defineProperty,Os=Object.defineProperties,Ss=Object.getOwnPropertyDescriptors,ks=Object.getOwnPropertySymbols,Ms=Object.prototype.hasOwnProperty,Ts=Object.prototype.propertyIsEnumerable,Ns=(e,t,r)=>t in e?Ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,js=(e,t)=>{for(var r in t||(t={}))Ms.call(t,r)&&Ns(e,r,t[r]);if(ks)for(var r of ks(t))Ts.call(t,r)&&Ns(e,r,t[r]);return e},Rs=(e,t)=>Os(e,Ss(t));class Ls extends Dr{constructor(e){super(e),this.name="engine",this.events=new(b()),this.initialized=!1,this.ignoredPayloadTypes=[1],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Es)}),this.initialized=!0)},this.connect=async e=>{this.isInitialized();const t=Rs(js({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);const{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:o,relays:s}=t;let a,c=r,l=!1;if(c&&(l=this.client.core.pairing.pairings.get(c).active),!c||!l){const{topic:e,uri:t}=await this.client.core.pairing.create();c=e,a=t}const u=await this.client.core.crypto.generateKeyPair(),h=js({requiredNamespaces:n,optionalNamespaces:i,relays:s??[{protocol:"irn"}],proposer:{publicKey:u,metadata:this.client.metadata}},o&&{sessionProperties:o}),{reject:d,resolve:p,done:f}=Wt(lt.FIVE_MINUTES,As);if(this.events.once(Kt("session_connect"),(async({error:e,session:t})=>{if(e)d(e);else if(t){t.self.publicKey=u;const e=Rs(js({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:t.peer.metadata}),p(e)}})),!c){const{message:e}=ur("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(e)}const m=await this.sendRequest(c,"wc_sessionPropose",h),g=Vt(lt.FIVE_MINUTES);return await this.setProposal(m,js({id:m,expiry:g},h)),{uri:a,approval:f}},this.pair=async e=>(this.isInitialized(),await this.client.core.pairing.pair(e)),this.approve=async e=>{this.isInitialized(),await this.isValidApprove(e);const{id:t,relayProtocol:r,namespaces:n,sessionProperties:i}=e,o=this.client.proposal.get(t);let{pairingTopic:s,proposer:a,requiredNamespaces:c,optionalNamespaces:l}=o;s=s||"",pr(c)||(c=function(e,t){const r=yr(e,"approve()");if(r)throw new Error(r.message);const n={};for(const[t,r]of Object.entries(e))n[t]={methods:r.methods,events:r.events,chains:r.accounts.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))};return n}(n));const u=await this.client.core.crypto.generateKeyPair(),h=a.publicKey,d=await this.client.core.crypto.generateSharedKey(u,h);s&&t&&(await this.client.core.pairing.updateMetadata({topic:s,metadata:a.metadata}),await this.sendResult(t,s,{relay:{protocol:r??"irn"},responderPublicKey:u}),await this.client.proposal.delete(t,hr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:s}));const p=js({relay:{protocol:r??"irn"},namespaces:n,requiredNamespaces:c,optionalNamespaces:l,pairingTopic:s,controller:{publicKey:u,metadata:this.client.metadata},expiry:Vt(Cs)},i&&{sessionProperties:i});await this.client.core.relayer.subscribe(d),await this.sendRequest(d,"wc_sessionSettle",p);const f=Rs(js({},p),{topic:d,pairingTopic:s,acknowledged:!1,self:p.controller,peer:{publicKey:a.publicKey,metadata:a.metadata},controller:u});return await this.client.session.set(d,f),await this.setExpiry(d,Vt(Cs)),{topic:d,acknowledged:()=>new Promise((e=>setTimeout((()=>e(this.client.session.get(d))),500)))}},this.reject=async e=>{this.isInitialized(),await this.isValidReject(e);const{id:t,reason:r}=e,{pairingTopic:n}=this.client.proposal.get(t);n&&(await this.sendError(t,n,r),await this.client.proposal.delete(t,hr("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.isValidUpdate(e);const{topic:t,namespaces:r}=e,n=await this.sendRequest(t,"wc_sessionUpdate",{namespaces:r}),{done:i,resolve:o,reject:s}=Wt();return this.events.once(Kt("session_update",n),(({error:e})=>{e?s(e):o()})),await this.client.session.update(t,{namespaces:r}),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.isValidExtend(e);const{topic:t}=e,r=await this.sendRequest(t,"wc_sessionExtend",{}),{done:n,resolve:i,reject:o}=Wt();return this.events.once(Kt("session_extend",r),(({error:e})=>{e?o(e):i()})),await this.setExpiry(t,Vt(Cs)),{acknowledged:n}},this.request=async e=>{this.isInitialized(),await this.isValidRequest(e);const{chainId:t,request:n,topic:i,expiry:o}=e,s=await this.sendRequest(i,"wc_sessionRequest",{request:n,chainId:t},o),{done:a,resolve:c,reject:l}=Wt(o);return this.events.once(Kt("session_request",s),(({error:e,result:t})=>{e?l(e):c(t)})),this.client.events.emit("session_request_sent",{topic:i,request:n,chainId:t,id:s}),async function({id:e,topic:t,wcDeepLink:n}){try{if(!n)return;const i="string"==typeof n?JSON.parse(n):n;let o=i?.href;if("string"!=typeof o)return;o.endsWith("/")&&(o=o.slice(0,-1));const s=`${o}/wc?requestId=${e}&sessionTopic=${t}`,a=Bt();a===Tt.browser?window.open(s,"_self","noreferrer noopener"):a===Tt.reactNative&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(s)}catch(e){console.error(e)}}({id:s,topic:i,wcDeepLink:await this.client.core.storage.getItem("WALLETCONNECT_DEEPLINK_CHOICE")}),await a()},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:r}=e,{id:n}=r;Pn(r)?await this.sendResult(n,t,r.result):On(r)&&await this.sendError(n,t,r.error),this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=await this.sendRequest(t,"wc_sessionPing",{}),{done:r,resolve:n,reject:i}=Wt();this.events.once(Kt("session_ping",e),(({error:e})=>{e?i(e):n()})),await r()}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.isValidEmit(e);const{topic:t,event:r,chainId:n}=e;await this.sendRequest(t,"wc_sessionEvent",{event:r,chainId:n})},this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=dn().toString();let r;const n=t=>{t?.id.toString()===e&&(this.client.core.relayer.events.removeListener(ho,n),r())};await Promise.all([new Promise((e=>{r=e,this.client.core.relayer.on(ho,n)})),this.sendRequest(t,"wc_sessionDelete",hr("USER_DISCONNECTED"),void 0,e)]),await this.deleteSession(t)}else await this.client.core.pairing.disconnect({topic:t})},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter((t=>function(e,t){const{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r);let o=!0;return!!Ut(i,n)&&(n.forEach((t=>{const{accounts:n,methods:i,events:s}=e.namespaces[t],a=or(n),c=r[t];Ut(ft(t,c),a)&&Ut(c.methods,i)&&Ut(c.events,s)||(o=!1)})),o)}(t,e)))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic}));if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map((e=>this.client.core.pairing.disconnect({topic:e.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async(e,t)=>{const{self:r}=this.client.session.get(e);await this.client.core.relayer.unsubscribe(e),this.client.session.delete(e,hr("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(r.publicKey)&&await this.client.core.crypto.deleteKeyPair(r.publicKey),this.client.core.crypto.keychain.has(e)&&await this.client.core.crypto.deleteSymKey(e),t||this.client.core.expirer.del(e)},this.deleteProposal=async(e,t)=>{await Promise.all([this.client.proposal.delete(e,hr("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)])},this.deletePendingSessionRequest=async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&await this.client.session.update(e,{expiry:t}),this.client.core.expirer.set(e,t)},this.setProposal=async(e,t)=>{await this.client.proposal.set(e,t),this.client.core.expirer.set(e,t.expiry)},this.setPendingSessionRequest=async e=>{const t=Es.wc_sessionRequest.req.ttl,{id:r,topic:n,params:i}=e;await this.client.pendingRequest.set(r,{id:r,topic:n,params:i}),t&&this.client.core.expirer.set(r,Vt(t))},this.sendRequest=async(e,t,r,n,i)=>{const o=pn(t,r);if(Lt()&&_s.includes(t)){const e=yt(JSON.stringify(o));await this.client.core.verify.register({attestationId:e})}const s=await this.client.core.crypto.encode(e,o),a=Es[t].req;return n&&(a.ttl=n),i&&(a.id=i),this.client.core.history.set(e,o),this.client.core.relayer.publish(e,s,a),o.id},this.sendResult=async(e,t,r)=>{const n=fn(e,r),i=await this.client.core.crypto.encode(t,n),o=await this.client.core.history.get(t,e),s=Es[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(n)},this.sendError=async(e,t,r)=>{const n=mn(e,r),i=await this.client.core.crypto.encode(t,n),o=await this.client.core.history.get(t,e),s=Es[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(n)},this.cleanup=async()=>{const e=[],t=[];this.client.session.getAll().forEach((t=>{Gt(t.expiry)&&e.push(t.topic)})),this.client.proposal.getAll().forEach((e=>{Gt(e.expiry)&&t.push(e.id)})),await Promise.all([...e.map((e=>this.deleteSession(e))),...t.map((e=>this.deleteProposal(e)))])},this.onRelayEventRequest=e=>{const{topic:t,payload:r}=e,n=r.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeRequest(t,r);case"wc_sessionSettle":return this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return this.onSessionExtendRequest(t,r);case"wc_sessionPing":return this.onSessionPingRequest(t,r);case"wc_sessionDelete":return this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return this.onSessionRequest(t,r);case"wc_sessionEvent":return this.onSessionEventRequest(t,r);default:return this.client.logger.info(`Unsupported request method ${n}`)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:r}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{const{topic:t}=e,{message:r}=ur("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)},this.onSessionProposeRequest=async(e,t)=>{const{params:r,id:n}=t;try{this.isValidConnect(js({},t.params));const i=Vt(lt.FIVE_MINUTES),o=js({id:n,pairingTopic:e,expiry:i},r);await this.setProposal(n,o);const s=yt(JSON.stringify(t)),a=await this.getVerifyContext(s,o.proposer.metadata);this.client.events.emit("session_proposal",{id:n,params:o,verifyContext:a})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionProposeResponse=async(e,t)=>{const{id:r}=t;if(Pn(t)){const{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});const i=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});const o=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const s=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:s});const a=await this.client.core.crypto.generateSharedKey(o,s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});const c=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else On(t)&&(await this.client.proposal.delete(r,hr("USER_DISCONNECTED")),this.events.emit(Kt("session_connect"),{error:t.error}))},this.onSessionSettleRequest=async(e,t)=>{const{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);const{relay:r,controller:i,expiry:o,namespaces:s,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:l,pairingTopic:u}=t.params,h=js({topic:e,relay:r,expiry:o,namespaces:s,acknowledged:!0,pairingTopic:u,requiredNamespaces:a,optionalNamespaces:c,controller:i.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},l&&{sessionProperties:l});await this.sendResult(t.id,e,!0),this.events.emit(Kt("session_connect"),{session:h}),this.cleanupDuplicatePairings(h)}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{const{id:r}=t;Pn(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(Kt("session_approve",r),{})):On(t)&&(await this.client.session.delete(e,hr("USER_DISCONNECTED")),this.events.emit(Kt("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{const{params:r,id:n}=t;try{this.isValidUpdate(js({topic:e},r)),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult(n,e,!0),this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionUpdateResponse=(e,t)=>{const{id:r}=t;Pn(t)?this.events.emit(Kt("session_update",r),{}):On(t)&&this.events.emit(Kt("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{const{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Vt(Cs)),await this.sendResult(r,e,!0),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{const{id:r}=t;Pn(t)?this.events.emit(Kt("session_extend",r),{}):On(t)&&this.events.emit(Kt("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{const{id:r}=t;setTimeout((()=>{Pn(t)?this.events.emit(Kt("session_ping",r),{}):On(t)&&this.events.emit(Kt("session_ping",r),{error:t.error})}),500)},this.onSessionDeleteRequest=async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise((t=>{this.client.core.relayer.once(wo,(async()=>{t(await this.deleteSession(e))}))})),this.sendResult(r,e,!0)]),this.client.events.emit("session_delete",{id:r,topic:e})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async(e,t)=>{const{id:r,params:n}=t;try{this.isValidRequest(js({topic:e},n)),await this.setPendingSessionRequest({id:r,topic:e,params:n});const i=yt(JSON.stringify(t)),o=this.client.session.get(e),s=await this.getVerifyContext(i,o.peer.metadata);this.client.events.emit("session_request",{id:r,topic:e,params:n,verifyContext:s})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionRequestResponse=(e,t)=>{const{id:r}=t;Pn(t)?this.events.emit(Kt("session_request",r),{result:t.result}):On(t)&&this.events.emit(Kt("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{const{id:r,params:n}=t;try{this.isValidEmit(js({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.isValidConnect=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:i,relays:o}=e;if(fr(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return e?e&&dr(e)&&e.length&&e.forEach((e=>{r=xr(e)})):r=!0,r}(o)){const{message:e}=ur("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(e)}!fr(r)&&0!==pr(r)&&this.validateNamespaces(r,"requiredNamespaces"),!fr(n)&&0!==pr(n)&&this.validateNamespaces(n,"optionalNamespaces"),fr(i)||this.validateSessionProps(i,"sessionProperties")},this.validateNamespaces=(e,t)=>{const r=function(e,t,r){let n=null;if(e&&pr(e)){const r=vr(e,t);r&&(n=r);const i=function(e,t){let r=null;return Object.entries(e).forEach((([e,n])=>{if(r)return;const i=function(e,t,r){let n=null;return dr(t)?t.forEach((t=>{n||(!wr(t)||!t.includes(e))&&(n=hr("UNSUPPORTED_CHAINS",`${r}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):n=hr("UNSUPPORTED_CHAINS",`${r}, chains ${t} should be an array of strings conforming to "namespace:chainId" format`),n}(e,ft(e,n),`${t} requiredNamespace`);i&&(r=i)})),r}(e,t);i&&(n=i)}else n=ur("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw new Error(r.message)},this.isValidApprove=async e=>{if(!Ar(e))throw new Error(ur("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:r,relayProtocol:n,sessionProperties:i}=e;await this.isValidProposalId(t);const o=this.client.proposal.get(t),s=yr(r,"approve()");if(s)throw new Error(s.message);const a=Er(o.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!mr(n,!0)){const{message:e}=ur("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw new Error(e)}fr(i)||this.validateSessionProps(i,"sessionProperties")},this.isValidReject=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:r}=e;if(await this.isValidProposalId(t),!function(e){return!!(e&&"object"==typeof e&&e.code&&gr(e.code,!1)&&e.message&&mr(e.message,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidSessionSettleRequest=e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:r,namespaces:n,expiry:i}=e;if(!xr(t)){const{message:e}=ur("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const o=function(e,t){let r=null;return mr(e?.publicKey,!1)||(r=ur("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),r}(r);if(o)throw new Error(o.message);const s=yr(n,"onSessionSettleRequest()");if(s)throw new Error(s.message);if(Gt(i)){const{message:e}=ur("EXPIRED","onSessionSettleRequest()");throw new Error(e)}},this.isValidUpdate=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:r}=e;await this.isValidSessionTopic(t);const n=this.client.session.get(t),i=yr(r,"update()");if(i)throw new Error(i.message);const o=Er(n.requiredNamespaces,r,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:r,chainId:n,expiry:i}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!Cr(o,n)){const{message:e}=ur("MISSING_OR_INVALID",`request() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(fr(e)||!mr(e.method,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(e)}if(!function(e,t,r){return!!mr(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{or(e.accounts).includes(t)&&r.push(...e.methods)})),r}(e,t).includes(r)}(o,n,r.method)){const{message:e}=ur("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(e)}if(i&&!function(e,t){return gr(e,!1)&&e<=t.max&&e>=t.min}(i,Is)){const{message:e}=ur("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${Is.min} and ${Is.max}`);throw new Error(e)}},this.isValidRespond=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:t,response:r}=e;if(await this.isValidSessionTopic(t),!function(e){return!(fr(e)||fr(e.result)&&fr(e.error)||!gr(e.id,!1)||!mr(e.jsonrpc,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidPing=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!Cr(i,n)){const{message:e}=ur("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(fr(e)||!mr(e.name,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}if(!function(e,t,r){return!!mr(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{or(e.accounts).includes(t)&&r.push(...e.events)})),r}(e,t).includes(r)}(i,n,r.name)){const{message:e}=ur("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidDisconnect=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.getVerifyContext=async(e,t)=>{const r={verified:{verifyUrl:t.verifyUrl||"",validation:"UNKNOWN",origin:t.url||""}};try{const n=await this.client.core.verify.resolve({attestationId:e,verifyUrl:t.verifyUrl});n&&(r.verified.origin=n,r.verified.validation=n===t.url?"VALID":"INVALID")}catch(e){this.client.logger.error(e)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((e=>{if(!mr(e,!1)){const{message:r}=ur("MISSING_OR_INVALID",`${t} must be in Record format. Received: ${JSON.stringify(e)}`);throw new Error(r)}}))}}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(uo,(async e=>{const{topic:t,message:r}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(r)))return;const n=await this.client.core.crypto.decode(t,r);In(n)?(this.client.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):_n(n)?(await this.client.core.history.resolve(n),this.onRelayEventResponse({topic:t,payload:n})):this.onRelayEventUnknownPayload({topic:t,payload:n})}))}registerExpirerEvents(){this.client.core.expirer.on(ko,(async e=>{const{topic:t,id:r}=qt(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,ur("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession(t,!0),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))}))}isValidPairingTopic(e){if(!mr(e,!1)){const{message:t}=ur("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ur("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!mr(e,!1)){const{message:t}=ur("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:t}=ur("EXPIRED",`session topic: ${e}`);throw new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(mr(e,!1)){const{message:t}=ur("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=ur("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if("number"!=typeof e){const{message:t}=ur("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:t}=ur("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class Bs extends ss{constructor(e,t){super(e,t,"proposal",ys),this.core=e,this.logger=t}}class $s extends ss{constructor(e,t){super(e,t,"session",ys),this.core=e,this.logger=t}}class Us extends ss{constructor(e,t){super(e,t,"request",ys,(e=>e.id)),this.core=e,this.logger=t}}class Ds extends Ur{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=xs,this.events=new w.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||xs,this.metadata=e?.metadata||(0,ht.D)()||{name:"",description:"",url:"",icons:[""]};const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e?.logger||"error"}));this.core=e?.core||new bs(e),this.logger=(0,Or.generateChildLogger)(t,this.name),this.session=new $s(this.core,this.logger),this.proposal=new Bs(this.core,this.logger),this.pendingRequest=new Us(this.core,this.logger),this.engine=new Ls(this)}static async init(e){const t=new Ds(e);return await t.initialize(),t}get context(){return(0,Or.getLoggerContext)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var zs=r(4098),Ws=r.n(zs);const Fs={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class Hs{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new w.EventEmitter,this.isAvailable=!1,this.registering=!1,!xn(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const t=Fr(e),r=await Ws()(this.url,Object.assign(Object.assign({},Fs),{body:t})),n=await r.json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!xn(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),void 0===this.isAvailable)return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=Fr({id:1,jsonrpc:"2.0",method:"test",params:[]});await Ws()(e,Object.assign(Object.assign({},Fs),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?Wr(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=mn(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return ln(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}const qs=Hs,Vs="error",Gs="wc@2:universal_provider:",Ks="default_chain_changed";var Zs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},Qs={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=32,a=128,c=1/0,l=9007199254740991,u=NaN,h=4294967295,d=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],p="[object Arguments]",f="[object Array]",m="[object Boolean]",g="[object Date]",w="[object Error]",b="[object Function]",v="[object GeneratorFunction]",y="[object Map]",x="[object Number]",A="[object Object]",C="[object Promise]",E="[object RegExp]",I="[object Set]",_="[object String]",P="[object Symbol]",O="[object WeakMap]",S="[object ArrayBuffer]",k="[object DataView]",M="[object Float32Array]",T="[object Float64Array]",N="[object Int8Array]",j="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",B="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",D=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,q=RegExp(F.source),V=RegExp(H.source),G=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(X.source),te=/^\s+/,re=/\s/,ne=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ae=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,de=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,fe=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,be=/['\n\r\u2028\u2029\\]/g,ve="\\ud800-\\udfff",ye="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_e="["+ve+"]",Pe="["+Ie+"]",Oe="["+ye+"]",Se="\\d+",ke="["+xe+"]",Me="["+Ae+"]",Te="[^"+ve+Ie+Se+xe+Ae+Ce+"]",Ne="\\ud83c[\\udffb-\\udfff]",je="[^"+ve+"]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+Ce+"]",$e="\\u200d",Ue="(?:"+Me+"|"+Te+")",De="(?:"+Be+"|"+Te+")",ze="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Fe="(?:"+Oe+"|"+Ne+")?",He="["+Ee+"]?",qe=He+Fe+"(?:"+$e+"(?:"+[je,Re,Le].join("|")+")"+He+Fe+")*",Ve="(?:"+[ke,Re,Le].join("|")+")"+qe,Ge="(?:"+[je+Oe+"?",Oe,Re,Le,_e].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(Oe,"g"),Qe=RegExp(Ne+"(?="+Ne+")|"+Ge+qe,"g"),Ye=RegExp([Be+"?"+Me+"+"+ze+"(?="+[Pe,Be,"$"].join("|")+")",De+"+"+We+"(?="+[Pe,Be+Ue,"$"].join("|")+")",Be+"?"+Ue+"+"+ze,Be+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Se,Ve].join("|"),"g"),Je=RegExp("["+$e+ve+ye+Ee+"]"),Xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,rt={};rt[M]=rt[T]=rt[N]=rt[j]=rt[R]=rt[L]=rt[B]=rt[$]=rt[U]=!0,rt[p]=rt[f]=rt[S]=rt[m]=rt[k]=rt[g]=rt[w]=rt[b]=rt[y]=rt[x]=rt[A]=rt[E]=rt[I]=rt[_]=rt[O]=!1;var nt={};nt[p]=nt[f]=nt[S]=nt[k]=nt[m]=nt[g]=nt[M]=nt[T]=nt[N]=nt[j]=nt[R]=nt[y]=nt[x]=nt[A]=nt[E]=nt[I]=nt[_]=nt[P]=nt[L]=nt[B]=nt[$]=nt[U]=!0,nt[w]=nt[b]=nt[O]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,st=parseInt,at="object"==typeof Zs&&Zs&&Zs.Object===Object&&Zs,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=at||ct||Function("return this")(),ut=t&&!t.nodeType&&t,ht=ut&&e&&!e.nodeType&&e,dt=ht&&ht.exports===ut,pt=dt&&at.process,ft=function(){try{return ht&&ht.require&&ht.require("util").types||pt&&pt.binding&&pt.binding("util")}catch{}}(),mt=ft&&ft.isArrayBuffer,gt=ft&&ft.isDate,wt=ft&&ft.isMap,bt=ft&&ft.isRegExp,vt=ft&&ft.isSet,yt=ft&&ft.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function At(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function Yt(e,t){for(var r=e.length;r--&&Bt(t,e[r],0)>-1;);return r}var Jt=Wt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Xt=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function er(e){return"\\"+it[e]}function tr(e){return Je.test(e)}function rr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function nr(e,t){return function(r){return e(t(r))}}function ir(e,t){for(var r=-1,n=e.length,i=0,s=[];++r",""":'"',"'":"'"}),ur=function e(t){var re=(t=null==t?lt:ur.defaults(lt.Object(),t,ur.pick(lt,et))).Array,ve=t.Date,ye=t.Error,xe=t.Function,Ae=t.Math,Ce=t.Object,Ee=t.RegExp,Ie=t.String,_e=t.TypeError,Pe=re.prototype,Oe=xe.prototype,Se=Ce.prototype,ke=t["__core-js_shared__"],Me=Oe.toString,Te=Se.hasOwnProperty,Ne=0,je=function(){var e=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Re=Se.toString,Le=Me.call(Ce),Be=lt._,$e=Ee("^"+Me.call(Te).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=dt?t.Buffer:r,De=t.Symbol,ze=t.Uint8Array,We=Ue?Ue.allocUnsafe:r,Fe=nr(Ce.getPrototypeOf,Ce),He=Ce.create,qe=Se.propertyIsEnumerable,Ve=Pe.splice,Ge=De?De.isConcatSpreadable:r,Qe=De?De.iterator:r,Je=De?De.toStringTag:r,it=function(){try{var e=so(Ce,"defineProperty");return e({},"",{}),e}catch{}}(),at=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,ct=ve&&ve.now!==lt.Date.now&&ve.now,ut=t.setTimeout!==lt.setTimeout&&t.setTimeout,ht=Ae.ceil,pt=Ae.floor,ft=Ce.getOwnPropertySymbols,jt=Ue?Ue.isBuffer:r,Wt=t.isFinite,hr=Pe.join,dr=nr(Ce.keys,Ce),pr=Ae.max,fr=Ae.min,mr=ve.now,gr=t.parseInt,wr=Ae.random,br=Pe.reverse,vr=so(t,"DataView"),yr=so(t,"Map"),xr=so(t,"Promise"),Ar=so(t,"Set"),Cr=so(t,"WeakMap"),Er=so(Ce,"create"),Ir=Cr&&new Cr,_r={},Pr=Ro(vr),Or=Ro(yr),Sr=Ro(xr),kr=Ro(Ar),Mr=Ro(Cr),Tr=De?De.prototype:r,Nr=Tr?Tr.valueOf:r,jr=Tr?Tr.toString:r;function Rr(e){if(Js(e)&&!zs(e)&&!(e instanceof Ur)){if(e instanceof $r)return e;if(Te.call(e,"__wrapped__"))return Lo(e)}return new $r(e)}var Lr=function(){function e(){}return function(t){if(!Ys(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function $r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Dr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function nn(e,t,n,i,o,s){var a,c=1&t,l=2&t,u=4&t;if(n&&(a=o?n(e,i,o,s):n(e)),a!==r)return a;if(!Ys(e))return e;var h=zs(e);if(h){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!c)return Ei(e,a)}else{var d=lo(e),f=d==b||d==v;if(qs(e))return bi(e,c);if(d==A||d==p||f&&!o){if(a=l||f?{}:ho(e),!c)return l?function(e,t){return Ii(e,co(e),t)}(e,function(e,t){return e&&Ii(t,Sa(t),e)}(a,e)):function(e,t){return Ii(e,ao(e),t)}(e,Xr(a,e))}else{if(!nt[d])return o?e:{};a=function(e,t,r){var n=e.constructor;switch(t){case S:return vi(e);case m:case g:return new n(+e);case k:return function(e,t){var r=t?vi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case M:case T:case N:case j:case R:case L:case B:case $:case U:return yi(e,r);case y:return new n;case x:case _:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new n;case P:return function(e){return Nr?Ce(Nr.call(e)):{}}(e)}}(e,d,c)}}s||(s=new Hr);var w=s.get(e);if(w)return w;s.set(e,a),na(e)?e.forEach((function(r){a.add(nn(r,t,n,r,e,s))})):Xs(e)&&e.forEach((function(r,i){a.set(i,nn(r,t,n,i,e,s))}));var C=h?r:(u?l?Xi:Ji:l?Sa:Oa)(e);return Ct(C||e,(function(r,i){C&&(r=e[i=r]),Qr(a,i,nn(r,t,n,i,e,s))})),a}function on(e,t,n){var i=n.length;if(null==e)return!i;for(e=Ce(e);i--;){var o=n[i],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function sn(e,t,i){if("function"!=typeof e)throw new _e(n);return _o((function(){e.apply(r,i)}),t)}function an(e,t,r,n){var i=-1,o=Pt,s=!0,a=e.length,c=[],l=t.length;if(!a)return c;r&&(t=St(t,Gt(r))),n?(o=Ot,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Fr(t));e:for(;++i-1},zr.prototype.set=function(e,t){var r=this.__data__,n=Yr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Dr,map:new(yr||zr),string:new Dr}},Wr.prototype.delete=function(e){var t=io(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return io(this,e).get(e)},Wr.prototype.has=function(e){return io(this,e).has(e)},Wr.prototype.set=function(e,t){var r=io(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Fr.prototype.add=Fr.prototype.push=function(e){return this.__data__.set(e,i),this},Fr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new zr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof zr){var n=r.__data__;if(!yr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var cn=Oi(gn),ln=Oi(wn,!0);function un(e,t){var r=!0;return cn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function hn(e,t,n){for(var i=-1,o=e.length;++i0&&r(a)?t>1?pn(a,t-1,r,n,i):kt(i,a):n||(i[i.length]=a)}return i}var fn=Si(),mn=Si(!0);function gn(e,t){return e&&fn(e,t,Oa)}function wn(e,t){return e&&mn(e,t,Oa)}function bn(e,t){return _t(t,(function(t){return Ks(e[t])}))}function vn(e,t){for(var n=0,i=(t=fi(t,e)).length;null!=e&&nt}function Cn(e,t){return null!=e&&Te.call(e,t)}function En(e,t){return null!=e&&t in Ce(e)}function In(e,t,n){for(var i=n?Ot:Pt,o=e[0].length,s=e.length,a=s,c=re(s),l=1/0,u=[];a--;){var h=e[a];a&&t&&(h=St(h,Gt(t))),l=fr(h.length,l),c[a]=!n&&(t||o>=120&&h.length>=120)?new Fr(a&&h):r}h=e[0];var d=-1,p=c[0];e:for(;++d=a?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Dn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)a!==e&&Ve.call(a,c,1),Ve.call(e,c,1);return e}function Wn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;fo(i)?Ve.call(e,i,1):si(e,i)}}return e}function Fn(e,t){return e+pt(wr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>l)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function qn(e,t){return Po(Ao(e,t,ec),e+"")}function Vn(e){return Vr(Ba(e))}function Gn(e,t){var r=Ba(e);return ko(r,rn(t,0,r.length))}function Kn(e,t,n,i){if(!Ys(e))return e;for(var o=-1,s=(t=fi(t,e)).length,a=s-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=re(i);++n>>1,s=e[o];null!==s&&!oa(s)&&(r?s<=t:s=200){var l=t?null:Hi(e);if(l)return or(l);s=!1,i=Zt,c=new Fr}else c=t?[]:a;e:for(;++n=i?e:Jn(e,t,n)}var wi=at||function(e){return lt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function vi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function yi(e,t){var r=t?vi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,s=oa(e),a=t!==r,c=null===t,l=t==t,u=oa(t);if(!c&&!u&&!s&&e>t||s&&a&&l&&!c&&!u||i&&a&&l||!n&&l||!o)return 1;if(!i&&!s&&!u&&e1?n[o-1]:r,a=o>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&mo(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=Ce(t);++i-1?o[s?t[a]:a]:r}}function ji(e){return Yi((function(t){var i=t.length,o=i,s=$r.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new _e(n);if(s&&!c&&"wrapper"==to(a))var c=new $r([],!0)}for(o=c?o:i;++o1&&v.reverse(),d&&uc))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&n?new Fr:r;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ne,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ct(d,(function(r){var n="_."+r[0];t&r[1]&&!Pt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(oe):[]}(n),r)))}function So(e){var t=0,n=0;return function(){var i=mr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function ko(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,rs(e,n)}));function ls(e){var t=Rr(e);return t.__chain__=!0,t}function us(e,t){return t(e)}var hs=Yi((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return tn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Ur&&fo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:us,args:[o],thisArg:r}),new $r(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)})),ds=_i((function(e,t,r){Te.call(e,r)?++e[r]:en(e,r,1)})),ps=Ni(Do),fs=Ni(zo);function ms(e,t){return(zs(e)?Ct:cn)(e,no(t,3))}function gs(e,t){return(zs(e)?Et:ln)(e,no(t,3))}var ws=_i((function(e,t,r){Te.call(e,r)?e[r].push(t):en(e,r,[t])})),bs=qn((function(e,t,r){var n=-1,i="function"==typeof t,o=Fs(e)?re(e.length):[];return cn(e,(function(e){o[++n]=i?xt(t,e,r):_n(e,t,r)})),o})),vs=_i((function(e,t,r){en(e,r,t)}));function ys(e,t){return(zs(e)?St:jn)(e,no(t,3))}var xs=_i((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),As=qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&mo(e,t[0],t[1])?t=[]:r>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Un(e,pn(t,1),[])})),Cs=ct||function(){return lt.Date.now()};function Es(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Vi(e,a,r,r,r,r,t)}function Is(e,t){var i;if("function"!=typeof t)throw new _e(n);return e=ha(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var _s=qn((function(e,t,r){var n=1;if(r.length){var i=ir(r,ro(_s));n|=s}return Vi(e,n,t,r,i)})),Ps=qn((function(e,t,r){var n=3;if(r.length){var i=ir(r,ro(Ps));n|=s}return Vi(t,n,e,r,i)}));function Os(e,t,i){var o,s,a,c,l,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new _e(n);function m(t){var n=o,i=s;return o=s=r,h=t,c=e.apply(i,n)}function g(e){var n=e-u;return u===r||n>=t||n<0||p&&e-h>=a}function w(){var e=Cs();if(g(e))return b(e);l=_o(w,function(e){var r=t-(e-u);return p?fr(r,a-(e-h)):r}(e))}function b(e){return l=r,f&&o?m(e):(o=s=r,c)}function v(){var e=Cs(),n=g(e);if(o=arguments,s=this,u=e,n){if(l===r)return function(e){return h=e,l=_o(w,t),d?m(e):c}(u);if(p)return wi(l),l=_o(w,t),m(u)}return l===r&&(l=_o(w,t)),c}return t=pa(t)||0,Ys(i)&&(d=!!i.leading,a=(p="maxWait"in i)?pr(pa(i.maxWait)||0,t):a,f="trailing"in i?!!i.trailing:f),v.cancel=function(){l!==r&&wi(l),h=0,o=u=s=l=r},v.flush=function(){return l===r?c:b(Cs())},v}var Ss=qn((function(e,t){return sn(e,1,t)})),ks=qn((function(e,t,r){return sn(e,pa(t)||0,r)}));function Ms(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Ms.Cache||Wr),r}function Ts(e){if("function"!=typeof e)throw new _e(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ms.Cache=Wr;var Ns=mi((function(e,t){var r=(t=1==t.length&&zs(t[0])?St(t[0],Gt(no())):St(pn(t,1),Gt(no()))).length;return qn((function(n){for(var i=-1,o=fr(n.length,r);++i=t})),Ds=Pn(function(){return arguments}())?Pn:function(e){return Js(e)&&Te.call(e,"callee")&&!qe.call(e,"callee")},zs=re.isArray,Ws=mt?Gt(mt):function(e){return Js(e)&&xn(e)==S};function Fs(e){return null!=e&&Qs(e.length)&&!Ks(e)}function Hs(e){return Js(e)&&Fs(e)}var qs=jt||pc,Vs=gt?Gt(gt):function(e){return Js(e)&&xn(e)==g};function Gs(e){if(!Js(e))return!1;var t=xn(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ta(e)}function Ks(e){if(!Ys(e))return!1;var t=xn(e);return t==b||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==ha(e)}function Qs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=l}function Ys(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Js(e){return null!=e&&"object"==typeof e}var Xs=wt?Gt(wt):function(e){return Js(e)&&lo(e)==y};function ea(e){return"number"==typeof e||Js(e)&&xn(e)==x}function ta(e){if(!Js(e)||xn(e)!=A)return!1;var t=Fe(e);if(null===t)return!0;var r=Te.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Le}var ra=bt?Gt(bt):function(e){return Js(e)&&xn(e)==E},na=vt?Gt(vt):function(e){return Js(e)&&lo(e)==I};function ia(e){return"string"==typeof e||!zs(e)&&Js(e)&&xn(e)==_}function oa(e){return"symbol"==typeof e||Js(e)&&xn(e)==P}var sa=yt?Gt(yt):function(e){return Js(e)&&Qs(e.length)&&!!rt[xn(e)]},aa=zi(Nn),ca=zi((function(e,t){return e<=t}));function la(e){if(!e)return[];if(Fs(e))return ia(e)?ar(e):Ei(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=lo(e);return(t==y?rr:t==I?or:Ba)(e)}function ua(e){return e?(e=pa(e))===c||e===-c?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ha(e){var t=ua(e),r=t%1;return t==t?r?t-r:t:0}function da(e){return e?rn(ha(e),0,h):0}function pa(e){if("number"==typeof e)return e;if(oa(e))return u;if(Ys(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ys(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Vt(e);var r=de.test(e);return r||fe.test(e)?st(e.slice(2),r?2:8):he.test(e)?u:+e}function fa(e){return Ii(e,Sa(e))}function ma(e){return null==e?"":ii(e)}var ga=Pi((function(e,t){if(vo(t)||Fs(t))Ii(t,Oa(t),e);else for(var r in t)Te.call(t,r)&&Qr(e,r,t[r])})),wa=Pi((function(e,t){Ii(t,Sa(t),e)})),ba=Pi((function(e,t,r,n){Ii(t,Sa(t),e,n)})),va=Pi((function(e,t,r,n){Ii(t,Oa(t),e,n)})),ya=Yi(tn),xa=qn((function(e,t){e=Ce(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&mo(t[0],t[1],o)&&(i=1);++n1),t})),Ii(e,Xi(e),r),n&&(r=nn(r,7,Zi));for(var i=t.length;i--;)si(r,t[i]);return r})),Na=Yi((function(e,t){return null==e?{}:function(e,t){return Dn(e,t,(function(t,r){return Ea(e,r)}))}(e,t)}));function ja(e,t){if(null==e)return{};var r=St(Xi(e),(function(e){return[e]}));return t=no(t),Dn(e,r,(function(e,r){return t(e,r[0])}))}var Ra=qi(Oa),La=qi(Sa);function Ba(e){return null==e?[]:Kt(e,Oa(e))}var $a=Mi((function(e,t,r){return t=t.toLowerCase(),e+(r?Ua(t):t)}));function Ua(e){return Ga(ma(e).toLowerCase())}function Da(e){return(e=ma(e))&&e.replace(ge,Jt).replace(Ze,"")}var za=Mi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=Mi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Fa=ki("toLowerCase"),Ha=Mi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),qa=Mi((function(e,t,r){return e+(r?" ":"")+Ga(t)})),Va=Mi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ga=ki("toUpperCase");function Ka(e,t,n){return e=ma(e),(t=n?r:t)===r?function(e){return Xe.test(e)}(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Za=qn((function(e,t){try{return xt(e,r,t)}catch(e){return Gs(e)?e:new ye(e)}})),Qa=Yi((function(e,t){return Ct(t,(function(t){t=jo(t),en(e,t,_s(e[t],e))})),e}));function Ya(e){return function(){return e}}var Ja=ji(),Xa=ji(!0);function ec(e){return e}function tc(e){return Mn("function"==typeof e?e:nn(e,1))}var rc=qn((function(e,t){return function(r){return _n(r,e,t)}})),nc=qn((function(e,t){return function(r){return _n(e,r,t)}}));function ic(e,t,r){var n=Oa(t),i=bn(t,n);null==r&&(!Ys(t)||!i.length&&n.length)&&(r=t,t=e,e=this,i=bn(t,Oa(t)));var o=!(Ys(r)&&"chain"in r&&!r.chain),s=Ks(e);return Ct(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ei(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,kt([this.value()],arguments))})})),e}function oc(){}var sc=$i(St),ac=$i(It),cc=$i(Nt);function lc(e){return go(e)?zt(jo(e)):function(e){return function(t){return vn(t,e)}}(e)}var uc=Di(),hc=Di(!0);function dc(){return[]}function pc(){return!1}var fc=Bi((function(e,t){return e+t}),0),mc=Fi("ceil"),gc=Bi((function(e,t){return e/t}),1),wc=Fi("floor"),bc=Bi((function(e,t){return e*t}),1),vc=Fi("round"),yc=Bi((function(e,t){return e-t}),0);return Rr.after=function(e,t){if("function"!=typeof t)throw new _e(n);return e=ha(e),function(){if(--e<1)return t.apply(this,arguments)}},Rr.ary=Es,Rr.assign=ga,Rr.assignIn=wa,Rr.assignInWith=ba,Rr.assignWith=va,Rr.at=ya,Rr.before=Is,Rr.bind=_s,Rr.bindAll=Qa,Rr.bindKey=Ps,Rr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zs(e)?e:[e]},Rr.chain=ls,Rr.chunk=function(e,t,n){t=(n?mo(e,t,n):t===r)?1:pr(ha(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=re(ht(i/t));oo?0:o+n),(i=i===r||i>o?o:ha(i))<0&&(i+=o),i=n>i?0:da(i);n>>0)?(e=ma(e))&&("string"==typeof t||null!=t&&!ra(t))&&!(t=ii(t))&&tr(e)?gi(ar(e),0,n):e.split(t,n):[]},Rr.spread=function(e,t){if("function"!=typeof e)throw new _e(n);return t=null==t?0:pr(ha(t),0),qn((function(r){var n=r[t],i=gi(r,0,t);return n&&kt(i,n),xt(e,this,i)}))},Rr.tail=function(e){var t=null==e?0:e.length;return t?Jn(e,1,t):[]},Rr.take=function(e,t,n){return e&&e.length?Jn(e,0,(t=n||t===r?1:ha(t))<0?0:t):[]},Rr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?Jn(e,(t=i-(t=n||t===r?1:ha(t)))<0?0:t,i):[]},Rr.takeRightWhile=function(e,t){return e&&e.length?ci(e,no(t,3),!1,!0):[]},Rr.takeWhile=function(e,t){return e&&e.length?ci(e,no(t,3)):[]},Rr.tap=function(e,t){return t(e),e},Rr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new _e(n);return Ys(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Os(e,t,{leading:i,maxWait:t,trailing:o})},Rr.thru=us,Rr.toArray=la,Rr.toPairs=Ra,Rr.toPairsIn=La,Rr.toPath=function(e){return zs(e)?St(e,jo):oa(e)?[e]:Ei(No(ma(e)))},Rr.toPlainObject=fa,Rr.transform=function(e,t,r){var n=zs(e),i=n||qs(e)||sa(e);if(t=no(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ys(e)&&Ks(o)?Lr(Fe(e)):{}}return(i?Ct:gn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Rr.unary=function(e){return Es(e,1)},Rr.union=Jo,Rr.unionBy=Xo,Rr.unionWith=es,Rr.uniq=function(e){return e&&e.length?oi(e):[]},Rr.uniqBy=function(e,t){return e&&e.length?oi(e,no(t,2)):[]},Rr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?oi(e,r,t):[]},Rr.unset=function(e,t){return null==e||si(e,t)},Rr.unzip=ts,Rr.unzipWith=rs,Rr.update=function(e,t,r){return null==e?e:ai(e,t,pi(r))},Rr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ai(e,t,pi(n),i)},Rr.values=Ba,Rr.valuesIn=function(e){return null==e?[]:Kt(e,Sa(e))},Rr.without=ns,Rr.words=Ka,Rr.wrap=function(e,t){return js(pi(t),e)},Rr.xor=is,Rr.xorBy=os,Rr.xorWith=ss,Rr.zip=as,Rr.zipObject=function(e,t){return hi(e||[],t||[],Qr)},Rr.zipObjectDeep=function(e,t){return hi(e||[],t||[],Kn)},Rr.zipWith=cs,Rr.entries=Ra,Rr.entriesIn=La,Rr.extend=wa,Rr.extendWith=ba,ic(Rr,Rr),Rr.add=fc,Rr.attempt=Za,Rr.camelCase=$a,Rr.capitalize=Ua,Rr.ceil=mc,Rr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=pa(n))==n?n:0),t!==r&&(t=(t=pa(t))==t?t:0),rn(pa(e),t,n)},Rr.clone=function(e){return nn(e,4)},Rr.cloneDeep=function(e){return nn(e,5)},Rr.cloneDeepWith=function(e,t){return nn(e,5,t="function"==typeof t?t:r)},Rr.cloneWith=function(e,t){return nn(e,4,t="function"==typeof t?t:r)},Rr.conformsTo=function(e,t){return null==t||on(e,t,Oa(t))},Rr.deburr=Da,Rr.defaultTo=function(e,t){return null==e||e!=e?t:e},Rr.divide=gc,Rr.endsWith=function(e,t,n){e=ma(e),t=ii(t);var i=e.length,o=n=n===r?i:rn(ha(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Rr.eq=Bs,Rr.escape=function(e){return(e=ma(e))&&V.test(e)?e.replace(H,Xt):e},Rr.escapeRegExp=function(e){return(e=ma(e))&&ee.test(e)?e.replace(X,"\\$&"):e},Rr.every=function(e,t,n){var i=zs(e)?It:un;return n&&mo(e,t,n)&&(t=r),i(e,no(t,3))},Rr.find=ps,Rr.findIndex=Do,Rr.findKey=function(e,t){return Rt(e,no(t,3),gn)},Rr.findLast=fs,Rr.findLastIndex=zo,Rr.findLastKey=function(e,t){return Rt(e,no(t,3),wn)},Rr.floor=wc,Rr.forEach=ms,Rr.forEachRight=gs,Rr.forIn=function(e,t){return null==e?e:fn(e,no(t,3),Sa)},Rr.forInRight=function(e,t){return null==e?e:mn(e,no(t,3),Sa)},Rr.forOwn=function(e,t){return e&&gn(e,no(t,3))},Rr.forOwnRight=function(e,t){return e&&wn(e,no(t,3))},Rr.get=Ca,Rr.gt=$s,Rr.gte=Us,Rr.has=function(e,t){return null!=e&&uo(e,t,Cn)},Rr.hasIn=Ea,Rr.head=Fo,Rr.identity=ec,Rr.includes=function(e,t,r,n){e=Fs(e)?e:Ba(e),r=r&&!n?ha(r):0;var i=e.length;return r<0&&(r=pr(i+r,0)),ia(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Bt(e,t,r)>-1},Rr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ha(r);return i<0&&(i=pr(n+i,0)),Bt(e,t,i)},Rr.inRange=function(e,t,n){return t=ua(t),n===r?(n=t,t=0):n=ua(n),function(e,t,r){return e>=fr(t,r)&&e=-l&&e<=l},Rr.isSet=na,Rr.isString=ia,Rr.isSymbol=oa,Rr.isTypedArray=sa,Rr.isUndefined=function(e){return e===r},Rr.isWeakMap=function(e){return Js(e)&&lo(e)==O},Rr.isWeakSet=function(e){return Js(e)&&"[object WeakSet]"==xn(e)},Rr.join=function(e,t){return null==e?"":hr.call(e,t)},Rr.kebabCase=za,Rr.last=Go,Rr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ha(n))<0?pr(i+o,0):fr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Lt(e,Ut,o,!0)},Rr.lowerCase=Wa,Rr.lowerFirst=Fa,Rr.lt=aa,Rr.lte=ca,Rr.max=function(e){return e&&e.length?hn(e,ec,An):r},Rr.maxBy=function(e,t){return e&&e.length?hn(e,no(t,2),An):r},Rr.mean=function(e){return Dt(e,ec)},Rr.meanBy=function(e,t){return Dt(e,no(t,2))},Rr.min=function(e){return e&&e.length?hn(e,ec,Nn):r},Rr.minBy=function(e,t){return e&&e.length?hn(e,no(t,2),Nn):r},Rr.stubArray=dc,Rr.stubFalse=pc,Rr.stubObject=function(){return{}},Rr.stubString=function(){return""},Rr.stubTrue=function(){return!0},Rr.multiply=bc,Rr.nth=function(e,t){return e&&e.length?$n(e,ha(t)):r},Rr.noConflict=function(){return lt._===this&&(lt._=Be),this},Rr.noop=oc,Rr.now=Cs,Rr.pad=function(e,t,r){e=ma(e);var n=(t=ha(t))?sr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ui(pt(i),r)+e+Ui(ht(i),r)},Rr.padEnd=function(e,t,r){e=ma(e);var n=(t=ha(t))?sr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=wr();return fr(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Fn(e,t)},Rr.reduce=function(e,t,r){var n=zs(e)?Mt:Ft,i=arguments.length<3;return n(e,no(t,4),r,i,cn)},Rr.reduceRight=function(e,t,r){var n=zs(e)?Tt:Ft,i=arguments.length<3;return n(e,no(t,4),r,i,ln)},Rr.repeat=function(e,t,n){return t=(n?mo(e,t,n):t===r)?1:ha(t),Hn(ma(e),t)},Rr.replace=function(){var e=arguments,t=ma(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rr.result=function(e,t,n){var i=-1,o=(t=fi(t,e)).length;for(o||(o=1,e=r);++il)return[];var r=h,n=fr(e,h);t=no(t),e-=h;for(var i=qt(n,t);++r=s)return e;var c=n-sr(i);if(c<1)return i;var l=a?gi(a,0,c).join(""):e.slice(0,c);if(o===r)return l+i;if(a&&(c+=l.length-c),ra(o)){if(e.slice(c).search(o)){var u,h=l;for(o.global||(o=Ee(o.source,ma(ue.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;l=l.slice(0,d===r?c:d)}}else if(e.indexOf(ii(o),c)!=c){var p=l.lastIndexOf(o);p>-1&&(l=l.slice(0,p))}return l+i},Rr.unescape=function(e){return(e=ma(e))&&q.test(e)?e.replace(F,lr):e},Rr.uniqueId=function(e){var t=++Ne;return ma(e)+t},Rr.upperCase=Va,Rr.upperFirst=Ga,Rr.each=ms,Rr.eachRight=gs,Rr.first=Fo,ic(Rr,function(){var e={};return gn(Rr,(function(t,r){Te.call(Rr.prototype,r)||(e[r]=t)})),e}(),{chain:!1}),Rr.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rr[e].placeholder=Rr})),Ct(["drop","take"],(function(e,t){Ur.prototype[e]=function(n){n=n===r?1:pr(ha(n),0);var i=this.__filtered__&&!t?new Ur(this):this.clone();return i.__filtered__?i.__takeCount__=fr(n,i.__takeCount__):i.__views__.push({size:fr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Ur.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:no(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ct(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Ur.prototype[e]=function(){return this[r](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Ur.prototype[e]=function(){return this.__filtered__?new Ur(this):this[r](1)}})),Ur.prototype.compact=function(){return this.filter(ec)},Ur.prototype.find=function(e){return this.filter(e).head()},Ur.prototype.findLast=function(e){return this.reverse().find(e)},Ur.prototype.invokeMap=qn((function(e,t){return"function"==typeof e?new Ur(this):this.map((function(r){return _n(r,e,t)}))})),Ur.prototype.reject=function(e){return this.filter(Ts(no(e)))},Ur.prototype.slice=function(e,t){e=ha(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ha(t))<0?n.dropRight(-t):n.take(t-e)),n)},Ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ur.prototype.toArray=function(){return this.take(h)},gn(Ur.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Rr[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(Rr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof Ur,l=a[0],u=c||zs(t),h=function(e){var t=o.apply(Rr,kt([e],a));return i&&d?t[0]:t};u&&n&&"function"==typeof l&&1!=l.length&&(c=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,m=c&&!p;if(!s&&u){t=m?t:new Ur(this);var g=e.apply(t,a);return g.__actions__.push({func:us,args:[h],thisArg:r}),new $r(g,d)}return f&&m?e.apply(this,a):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Rr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(zs(i)?i:[],e)}return this[r]((function(r){return t.apply(zs(r)?r:[],e)}))}})),gn(Ur.prototype,(function(e,t){var r=Rr[t];if(r){var n=r.name+"";Te.call(_r,n)||(_r[n]=[]),_r[n].push({name:t,func:r})}})),_r[Ri(r,2).name]=[{name:"wrapper",func:r}],Ur.prototype.clone=function(){var e=new Ur(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ur.prototype.reverse=function(){if(this.__filtered__){var e=new Ur(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ur.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=zs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Rr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Lo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Rr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var t=e;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:us,args:[Yo],thisArg:r}),new $r(t,this.__chain__)}return this.thru(Yo)},Rr.prototype.toJSON=Rr.prototype.valueOf=Rr.prototype.value=function(){return li(this.__wrapped__,this.__actions__)},Rr.prototype.first=Rr.prototype.head,Qe&&(Rr.prototype[Qe]=function(){return this}),Rr}();ht?((ht.exports=ur)._=ur,ut._=ur):lt._=ur}).call(Zs)}(Qs,Qs.exports);var Ys=Object.defineProperty,Js=Object.defineProperties,Xs=Object.getOwnPropertyDescriptors,ea=Object.getOwnPropertySymbols,ta=Object.prototype.hasOwnProperty,ra=Object.prototype.propertyIsEnumerable,na=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ia=(e,t)=>{for(var r in t||(t={}))ta.call(t,r)&&na(e,r,t[r]);if(ea)for(var r of ea(t))ra.call(t,r)&&na(e,r,t[r]);return e},oa=(e,t)=>Js(e,Xs(t));function sa(e,t,r){let n;const i=aa(e);return t.rpcMap&&(n=t.rpcMap[i]),n||(n=`https://rpc.walletconnect.com/v1?chainId=eip155:${i}&projectId=${r}`),n}function aa(e){return e.includes("eip155")?Number(e.split(":")[1]):Number(e)}function ca(e){var t,r,n,i;const o={};if(!pr(e))return o;for(const[s,a]of Object.entries(e)){const e=sr(s)?[s]:a.chains,c=a.methods||[],l=a.events||[],u=a.rpcMap||{},h=ar(s);o[h]=oa(ia(ia({},o[h]),a),{chains:Zt(e,null==(t=o[h])?void 0:t.chains),methods:Zt(c,null==(r=o[h])?void 0:r.methods),events:Zt(l,null==(n=o[h])?void 0:n.events),rpcMap:ia(ia({},u),null==(i=o[h])?void 0:i.rpcMap)})}return o}const la={},ua=e=>la[e],ha=(e,t)=>{la[e]=t};class da{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ks,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class pa{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){const r=aa(e);if(!this.httpProviders[r]){const e=t||sa(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!e)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,e)}this.chainId=r,this.events.emit(Ks,`${this.name}:${r}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new Hs(r,ua("disableProviderPing")))}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;const n=aa(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0";r=r.startsWith("0x")?r:`0x${r}`;const n=parseInt(r,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:e.chainId}),this.setDefaultChain(`${n}`)}return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class fa{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ks,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class ma{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ks,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class ga{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||this.getCardanoRPCUrl(e);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ks,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{const r=this.getCardanoRPCUrl(t);e[t]=this.createHttpProvider(t,r)})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||this.getCardanoRPCUrl(e);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class wa{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ks,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class ba{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ks,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}var va=Object.defineProperty,ya=Object.defineProperties,xa=Object.getOwnPropertyDescriptors,Aa=Object.getOwnPropertySymbols,Ca=Object.prototype.hasOwnProperty,Ea=Object.prototype.propertyIsEnumerable,Ia=(e,t,r)=>t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_a=(e,t)=>{for(var r in t||(t={}))Ca.call(t,r)&&Ia(e,r,t[r]);if(Aa)for(var r of Aa(t))Ea.call(t,r)&&Ia(e,r,t[r]);return e},Pa=(e,t)=>ya(e,xa(t));class Oa{constructor(e){this.events=new(b()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e?.logger||Vs})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Oa(e);return await t.initialize(),t}async request(e,t){const[r,n]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(r).request({request:_a({},e),chainId:`${r}:${n}`,topic:this.session.topic})}sendAsync(e,t,r){this.request(e,r).then((e=>t(null,e))).catch((e=>t(e,void 0)))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:hr("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await n().then((e=>{this.session=e})).catch((e=>{if(e.message!==As)throw e;t++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{const[r,n]=this.validateChain(e);this.getProvider(r).setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(dr(t)){for(const r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Ds.init({logger:this.providerOpts.logger||Vs,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map((e=>ar(e))))];ha("client",this.client),ha("events",this.events),ha("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=function(e,t){const r=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!r.length)return[];const n=[];return r.forEach((e=>{const r=t.namespaces[e].accounts;n.push(...r)})),n}(e,this.session),r=function(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}(t),n=function(e,t={}){const r=ca(e),n=ca(t);return Qs.exports.merge(r,n)}(this.namespaces,this.optionalNamespaces),i=Pa(_a({},n[e]),{accounts:t,chains:r});switch(e){case"eip155":this.rpcProviders[e]=new pa({namespace:i});break;case"solana":this.rpcProviders[e]=new fa({namespace:i});break;case"cosmos":this.rpcProviders[e]=new ma({namespace:i});break;case"polkadot":this.rpcProviders[e]=new da({namespace:i});break;case"cip34":this.rpcProviders[e]=new ga({namespace:i});break;case"elrond":this.rpcProviders[e]=new wa({namespace:i});break;case"multiversx":this.rpcProviders[e]=new ba({namespace:i})}}))}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(e=>{this.events.emit("session_ping",e)})),this.client.on("session_event",(e=>{const{params:t}=e,{event:r}=t;"accountsChanged"===r.name?this.events.emit("accountsChanged",r.data):"chainChanged"===r.name?this.onChainChanged(t.chainId):this.events.emit(r.name,r.data),this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var r;const{namespaces:n}=t,i=null==(r=this.client)?void 0:r.session.get(e);this.session=Pa(_a({},i),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Pa(_a({},hr("USER_DISCONNECTED")),{data:e.topic}))})),this.on(Ks,(e=>{this.onChainChanged(e,!0)}))}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach((e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t,optionalNamespaces:r,sessionProperties:n}=e;if(!t||!Object.keys(t).length)throw new Error("Namespaces must be not empty");this.namespaces=t,this.optionalNamespaces=r,this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",r)}validateChain(e){const[t,r]=e?.split(":")||["",""];if(t&&!Object.keys(this.namespaces).map((e=>ar(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];const n=ar(Object.keys(this.namespaces)[0]);return[n,this.rpcProviders[n].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var r;const[n,i]=this.validateChain(e);t||this.getProvider(n).setDefaultChain(i),(null!=(r=this.namespaces[n])?r:this.namespaces[`${n}:${i}`]).defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Gs}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Gs}/${e}`)}}const Sa=Oa,ka=["eth_sendTransaction","personal_sign"],Ma=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ta=["chainChanged","accountsChanged"],Na=["message","disconnect","connect"];var ja=Object.defineProperty,Ra=Object.defineProperties,La=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ua=Object.prototype.propertyIsEnumerable,Da=(e,t,r)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,za=(e,t)=>{for(var r in t||(t={}))$a.call(t,r)&&Da(e,r,t[r]);if(Ba)for(var r of Ba(t))Ua.call(t,r)&&Da(e,r,t[r]);return e},Wa=(e,t)=>Ra(e,La(t));function Fa(e){return Number(e[0].split(":")[1])}function Ha(e){return`0x${e.toString(16)}`}class qa{constructor(){this.events=new w.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new qa;return await t.initialize(e),t}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:r}=function(e){const{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:s,rpcMap:a}=e;if(!dr(t))throw new Error("Invalid chains");const c=t,l=n||ka,u=o||Ta,h={chains:c,methods:l,events:u,rpcMap:{[Fa(c)]:a[Fa(c)]}},d=o?.filter((e=>!Ta.includes(e))),p=n?.filter((e=>!ka.includes(e)));return r||s||i||null!=d&&d.length||null!=p&&p.length?{required:h,optional:{chains:[...new Set(d?.length&&p?.length||!r?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(u.concat(s||[]))],rpcMap:a}}:{required:h}}(this.rpc);try{const n=await new Promise((async(n,i)=>{var o;this.rpc.showQrModal&&(null==(o=this.modal)||o.subscribeModal((e=>{!e.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),i(new Error("Connection request reset. Please try again.")))}))),await this.signer.connect(Wa(za({namespaces:{[this.namespace]:t}},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:e?.pairingTopic})).then((e=>{n(e)})).catch((e=>{i(new Error(e.message))}))}));if(!n)return;this.setChainIds(this.rpc.chains);const i=function(e,t=[]){const r=[];return Object.keys(e).forEach((n=>{if(t.length&&!t.includes(n))return;const i=e[n];r.push(...i.accounts)})),r}(n.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:Ha(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(e=>{const{params:t}=e,{event:r}=t;"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)})),this.signer.on("chainChanged",(e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Ha(this.chainId)),this.persist()})),this.signer.on("session_update",(e=>{this.events.emit("session_update",e)})),this.signer.on("session_delete",(e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Wa(za({},hr("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(e=>{var t,r;this.rpc.showQrModal&&(null==(t=this.modal)||t.closeModal(),null==(r=this.modal)||r.openModal({uri:e})),this.events.emit("display_uri",e)}))}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter((e=>this.isCompatibleChainId(e))).map((e=>this.parseChainId(e)));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Ha(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,r,n]=e.split(":");return{chainId:`${t}:${r}`,address:n}}setAccounts(e){this.accounts=e.filter((e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId)).map((e=>this.parseAccountId(e).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,r;return{chains:(null==(t=e.chains)?void 0:t.map((e=>this.formatChainId(e))))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map((e=>this.formatChainId(e))):void 0,methods:e?.methods||ka,events:e?.events||Ta,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:!(null==e||!e.showQrModal),qrModalOptions:null!=(r=e?.qrModalOptions)?r:void 0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const r={};return e.forEach((e=>{r[e]=this.getRpcUrl(e,t)})),r}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Fa(this.rpc.chains),this.signer=await Sa.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const{WalletConnectModal:t}=await Promise.resolve().then(r.bind(r,9343));e=t}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(za({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(e){throw this.signer.logger.error(e),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:r,rpcMap:n}=e;t&&dr(t)&&(this.rpc.chains=t.map((e=>this.formatChainId(e))),t.forEach((e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)}))),r&&dr(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map((e=>this.formatChainId(e))),r.forEach((e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)})))}getRpcUrl(e,t){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((e=>this.parseAccount(e)))}}},8200:(e,t,r)=>{"use strict";r.d(t,{q:()=>n});class n{}},997:(e,t,r)=>{"use strict";r.r(t),r.d(t,{IEvents:()=>n.q});var n=r(8200)},2568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HEARTBEAT_EVENTS=t.HEARTBEAT_INTERVAL=void 0;const n=r(6736);t.HEARTBEAT_INTERVAL=n.FIVE_SECONDS,t.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}},3401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(2568),t)},8969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeartBeat=void 0;const n=r(655),i=r(7187),o=r(6736),s=r(1614),a=r(3401);class c extends s.IHeartBeat{constructor(e){super(e),this.events=new i.EventEmitter,this.interval=a.HEARTBEAT_INTERVAL,this.interval=(null==e?void 0:e.interval)||a.HEARTBEAT_INTERVAL}static init(e){return n.__awaiter(this,void 0,void 0,(function*(){const t=new c(e);return yield t.init(),t}))}init(){return n.__awaiter(this,void 0,void 0,(function*(){yield this.initialize()}))}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}initialize(){return n.__awaiter(this,void 0,void 0,(function*(){this.intervalRef=setInterval((()=>this.pulse()),o.toMiliseconds(this.interval))}))}pulse(){this.events.emit(a.HEARTBEAT_EVENTS.pulse)}}t.HeartBeat=c},772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(8969),t),n.__exportStar(r(1614),t),n.__exportStar(r(3401),t)},4174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IHeartBeat=void 0;const n=r(997);class i extends n.IEvents{constructor(e){super()}}t.IHeartBeat=i},1614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(4174),t)},5150:(e,t,r)=>{"use strict";const n=r(655),i=r(3954),o=n.__importDefault(r(653)),s=r(9728);t.ZP=class{constructor(){this.localStorage=o.default}getKeys(){return n.__awaiter(this,void 0,void 0,(function*(){return Object.keys(this.localStorage)}))}getEntries(){return n.__awaiter(this,void 0,void 0,(function*(){return Object.entries(this.localStorage).map(s.parseEntry)}))}getItem(e){return n.__awaiter(this,void 0,void 0,(function*(){const t=this.localStorage.getItem(e);if(null!==t)return i.safeJsonParse(t)}))}setItem(e,t){return n.__awaiter(this,void 0,void 0,(function*(){this.localStorage.setItem(e,i.safeJsonStringify(t))}))}removeItem(e){return n.__awaiter(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}}},653:(e,t,r)=>{"use strict";!function(){let t;function n(){}t=n,t.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},t.prototype.setItem=function(e,t){this[e]=String(t)},t.prototype.removeItem=function(e){delete this[e]},t.prototype.clear=function(){const e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},t.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),void 0!==r.g&&r.g.localStorage?e.exports=r.g.localStorage:"undefined"!=typeof window&&window.localStorage?e.exports=window.localStorage:e.exports=new n}()},9728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(9076),t),n.__exportStar(r(496),t)},9076:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IKeyValueStorage=void 0,t.IKeyValueStorage=class{}},496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEntry=void 0;const n=r(3954);t.parseEntry=function(e){var t;return[e[0],n.safeJsonParse(null!==(t=e[1])&&void 0!==t?t:"")]}},5727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PINO_CUSTOM_CONTEXT_KEY=t.PINO_LOGGER_DEFAULTS=void 0,t.PINO_LOGGER_DEFAULTS={level:"info"},t.PINO_CUSTOM_CONTEXT_KEY="custom_context"},9107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const n=r(655),i=n.__importDefault(r(6559));Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return i.default}}),n.__exportStar(r(5727),t),n.__exportStar(r(8048),t)},8048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateChildLogger=t.formatChildLoggerContext=t.getLoggerContext=t.setBrowserLoggerContext=t.getBrowserLoggerContext=t.getDefaultLoggerOptions=void 0;const n=r(5727);function i(e,t=n.PINO_CUSTOM_CONTEXT_KEY){return e[t]||""}function o(e,t,r=n.PINO_CUSTOM_CONTEXT_KEY){return e[r]=t,e}function s(e,t=n.PINO_CUSTOM_CONTEXT_KEY){let r="";return r=void 0===e.bindings?i(e,t):e.bindings().context||"",r}function a(e,t,r=n.PINO_CUSTOM_CONTEXT_KEY){const i=s(e,r);return i.trim()?`${i}/${t}`:t}t.getDefaultLoggerOptions=function(e){return Object.assign(Object.assign({},e),{level:(null==e?void 0:e.level)||n.PINO_LOGGER_DEFAULTS.level})},t.getBrowserLoggerContext=i,t.setBrowserLoggerContext=o,t.getLoggerContext=s,t.formatChildLoggerContext=a,t.generateChildLogger=function(e,t,r=n.PINO_CUSTOM_CONTEXT_KEY){const i=a(e,t,r);return o(e.child({context:i}),i,r)}},1882:()=>{},3014:()=>{},6900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(6869),t),n.__exportStar(r(8033),t)},6869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},8033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},6736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(4273),t),n.__exportStar(r(7001),t),n.__exportStar(r(2939),t),n.__exportStar(r(6900),t)},2939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(8766),t)},8766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0,t.IWatch=class{}},3207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;const n=r(6900);t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},3873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}},4273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(3873),t),n.__exportStar(r(3207),t)},7001:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},6151:(e,t,r)=>{"use strict";const n=r(610),i=r(4020),o=r(500),s=r(2806),a=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function u(e,t){return t.decode?i(e):e}function h(e){return Array.isArray(e)?e.sort():"object"==typeof e?h(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const i="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!i&&u(r,e).includes(e.arrayFormatSeparator);r=o?u(r,e):r;const s=i||o?r.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===r?r:u(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=r?u(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const i of e.split("&")){if(""===i)continue;let[e,s]=o(t.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:u(s,t),r(u(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=f(r[e],t);else n[e]=f(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=h(r):e[t]=r,e}),Object.create(null))}t.extract=p,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",i,"]"].join("")]:[...r,[l(t,e),"[",l(i,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),":list="].join("")]:[...r,[l(t,e),":list=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[l(r,e),t,l(i,e)].join("")]:[[n,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),i={};for(const t of Object.keys(e))r(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{const i=e[r];return void 0===i?"":null===i?l(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":i.reduce(n(r),[]).join("&"):l(r,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(p(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const n=d(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),s=Object.assign(o,e.query);let c=t.stringify(s,r);c&&(c=`?${c}`);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u=`#${r[a]?l(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${c}${u}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:i,query:o,fragmentIdentifier:c}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:s(o,r),fragmentIdentifier:c},n)},t.exclude=(e,r,n)=>{const i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},2873:(e,t)=>{"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){const t=r(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},5755:(e,t,r)=>{"use strict";t.D=void 0;const n=r(2873);t.D=function(){let e,t;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function r(...t){const r=e.getElementsByTagName("meta");for(let e=0;en.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=n.getAttribute("content");if(e)return e}}return""}const i=function(){let t=r("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:r("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const r=e.getElementsByTagName("link"),n=[];for(let e=0;e-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{const n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){const r=t.protocol+e;n.push(r)}else n.push(e)}}return n}(),name:i}}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),u=0,h=c>0?s-4:s;for(r=0;r>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;al?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),a(e<0?0:0|f(e))}function d(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:V(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return A(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function R(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function $(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=J((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=J((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return $(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return $(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw F(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},w.call(v.prototype),w.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];x.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,r){return new Promise((function(n,o){var s=new v(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}C.polyfill=!0,e.fetch||(e.fetch=C,e.Headers=d,e.Request=v,e.Response=x),t.Headers=d,t.Request=v,t.Response=x,t.fetch=C,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},4020:e=>{"use strict";var t="%[a-f0-9]{2}",r=new RegExp("("+t+")|([^%]+?)","gi"),n=new RegExp("("+t+")+","gi");function i(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],i(r),i(n))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(r)||[],n=1;n{"use strict";var t={single_source_shortest_paths:function(e,r,n){var i={},o={};o[r]=0;var s,a,c,l,u,h,d,p=t.PriorityQueue.make();for(p.push(r,0);!p.empty();)for(c in a=(s=p.pop()).value,l=s.cost,u=e[a]||{})u.hasOwnProperty(c)&&(h=l+u[c],d=o[c],(void 0===o[c]||d>h)&&(o[c]=h,p.push(c,h),i[c]=a));if(void 0!==n&&void 0===o[n]){var f=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(f)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},2378:e=>{"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n=55296&&i<=56319&&r>n+1){var o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(i=1024*(i-55296)+o-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,s,l;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,u=f(c,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},2806:e=>{"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,u=-7,h=r?i-1:0,d=r?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,l=8*o-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*c-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(s=s<0;e[r+p]=255&s,p+=f,s/=256,l-=8);e[r+p-f]|=128*m}},2307:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",d="[object Error]",p="[object Function]",f="[object GeneratorFunction]",m="[object Map]",g="[object Number]",w="[object Null]",b="[object Object]",v="[object Promise]",y="[object Proxy]",x="[object RegExp]",A="[object Set]",C="[object String]",E="[object Undefined]",I="[object WeakMap]",_="[object ArrayBuffer]",P="[object DataView]",O=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[c]=k[_]=k[u]=k[P]=k[h]=k[d]=k[p]=k[m]=k[g]=k[b]=k[x]=k[A]=k[C]=k[I]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,N=M||T||Function("return this")(),j=t&&!t.nodeType&&t,R=j&&e&&!e.nodeType&&e,L=R&&R.exports===j,B=L&&M.process,$=function(){try{return B&&B.binding&&B.binding("util")}catch(e){}}(),U=$&&$.isTypedArray;function D(e,t){for(var r=-1,n=null==e?0:e.length;++rl))return!1;var h=a.get(e);if(h&&a.get(t))return h==t;var d=-1,p=!0,f=r&o?new _e:void 0;for(a.set(e,t),a.set(t,e);++d-1},Ee.prototype.set=function(e,t){var r=this.__data__,n=Oe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Ie.prototype.clear=function(){this.size=0,this.__data__={hash:new Ce,map:new(he||Ee),string:new Ce}},Ie.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Ie.prototype.get=function(e){return je(this,e).get(e)},Ie.prototype.has=function(e){return je(this,e).has(e)},Ie.prototype.set=function(e,t){var r=je(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},_e.prototype.add=_e.prototype.push=function(e){return this.__data__.set(e,n),this},_e.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.clear=function(){this.__data__=new Ee,this.size=0},Pe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ee){var n=r.__data__;if(!he||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ie(n)}return r.set(e,t),this.size=r.size,this};var Le=ae?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,i=null==t?0:t.length,o=0,s=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=s}function Ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ge(e){return null!=e&&"object"==typeof e}var Ke=U?function(e){return function(t){return e(t)}}(U):function(e){return Ge(e)&&qe(e.length)&&!!k[Se(e)]};function Ze(e){return null!=(t=e)&&qe(t.length)&&!He(t)?function(e,t){var r=We(e),n=!r&&ze(e),i=!r&&!n&&Fe(e),o=!r&&!n&&!i&&Ke(e),s=r||n||i||o,a=s?function(e,t){for(var r=-1,n=Array(e);++r{"use strict";r.d(t,{j:()=>ce});const n={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},i=e=>1e3*e,o=e=>e/1e3,s=()=>{},a=e=>e;function c(e,t=!0){if(e&&"finished"!==e.playState)try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch(e){}}const l=e=>e(),u=(e,t,r=n.duration)=>new Proxy({animations:e.map(l).filter(Boolean),duration:r,options:t},h),h={get:(e,t)=>{const r=e.animations[0];switch(t){case"duration":return e.duration;case"currentTime":return o((null==r?void 0:r[t])||0);case"playbackRate":case"playState":return null==r?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(d)).catch(s)),e.finished;case"stop":return()=>{e.animations.forEach((e=>c(e)))};case"forEachNative":return t=>{e.animations.forEach((r=>t(r,e)))};default:return void 0===(null==r?void 0:r[t])?void 0:()=>e.animations.forEach((e=>e[t]()))}},set:(e,t,r)=>{switch(t){case"currentTime":r=i(r);case"currentTime":case"playbackRate":for(let n=0;ne.finished,p=e=>"object"==typeof e&&Boolean(e.createAnimation),f=e=>"number"==typeof e,m=e=>Array.isArray(e)&&!f(e[0]),g=(e,t,r)=>-r*e+r*t+e,w=(e,t,r)=>t-e==0?1:(r-e)/(t-e);function b(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=w(0,t,n);e.push(g(r,1,i))}}const v=(e,t,r)=>Math.min(Math.max(r,e),t);const y=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,x=1e-7,A=12;function C(e,t,r,n){if(e===t&&r===n)return a;return i=>0===i||1===i?i:y(function(e,t,r,n,i){let o,s,a=0;do{s=t+(r-t)/2,o=y(s,n,i)-e,o>0?r=s:t=s}while(Math.abs(o)>x&&++a"function"==typeof e,I=e=>Array.isArray(e)&&f(e[0]),_={ease:C(.25,.1,.25,1),"ease-in":C(.42,0,1,1),"ease-in-out":C(.42,0,.58,1),"ease-out":C(0,0,.58,1)},P=/\((.*?)\)/;function O(e){if(E(e))return e;if(I(e))return C(...e);if(_[e])return _[e];if(e.startsWith("steps")){const t=P.exec(e);if(t){const e=t[1].split(",");return((e,t="end")=>r=>{const n=(r="end"===t?Math.min(r,.999):Math.max(r,.001))*e,i="end"===t?Math.floor(n):Math.ceil(n);return v(0,1,i/e)})(parseFloat(e[0]),e[1].trim())}}return a}class S{constructor(e,t=[0,1],{easing:r,duration:i=n.duration,delay:o=n.delay,endDelay:s=n.endDelay,repeat:c=n.repeat,offset:l,direction:u="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=a,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),r=r||n.easing,p(r)){const e=r.createAnimation(t);r=e.easing,t=e.keyframes||t,i=e.duration||i}this.repeat=c,this.easing=m(r)?a:O(r),this.updateDuration(i);const h=function(e,t=function(e){const t=[0];return b(t,e-1),t}(e.length),r=a){const n=e.length,i=n-t.length;return i>0&&b(t,i),i=>{let o=0;for(;o{const n=t-e;return((r-e)%n+n)%n+e})(0,e.length,t)]:e}(r,o);return s=a(s),g(e[o],e[o+1],s)}}(t,l,m(r)?r.map(O):a);this.tick=t=>{var r;let n=0;n=void 0!==this.pauseTime?this.pauseTime:(t-this.startTime)*this.rate,this.t=n,n/=1e3,n=Math.max(n-o,0),"finished"===this.playState&&void 0===this.pauseTime&&(n=this.totalDuration);const i=n/this.duration;let a=Math.floor(i),c=i%1;!c&&i>=1&&(c=1),1===c&&a--;const l=a%2;("reverse"===u||"alternate"===u&&l||"alternate-reverse"===u&&!l)&&(c=1-c);const d=n>=this.totalDuration?1:Math.min(c,1),p=h(this.easing(d));e(p),void 0===this.pauseTime&&("finished"===this.playState||n>=this.totalDuration+s)?(this.playState="finished",null===(r=this.resolve)||void 0===r||r.call(this,p)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(e=this.reject)||void 0===e||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){void 0!==this.pauseTime||0===this.rate?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}class k{setAnimation(e){this.animation=e,null==e||e.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const M=new WeakMap;function T(e){return M.has(e)||M.set(e,{transforms:[],values:new Map}),M.get(e)}const N=["","X","Y","Z"],j={x:"translateX",y:"translateY",z:"translateZ"},R={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},L={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:R,scale:{syntax:"",initialValue:1,toDefaultUnit:a},skew:R},B=new Map,$=e=>`--motion-${e}`,U=["x","y","z"];["translate","scale","rotate","skew"].forEach((e=>{N.forEach((t=>{U.push(e+t),B.set($(e+t),L[e])}))}));const D=(e,t)=>U.indexOf(e)-U.indexOf(t),z=new Set(U),W=e=>z.has(e),F=e=>e.sort(D).reduce(H,"").trim(),H=(e,t)=>`${e} ${t}(var(${$(t)}))`,q=e=>e.startsWith("--"),V=new Set,G=(e,t)=>document.createElement("div").animate(e,t),K={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{G({opacity:[1]})}catch(e){return!1}return!0},finished:()=>Boolean(G({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{G({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}},Z={},Q={};for(const e in K)Q[e]=()=>(void 0===Z[e]&&(Z[e]=K[e]()),Z[e]);const Y=(e,t)=>E(e)?Q.linearEasing()?`linear(${((e,t)=>{let r="";const n=Math.round(t/.015);for(let t=0;t`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function X(e){return j[e]&&(e=j[e]),W(e)?$(e):e}const ee=(e,t)=>{t=X(t);let r=q(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&0!==r){const e=B.get(t);e&&(r=e.initialValue)}return r},te=(e,t,r)=>{t=X(t),q(t)?e.style.setProperty(t,r):e.style[t]=r};function re(e,t,r,o={},l){const u=window.__MOTION_DEV_TOOLS_RECORD,h=!1!==o.record&&u;let d,{duration:g=n.duration,delay:w=n.delay,endDelay:b=n.endDelay,repeat:v=n.repeat,easing:y=n.easing,persist:x=!1,direction:A,offset:C,allowWebkitAcceleration:I=!1}=o;const _=T(e),P=W(t);let O=Q.waapi();P&&((e,t)=>{j[t]&&(t=j[t]);const{transforms:r}=T(e);var n,i;i=t,-1===(n=r).indexOf(i)&&n.push(i),e.style.transform=F(r)})(e,t);const S=X(t),M=function(e,t){return e.has(t)||e.set(t,new k),e.get(t)}(_.values,S),N=B.get(S);return c(M.animation,!(p(y)&&M.generator)&&!1!==o.record),()=>{const n=()=>{var t,r;return null!==(r=null!==(t=ee(e,S))&&void 0!==t?t:null==N?void 0:N.initialValue)&&void 0!==r?r:0};let c=function(e,t){for(let r=0;rArray.isArray(e)?e:[e])(r),n);const _=function(e,t){var r;let n=(null==t?void 0:t.toDefaultUnit)||a;const i=e[e.length-1];if("string"==typeof i){const e=(null===(r=i.match(/(-?[\d.]+)([a-z%]*)/))||void 0===r?void 0:r[2])||"";e&&(n=t=>t+e)}return n}(c,N);if(p(y)){const e=y.createAnimation(c,"opacity"!==t,n,S,M);y=e.easing,c=e.keyframes||c,g=e.duration||g}if(q(S)&&(Q.cssRegisterProperty()?function(e){if(!V.has(e)){V.add(e);try{const{syntax:t,initialValue:r}=B.has(e)?B.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch(e){}}}(S):O=!1),P&&!Q.linearEasing()&&(E(y)||m(y)&&y.some(E))&&(O=!1),O){N&&(c=c.map((e=>f(e)?N.toDefaultUnit(e):e))),1!==c.length||Q.partialKeyframes()&&!h||c.unshift(n());const t={delay:i(w),duration:i(g),endDelay:i(b),easing:m(y)?void 0:Y(y,g),direction:A,iterations:v+1,fill:"both"};d=e.animate({[S]:c,offset:C,easing:m(y)?y.map((e=>Y(e,g))):void 0},t),d.finished||(d.finished=new Promise(((e,t)=>{d.onfinish=e,d.oncancel=t})));const r=c[c.length-1];d.finished.then((()=>{x||(te(e,S,r),d.cancel())})).catch(s),I||(d.playbackRate=1.000001)}else if(l&&P)c=c.map((e=>"string"==typeof e?parseFloat(e):e)),1===c.length&&c.unshift(parseFloat(n())),d=new l((t=>{te(e,S,_?_(t):t)}),c,Object.assign(Object.assign({},o),{duration:g,easing:y}));else{const t=c[c.length-1];te(e,S,N&&f(t)?N.toDefaultUnit(t):t)}return h&&u(e,t,c,{duration:g,delay:w,easing:y,repeat:v,offset:C},"motion-one"),M.setAnimation(d),d}}const ne=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function ie(e,t,r){return E(e)?e(t,r):e}const oe=(se=S,function(e,t,r={}){const n=(e=function(e,t){return"string"==typeof e?e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}(e)).length;Boolean(n),Boolean(t);const i=[];for(let o=0;o{const r=new S(e,[0,1],t);return r.finished.catch((()=>{})),r}],t,t.duration)}function ce(e,t,r){return(E(e)?ae:oe)(e,t,r)}},2592:(e,t,r)=>{const n=r(7138),i=r(5115),o=r(6907),s=r(3776);function a(e,t,r,o,s){const a=[].slice.call(arguments,1),c=a.length,l="function"==typeof a[c-1];if(!l&&!n())throw new Error("Callback required as last argument");if(!l){if(c<1)throw new Error("Too few arguments provided");return 1===c?(r=t,t=o=void 0):2!==c||t.getContext||(o=r,r=t,t=void 0),new Promise((function(n,s){try{const s=i.create(r,o);n(e(s,t,o))}catch(e){s(e)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(s=r,r=t,t=o=void 0):3===c&&(t.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=t,t=void 0));try{const n=i.create(r,o);s(null,e(n,t,o))}catch(e){s(e)}}t.create=i.create,t.toCanvas=a.bind(null,o.render),t.toDataURL=a.bind(null,o.renderToDataURL),t.toString=a.bind(null,(function(e,t,r){return s.render(e,r)}))},7138:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},1845:(e,t,r)=>{const n=r(242).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),o=[r-7];for(let e=1;e{const n=r(6910),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(e){this.mode=n.ALPHANUMERIC,this.data=e}o.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=o},7245:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},3280:e=>{function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},3424:(e,t,r)=>{const n=r(2378),i=r(6910);function o(e){this.mode=i.BYTE,"string"==typeof e&&(e=n(e)),this.data=new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,r=this.data.length;t{const n=r(4908),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return o[4*(e-1)+0];case n.M:return o[4*(e-1)+1];case n.Q:return o[4*(e-1)+2];case n.H:return o[4*(e-1)+3];default:return}}},4908:(e,t)=>{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},6526:(e,t,r)=>{const n=r(242).getSymbolSize;t.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},1642:(e,t,r)=>{const n=r(242),i=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let o=r<<10;for(;n.getBCHDigit(o)-i>=0;)o^=1335<{const r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},5442:(e,t,r)=>{const n=r(6910),i=r(242);function o(e){this.mode=n.KANJI,this.data=e}o.getBitsLength=function(e){return 13*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=o},7126:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function r(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,n=0,i=0,o=null,s=null;for(let a=0;a=5&&(r+=n-5+3),o=t,n=1),t=e.get(c,a),t===s?i++:(i>=5&&(r+=i-5+3),s=t,i=1)}n>=5&&(r+=n-5+3),i>=5&&(r+=i-5+3)}return r},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(s,o),s>=10&&(1488===i||93===i)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n{const n=r(3114),i=r(7007);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},1085:(e,t,r)=>{const n=r(6910);function i(e){this.mode=n.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},e.exports=i},6143:(e,t,r)=>{const n=r(9729);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let i=0;i=0;){const e=r[0];for(let i=0;i{const n=r(242),i=r(4908),o=r(7245),s=r(3280),a=r(1845),c=r(6526),l=r(7126),u=r(5393),h=r(2882),d=r(3103),p=r(1642),f=r(6910),m=r(6130);function g(e,t,r){const n=e.size,i=p.getEncodedBits(t,r);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(n-15+o,8,s,!0),o<8?e.set(8,n-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(n-8,8,1,!0)}function w(e,t,r,i){let p;if(Array.isArray(e))p=m.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=m.rawSplit(e);n=d.getBestVersionForData(t,r)}p=m.fromString(e,n||40)}}const w=d.getBestVersionForData(p,r);if(!w)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,o+n,!0,!0):e.set(i+t,o+n,!1,!0))}}(y,t),function(e){const t=e.size;for(let r=8;r=7&&function(e,t){const r=e.size,n=d.getEncodedBits(t);let i,o,s;for(let t=0;t<18;t++)i=Math.floor(t/3),o=t%3+r-8-3,s=1==(n>>t&1),e.set(i,o,s,!0),e.set(o,i,s,!0)}(y,t),function(e,t){const r=e.size;let n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;s>>o&1)),e.set(i,a-r,n),o--,-1===o&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(y,b),isNaN(i)&&(i=l.getBestMask(y,g.bind(null,y,r))),l.applyMask(i,y),g(y,r,i),{modules:y,version:t,errorCorrectionLevel:r,maskPattern:i,segments:p}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,o,s=i.M;return void 0!==t&&(s=i.from(t.errorCorrectionLevel,i.M),r=d.from(t.version),o=l.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),w(e,r,s,o)}},2882:(e,t,r)=>{const n=r(6143);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=i},7007:(e,t)=>{const r="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";t.KANJI=new RegExp(n,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(i,"g"),t.NUMERIC=new RegExp(r,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const o=new RegExp("^"+n+"$"),s=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return o.test(e)},t.testNumeric=function(e){return s.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},6130:(e,t,r)=>{const n=r(6910),i=r(1085),o=r(8260),s=r(3424),a=r(5442),c=r(7007),l=r(242),u=r(5987);function h(e){return unescape(encodeURIComponent(e)).length}function d(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function p(e){const t=d(c.NUMERIC,n.NUMERIC,e),r=d(c.ALPHANUMERIC,n.ALPHANUMERIC,e);let i,o;return l.isKanjiModeEnabled()?(i=d(c.BYTE,n.BYTE,e),o=d(c.KANJI,n.KANJI,e)):(i=d(c.BYTE_KANJI,n.BYTE,e),o=[]),t.concat(r,i,o).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function f(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return o.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return s.getBitsLength(e)}}function m(e,t){let r;const c=n.getBestModeForData(e);if(r=n.from(t,c),r!==n.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[]))},t.rawSplit=function(e){return t.fromArray(p(e,l.isKanjiModeEnabled()))}},242:(e,t)=>{let r;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},3114:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},3103:(e,t,r)=>{const n=r(242),i=r(5393),o=r(4908),s=r(6910),a=r(3114),c=n.getBCHDigit(7973);function l(e,t){return s.getCharCountIndicator(e,t)+4}function u(e,t){let r=0;return e.forEach((function(e){const n=l(e.mode,t);r+=n+e.getBitsLength()})),r}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);const o=8*(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t));if(r===s.MIXED)return o;const c=o-l(r,e);switch(r){case s.NUMERIC:return Math.floor(c/10*3);case s.ALPHANUMERIC:return Math.floor(c/11*2);case s.KANJI:return Math.floor(c/13);case s.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let n;const i=o.from(r,o.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(u(e,n)<=t.getCapacity(n,r,s.MIXED))return n}(e,i);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-c>=0;)t^=7973<{const n=r(9653);t.render=function(e,t,r){let i=r,o=t;void 0!==i||t&&t.getContext||(i=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=n.getOptions(i);const s=n.getImageWidth(e.modules.size,i),a=o.getContext("2d"),c=a.createImageData(s,s);return n.qrToImageData(c.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,o,s),a.putImageData(c,0,0),o},t.renderToDataURL=function(e,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const o=t.render(e,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},3776:(e,t,r)=>{const n=r(9653);function i(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){const s=n.getOptions(t),a=e.modules.size,c=e.modules.data,l=a+2*s.margin,u=s.color.light.a?"':"",h="0&&l>0&&e[c-1]||(n+=s?o("M",l+r,.5+u+r):o("m",i,0),i=0,s=!1),l+1',d='viewBox="0 0 '+l+" "+l+'"',p=''+u+h+"\n";return"function"==typeof r&&r(null,p),p}},9653:(e,t)=>{function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const i=r.modules.size,o=r.modules.data,s=t.getScale(i,n),a=Math.floor((i+2*n.margin)*s),c=n.margin*s,l=[n.color.light,n.color.dark];for(let t=0;t=c&&r>=c&&t{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var o=r.length+1;if(1===o)return e;var s=new Array(o);s[0]=i(e);for(var a=1;a-1?h:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c)break;if(null==r[u])break;h=c)break;if(null==r[u])break;h=c)break;if(void 0===r[u])break;h",h=p+2,p++;break}l+=i(r[u]),h=p+2,p++;break;case 115:if(u>=c)break;h{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeJsonParse=function(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return JSON.parse(e)}catch(t){return e}},t.safeJsonStringify=function(e){return"string"==typeof e?e:JSON.stringify(e,((e,t)=>void 0===t?null:t))}},500:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},610:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},655:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>y,__asyncGenerator:()=>v,__asyncValues:()=>x,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>_,__createBinding:()=>d,__decorate:()=>a,__exportStar:()=>p,__extends:()=>i,__generator:()=>h,__importDefault:()=>E,__importStar:()=>C,__makeTemplateObject:()=>A,__metadata:()=>l,__param:()=>c,__read:()=>m,__rest:()=>s,__spread:()=>g,__spreadArrays:()=>w,__values:()=>f});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function h(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(c,l):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function y(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=f(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function _(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},5289:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:void 0!==r.g?n=r.g.WebSocket||r.g.MozWebSocket:"undefined"!=typeof window?n=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket);const i=n},7026:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},5883:()=>{},6559:(e,t,r)=>{"use strict";const n=r(5346);e.exports=s;const i=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},o={mapHttpRequest:d,mapHttpResponse:d,wrapRequestSerializer:p,wrapResponseSerializer:p,wrapErrorSerializer:p,req:d,res:d,err:function(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}};function s(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},o=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1),"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===e.enabled&&(e.level="silent");const p=e.level||"info",m=Object.create(r);m.log||(m.log=f),Object.defineProperty(m,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(m,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,a(g,m,"error","log"),a(g,m,"fatal","error"),a(g,m,"warn","error"),a(g,m,"info","log"),a(g,m,"debug","log"),a(g,m,"trace","log")}});const g={transmit:t,serialize:o,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:h(e)};return m.levels=s.levels,m.level=p,m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=f,m.serializers=n,m._serialize=o,m._stdErrSerialize=d,m.child=function(r,i){if(!r)throw new Error("missing bindings for child Pino");i=i||{},o&&r.serializers&&(i.serializers=r.serializers);const s=i.serializers;if(o&&s){var a=Object.assign({},n,s),h=!0===e.browser.serialize?Object.keys(a):o;delete r.serializers,c([r],h,a,this._stdErrSerialize)}function d(e){this._childLevel=1+(0|e._childLevel),this.error=l(e,r,"error"),this.fatal=l(e,r,"fatal"),this.warn=l(e,r,"warn"),this.info=l(e,r,"info"),this.debug=l(e,r,"debug"),this.trace=l(e,r,"trace"),a&&(this.serializers=a,this._serialize=h),t&&(this._logEvent=u([].concat(e._logEvent.bindings,r)))}return d.prototype=this,new d(this)},t&&(m._logEvent=u()),m}function a(e,t,r,o){const a=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?f:a[r]?a[r]:i[r]||i[o]||f,function(e,t,r){var o;(e.transmit||t[r]!==f)&&(t[r]=(o=t[r],function(){const a=e.timestamp(),l=new Array(arguments.length),h=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var d=0;d-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function l(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i{"use strict";r.d(t,{AV:()=>s,ConfigCtrl:()=>f,ExplorerCtrl:()=>S,OptionsCtrl:()=>d,ThemeCtrl:()=>$,ToastCtrl:()=>D,jb:()=>M,uA:()=>u,zv:()=>a});var n=r(6828),i=r(8764);const o=(0,n.sj)({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),s={state:o,subscribe:e=>(0,n.Ld)(o,(()=>e(o))),push(e,t){e!==o.view&&(o.view=e,t&&(o.data=t),o.history.push(e))},reset(e){o.view=e,o.history=[e]},replace(e){o.history.length>1&&(o.history[o.history.length-1]=e,o.view=e)},goBack(){if(o.history.length>1){o.history.pop();const[e]=o.history.slice(-1);o.view=e}},setData(e){o.data=e}},a={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>a.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return a.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,r){if(a.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,r){if(!a.isHttpUrl(e))return this.formatNativeUrl(e,t,r);let n=e;return n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))},setWalletConnectAndroidDeepLink(e){const[t]=e.split("?");localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(a.WALLETCONNECT_DEEPLINK_CHOICE)},setModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(a.WCM_VERSION,"2.5.4")},getWalletRouterData(){var e;const t=null==(e=s.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},c=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),l=(0,n.sj)({enabled:c,userSessionId:"",events:[],connectedWalletId:void 0}),u={state:l,subscribe:e=>(0,n.Ld)(l.events,(()=>e((0,n.CO)(l.events[l.events.length-1])))),initialize(){l.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(l.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){l.connectedWalletId=e},click(e){if(l.enabled){const t={type:"CLICK",name:e.name,userSessionId:l.userSessionId,timestamp:Date.now(),data:e};l.events.push(t)}},track(e){if(l.enabled){const t={type:"TRACK",name:e.name,userSessionId:l.userSessionId,timestamp:Date.now(),data:e};l.events.push(t)}},view(e){if(l.enabled){const t={type:"VIEW",name:e.name,userSessionId:l.userSessionId,timestamp:Date.now(),data:e};l.events.push(t)}}},h=(0,n.sj)({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),d={state:h,subscribe:e=>(0,n.Ld)(h,(()=>e(h))),setChains(e){h.chains=e},setWalletConnectUri(e){h.walletConnectUri=e},setIsCustomDesktop(e){h.isCustomDesktop=e},setIsCustomMobile(e){h.isCustomMobile=e},setIsDataLoaded(e){h.isDataLoaded=e},setIsUiLoaded(e){h.isUiLoaded=e},setIsAuth(e){h.isAuth=e}},p=(0,n.sj)({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),f={state:p,subscribe:e=>(0,n.Ld)(p,(()=>e(p))),setConfig(e){var t,r;u.initialize(),d.setChains(e.chains),d.setIsAuth(Boolean(e.enableAuthMode)),d.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),d.setIsCustomDesktop(Boolean(null==(r=e.desktopWallets)?void 0:r.length)),a.setModalVersionInStorage(),Object.assign(p,e)}},m="https://explorer-api.walletconnect.com";async function g(e,t){const r=new URL(e,m);return r.searchParams.append("projectId",f.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&r.searchParams.append(e,String(t))})),(await fetch(r)).json()}const w=async e=>g("/w3m/v1/getDesktopListings",e),b=async e=>g("/w3m/v1/getMobileListings",e),v=async e=>g("/w3m/v1/getAllListings",e),y=e=>`${m}/w3m/v1/getWalletImage/${e}?projectId=${f.state.projectId}`,x=e=>`${m}/w3m/v1/getAssetImage/${e}?projectId=${f.state.projectId}`;var A=Object.defineProperty,C=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,_=(e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const P=a.isMobile(),O=(0,n.sj)({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),S={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=f.state;if("NONE"===e||"ALL"===t&&!e)return O.recomendedWallets;if(a.isArray(e)){const t={recommendedIds:e.join(",")},{listings:r}=await v(t),n=Object.values(r);n.sort(((t,r)=>e.indexOf(t.id)-e.indexOf(r.id))),O.recomendedWallets=n}else{const{chains:e,isAuth:r}=d.state,n=e?.join(","),i=a.isArray(t),o={page:1,sdks:r?"auth_v1":void 0,entries:a.RECOMMENDED_WALLET_AMOUNT,chains:n,version:2,excludedIds:i?t.join(","):void 0},{listings:s}=P?await b(o):await w(o);O.recomendedWallets=Object.values(s)}return O.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var r in t||(t={}))E.call(t,r)&&_(e,r,t[r]);if(C)for(var r of C(t))I.call(t,r)&&_(e,r,t[r]);return e})({},e),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=f.state,{recomendedWallets:i}=O;if("ALL"===n)return O.wallets;t.search||(i.length?t.excludedIds=i.map((e=>e.id)).join(","):a.isArray(r)&&(t.excludedIds=r.join(","))),a.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),d.state.isAuth&&(t.sdks="auth_v1");const{page:o,search:s}=e,{listings:c,total:l}=P?await b(t):await w(t),u=Object.values(c),h=s?"search":"wallets";return O[h]={listings:[...O[h].listings,...u],total:l,page:o??1},{listings:u,total:l}},getWalletImageUrl:e=>y(e),getAssetImageUrl:e=>x(e),resetSearch(){O.search={listings:[],total:0,page:1}}},k=(0,n.sj)({open:!1}),M={state:k,subscribe:e=>(0,n.Ld)(k,(()=>e(k))),open:async e=>new Promise((t=>{const{isUiLoaded:r,isDataLoaded:n}=d.state;if(d.setWalletConnectUri(e?.uri),d.setChains(e?.chains),s.reset("ConnectWallet"),r&&n)k.open=!0,t();else{const e=setInterval((()=>{const r=d.state;r.isUiLoaded&&r.isDataLoaded&&(clearInterval(e),k.open=!0,t())}),200)}})),close(){k.open=!1}};var T=Object.defineProperty,N=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,L=(e,t,r)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const B=(0,n.sj)({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),$={state:B,subscribe:e=>(0,n.Ld)(B,(()=>e(B))),setThemeConfig(e){const{themeMode:t,themeVariables:r}=e;t&&(B.themeMode=t),r&&(B.themeVariables=((e,t)=>{for(var r in t||(t={}))j.call(t,r)&&L(e,r,t[r]);if(N)for(var r of N(t))R.call(t,r)&&L(e,r,t[r]);return e})({},r))}},U=(0,n.sj)({open:!1,message:"",variant:"success"}),D={state:U,subscribe:e=>(0,n.Ld)(U,(()=>e(U))),openToast(e,t){U.open=!0,U.message=e,U.variant=t},closeToast(){U.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=i.lW),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window))},141:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WcmModal:()=>Je,WcmQrCode:()=>oe});var n=r(9392),i=r(7408),o=r(623),s=r(672),a=r(3692),c=r(4213);const l=e=>null!=e?e:a.Ld;var u=r(2592),h=Object.defineProperty,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&m(e,r,t[r]);if(d)for(var r of d(t))f.call(t,r)&&m(e,r,t[r]);return e};const w={getPreset:e=>({"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}[e]),setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=s.ThemeCtrl.state;if(e){const r=g(g(g({},function(){var e;const t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[null!=(e=s.ThemeCtrl.state.themeMode)?e:"dark"];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}()),{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}),t);Object.entries(r).forEach((([t,r])=>e.style.setProperty(t,r)))}},globalCss:n.iv`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},b=n.iv`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,x=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?y(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&v(t,r,o),o};let A=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"wcm-icon-left":void 0!==this.iconLeft,"wcm-icon-right":void 0!==this.iconRight,"wcm-ghost":"ghost"===this.variant,"wcm-outline":"outline"===this.variant};let t="inverse";return"ghost"===this.variant&&(t="secondary"),"outline"===this.variant&&(t="accent"),n.dy``}};A.styles=[w.globalCss,b],x([(0,i.Cb)({type:Boolean})],A.prototype,"disabled",2),x([(0,i.Cb)()],A.prototype,"iconLeft",2),x([(0,i.Cb)()],A.prototype,"iconRight",2),x([(0,i.Cb)()],A.prototype,"onClick",2),x([(0,i.Cb)()],A.prototype,"variant",2),A=x([(0,i.Mo)("wcm-button")],A);const C=n.iv`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var E=Object.defineProperty,I=Object.getOwnPropertyDescriptor,_=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?I(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&E(t,r,o),o};let P=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"wcm-secondary":"secondary"===this.variant};return n.dy``}};P.styles=[w.globalCss,C],_([(0,i.Cb)({type:Boolean})],P.prototype,"disabled",2),_([(0,i.Cb)()],P.prototype,"variant",2),P=_([(0,i.Mo)("wcm-button-big")],P);const O=n.iv`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let S=class extends n.oi{render(){return n.dy`
`}};S.styles=[w.globalCss,O],S=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-info-footer")],S);const k={CROSS_ICON:a.YP``,WALLET_CONNECT_LOGO:a.YP``,WALLET_CONNECT_ICON:a.YP``,WALLET_CONNECT_ICON_COLORED:a.YP``,BACK_ICON:a.YP``,COPY_ICON:a.YP``,RETRY_ICON:a.YP``,DESKTOP_ICON:a.YP``,MOBILE_ICON:a.YP``,ARROW_DOWN_ICON:a.YP``,ARROW_UP_RIGHT_ICON:a.YP``,ARROW_RIGHT_ICON:a.YP``,QRCODE_ICON:a.YP``,SCAN_ICON:a.YP``,CHECKMARK_ICON:a.YP``,SEARCH_ICON:a.YP``,WALLET_PLACEHOLDER:a.YP``,GLOBE_ICON:a.YP``},M=n.iv`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let T=class extends n.oi{render(){return n.dy`
${k.WALLET_CONNECT_LOGO}
`}};T.styles=[w.globalCss,M],T=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-modal-backcard")],T);const N=n.iv`main{padding:20px;padding-top:0;width:100%}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let j=class extends n.oi{render(){return n.dy`
`}};j.styles=[w.globalCss,N],j=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-modal-content")],j);const R=n.iv`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let L=class extends n.oi{render(){return n.dy`
`}};L.styles=[w.globalCss,R],L=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-modal-footer")],L);const B=n.iv`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var $=Object.defineProperty,U=Object.getOwnPropertyDescriptor,D=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?U(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&$(t,r,o),o};let z=class extends n.oi{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return n.dy``}actionBtnTemplate(){return n.dy``}render(){const e={"wcm-border":this.border},t=s.AV.state.history.length>1,r=this.title?n.dy`${this.title}`:n.dy``;return n.dy`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};z.styles=[w.globalCss,B],D([(0,i.Cb)()],z.prototype,"title",2),D([(0,i.Cb)()],z.prototype,"onAction",2),D([(0,i.Cb)()],z.prototype,"actionIcon",2),D([(0,i.Cb)({type:Boolean})],z.prototype,"border",2),z=D([(0,i.Mo)("wcm-modal-header")],z);const W={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=s.ConfigCtrl.state;return null!=r&&r[e]?r[e]:t?s.ExplorerCtrl.getWalletImageUrl(t):""},getWalletName:(e,t=!1)=>t?e.split(" ")[0]:e,isMobileAnimation:()=>window.innerWidth<=W.MOBILE_BREAKPOINT,async preloadImage(e){const t=new Promise(((t,r)=>{const n=new Image;n.onload=t,n.onerror=r,n.src=e}));return Promise.race([t,s.zv.wait(3e3)])},getErrorMessage:e=>e instanceof Error?e.message:"Unknown Error",debounce(e,t=500){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout((function(){e(...n)}),t)}},handleMobileLinking(e){const{walletConnectUri:t}=s.OptionsCtrl.state,{mobile:r,name:n}=e,i=r?.native,o=r?.universal;W.setRecentWallet(e),t&&function(e){let t="";i?t=s.zv.formatUniversalUrl(i,e,n):o&&(t=s.zv.formatNativeUrl(o,e,n)),s.zv.openHref(t,"_self")}(t)},handleAndroidLinking(){const{walletConnectUri:e}=s.OptionsCtrl.state;e&&(s.zv.setWalletConnectAndroidDeepLink(e),s.zv.openHref(e,"_self"))},async handleUriCopy(){const{walletConnectUri:e}=s.OptionsCtrl.state;if(e)try{await navigator.clipboard.writeText(e),s.ToastCtrl.openToast("Link copied","success")}catch{s.ToastCtrl.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:e}=s.ConfigCtrl.state,t=Object.values(e??{});return Object.values(t)},truncate:(e,t=8)=>e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`,setRecentWallet(e){localStorage.setItem(W.WCM_RECENT_WALLET_DATA,JSON.stringify(e))},getRecentWallet(){const e=localStorage.getItem(W.WCM_RECENT_WALLET_DATA);if(e)return JSON.parse(e)},caseSafeIncludes:(e,t)=>e.toUpperCase().includes(t.toUpperCase()),openWalletExplorerUrl(){s.zv.openHref(W.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:e,mobile:t}=s.zv.getWalletRouterData(),r=Boolean(e?.native),n=Boolean(e?.universal);return{isDesktop:r,isMobile:Boolean(t?.native)||Boolean(t?.universal),isWeb:n}},goToConnectingView(e){s.AV.setData({Wallet:e});const t=s.zv.isMobile(),{isDesktop:r,isWeb:n,isMobile:i}=W.getCachedRouterWalletPlatforms();t?i?s.AV.push("MobileConnecting"):n?s.AV.push("WebConnecting"):s.AV.push("InstallWallet"):r?s.AV.push("DesktopConnecting"):n?s.AV.push("WebConnecting"):i?s.AV.push("MobileQrcodeConnecting"):s.AV.push("InstallWallet")}},F=n.iv`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var H=Object.defineProperty,q=Object.getOwnPropertyDescriptor,V=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?q(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&H(t,r,o),o};let G=class extends n.oi{constructor(){super(),this.view=s.AV.state.view,this.prevView=s.AV.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=s.AV.subscribe((e=>{this.view!==e.view&&this.onChangeRoute()}))}firstUpdated(){this.resizeObserver=new ResizeObserver((([e])=>{const t=`${e.contentRect.height}px`;"0px"!==this.oldHeight&&(0,c.j)(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t})),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;null==(e=this.unsubscribe)||e.call(this),null==(t=this.resizeObserver)||t.disconnect()}get routerEl(){return W.getShadowRootElement(this,".wcm-router")}get contentEl(){return W.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return n.dy``;case"DesktopConnecting":return n.dy``;case"MobileConnecting":return n.dy``;case"WebConnecting":return n.dy``;case"MobileQrcodeConnecting":return n.dy``;case"WalletExplorer":return n.dy``;case"Qrcode":return n.dy``;case"InstallWallet":return n.dy``;default:return n.dy`
Not Found
`}}async onChangeRoute(){await(0,c.j)(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=s.AV.state.view,(0,c.j)(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return n.dy`
${this.viewTemplate()}
`}};G.styles=[w.globalCss,F],V([(0,i.SB)()],G.prototype,"view",2),V([(0,i.SB)()],G.prototype,"prevView",2),G=V([(0,i.Mo)("wcm-modal-router")],G);const K=n.iv`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var Z=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,Y=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Q(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Z(t,r,o),o};let J=class extends n.oi{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=s.ToastCtrl.subscribe((e=>{e.open?(this.open=!0,this.timeout=setTimeout((()=>s.ToastCtrl.closeToast()),2200)):(this.open=!1,clearTimeout(this.timeout))}))}disconnectedCallback(){var e;null==(e=this.unsubscribe)||e.call(this),clearTimeout(this.timeout),s.ToastCtrl.closeToast()}render(){const{message:e,variant:t}=s.ToastCtrl.state,r={"wcm-success":"success"===t,"wcm-error":"error"===t};return this.open?n.dy`
${"success"===t?k.CHECKMARK_ICON:null} ${"error"===t?k.CROSS_ICON:null}${e}
`:null}};function X(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}J.styles=[w.globalCss,K],Y([(0,i.SB)()],J.prototype,"open",2),J=Y([(0,i.Mo)("wcm-modal-toast")],J);const ee={generate(e,t,r){const i="#141414",o=[],s=function(e,t){const r=Array.prototype.slice.call(u.create(e,{errorCorrectionLevel:"Q"}).modules.data,0),n=Math.sqrt(r.length);return r.reduce(((e,t,r)=>(r%n==0?e.push([t]):e[e.length-1].push(t))&&e),[])}(e),a=t/s.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach((({x:e,y:t})=>{const r=(s.length-7)*a*e,l=(s.length-7)*a*t;for(let e=0;e`)}}));const l=Math.floor((r+25)/a),h=s.length/2-l/2,d=s.length/2+l/2-1,p=[];s.forEach(((e,t)=>{e.forEach(((e,r)=>{if(s[t][r]&&!(t<7&&r<7||t>s.length-8&&r<7||t<7&&r>s.length-8)&&!(t>h&&th&&r{f[e]?f[e].push(t):f[e]=[t]})),Object.entries(f).map((([e,t])=>{const r=t.filter((e=>t.every((t=>!X(e,t,a)))));return[Number(e),r]})).forEach((([e,t])=>{t.forEach((t=>{o.push(n.YP``)}))})),Object.entries(f).filter((([e,t])=>t.length>1)).map((([e,t])=>{const r=t.filter((e=>t.some((t=>X(e,t,a)))));return[Number(e),r]})).map((([e,t])=>{t.sort(((e,t)=>et.some((t=>X(e,t,a)))));t?t.push(e):r.push([e])}return[e,r.map((e=>[e[0],e[e.length-1]]))]})).forEach((([e,t])=>{t.forEach((([t,r])=>{o.push(n.YP``)}))})),o}},te=n.iv`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var re=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ie=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ne(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&re(t,r,o),o};let oe=class extends n.oi{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e="light"===s.ThemeCtrl.state.themeMode?this.size:this.size-36;return n.YP`${ee.generate(this.uri,e,e/4)}`}render(){const e={"wcm-dark":"dark"===s.ThemeCtrl.state.themeMode};return n.dy`
${this.walletId||this.imageUrl?n.dy``:k.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};oe.styles=[w.globalCss,te],ie([(0,i.Cb)()],oe.prototype,"uri",2),ie([(0,i.Cb)({type:Number})],oe.prototype,"size",2),ie([(0,i.Cb)()],oe.prototype,"imageId",2),ie([(0,i.Cb)()],oe.prototype,"walletId",2),ie([(0,i.Cb)()],oe.prototype,"imageUrl",2),oe=ie([(0,i.Mo)("wcm-qrcode")],oe);const se=n.iv`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ce(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ae(t,r,o),o};let ue=class extends n.oi{constructor(){super(...arguments),this.onChange=()=>null}render(){return n.dy` ${k.SEARCH_ICON}`}};ue.styles=[w.globalCss,se],le([(0,i.Cb)()],ue.prototype,"onChange",2),ue=le([(0,i.Mo)("wcm-search-input")],ue);const he=n.iv`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let de=class extends n.oi{render(){return n.dy``}};de.styles=[w.globalCss,he],de=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-spinner")],de);const pe=n.iv`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var fe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,ge=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?me(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&fe(t,r,o),o};let we=class extends n.oi{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"wcm-big-bold":"big-bold"===this.variant,"wcm-medium-regular":"medium-regular"===this.variant,"wcm-small-regular":"small-regular"===this.variant,"wcm-small-thin":"small-thin"===this.variant,"wcm-xsmall-regular":"xsmall-regular"===this.variant,"wcm-xsmall-bold":"xsmall-bold"===this.variant,"wcm-color-primary":"primary"===this.color,"wcm-color-secondary":"secondary"===this.color,"wcm-color-tertiary":"tertiary"===this.color,"wcm-color-inverse":"inverse"===this.color,"wcm-color-accnt":"accent"===this.color,"wcm-color-error":"error"===this.color};return n.dy``}};we.styles=[w.globalCss,pe],ge([(0,i.Cb)()],we.prototype,"variant",2),ge([(0,i.Cb)()],we.prototype,"color",2),we=ge([(0,i.Mo)("wcm-text")],we);const be=n.iv`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,xe=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ye(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ve(t,r,o),o};let Ae=class extends n.oi{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?n.dy`RECENT`:this.installed?n.dy`INSTALLED`:null}handleClick(){s.uA.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return n.dy``}};Ae.styles=[w.globalCss,be],xe([(0,i.Cb)()],Ae.prototype,"onClick",2),xe([(0,i.Cb)()],Ae.prototype,"name",2),xe([(0,i.Cb)()],Ae.prototype,"walletId",2),xe([(0,i.Cb)()],Ae.prototype,"label",2),xe([(0,i.Cb)()],Ae.prototype,"imageId",2),xe([(0,i.Cb)({type:Boolean})],Ae.prototype,"installed",2),xe([(0,i.Cb)({type:Boolean})],Ae.prototype,"recent",2),Ae=xe([(0,i.Mo)("wcm-wallet-button")],Ae);const Ce=n.iv`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Ee=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,_e=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ie(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ee(t,r,o),o};let Pe=class extends n.oi{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=null!=(e=this.imageUrl)&&e.length?this.imageUrl:W.getWalletIcon({id:this.walletId,image_id:this.imageId});return n.dy`${t.length?n.dy`
${this.id}
`:k.WALLET_PLACEHOLDER}`}};Pe.styles=[w.globalCss,Ce],_e([(0,i.Cb)()],Pe.prototype,"walletId",2),_e([(0,i.Cb)()],Pe.prototype,"imageId",2),_e([(0,i.Cb)()],Pe.prototype,"imageUrl",2),Pe=_e([(0,i.Mo)("wcm-wallet-image")],Pe);var Oe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,ke=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Se(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Oe(t,r,o),o};let Me=class extends n.oi{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{null!=e&&e.length&&await Promise.all(e.map((async e=>W.preloadImage(e))))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){if(s.ConfigCtrl.state.enableExplorer){await s.ExplorerCtrl.getRecomendedWallets(),s.OptionsCtrl.setIsDataLoaded(!0);const{recomendedWallets:e}=s.ExplorerCtrl.state,t=e.map((e=>W.getWalletIcon(e)));await this.loadImages(t)}else s.OptionsCtrl.setIsDataLoaded(!0)}async preloadCustomImages(){const e=W.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),s.ToastCtrl.openToast("Failed preloading","error")}}};ke([(0,i.SB)()],Me.prototype,"preload",2),Me=ke([(0,i.Mo)("wcm-explorer-context")],Me);Object.defineProperty,Object.getOwnPropertyDescriptor;let Te=class extends n.oi{constructor(){super(),this.unsubscribeTheme=void 0,w.setTheme(),this.unsubscribeTheme=s.ThemeCtrl.subscribe(w.setTheme)}disconnectedCallback(){var e;null==(e=this.unsubscribeTheme)||e.call(this)}};Te=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-theme-context")],Te);const Ne=n.iv`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let je=class extends n.oi{onGoToQrcode(){s.AV.push("Qrcode")}render(){const{recomendedWallets:e}=s.ExplorerCtrl.state,t=[...e,...e],r=2*s.zv.RECOMMENDED_WALLET_AMOUNT;return n.dy`
${k.MOBILE_ICON}WalletConnect
${[...Array(r)].map(((e,r)=>{const i=t[r%t.length];return i?n.dy``:k.WALLET_PLACEHOLDER}))}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};je.styles=[w.globalCss,Ne],je=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-android-wallet-selection")],je);const Re=n.iv`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var Le=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,$e=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Be(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Le(t,r,o),o};let Ue=class extends n.oi{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=null!=(t=null==(e=s.ThemeCtrl.state.themeVariables)?void 0:e["--wcm-wallet-icon-large-border-radius"])?t:w.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;i=r.includes("%")?.88*parseInt(r,10):parseInt(r,10),i*=1.17;const o=317-1.57*i,a=425-1.8*i;return n.dy``}render(){const e={"wcm-error":this.isError,"wcm-stale":this.isStale};return n.dy`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};Ue.styles=[w.globalCss,Re],$e([(0,i.Cb)()],Ue.prototype,"walletId",2),$e([(0,i.Cb)()],Ue.prototype,"imageId",2),$e([(0,i.Cb)({type:Boolean})],Ue.prototype,"isError",2),$e([(0,i.Cb)({type:Boolean})],Ue.prototype,"isStale",2),$e([(0,i.Cb)()],Ue.prototype,"label",2),Ue=$e([(0,i.Mo)("wcm-connector-waiting")],Ue);const De={manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=s.ConfigCtrl.state,i=null==(e=De.recentWallet())?void 0:e.id,o=s.zv.isMobile()?r:n,a=o?.filter((e=>i!==e.id));return null!=(t=s.zv.isMobile()?a?.map((({id:e,name:t,links:r})=>({id:e,name:t,mobile:r,links:r}))):a?.map((({id:e,name:t,links:r})=>({id:e,name:t,desktop:r,links:r}))))?t:[]},recentWallet:()=>W.getRecentWallet(),recomendedWallets(e=!1){var t;const r=e||null==(t=De.recentWallet())?void 0:t.id,{recomendedWallets:n}=s.ExplorerCtrl.state;return n.filter((e=>r!==e.id))}},ze={onConnecting(e){W.goToConnectingView(e)},manualWalletsTemplate(){return De.manualWallets().map((e=>n.dy``))},recomendedWalletsTemplate(e=!1){return De.recomendedWallets(e).map((e=>n.dy``))},recentWalletTemplate(){const e=De.recentWallet();if(e)return n.dy``}},We=n.iv`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Fe=class extends n.oi{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=s.ConfigCtrl.state,r="ALL"!==e&&t,i=ze.manualWalletsTemplate(),o=ze.recomendedWalletsTemplate();let a=[ze.recentWalletTemplate(),...i,...o];a=a.filter(Boolean);const c=a.length>4||r;let l=[];l=c?a.slice(0,3):a;const u=Boolean(l.length);return n.dy`
${k.MOBILE_ICON}Mobile
${k.SCAN_ICON}Scan with your wallet
${u?n.dy`
${k.DESKTOP_ICON}Desktop
${l} ${c?n.dy``:null}
`:null}`}};Fe.styles=[w.globalCss,We],Fe=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-desktop-wallet-selection")],Fe);const He=n.iv`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let qe=class extends n.oi{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=s.ConfigCtrl.state;return e??t?n.dy`
By connecting your wallet to this app, you agree to the app's ${e?n.dy`Terms of Service`:null} ${e&&t?"and":null} ${t?n.dy`Privacy Policy`:null}
`:null}};qe.styles=[w.globalCss,He],qe=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-legal-notice")],qe);const Ve=n.iv`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Ge=class extends n.oi{onQrcode(){s.AV.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=s.ConfigCtrl.state,r="ALL"!==e&&t,i=ze.manualWalletsTemplate(),o=ze.recomendedWalletsTemplate();let a=[ze.recentWalletTemplate(),...i,...o];a=a.filter(Boolean);const c=a.length>8||r;let l=[];l=c?a.slice(0,7):a;const u=Boolean(l.length);return n.dy`${u?n.dy`
${l} ${c?n.dy``:null}
`:null}`}};Ge.styles=[w.globalCss,Ve],Ge=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-mobile-wallet-selection")],Ge);const Ke=n.iv`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var Ze=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,Ye=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Qe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ze(t,r,o),o};let Je=class extends n.oi{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=s.jb.subscribe((e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()}))}disconnectedCallback(){var e;null==(e=this.unsubscribeModal)||e.call(this)}get overlayEl(){return W.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return W.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(e){if(document.querySelector("body"))if(e){const e=document.getElementById("wcm-styles");e?.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(e){e.target===e.currentTarget&&s.jb.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout((async()=>{const e=W.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[0,1]},{delay:.1,duration:.2}).finished,(0,c.j)(this.containerEl,e,{delay:.1,duration:.2}).finished]),this.active=!0}),0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=W.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished,(0,c.j)(this.containerEl,e,{duration:.2}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",(e=>{var t;"Escape"===e.key?s.jb.close():"Tab"===e.key&&(null!=(t=e.target)&&t.tagName.includes("wcm-")||this.containerEl.focus())}),this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;null==(e=this.abortController)||e.abort(),this.abortController=void 0}render(){const e={"wcm-overlay":!0,"wcm-active":this.active};return n.dy`
${this.open?n.dy`
`:null}
`}};Je.styles=[w.globalCss,Ke],Ye([(0,i.SB)()],Je.prototype,"open",2),Ye([(0,i.SB)()],Je.prototype,"active",2),Je=Ye([(0,i.Mo)("wcm-modal")],Je);const Xe=n.iv`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var et=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,rt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?tt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&et(t,r,o),o};let nt=class extends n.oi{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){s.zv.isMobile()?s.AV.replace("MobileConnecting"):s.AV.replace("MobileQrcodeConnecting")}onDesktop(){s.AV.replace("DesktopConnecting")}onWeb(){s.AV.replace("WebConnecting")}render(){return n.dy`
${this.isRetry?n.dy``:null} ${this.isMobile?n.dy`Mobile`:null} ${this.isDesktop?n.dy`Desktop`:null} ${this.isWeb?n.dy`Web`:null}
`}};nt.styles=[w.globalCss,Xe],rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isMobile",2),rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isDesktop",2),rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isWeb",2),rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isRetry",2),nt=rt([(0,i.Mo)("wcm-platform-selection")],nt);const it=n.iv`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let ot=class extends n.oi{onClick(){s.AV.push("WalletExplorer")}render(){const{recomendedWallets:e}=s.ExplorerCtrl.state,t=[...e,...De.manualWallets()].reverse().slice(0,4);return n.dy``}};ot.styles=[w.globalCss,it],ot=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-view-all-wallets-button")],ot);const st=n.iv`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ct(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&at(t,r,o),o};let ut=class extends n.oi{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout((()=>{const{walletConnectUri:e}=s.OptionsCtrl.state;this.uri=e}),0)}get overlayEl(){return W.getShadowRootElement(this,".wcm-qr-container")}render(){return n.dy`
${this.uri?n.dy``:n.dy``}
`}};ut.styles=[w.globalCss,st],lt([(0,i.Cb)()],ut.prototype,"walletId",2),lt([(0,i.Cb)()],ut.prototype,"imageId",2),lt([(0,i.SB)()],ut.prototype,"uri",2),ut=lt([(0,i.Mo)("wcm-walletconnect-qr")],ut);Object.defineProperty,Object.getOwnPropertyDescriptor;let ht=class extends n.oi{viewTemplate(){return s.zv.isAndroid()?n.dy``:s.zv.isMobile()?n.dy``:n.dy``}render(){return n.dy`${this.viewTemplate()}`}};ht.styles=[w.globalCss],ht=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-connect-wallet-view")],ht);const dt=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var pt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,mt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ft(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&pt(t,r,o),o};let gt=class extends n.oi{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(e){const{desktop:t,name:r}=s.zv.getWalletRouterData(),n=t?.native;if(n){const t=s.zv.formatNativeUrl(n,e,r);s.zv.openHref(t,"_self")}}openDesktopApp(){const{walletConnectUri:e}=s.OptionsCtrl.state,t=s.zv.getWalletRouterData();W.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=s.zv.getWalletRouterData(),{isMobile:i,isWeb:o}=W.getCachedRouterWalletPlatforms();return n.dy`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};gt.styles=[w.globalCss,dt],mt([(0,i.SB)()],gt.prototype,"isError",2),gt=mt([(0,i.Mo)("wcm-desktop-connecting-view")],gt);const wt=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let bt=class extends n.oi{onInstall(e){e&&s.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:i}=s.zv.getWalletRouterData();return n.dy`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};bt.styles=[w.globalCss,wt],bt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-install-wallet-view")],bt);const vt=n.iv`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var yt=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,At=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?xt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&yt(t,r,o),o};let Ct=class extends n.oi{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=s.zv.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!t){const t=s.zv.formatNativeUrl(i,e,n);s.zv.openHref(t,"_self")}else if(o){const t=s.zv.formatUniversalUrl(o,e,n);s.zv.openHref(t,"_self")}}openMobileApp(e=!1){const{walletConnectUri:t}=s.OptionsCtrl.state,r=s.zv.getWalletRouterData();W.setRecentWallet(r),t&&this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&s.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:i,mobile:o}=s.zv.getWalletRouterData(),{isWeb:a}=W.getCachedRouterWalletPlatforms(),c=i?.ios,u=o?.universal;return n.dy`Retry${u?n.dy`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};Ct.styles=[w.globalCss,vt],At([(0,i.SB)()],Ct.prototype,"isError",2),Ct=At([(0,i.Mo)("wcm-mobile-connecting-view")],Ct);const Et=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let It=class extends n.oi{render(){const{name:e,id:t,image_id:r}=s.zv.getWalletRouterData(),{isDesktop:i,isWeb:o}=W.getCachedRouterWalletPlatforms();return n.dy`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};It.styles=[w.globalCss,Et],It=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-mobile-qr-connecting-view")],It);Object.defineProperty,Object.getOwnPropertyDescriptor;let _t=class extends n.oi{render(){return n.dy``}};_t.styles=[w.globalCss],_t=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-qrcode-view")],_t);const Pt=n.iv`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var Ot=Object.defineProperty,St=Object.getOwnPropertyDescriptor,kt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?St(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ot(t,r,o),o};let Mt=class extends n.oi{constructor(){super(...arguments),this.loading=!s.ExplorerCtrl.state.wallets.listings.length,this.firstFetch=!s.ExplorerCtrl.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=W.debounce((e=>{e.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=e,s.ExplorerCtrl.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),s.ExplorerCtrl.resetSearch())}))}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;null==(e=this.intersectionObserver)||e.disconnect()}get placeholderEl(){return W.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver((([e])=>{e.isIntersecting&&(!this.search||!this.firstFetch)&&this.fetchWallets()})),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=s.ExplorerCtrl.state,{listings:r,total:n}=this.search?t:e;return n<=40||r.length>=n}async fetchWallets(){var e;const{wallets:t,search:r}=s.ExplorerCtrl.state,{listings:n,total:i,page:o}=this.search?r:t;if(!this.endReached&&(this.firstFetch||i>40&&n.lengthW.getWalletIcon(e)));await Promise.all([...n.map((async e=>W.preloadImage(e))),s.zv.wait(300)]),this.endReached=this.isLastPage()}catch(e){console.error(e),s.ToastCtrl.openToast(W.getErrorMessage(e),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){s.zv.isAndroid()?W.handleMobileLinking(e):W.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=s.ExplorerCtrl.state,{listings:r}=this.search?t:e,i=this.loading&&!r.length,a=this.search.length>=3;let c=ze.manualWalletsTemplate(),l=ze.recomendedWalletsTemplate(!0);a&&(c=c.filter((({values:e})=>W.caseSafeIncludes(e[0],this.search))),l=l.filter((({values:e})=>W.caseSafeIncludes(e[0],this.search))));const u=!this.loading&&!r.length&&!l.length,h={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return n.dy`
${i?null:c} ${i?null:l} ${i?null:r.map((e=>n.dy`${e?n.dy``:null}`))}
${u?n.dy`No results found`:null} ${!u&&this.loading?n.dy``:null}
`}};Mt.styles=[w.globalCss,Pt],kt([(0,i.SB)()],Mt.prototype,"loading",2),kt([(0,i.SB)()],Mt.prototype,"firstFetch",2),kt([(0,i.SB)()],Mt.prototype,"search",2),kt([(0,i.SB)()],Mt.prototype,"endReached",2),Mt=kt([(0,i.Mo)("wcm-wallet-explorer-view")],Mt);const Tt=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Nt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,Rt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?jt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Nt(t,r,o),o};let Lt=class extends n.oi{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(e){const{desktop:t,name:r}=s.zv.getWalletRouterData(),n=t?.universal;if(n){const t=s.zv.formatUniversalUrl(n,e,r);s.zv.openHref(t,"_blank")}}openWebWallet(){const{walletConnectUri:e}=s.OptionsCtrl.state,t=s.zv.getWalletRouterData();W.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=s.zv.getWalletRouterData(),{isMobile:i,isDesktop:o}=W.getCachedRouterWalletPlatforms(),a=s.zv.isMobile();return n.dy`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};Lt.styles=[w.globalCss,Tt],Rt([(0,i.SB)()],Lt.prototype,"isError",2),Lt=Rt([(0,i.Mo)("wcm-web-connecting-view")],Lt)},9343:(e,t,r)=>{"use strict";r.d(t,{WalletConnectModal:()=>i});var n=r(672);class i{constructor(e){this.openModal=n.jb.open,this.closeModal=n.jb.close,this.subscribeModal=n.jb.subscribe,this.setTheme=n.ThemeCtrl.setThemeConfig,n.ThemeCtrl.setThemeConfig(e),n.ConfigCtrl.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(r.bind(r,141));const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),n.OptionsCtrl.setIsUiLoaded(!0)}}}},1475:(e,t,r)=>{"use strict";r.d(t,{AV:()=>c,AccountCtrl:()=>b,ConfigCtrl:()=>g,ExplorerCtrl:()=>j,Id:()=>s,OptionsCtrl:()=>f,ThemeCtrl:()=>q,ToastCtrl:()=>G,WcConnectionCtrl:()=>L,jb:()=>$,uA:()=>d,zv:()=>l});var n=r(6828),i=r(8764);let o;const s={ethereumClient:void 0,setEthereumClient(e){o=e},client(){if(o)return o;throw new Error("ClientCtrl has no client set")}},a=(0,n.sj)({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),c={state:a,subscribe:e=>(0,n.Ld)(a,(()=>e(a))),push(e,t){e!==a.view&&(a.view=e,t&&(a.data=t),a.history.push(e))},reset(e){a.view=e,a.history=[e]},replace(e){a.history.length>1&&(a.history[a.history.length-1]=e,a.view=e)},goBack(){if(a.history.length>1){a.history.pop();const[e]=a.history.slice(-1);a.view=e}},setData(e){a.data=e}},l={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>l.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return l.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,r){if(l.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,r){if(!l.isHttpUrl(e))return this.formatNativeUrl(e,t,r);let n=e;return n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(l.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(l.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(l.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setWeb3ModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(l.W3M_VERSION,"2.6.1")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=null==(e=c.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t},getSwitchNetworkRouterData(){var e;const t=null==(e=c.state.data)?void 0:e.SwitchNetwork;if(!t)throw new Error('Missing "SwitchNetwork" view data');return t},isPreferInjectedFlag:()=>typeof location<"u"&&new URLSearchParams(location.search).has(l.W3M_PREFER_INJECTED_URL_FLAG)},u=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),h=(0,n.sj)({enabled:u,userSessionId:"",events:[],connectedWalletId:void 0}),d={state:h,subscribe:e=>(0,n.Ld)(h.events,(()=>e((0,n.CO)(h.events[h.events.length-1])))),initialize(){h.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(h.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){h.connectedWalletId=e},click(e){if(h.enabled){const t={type:"CLICK",name:e.name,userSessionId:h.userSessionId,timestamp:Date.now(),data:e};h.events.push(t)}},track(e){if(h.enabled){const t={type:"TRACK",name:e.name,userSessionId:h.userSessionId,timestamp:Date.now(),data:e};h.events.push(t)}},view(e){if(h.enabled){const t={type:"VIEW",name:e.name,userSessionId:h.userSessionId,timestamp:Date.now(),data:e};h.events.push(t)}}},p=(0,n.sj)({selectedChain:void 0,chains:void 0,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1}),f={state:p,subscribe:e=>(0,n.Ld)(p,(()=>e(p))),setChains(e){p.chains=e},getSelectedChain(){const e=s.client().getNetwork().chain;return e&&(p.selectedChain=e),p.selectedChain},setSelectedChain(e){p.selectedChain=e},setIsCustomDesktop(e){p.isCustomDesktop=e},setIsCustomMobile(e){p.isCustomMobile=e},setIsDataLoaded(e){p.isDataLoaded=e},setIsUiLoaded(e){p.isUiLoaded=e},setIsPreferInjected(e){p.isPreferInjected=e}},m=(0,n.sj)({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),g={state:m,subscribe:e=>(0,n.Ld)(m,(()=>e(m))),setConfig(e){var t,r;d.initialize(),f.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),f.setIsCustomDesktop(Boolean(null==(r=e.desktopWallets)?void 0:r.length)),f.setChains(s.client().chains),f.setIsPreferInjected(s.client().isInjectedProviderInstalled()&&l.isPreferInjectedFlag()),e.defaultChain&&f.setSelectedChain(e.defaultChain),l.setWeb3ModalVersionInStorage(),Object.assign(m,e)}},w=(0,n.sj)({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),b={state:w,subscribe:e=>(0,n.Ld)(w,(()=>e(w))),getAccount(){const e=s.client().getAccount();w.address=e.address,w.isConnected=e.isConnected},async fetchProfile(e,t){var r;try{w.profileLoading=!0;const n=t??w.address,i=null==(r=f.state.chains)?void 0:r.find((e=>1===e.id));if(n&&i){const t=await s.client().fetchEnsName({address:n,chainId:1});if(t){const r=await s.client().fetchEnsAvatar({name:t,chainId:1});r&&await e(r),w.profileAvatar=r}w.profileName=t}}finally{w.profileLoading=!1}},async fetchBalance(e){try{const{chain:t}=s.client().getNetwork(),{tokenContracts:r}=g.state;let n;t&&r&&(n=r[t.id]),w.balanceLoading=!0;const i=e??w.address;if(i){const e=await s.client().fetchBalance({address:i,token:n});w.balance={amount:e.formatted,symbol:e.symbol}}}finally{w.balanceLoading=!1}},setAddress(e){w.address=e},setIsConnected(e){w.isConnected=e},resetBalance(){w.balance=void 0},resetAccount(){w.address=void 0,w.isConnected=!1,w.profileName=void 0,w.profileAvatar=void 0,w.balance=void 0}},v="https://explorer-api.walletconnect.com";async function y(e,t){const r=new URL(e,v);return r.searchParams.append("projectId",g.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&r.searchParams.append(e,String(t))})),(await fetch(r)).json()}const x=async e=>y("/w3m/v1/getDesktopListings",e),A=async e=>y("/w3m/v1/getMobileListings",e),C=async e=>y("/w3m/v1/getInjectedListings",e),E=async e=>y("/w3m/v1/getAllListings",e),I=e=>`${v}/w3m/v1/getWalletImage/${e}?projectId=${g.state.projectId}`,_=e=>`${v}/w3m/v1/getAssetImage/${e}?projectId=${g.state.projectId}`;var P=Object.defineProperty,O=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,M=(e,t,r)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const T=l.isMobile(),N=(0,n.sj)({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),j={state:N,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=g.state;if("NONE"===e||"ALL"===t&&!e)return N.recomendedWallets;if(l.isArray(e)){const t={recommendedIds:e.join(",")},{listings:r}=await E(t),n=Object.values(r);n.sort(((t,r)=>e.indexOf(t.id)-e.indexOf(r.id))),N.recomendedWallets=n}else{const e=l.isArray(t),r={page:1,entries:l.RECOMMENDED_WALLET_AMOUNT,version:2,excludedIds:e?t.join(","):void 0},{listings:n}=T?await A(r):await x(r);N.recomendedWallets=Object.values(n)}return N.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var r in t||(t={}))S.call(t,r)&&M(e,r,t[r]);if(O)for(var r of O(t))k.call(t,r)&&M(e,r,t[r]);return e})({},e),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=g.state,{recomendedWallets:i}=N;if("ALL"===n)return N.wallets;i.length?t.excludedIds=i.map((e=>e.id)).join(","):l.isArray(r)&&(t.excludedIds=r.join(",")),l.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(","));const{page:o,search:s}=e,{listings:a,total:c}=T?await A(t):await x(t),u=Object.values(a),h=s?"search":"wallets";return N[h]={listings:[...N[h].listings,...u],total:c,page:o??1},{listings:u,total:c}},async getInjectedWallets(){const{listings:e}=await C({}),t=Object.values(e);return N.injectedWallets=t,N.injectedWallets},getWalletImageUrl:e=>I(e),getAssetImageUrl:e=>_(e),resetSearch(){N.search={listings:[],total:0,page:1}}},R=(0,n.sj)({pairingEnabled:!1,pairingUri:"",pairingError:!1}),L={state:R,subscribe:e=>(0,n.Ld)(R,(()=>e(R))),setPairingUri(e){R.pairingUri=e},setPairingError(e){R.pairingError=e},setPairingEnabled(e){R.pairingEnabled=e}},B=(0,n.sj)({open:!1}),$={state:B,subscribe:e=>(0,n.Ld)(B,(()=>e(B))),open:async e=>new Promise((t=>{const{isUiLoaded:r,isDataLoaded:n,isPreferInjected:i,selectedChain:o}=f.state,{isConnected:a}=b.state,{enableNetworkView:l}=g.state;if(L.setPairingEnabled(!0),null!=e&&e.route)c.reset(e.route);else if(a)c.reset("Account");else if(l)c.reset("SelectNetwork");else{if(i)return s.client().connectConnector("injected",o?.id).catch((e=>console.error(e))),void t();c.reset("ConnectWallet")}const{pairingUri:u}=L.state;if(r&&n&&(u||a))B.open=!0,t();else{const e=setInterval((()=>{const r=f.state,n=L.state;r.isUiLoaded&&r.isDataLoaded&&(n.pairingUri||a)&&(clearInterval(e),B.open=!0,t())}),200)}})),close(){B.open=!1}};var U=Object.defineProperty,D=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,F=(e,t,r)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const H=(0,n.sj)({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),q={state:H,subscribe:e=>(0,n.Ld)(H,(()=>e(H))),setThemeConfig(e){const{themeMode:t,themeVariables:r}=e;t&&(H.themeMode=t),r&&(H.themeVariables=((e,t)=>{for(var r in t||(t={}))z.call(t,r)&&F(e,r,t[r]);if(D)for(var r of D(t))W.call(t,r)&&F(e,r,t[r]);return e})({},r))}},V=(0,n.sj)({open:!1,message:"",variant:"success"}),G={state:V,subscribe:e=>(0,n.Ld)(V,(()=>e(V))),openToast(e,t){V.open=!0,V.message=e,V.variant=t},closeToast(){V.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=i.lW),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window))},8416:(e,t,r)=>{"use strict";r.r(t),r.d(t,{W3mAccountButton:()=>bt,W3mConnectButton:()=>Vt,W3mCoreButton:()=>tr,W3mModal:()=>dr,W3mNetworkSwitch:()=>wr,W3mQrCode:()=>Ie});var n=r(9392),i=r(7408),o=r(1475),s=r(623),a=r(3692),c=r(4213),l=r(2592),u=Object.defineProperty,h=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))d.call(t,r)&&f(e,r,t[r]);if(h)for(var r of h(t))p.call(t,r)&&f(e,r,t[r]);return e};const g={getPreset:e=>({"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)","--w3m-overlay-background-color":"rgba(0, 0, 0, 0.3)","--w3m-overlay-backdrop-filter":"none"}[e]),setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=o.ThemeCtrl.state;if(e){const r=m(m(m(m({},function(){var e;const t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[null!=(e=o.ThemeCtrl.state.themeMode)?e:"dark"];return{"--w3m-color-fg-1":t.foreground[1],"--w3m-color-fg-2":t.foreground[2],"--w3m-color-fg-3":t.foreground[3],"--w3m-color-bg-1":t.background[1],"--w3m-color-bg-2":t.background[2],"--w3m-color-bg-3":t.background[3],"--w3m-color-overlay":t.overlay}}()),{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)","--w3m-overlay-background-color":"rgba(0, 0, 0, 0.3)","--w3m-overlay-backdrop-filter":"none"}),t),function(){const{themeVariables:e}=o.ThemeCtrl.state;return{"--w3m-background-image-url":null!=e&&e["--w3m-background-image-url"]?`url(${e["--w3m-background-image-url"]})`:"none"}}());Object.entries(r).forEach((([t,r])=>e.style.setProperty(t,r)))}},globalCss:n.iv`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},w=n.iv`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}button:disabled{opacity:.7}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?v(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&b(t,r,o),o};let x=class extends n.oi{constructor(){super(...arguments),this.icon=void 0,this.label="",this.loading=!1,this.onClick=()=>null}render(){return n.dy``}};x.styles=[g.globalCss,w],y([(0,i.Cb)()],x.prototype,"icon",2),y([(0,i.Cb)()],x.prototype,"label",2),y([(0,i.Cb)()],x.prototype,"loading",2),y([(0,i.Cb)()],x.prototype,"onClick",2),x=y([(0,i.Mo)("w3m-box-button")],x);const A=n.iv`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var C=Object.defineProperty,E=Object.getOwnPropertyDescriptor,I=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?E(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&C(t,r,o),o};let _=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"w3m-icon-left":void 0!==this.iconLeft,"w3m-icon-right":void 0!==this.iconRight,"w3m-ghost":"ghost"===this.variant,"w3m-outline":"outline"===this.variant};let t="inverse";return"ghost"===this.variant&&(t="secondary"),"outline"===this.variant&&(t="accent"),n.dy``}};_.styles=[g.globalCss,A],I([(0,i.Cb)()],_.prototype,"disabled",2),I([(0,i.Cb)()],_.prototype,"iconLeft",2),I([(0,i.Cb)()],_.prototype,"iconRight",2),I([(0,i.Cb)()],_.prototype,"onClick",2),I([(0,i.Cb)()],_.prototype,"variant",2),_=I([(0,i.Mo)("w3m-button")],_);const P=n.iv`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var O=Object.defineProperty,S=Object.getOwnPropertyDescriptor,k=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?S(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&O(t,r,o),o};let M=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"w3m-secondary":"secondary"===this.variant};return n.dy``}};M.styles=[g.globalCss,P],k([(0,i.Cb)()],M.prototype,"disabled",2),k([(0,i.Cb)()],M.prototype,"variant",2),M=k([(0,i.Mo)("w3m-button-big")],M);const T=n.iv`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let N=class extends n.oi{render(){return n.dy`
`}};N.styles=[g.globalCss,T],N=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-info-footer")],N);const j={CROSS_ICON:a.YP``,WALLET_CONNECT_LOGO:a.YP``,WALLET_CONNECT_ICON:a.YP``,WALLET_CONNECT_ICON_COLORED:a.YP``,BACK_ICON:a.YP``,COPY_ICON:a.YP``,RETRY_ICON:a.YP``,DESKTOP_ICON:a.YP``,MOBILE_ICON:a.YP``,ARROW_DOWN_ICON:a.YP``,ARROW_UP_RIGHT_ICON:a.YP``,ARROW_RIGHT_ICON:a.YP``,QRCODE_ICON:a.YP``,SCAN_ICON:a.YP``,CHECKMARK_ICON:a.YP``,HELP_ETH_IMG:a.YP``,HELP_PAINTING_IMG:a.YP``,HELP_CHART_IMG:a.YP``,HELP_KEY_IMG:a.YP``,HELP_USER_IMG:a.YP``,HELP_LOCK_IMG:a.YP``,HELP_COMPAS_IMG:a.YP``,HELP_NOUN_IMG:a.YP``,HELP_DAO_IMG:a.YP``,SEARCH_ICON:a.YP``,HELP_ICON:a.YP``,WALLET_ICON:a.YP``,NETWORK_PLACEHOLDER:a.YP``,WALLET_PLACEHOLDER:a.YP``,TOKEN_PLACEHOLDER:a.YP``,ACCOUNT_COPY:a.YP``,ACCOUNT_DISCONNECT:a.YP``,GLOBE_ICON:a.YP``},R=n.iv`.w3m-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var L=Object.defineProperty,B=Object.getOwnPropertyDescriptor,$=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?B(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&L(t,r,o),o};let U=class extends n.oi{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=o.AV.subscribe((e=>{this.isHelp="Help"===e.view}))}disconnectedCallback(){var e;null==(e=this.unsubscribeRouter)||e.call(this)}onHelp(){o.AV.push("Help")}logoTemplate(){var e;const t=null==(e=o.ThemeCtrl.state.themeVariables)?void 0:e["--w3m-logo-image-url"];return t?n.dy``:j.WALLET_CONNECT_LOGO}render(){const e={"w3m-help-active":this.isHelp};return n.dy`
${this.logoTemplate()}
`}};U.styles=[g.globalCss,R],$([(0,i.SB)()],U.prototype,"isHelp",2),U=$([(0,i.Mo)("w3m-modal-backcard")],U);const D=n.iv`main{padding:20px;padding-top:0;width:100%}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let z=class extends n.oi{render(){return n.dy`
`}};z.styles=[g.globalCss,D],z=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-modal-content")],z);const W=n.iv`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let F=class extends n.oi{render(){return n.dy`
`}};F.styles=[g.globalCss,W],F=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-modal-footer")],F);const H=n.iv`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var q=Object.defineProperty,V=Object.getOwnPropertyDescriptor,G=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?V(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&q(t,r,o),o};let K=class extends n.oi{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return n.dy``}actionBtnTemplate(){return n.dy``}render(){const e={"w3m-border":this.border},t=o.AV.state.history.length>1,r=this.title?n.dy`${this.title}`:n.dy``;return n.dy`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};K.styles=[g.globalCss,H],G([(0,i.Cb)()],K.prototype,"title",2),G([(0,i.Cb)()],K.prototype,"onAction",2),G([(0,i.Cb)()],K.prototype,"actionIcon",2),G([(0,i.Cb)()],K.prototype,"border",2),K=G([(0,i.Mo)("w3m-modal-header")],K);const Z={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"},Q={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}},Y={externalWallets(){let e=o.Id.client().getConnectors();return e=e.filter((e=>"injected"!==e.id)),e},manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=o.ConfigCtrl.state,i=null==(e=Y.recentWallet())?void 0:e.id,s=o.zv.isMobile()?r:n,a=s?.filter((e=>i!==e.id));return null!=(t=o.zv.isMobile()?a?.map((({id:e,name:t,links:r})=>({id:e,name:t,mobile:r,links:r}))):a?.map((({id:e,name:t,links:r})=>({id:e,name:t,desktop:r,links:r}))))?t:[]},installedInjectedWallets(){if(!o.Id.client().isInjectedProviderInstalled())return[];const{namespace:e}=o.Id.client(),{injectedWallets:t}=o.ExplorerCtrl.state;let r=t.filter((({injected:t})=>Boolean(t.some((t=>o.Id.client().safeCheckInjectedProvider(t.injected_id)&&t.namespace===e)))));return r.length>1&&(r=r.filter((({injected:e})=>{const t=e.map((({injected_id:e})=>e));return Boolean(t.every((e=>"isMetaMask"!==e)))}))),r.length?r:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:t}=o.ConfigCtrl.state,r=o.zv.isMobile();if("ALL"===e||r)return[];const{namespace:n}=o.Id.client(),{injectedWallets:i}=o.ExplorerCtrl.state;return i.filter((({id:r,injected:i})=>{const s=o.zv.isArray(e)?e:[],a=o.zv.isArray(t)?t:[];return Boolean(i.some((e=>e.namespace===n&&!s.includes(r)&&!a.includes(r))))}))},recentWallet:()=>J.getRecentWallet(),recomendedWallets(e=!1){var t;const r=[...Y.installedInjectedWallets().map((({id:e})=>e)),e||null==(t=Y.recentWallet())?void 0:t.id],{recomendedWallets:n}=o.ExplorerCtrl.state;return n.filter((e=>!r.includes(e.id)))}},J={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_INFO:"W3M_RECENT_WALLET_INFO",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",WAGMI_WALLET:"wagmi.wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=o.ConfigCtrl.state;return null!=r&&r[e]?r[e]:t?o.ExplorerCtrl.getWalletImageUrl(t):""},getWalletName:(e,t=!1)=>t?e.split(" ")[0]:e,getChainIcon(e){var t;const r=Z[e],{projectId:n,chainImages:i}=o.ConfigCtrl.state;return null!=(t=i?.[e])?t:n&&r?o.ExplorerCtrl.getAssetImageUrl(r):""},getTokenIcon(e){var t,r;const n=null==(t=Q[e])?void 0:t.icon,{projectId:i,tokenImages:s}=o.ConfigCtrl.state;return null!=(r=s?.[e])?r:i&&n?o.ExplorerCtrl.getAssetImageUrl(n):""},isMobileAnimation:()=>window.innerWidth<=J.MOBILE_BREAKPOINT,async preloadImage(e){const t=new Promise(((t,r)=>{const n=new Image;n.onload=t,n.onerror=r,n.src=e}));return Promise.race([t,o.zv.wait(3e3)])},getErrorMessage:e=>e instanceof Error?e.message:"Unknown Error",debounce(e,t=500){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout((function(){e(...n)}),t)}},handleMobileLinking(e){const{pairingUri:t}=o.WcConnectionCtrl.state,{mobile:r,name:n}=e,i=r?.native,s=r?.universal;J.setRecentWallet(e),function(e){let t="";i?t=o.zv.formatUniversalUrl(i,e,n):s&&(t=o.zv.formatNativeUrl(s,e,n)),o.zv.openHref(t,"_self")}(t)},handleAndroidLinking(){const{pairingUri:e}=o.WcConnectionCtrl.state;o.zv.setWalletConnectAndroidDeepLink(e),o.zv.openHref(e,"_self")},async handleUriCopy(){try{const{pairingUri:e}=o.WcConnectionCtrl.state;await navigator.clipboard.writeText(e),o.ToastCtrl.openToast("Link copied","success")}catch{o.ToastCtrl.openToast("Failed to copy","error")}},async handleConnectorConnection(e,t){try{const{selectedChain:t}=o.OptionsCtrl.state;await o.Id.client().connectConnector(e,t?.id),o.jb.close()}catch(e){console.error(e),t?t():o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}},getCustomImageUrls(){const{chainImages:e,walletImages:t}=o.ConfigCtrl.state,r=Object.values(e??{}),n=Object.values(t??{});return Object.values([...r,...n])},truncate:(e,t=8)=>e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`,generateAvatarColors(e){var t;const r=null==(t=e.match(/.{1,7}/g))?void 0:t.splice(0,5),n=[];r?.forEach((e=>{let t=0;for(let r=0;r>8*e&255;r[e]=n}n.push(`rgb(${r[0]}, ${r[1]}, ${r[2]})`)}));const i=document.querySelector(":root");if(i){const e={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(e).forEach((([e,t])=>i.style.setProperty(e,t)))}},setRecentWallet(e){try{localStorage.setItem(J.W3M_RECENT_WALLET_INFO,JSON.stringify(e))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const e=localStorage.getItem(J.W3M_RECENT_WALLET_INFO);return e?JSON.parse(e):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes:(e,t)=>e.toUpperCase().includes(t.toUpperCase()),openWalletExplorerUrl(){o.zv.openHref(J.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:e,desktop:t,mobile:r,injected:n}=o.zv.getWalletRouterData(),i=Y.installedInjectedWallets(),s=Boolean(n?.length),a=i.some((t=>t.id===e)),c=Boolean(t?.native),l=Boolean(t?.universal);return{isInjectedInstalled:a,isInjected:s,isDesktop:c,isMobile:Boolean(r?.native)||Boolean(r?.universal),isWeb:l}},goToConnectingView(e){o.AV.setData({Wallet:e});const t=o.zv.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:s}=J.getCachedRouterWalletPlatforms();t?s?o.AV.push("InjectedConnecting"):i?o.AV.push("MobileConnecting"):n?o.AV.push("WebConnecting"):o.AV.push("InstallWallet"):s?o.AV.push("InjectedConnecting"):r?o.AV.push("DesktopConnecting"):n?o.AV.push("WebConnecting"):i?o.AV.push("MobileQrcodeConnecting"):o.AV.push("InstallWallet")},getWagmiWalletType:()=>localStorage.getItem(J.WAGMI_WALLET)},X=n.iv`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,re=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?te(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ee(t,r,o),o};let ne=class extends n.oi{constructor(){super(),this.view=o.AV.state.view,this.prevView=o.AV.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=o.AV.subscribe((e=>{this.view!==e.view&&this.onChangeRoute()}))}firstUpdated(){this.resizeObserver=new ResizeObserver((([e])=>{const t=`${e.contentRect.height}px`;"0px"!==this.oldHeight&&(0,c.j)(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t})),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;null==(e=this.unsubscribe)||e.call(this),null==(t=this.resizeObserver)||t.disconnect()}get routerEl(){return J.getShadowRootElement(this,".w3m-router")}get contentEl(){return J.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return n.dy``;case"SelectNetwork":return n.dy``;case"InjectedConnecting":return n.dy``;case"DesktopConnecting":return n.dy``;case"MobileConnecting":return n.dy``;case"WebConnecting":return n.dy``;case"MobileQrcodeConnecting":return n.dy``;case"GetWallet":return n.dy``;case"WalletExplorer":return n.dy``;case"Qrcode":return n.dy``;case"Help":return n.dy``;case"Account":return n.dy``;case"SwitchNetwork":return n.dy``;case"InstallWallet":return n.dy``;default:return n.dy`
Not Found
`}}async onChangeRoute(){await(0,c.j)(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=o.AV.state.view,(0,c.j)(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return n.dy`
${this.viewTemplate()}
`}};ne.styles=[g.globalCss,X],re([(0,i.SB)()],ne.prototype,"view",2),re([(0,i.SB)()],ne.prototype,"prevView",2),ne=re([(0,i.Mo)("w3m-modal-router")],ne);const ie=n.iv`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var oe=Object.defineProperty,se=Object.getOwnPropertyDescriptor,ae=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?se(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&oe(t,r,o),o};let ce=class extends n.oi{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=o.ToastCtrl.subscribe((e=>{e.open?(this.open=!0,this.timeout=setTimeout((()=>o.ToastCtrl.closeToast()),2200)):(this.open=!1,clearTimeout(this.timeout))}))}disconnectedCallback(){var e;null==(e=this.unsubscribe)||e.call(this),clearTimeout(this.timeout),o.ToastCtrl.closeToast()}render(){const{message:e,variant:t}=o.ToastCtrl.state,r={"w3m-success":"success"===t,"w3m-error":"error"===t};return this.open?n.dy`
${"success"===t?j.CHECKMARK_ICON:null} ${"error"===t?j.CROSS_ICON:null}${e}
`:null}};ce.styles=[g.globalCss,ie],ae([(0,i.SB)()],ce.prototype,"open",2),ce=ae([(0,i.Mo)("w3m-modal-toast")],ce);const le=n.iv`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var ue=Object.defineProperty,he=Object.getOwnPropertyDescriptor,de=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?he(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ue(t,r,o),o};let pe=class extends n.oi{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const e={"w3m-unsupported":this.unsupported};return n.dy``}};pe.styles=[g.globalCss,le],de([(0,i.Cb)()],pe.prototype,"onClick",2),de([(0,i.Cb)()],pe.prototype,"name",2),de([(0,i.Cb)()],pe.prototype,"chainId",2),de([(0,i.Cb)()],pe.prototype,"unsupported",2),pe=de([(0,i.Mo)("w3m-network-button")],pe);const fe=n.iv`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}image{clip-path:path('M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z')}`;var me=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,we=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ge(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&me(t,r,o),o};let be=class extends n.oi{constructor(){super(...arguments),this.chainId=""}render(){const e=J.getChainIcon(this.chainId);return e?n.dy``:n.dy`${j.NETWORK_PLACEHOLDER}`}};function ve(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}be.styles=[g.globalCss,fe],we([(0,i.Cb)()],be.prototype,"chainId",2),be=we([(0,i.Mo)("w3m-network-image")],be);const ye={generate(e,t,r){const i="#141414",o=[],s=function(e,t){const r=Array.prototype.slice.call(l.create(e,{errorCorrectionLevel:"Q"}).modules.data,0),n=Math.sqrt(r.length);return r.reduce(((e,t,r)=>(r%n==0?e.push([t]):e[e.length-1].push(t))&&e),[])}(e),a=t/s.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach((({x:e,y:t})=>{const r=(s.length-7)*a*e,l=(s.length-7)*a*t;for(let e=0;e`)}}));const u=Math.floor((r+25)/a),h=s.length/2-u/2,d=s.length/2+u/2-1,p=[];s.forEach(((e,t)=>{e.forEach(((e,r)=>{if(s[t][r]&&!(t<7&&r<7||t>s.length-8&&r<7||t<7&&r>s.length-8)&&!(t>h&&th&&r{f[e]?f[e].push(t):f[e]=[t]})),Object.entries(f).map((([e,t])=>{const r=t.filter((e=>t.every((t=>!ve(e,t,a)))));return[Number(e),r]})).forEach((([e,t])=>{t.forEach((t=>{o.push(n.YP``)}))})),Object.entries(f).filter((([e,t])=>t.length>1)).map((([e,t])=>{const r=t.filter((e=>t.some((t=>ve(e,t,a)))));return[Number(e),r]})).map((([e,t])=>{t.sort(((e,t)=>et.some((t=>ve(e,t,a)))));t?t.push(e):r.push([e])}return[e,r.map((e=>[e[0],e[e.length-1]]))]})).forEach((([e,t])=>{t.forEach((([t,r])=>{o.push(n.YP``)}))})),o}},xe=n.iv`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.w3m-dark{background-color:#fff;border-radius:var(--w3m-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var Ae=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ce(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ae(t,r,o),o};let Ie=class extends n.oi{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e="light"===o.ThemeCtrl.state.themeMode?this.size:this.size-36;return n.YP`${ye.generate(this.uri,e,e/4)}`}render(){const e={"w3m-dark":"dark"===o.ThemeCtrl.state.themeMode};return n.dy`
${this.walletId||this.imageUrl?n.dy``:j.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};Ie.styles=[g.globalCss,xe],Ee([(0,i.Cb)()],Ie.prototype,"uri",2),Ee([(0,i.Cb)({type:Number})],Ie.prototype,"size",2),Ee([(0,i.Cb)()],Ie.prototype,"imageId",2),Ee([(0,i.Cb)()],Ie.prototype,"walletId",2),Ee([(0,i.Cb)()],Ie.prototype,"imageUrl",2),Ie=Ee([(0,i.Mo)("w3m-qrcode")],Ie);const _e=n.iv`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var Pe=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Se=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Oe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Pe(t,r,o),o};let ke=class extends n.oi{constructor(){super(...arguments),this.onChange=()=>null}render(){return n.dy` ${j.SEARCH_ICON}`}};ke.styles=[g.globalCss,_e],Se([(0,i.Cb)()],ke.prototype,"onChange",2),ke=Se([(0,i.Mo)("w3m-search-input")],ke);const Me=n.iv`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}:host{width:100%;height:100%;display:flex;justify-content:center;align-items:center}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite}.accent{stroke:var(--w3m-accent-color)}.fill{stroke:var(--w3m-accent-fill-color)}`;var Te=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,je=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ne(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Te(t,r,o),o};let Re=class extends n.oi{constructor(){super(...arguments),this.color="accent",this.size=24}render(){return n.dy``}};Re.styles=[g.globalCss,Me],je([(0,i.Cb)()],Re.prototype,"color",2),je([(0,i.Cb)({type:Number})],Re.prototype,"size",2),Re=je([(0,i.Mo)("w3m-spinner")],Re);const Le=n.iv`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:var(--w3m-font-feature-settings)}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var Be=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,Ue=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?$e(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Be(t,r,o),o};let De=class extends n.oi{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"w3m-big-bold":"big-bold"===this.variant,"w3m-medium-regular":"medium-regular"===this.variant,"w3m-small-regular":"small-regular"===this.variant,"w3m-small-thin":"small-thin"===this.variant,"w3m-xsmall-regular":"xsmall-regular"===this.variant,"w3m-xsmall-bold":"xsmall-bold"===this.variant,"w3m-color-primary":"primary"===this.color,"w3m-color-secondary":"secondary"===this.color,"w3m-color-tertiary":"tertiary"===this.color,"w3m-color-inverse":"inverse"===this.color,"w3m-color-accnt":"accent"===this.color,"w3m-color-error":"error"===this.color};return n.dy``}};De.styles=[g.globalCss,Le],Ue([(0,i.Cb)()],De.prototype,"variant",2),Ue([(0,i.Cb)()],De.prototype,"color",2),De=Ue([(0,i.Mo)("w3m-text")],De);const ze=n.iv`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var We=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,He=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Fe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&We(t,r,o),o};let qe=class extends n.oi{constructor(){super(...arguments),this.symbol=void 0}render(){var e;const t=J.getTokenIcon(null!=(e=this.symbol)?e:"");return t?n.dy`
${this.id}
`:j.TOKEN_PLACEHOLDER}};qe.styles=[g.globalCss,ze],He([(0,i.Cb)()],qe.prototype,"symbol",2),qe=He([(0,i.Mo)("w3m-token-image")],qe);const Ve=n.iv`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var Ge=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,Ze=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ke(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ge(t,r,o),o};let Qe=class extends n.oi{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?n.dy`RECENT`:this.installed?n.dy`INSTALLED`:null}handleClick(){o.uA.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return n.dy``}};Qe.styles=[g.globalCss,Ve],Ze([(0,i.Cb)()],Qe.prototype,"onClick",2),Ze([(0,i.Cb)()],Qe.prototype,"name",2),Ze([(0,i.Cb)()],Qe.prototype,"walletId",2),Ze([(0,i.Cb)()],Qe.prototype,"label",2),Ze([(0,i.Cb)()],Qe.prototype,"imageId",2),Ze([(0,i.Cb)()],Qe.prototype,"installed",2),Ze([(0,i.Cb)()],Qe.prototype,"recent",2),Qe=Ze([(0,i.Mo)("w3m-wallet-button")],Qe);const Ye=n.iv`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var Je=Object.defineProperty,Xe=Object.getOwnPropertyDescriptor,et=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Xe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Je(t,r,o),o};let tt=class extends n.oi{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=null!=(e=this.imageUrl)&&e.length?this.imageUrl:J.getWalletIcon({id:this.walletId,image_id:this.imageId});return n.dy`${t.length?n.dy`
${this.id}
`:j.WALLET_PLACEHOLDER}`}};tt.styles=[g.globalCss,Ye],et([(0,i.Cb)()],tt.prototype,"walletId",2),et([(0,i.Cb)()],tt.prototype,"imageId",2),et([(0,i.Cb)()],tt.prototype,"imageUrl",2),tt=et([(0,i.Mo)("w3m-wallet-image")],tt);Object.defineProperty,Object.getOwnPropertyDescriptor;let rt=class extends n.oi{constructor(){super(),this.unwatchAccount=void 0,o.AccountCtrl.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=o.Id.client().watchAccount((e=>{const{address:t,isConnected:r}=o.AccountCtrl.state;e.isConnected&&e.address!==t&&(this.fetchProfile(e.address),this.fetchBalance(e.address),o.AccountCtrl.setAddress(e.address)),e.isConnected||o.AccountCtrl.resetAccount(),r!==e.isConnected&&o.jb.close(),!r&&e.isConnected?o.uA.track({name:"ACCOUNT_CONNECTED"}):r&&!e.isConnected&&o.uA.track({name:"ACCOUNT_DISCONNECTED"}),o.AccountCtrl.setIsConnected(e.isConnected)}))}disconnectedCallback(){var e;null==(e=this.unwatchAccount)||e.call(this)}async fetchProfile(e){var t;const r=null==(t=o.OptionsCtrl.state.chains)?void 0:t.find((e=>1===e.id));if(o.ConfigCtrl.state.enableAccountView&&r)try{await o.AccountCtrl.fetchProfile(J.preloadImage,e)}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}}async fetchBalance(e){if(o.ConfigCtrl.state.enableAccountView)try{await o.AccountCtrl.fetchBalance(e)}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}}};rt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-account-context")],rt);var nt=Object.defineProperty,it=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?it(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&nt(t,r,o),o};let st=class extends n.oi{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{null!=e&&e.length&&await Promise.all(e.map((async e=>J.preloadImage(e))))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){var e;if(o.ConfigCtrl.state.enableExplorer){const{chains:t}=o.OptionsCtrl.state;await Promise.all([o.ExplorerCtrl.getRecomendedWallets(),o.ExplorerCtrl.getInjectedWallets()]),o.OptionsCtrl.setIsDataLoaded(!0);const{recomendedWallets:r}=o.ExplorerCtrl.state,n=Y.installedInjectedWallets(),i=null!=(e=t?.map((e=>J.getChainIcon(e.id))))?e:[],s=r.map((e=>J.getWalletIcon(e))),a=n.map((e=>J.getWalletIcon(e)));await this.loadImages([...i,...s,...a])}else o.OptionsCtrl.setIsDataLoaded(!0)}async preloadCustomImages(){const e=J.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),o.ToastCtrl.openToast("Failed preloading","error")}}};ot([(0,i.SB)()],st.prototype,"preload",2),st=ot([(0,i.Mo)("w3m-explorer-context")],st);var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ct(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&at(t,r,o),o};let ut=class extends n.oi{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const e=o.OptionsCtrl.getSelectedChain();this.activeChainId=e?.id,this.unwatchNetwork=o.Id.client().watchNetwork((e=>{const t=e.chain;t&&this.activeChainId!==t.id&&(o.OptionsCtrl.setSelectedChain(t),this.activeChainId=t.id,o.AccountCtrl.resetBalance(),this.fetchBalance())}))}disconnectedCallback(){var e;null==(e=this.unwatchNetwork)||e.call(this)}async fetchBalance(){if(o.ConfigCtrl.state.enableAccountView)try{await o.AccountCtrl.fetchBalance()}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}}};lt([(0,i.SB)()],ut.prototype,"activeChainId",2),ut=lt([(0,i.Mo)("w3m-network-context")],ut);Object.defineProperty,Object.getOwnPropertyDescriptor;let ht=class extends n.oi{constructor(){super(),this.unsubscribeTheme=void 0,g.setTheme(),this.unsubscribeTheme=o.ThemeCtrl.subscribe(g.setTheme),this.preloadThemeImages()}disconnectedCallback(){var e;null==(e=this.unsubscribeTheme)||e.call(this)}async preloadThemeImages(){try{const{themeVariables:e}=o.ThemeCtrl.state,t=[e?.["--w3m-background-image-url"],e?.["--w3m-logo-image-url"]].filter(Boolean);t.length&&await Promise.all(t.map((async e=>J.preloadImage(e))))}catch{console.info("Unsuccessful attempt at preloading some images")}}};ht=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-theme-context")],ht);var dt;Object.defineProperty,Object.getOwnPropertyDescriptor;let pt=class extends n.oi{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.unwatchWcConnection=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=null==(dt=o.OptionsCtrl.state.selectedChain)?void 0:dt.id,this.isAccountConnected=o.AccountCtrl.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=o.OptionsCtrl.subscribe((e=>{var t,r;(null==(t=e.selectedChain)?void 0:t.id)!==this.selectedChainId&&(this.selectedChainId=null==(r=e.selectedChain)?void 0:r.id,this.connectAndWait())})),this.unwatchAccount=o.AccountCtrl.subscribe((e=>{(this.isAccountConnected!==e.isConnected||!this.isGenerated)&&(this.isAccountConnected=e.isConnected,this.connectAndWait())})),this.unwatchWcConnection=o.WcConnectionCtrl.subscribe((e=>{e.pairingEnabled&&!this.isGenerated&&this.connectAndWait()}))}disconnectedCallback(){var e,t,r;null==(e=this.unwatchOptions)||e.call(this),null==(t=this.unwatchAccount)||t.call(this),null==(r=this.unwatchWcConnection)||r.call(this)}async connectAndWait(){const{pairingEnabled:e}=o.WcConnectionCtrl.state;if(clearTimeout(this.timeout),!this.isAccountConnected&&e){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),24e4);try{const{selectedChain:e}=o.OptionsCtrl.state;await o.Id.client().connectWalletConnect((e=>o.WcConnectionCtrl.setPairingUri(e)),e?.id)}catch(e){console.error(e),o.WcConnectionCtrl.setPairingError(!0),o.ToastCtrl.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=1e3&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};pt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-wc-connection-context")],pt);const ft=n.iv`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var mt=Object.defineProperty,gt=Object.getOwnPropertyDescriptor,wt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?gt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&mt(t,r,o),o};let bt=class extends n.oi{constructor(){super(),this.balance="hide",this.avatar="show"}onOpen(){o.uA.click({name:"ACCOUNT_BUTTON"}),o.jb.open({route:"Account"})}accountTemplate(){const e="show"===this.avatar;return n.dy`${e?n.dy``:null}`}render(){const e="show"===this.balance,t={"w3m-no-avatar":"hide"===this.avatar};return e?n.dy`
`:n.dy`${this.accountTemplate()}`}};bt.styles=[g.globalCss,ft],wt([(0,i.Cb)()],bt.prototype,"balance",2),wt([(0,i.Cb)()],bt.prototype,"avatar",2),bt=wt([(0,i.Mo)("w3m-account-button")],bt);const vt=n.iv`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var yt=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,At=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?xt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&yt(t,r,o),o};let Ct=class extends n.oi{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:e}=o.OptionsCtrl.state;this.chainId=e?.id,this.label=e?.name,this.unsubscribeNetwork=o.OptionsCtrl.subscribe((({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name}))}disconnectedCallback(){var e;null==(e=this.unsubscribeNetwork)||e.call(this)}onClick(){o.AV.push("SelectNetwork")}render(){const{chains:e,selectedChain:t}=o.OptionsCtrl.state,r=e?.map((e=>e.id)),i=t&&r?.includes(t.id),s=e&&e.length<=1&&i;return n.dy``}};Ct.styles=[g.globalCss,vt],At([(0,i.SB)()],Ct.prototype,"chainId",2),At([(0,i.SB)()],Ct.prototype,"label",2),Ct=At([(0,i.Mo)("w3m-account-network-button")],Ct);const Et=n.iv`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var It=Object.defineProperty,_t=Object.getOwnPropertyDescriptor,Pt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?_t(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&It(t,r,o),o};let Ot=class extends n.oi{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=o.AccountCtrl.state.address,this.name=o.AccountCtrl.state.profileName,this.loading=Boolean(o.AccountCtrl.state.profileLoading),this.unsubscribeAccount=o.AccountCtrl.subscribe((({address:e,profileName:t,profileLoading:r})=>{this.address=e,this.name=t,this.loading=Boolean(r)}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){var e;const t="button"===this.variant,r={"w3m-loading":this.loading};return n.dy`${this.name?this.name:J.truncate(null!=(e=this.address)?e:"")}`}};Ot.styles=[g.globalCss,Et],Pt([(0,i.SB)()],Ot.prototype,"address",2),Pt([(0,i.SB)()],Ot.prototype,"name",2),Pt([(0,i.SB)()],Ot.prototype,"loading",2),Pt([(0,i.Cb)()],Ot.prototype,"variant",2),Ot=Pt([(0,i.Mo)("w3m-address-text")],Ot);const St={onConnecting(e){J.goToConnectingView(e)},onExternal(e){J.handleConnectorConnection(e)},manualWalletsTemplate(){return Y.manualWallets().map((e=>n.dy``))},recomendedWalletsTemplate(e=!1){return Y.recomendedWallets(e).map((e=>n.dy``))},externalWalletsTemplate(){return Y.externalWallets().map((e=>n.dy``))},recentWalletTemplate(){const e=Y.recentWallet();if(e)return n.dy``},installedInjectedWalletsTemplate(){return Y.installedInjectedWallets().map((e=>n.dy``))},injectedWalletsTemplate(){return Y.injectedWallets().map((e=>n.dy``))}},kt=n.iv`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Mt=class extends n.oi{onGoToQrcode(){o.AV.push("Qrcode")}onGetWallet(){o.AV.push("GetWallet")}render(){const{recomendedWallets:e}=o.ExplorerCtrl.state,t=[...e,...e],r=St.externalWalletsTemplate(),i=St.installedInjectedWalletsTemplate(),s=[...i,...r].length>0,a=2*o.zv.RECOMMENDED_WALLET_AMOUNT;return n.dy`
${j.MOBILE_ICON}WalletConnect
${[...Array(a)].map(((e,r)=>{const i=t[r%t.length];return i?n.dy``:j.WALLET_PLACEHOLDER}))}
Select Wallet
${s?n.dy`
${j.WALLET_ICON}Other
${i} ${r}
`:null}${"Choose WalletConnect to see supported apps on your device"+(s?", or select from other options":"")}I don't have a wallet`}};Mt.styles=[g.globalCss,kt],Mt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-android-wallet-selection")],Mt);const Tt=n.iv`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var Nt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,Rt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?jt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Nt(t,r,o),o};let Lt=class extends n.oi{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=o.AccountCtrl.state.address,this.avatar=o.AccountCtrl.state.profileAvatar,this.loading=Boolean(o.AccountCtrl.state.profileLoading),this.unsubscribeAccount=o.AccountCtrl.subscribe((({address:e,profileAvatar:t,profileLoading:r})=>{this.address=e,this.avatar=t,this.loading=Boolean(r)}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){const e={"w3m-placeholder":!0,"w3m-small":"small"===this.size,"w3m-medium":"medium"===this.size};return this.avatar?n.dy``:this.address?(J.generateAvatarColors(this.address),n.dy`
${this.loading?n.dy`
`:null}
`):null}};Lt.styles=[g.globalCss,Tt],Rt([(0,i.SB)()],Lt.prototype,"address",2),Rt([(0,i.SB)()],Lt.prototype,"avatar",2),Rt([(0,i.SB)()],Lt.prototype,"loading",2),Rt([(0,i.Cb)()],Lt.prototype,"size",2),Lt=Rt([(0,i.Mo)("w3m-avatar")],Lt);const Bt=n.iv`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var $t=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Dt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ut(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&$t(t,r,o),o};let zt=class extends n.oi{constructor(){var e,t;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=null==(e=o.AccountCtrl.state.balance)?void 0:e.symbol,this.amount=null==(t=o.AccountCtrl.state.balance)?void 0:t.amount,this.unsubscribeAccount=o.AccountCtrl.subscribe((({balance:e})=>{this.symbol=e?.symbol,this.amount=e?.amount}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){let e="_._";return"0.0"===this.amount?e="0":"string"==typeof this.amount&&this.amount.length>6?e=this.amount.substring(0,6):"string"==typeof this.amount&&(e=this.amount),n.dy`
${e} ${this.symbol}
`}};zt.styles=[g.globalCss,Bt],Dt([(0,i.SB)()],zt.prototype,"symbol",2),Dt([(0,i.SB)()],zt.prototype,"amount",2),zt=Dt([(0,i.Mo)("w3m-balance")],zt);const Wt=n.iv`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var Ft=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,qt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ht(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ft(t,r,o),o};let Vt=class extends n.oi{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,this.modalUnsub=o.jb.subscribe((e=>{e.open&&(this.loading=!0),e.open||(this.loading=!1)}))}disconnectedCallback(){var e;null==(e=this.modalUnsub)||e.call(this)}iconTemplate(){return"show"===this.icon?j.WALLET_CONNECT_ICON:null}onClick(){o.AccountCtrl.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,o.uA.click({name:"CONNECT_BUTTON"}),await o.jb.open(),o.jb.state.open||(this.loading=!1)}async onDisconnect(){o.uA.click({name:"DISCONNECT_BUTTON"}),await o.Id.client().disconnect()}render(){return n.dy`${this.loading?n.dy`Connecting...`:n.dy`${this.iconTemplate()}${this.label}`}`}};Vt.styles=[g.globalCss,Wt],qt([(0,i.SB)()],Vt.prototype,"loading",2),qt([(0,i.Cb)()],Vt.prototype,"label",2),qt([(0,i.Cb)()],Vt.prototype,"icon",2),Vt=qt([(0,i.Mo)("w3m-connect-button")],Vt);const Gt=n.iv`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var Kt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Qt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Zt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Kt(t,r,o),o};let Yt=class extends n.oi{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=null!=(t=null==(e=o.ThemeCtrl.state.themeVariables)?void 0:e["--w3m-wallet-icon-large-border-radius"])?t:g.getPreset("--w3m-wallet-icon-large-border-radius");let i=0;i=r.includes("%")?.88*parseInt(r,10):parseInt(r,10),i*=1.17;const s=317-1.57*i,a=425-1.8*i;return n.dy``}render(){const e={"w3m-error":this.isError,"w3m-stale":this.isStale};return n.dy`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};Yt.styles=[g.globalCss,Gt],Qt([(0,i.Cb)()],Yt.prototype,"walletId",2),Qt([(0,i.Cb)()],Yt.prototype,"imageId",2),Qt([(0,i.Cb)()],Yt.prototype,"isError",2),Qt([(0,i.Cb)()],Yt.prototype,"isStale",2),Qt([(0,i.Cb)()],Yt.prototype,"label",2),Yt=Qt([(0,i.Mo)("w3m-connector-waiting")],Yt);var Jt=Object.defineProperty,Xt=Object.getOwnPropertyDescriptor,er=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Xt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Jt(t,r,o),o};let tr=class extends n.oi{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,this.isConnected=o.AccountCtrl.state.isConnected,this.unsubscribeAccount=o.AccountCtrl.subscribe((({isConnected:e})=>{this.isConnected=e}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){const{enableAccountView:e}=o.ConfigCtrl.state,t=this.balance,r=this.label,i=this.icon,s=this.avatar;return this.isConnected&&e?n.dy``:n.dy``}};er([(0,i.SB)()],tr.prototype,"isConnected",2),er([(0,i.Cb)()],tr.prototype,"label",2),er([(0,i.Cb)()],tr.prototype,"icon",2),er([(0,i.Cb)()],tr.prototype,"avatar",2),er([(0,i.Cb)()],tr.prototype,"balance",2),tr=er([(0,i.Mo)("w3m-core-button")],tr);const rr=n.iv`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let nr=class extends n.oi{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=o.ConfigCtrl.state,r="ALL"!==e&&t,i=St.manualWalletsTemplate(),s=St.recomendedWalletsTemplate(),a=St.externalWalletsTemplate(),c=St.recentWalletTemplate();let l=[...St.installedInjectedWalletsTemplate(),c,...a,...i,...s];l=l.filter(Boolean);const u=l.length>4||r;let h=[];h=u?l.slice(0,3):l;const d=Boolean(h.length);return n.dy`
${j.MOBILE_ICON}Mobile
${j.SCAN_ICON}Scan with your wallet
${d?n.dy`
${j.DESKTOP_ICON}Desktop
${h} ${u?n.dy``:null}
`:null}`}};nr.styles=[g.globalCss,rr],nr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-desktop-wallet-selection")],nr);const ir=n.iv`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let or=class extends n.oi{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=o.ConfigCtrl.state;return e??t?n.dy`
By connecting your wallet to this app, you agree to the app's ${e?n.dy`Terms of Service`:null} ${e&&t?"and":null} ${t?n.dy`Privacy Policy`:null}
`:null}};or.styles=[g.globalCss,ir],or=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-legal-notice")],or);const sr=n.iv`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let ar=class extends n.oi{onQrcode(){o.AV.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=o.ConfigCtrl.state,r="ALL"!==e&&t,i=St.manualWalletsTemplate(),s=St.recomendedWalletsTemplate(),a=St.externalWalletsTemplate(),c=St.recentWalletTemplate();let l=[...St.installedInjectedWalletsTemplate(),c,...a,...i,...s];l=l.filter(Boolean);const u=l.length>8||r;let h=[];h=u?l.slice(0,7):l;const d=Boolean(h.length);return n.dy`${d?n.dy`
${h} ${u?n.dy``:null}
`:null}`}};ar.styles=[g.globalCss,sr],ar=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-mobile-wallet-selection")],ar);const cr=n.iv`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--w3m-overlay-background-color);backdrop-filter:var(--w3m-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var lr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,hr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ur(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&lr(t,r,o),o};let dr=class extends n.oi{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=o.jb.subscribe((e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()}))}disconnectedCallback(){var e;null==(e=this.unsubscribeModal)||e.call(this)}get overlayEl(){return J.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return J.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(e){if(document.querySelector("body"))if(e){const e=document.getElementById("w3m-styles");e?.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(e){e.target===e.currentTarget&&o.jb.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout((async()=>{const e=J.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[0,1]},{delay:.1,duration:.2}).finished,(0,c.j)(this.containerEl,e,{delay:.1,duration:.2}).finished]),this.active=!0}),0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=J.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished,(0,c.j)(this.containerEl,e,{duration:.2}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",(e=>{var t;"Escape"===e.key?o.jb.close():"Tab"===e.key&&(null!=(t=e.target)&&t.tagName.includes("W3M-")||this.containerEl.focus())}),this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;null==(e=this.abortController)||e.abort(),this.abortController=void 0}render(){const e={"w3m-overlay":!0,"w3m-active":this.active};return n.dy`
${this.open?n.dy`
`:null}
`}};dr.styles=[g.globalCss,cr],hr([(0,i.SB)()],dr.prototype,"open",2),hr([(0,i.SB)()],dr.prototype,"active",2),dr=hr([(0,i.Mo)("w3m-modal")],dr);const pr=n.iv`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var fr=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,gr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?mr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&fr(t,r,o),o};let wr=class extends n.oi{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0;const{selectedChain:e}=o.OptionsCtrl.state;this.onSetChainData(e),this.unsubscribeNetwork=o.OptionsCtrl.subscribe((({selectedChain:e})=>{this.onSetChainData(e)}))}disconnectedCallback(){var e;null==(e=this.unsubscribeNetwork)||e.call(this)}onSetChainData(e){if(e){const{chains:t}=o.OptionsCtrl.state,r=t?.map((e=>e.id));this.chainId=e.id.toString(),this.wrongNetwork=!(null!=r&&r.includes(e.id)),this.label=this.wrongNetwork?"Wrong Network":e.name}}onClick(){o.uA.click({name:"NETWORK_BUTTON"}),o.jb.open({route:"SelectNetwork"})}render(){var e;const{chains:t}=o.OptionsCtrl.state,r=t&&t.length>1;return n.dy`${null!=(e=this.label)&&e.length?this.label:"Select Network"}`}};wr.styles=[g.globalCss,pr],gr([(0,i.SB)()],wr.prototype,"chainId",2),gr([(0,i.SB)()],wr.prototype,"label",2),gr([(0,i.SB)()],wr.prototype,"wrongNetwork",2),wr=gr([(0,i.Mo)("w3m-network-switch")],wr);const br=n.iv`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var vr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,xr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?yr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&vr(t,r,o),o};let Ar=class extends n.oi{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return n.dy``}render(){const e={"w3m-error":this.isError};return n.dy`
${this.svgLoaderTemplate()}
${this.isError?"Switch declined":this.label}`}};Ar.styles=[g.globalCss,br],xr([(0,i.Cb)()],Ar.prototype,"chainId",2),xr([(0,i.Cb)()],Ar.prototype,"isError",2),xr([(0,i.Cb)()],Ar.prototype,"label",2),Ar=xr([(0,i.Mo)("w3m-network-waiting")],Ar);const Cr=n.iv`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var Er=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,_r=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ir(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Er(t,r,o),o};let Pr=class extends n.oi{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){o.zv.isMobile()?o.AV.replace("MobileConnecting"):o.AV.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?o.AV.replace("InjectedConnecting"):o.AV.replace("InstallWallet")}onDesktop(){o.AV.replace("DesktopConnecting")}onWeb(){o.AV.replace("WebConnecting")}render(){return n.dy`
${this.isRetry?n.dy``:null} ${this.isMobile?n.dy`Mobile`:null} ${this.isInjected?n.dy`Browser`:null} ${this.isDesktop?n.dy`Desktop`:null} ${this.isWeb?n.dy`Web`:null}
`}};Pr.styles=[g.globalCss,Cr],_r([(0,i.Cb)()],Pr.prototype,"isMobile",2),_r([(0,i.Cb)()],Pr.prototype,"isInjected",2),_r([(0,i.Cb)()],Pr.prototype,"isInjectedInstalled",2),_r([(0,i.Cb)()],Pr.prototype,"isDesktop",2),_r([(0,i.Cb)()],Pr.prototype,"isWeb",2),_r([(0,i.Cb)()],Pr.prototype,"isRetry",2),Pr=_r([(0,i.Mo)("w3m-platform-selection")],Pr);const Or=n.iv`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Sr=class extends n.oi{onClick(){o.AV.push("WalletExplorer")}render(){const{recomendedWallets:e}=o.ExplorerCtrl.state,t=[...e,...Y.manualWallets()].reverse().slice(0,4);return n.dy``}};Sr.styles=[g.globalCss,Or],Sr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-view-all-wallets-button")],Sr);const kr=n.iv`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var Mr=Object.defineProperty,Tr=Object.getOwnPropertyDescriptor,Nr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Tr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Mr(t,r,o),o};let jr=class extends n.oi{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout((()=>{const{pairingUri:e}=o.WcConnectionCtrl.state;this.uri=e}),0),this.unwatchWcConnection=o.WcConnectionCtrl.subscribe((e=>{e.pairingUri&&(this.uri=e.pairingUri)}))}disconnectedCallback(){var e;null==(e=this.unwatchWcConnection)||e.call(this)}get overlayEl(){return J.getShadowRootElement(this,".w3m-qr-container")}render(){return n.dy`
${this.uri?n.dy``:n.dy``}
`}};jr.styles=[g.globalCss,kr],Nr([(0,i.Cb)()],jr.prototype,"walletId",2),Nr([(0,i.Cb)()],jr.prototype,"imageId",2),Nr([(0,i.SB)()],jr.prototype,"uri",2),jr=Nr([(0,i.Mo)("w3m-walletconnect-qr")],jr);const Rr=n.iv`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var Lr=Object.defineProperty,Br=Object.getOwnPropertyDescriptor,$r=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Br(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Lr(t,r,o),o};let Ur=class extends n.oi{constructor(){super(...arguments),this.loading=!1}async onDisconnect(){this.loading||(this.loading=!0,await o.Id.client().disconnect(),this.loading=!1)}async onCopyAddress(){var e;try{await navigator.clipboard.writeText(null!=(e=o.AccountCtrl.state.address)?e:""),o.ToastCtrl.openToast("Address copied","success")}catch{o.ToastCtrl.openToast("Failed to copy","error")}}render(){return n.dy`
Connected
`}};Ur.styles=[g.globalCss,Rr],$r([(0,i.SB)()],Ur.prototype,"loading",2),Ur=$r([(0,i.Mo)("w3m-account-view")],Ur);Object.defineProperty,Object.getOwnPropertyDescriptor;let Dr=class extends n.oi{viewTemplate(){return o.zv.isAndroid()?n.dy``:o.zv.isMobile()?n.dy``:n.dy``}render(){return n.dy`${this.viewTemplate()}`}};Dr.styles=[g.globalCss],Dr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-connect-wallet-view")],Dr);const zr=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var Wr=Object.defineProperty,Fr=Object.getOwnPropertyDescriptor,Hr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Fr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Wr(t,r,o),o};let qr=class extends n.oi{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=o.WcConnectionCtrl.subscribe((e=>{this.isError=e.pairingError}))}disconnectedCallback(){var e;null==(e=this.unwatchConnection)||e.call(this)}onFormatAndRedirect(e){const{desktop:t,name:r}=o.zv.getWalletRouterData(),n=t?.native;if(n){const t=o.zv.formatNativeUrl(n,e,r);o.zv.openHref(t,"_self")}}openDesktopApp(){o.WcConnectionCtrl.setPairingError(!1);const{pairingUri:e}=o.WcConnectionCtrl.state,t=o.zv.getWalletRouterData();J.setRecentWallet(t),this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isMobile:i,isInjected:s,isWeb:a}=J.getCachedRouterWalletPlatforms();return n.dy`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};qr.styles=[g.globalCss,zr],Hr([(0,i.SB)()],qr.prototype,"isError",2),qr=Hr([(0,i.Mo)("w3m-desktop-connecting-view")],qr);const Vr=n.iv`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Gr=class extends n.oi{onGet(e){o.zv.openHref(e,"_blank")}render(){const e=o.ExplorerCtrl.state.recomendedWallets.slice(0,5),t=Y.manualWallets().slice(0,5),r=e.length,i=t.length;return n.dy`${r?e.map((e=>n.dy`
${e.name}Get
`)):null} ${i?t.map((e=>n.dy`
${e.name}Get
`)):null}
`}};Gr.styles=[g.globalCss,Vr],Gr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-get-wallet-view")],Gr);const Kr=n.iv`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Zr=class extends n.oi{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){o.ConfigCtrl.state.enableExplorer?o.AV.push("GetWallet"):J.openWalletExplorerUrl()}onLearnMore(){o.zv.openHref(this.learnUrl,"_blank")}render(){return n.dy`
${j.HELP_CHART_IMG} ${j.HELP_PAINTING_IMG} ${j.HELP_ETH_IMG}
A home for your digital assetsA wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.
${j.HELP_KEY_IMG} ${j.HELP_USER_IMG} ${j.HELP_LOCK_IMG}
One login for all of web3Log in to any app by connecting your wallet. Say goodbye to countless passwords!
${j.HELP_COMPAS_IMG} ${j.HELP_NOUN_IMG} ${j.HELP_DAO_IMG}
Your gateway to a new webWith your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.
`}};Zr.styles=[g.globalCss,Kr],Zr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-help-view")],Zr);const Qr=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var Yr=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Xr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Jr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Yr(t,r,o),o};let en=class extends n.oi{constructor(){super(),this.isError=!1,this.connector=o.Id.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:e}=this.connector;e&&(this.isError=!1,await J.handleConnectorConnection("injected",(()=>{this.isError=!0})))}render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isMobile:i,isDesktop:s,isWeb:a}=J.getCachedRouterWalletPlatforms();return n.dy`Connection can be declined if multiple wallets are installed or previous request is still activeRetry`}};en.styles=[g.globalCss,Qr],Xr([(0,i.SB)()],en.prototype,"isError",2),en=Xr([(0,i.Mo)("w3m-injected-connecting-view")],en);const tn=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let rn=class extends n.oi{onInstall(e){e&&o.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:i}=o.zv.getWalletRouterData();return n.dy`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};rn.styles=[g.globalCss,tn],rn=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-install-wallet-view")],rn);const nn=n.iv`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var on=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,an=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?sn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&on(t,r,o),o};let cn=class extends n.oi{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=o.WcConnectionCtrl.subscribe((e=>{this.isError=e.pairingError}))}disconnectedCallback(){var e;null==(e=this.unwatchConnection)||e.call(this)}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=o.zv.getWalletRouterData(),i=r?.native,s=r?.universal;if(i&&!t){const t=o.zv.formatNativeUrl(i,e,n);o.zv.openHref(t,"_self")}else if(s){const t=o.zv.formatUniversalUrl(s,e,n);o.zv.openHref(t,"_self")}}openMobileApp(e=!1){o.WcConnectionCtrl.setPairingError(!1);const{pairingUri:t}=o.WcConnectionCtrl.state,r=o.zv.getWalletRouterData();J.setRecentWallet(r),this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&o.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:i,mobile:s}=o.zv.getWalletRouterData(),{isWeb:a}=J.getCachedRouterWalletPlatforms(),c=i?.ios,l=s?.universal;return n.dy`Retry${l?n.dy`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};cn.styles=[g.globalCss,nn],an([(0,i.SB)()],cn.prototype,"isError",2),cn=an([(0,i.Mo)("w3m-mobile-connecting-view")],cn);const ln=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let un=class extends n.oi{render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isInjected:i,isDesktop:s,isWeb:a}=J.getCachedRouterWalletPlatforms();return n.dy`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};un.styles=[g.globalCss,ln],un=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-mobile-qr-connecting-view")],un);Object.defineProperty,Object.getOwnPropertyDescriptor;let hn=class extends n.oi{render(){return n.dy``}};hn.styles=[g.globalCss],hn=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-qrcode-view")],hn);const dn=n.iv`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var pn=Object.defineProperty,fn=Object.defineProperties,mn=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,wn=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,yn=(e,t,r)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xn=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?mn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&pn(t,r,o),o};let An=class extends n.oi{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await o.Id.client().getConnectedChainIds()}async onSelectChain(e){try{const{selectedChain:t,isPreferInjected:r}=o.OptionsCtrl.state,{isConnected:n}=o.AccountCtrl.state;n?t?.id===e.id?o.AV.reset("Account"):'"walletConnect"'===J.getWagmiWalletType()?(await o.Id.client().switchNetwork({chainId:e.id}),o.AV.reset("Account")):o.AV.push("SwitchNetwork",{SwitchNetwork:e}):r?(o.OptionsCtrl.setSelectedChain(e),o.jb.close()):(o.OptionsCtrl.setSelectedChain(e),o.AV.push("ConnectWallet"))}catch(e){console.error(e),o.ToastCtrl.openToast("Unsupported chain","error")}}isUnsuportedChainId(e){return("string"==typeof this.connectedChains&&"ALL"!==this.connectedChains||!(!Array.isArray(this.connectedChains)||this.connectedChains.includes(String(e))))&&(this.isUnsupportedChains=!0,!0)}render(){const{chains:e}=o.OptionsCtrl.state,t=e?.map((e=>((e,t)=>fn(e,gn(t)))(((e,t)=>{for(var r in t||(t={}))bn.call(t,r)&&yn(e,r,t[r]);if(wn)for(var r of wn(t))vn.call(t,r)&&yn(e,r,t[r]);return e})({},e),{unsupported:this.isUnsuportedChainId(e.id)}))),r=t?.sort(((e,t)=>Number(e.unsupported)-Number(t.unsupported)));return n.dy`
${r?.map((e=>n.dy`${e.name}`))}
${this.isUnsupportedChains?n.dy`Your connected wallet may not support some of the networks available for this dapp`:null}`}};An.styles=[g.globalCss,dn],xn([(0,i.SB)()],An.prototype,"connectedChains",2),xn([(0,i.SB)()],An.prototype,"isUnsupportedChains",2),An=xn([(0,i.Mo)("w3m-select-network-view")],An);const Cn=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var En=Object.defineProperty,In=Object.getOwnPropertyDescriptor,_n=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?In(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&En(t,r,o),o};let Pn=class extends n.oi{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const e=o.zv.getSwitchNetworkRouterData();await o.Id.client().switchNetwork({chainId:e.id}),o.OptionsCtrl.setSelectedChain(e),o.AV.reset("Account")}catch{this.isError=!0}}render(){const{id:e,name:t}=o.zv.getSwitchNetworkRouterData();return n.dy`Switch can be declined if chain is not supported by a wallet or previous request is still activeTry Again`}};Pn.styles=[g.globalCss,Cn],_n([(0,i.SB)()],Pn.prototype,"isError",2),Pn=_n([(0,i.Mo)("w3m-switch-network-view")],Pn);const On=n.iv`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var Sn=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,Mn=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?kn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Sn(t,r,o),o};let Tn=class extends n.oi{constructor(){super(...arguments),this.loading=!o.ExplorerCtrl.state.wallets.listings.length,this.firstFetch=!o.ExplorerCtrl.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=J.debounce((e=>{e.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=e,o.ExplorerCtrl.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),o.ExplorerCtrl.resetSearch())}))}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;null==(e=this.intersectionObserver)||e.disconnect()}get placeholderEl(){return J.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver((([e])=>{e.isIntersecting&&(!this.search||!this.firstFetch)&&this.fetchWallets()})),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=o.ExplorerCtrl.state,{listings:r,total:n}=this.search?t:e;return n<=40||r.length>=n}async fetchWallets(){const{wallets:e,search:t,injectedWallets:r}=o.ExplorerCtrl.state,{listings:n,total:i,page:s}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>40&&n.lengthJ.getWalletIcon(e))),n=r.map((e=>J.getWalletIcon(e)));await Promise.all([...t.map((async e=>J.preloadImage(e))),...n.map((async e=>J.preloadImage(e))),o.zv.wait(300)]),this.endReached=this.isLastPage()}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){o.zv.isAndroid()?J.handleMobileLinking(e):J.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=o.ExplorerCtrl.state,{listings:r}=this.search?t:e,i=this.loading&&!r.length,a=this.search.length>=3;let c=St.injectedWalletsTemplate(),l=St.manualWalletsTemplate(),u=St.recomendedWalletsTemplate(!0);a&&(c=c.filter((({values:e})=>J.caseSafeIncludes(e[0],this.search))),l=l.filter((({values:e})=>J.caseSafeIncludes(e[0],this.search))),u=u.filter((({values:e})=>J.caseSafeIncludes(e[0],this.search)))),c=c.filter((e=>!u.find((t=>J.caseSafeIncludes(e.values[0],t.values[0])))));const h=!(this.loading||r.length||c.length||u.length),d=Math.max(c.length,r.length),p={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return n.dy`
${i?null:u} ${i?null:[...Array(d)].map(((e,t)=>n.dy`${l[t]} ${c[t]} ${r[t]?n.dy``:null}`))}
${h?n.dy`No results found`:null} ${!h&&this.loading?n.dy``:null}
`}};Tn.styles=[g.globalCss,On],Mn([(0,i.SB)()],Tn.prototype,"loading",2),Mn([(0,i.SB)()],Tn.prototype,"firstFetch",2),Mn([(0,i.SB)()],Tn.prototype,"search",2),Mn([(0,i.SB)()],Tn.prototype,"endReached",2),Tn=Mn([(0,i.Mo)("w3m-wallet-explorer-view")],Tn);const Nn=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var jn=Object.defineProperty,Rn=Object.getOwnPropertyDescriptor,Ln=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Rn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&jn(t,r,o),o};let Bn=class extends n.oi{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=o.WcConnectionCtrl.subscribe((e=>{this.isError=e.pairingError}))}disconnectedCallback(){var e;null==(e=this.unwatchConnection)||e.call(this)}onFormatAndRedirect(e){const{desktop:t,name:r}=o.zv.getWalletRouterData(),n=t?.universal;if(n){const t=o.zv.formatUniversalUrl(n,e,r);o.zv.openHref(t,"_blank")}}openWebWallet(){o.WcConnectionCtrl.setPairingError(!1);const{pairingUri:e}=o.WcConnectionCtrl.state,t=o.zv.getWalletRouterData();J.setRecentWallet(t),this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isMobile:i,isInjected:s,isDesktop:a}=J.getCachedRouterWalletPlatforms(),c=o.zv.isMobile();return n.dy`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};Bn.styles=[g.globalCss,Nn],Ln([(0,i.SB)()],Bn.prototype,"isError",2),Bn=Ln([(0,i.Mo)("w3m-web-connecting-view")],Bn)},3692:(e,t,r)=>{"use strict";var n;r.d(t,{Jb:()=>_,Ld:()=>P,YP:()=>I,dy:()=>E,sY:()=>W});const i=window,o=i.trustedTypes,s=o?o.createPolicy("lit-html",{createHTML:e=>e}):void 0,a="$lit$",c=`lit$${(Math.random()+"").slice(9)}$`,l="?"+c,u=`<${l}>`,h=document,d=()=>h.createComment(""),p=e=>null===e||"object"!=typeof e&&"function"!=typeof e,f=Array.isArray,m="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,w=/-->/g,b=/>/g,v=RegExp(`>|${m}(?:([^\\s"'>=/]+)(${m}*=${m}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),y=/'/g,x=/"/g,A=/^(?:script|style|textarea|title)$/i,C=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),E=C(1),I=C(2),_=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),O=new WeakMap,S=h.createTreeWalker(h,129,null,!1),k=(e,t)=>{const r=e.length-1,n=[];let i,o=2===t?"":"",l=g;for(let t=0;t"===h[0]?(l=null!=i?i:g,d=-1):void 0===h[1]?d=-2:(d=l.lastIndex-h[2].length,s=h[1],l=void 0===h[3]?v:'"'===h[3]?x:y):l===x||l===y?l=v:l===w||l===b?l=g:(l=v,i=void 0);const f=l===v&&e[t+1].startsWith("/>")?" ":"";o+=l===g?r+u:d>=0?(n.push(s),r.slice(0,d)+a+r.slice(d)+c+f):r+c+(-2===d?(n.push(void 0),t):f)}const h=o+(e[r]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==s?s.createHTML(h):h,n]};class M{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,s=0;const u=e.length-1,h=this.parts,[p,f]=k(e,t);if(this.el=M.createElement(p,r),S.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=S.nextNode())&&h.length0){n.textContent=o?o.emptyScript:"";for(let r=0;rf(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==P&&p(this._$AH)?this._$AA.nextSibling.data=e:this.$(h.createTextNode(e)),this._$AH=e}g(e){var t;const{values:r,_$litType$:n}=e,i="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=M.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===i)this._$AH.v(r);else{const e=new N(i,this),t=e.u(this.options);e.v(r),this.$(t),this._$AH=e}}_$AC(e){let t=O.get(e.strings);return void 0===t&&O.set(e.strings,t=new M(e)),t}T(e){f(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const i of e)n===t.length?t.push(r=new j(this.k(d()),this.k(d()),this,this.options)):r=t[n],r._$AI(i),n++;n2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=P}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){const i=this.strings;let o=!1;if(void 0===i)e=T(this,e,t,0),o=!p(e)||e!==this._$AH&&e!==_,o&&(this._$AH=e);else{const n=e;let s,a;for(e=i[0],s=0;s{var n,i;const o=null!==(n=null==r?void 0:r.renderBefore)&&void 0!==n?n:t;let s=o._$litPart$;if(void 0===s){const e=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:null;o._$litPart$=s=new j(t.insertBefore(d(),e),e,void 0,null!=r?r:{})}return s._$AI(e),s}},7408:(e,t,r)=>{"use strict";r.d(t,{Mo:()=>n,Cb:()=>s,SB:()=>a});const n=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:r,elements:n}=t;return{kind:r,elements:n,finisher(t){customElements.define(e,t)}}})(e,t),i=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(r){r.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(r){r.createProperty(t.key,e)}},o=(e,t,r)=>{t.constructor.createProperty(r,e)};function s(e){return(t,r)=>void 0!==r?o(e,t,r):i(e,t)}function a(e){return s({...e,state:!0})}var c;null===(c=window.HTMLSlotElement)||void 0===c||c.prototype.assignedElements},623:(e,t,r)=>{"use strict";r.d(t,{$:()=>o});var n=r(3692);class i{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const o=(s=class extends i{constructor(e){var t;if(super(e),1!==e.type||"class"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){var r,i;if(void 0===this.it){this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!(null===(r=this.nt)||void 0===r?void 0:r.has(e))&&this.it.add(e);return this.render(t)}const o=e.element.classList;this.it.forEach((e=>{e in t||(o.remove(e),this.it.delete(e))}));for(const e in t){const r=!!t[e];r===this.it.has(e)||(null===(i=this.nt)||void 0===i?void 0:i.has(e))||(r?(o.add(e),this.it.add(e)):(o.remove(e),this.it.delete(e)))}return n.Jb}},(...e)=>({_$litDirective$:s,values:e}));var s},9392:(e,t,r)=>{"use strict";r.d(t,{oi:()=>C,iv:()=>c,dy:()=>A.dy,YP:()=>A.YP});const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(e,t,r){if(this._$cssResult$=!0,r!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&s.set(t,e))}return e}toString(){return this.cssText}}const c=(e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,r,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[n+1]),e[0]);return new a(r,e,o)},l=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,o))(t)})(e):e;var u;const h=window,d=h.trustedTypes,p=d?d.emptyScript:"",f=h.reactiveElementPolyfillSupport,m={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},g=(e,t)=>t!==e&&(t==t||e==e),w={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:g},b="finalized";class v extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,r)=>{const n=this._$Ep(r,t);void 0!==n&&(this._$Ev.set(n,r),e.push(n))})),e}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const r="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,r,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(n){const i=this[e];this[t]=n,this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||w}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const r of t)this.createProperty(r,e[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Ep(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,r;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(r=e.hostConnected)||void 0===r||r.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{i?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const r=document.createElement("style"),i=n.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=t.cssText,e.appendChild(r)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=w){var n;const i=this.constructor._$Ep(e,r);if(void 0!==i&&!0===r.reflect){const o=(void 0!==(null===(n=r.converter)||void 0===n?void 0:n.toAttribute)?r.converter:m).toAttribute(t,r.type);this._$El=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(e,t){var r;const n=this.constructor,i=n._$Ev.get(e);if(void 0!==i&&this._$El!==i){const e=n.getPropertyOptions(i),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(r=e.converter)||void 0===r?void 0:r.fromAttribute)?e.converter:m;this._$El=i,this[i]=o.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,r){let n=!0;void 0!==e&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||g)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,r))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(r)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}v[b]=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==f||f({ReactiveElement:v}),(null!==(u=h.reactiveElementVersions)&&void 0!==u?u:h.reactiveElementVersions=[]).push("1.6.2");var y,x,A=r(3692);class C extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const r=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=r.firstChild),r}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,A.sY)(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return A.Jb}}C.finalized=!0,C._$litElement$=!0,null===(y=globalThis.litElementHydrateSupport)||void 0===y||y.call(globalThis,{LitElement:C});const E=globalThis.litElementPolyfillSupport;null==E||E({LitElement:C}),(null!==(x=globalThis.litElementVersions)&&void 0!==x?x:globalThis.litElementVersions=[]).push("3.3.2")},6828:(e,t,r)=>{"use strict";r.d(t,{sj:()=>h,CO:()=>p,Ld:()=>d}),Symbol();const n=Symbol(),i=Object.getPrototypeOf,o=new WeakMap,s=(e,t=!0)=>{o.set(e,t)},a=e=>"object"==typeof e&&null!==e,c=new WeakMap,l=new WeakSet,[u]=((e=Object.is,t=((e,t)=>new Proxy(e,t)),r=(e=>a(e)&&!l.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),u=(e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),h=new WeakMap,d=((e,t,r=u)=>{const n=h.get(e);if((null==n?void 0:n[0])===t)return n[1];const i=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return s(i,!0),h.set(e,[t,i]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(i,t))return;const n=Reflect.get(e,t),o={value:n,enumerable:!0,configurable:!0};if(l.has(n))s(n,!1);else if(n instanceof Promise)delete o.value,o.get=()=>r(n);else if(c.has(n)){const[e,t]=c.get(n);o.value=d(e,t(),r)}Object.defineProperty(i,t,o)})),i}),p=new WeakMap,f=[1,1],m=(s=>{if(!a(s))throw new Error("object required");const u=p.get(s);if(u)return u;let h=f[0];const g=new Set,w=(e,t=++f[0])=>{h!==t&&(h=t,g.forEach((r=>r(e,t))))};let b=f[1];const v=e=>(t,r)=>{const n=[...t];n[1]=[e,...n[1]],w(n,r)},y=new Map,x=e=>{var t;const r=y.get(e);r&&(y.delete(e),null==(t=r[1])||t.call(r))},A=Array.isArray(s)?[]:Object.create(Object.getPrototypeOf(s)),C=t(A,{deleteProperty(e,t){const r=Reflect.get(e,t);x(t);const n=Reflect.deleteProperty(e,t);return n&&w(["delete",[t],r]),n},set(t,s,u,h){const d=Reflect.has(t,s),f=Reflect.get(t,s,h);if(d&&(e(f,u)||p.has(u)&&e(f,p.get(u))))return!0;var b;x(s),a(u)&&(u=(e=>e&&(o.has(e)?o.get(e):i(e)===Object.prototype||i(e)===Array.prototype))(b=u)&&b[n]||null||u);let A=u;if(u instanceof Promise)u.then((e=>{u.status="fulfilled",u.value=e,w(["resolve",[s],e])})).catch((e=>{u.status="rejected",u.reason=e,w(["reject",[s],e])}));else{!c.has(u)&&r(u)&&(A=m(u));const e=!l.has(A)&&c.get(A);e&&((e,t)=>{if(y.has(e))throw new Error("prop listener already exists");if(g.size){const r=t[3](v(e));y.set(e,[t,r])}else y.set(e,[t])})(s,e)}return Reflect.set(t,s,A,h),w(["set",[s],u,f]),!0}});p.set(s,C);const E=[A,(e=++f[1])=>(b===e||g.size||(b=e,y.forEach((([t])=>{const r=t[1](e);r>h&&(h=r)}))),h),d,e=>(g.add(e),1===g.size&&y.forEach((([e,t],r)=>{if(t)throw new Error("remove already exists");const n=e[3](v(r));y.set(r,[e,n])})),()=>{g.delete(e),0===g.size&&y.forEach((([e,t],r)=>{t&&(t(),y.set(r,[e]))}))})];return c.set(C,E),Reflect.ownKeys(s).forEach((e=>{const t=Object.getOwnPropertyDescriptor(s,e);"value"in t&&(C[e]=s[e],delete t.value,delete t.writable),Object.defineProperty(A,e,t)})),C}))=>[m,c,l,e,t,r,u,h,d,p,f])();function h(e={}){return u(e)}function d(e,t,r){const n=c.get(e);let i;n||console.warn("Please use proxy object");const o=[],s=n[3];let a=!1;const l=s((e=>{o.push(e),r?t(o.splice(0)):i||(i=Promise.resolve().then((()=>{i=void 0,a&&t(o.splice(0))})))}));return a=!0,()=>{a=!1,l()}}function p(e,t){const r=c.get(e);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),t)}},1431:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}r.d(t,{T:()=>n})},5291:(e,t,r)=>{"use strict";r.d(t,{R:()=>b});var n=r(1431),i=r(1920);const o="0x82ad56cb";var s=r(9977),a=r(1973),c=r(6647),l=r(1826),u=r(6606),h=r(1786),d=r(6872),p=r(968),f=r(1019),m=r(3822),g=r(8583),w=r(3134);async function b(e,t){const{account:b,batch:v=Boolean(e.batch?.multicall),blockNumber:y,blockTag:x="latest",accessList:A,data:C,gas:E,gasPrice:I,maxFeePerGas:_,maxPriorityFeePerGas:P,nonce:O,to:S,value:k,...M}=t,T=b?(0,n.T)(b):void 0;try{(0,w.F)(t);const r=(y?(0,d.eC)(y):void 0)||x,n=e.chain?.formatters?.transactionRequest?.format||m.t,s=n({...(0,f.K)(M,{format:n}),from:T?.address,accessList:A,data:C,gas:E,gasPrice:I,maxFeePerGas:_,maxPriorityFeePerGas:P,nonce:O,to:S,value:k});if(v&&function({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(o)||!r||Object.values(n).filter((e=>void 0!==e)).length>0)}({request:s}))try{return await async function(e,t){const{batchSize:r=1024,wait:n=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:o,blockTag:s="latest",data:p,multicallAddress:f,to:m}=t;let w=f;if(!w){if(!e.chain)throw new a.pZ;w=(0,h.LI)({blockNumber:o,chain:e.chain,contract:"multicall3"})}const b=(o?(0,d.eC)(o):void 0)||s,{schedule:v}=(0,g.S)({id:`${e.uid}.${b}`,wait:n,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*r},fn:async t=>{const r=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),n=(0,u.R)({abi:i.F8,args:[r],functionName:"aggregate3"}),o=await e.request({method:"eth_call",params:[{data:n,to:w},b]});return(0,l.k)({abi:i.F8,args:[r],functionName:"aggregate3",data:o||"0x"})}}),[{returnData:y,success:x}]=await v({data:p,to:m});if(!x)throw new c.VQ({data:y});return"0x"===y?{data:void 0}:{data:y}}(e,{...s,blockNumber:y,blockTag:x})}catch(e){if(!(e instanceof a.pZ||e instanceof a.mm))throw e}const p=await e.request({method:"eth_call",params:r?[s,r]:[s]});return"0x"===p?{data:void 0}:{data:p}}catch(n){const i=function(e){if(!(e instanceof s.G))return;const t=e.walk();return"object"==typeof t.data?t.data.data:t.data}(n),{offchainLookup:o,offchainLookupSignature:a}=await Promise.resolve().then(r.bind(r,6663));if(i?.slice(0,10)===a&&S)return{data:await o(e,{data:i,to:S})};throw function(e,{docsPath:t,...r}){let n=e;return(0,p.B)(e)&&(n=(0,p.k)(e,r)),new c.cg(n,{docsPath:t,...r})}(n,{...t,account:T,chain:e.chain})}}},1920:(e,t,r)=>{"use strict";r.d(t,{$o:()=>a,Ei:()=>s,F8:()=>n,lD:()=>i,nZ:()=>o});const n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],i=[{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],o=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],s=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]}],a=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}]},5554:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,Up:()=>i,hZ:()=>o});const n={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},o={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},8617:(e,t,r)=>{"use strict";r.d(t,{Bd:()=>o,Zn:()=>i,ez:()=>n});const n={gwei:9,wei:18},i={ether:-9,wei:9},o={ether:-18,gwei:-9}},5555:(e,t,r)=>{"use strict";r.d(t,{CI:()=>C,FM:()=>f,Gy:()=>x,KY:()=>v,M4:()=>h,MX:()=>b,SM:()=>y,cO:()=>a,dh:()=>A,fM:()=>s,fs:()=>d,gr:()=>u,hn:()=>E,lC:()=>m,mv:()=>g,wM:()=>I,wb:()=>l,xB:()=>c,xL:()=>w,yP:()=>p});var n=r(1494),i=r(1756),o=r(9977);class s extends o.G{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class a extends o.G{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class c extends o.G{constructor({data:e,params:t,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${(0,n.h)(t,{includeName:!0})})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class l extends o.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class u extends o.G{constructor({expectedLength:e,givenLength:t,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class h extends o.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.d)(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class d extends o.G{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class p extends o.G{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"})}}class f extends o.G{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class m extends o.G{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class g extends o.G{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class w extends o.G{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class b extends o.G{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class v extends o.G{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class y extends o.G{constructor({abiItem:e,data:t,params:r,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${(0,n.h)(r,{includeName:!0})})`,`Data: ${t} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class x extends o.G{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.t)(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class A extends o.G{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class C extends o.G{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class E extends o.G{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class I extends o.G{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}},2960:(e,t,r)=>{"use strict";r.d(t,{b:()=>i});var n=r(9977);class i extends n.G{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},9977:(e,t,r)=>{"use strict";r.d(t,{G:()=>i});var n=r(3678);class i extends Error{constructor(e,t={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:(0,n.bo)()});const r=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof i&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: https://viem.sh${o}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return o(this,e)}}function o(e,t){return t?.(e)?e:e.cause?o(e.cause,t):e}},1973:(e,t,r)=>{"use strict";r.d(t,{Bk:()=>s,Yl:()=>o,mm:()=>i,pZ:()=>a});var n=r(9977);class i extends n.G{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class o extends n.G{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class s extends n.G{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class a extends n.G{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}},6647:(e,t,r)=>{"use strict";r.d(t,{cg:()=>m,uq:()=>g,Lu:()=>w,Dk:()=>b,VQ:()=>v});var n=r(1431),i=r(5554),o=r(1856),s=r(1494),a=r(1344);function c({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map(((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,a.P)(t[r]):t[r]}`)).join(", ")})`}var l=r(8604),u=r(6665),h=r(6283),d=r(9977),p=r(4574),f=r(3678);class m extends d.G{constructor(e,{account:t,docsPath:r,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:d,to:f,value:m}){const g=t?(0,n.T)(t):void 0,w=(0,p.xr)({from:g?.address,to:f,value:void 0!==m&&`${(0,u.d)(m)} ${i?.nativeCurrency.symbol||"ETH"}`,data:o,gas:s,gasPrice:void 0!==a&&`${(0,h.o)(a)} gwei`,maxFeePerGas:void 0!==c&&`${(0,h.o)(c)} gwei`,maxPriorityFeePerGas:void 0!==l&&`${(0,h.o)(l)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class g extends d.G{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:o,sender:a}){const u=(0,l.m)({abi:t,args:r,name:o}),h=u?c({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=u?(0,s.t)(u,{includeName:!0}):void 0,m=(0,p.xr)({address:n&&(0,f.CR)(n),function:d,args:h&&"()"!==h&&`${[...Array(o?.length??0).keys()].map((()=>" ")).join("")}${h}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",m].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=o,this.sender=a}}class w extends d.G{constructor({abi:e,data:t,functionName:r,message:n}){let a,l,u;if(t&&"0x"!==t){a=(0,o.p)({abi:e,data:t});const{abiItem:r,errorName:n,args:h}=a;if("Error"===n)u=h[0];else if("Panic"===n){const[e]=h;u=i.$[e]}else{const e=r?(0,s.t)(r,{includeName:!0}):void 0,t=r&&h?c({abiItem:r,args:h,includeFunctionName:!1,includeName:!1}):void 0;l=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(n?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}else n&&(u=n);super(u&&"execution reverted"!==u?[`The contract function "${r}" reverted with the following reason:`,u].join("\n"):`The contract function "${r}" reverted.`,{metaMessages:l}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.reason=u,this.data=a}}class b extends d.G{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class v extends d.G{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},8309:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,m:()=>i});var n=r(9977);class i extends n.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class o extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}},9466:(e,t,r)=>{"use strict";r.d(t,{Cd:()=>o,J5:()=>i,M6:()=>s});var n=r(9977);class i extends n.G{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class o extends n.G{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class s extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}},6054:(e,t,r)=>{"use strict";r.d(t,{C_:()=>h,G$:()=>a,Hh:()=>s,M_:()=>o,WF:()=>d,ZI:()=>c,cj:()=>g,cs:()=>m,dR:()=>p,pZ:()=>f,se:()=>u,vU:()=>l});var n=r(6283),i=r(9977);class o extends i.G{constructor({cause:e,message:t}={}){const r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class s extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class a extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class c extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class l extends i.G{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported/});class u extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class h extends i.G{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class d extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class p extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends i.G{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class m extends i.G{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.o)(r)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(m,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class g extends i.G{constructor({cause:e}){super(`An error occurred while executing: ${e?.message}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}},8822:(e,t,r)=>{"use strict";r.d(t,{Gg:()=>s,W5:()=>l,bs:()=>c,c9:()=>a});var n=r(1344),i=r(9977),o=r(3678);class s extends i.G{constructor({body:e,details:t,headers:r,status:i,url:s}){super("HTTP request failed.",{details:t,metaMessages:[i&&`Status: ${i}`,`URL: ${(0,o.Gr)(s)}`,e&&`Request body: ${(0,n.P)(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=r,this.status=i,this.url=s}}class a extends i.G{constructor({body:e,details:t,url:r}){super("WebSocket request failed.",{details:t,metaMessages:[`URL: ${(0,o.Gr)(r)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class c extends i.G{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,o.Gr)(r)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class l extends i.G{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,o.Gr)(t)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}},2455:(e,t,r)=>{"use strict";r.d(t,{B:()=>c,GD:()=>b,I0:()=>C,KB:()=>m,LX:()=>l,Og:()=>p,PE:()=>y,Pv:()=>w,Ts:()=>x,XS:()=>h,ab:()=>v,gS:()=>g,ir:()=>I,nY:()=>u,pT:()=>f,s7:()=>a,u5:()=>A,x3:()=>E,yR:()=>d});var n=r(9977),i=r(8822);class o extends n.G{constructor(e,{code:t,docsPath:r,metaMessages:n,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof i.bs?e.code:t??-1}}class s extends o{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class a extends o{constructor(e){super(e,{code:a.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class c extends o{constructor(e){super(e,{code:c.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class l extends o{constructor(e){super(e,{code:l.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends o{constructor(e){super(e,{code:u.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class h extends o{constructor(e){super(e,{code:h.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class d extends o{constructor(e){super(e,{code:d.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class p extends o{constructor(e){super(e,{code:p.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class f extends o{constructor(e){super(e,{code:f.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class m extends o{constructor(e){super(e,{code:m.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class g extends o{constructor(e){super(e,{code:g.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class w extends o{constructor(e){super(e,{code:w.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends o{constructor(e){super(e,{code:b.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class v extends s{constructor(e){super(e,{code:v.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class y extends s{constructor(e){super(e,{code:y.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends s{constructor(e){super(e,{code:x.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class A extends s{constructor(e){super(e,{code:A.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class C extends s{constructor(e){super(e,{code:C.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class E extends s{constructor(e){super(e,{code:E.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class I extends o{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}},4574:(e,t,r)=>{"use strict";r.d(t,{Bh:()=>l,Yb:()=>u,mc:()=>h,mk:()=>c,xY:()=>a,xr:()=>s});var n=r(6665),i=r(6283),o=r(9977);function s(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),r=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(r+1)} ${t}`)).join("\n")}class a extends o.G{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class c extends o.G{constructor(e,{account:t,docsPath:r,chain:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:h,nonce:d,to:p,value:f}){const m=s({chain:o&&`${o?.name} (id: ${o?.id})`,from:t?.address,to:p,value:void 0!==f&&`${(0,n.d)(f)} ${o?.nativeCurrency.symbol||"ETH"}`,data:a,gas:c,gasPrice:void 0!==l&&`${(0,i.o)(l)} gwei`,maxFeePerGas:void 0!==u&&`${(0,i.o)(u)} gwei`,maxPriorityFeePerGas:void 0!==h&&`${(0,i.o)(h)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class l extends o.G{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let o="Transaction";r&&void 0!==i&&(o=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(o=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(o=`Transaction at block number "${t}" at index "${i}"`),n&&(o=`Transaction with hash "${n}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class u extends o.G{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class h extends o.G{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}},3678:(e,t,r)=>{"use strict";r.d(t,{CR:()=>n,Gr:()=>i,bo:()=>o});const n=e=>e,i=e=>e,o=()=>"viem@1.1.7"},558:(e,t,r)=>{"use strict";r.d(t,{r:()=>u});var n=r(5555),i=r(2221),o=r(1756),s=r(3283),a=r(6873),c=r(169),l=r(2546);function u(e,t){if("0x"===t&&e.length>0)throw new n.wb;if((0,o.d)(t)&&(0,o.d)(t)<32)throw new n.xB({data:t,params:e,size:(0,o.d)(t)});return function({data:e,params:t}){const r=[];let i=0;for(let s=0;s=(0,o.d)(e))throw new n.xB({data:e,params:t,size:(0,o.d)(e)});const a=t[s],{consumed:c,value:l}=h({data:e,param:a,position:i});r.push(l),i+=c}return r}({data:t,params:e})}function h({data:e,param:t,position:r}){const o=(0,l.S)(t.type);if(o){const[n,i]=o;return function(e,{param:t,length:r,position:n}){if(!r){const r=(0,c.ly)((0,s.tP)(e,n,n+32,{strict:!0})),i=(0,c.ly)((0,s.tP)(e,r,r+32,{strict:!0}));let o=0;const a=[];for(let n=0;n!e)),i=n?[]:{};let o=0;if(d(t)){const a=(0,c.ly)((0,s.tP)(e,r,r+32,{strict:!0}));for(let r=0;r48?(0,c.y_)(e,{signed:r}):(0,c.ly)(e,{signed:r})}}(u,{param:t});if("address"===t.type)return function(e){return{consumed:32,value:(0,i.x)((0,s.tP)(e,-20))}}(u);if("bool"===t.type)return function(e){return{consumed:32,value:(0,c.XA)(e)}}(u);throw new n.CI(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function d(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(d);const r=(0,l.S)(e.type);return!(!r||!d({...e,type:r[1]}))}},1856:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var n=r(5554),i=r(5555),o=r(3283),s=r(507),a=r(558),c=r(1494);function l({abi:e,data:t}){const r=(0,o.tP)(t,0,4);if("0x"===r)throw new i.wb;const l=[...e||[],n.Up,n.hZ].find((e=>"error"===e.type&&r===(0,s.o)((0,c.t)(e))));if(!l)throw new i.yP(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:l,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,a.r)(l.inputs,(0,o.tP)(t,4)):void 0,errorName:l.name}}},1826:(e,t,r)=>{"use strict";r.d(t,{k:()=>a});var n=r(5555),i=r(558),o=r(8604);const s="/docs/contract/decodeFunctionResult";function a({abi:e,args:t,functionName:r,data:a}){let c=e[0];if(r&&(c=(0,o.m)({abi:e,args:t,name:r}),!c))throw new n.xL(r,{docsPath:s});if("function"!==c.type)throw new n.xL(void 0,{docsPath:s});if(!c.outputs)throw new n.MX(c.name,{docsPath:s});const l=(0,i.r)(c.outputs,a);return l&&l.length>1?l:l&&1===l.length?l[0]:void 0}},2546:(e,t,r)=>{"use strict";r.d(t,{E:()=>h,S:()=>f});var n=r(5555),i=r(2960),o=r(7451),s=r(9040),a=r(8795),c=r(1756),l=r(3283),u=r(6872);function h(e,t){if(e.length!==t.length)throw new n.fs({expectedLength:e.length,givenLength:t.length});const r=function({params:e,values:t}){const r=[];for(let n=0;n0?(0,s.zo)([t,e]):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,s.zo)(a.map((({encoded:e})=>e)))}}(t,{length:i,param:{...e,type:o}})}if("tuple"===e.type)return function(e,{param:t}){let r=!1;const n=[];for(let i=0;ie)))}}(t,{param:e});if("address"===e.type)return function(e){if(!(0,o.U)(e))throw new i.b({address:e});return{dynamic:!1,encoded:(0,a.gc)(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:(0,a.gc)((0,u.C4)(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return function(e,{signed:t}){return{dynamic:!1,encoded:(0,u.eC)(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")});if(e.type.startsWith("bytes"))return function(e,{param:t}){const[r,i]=t.type.split("bytes");if(!i){const t=Math.ceil((0,c.d)(e)/32),r=[];for(let n=0;n{"use strict";r.d(t,{R:()=>l});var n=r(5555),i=r(9040),o=r(507),s=r(2546),a=r(1494),c=r(8604);function l({abi:e,args:t,functionName:r}){let l=e[0];if(r&&(l=(0,c.m)({abi:e,args:t,name:r}),!l))throw new n.xL(r,{docsPath:"/docs/contract/encodeFunctionData"});if("function"!==l.type)throw new n.xL(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const u=(0,a.t)(l),h=(0,o.o)(u),d="inputs"in l&&l.inputs?(0,s.E)(l.inputs,t??[]):void 0;return(0,i.SM)([h,d??"0x"])}},1494:(e,t,r)=>{"use strict";r.d(t,{h:()=>o,t:()=>i});var n=r(5555);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.wM(e.type);return`${e.name}(${o(e.inputs,{includeName:t})})`}function o(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${o(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}},8604:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var n=r(7451);function i({abi:e,args:t=[],name:r}){const n=e.filter((e=>"name"in e&&e.name===r));if(0!==n.length){if(1===n.length)return n[0];for(const e of n)if("inputs"in e)if(t&&0!==t.length){if(e.inputs&&0!==e.inputs.length&&e.inputs.length===t.length&&t.every(((t,r)=>{const n="inputs"in e&&e.inputs[r];return!!n&&o(t,n)})))return e}else if(!e.inputs||0===e.inputs.length)return e;return n[0]}}function o(e,t){const r=typeof e,i=t.type;switch(i){case"address":return(0,n.U)(e);case"bool":return"boolean"===r;case"function":case"string":return"string"===r;default:return"tuple"===i&&"components"in t?Object.values(t.components).every(((t,r)=>o(Object.values(e)[r],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i)?"number"===r||"bigint"===r:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i)?"string"===r||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i)&&Array.isArray(e)&&e.every((e=>o(e,{...t,type:i.replace(/(\[[0-9]{0,}\])$/,"")})))}}},2221:(e,t,r)=>{"use strict";r.d(t,{K:()=>c,x:()=>a});var n=r(2960),i=r(1327),o=r(7871),s=r(7451);function a(e,t){const r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,o.w)((0,i.qX)(r),"bytes"),s=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&n[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());return`0x${s.join("")}`}function c(e,t){if(!(0,s.U)(e))throw new n.b({address:e});return a(e,t)}},7451:(e,t,r)=>{"use strict";r.d(t,{U:()=>i});const n=/^0x[a-fA-F0-9]{40}$/;function i(e){return n.test(e)}},6663:(e,t,r)=>{"use strict";r.d(t,{offchainLookup:()=>v,offchainLookupSignature:()=>w});var n=r(5291),i=r(1344),o=r(9977),s=r(3678);class a extends o.G{constructor({callbackSelector:e,cause:t,data:r,extraData:n,sender:i,urls:o}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map((e=>` ${(0,s.Gr)(e)}`))],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${e}`,` Extra data: ${n}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class c extends o.G{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,s.Gr)(t)}`,`Response: ${(0,i.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class l extends o.G{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}var u=r(8822),h=r(1856),d=r(2546),p=r(2960),f=r(7451),m=r(9040),g=r(5493);const w="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function v(e,{blockNumber:t,blockTag:r,data:o,to:s}){const{args:w}=(0,h.p)({data:o,abi:[b]}),[v,y,x,A,C]=w;try{if(!function(e,t){if(!(0,f.U)(e))throw new p.b({address:e});if(!(0,f.U)(t))throw new p.b({address:t});return e.toLowerCase()===t.toLowerCase()}(s,v))throw new l({sender:v,to:s});const o=await async function({data:e,sender:t,urls:r}){let n=new Error("An unknown error occurred.");for(let o=0;o{"use strict";r.d(t,{LI:()=>s,ax:()=>o,qg:()=>i});var n=r(1973);function i({chain:e,currentChainId:t}){if(!e)throw new n.Bk;if(t!==e.id)throw new n.Yl({chain:e,currentChainId:t})}function o(e,t){return{...e,formatters:t?.formatters,serializers:t?.serializers}}function s({blockNumber:e,chain:t,contract:r}){const i=t?.contracts?.[r];if(!i)throw new n.mm({chain:t,contract:{name:r}});if(e&&i.blockCreated&&i.blockCreated>e)throw new n.mm({blockNumber:e,chain:t,contract:{name:r,blockCreated:i.blockCreated}});return i.address}},9040:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(const r of e)t+=r.length;const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}r.d(t,{SM:()=>i,zo:()=>n})},5493:(e,t,r)=>{"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{v:()=>n})},8795:(e,t,r)=>{"use strict";r.d(t,{gc:()=>o,vk:()=>i});var n=r(8309);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?o(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.$({size:e.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let n=0;n2*r)throw new n.$({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}},1756:(e,t,r)=>{"use strict";r.d(t,{d:()=>i});var n=r(5493);function i(e){return(0,n.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},3283:(e,t,r)=>{"use strict";r.d(t,{tP:()=>s});var n=r(8309),i=r(5493),o=r(1756);function s(e,t,r,{strict:n}={}){return(0,i.v)(e,{strict:!1})?function(e,t,r,{strict:n}={}){a(e,t);const i=`0x${e.replace("0x","").slice(2*(t??0),2*(r??e.length))}`;return n&&c(i,t,r),i}(e,t,r,{strict:n}):function(e,t,r,{strict:n}={}){a(e,t);const i=e.slice(t,r);return n&&c(i,t,r),i}(e,t,r,{strict:n})}function a(e,t){if("number"==typeof t&&t>0&&t>(0,o.d)(e)-1)throw new n.m({offset:t,position:"start",size:(0,o.d)(e)})}function c(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,o.d)(e)!==r-t)throw new n.m({offset:r,position:"end",size:(0,o.d)(e)})}},6873:(e,t,r)=>{"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,n=0;for(let e=0;en})},169:(e,t,r)=>{"use strict";r.d(t,{XA:()=>l,Yf:()=>a,ly:()=>u,rR:()=>h,y_:()=>c});var n=r(9466),i=r(1756),o=r(6873),s=r(1327);function a(e,{size:t}){if((0,i.d)(e)>t)throw new n.M6({givenSize:(0,i.d)(e),maxSize:t})}function c(e,t={}){const{signed:r}=t;t.size&&a(e,{size:t.size});const n=BigInt(e);if(!r)return n;const i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function l(e,t={}){let r=e;if(t.size&&(a(r,{size:t.size}),r=(0,o.f)(r)),"0x00"===(0,o.f)(r))return!1;if("0x01"===(0,o.f)(r))return!0;throw new n.Cd(r)}function u(e,t={}){return Number(c(e,t))}function h(e,t={}){let r=(0,s.nr)(e);return t.size&&(a(r,{size:t.size}),r=(0,o.f)(r,{dir:"right"})),(new TextDecoder).decode(r)}},1327:(e,t,r)=>{"use strict";r.d(t,{O0:()=>l,nr:()=>u,qX:()=>h});var n=r(9977),i=r(5493),o=r(8795),s=r(169),a=r(6872);const c=new TextEncoder;function l(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){return u((0,a.eC)(e,t))}(e,t):"boolean"==typeof e?function(e,t={}){const r=new Uint8Array(1);return r[0]=Number(e),"number"==typeof t.size?((0,s.Yf)(r,{size:t.size}),(0,o.vk)(r,{size:t.size})):r}(e,t):(0,i.v)(e)?u(e,t):h(e,t)}function u(e,t={}){let r=e;t.size&&((0,s.Yf)(r,{size:t.size}),r=(0,o.vk)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);const a=new Uint8Array(i.length/2);for(let e=0;e{"use strict";r.d(t,{$G:()=>d,C4:()=>c,NC:()=>a,ci:()=>l,eC:()=>u});var n=r(9466),i=r(8795),o=r(169);const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?d(e,t):"boolean"==typeof e?c(e,t):l(e,t)}function c(e,t={}){const r=`0x${Number(e)}`;return"number"==typeof t.size?((0,o.Yf)(r,{size:t.size}),(0,i.vk)(r,{size:t.size})):r}function l(e,t={}){let r="";for(let t=0;ta||s{"use strict";r.d(t,{B:()=>s,k:()=>a});var n=r(6054),i=r(8822),o=r(2455);function s(e){return e instanceof o.KB||e instanceof o.yR||e instanceof i.bs&&e.code===n.M_.code}function a(e,t){const r=e.details.toLowerCase();return n.Hh.nodeMessage.test(r)?new n.Hh({cause:e,maxFeePerGas:t?.maxFeePerGas}):n.G$.nodeMessage.test(r)?new n.G$({cause:e,maxFeePerGas:t?.maxFeePerGas}):n.ZI.nodeMessage.test(r)?new n.ZI({cause:e,nonce:t?.nonce}):n.vU.nodeMessage.test(r)?new n.vU({cause:e,nonce:t?.nonce}):n.se.nodeMessage.test(r)?new n.se({cause:e,nonce:t?.nonce}):n.C_.nodeMessage.test(r)?new n.C_({cause:e}):n.WF.nodeMessage.test(r)?new n.WF({cause:e,gas:t?.gas}):n.dR.nodeMessage.test(r)?new n.dR({cause:e,gas:t?.gas}):n.pZ.nodeMessage.test(r)?new n.pZ({cause:e}):n.cs.nodeMessage.test(r)?new n.cs({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):r.match(n.M_.nodeMessage)||"code"in e.cause&&e.cause?.code===n.M_.code?new n.M_({cause:e,message:e.cause.details||e.details}):new n.cj({cause:e.cause.cause})}},1019:(e,t,r)=>{"use strict";function n(e,{format:t}){return t?Object.keys(t({})).reduce(((t,r)=>(e?.hasOwnProperty(r)&&(t[r]=e[r]),t)),{}):{}}r.d(t,{K:()=>n})},5491:(e,t,r)=>{"use strict";function n(e,t){return({exclude:r,format:n})=>({format:e=>{const i=t(e);if(r)for(const e of r)delete i[e];return{...i,...n(e)}},type:e})}r.d(t,{$:()=>n})},3822:(e,t,r)=>{"use strict";r.d(t,{i:()=>o,t:()=>i});var n=r(6872);function i(e){return{...e,gas:void 0!==e.gas?(0,n.eC)(e.gas):void 0,gasPrice:void 0!==e.gasPrice?(0,n.eC)(e.gasPrice):void 0,maxFeePerGas:void 0!==e.maxFeePerGas?(0,n.eC)(e.maxFeePerGas):void 0,maxPriorityFeePerGas:void 0!==e.maxPriorityFeePerGas?(0,n.eC)(e.maxPriorityFeePerGas):void 0,nonce:void 0!==e.nonce?(0,n.eC)(e.nonce):void 0,value:void 0!==e.value?(0,n.eC)(e.value):void 0}}const o=(0,r(5491).$)("transactionRequest",i)},507:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(3283),i=r(3693);const o=e=>"string"==typeof e?(0,n.tP)((0,i.F)(e),0,4):(0,n.tP)((0,i.J)(e),0,4)},3693:(e,t,r)=>{"use strict";r.d(t,{J:()=>l,F:()=>c});const n=/((function|event)\s)?(.*)(\((.*)\))/;function i(e){const t=e.match(n),r=t?.[2]||void 0,i=t?.[3];return{type:r,name:i,params:t?.[5]||void 0}}var o=r(1327),s=r(7871);const a=e=>(0,s.w)((0,o.O0)(e));function c(e){const t=function(e){return i(e).name}(e),r=function(e){const t=i(e).params,r=t?.split(",").map((e=>e.trim().split(" ")));return r?.map((e=>({type:e[0],name:"indexed"===e[1]?e[2]:e[1],..."indexed"===e[1]?{indexed:!0}:{}})))}(e)||[];return a(`${t}(${r.map((({type:e})=>e)).join(",")})`)}function l(e){return a(`${e.name}(${e.inputs.map((({type:e})=>e)).join(",")})`)}},7871:(e,t,r)=>{"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}r.d(t,{w:()=>L});const o={number:n,bool:function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:i,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function(e,t){i(e);const r=t.outputLen;if(e.length>a&s)}:{h:0|Number(e>>a&s),l:0|Number(e&s)}}const l=function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;ie<>>32-r,h=(e,t,r)=>t<>>32-r,d=(e,t,r)=>t<>>64-r,p=(e,t,r)=>e<>>64-r;if("object"==typeof globalThis&&"crypto"in globalThis&&globalThis.crypto,68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function f(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));class m{clone(){return this._cloneInto()}}const[g,w,b]=[[],[],[]],v=BigInt(0),y=BigInt(1),x=BigInt(2),A=BigInt(7),C=BigInt(256),E=BigInt(113);for(let e=0,t=y,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],g.push(2*(5*n+r)),w.push((e+1)*(e+2)/2%64);let i=v;for(let e=0;e<7;e++)t=(t<>A)*E)%C,t&x&&(i^=y<<(y<r>32?d(e,t,r):u(e,t,r),O=(e,t,r)=>r>32?p(e,t,r):h(e,t,r);class S extends m{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,o.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=P(o,s,1)^r[n],c=O(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=w[r],o=P(t,i,n),s=O(t,i,n),a=g[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=I[n],e[1]^=_[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){o.exists(this);const{blockLen:t,state:r}=this,n=(e=f(e)).length;for(let i=0;i=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return o.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(o.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new S(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}const k=(e,t,r)=>function(e){const t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}((()=>new S(t,e,r))),M=(k(6,144,28),k(6,136,32),k(6,104,48),k(6,72,64),k(1,144,28),k(1,136,32)),T=(k(1,104,48),k(1,72,64),(e,t,r)=>function(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(((n={})=>new S(t,e,void 0===n.dkLen?r:n.dkLen,!0))));T(31,168,16),T(31,136,32);var N=r(5493),j=r(1327),R=r(6872);function L(e,t){const r=t||"hex",n=M((0,N.v)(e,{strict:!1})?(0,j.O0)(e):e);return"bytes"===r?n:(0,R.NC)(n)}},8583:(e,t,r)=>{"use strict";r.d(t,{S:()=>i});const n=new Map;function i({fn:e,id:t,shouldSplitBatch:r,wait:i=0}){const o=async()=>{const t=a();s();const r=t.map((({args:e})=>e));0!==r.length&&e(r).then((e=>{t.forEach((({pendingPromise:t},r)=>t.resolve?.([e[r],e])))})).catch((e=>{t.forEach((({pendingPromise:t})=>t.reject?.(e)))}))},s=()=>n.delete(t),a=()=>n.get(t)||[],c=e=>n.set(t,[...a(),e]);return{flush:s,async schedule(e){const t={},n=new Promise(((e,r)=>{t.resolve=e,t.reject=r})),s=r?.([...a().map((({args:e})=>e)),e]);return s&&o(),a().length>0?(c({args:e,pendingPromise:t}),n):(c({args:e,pendingPromise:t}),setTimeout(o,i),n)}}}},1344:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});const n=(e,t,r)=>JSON.stringify(e,((e,r)=>{const n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n}),r)},3134:(e,t,r)=>{"use strict";r.d(t,{F:()=>c});var n=r(1431),i=r(2960),o=r(6054),s=r(4574),a=r(7451);function c(e){const{account:t,gasPrice:r,maxFeePerGas:c,maxPriorityFeePerGas:l,to:u}=e,h=t?(0,n.T)(t):void 0;if(h&&!(0,a.U)(h.address))throw new i.b({address:h.address});if(u&&!(0,a.U)(u))throw new i.b({address:u});if(void 0!==r&&(void 0!==c||void 0!==l))throw new s.xY;if(c&&c>2n**256n-1n)throw new o.Hh({maxFeePerGas:c});if(l&&c&&l>c)throw new o.cs({maxFeePerGas:c,maxPriorityFeePerGas:l})}},6665:(e,t,r)=>{"use strict";r.d(t,{d:()=>o});var n=r(8617),i=r(263);function o(e,t="wei"){return(0,i.b)(e,n.ez[t])}},6283:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(8617),i=r(263);function o(e,t="wei"){return(0,i.b)(e,n.Zn[t])}},263:(e,t,r)=>{"use strict";function n(e,t){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[i,o]=[r.slice(0,r.length-t),r.slice(r.length-t)];return o=o.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${o?`.${o}`:""}`}r.d(t,{b:()=>n})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=r(6729),t={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0},n={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}},i=r(1786),o=r(169),s=r(6872);r(5491);const a={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function c(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,o.ly)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,o.ly)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?a[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip2930"===t.type&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t}function l(e){const t=e.transactions?.map((e=>"string"==typeof e?e:c(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,difficulty:e.difficulty?BigInt(e.difficulty):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}function u(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}const h={"0x0":"reverted","0x1":"success"};function d(e){return{...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>u(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,o.ly)(e.transactionIndex):null,status:e.status?h[e.status]:null,type:e.type?a[e.type]||e.type:null}}var p=r(3822);const f=(0,i.ax)(t),m=(0,i.ax)(n);var g=Object.defineProperty,w=(e,t,r)=>(((e,t,r)=>{t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),b=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},v=(e,t,r)=>(b(e,t,"read from private field"),r?r.call(e):t.get(e)),y=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},x=(e,t,r,n)=>(b(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),A=(e,t,r)=>(b(e,t,"access private method"),r),C=class extends e{constructor({chains:e=[m,f],options:t}){super(),w(this,"chains"),w(this,"options"),w(this,"storage"),this.chains=e,this.options=t}getBlockExplorerUrls(e){const{default:t,...r}=e.blockExplorers??{};if(t)return[t.url,...Object.values(r).map((e=>e.url))]}isChainUnsupported(e){return!this.chains.some((t=>t.id===e))}setStorage(e){this.storage=e}},E=class extends Error{constructor({chainId:e,connectorId:t}){super(`Chain "${e}" not configured for connector "${t}".`),w(this,"name","ChainNotConfiguredForConnectorError")}},I=class extends Error{constructor(){super(...arguments),w(this,"name","ConnectorNotFoundError"),w(this,"message","Connector not found")}};function _(e){return"string"==typeof e?Number.parseInt(e,"0x"===e.trim().substring(0,2)?16:10):"bigint"==typeof e?Number(e):e}var P=r(2221),O=r(2455),S=r(1431);const k=256;let M,T=k;function N(e=11){if(!M||T+e>2*k){M="",T=0;for(let e=0;e"type"in e&&"constructor"===e.type));if(!n)throw new L.fM({docsPath:U});if(!("inputs"in n))throw new L.cO({docsPath:U});if(!n.inputs||0===n.inputs.length)throw new L.cO({docsPath:U});const i=(0,$.E)(n.inputs,t);return(0,B.SM)([r,i])}var z=r(9977);class W extends z.G{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}var F=r(4574),H=r(968),q=r(1019),V=r(3134),G=r(6665),K=r(6283);class Z extends z.G{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:o,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:l,to:u,value:h}){const d=(0,F.xr)({from:t?.address,to:u,value:void 0!==h&&`${(0,G.d)(h)} ${n?.nativeCurrency.symbol||"ETH"}`,data:i,gas:o,gasPrice:void 0!==s&&`${(0,K.o)(s)} gwei`,maxFeePerGas:void 0!==a&&`${(0,K.o)(a)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${(0,K.o)(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",d].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}async function Q(e,t){const r=t.account??e.account;if(!r)throw new W({docsPath:"/docs/actions/public/estimateGas"});const n=(0,S.T)(r);try{const{accessList:r,blockNumber:i,blockTag:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:h,nonce:d,to:f,value:m,...g}="local"===n.type?await re(e,t):t,w=(i?(0,s.eC)(i):void 0)||o;(0,V.F)(t);const b=e.chain?.formatters?.transactionRequest?.format||p.t,v=b({...(0,q.K)(g,{format:b}),from:n.address,accessList:r,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:h,nonce:d,to:f,value:m}),y=await e.request({method:"eth_estimateGas",params:w?[v,w]:[v]});return BigInt(y)}catch(r){throw function(e,{docsPath:t,...r}){let n=e;return(0,H.B)(e)&&(n=(0,H.k)(e,r)),new Z(n,{docsPath:t,...r})}(r,{...t,account:n,chain:e.chain})}}class Y extends z.G{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function J(e,{blockHash:t,blockNumber:r,blockTag:n="latest",includeTransactions:i=!1}={}){const o=void 0!==r?(0,s.eC)(r):void 0;let a=null;if(a=t?await e.request({method:"eth_getBlockByHash",params:[t,i]}):await e.request({method:"eth_getBlockByNumber",params:[o||n,i]}),!a)throw new Y({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||l)(a)}async function X(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function ee(e,{address:t,blockTag:r="latest",blockNumber:n}){const i=await e.request({method:"eth_getTransactionCount",params:[t,n?(0,s.eC)(n):r]});return(0,o.ly)(i)}const te=1500000000n;async function re(e,t){const{account:r,gas:n,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:s,nonce:a}=t;if(!r)throw new W;const c=(0,S.T)(r),l=await J(e,{blockTag:"latest"}),u={...t,from:c.address};if(void 0===a&&(u.nonce=await ee(e,{address:c.address,blockTag:"pending"})),l.baseFeePerGas){if(void 0!==i)throw new z.G("Chain does not support legacy `gasPrice`.");if(void 0===o)u.maxPriorityFeePerGas=s??te,u.maxFeePerGas=120n*l.baseFeePerGas/100n+u.maxPriorityFeePerGas;else{if(void 0===s&&o{for(const r of e){const{name:e,type:n}=r,a=n,c=t[e],l=a.match(ue);if(l&&("number"==typeof c||"bigint"==typeof c)){const[e,t,r]=l;(0,s.eC)(c,{signed:"int"===t,size:parseInt(r)/8})}if("address"===a&&"string"==typeof c&&!(0,ae.U)(c))throw new se.b({address:c});const u=a.match(le);if(u){const[e,t]=u;if(t&&(0,ce.d)(c)!==parseInt(t))throw new L.KY({expectedSize:parseInt(t),givenSize:(0,ce.d)(c)})}const h=i[a];h&&o(h,c)}};if(i.EIP712Domain&&e&&o(i.EIP712Domain,e),"EIP712Domain"!==r){const e=i[r];o(e,t)}}var de=r(6606);const pe=e=>({addChain:t=>async function(e,{chain:t}){const{id:r,name:n,nativeCurrency:i,rpcUrls:o,blockExplorers:a}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:(0,s.eC)(r),chainName:n,nativeCurrency:i,rpcUrls:o.default.http,blockExplorerUrls:a?Object.values(a).map((({url:e})=>e)):void 0}]})}(e,t),deployContract:t=>function(e,{abi:t,args:r,bytecode:n,...i}){return ne(e,{...i,data:D({abi:t,args:r,bytecode:n})})}(e,t),getAddresses:()=>async function(e){return(await e.request({method:"eth_accounts"})).map((e=>(0,P.x)(e)))}(e),getChainId:()=>R(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"})}(e),requestAddresses:()=>async function(e){return(await e.request({method:"eth_requestAccounts"})).map((e=>(0,P.K)(e)))}(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]})}(e,t),sendTransaction:t=>ne(e,t),signMessage:t=>async function(e,{account:t=e.account,message:r}){if(!t)throw new W({docsPath:"/docs/actions/wallet/signMessage"});const n=(0,S.T)(t);if("local"===n.type)return n.signMessage({message:r});const i="string"==typeof r?(0,s.$G)(r):r.raw instanceof Uint8Array?(0,s.NC)(r.raw):r.raw;return e.request({method:"personal_sign",params:[i,n.address]})}(e,t),signTypedData:t=>async function(e,{account:t=e.account,domain:r,message:n,primaryType:i,types:o}){if(!t)throw new W({docsPath:"/docs/actions/wallet/signTypedData"});const s=(0,S.T)(t),a={EIP712Domain:["string"==typeof r?.name&&{name:"name",type:"string"},r?.version&&{name:"version",type:"string"},"number"==typeof r?.chainId&&{name:"chainId",type:"uint256"},r?.verifyingContract&&{name:"verifyingContract",type:"address"},r?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...o};if(he({domain:r,message:n,primaryType:i,types:a}),"local"===s.type)return s.signTypedData({domain:r,primaryType:i,types:a,message:n});const c=(0,oe.P)({domain:r??{},primaryType:i,types:a,message:n},((e,t)=>(0,ie.v)(t)?t.toLowerCase():t));return e.request({method:"eth_signTypedData_v4",params:[s.address,c]})}(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,s.eC)(t)}]})}(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t})}(e,t),writeContract:t=>async function(e,{abi:t,address:r,args:n,dataSuffix:i,functionName:o,...s}){const a=(0,de.R)({abi:t,args:n,functionName:o});return await ne(e,{data:`${a}${i?i.replace("0x",""):""}`,to:r,...s})}(e,t)});function fe({account:e,chain:t,transport:r,key:n="wallet",name:i="Wallet Client",pollingInterval:o}){const s={...j({chain:t,key:n,name:i,pollingInterval:o,transport:e=>r({...e,retryCount:0}),type:"walletClient"}),account:e?(0,S.T)(e):void 0};return{...s,...pe(s)}}var me=r(8822);async function ge(e){return new Promise((t=>setTimeout(t,e)))}function we(e,{delay:t=100,retryCount:r=2,shouldRetry:n=(()=>!0)}={}){return new Promise(((i,o)=>{const s=async({count:a=0}={})=>{try{const t=await e();i(t)}catch(e){if(a{const r="function"==typeof t?t({count:a,error:e}):t;r&&await ge(r),s({count:a+1})})({error:e});o(e)}};s()}))}const be=e=>"code"in e?-1!==e.code&&-32004!==e.code&&-32005!==e.code&&-32042!==e.code&&-32603!==e.code:!!(e instanceof me.Gg&&e.status)&&403!==e.status&&408!==e.status&&413!==e.status&&429!==e.status&&500!==e.status&&502!==e.status&&503!==e.status&&504!==e.status;function ve(e,{retryDelay:t=150,retryCount:r=3}={}){return async n=>we((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case O.s7.code:throw new O.s7(t);case O.B.code:throw new O.B(t);case O.LX.code:throw new O.LX(t);case O.nY.code:throw new O.nY(t);case O.XS.code:throw new O.XS(t);case O.yR.code:throw new O.yR(t);case O.Og.code:throw new O.Og(t);case O.pT.code:throw new O.pT(t);case O.KB.code:throw new O.KB(t);case O.gS.code:throw new O.gS(t);case O.Pv.code:throw new O.Pv(t);case O.GD.code:throw new O.GD(t);case O.ab.code:throw new O.ab(t);case O.PE.code:throw new O.PE(t);case O.Ts.code:throw new O.Ts(t);case O.u5.code:throw new O.u5(t);case O.I0.code:throw new O.I0(t);case O.x3.code:throw new O.x3(t);default:if(e instanceof z.G)throw e;throw new O.ir(t)}}}),{delay:({count:e,error:r})=>{if(r&&r instanceof me.Gg){const e=r?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return~~(1<!be(e)})}function ye({key:e,name:t,request:r,retryCount:n=3,retryDelay:i=150,timeout:o,type:s},a){return{config:{key:e,name:t,request:r,retryCount:n,retryDelay:i,timeout:o,type:s},request:ve(r,{retryCount:n,retryDelay:i}),value:a}}function xe(e,t={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=t;return({retryCount:o})=>ye({key:r,name:n,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:i,type:"custom"})}var Ae,Ce=class extends C{constructor({chains:e,options:t}={}){const r={shimDisconnect:!0,getProvider(){if("undefined"==typeof window)return;const e=window.ethereum;return e?.providers?e.providers[0]:e},...t};super({chains:e,options:r}),w(this,"id","injected"),w(this,"name"),w(this,"ready"),y(this,Ae,void 0),w(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),w(this,"onAccountsChanged",(e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,P.K)(e[0])})})),w(this,"onChainChanged",(e=>{const t=_(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})})),w(this,"onDisconnect",(async e=>{1013===e.code&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&this.storage?.removeItem(this.shimDisconnectKey))}));const n=r.getProvider();if("string"==typeof r.name)this.name=r.name;else if(n){const e=function(e){if(!e)return"Injected";const t=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isStatus?"Status":e.isTalisman?"Talisman":e.isTally?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0;if(e.providers?.length){const r=new Set;let n=1;for(const i of e.providers){let e=t(i);e||(e=`Unknown Wallet #${n}`,n+=1),r.add(e)}const i=[...r];return i.length?i:i[0]??"Injected"}return t(e)??"Injected"}(n);r.name?this.name=r.name(e):this.name="string"==typeof e?e:e[0]}else this.name="Injected";this.ready=!!n}async connect({chainId:e}={}){try{const t=await this.getProvider();if(!t)throw new I;t.on&&(t.on("accountsChanged",this.onAccountsChanged),t.on("chainChanged",this.onChainChanged),t.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const r=await t.request({method:"eth_requestAccounts"}),n=(0,P.K)(r[0]);let i=await this.getChainId(),o=this.isChainUnsupported(i);return e&&i!==e&&(i=(await this.switchChain(e)).id,o=this.isChainUnsupported(i)),this.options.shimDisconnect&&this.storage?.setItem(this.shimDisconnectKey,!0),{account:n,chain:{id:i,unsupported:o}}}catch(e){if(this.isUserRejectedRequestError(e))throw new O.ab(e);if(-32002===e.code)throw new O.pT(e);throw e}}async disconnect(){const e=await this.getProvider();e?.removeListener&&(e.removeListener("accountsChanged",this.onAccountsChanged),e.removeListener("chainChanged",this.onChainChanged),e.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&this.storage?.removeItem(this.shimDisconnectKey))}async getAccount(){const e=await this.getProvider();if(!e)throw new I;const t=await e.request({method:"eth_accounts"});return(0,P.K)(t[0])}async getChainId(){const e=await this.getProvider();if(!e)throw new I;return e.request({method:"eth_chainId"}).then(_)}async getProvider(){const e=this.options.getProvider();return e&&x(this,Ae,e),v(this,Ae)}async getWalletClient({chainId:e}={}){const[t,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find((t=>t.id===e));if(!t)throw new Error("provider is required.");return fe({account:r,chain:n,transport:xe(t)})}async isAuthorized(){try{if(this.options.shimDisconnect&&!this.storage?.getItem(this.shimDisconnectKey))return!1;if(!await this.getProvider())throw new I;return!!await this.getAccount()}catch{return!1}}async switchChain(e){const t=await this.getProvider();if(!t)throw new I;const r=(0,s.eC)(e);try{return await Promise.all([t.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),new Promise((t=>this.on("change",(({chain:r})=>{r?.id===e&&t()}))))]),this.chains.find((t=>t.id===e))??{id:e,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(n){const i=this.chains.find((t=>t.id===e));if(!i)throw new E({chainId:e,connectorId:this.id});if(4902===n.code||4902===n?.data?.originalError?.code)try{if(await t.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:i.name,nativeCurrency:i.nativeCurrency,rpcUrls:[i.rpcUrls.public?.http[0]??""],blockExplorerUrls:this.getBlockExplorerUrls(i)}]}),await this.getChainId()!==e)throw new O.ab(new Error("User rejected switch after adding network."));return i}catch(e){throw new O.ab(e)}if(this.isUserRejectedRequestError(n))throw new O.ab(n);throw new O.x3(n)}}async watchAsset({address:e,decimals:t=18,image:r,symbol:n}){const i=await this.getProvider();if(!i)throw new I;return i.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,decimals:t,image:r,symbol:n}}})}isUserRejectedRequestError(e){return 4001===e.code}};Ae=new WeakMap;var Ee=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Ie=(e,t,r)=>(Ee(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Pe=(e,t,r,n)=>(Ee(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Oe=r(1920),Se=r(6647),ke=r(1826),Me=r(6873),Te=r(1327),Ne=r(7871);function je(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return(0,ie.v)(t)?t:null}function Re(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,s.ci)(t);const r=e.split(".");for(let e=r.length-1;e>=0;e-=1){const n=je(r[e]),i=n?(0,Te.O0)(n):(0,Ne.w)((0,Te.qX)(r[e]),"bytes");t=(0,Ne.w)((0,B.zo)([t,i]),"bytes")}return(0,s.ci)(t)}function Le(e){const t=new Uint8Array(32).fill(0);return e?je(e)||(0,Ne.w)((0,Te.qX)(e)):(0,s.ci)(t)}function Be(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const r=new Uint8Array((0,Te.qX)(t).byteLength+2);let n=0;const i=t.split(".");for(let e=0;e255&&(t=(0,Te.qX)(`[${Le(i[e]).slice(2)}]`)),r[n]=t.length,r.set(t,n+1),n+=t.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const $e=3;function Ue(e,{abi:t,address:r,args:n,docsPath:i,functionName:o,sender:s}){const{code:a,data:c,message:l,shortMessage:u}=e instanceof Se.VQ?e:e instanceof z.G?e.walk((e=>"data"in e)):{};let h=e;return e instanceof L.wb?h=new Se.Dk({functionName:o}):a===$e&&(c||l||u)&&(h=new Se.Lu({abi:t,data:"object"==typeof c?c.data:c,functionName:o,message:u??l})),new Se.uq(h,{abi:t,args:n,contractAddress:r,docsPath:i,functionName:o,sender:s})}var De=r(5291);async function ze(e,{abi:t,address:r,args:n,functionName:i,...o}){const s=(0,de.R)({abi:t,args:n,functionName:i});try{const{data:a}=await(0,De.R)(e,{data:s,to:r,...o});return(0,ke.k)({abi:t,args:n,functionName:i,data:a||"0x"})}catch(e){throw Ue(e,{abi:t,address:r,args:n,docsPath:"/docs/contract/readContract",functionName:i})}}class We extends z.G{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class Fe extends z.G{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class He extends z.G{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class qe extends z.G{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Ve=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Ge=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,Ke=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Ze=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function Qe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Ye({uri:e,gatewayUrls:t}){const r=Ke.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};const n=Qe(t?.ipfs,"https://ipfs.io"),i=Qe(t?.arweave,"https://arweave.net"),o=e.match(Ve),{protocol:s,subpath:a,target:c,subtarget:l=""}=o?.groups||{},u="ipns:/"===s||"ipns/"===a,h="ipfs:/"===s||"ipfs/"===a||Ge.test(e);if(e.startsWith("http")&&!u&&!h){let r=e;return t?.arweave&&(r=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:r,isOnChain:!1,isEncoded:!1}}if((u||h)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===s&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(Ze,"");if(d.startsWith("{const r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e}))}}(r);if(i)return r;throw new He({uri:t})}async function et(e,{blockNumber:t,blockTag:r,name:n,key:o,universalResolverAddress:a}){let c=a;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=(0,i.LI)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const l=await ze(e,{address:c,abi:Oe.lD,functionName:"resolve",args:[(0,s.NC)(Be(n)),(0,de.R)({abi:Oe.nZ,functionName:"text",args:[Re(n),o]})],blockNumber:t,blockTag:r});if("0x"===l[0])return null;const u=(0,ke.k)({abi:Oe.nZ,functionName:"text",data:l[0]});return""===u?null:u}var tt=r(5554);function rt(e,{method:t}){const r={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:n,status:i,transport:o})=>{"success"===i&&t===e&&(r[n]=o.request)})),t=>r[t]||e.request}class nt extends z.G{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}var it=r(3693);const ot=e=>"string"==typeof e?(0,it.F)(e):(0,it.J)(e);var st=r(1494),at=r(8604);function ct({abi:e,eventName:t,args:r}){let n=e[0];if(t&&(n=(0,at.m)({abi:e,args:r,name:t}),!n))throw new L.mv(t,{docsPath:"/docs/contract/encodeEventTopics"});if("event"!==n.type)throw new L.mv(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const i=(0,st.t)(n),o=ot(i);let s=[];if(r&&"inputs"in n){const e=n.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(r)?r:Object.values(r).length>0?e?.map((e=>r[e.name]))??[]:[];t.length>0&&(s=e?.map(((e,r)=>Array.isArray(t[r])?t[r].map(((n,i)=>lt({param:e,value:t[r][i]}))):t[r]?lt({param:e,value:t[r]}):null))??[])}return[o,...s]}function lt({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return(0,Ne.w)((0,Te.O0)(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new nt(e.type);return(0,$.E)([e],[t])}async function ut(e,{address:t,abi:r,args:n,eventName:i,fromBlock:o,strict:a,toBlock:c}){const l=rt(e,{method:"eth_newFilter"}),u=i?ct({abi:r,args:n,eventName:i}):void 0,h=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof o?(0,s.eC)(o):o,toBlock:"bigint"==typeof c?(0,s.eC)(c):c,topics:u}]});return{abi:r,args:n,eventName:i,id:h,request:l(h),strict:a,type:"event"}}async function ht(e,{address:t,args:r,event:n,fromBlock:i,strict:o,toBlock:a}={}){const c=rt(e,{method:"eth_newFilter"});let l=[];n&&(l=ct({abi:[n],eventName:n.name,args:r}));const u=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?(0,s.eC)(i):i,toBlock:"bigint"==typeof a?(0,s.eC)(a):a,...l.length?{topics:l}:{}}]});return{abi:n?[n]:void 0,args:r,eventName:n?n.name:void 0,id:u,request:c(u),strict:o,type:"event"}}async function dt(e){const t=rt(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}const pt=new Map,ft=new Map;const mt=e=>`blockNumber.${e}`;async function gt(e,{maxAge:t=e.pollingInterval}={}){const r=await async function(e,{cacheKey:t,maxAge:r=1/0}){const n=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),r=t(e,pt),n=t(e,ft);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}(t),i=n.response.get();if(i&&r>0&&(new Date).getTime()-i.created.getTime()e.request({method:"eth_blockNumber"})),{cacheKey:mt(e.uid),maxAge:t});return BigInt(r)}var wt=r(558);const bt="/docs/contract/decodeEventLog";function vt({abi:e,data:t,strict:r,topics:n}){const i=r??!0,[o,...s]=n;if(!o)throw new L.FM({docsPath:bt});const a=e.find((e=>"event"===e.type&&o===ot((0,st.t)(e))));if(!a||!("name"in a)||"event"!==a.type)throw new L.lC(o,{docsPath:bt});const{name:c,inputs:l}=a,u=l?.some((e=>!("name"in e&&e.name)));let h=u?[]:{};const d=l.filter((e=>"indexed"in e&&e.indexed));if(s.length>0)for(let e=0;e!("indexed"in e&&e.indexed)));if(p.length>0)if(t&&"0x"!==t)try{const e=(0,wt.r)(p,t);if(e)if(u)h=[...h,...e];else for(let t=0;t0?h:void 0}}function yt({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,wt.r)([e],t)||[])[0]}async function xt(e,{filter:t}){const r="strict"in t&&t.strict;return(await t.request({method:"eth_getFilterChanges",params:[t.id]})).map((e=>{if("string"==typeof e)return e;try{const{eventName:n,args:i}="abi"in t&&t.abi?vt({abi:t.abi,data:e.data,topics:e.topics,strict:r}):{eventName:void 0,args:void 0};return u(e,{args:i,eventName:n})}catch(r){let n,i;if(r instanceof L.SM||r instanceof L.Gy){if("strict"in t&&t.strict)return;n=r.abiItem.name,i=r.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return u(e,{args:i?[]:{},eventName:n})}})).filter(Boolean)}async function At(e,{address:t,blockHash:r,fromBlock:n,toBlock:i,event:o,args:a,strict:c}={}){const l=c??!1;let h,d=[];return o&&(d=ct({abi:[o],eventName:o.name,args:a})),h=r?await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:"bigint"==typeof n?(0,s.eC)(n):n,toBlock:"bigint"==typeof i?(0,s.eC)(i):i}]}),h.map((e=>{try{const{eventName:t,args:r}=o?vt({abi:[o],data:e.data,topics:e.topics,strict:l}):{eventName:void 0,args:void 0};return u(e,{args:r,eventName:t})}catch(t){let r,n;if(t instanceof L.SM||t instanceof L.Gy){if(l)return;r=t.abiItem.name,n=t.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return u(e,{args:n?[]:{},eventName:r})}})).filter(Boolean)}async function Ct(e,{blockHash:t,blockNumber:r,blockTag:n="latest",hash:i,index:o}){const a=void 0!==r?(0,s.eC)(r):void 0;let l=null;if(i?l=await e.request({method:"eth_getTransactionByHash",params:[i]}):t?l=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,s.eC)(o)]}):(a||n)&&(l=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||n,(0,s.eC)(o)]})),!l)throw new F.Bh({blockHash:t,blockNumber:r,blockTag:n,hash:i,index:o});return(e.chain?.formatters?.transaction?.format||c)(l)}async function Et(e,{hash:t}){const r=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!r)throw new F.Yb({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||d)(r)}async function It(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const _t="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";async function Pt(e,{address:t,hash:r,signature:n,...i}){const o=(0,ie.v)(n)?n:(0,s.NC)(n);try{const{data:n}=await(0,De.R)(e,{data:D({abi:Oe.$o,args:[t,r,o],bytecode:_t}),...i});return a=n??"0x0",c="0x1",function(e,t){if(e.length!==t.length)return!1;for(let r=0;r`${t} ${e}`)).join(",")})`;return r}({primaryType:e,types:t}));return(0,Ne.w)(r)}function Tt({primaryType:e,types:t},r=new Set){const n=e.match(/^\w*/u),i=n?.[0];if(r.has(i)||void 0===t[i])return r;r.add(i);for(const e of t[i])Tt({primaryType:e.type,types:t},r);return r}function Nt({types:e,name:t,type:r,value:n}){if(void 0!==e[r])return[{type:"bytes32"},(0,Ne.w)(kt({data:n,primaryType:r,types:e}))];if("bytes"===r)return n="0x"+((n.length%2?"0":"")+n.slice(2)),[{type:"bytes32"},(0,Ne.w)(n)];if("string"===r)return[{type:"bytes32"},(0,Ne.w)((0,s.NC)(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),o=n.map((r=>Nt({name:t,type:i,types:e,value:r})));return[{type:"bytes32"},(0,Ne.w)((0,$.E)(o.map((([e])=>e)),o.map((([,e])=>e))))]}return[{type:r},n]}BigInt(0),BigInt(1),BigInt(2),Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const jt=new Map,Rt=new Map;let Lt=0;function Bt(e,t,r){const n=++Lt,i=()=>jt.get(e)||[],o=()=>{const t=Rt.get(e);1===i().length&&t&&t(),(()=>{const t=i();jt.set(e,t.filter((e=>e.id!==n)))})()},s=i();if(jt.set(e,[...s,{id:n,fns:t}]),s&&s.length>0)return o;const a={};for(const e in t)a[e]=(...t)=>{const r=i();0!==r.length&&r.forEach((r=>r.fns[e]?.(...t)))};const c=r(a);return"function"==typeof c&&Rt.set(e,c),o}function $t(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let i=!0;const o=()=>i=!1;return(async()=>{let s;t&&(s=await e({unpoll:o}));const a=await(r?.(s))??n;await ge(a);const c=async()=>{i&&(await e({unpoll:o}),await ge(n),c())};c()})(),o}function Ut(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:a=e.pollingInterval}){let c;return(void 0!==s?s:"webSocket"!==e.transport.type)?Bt((0,oe.P)(["watchBlockNumber",e.uid,t,r,a]),{onBlockNumber:n,onError:i},(n=>$t((async()=>{try{const t=await gt(e,{maxAge:0});if(c){if(t===c)return;if(t-c>1&&r)for(let e=c+1n;ec)&&(n.onBlockNumber(t,c),c=t)}catch(e){n.onError?.(e)}}),{emitOnBegin:t,interval:a}))):(()=>{let t=!0,r=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newHeads"],onData(e){if(!t)return;const r=(0,o.y_)(e.result?.number);n(r,c),c=r},onError(e){i?.(e)}});r=s,t||r()}catch(e){i?.(e)}})(),r})()}const Dt=e=>({call:t=>(0,De.R)(e,t),createBlockFilter:()=>async function(e){const t=rt(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}(e),createContractEventFilter:t=>ut(e,t),createEventFilter:t=>ht(e,t),createPendingTransactionFilter:()=>dt(e),estimateContractGas:t=>async function(e,{abi:t,address:r,args:n,functionName:i,...o}){const s=(0,de.R)({abi:t,args:n,functionName:i});try{return await Q(e,{data:s,to:r,...o})}catch(e){const s=o.account?(0,S.T)(o.account):void 0;throw Ue(e,{abi:t,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:i,sender:s?.address})}}(e,t),estimateGas:t=>Q(e,t),getBalance:t=>async function(e,{address:t,blockNumber:r,blockTag:n="latest"}){const i=r?(0,s.eC)(r):void 0,o=await e.request({method:"eth_getBalance",params:[t,i||n]});return BigInt(o)}(e,t),getBlock:t=>J(e,t),getBlockNumber:t=>gt(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){const i=void 0!==r?(0,s.eC)(r):void 0;let a;return a=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),(0,o.ly)(a)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:r,blockTag:n="latest"}){const i=void 0!==r?(0,s.eC)(r):void 0,o=await e.request({method:"eth_getCode",params:[t,i||n]});if("0x"!==o)return o}(e,t),getChainId:()=>R(e),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:r,name:n,universalResolverAddress:o}){let a=o;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=(0,i.LI)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=await ze(e,{address:a,abi:Oe.lD,functionName:"resolve",args:[(0,s.NC)(Be(n)),(0,de.R)({abi:Oe.Ei,functionName:"addr",args:[Re(n)]})],blockNumber:t,blockTag:r});if("0x"===i[0])return null;const o=(0,ke.k)({abi:Oe.Ei,functionName:"addr",data:i[0]});return"0x00"===(0,Me.f)(o)?null:o}catch(e){if(e instanceof Se.uq){const t=e.cause?.reason;if(t?.includes("Wildcard on non-extended resolvers is not supported"))return null}throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:r,gatewayUrls:n,name:i,universalResolverAddress:o}){const s=await et(e,{blockNumber:t,blockTag:r,key:"avatar",name:i,universalResolverAddress:o});if(!s)return null;try{return await async function(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?async function(e,{gatewayUrls:t,record:r}){const n=function(e){e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[t,r,n]=e.split("/"),[i,o]=t.split(":"),[s,a]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new Fe({reason:"Only EIP-155 supported"});if(!o)throw new Fe({reason:"Chain ID not found"});if(!a)throw new Fe({reason:"Contract address not found"});if(!n)throw new Fe({reason:"Token ID not found"});if(!s)throw new Fe({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:s.toLowerCase(),contractAddress:a,tokenID:n}}(r),i=await async function(e,{nft:t}){if("erc721"===t.namespace)return ze(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return ze(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new qe({namespace:t.namespace})}(e,{nft:n}),{uri:o,isOnChain:s,isEncoded:a}=Ye({uri:i,gatewayUrls:t});if(s&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const e=a?atob(o.replace("data:application/json;base64,","")):o;return Xe({uri:Je(JSON.parse(e)),gatewayUrls:t})}let c=n.tokenID;return"erc1155"===n.namespace&&(c=c.replace("0x","").padStart(64,"0")),async function({gatewayUrls:e,uri:t}){try{const r=await fetch(t).then((e=>e.json()));return await Xe({gatewayUrls:e,uri:Je(r)})}catch{throw new He({uri:t})}}({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:r}):Xe({uri:r,gatewayUrls:t})}(e,{record:s,gatewayUrls:n})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:r,blockTag:n,universalResolverAddress:o}){let a=o;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=(0,i.LI)({blockNumber:r,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{return(await ze(e,{address:a,abi:[{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],functionName:"reverse",args:[(0,s.NC)(Be(c))],blockNumber:r,blockTag:n}))[0]}catch(e){if(e instanceof Se.uq&&e.cause.reason===tt.$[50])return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:r,name:n,universalResolverAddress:o}){let a=o;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=(0,i.LI)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[c]=await ze(e,{address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,s.NC)(Be(n))],blockNumber:t,blockTag:r});return c}(e,t),getEnsText:t=>et(e,t),getFeeHistory:t=>async function(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const o=r?(0,s.eC)(r):void 0;return{baseFeePerGas:(a=await e.request({method:"eth_feeHistory",params:[(0,s.eC)(t),o||n,i]})).baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:a.gasUsedRatio,oldestBlock:BigInt(a.oldestBlock),reward:a.reward?.map((e=>e.map((e=>BigInt(e)))))};var a}(e,t),getFilterChanges:e=>xt(0,e),getFilterLogs:e=>async function(e,{filter:t}){const r=t.strict??!1;return(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>{try{const{eventName:n,args:i}="abi"in t&&t.abi?vt({abi:t.abi,data:e.data,topics:e.topics,strict:r}):{eventName:void 0,args:void 0};return u(e,{args:i,eventName:n})}catch(r){let n,i;if(r instanceof L.SM||r instanceof L.Gy){if("strict"in t&&t.strict)return;n=r.abiItem.name,i=r.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return u(e,{args:i?[]:{},eventName:n})}})).filter(Boolean)}(0,e),getGasPrice:()=>X(e),getLogs:t=>At(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:r,blockTag:n="latest",slot:i}){const o=void 0!==r?(0,s.eC)(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,i,o||n]})}(e,t),getTransaction:t=>Ct(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:r}){const[n,i]=await Promise.all([gt(e),t?Ct(e,{hash:t}):void 0]),o=r?.blockNumber||i?.blockNumber;return o?n-o+1n:0n}(e,t),getTransactionCount:t=>ee(e,t),getTransactionReceipt:t=>Et(e,t),multicall:t=>async function(e,t){const{allowFailure:r=!0,batchSize:n,blockNumber:o,blockTag:s,contracts:a,multicallAddress:c}=t,l=n??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024),u=a;let h=c;if(!h){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");h=(0,i.LI)({blockNumber:o,chain:e.chain,contract:"multicall3"})}const d=[[]];let p=0,f=0;for(let e=0;e0&&f>l&&(p++,f=(e.length-2)/2,d[p]=[]),d[p]=[...d[p],{allowFailure:!0,callData:e,target:n}]}catch(e){const s=Ue(e,{abi:t,address:n,args:i,docsPath:"/docs/contract/multicall",functionName:o});if(!r)throw s;d[p]=[...d[p],{allowFailure:!0,callData:"0x",target:n}]}}return(await Promise.all(d.map((t=>ze(e,{abi:Oe.F8,address:h,args:[t],blockNumber:o,blockTag:s,functionName:"aggregate3"}))))).flat().map((({returnData:e,success:t},n)=>{const i=d.flat(),{callData:o}=i[n],{abi:s,address:a,functionName:c,args:l}=u[n];try{if("0x"===o)throw new L.wb;if(!t)throw new Se.VQ({data:e});const n=(0,ke.k)({abi:s,data:e,functionName:c});return r?{result:n,status:"success"}:n}catch(e){const t=Ue(e,{abi:s,address:a,args:l,docsPath:"/docs/contract/multicall",functionName:c});if(!r)throw t;return{error:t,result:void 0,status:"failure"}}}))}(e,t),readContract:t=>ze(e,t),simulateContract:t=>async function(e,{abi:t,address:r,args:n,dataSuffix:i,functionName:o,...s}){const a=s.account?(0,S.T)(s.account):void 0,c=(0,de.R)({abi:t,args:n,functionName:o});try{const{data:a}=await(0,De.R)(e,{batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...s});return{result:(0,ke.k)({abi:t,args:n,functionName:o,data:a||"0x"}),request:{abi:t,address:r,args:n,functionName:o,...s}}}catch(e){throw Ue(e,{abi:t,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:o,sender:a?.address})}}(e,t),verifyMessage:t=>async function(e,{address:t,message:r,signature:n,...i}){const o=function(e,t){const r="string"==typeof e?(0,Te.qX)(e):e.raw instanceof Uint8Array?e.raw:(0,Te.O0)(e.raw),n=(0,Te.qX)(`Ethereum Signed Message:\n${r.length}`);return(0,Ne.w)((0,B.zo)([n,r]),void 0)}(r);return Pt(e,{address:t,hash:o,signature:n,...i})}(e,t),verifyTypedData:t=>async function(e,{address:t,signature:r,message:n,primaryType:i,types:o,domain:s,...a}){return Pt(e,{address:t,hash:Ot({message:n,primaryType:i,types:o,domain:s}),signature:r,...a})}(e,t),uninstallFilter:e=>It(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:r,onReplaced:n,pollingInterval:i=e.pollingInterval,timeout:o}){const s=(0,oe.P)(["waitForTransactionReceipt",e.uid,r]);let a,c,l,u=!1;return new Promise(((h,d)=>{o&&setTimeout((()=>d(new F.mc({hash:r}))),o);const p=Bt(s,{onReplaced:n,resolve:h,reject:d},(n=>{const o=Ut(e,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(i){if(u)return;let s=i;const h=async e=>{o(),e(),p()};try{if(l){if(s-l.blockNumber+1nn.resolve(l)))}if(a||(u=!0,await we((async()=>{a=await Ct(e,{hash:r}),a.blockNumber&&(s=a.blockNumber)}),{delay:({count:e})=>200*~~(1<0&&s-l.blockNumber+1nn.resolve(l)))}catch(r){if(a&&(r instanceof F.Bh||r instanceof F.Yb)){c=a;const r=(await J(e,{blockNumber:s,includeTransactions:!0})).transactions.find((({from:e,nonce:t})=>e===c.from&&t===c.nonce));if(!r)return;if(l=await Et(e,{hash:r.hash}),s-l.blockNumber+1n{n.onReplaced?.({reason:i,replacedTransaction:c,transaction:r,transactionReceipt:l}),n.resolve(l)}))}else h((()=>n.reject(r)))}}});return o}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:o,includeTransactions:s=!1,poll:a,pollingInterval:c=e.pollingInterval}){let u;return(void 0!==a?a:"webSocket"!==e.transport.type)?Bt((0,oe.P)(["watchBlocks",e.uid,r,n,s,c]),{onBlock:i,onError:o},(i=>$t((async()=>{try{const n=await J(e,{blockTag:t,includeTransactions:s});if(n.number&&u?.number){if(n.number===u.number)return;if(n.number-u.number>1&&r)for(let t=u?.number+1n;tu.number)&&(i.onBlock(n,u),u=n)}catch(e){i.onError?.(e)}}),{emitOnBegin:n,interval:c}))):(()=>{let t=!0,r=()=>t=!1;return(async()=>{try{const{unsubscribe:n}=await e.transport.subscribe({params:["newHeads"],onData(r){if(!t)return;const n=(e.chain?.formatters?.block?.format||l)(r.result);i(n,u),u=n},onError(e){o?.(e)}});r=n,t||r()}catch(e){o?.(e)}})(),r})()}(e,t),watchBlockNumber:t=>Ut(e,t),watchContractEvent:t=>function(e,{abi:t,address:r,args:n,batch:i=!0,eventName:o,onError:s,onLogs:a,pollingInterval:c=e.pollingInterval,strict:l}){const u=(0,oe.P)(["watchContractEvent",r,n,i,e.uid,o,c]),h=l??!1;return Bt(u,{onLogs:a,onError:s},(s=>{let a,l,u=!1;const d=$t((async()=>{if(u)try{let c;if(l)c=await xt(0,{filter:l});else{const i=await gt(e);c=a&&a!==i?await At(e,{address:r,args:n,fromBlock:a+1n,toBlock:i,event:(0,at.m)({abi:t,name:o})}):[],a=i}if(0===c.length)return;i?s.onLogs(c):c.forEach((e=>s.onLogs([e])))}catch(e){s.onError?.(e)}else{try{l=await ut(e,{abi:t,address:r,args:n,eventName:o,strict:h})}catch{}u=!0}}),{emitOnBegin:!0,interval:c});return async()=>{l&&await It(0,{filter:l}),d()}}))}(e,t),watchEvent:t=>function(e,{address:t,args:r,batch:n=!0,event:i,onError:o,onLogs:s,pollingInterval:a=e.pollingInterval,strict:c}){const l=(0,oe.P)(["watchEvent",t,r,n,e.uid,i,a]),u=c??!1;return Bt(l,{onLogs:s,onError:o},(o=>{let s,c,l=!1;const h=$t((async()=>{if(l)try{let a;if(c)a=await xt(0,{filter:c});else{const n=await gt(e);a=s&&s!==n?await At(e,{address:t,args:r,fromBlock:s+1n,toBlock:n,event:i}):[],s=n}if(0===a.length)return;n?o.onLogs(a):a.forEach((e=>o.onLogs([e])))}catch(e){o.onError?.(e)}else{try{c=await ht(e,{address:t,args:r,event:i,strict:u})}catch{}l=!0}}),{emitOnBegin:!0,interval:a});return async()=>{c&&await It(0,{filter:c}),h()}}))}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:r,onTransactions:n,poll:i,pollingInterval:o=e.pollingInterval}){return(void 0!==i?i:"webSocket"!==e.transport.type)?Bt((0,oe.P)(["watchPendingTransactions",e.uid,t,o]),{onTransactions:n,onError:r},(r=>{let n;const i=$t((async()=>{try{if(!n)try{return void(n=await dt(e))}catch(e){throw i(),e}const o=await xt(0,{filter:n});if(0===o.length)return;t?r.onTransactions(o):o.forEach((e=>r.onTransactions([e])))}catch(e){r.onError?.(e)}}),{emitOnBegin:!0,interval:o});return async()=>{n&&await It(0,{filter:n}),i()}})):(()=>{let t=!0,i=()=>t=!1;return(async()=>{try{const{unsubscribe:o}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const r=e.result;n([r])},onError(e){r?.(e)}});i=o,t||i()}catch(e){r?.(e)}})(),i})()}(e,t)});function zt({batch:e,chain:t,key:r="public",name:n="Public Client",transport:i,pollingInterval:o}){const s={batch:e,...j({chain:t,key:r,name:n,pollingInterval:o,transport:i,type:"publicClient"})};return{...s,...Dt(s)}}function Wt(e,t={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:o,retryDelay:s}=t;return({chain:t,pollingInterval:a=4e3,timeout:c})=>{let l=e,u=()=>{};const h=ye({key:r,name:n,async request({method:e,params:r}){const n=async(i=0)=>{const o=l[i]({chain:t,retryCount:0,timeout:c});try{const t=await o.request({method:e,params:r});return u({method:e,params:r,response:t,transport:o,status:"success"}),t}catch(t){if(u({error:t,method:e,params:r,transport:o,status:"error"}),be(t))throw t;if(i===l.length-1)throw t;return n(i+1)}};return n()},retryCount:o,retryDelay:s,type:"fallback"},{onResponse:e=>u=e,transports:l.map((e=>e({chain:t,retryCount:0})))});if(i){const e="object"==typeof i?i:{};!function({chain:e,interval:t=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:o,weights:s={}}){const{stability:a=.7,latency:c=.3}=s,l=[],u=async()=>{const s=await Promise.all(o.map((async t=>{const r=t({chain:e,retryCount:0,timeout:i}),n=Date.now();let o,s;try{await r.request({method:"net_listening"}),s=1}catch{s=0}finally{o=Date.now()}return{latency:o-n,success:s}})));l.push(s),l.length>n&&l.shift();const h=Math.max(...l.map((e=>Math.max(...e.map((({latency:e})=>e)))))),d=o.map(((e,t)=>{const r=l.map((e=>e[t].latency)),n=1-r.reduce(((e,t)=>e+t),0)/r.length/h,i=l.map((e=>e[t].success)),o=i.reduce(((e,t)=>e+t),0)/i.length;return 0===o?[0,t]:[c*n+a*o,t]})).sort(((e,t)=>t[0]-e[0]));r(d.map((([,e])=>o[e]))),await ge(t),u()};u()}({chain:t,interval:e.interval??a,onTransports:e=>l=e,sampleCount:e.sampleCount,timeout:e.timeout,transports:l,weights:e.weights})}return h}}class Ft extends z.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}var Ht=r(8583);function qt(e,{errorInstance:t,timeout:r,signal:n}){return new Promise(((i,o)=>{(async()=>{let s;try{const a=new AbortController;r>0&&(s=setTimeout((()=>{n?a.abort():o(t)}),r)),i(await e({signal:a?.signal}))}catch(e){"AbortError"===e.name&&o(t),o(e)}finally{clearTimeout(s)}})()}))}let Vt=0;const Gt=new Map;async function Kt(e){const t=new URL(e),n=t.toString();let i=Gt.get(n);if(i)return i;const{schedule:o}=(0,Ht.S)({id:n,fn:async()=>{let e=await Promise.resolve().then(r.bind(r,5289));e=e.default?.constructor?e.default:e.WebSocket;const o=new e(t),s=new Map,a=new Map,c=({data:e})=>{const t=JSON.parse(e),r="eth_subscription"===t.method,n=r?t.params.subscription:t.id,i=r?a:s,o=i.get(n);o&&o({data:e}),r||i.delete(n)},l=()=>{Gt.delete(n),o.removeEventListener("close",l),o.removeEventListener("message",c)};return o.addEventListener("close",l),o.addEventListener("message",c),o.readyState===e.CONNECTING&&await new Promise(((e,t)=>{o&&(o.onopen=e,o.onerror=t)})),i=Object.assign(o,{requests:s,subscriptions:a}),Gt.set(n,i),[i]}}),[s,[a]]=await o();return a}const Zt={http:async function(e,{body:t,fetchOptions:r={},timeout:n=1e4}){const{headers:i,method:o,signal:s}=r;try{const a=await qt((async({signal:a})=>await fetch(e,{...r,body:Array.isArray(t)?(0,oe.P)(t.map((e=>({jsonrpc:"2.0",id:Vt++,...e})))):(0,oe.P)({jsonrpc:"2.0",id:Vt++,...t}),headers:{...i,"Content-Type":"application/json"},method:o||"POST",signal:s||(n>0?a:void 0)})),{errorInstance:new me.W5({body:t,url:e}),timeout:n,signal:!0});let c;if(c=a.headers.get("Content-Type")?.startsWith("application/json")?await a.json():await a.text(),!a.ok)throw new me.Gg({body:t,details:(0,oe.P)(c.error)||a.statusText,headers:a.headers,status:a.status,url:e});return c}catch(r){if(r instanceof me.Gg)throw r;if(r instanceof me.W5)throw r;throw new me.Gg({body:t,details:r.message,url:e})}},webSocket:function(e,{body:t,onResponse:r}){if(e.readyState===e.CLOSED||e.readyState===e.CLOSING)throw new me.c9({body:t,url:e.url,details:"Socket is closed."});const n=Vt++,i=({data:o})=>{const s=JSON.parse(o);"number"==typeof s.id&&n!==s.id||(r?.(s),"eth_subscribe"===t.method&&"string"==typeof s.result&&e.subscriptions.set(s.result,i),"eth_unsubscribe"===t.method&&e.subscriptions.delete(t.params?.[0]))};return e.requests.set(n,i),e.send(JSON.stringify({jsonrpc:"2.0",...t,id:n})),e},webSocketAsync:async function(e,{body:t,timeout:r=1e4}){return qt((()=>new Promise((r=>Zt.webSocket(e,{body:t,onResponse:r})))),{errorInstance:new me.W5({body:t,url:e.url}),timeout:r})}};var Qt=r(8617);function Yt(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var n;const i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}const Jt=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then:e=>Jt(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>Jt(t)(e)}}},Xt=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=n?n:"object"!=typeof i)?i:Object.assign({},t,i),r.forEach((r=>r(t,e)))}},i=()=>t,o={setState:n,getState:i,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(n,i,o),o};var er=r(263);function tr(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,n]of e)if(!Object.is(n,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;ne[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const h=2**31,d=h>>>1,p=h-1;let f=0;for(let e=0;e<31;e++)f=f<<1|u();let m=[],g=0,w=h;for(;;){let e=Math.floor(((f-g+1)*i-1)/w),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|u(),s=s<<1^d,a=(a^d)<<1|d|1;g=s,w=1+a-s}let b=n-4;return m.map((t=>{switch(t-b){case 3:return b+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return b+256+(e[a++]<<8|e[a++]);case 1:return b+e[a++];default:return t-1}}))}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,r)=>t[e.charCodeAt(0)]=r));let r=e.length,n=new Uint8Array(6*r>>3);for(let i=0,o=0,s=0,a=0;i=8&&(n[o++]=a>>(s-=8));return n}(e)))}function nr(e){return 1&e?~e>>1:e>>1}function ir(e,t){let r=Array(e);for(let n=0,i=0;n{let t=or(e);if(t.length)return t}))}function ar(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(ur(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(hr(r,e))}return t.flat()}function cr(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function lr(e,t,r){let n=Array(e).fill().map((()=>[]));for(let i=0;in[t].push(e)));return n}function ur(e,t){let r=1+t(),n=t(),i=cr(t);return lr(i.length,1+e,t).flatMap(((e,t)=>{let[o,...s]=e;return Array(i[t]).fill().map(((e,t)=>{let i=t*n;return[o+t*r,s.map((e=>e+i))]}))}))}function hr(e,t){return lr(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}var dr=rr("AEgSbwjEDVYByQKaAQsBOQDpATQAngDUAHsAoABoANQAagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXAA0ADgAWAA8AFAAVBFsF1QEXE0o3xAXUALIArkABaACmAgPGAK6AMDAwMAE/qAYK7P4HQAblMgVYBVkAPSw5Afa3EgfJwgAPA8meNALGCjACjqIChtk/j2+KAsXMAoPzASDgCgDyrgFCAi6OCkCQAOQA4woWABjVuskNDD6eBBx4AP4COhi+D+wKBirqBgSCaA0cBy4ArABqku+mnIAAXAaUJAbqABwAPAyUFvyp/Mo8INAIvCoDshQ8APcubKQAon4ZABgEJtgXAR4AuhnOBPsKIE04CZgJiR8cVlpM5INDABQADQAWAA9sVQAiAA8ASO8W2T30OVnKluYvChEeX05ZPe0AFAANABYAD2wgXUCYAMPsABwAOgzGFryp/AHauQVcBeMC0KACxLEKTR2kZhR0Gm5M9gC8DmgC4gAMLjSKF8qSAoF8ARMcAL4OaALiAAwuAUlQJpJMCwMt/AUpCthqGK4B2EQAciwSeAIyFiIDKCi6OGwAOuIB9iYAyA7MtgEcZIIAsgYABgCK1EoFHNZsGACoKNIBogAAAAAAKy4DnABoAQoaPu43dQQZGACrAcgCIgDgLBJ0OvRQsTOiKDVJBfsoBVoFWbC5BWo7XkITO1hCmHuUZmCh+QwUA8YIJvJ4JASkTAJUVAJ2HKwoAZCkpjZcA0YYBIRiCgDSBqxAMCQHKgI6XgBsAWIgcgCEHhoAlgFKuAAoahgBsMYDOC4iRFQBcFoGZgJmAPJKGAMqAgYASkIArABeAHQALLYGCPTwGo6AAAAKIgAqALQcSAHSAdwIDDKXeYHpAAsAEgA1AD4AOTR3etTBEGAQXQJNCkxtOxUMAq0PpwvmERYM0irM09kANKoH7ANUB+wDVANUB+wH7ANUB+wDVANUA1QDVBwL8BvUwRBgD0kEbgWPBYwE1wiEJkoRggcpCNNUDnQfHEgDRgD9IyZJHTuUMwwlQ0wNTQQH/TZDbKh9OQNIMaxU9pCjA8wyUDltAh5yEqEAKw90HTW2Tn96SHGhCkxPr7WASWNOaAK/Oqk/+QoiCZRvvHdPBj4QGCeiEPQMMAGyATgN6kvVBO4GOATGH3oZFg/KlZkIoi3aDOom4C6egFcj8iqABepL8TzaC0pRZQ9WC2IJ4DpggUsDHgEKIogK2g02CGoQ8ArGaA3iEUIHNgPSSZcAogb+Cw4dMhWyJg1iqQsGOXQG+BrzC4wmrBMmevkF0BoeBkoBJhr8AMwu5IWtWi5cGU9cBgALIiPEFKVQHQ0iQLR4RRoYBxIlpgKOQ21KhFEzHpAh8zw6DWMuEFF5B/I8AhlMC348m0aoRQsRzz6KPUUiRkwpBDJ8LCwniAnMD4IMtnxvAVYJHgmuDG4TLhEUN8IINgcWKpchJxIIHkaSYJcE9JwD8BPOAwgFPAk+BxADshwqEysVJgUKgSHUAvA20i6wAoxWfQEUBcgPIh/cEE1H3Q7mCJgCYgOAJegAKhUeABQimAhAYABcj9VTAi7ICMRqaSNxA2QU5F4RcAeODlQHpBwwFbwc3nDFXgiGBSigrAlYAXIJlgFcBOAIBjVYjJ0gPmdQi1UYmCBeQTxd+QIuDGIVnES6h3UCiA9oEhgBMgFwBzYM/gJ0EeoRaBCSCOiGATWyM/U6IgRMIYAgDgokA0xsywskJvYM9WYBoBJfAwk0OnfrZ6hgsyEX+gcWMsJBXSHuC49PygyZGr4YP1QrGeEHvAPwGvAn50FUBfwDoAAQOkoz6wS6C2YIiAk8AEYOoBQH1BhnCm6MzQEuiAG0lgNUjoACbIwGNAcIAGQIhAV24gAaAqQIoAACAMwDVAA2AqoHmgAWAII+AToDJCwBHuICjAOQCC7IAZIsAfAmBBjADBIA9DRuRwLDrgKAZ2afBdpVAosCRjIBSiIEAktETgOsbt4A2ABIBhDcRAESqEfIF+BAAdxsKADEAPgAAjIHAj4BygHwagC0AVwLLgmfsLIBSuYmAIAAEmgB1AKGANoAMgB87gFQAEoFVvYF0AJMRgEOLhUoVF4BuAMcATABCgB2BsiKosYEHARqB9ACEBgV3gLvKweyAyLcE8pCwgK921IAMhMKNQqkCqNgWF0wAy5vPU0ACx+lPsQ/SwVOO1A7VTtQO1U7UDtVO1A7VTtQO1UDlLzfvN8KaV9CYegMow3RRMU6RhPYYE5gLxPFLbQUvhXLJVMZOhq5JwIl4VUGDwEt0GYtCCk0che5ADwpZYM+Y4MeLQpIHORTjlT1LRgArkufM6wNqRsSRD0FRHXqYicWCwofAmR+AmI/WEqsWDcdAqH0AmiVAmYGAp+BOBgIAmY4AmYjBGsEfAN/EAN+jzkDOXQUOX86ICACbBoCMjM4BwJtxAJtq+yHMGRCKAFkANsA3gBHAgeVDIoA+wi/AAqyAncsAnafPAJ5SEACeLcaWdhFq0bwAnw8AnrFAn0GAnztR/1IemAhACgSSVVKWBIUSskC0P4C0MlLJAOITAOH40TCkS8C8p5dAAMDq0vLTCoiAMxNSU2sAos8AorVvhgEGkBkArQCjjQCjlk9lH4CjtYCjll1UbFTMgdS0VSCApP4ApMJAOYAGVUbVaxVzQMsGCmSgzLeeGNFODYCl5wC769YHqUAViIClowClnmZAKZZqVoGfkoAOAKWsgKWS1xBXM4CmcgCmWFcx10EFgKcmDm/OpoCnBMCn5gCnrWHABoMLicMAp3uAp6PALI6YTFh7AKe0AKgawGmAp6cHAKeS6JjxWQkIigCJ6wCJnsCoPgCoEnUAqYsAqXLAqf8AHoCp+9oeWiuAABGahlqzgKs4AKsqwKtZAKs/wJXGgJV2QKx3tQDH0tslAKyugoCsuUUbN1tYG1FXAMlygK2WTg8bo0DKUICuFsCuUQSArkndHAzcN4CvRYDLa8DMg4CvoVx/wMzbgK+F3Mfc0wCw8gCwwFzf3RIMkJ03QM8pAM8lwM9vALFeQLGRALGDYYCyGZOAshBAslMAskrAmSaAt3PeHZeeKt5IkvNAxigZv8CYfEZ8JUhewhej164DgLPaALPaSxIUM/wEJwAw6oCz3ABJucDTg9+SAIC3CQC24cC0kwDUlkDU1wA/gNViYCGPMgT6l1CcoLLg4oC2sQC2duEDYRGpzkDhqIALANkC4ZuVvYAUgLfYgLetXB0AuIs7REB8y0kAfSYAfLPhALr8ALpbXYC6vYC6uEA9kQBtgLuhgLrmZanlwAC7jwDhd2YdnDdcZ4C8wAAZgOOE5mQAvcQA5FrA5KEAveVAvnWAvhjmhmaqLg0mxsDnYAC/vcBGAA2nxmfsAMFigOmZwOm1gDOwgMGZ6GFogIGAwxGAQwBHAdqBl62ZAIAuARovA6IHrAKABRyNgAgAzASSgOGfAFgJB4AjOwAHgDmoAScjgi0BhygwgCoBRK86h4+PxZ5BWk4P0EsQiJCtV9yEl+9AJbGBTMAkE0am7o7J2AzErrQDjAYxxiKyfcFWAVZBVgFWQVkBVkFWAVZBVgFWQVYBVkFWAVZRxYI2IZoAwMDCmVe6iwEygOyBjC8vAC8BKi8AOhBKhazBUc+aj5xQkBCt192OF/pAFgSM6wAjP/MbMv9puhGez4nJAUsFyg3Nn5u32vB8hnDLGoBbNdvMRgFYAVrycLJuQjQSlwBAQEKfV5+jL8AND+CAAQW0gbmriQGAIzEDAMCDgDlZh4+JSBLQrJCvUI5JF8oYDcoOSQJwj4KRT9EPnk+gj5xPnICikK9SkM8X8xPUGtOCy1sVTBrDG8gX+E0OxwJaJwKYyQsPR4nQqxCvSzMAsv9X8oPIC8KCQoAACN+nt9rOy5LGMmsya0JZsLMzQphQWAP5hCkEgCTjh5GQiYbqm06zjkKND9EPnFCQBwICx5NSG1cLS5a4rwTCn7uHixCQBxeCUsKDzRVREM4BTtEnC0KghwuQkAb9glUIyQZMTIBBo9i8F8KcmTKYAxgLiRvAERgGjoDHB9gtAcDbBFmT2BOEgIAZOhgFmCWYH5gtGBMYJJpFhgGtg/cVqq8WwtDF6wBvCzOwgMgFgEdBB8BegJtMDGWU4EBiwq5SBsA5SR0jwvLDqdN6wGcAoidUAVBYAD4AD4LATUXWHsMpg0lILuwSABQDTUAFhO4NVUC0wxLZhEcANlPBnYECx9bADIAtwKbKAsWcKwzOaAaAVwBhwn9A9ruEAarBksGugAey1aqWwq7YhOKCy1ADrwBvAEjA0hbKSkpIR8gIi0TJwciDY4AVQJvWJFKlgJvIA9ySAHUdRDPUiEaqrFN6wcSBU1gAPgAPgsBewAHJW0LiAymOTEuyLBXDgwAYL0MAGRKaFAiIhzAADIAtwKbKC08D88CkRh8ULxYyXRzjtilnA72mhU+G+0S2hIHDxwByAk7EJQGESwNNwwAPAC0zwEDAKUA4gCbizAAFQBcG8cvbXcrDsIRAzwlRNTiHR8MG34CfATCC6vxbQA4Oi4Opzkuz6IdB7wKABA7Ls8SGgB9rNsdD7wbSBzOoncfAT4qYB0C7KAJBE3z5R9mDL0M+wg9Cj8ABcELPgJMDbwIvQ09CT0KvS7PoisOvAaYAhwPjBriBBwLvBY8AKELPBC8BRihe90AO2wMPQACpwm9BRzR9QYFB2/LBnwAB7wSXBISvQECAOsCAAB1FVwHFswV/HAXvBg8AC68AuyovAAevAJWISuAAAG8AALkFT0VvCvso7zJqDwEAp8nTAACXADn3hm8CaVcD7/FAPUafAiiBQv/cQDfvKe8GNwavKOMeXMG/KmchAASvAcbDAADlABtvAcAC7ynPAIaPLsIopzLDvwHwak8AOF8L7dtvwNJAAPsABW8AAb8AAm8AGmMABq8AA68Axi8jmoV/AABXAAObAAuTB8ABrwAF7wIIgANSwC6vCcAA7wADpwq7ACyWwAcHAAbvAAB7AqiAAXHCxYV3AAHnABCvAEDAGm8AAt8AB28AAi8CaIABcsAbqAZ1gCSCCIABcsAATwAB9wAHZwIIgAGmwAJfAAbLABtHADmvIEACFwACDwAFLwAaPwJIgAGywDjjAAJPAuiDsX7YAAHPABunUBJAEgACrwFAAM8AAmuAzgABxwAGXwAAgym/AAKHAAKPAAJ/KfsBrwACRwAAwwAEDwBABQ8ABFsAA+MAA3sAA28ABkMBxYcABU8AG6cFrQBvAC7ABM8BABpLAsA4UwAAjwABFMAF3wFHAAG0QAYvB8BfClTADpGALAJBw4McwApK3EBpQYIXwJtJA0ACghwTG1gK4oggRVjLjcDogq1AALZABcC/ARvAXdzSFMVIgNQAhY/AS0GBHRHvnxTe0EAKgAyAvwAVAvcAHyRLQEsAHfmDhIzRwJLAFgGAAJRAQiLzQB5PAQhpgBbANcWAJZpOCCMAM5ssgDQ1RcJw3Z0HBlXHgrSAYmRrCNUVE5JEz3DivoAgB04QSos4RKYUABzASosMSlDGhADMVYE+MbvAExm3QBrAnICQBF7Osh4LzXWBhETIAUVCK6v/xPNACYAAQIbAIYAiQCONgDjALQA1QCdPQC7AKsApgChAOcAnwDTAJwA4AEBAPwAwAB6AFsAywDNAPwA1wDrAIkAogEqAOMA2ADVBAIIKzTT09PTtb/bzM/NQjEWAUsBVS5GAVMBYgFhAVQBRUpCRGcMAUwUBgkEMzcMBwAgDSQmKCs3OTk8PDw9Pg0/HVBQUFBSUlFSKFNUVlVVHFxgYF9hYCNlZ29ucXFxcXFxc3Nzc3Nzc3Nzc3N1dXZ1dFsAPesAQgCTAHEAKwBf8QCHAFAAUAAwAm/oAIT+8fEAXQCM6wCYAEgAWwBd+PipAH4AfgBiAE8AqgAdAK8AfAI5AjwA9QDgAPcA9wDhAPgA4gDiAOEA3wAoAnQBSgE5ATcBTQE3ATcBNwEyATEBMQExARUBURAAKgkBAEwYCxcEFhcPAIcAjwCfAEoAYxkCKgBvAGgAkAMOAyArAxpCP0gqAIoCSADAAlACnQC5Ao8CjwKPAo8CjwKPAoQCjwKPAo8CjwKPAo8CjgKOApECmQKQAo8CjwKNAo0CjQKNAosCjgJuAc0CkAKYAo8CjwKOF3oMAPcGA5gCWgIzGAFNETYC2xILLBQBRzgUTpIBdKU9AWJaAP4DOkgA/wCSKh4ZkGsAKmEAagAvAIoDlcyM8K+FWwa7LA/DEgKe1nUrCwQkWwGzAN5/gYB/gX+Cg4N/hIeFf4aJh4GIg4mDin+Lf4x/jYuOf49/kIORf5J/k3+Uf5WElomXg5h/AIMloQCEBDwEOQQ7BD4EPARCBD8EOgRABEIEQQQ9BD8EQgCkA4gAylIA0AINAPdbAPcBGgD3APUA9QD2APXVhSRmvwD3APUA9QD2APUdAIpbAPcAigEaAPcAigLtAPcAitWFJGa/HQD4WwEaAPcA9wD1APUA9gD1APgA9QD1APYA9dWFJGa/HQCKWwEaAPcAigD3AIoC7QD3AIrVhSRmvx0CRAE3AksBOgJMwgOfAu0Dn9WFJGa/HQCKWwEaA58AigOfAIoC7QOfAIrVhSRmvx0EMQCKBDIAigeOMm4hLQCKAT9vBCQA/gDHWwMAVVv/FDMDAIoDPtkASgMAigMAl2dBtv/TrfLzakaPh3aztmIuZQrR3ER2n5Yo+qNR2jK/aP/V04UK1njIJXLgkab9PjOxyJDVbIN3R/FZLoZVl2kYFQIZ7V6LpRqGDt9OdDohnJKp5yX/HLj0voPpLrneDaN11t5W3sSM4ALscgSw8fyWLVkKa/cNcQmjYOgTLZUgOLi2F05g4TR0RfgZ4PBdntxdV3qvdxQt8DeaMMgjJMgwUxYN3tUNpUNx21AvwADDAIa0+raTWaoBXmShAl5AThpMi282o+WzOKMlxjHj7a+DI6AM6VI9w+xyh3Eyg/1XvPmbqjeg2MGXugHt8wW03DQMRTd5iqqOhjLvyOCcKtViGwAHVLyl86KqvxVX7MxSW8HLq6KCrLpB8SspAOHO9IuOwCh9poLoMEha9CHCxlRAXJNDobducWjqhFHqCkzjTM2V9CHslwq4iU19IxqhIFZMve15lDTiMVZIPdADXGxTqzSTv0dDWyk1ht430yvaYCy9qY0MQ3cC5c1uw4mHcTGkMHTAGC99TkNXFAiLQgw9ZWhwKJjGCe+J5FIaMpYhhyUnEgfrF3zEtzn40DdgCIJUJfZ0mo3eXsDwneJ8AYCr7Vx2eHFnt2H6ZEyAHs9JoQ4Lzh5zBoGOGwAz37NOPuqSNmZf51hBEovtpm2T1wI79OBWDyvCFYkONqAKGVYgIL0F+uxTcMLSPtFbiNDbBPFgip8MGDmLLHbSyGXdCMO6f7teiW9EEmorZ+75KzanZwvUySgjoUQBTfHlOIerJs6Y9wLlgDw18AB1ne0tZRNgGjcrqHbtubSUooEpy4hWpDzTSrmvqw0H9AoXQLolMt9eOM+l9RitBB1OBnrdC1XL4yLFyXqZSgZhv7FnnDEXLUeffb4nVDqYTLY6X7gHVaK4ZZlepja2Oe6OhLDI/Ve5SQTCmJdH3HJeb14cw99XsBQAlDy5s5kil2sGezZA3tFok2IsNja7QuFgM30Hff3NGSsSVFYZLOcTBOvlPx8vLhjJrSI7xrNMA/BOzpBIJrdR1+v+zw4RZ7ry6aq4/tFfvPQxQCPDsXlcRvIZYl+E5g3kJ+zLMZon0yElBvEOQTh6SaAdIO6BwdqJqfvgU+e8Y65FQhdiHkZMVt9/39N2jGd26J6cNjq8cQIyp6RonRPgVn2fl89uRDcQ27GacaN0MPrcNyRlbUWelKfDfyrNVVGBG5sjd3jXzTx06ywyzuWn5jbvEfPPCTbpClkgEu9oPLKICxU5HuDe3jA1XnvU85IYYhaEtOU1YVWYhEFsa4/TQj3rHdsU2da2eVbF8YjSI0m619/8bLMZu3xildwqM7zf1cjn4Whx0PSYXcY5bR7wEQfGC7CTOXwZdmsdTO8q3uGm7Rh/RfCWwpzBHCAaVfjxgibL5vUeL0pH6bzDmI9yCXKC/okkmbc28OJvI87L/bjFzpq0DHepw4kT1Od+fL7cyuFaRgfaUWB2++TCFvz11J0leEtrGkpccfX9z2LY39sph4PBHCjNOOkd0ybUm+ZzS8GkFbqMpq8uiX2yHpa0jllTLfGTDBMYR6FT5FWLLDPMkYxt1Q0eyMvxJWztDjy0m6VvZPvamrFXjHmPpU6WxrZqH6WW//I37RwvqPQhPz8I3RPuXAk1C94ZprQWm9iGM/KgiGDO6SV9sjp+Jmk4TBajMNJ5zzWZ1k1jrteQQBp9C2dOvmbIeeEME8y573Q8TgGe+ZCzutM45gYLBzYm2LNvgq2kebAbMpHRDSyh6dQ27GbsAAdCqQVVXWC1C+zpwBM2Lr4eqtobmmu1vJEDlIQR1iN8CUWpztq50z7FFQBn3SKViX6wSqzVQCoYvAjByjeSa+h1PRnYWvBinTDB9cHt4eqDsPS4jcD3FwXJKT0RQsl8EvslI2SFaz2OtmYLFV8FwgvWroZ3fKmh7btewX9tfL2upXsrsqpLJzpzNGyNlnuZyetg7DIOxQTMBR7dqlrTlZ6FWi1g4j1NSjA2j1Yd7fzTH6k9LxCyUCneAKYCU581bnvKih6KJTeTeCX4Zhme/QIz7w2o+AdSgtLAkdrLS9nfweYEqrMLsrGGSWXtgWamAWp6+x6GM/Z8jNw3BqPNQ39hrzYLECn3tPvh/LqKbRSCiDGauDKBBj/kGbpnM1Bb/my8hv4NWStclkwjfl57y4oNDgw1JAG9VOti3QVVoSziMEsSdfEjaCPIDb7SgpLXykQsM+nbqbt97I0mIlzWv0uqFobLMAq8Rd9pszUBKxFhBPwOjf//gVOz2r7URJ2OnpviCXv9iz3a4X/YLBYbXoYwxBv/Kq0a5s4utQHzoTerJ7PmFW/no/ZAsid/hRIV82tD+Qabh5F1ssIM8Ri3chu0PuPD3sSJRMjDoxLAbwUbroiPAz/V52e8s3DIixxlO7OrvhMj3qfzA0kKxzwicr5wJmZwJxTXgrwYsqhRvpgC2Nfdyd+TYYxJSZgk+gk2g9KyHSlwQVAyPtWWgvVGyVBqsU2LpDlLNosSAtolC1uBKt5pQZLhAxTjeGCWIC/HVpagc5rRwkgpCHKEsjA8d+scp8aiMewwQBhp5dYTV5t/Nvl+HbDMu8F3S0psPyZb1bSnqlHPFUnMQeQqSqwDBT23fJO9gO3aVaa1icrXU0PKwlMM5K+iL3ATcVq2fFWKk0irCTF4LDVDG4gUpkyplq6efcZS+WDR1woApjD18x+2JQR9oOXzuA7uy4b+/91WsJd/tSd1QcAH8PVPXApieA37B7YXPhDPH1azP3PKR+HfHmOoDYLeuKsIi/ssSsdYs62qJo14Hw1P2N/6zpr8F3FTWmJ4ysAVcl84Iv/tl///Z8FaAWbBQbyMNDZjrZ2JwdRjtd1jOeNumSodFtr4/Zf45iRJf/8HSW+KIB/+GlKu8Rv1BPLr/4duoL+kFPRqrstEr41gfJupoJRf4hcYDWX93FOcfEBiIivxtjtV8g7mvOReiamYWKE7vfPbv3v2L9Kwq3cIDFGLyhyfOGuf/9vA5muH6Pjg7B4SUj2ydDXra9fSBI+DrsNHA6l51wfHssJb+11TfNk7B8OleUe3Y+ZmHboMFHdv7FFP2cfISFyeAQR0sk/Xv62HBTdW4HmnGSLFk/cqyWVVFJkdIIa+4hos3JRHcqLoRKM5h2Qtk1RZtzISMtlXTfTqIc77YsCCgQD0r61jtxskCctwJOtjE/pL8wC4LBD4AZFjh2wzzFCrT/PNqW0/DeBbkfMfzVm9yy06WiF+1mTdNNEAytVtohBKg3brWd2VQa+aF+cQ0mW5CvbwOlWCT07liX226PjiVLwFCRs/Ax2/u+ZNPjrNFIWIPf5GjHyUKp60OeXe9F01f7IaPf/SDTvyDAf7LSWWejtiZcsqtWZjrdn6A2MqBwnSeKhrZOlUMmgMionmiCIvXqKZfmhGZ1MwD3uMF4n9KJcfWLA3cL5pq48tm5NDYNh3SS/TKUtmFSlQR89MR4+kxcqJgpGbhm9gXneDELkyqAN5nitmIzTscKeJRXqd64RiaOALR2d295NWwbjHRNG2AU5oR9OS2oJg/5CY6BFPc1JvD2Mxdhp2/MZdI8dLePxiP4KRIp8VXmqfg+jqd/RNG7GNuq1U2SiI4735Bdc0MVFx6mH5UOWEa5HuhYykd6t4M1gYLVS8m1B+9bUqi5DziQq7qT8d94cxB6AB4WqMCOF/zPPtRSZUUaMSsvHOWxGASufywTX8ogy6HgUf9p+Z30wUEosl8qgmwm6o2AV6nO9HKQjRHpN6SUegI5pvR61RLnUJ1lqCtmfcsRQutEizVpAaPXN7xMp5UQ5OSZK6tniCK9CpyMd7LjR6+MxfoMEDPpWdf2p2m5N3KO4QMxf+V7vGdYjemQczQ+m2MGIkFNYDMf0Yop2eSx81sP36WHUczqEhKysp2iJSYAvfgJjinKwToPvRKb+HBi+7cJ96S5ngfLOXaHAFRLkulo4TnXTFO51gX0TCCo4ZUHdbpdgkMEwUZAPjh6M+hA8DzycbtxAgH3uD6i0nN1aTiIuQ4BYCE9dEHHwAmINU+4YEWx4EC3OZwFGfYZMPLScVlb+BAAJeARUh+gdWA3/gRqCrf1jecgqeFf1MdzrrP4SVlGm5mMihSP+zYYksAB7O+SBPwNQqSNMiLnkviY/klwgcRmvqtCqeWeA0gjuir4CMZqmw/ntP6M+l0pdN8/P9xI53aP7x/zavJbbKOz8VzO/nXxIr1tjparMnqd6iWdByHKw4lF4p/u57Yv07WeZPDnRl7wgmDVZZ44fQsjdYO/gmXQ+940PRGst8UMQApFC4OOV22e4N+lVOPyFLAOj4t8R3PFw/FjbSWy0ELuAFReNkee8ORcBOT2NPDcs7OfpUmzvn/F9Czk9o9naMyVYy/j8I5qVFmQDFcptBp65J/+sJA3w/j6y/eqUkKxTsf0CZjtNdRSBEmJ2tmfgmJbqpcsSagk+Ul9qdyV+NnqFBIJZFCB1XwPvWGDBOjVUmpWGHsWA5uDuMgLUNKZ4vlq5qfzY1LnRhCc/mh5/EX+hzuGdDy5aYYx4BAdwTTeZHcZpl3X0YyuxZFWNE6wFNppYs3LcFJePOyfKZ8KYb7dmRyvDOcORLPH0sytC6mH1US3JVj6paYM1GEr+CUmyHRnabHPqLlh6Kl0/BWd3ebziDfvpRQpPoR7N+LkUeYWtQ6Rn5v5+NtNeBPs2+DKDlzEVR5aYbTVPrZekJsZ9UC9qtVcP99thVIt1GREnN8zXP8mBfzS+wKYym8fcW6KqrE702Zco+hFQAEIR7qimo7dd7wO8B7R+QZPTuCWm1UAwblDTyURSbd85P4Pz+wBpQyGPeEpsEvxxIZkKsyfSOUcfE3UqzMFwZKYijb7sOkzpou+tC4bPXey5GI1GUAg9c3vLwIwAhcdPHRsYvpAfzkZHWY20vWxxJO0lvKfj6sG2g/pJ1vd/X2EBZkyEjLN4nUZOpOO7MewyHCrxQK8d5aF7rCeQlFX+XksK6l6z971BPuJqwdjj68ULOj9ZTDdOLopMdOLL0PFSS792SXE/EC9EDnIXZGYhr52aQb+9b2zEdBSnpkxAdBUkwJDqGCpZk/HkRidjdp0zKv/Cm52EenmfeKX6HkLUJgMbTTxxIZkIeL/6xuAaAAHbA7mONVduTHNX/UJj1nJEaI7f3HlUyiqKn7VfBE+bdb4HWln1HPJx001Ulq1tOxFf8WZEARvq5Da1+pE7fPVxLntGACz3nkoLsKcPdUqdCwwiyWkmXTd5+bv3j7HaReRt3ESn783Ew3SWsvkEjKtbocNksbrLmV+GVZn1+Uneo35MT1/4r8fngQX5/ptORfgmWfF6KSB/ssJmUSijXxQqUpzkANEkSkYgYj560OOjJr6uqckFuO15TRNgABEwNDjus1V3q2huLPYERMCLXUNmJJpbMrUQsSO7Qnxta55TvPWL6gWmMOvFknqETzqzFVO8SVkovEdYatypLGmDy9VWfgAc0KyIChiOhbd7UlbAeVLPZyEDp4POXKBwN/KP5pT6Cyqs6yaI00vXMn1ubk9OWT9Q/O2t/C25qlnO/zO0xcBzpMBCAB8vsdsh3U8fnPX1XlPEWfaYJxKVaTUgfCESWl4CCkIyjE6iQ5JFcwU6S4/IH0/Agacp8d5Gzq2+GzPnJ7+sqk40mfFQpKrDbAKwLlr3ONEati2k/ycLMSUu7V/7BBkDlNyXoN9tvqXCbbMc4SSQXgC/DBUY9QjtrCtQ+susEomCq8xcNJNNMWCH31GtlTw2BdCXkJBjT+/QNWlBWwQ5SWCh1LdQ99QVii/DyTxjSR6rmdap3l3L3aiplQpPYlrzNm9er88fXd2+ao+YdUNjtqmxiVxmyYPzJxl67OokDcTezEGqldkGgPbRdXA+fGcuZVkembZByo7J1dMnkGNjwwCny+FNcVcWvWYL9mg8oF7jACVWI3bA64EXpdM8bSIEVIAs5JJH+LHXgnCsgcMGPZyAAVBncvbLiexzg9YozcytjPXVlAbQAC7Tc4S0C8QN4LlAGjj4pQAVWrwkaDoUYGxxvkCWKRRHkdzJB5zpREleBDL1oDKEvAqmkDibVC4kTqF89YO6laUjgtJPebBfzr16tg4t10GmN1sJ5vezk2sUOq8blCn5mPZyT3ltaDcddKupQjqusNM9wtFVD0ABzv17fZDn7GPT1nkCtdcgYejcK1qOcTGtPxnCX1rErEjVWCnEJv5HaOAUjgpiKQjUKkQi64D5g2COgwas8FcgIl0Pw95H9dWxE3QG0VbMNffh6BPlAojLDf4es2/5Xfq7hw5NGcON2g8Qsy2UQm94KddKyy3kdJxWgpNaEc15xcylbLC3vnT26u8qS90qc2MU8LdOJc5VPF5KnSpXIhnj1eJJ/jszjZ01oR6JDFJRoeTPO/wh4IPFbdG9KljuSzeuI92p8JF/bpgDE8wG86/W2EBKgPrmzdLijxssQn8mM44ky/KLGOJcrSwXIpZa/Z3v7W6HCRk7ewds99LTsUW1LbeJytw8Q/BFZVZyfO9BUHOCe2suuEkO8DU4fLX0IQSQ2TdOkKXDtPf3sNV9tYhYFueuPRhfQlEEy+aYM/MCz7diDNmFSswYYlZZPmKr2Q5AxLsSVEqqBtn6hVl1BCFOFExnqnIsmyY/NA8jXnDaNzr7Zv3hu+I1Mf/PJjk0gALN2G8ABzdf9FNvWHvZHhv6xIoDCXf964MxG92vGZtx/LYU5PeZqgly8tT5tGeQGeJzMMsJc5p+a5Rn2PtEhiRzo/5Owjy1n0Lzx3ev8GHQmeWb8vagG6O5Qk5nrZuQTiKODI4UqL0LLAusS2Ve7j1Ivdxquu1BR9Rc4QkOiUPwQXJv6du2E8i5pDhVoQpUhyMWGUT2O2YODIhjAfI71gxep5r5zAY7GBUZpy51hAw0pcCCrhOmU8Wp6ujQTdZQsCjtq6SHX8QAMNiPCIIkoxhHEZPgsBcOlP4aErJZPhF7qvx6gHrn8hEwPwYbx8YmT/n7lbcmTip1v8kgsrIjFTAlvLY4Nuil0KDmgz3svYs0ZJ3O3Is/vSx4xpxF1e2VAtZE8dJxGYEIhCSuPvCjP54l/NSNDnwlKvAW8mG+AQkgp7a87Igh26uKMFGD0PoPHTSvoWxiHuk+su8XkQiHIjeYKl/RdcOHpxhQH3zHCNE3aARm83Bl6zGxU/vMltlVPQhubcqhW4RYkl6uXk5JdP/QpzaKFpw2M8zvysv2qj7xaQECuu2akM0Cssj/uB9+wDR7uA6XOnLNaoczalHoMj33eiiu+DRaFsUmlmUZuh9bjDY4INMNSSAivSh03uJvny4Gj+D+neudoa7iJi7c4VFlZ/J5gUR82308zSNAt/ZroBXDWw0fV3eVPAn3aX0mtJabF6RsUZmL+Ehn+wn51/4QipMjD+6y64t7bjL6bjENan2prQ4h7++hBJ9NXvX8CUocJqMC937IasLzm5K0qwXeFMAimMHkEIQIQI2LrQ9sLBfXuyp66zWvlsh74GPv7Xpabj993pRNNDuFud5oIcn/92isbADXdpRPbjmbCNOrwRbxGZx2XmYNGMiV5kjF4IKyxCBvKier9U4uVoheCdmk83rp5G0PihAm2fAtczI4b9BWqX+nrZTrJX5kSwQddi93NQrXG+Cl3eBGNkM77VBsMpEolhXex1MVvMkZN9fG59GGbciH11FEXaY1MxrArovaSjE/lUUqBg2cZBNmiWbvzCHCPJ4RVGFK2dTbObM1m+gJyEX53fa7u3+TZpm74mNEzWbkVL4vjNwfL9uzRCu1cgbrNx5Yv5dDruNrIOgwIk+UZWwJfdbu/WHul6PMmRflVCIzd7B37Pgm/Up/NuCiQW7RXyafevN3AL6ycciCc4ZPlTRzEu+aURGlUBOJbUEsheX7PPyrrhdUt5JAG12EEEZpY/N3Vhbl5uLAfT0CbC2XmpnryFkxZmBTs5prvEeuf0bn73i3O82WTiQtJWEPLsBXnQmdnKhB06NbbhLtlTZYJMxDMJpFeajSNRDB2v61BMUHqXggUwRJ19m6p5zl51v11q34T74lTXdJURuV6+bg2D6qpfGnLy7KGLuLZngobM4pIouz4+n0/UzFKxDgLM4h+fUwKZozQ9UGrHjcif51Ruonz7oIVZ56xWtZS8z7u5zay6J2LD4gCYh2RXoBRLDKsUlZ80R8kmoxlJiL8aZCy2wCAonnucFxCLT1HKoMhbPKt34D97EXPPh0joO93iJVF1Uruew61Qoy3ZUVNX9uIJDt9AQWKLLo+mSzmTibyLHq0D6hhzpvgUgI6ekyVEL3FD+Fi5R3A8MRHPXspN1VyKkfRlC+OGiNgPC4NREZpFETgVmdXrQ2TxChuS3aY+Ndc7CiYv5+CmzfiqeZrWIQJW/C4RvjbGUoJFf1K6ZdR2xL/bG4kVq1+I4jQWX+26YUijpp+lpN7o5c6ZodXJCF56UkFGsqz44sIg8jrdWvbjRCxi2Bk0iyM3a7ecAV93zB6h1Ei38c0s6+8nrbkopArccGP8vntQe1bFeEh2nJIFOHX/k3/UHb5PtKGpnzbkmnRETMX+9X/QduLZWw/feklW/kH/JnzToJe9Kgu9Hct1UGbH5BPCLo4OOtQnZonW0xnyCcdtKyPQ/sbLiSTYJdSx4sJqWLMnfn6fIqPB3WAgk00J+fCOkomPHqtS67pf0mFmKoItYZUlJu6BihSZ8qve8+/X+LX1MhQXF95AshfUleCtmdn6l6QFXzLg2sgLn1oyVFuZecv7fzsIHzoRlAGp0gwYDOn1S4qabWvB5xUaE+Svw4KmjWtxdnuQbI32dw87D4N95u8qQRJTSQg0wLxOLkxSrPMLEn1UIhNKjAa9VLs3WLaXGrtCIt8bKY2AQP/ZdyRU6zT/E8qP2ltyBE2CCZPgWgEYDoJJO4n92y61ylNaSFXKohJhLjkfvYWm592539sIpmBNLlDo1bExFBfmHJJ0lFEiC/fj8v42OoMC9Mo3whIoWvyHfq6Uacqq55mzFf/EGC+NP/gHjhd6urc6R0hES27VXux7UY8CGKPohplWIZtTrFSaPWslCWy78E22Pw8fvReSUZx/txqLtHrFqg1DY/Eus6Iq1heZdrdcqE0/c971Bz1HW/XNXHsXpUIbI4kHdOfCc6T5zHZzvzQJB0ggMFL6IGPAilU9bj/ASdPk6fNvNtZqPuwEDhMBtBnhCexo6D6VAGIOPvJPPV523Y8R8a9vCqZbswSZKzOT1291BsUbmUWehtbb1fdRX9hiJKXvwr1QX6GjnZMgyMvnwOo2Dr24amr7FqEAbVeJAjRNOceM2EQ1Mna9fInqPJ5mh5X8CzT1aDOv08An0blz0fF5Gq4mS2cwq5glwIOlY5nznE8X4j/UdZ3FJsVIXte1JH0A7iibuPfazStM5O/Vo3KXIpXBeGORV0M9XDXFvsYZUHGvFCUubWzTw248EHE0cpQM2zNg6rjavreq3NHCAWsoZ7wvVy7l5gvtKRmIj1MnvfWEm0yFnGcuOq192350a5WefpfKCcX3Sn+AgHU+qnpstNtddbdVebagJU390lq9ko4aI9rqdaWXYG8tv5O/ZQHSqDRYHC6zfH10l5z++opso7aOSaIczlQ13iAzXvLdEu0V7kwNUZ1c8Y8aq7SeIEe5p902FlNkW8DnwHyueHchbK8vVFJfmr9mz7P8nUSccl1ULaoWMRSI1ls32kvlK0h46h3J25Yd9AzfcJbp9qYF/SEt3H5j69mMdcsNxZcAzT/A89ov3tglTX54y/EwjMfuoDoxPwLJDm5I7q6F9Kp469yNy1zSxz0N4HbRRBj9xFFuogvBspv7DXUNIsGxTINEQfmctb42XImWAODgARNo7dfcTqFKq6aTfivmvunLmzP9f8yLsJvXD3JbcPcDGNriMAcjzeDTNr65t8YB5tsnFDFLa0Uwmd2OvUdkLMX9TsAUYUfooSv47sw5J88j7CpahRjjO3/UhOXjTS39W5YZAel2KTbQd1h7INOw9P23GW7GDAe4agIUFHP48MZr7ubq0efFmmtwYMyk7D0r1oeG/CGOODgb9Ur+JMHxkwzPbtCX2ZnENQuI0RN5SyTIZuoY4XS9Rd/tPe3vNAZGSHM/YYwqs9xkkENx0O+eC2YVW1cwOJ3ckE890nbQeHLKlW15L0P0W2VliyYrfNr0nrIYddoRyGaCtj4OYd2MT7ebApqZOAQIaSHJM4mphhfjNjtnjg6YRyx9qM2FT3xOiYIMqXPFWdzhSgFF8ItocqVV09CmIoO8k6U/oJB7++wSX/YksxfPXHyjSgAGZOj1aKEq9fSvXBqtp2wu8/FxEf5AxapAD06pPGuLVUYLdgEzHR8wqRGYEwiUO9MyYbgswstuLYhwYFpSVKOdzAihZ9LuHtD598EGhINU9xc9xhL+QgTLAstmPIvvm2xyRw/WTUPXkP3ZHu6GyPmj5xFH9/QGpkglKXRVUBgVmLOJx8uZO2AstxQYocZH2JhORlxawj66BAXUEs7K/gPxINIRAFyK3WLuyq9oBTF9wEbnmCot82WjIg7CPNwYK3KrZMrKAz5yFszg4wCVLJVnIL8+OYA0xRDH8cHQjQUiQ2i1mr/be32k/3Xej9sdf3iuGvZHyLFSJvPSqz/wltnxumTJYKZsrWXtx/Rmu39jjV9lFaJttfFn57/No2h/unsJmMHbrnZ8csxkp5HQ4xR1s0HH+t3Iz82a3iQWTUDGq/+l2W3TUYLE8zNdL8Y+5oXaIH/Y2UUcX67cXeN4WvENZjz4+8q7vjhowOI3rSjFhGZ6KzwmU7+5nFV+kGWAZ5z2UWvzq0TK0pk1hPwAN4jbw//1CApRvIaIjhSGhioY6TUmsToek9cF9XjJdHvLPcyyCV3lbR5Jiz/ts46ay2F820VjTXvllElwrGzKcNSyvQlWDXdwrUINXmHorAM3fE19ngLZmgeUaCJLsSITf2VcfAOuWwX7mTPdP8Zb/04KqRniufCpwnDUk7sP0RX6cud/sanFMagnzKInSRVey0YzlVSOtA/AjrofmSH6RYbJQ8b4NDeTkIGc6247+Mnbez/qhJ9GAv9fGNFercPnnrf285Qgs+UqThLRgflcAKFuqWhLzZaR4QqvSwa3xe0LPkqj9xJWub195r7NrrR0e78FR+0mRBNMPsraqZctAUVAJfYKehTDV1MGGQSeDsOK9J3sbUuKRIS/WilX/64CBms9jCZocBlsBSZaIAjWm/SUZ8daWL2a/cJFyUOFqE3Epc2RWbtjNyPwOGpWtzu32kUooUqsJud7IV4E8rstUBXM7tGEtBx99x60g1duhyvxeKJSl8s5E34HTMmADT0836aEdg5Dv9rVyCz8i2REOmiz6wtIVFN0HsjAoN37SrY0bV1Ms8CRUILhvZvvRaDzoVCaSI0u8EPuTe4b7OPowgRGODl22UBBmHSTUY8e4DyL+Bc7bngo+2T8HtNvzyATSL5iJZgFPKpmUyZv54vVL90+/RQGATUmNKnrIvcJMYON9fl83naW5sf6hRkbbTC9RUEE6XADwjgA46wWfUQ+QWZl0J4PVTWAln/YfAz/SV3q3J9+yCYDleruoN5uoc/wT2f4YONGTb6zTGq3V+3JqzmCOjwebKln+fExVLN7sqtqfMnsKVXWbb2Ai5m3D/fCTgX7oKYzTZvj+m28XnDqPbXuP4MyWdmPezcesdrh7rCzA7BWdObiuyDEKjjzBbQ0qnuwjliz+b+j7aPMKlkXyIznV3tGzAfYwIbzGGt098oh4eq3ruDjdgHtjxfFCjHrjjRbHajoz/YOY4raojPFQ910GIlBV7hq47UDgpyajBxQUmD8NctiLV1rTSLAEsQDLTeRKcmPBMVMFF0SPBBhZ5oXoxtD3lMhuAQXmA+57OcciczVW9e9zwSIAHS+FJmvfXMJGF1dMBsIUMaPjvgaVqUc3p32qVCMQYFEiRLzlVSOGMCmv/HJIxAHe3mL/XnoZ1IkWLeRZfgyByjnDbbeRK5KL7bYHSVJZ9UFq+yCiNKeRUaYjgbC3hVUvfJAhy/QNl/JqLKVvGMk9ZcfyGidNeo/VTxK9vUpodzfQI9Z2eAre4nmrkzgxKSnT5IJ1D69oHuUS5hp7pK9IAWuNrAOtOH0mAuwCrY8mXAtVXUeaNK3OXr6PRvmWg4VQqFSy+a1GZfFYgdsJELG8N0kvqmzvwZ02Plf5fH9QTy6br0oY/IDsEA+GBf9pEVWCIuBCjsup3LDSDqI+5+0IKSUFr7A96A2f0FbcU9fqljdqvsd8sG55KcKloHIFZem2Wb6pCLXybnVSB0sjCXzdS8IKvE");const pr=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),fr=4;function mr(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function gr(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let r=[];for(let n=0;n>24&255}function vr(e){return 16777215&e}const yr=new Map(sr(wr).flatMap(((e,t)=>e.map((e=>[e,t+1<<24]))))),xr=new Set(or(wr)),Ar=new Map,Cr=new Map;for(let[e,t]of ar(wr)){if(!xr.has(e)&&2==t.length){let[r,n]=t,i=Cr.get(r);i||(i=new Map,Cr.set(r,i)),i.set(n,e)}Ar.set(e,t.reverse())}const Er=44032,Ir=4352,_r=4449,Pr=4519,Or=28,Sr=21*Or,kr=Er+19*Sr,Mr=Ir+19,Tr=_r+21,Nr=Pr+Or;function jr(e){return e>=Er&&e=Ir&&e=_r&&tPr&&t0&&i(Pr+r)}else{let e=Ar.get(n);e?r.push(...e):i(n)}if(!r.length)break;n=r.pop()}if(n&&t.length>1){let e=br(t[0]);for(let r=1;r0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=s):r.push(s),i=e;else{let o=Rr(n,s);o>=0?n=o:0==i&&0==e?(t.push(n),n=s):(r.push(s),i=e)}}return n>=0&&t.push(n,...r),t}(Lr(e))}const Ur=65039,Dr=".",zr=1,Wr=45;function Fr(){return new Set(or(dr))}const Hr=new Map(ar(dr)),qr=Fr(),Vr=Fr(),Gr=new Set(or(dr).map((function(e){return this[e]}),[...Vr])),Kr=Fr(),Zr=(Fr(),sr(dr));function Qr(){return new Set([or(dr).map((e=>Zr[e])),or(dr)].flat(2))}const Yr=dr(),Jr=cr((e=>{let t=cr(dr).map((e=>e+96));if(t.length){let r=e>=Yr;t[0]-=32,t=gr(t),r&&(t=`Restricted[${t}]`);let n=Qr(),i=Qr(),o=[...n,...i].sort(((e,t)=>e-t));return{N:t,P:n,M:!dr(),R:r,V:new Set(o)}}})),Xr=Fr(),en=new Map;[...Xr,...Fr()].sort(((e,t)=>e-t)).map(((e,t,r)=>{let n=dr(),i=r[t]=n?r[t-n]:{V:[],M:new Map};i.V.push(e),Xr.has(e)||en.set(e,i)}));for(let{V:e,M:t}of new Set(en.values())){let r=[];for(let t of e){let e=Jr.filter((e=>e.V.has(t))),n=r.find((({G:t})=>e.some((e=>t.has(e)))));n||(n={G:new Set,V:[]},r.push(n)),n.V.push(t),e.forEach((e=>n.G.add(e)))}let n=r.flatMap((({G:e})=>[...e]));for(let{G:e,V:i}of r){let r=new Set(n.filter((t=>!e.has(t))));for(let e of i)t.set(e,r)}}let tn=new Set,rn=new Set;for(let e of Jr)for(let t of e.V)(tn.has(t)?rn:tn).add(t);for(let e of tn)en.has(e)||rn.has(e)||en.set(e,zr);const nn=new Set([...tn,...Br(tn)]),on=or(dr),sn=function e(t){let r=cr((()=>{let t=or(dr).map((e=>on[e]));if(t.length)return e(t)})).sort(((e,t)=>t.Q.size-e.Q.size)),n=dr(),i=n%3;n=n/3|0;let o=1&n;return n>>=1,{B:r,V:i,F:o,S:1&n,C:2&n,Q:new Set(t)}}([]);class an extends Array{get is_emoji(){return!0}}function cn(e,t=mr){let r=[];var n;n=e[0],Vr.has(n)&&r.push("◌");let i=0,o=e.length;for(let n=0;n0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}function dn(e){return Kr.has(e)}function pn(e,t){let r=0;return e.split(Dr).map((e=>{let n,i=function(e){let t=[];for(let r=0,n=e.length;r1||i.is_emoji;if(!a&&i.every((e=>e<128)))n=i,hn(n),function(e){if(e.length>=4&&e[2]==Wr&&e[3]==Wr)throw new Error("invalid label extension")}(n),e="ASCII";else if(a&&(o.emoji=!0,i=r.flatMap((e=>e.is_emoji?[]:e))),n=r.flatMap((e=>!t&&e.is_emoji?e.filter((e=>e!=Ur)):e)),hn(n),i.length){if(Vr.has(n[0]))throw gn("leading combining mark");for(let e=1;ee.V.has(r)));if(!e.length)throw t===Jr?fn(r):mn(t[0],r);if(t=e,1==e.length)break}return t}(t);!function(e,t){let{V:r,M:n}=e;for(let n of t)if(!r.has(n))throw mn(e,n);if(n){let e=Br(t);for(let t=1,r=e.length;tfr)throw new Error(`non-spacing marks: too many ${un(cn(e.slice(t-1,n)))} (${n-t}/${fr})`);t=n}}}(o,i),function(e,t){let r,n=[];for(let e of t){let t=en.get(e);if(t===zr)return;if(t){let n=t.M.get(e);if(r=r?r.filter((e=>n.has(e))):[...n],!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every((e=>t.V.has(e))))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(o,t),e=o.N}else e="Emoji"}o.type=e}catch(e){o.error=e}return o.output=n,o}))}function fn(e){return new Error(`disallowed character: ${ln(e)}`)}function mn(e,t){let r=ln(t),n=Jr.find((e=>e.P.has(t)));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function gn(e){return new Error(`illegal placement: ${e}`)}function wn(e,t){let r,n,i=sn,o=[],s=e.length;for(t&&(t.length=0);s;){let a=e[--s];if(i=i.B.find((e=>e.Q.has(a))),!i)break;if(i.S)n=a;else if(i.C&&a===n)break;o.push(a),i.F&&(o.push(Ur),s>0&&e[s-1]==Ur&&s--),i.V&&(r=bn(o,i),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}function bn(e,t){let r=an.from(e);return 2==t.V&&r.splice(1,1),r}function vn(e){return function(e){return(t=pn(e)).map((({input:e,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==t.length?n:`Invalid label ${un(cn(e))}: ${n}`)}return gr(n)})).join(Dr);var t}(e)}var yn=class extends Error{constructor({activeChain:e,targetChain:t}){super(`Chain mismatch: Expected "${t}", received "${e}".`),this.name="ChainMismatchError"}},xn=class extends Error{constructor({chainId:e,connectorId:t}){super(`Chain "${e}" not configured${t?` for connector "${t}"`:""}.`),this.name="ChainNotConfigured"}},An=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},Cn=class extends Error{constructor(){super(...arguments),this.name="ConfigChainsNotFound",this.message="No chains were found on the wagmi config. Some functions that require a chain may not work."}},En=class extends Error{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}},In=(e,{find:t,replace:r})=>e&&t(e)?r(e):"object"!=typeof e?e:Array.isArray(e)?e.map((e=>In(e,{find:t,replace:r}))):e instanceof Object?Object.entries(e).reduce(((e,[n,i])=>({...e,[n]:In(i,{find:t,replace:r})})),{}):e;function _n(e){const t=JSON.parse(e);return In(t,{find:e=>"string"==typeof e&&e.startsWith("#bigint."),replace:e=>BigInt(e.replace("#bigint.",""))})}function Pn(e){return"number"==typeof e?e:"wei"===e?0:Math.abs(Qt.Bd[e])}function On(e,t){return e.slice(0,t).join(".")||"."}function Sn(e,t){const{length:r}=e;for(let n=0;n{const n="bigint"==typeof r?`#bigint.${r.toString()}`:r;return t?.(e,n)||n}),n),r??void 0)}var Mn={getItem:e=>"",setItem:(e,t)=>null,removeItem:e=>null};function Tn({deserialize:e=_n,key:t="wagmi",serialize:r=kn,storage:n}){return{...n,getItem:(r,i=null)=>{const o=n.getItem(`${t}.${r}`);try{return o?e(o):i}catch(e){return console.warn(e),i}},setItem:(e,i)=>{if(null===i)n.removeItem(`${t}.${e}`);else try{n.setItem(`${t}.${e}`,r(i))}catch(e){console.error(e)}},removeItem:e=>n.removeItem(`${t}.${e}`)}}var Nn,jn,Rn,Ln,Bn,$n="store";function Un(){if(!Bn)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return Bn}async function Dn({chainId:e,connector:t}){const r=Un(),n=r.connector;if(n&&t.id===n.id)throw new An;try{r.setState((e=>({...e,status:"connecting"})));const n=await t.connect({chainId:e});return r.setLastUsedConnector(t.id),r.setState((e=>({...e,connector:t,chains:t?.chains,data:n,status:"connected"}))),r.storage.setItem("connected",!0),{...n,connector:t}}catch(e){throw r.setState((e=>({...e,status:e.connector?"connected":"disconnected"}))),e}}async function zn(){const e=Un();e.connector&&await e.connector.disconnect(),e.clearState(),e.storage.removeItem("connected")}Nn=new WeakMap,jn=new WeakMap,Rn=new WeakSet,Ln=function(){const e=e=>{this.setState((t=>({...t,data:{...t.data,...e}})))},t=()=>{this.clearState()},r=e=>{this.setState((t=>({...t,error:e})))};this.store.subscribe((({connector:e})=>e),((n,i)=>{i?.off?.("change",e),i?.off?.("disconnect",t),i?.off?.("error",r),n&&(n.on?.("change",e),n.on?.("disconnect",t),n.on?.("error",r))}));const{publicClient:n,webSocketPublicClient:i}=this.args;("function"==typeof n||"function"==typeof i)&&this.store.subscribe((({data:e})=>e?.chain?.id),(e=>{this.setState((t=>({...t,publicClient:this.getPublicClient({chainId:e}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:e})})))}))};var Wn=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Fn=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function Hn({chainId:e}={}){const t=Un();return e&&t.getPublicClient({chainId:e})||t.publicClient}async function qn({chainId:e}={}){const t=Un();return await(t.connector?.getWalletClient?.({chainId:e}))||null}async function Vn({address:e,account:t,chainId:r,abi:n,args:i,functionName:o,blockNumber:s,blockTag:a}){return Hn({chainId:r}).readContract({abi:n,address:e,account:t,functionName:o,args:i,blockNumber:s,blockTag:a})}async function Gn({contracts:e,blockNumber:t,blockTag:r,...n}){const{allowFailure:i=!0}=n;try{const n=Hn(),o=e.reduce(((e,t,r)=>{const i=t.chainId??n.chain.id;return{...e,[i]:[...e[i]||[],{contract:t,index:r}]}}),{}),s=()=>Object.entries(o).map((([e,n])=>async function({chainId:e,contracts:t,blockNumber:r,blockTag:n,...i}){const o=Hn({chainId:e});if(!o.chains)throw new Cn;if(e&&o.chain.id!==e)throw new xn({chainId:e});return o.multicall({allowFailure:i.allowFailure??!0,blockNumber:r,blockTag:n,contracts:t})}({allowFailure:i,chainId:parseInt(e),contracts:n.map((({contract:e})=>e)),blockNumber:t,blockTag:r}))),a=(await Promise.all(s())).flat(),c=Object.values(o).flatMap((e=>e.map((({index:e})=>e))));return a.reduce(((e,t,r)=>(e&&(e[c[r]]=t),e)),[])}catch(n){if(n instanceof Se.uq)throw n;const o=()=>e.map((e=>Vn({...e,blockNumber:t,blockTag:r})));return i?(await Promise.allSettled(o())).map((e=>"fulfilled"===e.status?{result:e.value,status:"success"}:{error:e.reason,result:void 0,status:"failure"})):await Promise.all(o())}}async function Kn({address:e,chainId:t,formatUnits:r,token:n}){const i=Un(),s=Hn({chainId:t});if(n){const i=async({abi:i})=>{const o={abi:i,address:n,chainId:t},[s,a,c]=await Gn({allowFailure:!1,contracts:[{...o,functionName:"balanceOf",args:[e]},{...o,functionName:"decimals"},{...o,functionName:"symbol"}]});return{decimals:a,formatted:(0,er.b)(s??"0",Pn(r??a)),symbol:c,value:s}};try{return await i({abi:Wn})}catch(e){if(e instanceof Se.uq){const{symbol:e,...t}=await i({abi:Fn});return{symbol:(0,o.rR)((0,Me.f)(e,{dir:"right"})),...t}}throw e}}const a=[...i.publicClient.chains||[],...i.chains??[]],c=await s.getBalance({address:e}),l=a.find((e=>e.id===s.chain.id));return{decimals:l?.nativeCurrency.decimals??18,formatted:(0,er.b)(c??"0",Pn(r??18)),symbol:l?.nativeCurrency.symbol??"ETH",value:c}}function Zn(){const{data:e,connector:t,status:r}=Un();switch(r){case"connected":return{address:e?.account,connector:t,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:e?.account,connector:t,isConnected:!!e?.account,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:e?.account,connector:t,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function Qn(){const e=Un(),t=e.data?.chain?.id,r=e.chains??[],n=[...e.publicClient?.chains||[],...r].find((e=>e.id===t))??{id:t,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:t?{...n,...e.data?.chain,id:t}:void 0,chains:r}}async function Yn({domain:e,message:t,primaryType:r,types:n}){const i=await qn();if(!i)throw new I;const{chainId:o}=e;return o&&ni({chainId:o}),i.signTypedData({message:t,primaryType:r,types:n,domain:e})}async function Jn({chainId:e}){const{connector:t}=Un();if(!t)throw new I;if(!t.switchChain)throw new En({connector:t});return t.switchChain(e)}function Xn(e,{selector:t=(e=>e)}={}){return Un().subscribe((({data:e,connector:r,status:n})=>t({address:e?.account,connector:r,status:n})),(()=>e(Zn())),{equalityFn:tr})}function ei(e,{selector:t=(e=>e)}={}){const r=Un().subscribe((({data:e,chains:r})=>t({chainId:e?.chain?.id,chains:r})),(()=>e(Qn())),{equalityFn:tr});return r}async function ti({name:e,chainId:t}){const r=Hn({chainId:t});return await r.getEnsAvatar({name:vn(e)})}async function ri({address:e,chainId:t}){return Hn({chainId:t}).getEnsName({address:(0,P.K)(e)})}function ni({chainId:e}){const{chain:t,chains:r}=Qn(),n=t?.id;if(n&&e!==n)throw new yn({activeChain:r.find((e=>e.id===n))?.name??`Chain ${n}`,targetChain:r.find((t=>t.id===e))?.name??`Chain ${e}`})}var ii,oi,si,ai,ci,li,ui,hi,di,pi,fi,mi,gi,wi,bi,vi,yi,xi,Ai,Ci,Ei="eip155",Ii="requestedChains",_i="wallet_addEthereumChain",Pi=class extends C{constructor(e){super({...e,options:{isNewChainsStale:!0,...e.options}}),y(this,si),y(this,ci),y(this,ui),y(this,di),y(this,fi),y(this,gi),y(this,bi),y(this,yi),y(this,Ai),w(this,"id","walletConnect"),w(this,"name","WalletConnect"),w(this,"ready",!0),y(this,ii,void 0),y(this,oi,void 0),w(this,"onAccountsChanged",(e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,P.K)(e[0])})})),w(this,"onChainChanged",(e=>{const t=Number(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})})),w(this,"onDisconnect",(()=>{A(this,gi,wi).call(this,[]),this.emit("disconnect")})),w(this,"onDisplayUri",(e=>{this.emit("message",{type:"display_uri",data:e})})),w(this,"onConnect",(()=>{this.emit("connect",{})})),A(this,si,ai).call(this)}async connect({chainId:e,pairingTopic:t}={}){try{let r=e;if(!r){const e=this.storage?.getItem("store"),t=e?.state?.data?.chain?.id;r=t&&!this.isChainUnsupported(t)?t:this.chains[0]?.id}if(!r)throw new Error("No chains found on connector.");const n=await this.getProvider();A(this,di,pi).call(this);const i=A(this,ui,hi).call(this);if(n.session&&i&&await n.disconnect(),!n.session||i){const e=this.chains.filter((e=>e.id!==r)).map((e=>e.id));this.emit("message",{type:"connecting"}),await n.connect({pairingTopic:t,chains:[r],optionalChains:e}),A(this,gi,wi).call(this,this.chains.map((({id:e})=>e)))}const o=await n.enable(),s=(0,P.K)(o[0]),a=await this.getChainId();return{account:s,chain:{id:a,unsupported:this.isChainUnsupported(a)}}}catch(e){if(/user rejected/i.test(e?.message))throw new O.ab(e);throw e}}async disconnect(){const e=await this.getProvider();try{await e.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{A(this,fi,mi).call(this),A(this,gi,wi).call(this,[])}}async getAccount(){const{accounts:e}=await this.getProvider();return(0,P.K)(e[0])}async getChainId(){const{chainId:e}=await this.getProvider();return e}async getProvider({chainId:e}={}){return v(this,ii)||await A(this,si,ai).call(this),e&&await this.switchChain(e),v(this,ii)}async getWalletClient({chainId:e}={}){const[t,r]=await Promise.all([this.getProvider({chainId:e}),this.getAccount()]),n=this.chains.find((t=>t.id===e));if(!t)throw new Error("provider is required.");return fe({account:r,chain:n,transport:xe(t)})}async isAuthorized(){try{const[e,t]=await Promise.all([this.getAccount(),this.getProvider()]),r=A(this,ui,hi).call(this);if(!e)return!1;if(r&&t.session){try{await t.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(e){const t=this.chains.find((t=>t.id===e));if(!t)throw new O.x3(new Error("chain not found on connector."));try{const r=await this.getProvider(),n=A(this,yi,xi).call(this),i=A(this,Ai,Ci).call(this);if(!n.includes(e)&&i.includes(_i)){await r.request({method:_i,params:[{chainId:(0,s.eC)(t.id),blockExplorerUrls:[t.blockExplorers?.default?.url],chainName:t.name,nativeCurrency:t.nativeCurrency,rpcUrls:[...t.rpcUrls.default.http]}]});const n=A(this,bi,vi).call(this);n.push(e),A(this,gi,wi).call(this,n)}return await r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,s.eC)(e)}]}),t}catch(e){if(/user rejected request/i.test("string"==typeof e?e:e?.message))throw new O.ab(e);throw new O.x3(e)}}};ii=new WeakMap,oi=new WeakMap,si=new WeakSet,ai=async function(){return v(this,oi)||"undefined"==typeof window||x(this,oi,A(this,ci,li).call(this)),v(this,oi)},ci=new WeakSet,li=async function(){const{default:e,OPTIONAL_EVENTS:t,OPTIONAL_METHODS:n}=await Promise.resolve().then(r.bind(r,9328)),[i,...o]=this.chains.map((({id:e})=>e));if(i){const{projectId:r,showQrModal:s=!0,qrModalOptions:a,metadata:c}=this.options;x(this,ii,await e.init({showQrModal:s,qrModalOptions:a,projectId:r,optionalMethods:n,optionalEvents:t,chains:[i],optionalChains:o,rpcMap:Object.fromEntries(this.chains.map((e=>[e.id,e.rpcUrls.default.http[0]]))),metadata:c}))}},ui=new WeakSet,hi=function(){if(A(this,Ai,Ci).call(this).includes(_i))return!1;if(!this.options.isNewChainsStale)return!1;const e=A(this,bi,vi).call(this),t=this.chains.map((({id:e})=>e)),r=A(this,yi,xi).call(this);return!(r.length&&!r.some((e=>t.includes(e)))||t.every((t=>e.includes(t))))},di=new WeakSet,pi=function(){v(this,ii)&&(A(this,fi,mi).call(this),v(this,ii).on("accountsChanged",this.onAccountsChanged),v(this,ii).on("chainChanged",this.onChainChanged),v(this,ii).on("disconnect",this.onDisconnect),v(this,ii).on("session_delete",this.onDisconnect),v(this,ii).on("display_uri",this.onDisplayUri),v(this,ii).on("connect",this.onConnect))},fi=new WeakSet,mi=function(){v(this,ii)&&(v(this,ii).removeListener("accountsChanged",this.onAccountsChanged),v(this,ii).removeListener("chainChanged",this.onChainChanged),v(this,ii).removeListener("disconnect",this.onDisconnect),v(this,ii).removeListener("session_delete",this.onDisconnect),v(this,ii).removeListener("display_uri",this.onDisplayUri),v(this,ii).removeListener("connect",this.onConnect))},gi=new WeakSet,wi=function(e){this.storage?.setItem(Ii,e)},bi=new WeakSet,vi=function(){return this.storage?.getItem(Ii)??[]},yi=new WeakSet,xi=function(){if(!v(this,ii))return[];const e=v(this,ii).session?.namespaces[Ei]?.chains?.map((e=>parseInt(e.split(":")[1]||"")));return e??[]},Ai=new WeakSet,Ci=function(){if(!v(this,ii))return[];const e=v(this,ii).session?.namespaces[Ei]?.methods;return e??[]};class Oi{constructor(e,t){this.wagmi={},this.chains=[],this.namespace="eip155",this.disconnect=zn,this.getAccount=Zn,this.watchAccount=Xn,this.fetchBalance=Kn,this.getNetwork=Qn,this.watchNetwork=ei,this.switchNetwork=Jn,this.fetchEnsName=ri,this.fetchEnsAvatar=ti,this.wagmi=e,this.chains=t}getWalletConnectConnector(){const e=this.wagmi.connectors.find((e=>"walletConnect"===e.id));if(!e)throw new Error("WalletConnectConnector is required");return e}async connectWalletConnectProvider(e,t){return await e.getProvider(),new Promise((r=>{e.once("message",(e=>{"display_uri"===e.type&&(t(e.data),r())}))}))}getConnectorById(e){const t=this.wagmi.connectors.find((t=>t.id===e));if(!t)throw new Error(`Connector for id ${e} was not found`);return t}getConnectors(){return this.wagmi.connectors.filter((e=>!e.id.includes("walletConnect")))}async connectWalletConnect(e,t){const r=this.getWalletConnectConnector(),n={connector:r};return t&&(n.chainId=t),Promise.all([Dn(n),this.connectWalletConnectProvider(r,e)])}async connectConnector(e,t){const r={connector:this.getConnectorById(e)};return t&&(r.chainId=t),await Dn(r)}isInjectedProviderInstalled(){return typeof window.ethereum<"u"}safeCheckInjectedProvider(e){var t;try{const r=String(e);return Boolean(null==(t=window.ethereum)?void 0:t[r])}catch(e){return console.error(e),!1}}async getConnectedChainIds(){var e,t,r;const n=null==(t=null==(e=(await this.getWalletConnectConnector().getProvider()).signer)?void 0:e.session)?void 0:t.namespaces,i=null==(r=n?.[this.namespace])?void 0:r.methods;if(null!=i&&i.includes("wallet_addEthereumChain"))return"ALL";if(n){const e=[];return Object.keys(n).forEach((t=>{t.includes(this.namespace)&&e.push(...n[t].accounts)})),e?.map((e=>e.split(":")[1]))}return"ALL"}}function Si({projectId:e}){return function({rpc:e}){return function(t){const r=e(t);return r&&""!==r.http?{chain:{...t,rpcUrls:{...t.rpcUrls,default:{http:[r.http]}}},rpcUrls:{http:[r.http],webSocket:r.webSocket?[r.webSocket]:void 0}}:null}}({rpc:t=>{var r;return[1,3,4,5,10,42,56,69,97,100,137,280,324,420,42161,42220,43114,80001,421611,421613,1313161554,1313161555].includes(t.id)?{http:`https://rpc.walletconnect.com/v1/?chainId=eip155:${t.id}&projectId=${e}`}:{http:t.rpcUrls.default.http[0],webSocket:null==(r=t.rpcUrls.default.webSocket)?void 0:r[0]}}})}function ki({chains:e,projectId:t}){return[new Pi({chains:e,options:{projectId:t,showQrModal:!1}}),new Ce({chains:e,options:{shimDisconnect:!0}})]}var Mi=r(1475);class Ti{constructor(e,t){this.openModal=Mi.jb.open,this.closeModal=Mi.jb.close,this.subscribeModal=Mi.jb.subscribe,this.setTheme=Mi.ThemeCtrl.setThemeConfig,this.setDefaultChain=Mi.OptionsCtrl.setSelectedChain,this.subscribeEvents=Mi.uA.subscribe,Mi.ThemeCtrl.setThemeConfig(e),Mi.Id.setEthereumClient(t),Mi.ConfigCtrl.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(r.bind(r,8416));const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Mi.OptionsCtrl.setIsUiLoaded(!0)}}}const Ni=[{safeNetworkIdentifier:"mainnet",chain:{id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}},{safeNetworkIdentifier:"goerli",chain:{id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}},{safeNetworkIdentifier:"arbitrum",chain:{id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}},{chain:{id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}},{safeNetworkIdentifier:"optimism",chain:{id:10,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}}}},{chain:{id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0}},{chain:{id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]},public:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}},{chain:{id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}}],ji={selectedAccount:null,signedByAccount:null,messageSignature:null,paymentDetails:null,signatureRequested:!1,transactionRequested:!1,transactionHashSubmitted:!1,lastOrderStatus:"",elements:{divPrepare:document.getElementById("prepare"),divError:document.getElementById("message-error"),divSuccess:document.getElementById("success"),divTransactionHash:document.getElementById("pretix-eth-transaction-hash"),aOrderDetailURL:document.getElementById("pretix-order-detail-url"),aNetworkData:document.getElementById("pretix-data-chain-info"),buttonConnect:document.getElementById("btn-connect"),submittedTransactionHash:document.getElementById("pretix-eth-submitted-transaction-hash"),paymentNetworkName:document.getElementById("payment-network-id")},selectors:{paymentSteps:document.querySelectorAll(".pretix-eth-payment-steps")},chains:[],web3Modal:null};function Ri(){return ji.elements.buttonConnect.getAttribute("data-transaction-details-url")}async function Li(e=!1){if(!e&&null!==ji.paymentDetails)return ji.paymentDetails;const t=await(Zn()?.address),r=Ri(),n=await fetch(r+"?"+new URLSearchParams({sender_address:t}));if(n.status>=400)throw"Failed to fetch order details. If this problem persists, please contact the organizer directly.";return await n.json()}function Bi(e){e+="=";const t=decodeURIComponent(document.cookie).split(";");for(let r=0;r{const e=`https://safe-transaction-${ji.safeNetworkIdentifier}.safe.global/api/v1/safes/${ji.selectedAccount}`;return(await fetch(e)).ok};if(!await t())return $i("This version of the crypto payment plugin only supports Safe wallet (on supported networks) and EOA wallets. Please connect another wallet."),void(ji.signatureRequested=!1);const r=await Yn(e),n=new URL(window.location.origin+window.__validateSignatureUrl);n.searchParams.append("signature",r),n.searchParams.append("sender",ji.selectedAccount);const i=Bi("pretix_csrftoken"),o=await fetch(n.href,{headers:{"Content-Type":"application/x-www-form-urlencoded","X-CSRF-TOKEN":i,"HTTP-X-CSRFTOKEN":i},method:"GET"});if(ji.messageSignature=r,ji.signedByAccount=ji.selectedAccount,!o.ok)return $i("EIP1271 error: unable to verify signature; your wallet may not be supported."),void(ji.signatureRequested=!1);await Wi()}else{const t=await Yn(e);ji.messageSignature=t,ji.signedByAccount=ji.selectedAccount,await Wi()}}}()}catch(e){$i(e),ji.signatureRequested=!1}}();else $i("Please wait for other payments from your wallet to be confirmed before submitting another transaction.");else $i("It seems that you have paid for this order already.")}()}catch(e){$i(e,!0)}}async function Wi(){try{await async function(){if(!0!==ji.transactionRequested)if(ji.transactionRequested=!0,ji.paymentDetails=await Li(),null!==ji.paymentDetails.erc20_contract_address){const e=ji.paymentDetails.erc20_contract_address,t=await Vn({abi:Wn,address:e,functionName:"balanceOf",args:[ji.selectedAccount]});if(BigInt(t)"name"in e&&e.name===i)),chainId:n},result:v}}(i);r=o.request}return{hash:await t.writeContract({...r,chain:null})}}({abi:Wn,address:e,functionName:"transfer",args:[ji.paymentDetails.recipient_address,ji.paymentDetails.amount]});await Fi(t)}catch(e){$i(e)}}else{Ui("send-transaction");try{const{hash:e}=await async function({accessList:e,account:t,chainId:r,data:n,gas:i,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,mode:c,nonce:l,to:u,value:h}){const d=await qn({chainId:r});if(!d)throw new I;let p;return r&&ni({chainId:r}),p="prepared"===c?{account:t,accessList:e,chain:null,data:n,gas:i,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:l,to:u,value:h}:await async function({accessList:e,account:t,chainId:r,data:n,gas:i,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:c,to:l,value:u,walletClient:h}){const d=Hn({chainId:r}),p=h??await qn({chainId:r});if(!p)throw new I;r&&ni({chainId:r});const f=(l&&!(0,ae.U)(l)?await async function({chainId:e,name:t}){const r=Hn({chainId:e}),n=await r.getEnsAddress({name:vn(t)});try{return"0x0000000000000000000000000000000000000000"===n?null:n?(0,P.K)(n):null}catch(e){return null}}({name:l}):l)||void 0;if(f&&!(0,ae.U)(f))throw new Error("Invalid address");return{accessList:e,account:t,data:n,gas:void 0===i?await d.estimateGas({accessList:e,account:p.account,data:n,gas:i??void 0,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:c,to:f,value:u}):i||void 0,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,mode:"prepared",nonce:c,to:f,value:u,...r?{chainId:r}:{}}}({accessList:e,account:t,chainId:r,data:n,gas:i||null,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:l,to:u,value:h}),{hash:await d.sendTransaction({...p,chain:null})}}({to:ji.paymentDetails.recipient_address,value:ji.paymentDetails.amount});await Fi(e)}catch(e){$i(e)}}else console.log("Transaction was already submitted.")}()}catch(e){$i(e,!0)}}async function Fi(e){try{await async function(e){const t=await(async e=>{try{const t=`https://safe-transaction-${ji.safeNetworkIdentifier}.safe.global/api/v1/multisig-transactions/${e}`;if((await fetch(t)).ok)return t}catch(e){return}})(e),r=Bi("pretix_csrftoken"),n=Ri();let i=new URLSearchParams({signedMessage:ji.messageSignature,transactionHash:e,selectedAccount:ji.signedByAccount,csrfmiddlewaretoken:r});t&&i.append("safeAppTransactionUrl",t),fetch(n,{headers:{"Content-Type":"application/x-www-form-urlencoded","X-CSRF-TOKEN":r,"HTTP-X-CSRFTOKEN":r},method:"POST",body:i}).then((async r=>{r.ok?(function(e,t){ji.transactionHashSubmitted=!0;const r=ji.elements.aNetworkData.getAttribute("data-chain-id");ji.elements.divTransactionHash.innerHTML=t||function(e,t){const r=Ni.filter((t=>t.chain.id===parseInt(e)));let n;r&&(n=r[0].chain);const i=n?.blockExplorers?.etherscan?.url;return i?''+t+"":t}(r,e),Ui(),ji.elements.divSuccess.style.display="block"}(e,t),await async function(){for(;;)await Di(),await new Promise((e=>setTimeout(e,5e3)))}()):$i("There was an error processing your payment, please contact support. Your payment was sent in transaction "+e+".",!1)}))}(e)}catch(e){$i(e,!0)}}!async function(){const e=ji.elements.buttonConnect.getAttribute("data-chain-id"),t=document.getElementById("web3modal").getAttribute("data-walletconnect-id");document.title="Pretix Payment";const r=Ni.filter((t=>t.chain.id===parseInt(e)));if(r.length<1)return void $i("Invalid chain ID");const{publicClient:n}=function(e,t,{batch:r={multicall:{wait:32}},pollingInterval:n=4e3,rank:i,retryCount:o,retryDelay:s,stallTimeout:a}={}){if(!e.length)throw new Error("must have at least one chain");let c=[];const l={},u={};for(const r of e){let e=!1;for(const n of t){const t=n(r);t&&(e=!0,c.some((({id:e})=>e===r.id))||(c=[...c,t.chain]),l[r.id]=[...l[r.id]||[],...t.rpcUrls.http],t.rpcUrls.webSocket&&(u[r.id]=[...u[r.id]||[],...t.rpcUrls.webSocket]))}if(!e)throw new Error([`Could not find valid provider configuration for chain "${r.name}".\n`,"You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.","Read more: https://wagmi.sh/core/providers/jsonRpc"].join("\n"))}return{chains:c,publicClient:({chainId:t})=>{const u=c.find((e=>e.id===t))??e[0],h=l[u.id];if(!h||!h[0])throw new Error(`No providers configured for chain "${u.id}"`);const d=zt({batch:r,chain:u,transport:Wt(h.map((e=>function(e,t={}){const{batch:r,fetchOptions:n,key:i="http",name:o="HTTP JSON-RPC",retryDelay:s}=t;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:h=0}="object"==typeof r?r:{},d=t.retryCount??c,p=l??t.timeout??1e4,f=e||a?.rpcUrls.default.http[0];if(!f)throw new Ft;return ye({key:i,name:o,async request({method:t,params:i}){const o={method:t,params:i},{schedule:s}=(0,Ht.S)({id:`${e}`,wait:h,shouldSplitBatch:e=>e.length>u,fn:e=>Zt.http(f,{body:e,fetchOptions:n,timeout:p})}),[{error:a,result:c}]=await(async e=>r?s(e):[await Zt.http(f,{body:e,fetchOptions:n,timeout:p})])(o);if(a)throw new me.bs({body:o,error:a,url:f});return c},retryCount:d,retryDelay:s,timeout:p,type:"http"},{url:e})}}(e,{timeout:a}))),{rank:i,retryCount:o,retryDelay:s}),pollingInterval:n});return Object.assign(d,{chains:c})},webSocketPublicClient:({chainId:t})=>{const l=c.find((e=>e.id===t))??e[0],h=u[l.id];if(!h||!h[0])return;const d=zt({batch:r,chain:l,transport:Wt(h.map((e=>function(e,t={}){const{key:r="webSocket",name:n="WebSocket JSON-RPC",retryDelay:i}=t;return({chain:o,retryCount:s,timeout:a})=>{const c=t.retryCount??s,l=a??t.timeout??1e4,u=e||o?.rpcUrls.default.webSocket?.[0];if(!u)throw new Ft;return ye({key:r,name:n,async request({method:e,params:t}){const r={method:e,params:t},n=await Kt(u),{error:i,result:o}=await Zt.webSocketAsync(n,{body:r,timeout:l});if(i)throw new me.bs({body:r,error:i,url:u});return o},retryCount:c,retryDelay:i,timeout:l,type:"webSocket"},{getSocket:()=>Kt(u),async subscribe({params:e,onData:t,onError:r}){const n=await Kt(u),{result:i}=await new Promise(((i,o)=>Zt.webSocket(n,{body:{method:"eth_subscribe",params:e},onResponse(e){if(e.error)return o(e.error),void r?.(e.error);"number"!=typeof e.id?"eth_subscription"===e.method&&t(e.params):i(e)}})));return{subscriptionId:i,unsubscribe:async()=>new Promise((e=>Zt.webSocket(n,{body:{method:"eth_unsubscribe",params:[i]},onResponse:e})))}}})}}(e,{timeout:a}))),{rank:i,retryCount:o,retryDelay:s}),pollingInterval:n});return Object.assign(d,{chains:c})}}}([r[0].chain],[Si({projectId:t})]),i=function(e){const t=new class{constructor({autoConnect:e=!1,connectors:t=[new Ce],publicClient:r,storage:n=Tn({storage:"undefined"!=typeof window?window.localStorage:Mn}),logger:i={warn:console.warn},webSocketPublicClient:o}){_e(this,Rn),this.publicClients=new Map,this.webSocketPublicClients=new Map,_e(this,Nn,void 0),_e(this,jn,void 0),this.args={autoConnect:e,connectors:t,logger:i,publicClient:r,storage:n,webSocketPublicClient:o};let s,a="disconnected";if(e)try{const e=n.getItem($n),t=e?.state?.data;a=t?.account?"reconnecting":"connecting",s=t?.chain?.id}catch(e){}const c="function"==typeof t?t():t;var l,u,h,d;c.forEach((e=>e.setStorage(n))),this.store=(d=((e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(r,n,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let l;try{l=o.getStorage()}catch(e){}if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...e)}),n,i);const u=Jt(o.serialize),h=()=>{const e=o.partialize({...n()});let t;const r=u({state:e,version:o.version}).then((e=>l.setItem(o.name,e))).catch((e=>{t=e}));if(t)throw t;return r},d=i.setState;i.setState=(e,t)=>{d(e,t),h()};const p=e(((...e)=>{r(...e),h()}),n,i);let f;const m=()=>{var e;if(!l)return;s=!1,a.forEach((e=>e(n())));const t=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,n()))||void 0;return Jt(l.getItem.bind(l))(o.name).then((e=>{if(e)return o.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return f=o.merge(e,null!=(t=n())?t:p),r(f,!0),h()})).then((()=>{null==t||t(f,void 0),s=!0,c.forEach((e=>e(f)))})).catch((e=>{null==t||t(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.getStorage&&(l=e.getStorage())},clearStorage:()=>{null==l||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),f||p})(e,t)):((e,t)=>(r,n,i)=>{let o={storage:Yt((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...e)}),n,i);const u=()=>{const e=o.partialize({...n()});return l.setItem(o.name,{state:e,version:o.version})},h=i.setState;i.setState=(e,t)=>{h(e,t),u()};const d=e(((...e)=>{r(...e),u()}),n,i);let p;const f=()=>{var e,t;if(!l)return;s=!1,a.forEach((e=>{var t;return e(null!=(t=n())?t:d)}));const i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=n())?e:d))||void 0;return Jt(l.getItem.bind(l))(o.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return p=o.merge(e,null!=(t=n())?t:d),r(p,!0),u()})).then((()=>{null==i||i(p,void 0),p=n(),s=!0,c.forEach((e=>e(p)))})).catch((e=>{null==i||i(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},o.skipHydration||f(),p||d})(e,t))((()=>({connectors:c,publicClient:this.getPublicClient({chainId:s}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:s})})),{name:$n,storage:n,partialize:t=>({...e&&{data:{account:t?.data?.account,chain:t?.data?.chain}},chains:t?.chains}),version:2}),(h=(e,t,r)=>{const n=r.subscribe;return r.subscribe=(e,t,i)=>{let o=e;if(t){const n=(null==i?void 0:i.equalityFn)||Object.is;let s=e(r.getState());o=r=>{const i=e(r);if(!n(s,i)){const e=s;t(s=i,e)}},(null==i?void 0:i.fireImmediately)&&t(s,s)}return n(o)},d(e,t,r)})?Xt(h):Xt),this.storage=n,Pe(this,jn,n?.getItem("wallet")),(l=Rn,u=Ln,Ee(this,l,"access private method"),u).call(this),e&&"undefined"!=typeof window&&setTimeout((async()=>await this.autoConnect()),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){return this.data?.chain?.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(e){const t="function"==typeof e?e(this.store.getState()):e;this.store.setState(t,!0)}clearState(){this.setState((e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"})))}async destroy(){this.connector&&await(this.connector.disconnect?.()),Pe(this,Nn,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(Ie(this,Nn))return;Pe(this,Nn,!0),this.setState((e=>({...e,status:e.data?.account?"reconnecting":"connecting"})));const e=Ie(this,jn)?[...this.connectors].sort((e=>e.id===Ie(this,jn)?-1:1)):this.connectors;let t=!1;for(const r of e){if(!r.ready||!r.isAuthorized)continue;if(!await r.isAuthorized())continue;const e=await r.connect();this.setState((t=>({...t,connector:r,chains:r?.chains,data:e,status:"connected"}))),t=!0;break}return t||this.setState((e=>({...e,data:void 0,status:"disconnected"}))),Pe(this,Nn,!1),this.data}setConnectors(e){this.args={...this.args,connectors:e};const t="function"==typeof e?e():e;t.forEach((e=>e.setStorage(this.args.storage))),this.setState((e=>({...e,connectors:t})))}getPublicClient({chainId:e}={}){let t=this.publicClients.get(-1);if(t&&t?.chain.id===e)return t;if(t=this.publicClients.get(e??-1),t)return t;const{publicClient:r}=this.args;return t="function"==typeof r?r({chainId:e}):r,this.publicClients.set(e??-1,t),t}setPublicClient(e){const t=this.data?.chain?.id;this.args={...this.args,publicClient:e},this.publicClients.clear(),this.setState((e=>({...e,publicClient:this.getPublicClient({chainId:t})})))}getWebSocketPublicClient({chainId:e}={}){let t=this.webSocketPublicClients.get(-1);if(t&&t?.chain.id===e)return t;if(t=this.webSocketPublicClients.get(e??-1),t)return t;const{webSocketPublicClient:r}=this.args;return t="function"==typeof r?r({chainId:e}):r,t&&this.webSocketPublicClients.set(e??-1,t),t}setWebSocketPublicClient(e){const t=this.data?.chain?.id;this.args={...this.args,webSocketPublicClient:e},this.webSocketPublicClients.clear(),this.setState((e=>({...e,webSocketPublicClient:this.getWebSocketPublicClient({chainId:t})})))}setLastUsedConnector(e=null){this.storage?.setItem("wallet",e)}}(e);return Bn=t,t}({autoConnect:!0,connectors:[...ki({projectId:t,version:2,chains:[r[0].chain]})],publicClient:n}),o=new Oi(i,r);let s;ji.web3Modal=new Ti({projectId:t},o),ji.safeNetworkIdentifier=r[0].safeNetworkIdentifier,Xn((async e=>{if("connecting"===s&&"connected"===e.status)try{await zi()}catch(e){$i(e)}s=e.status})),ei((()=>{Ui("prepare")})),ji.elements.divPrepare.style.display="block",document.getElementById("spinner").style.display="none",ji.elements.buttonConnect.addEventListener("click",(async()=>{try{await async function(){try{if((await Zn()).isConnected)return!0;await ji.web3Modal.openModal()}catch(e){throw console.error(e,"Sign in failed"),e}return!1}()&&await zi()}catch(e){$i(error)}}))}()})()})(); \ No newline at end of file +/*! For license information please see web3modal.4411707096ff89c614b4.js.LICENSE.txt */ +(()=>{var e={8099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7117);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function l(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function u(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),u(e/4294967296>>>0,t,r),u(e>>>0,t,r+4),t}function p(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e>>>0,t,r),h(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=l,t.writeUint32BE=u,t.writeInt32BE=u,t.writeUint32LE=h,t.writeInt32LE=h,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=l(e,t);return 4294967296*l(e,t+4)+r},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=p,t.writeInt64LE=p,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8099),i=r(7309),o=20;function s(e,t,r){for(var i=1634760805,s=857760878,a=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],u=r[7]<<24|r[6]<<16|r[5]<<8|r[4],h=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],p=r[19]<<24|r[18]<<16|r[17]<<8|r[16],f=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],w=t[3]<<24|t[2]<<16|t[1]<<8|t[0],b=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],y=t[15]<<24|t[14]<<16|t[13]<<8|t[12],x=i,A=s,C=a,E=c,I=l,_=u,P=h,O=d,S=p,k=f,M=m,T=g,N=w,j=b,R=v,L=y,B=0;B>>16|N<<16)|0)>>>20|I<<12,_=(_^=k=k+(j=(j^=A=A+_|0)>>>16|j<<16)|0)>>>20|_<<12,P=(P^=M=M+(R=(R^=C=C+P|0)>>>16|R<<16)|0)>>>20|P<<12,O=(O^=T=T+(L=(L^=E=E+O|0)>>>16|L<<16)|0)>>>20|O<<12,P=(P^=M=M+(R=(R^=C=C+P|0)>>>24|R<<8)|0)>>>25|P<<7,O=(O^=T=T+(L=(L^=E=E+O|0)>>>24|L<<8)|0)>>>25|O<<7,_=(_^=k=k+(j=(j^=A=A+_|0)>>>24|j<<8)|0)>>>25|_<<7,I=(I^=S=S+(N=(N^=x=x+I|0)>>>24|N<<8)|0)>>>25|I<<7,_=(_^=M=M+(L=(L^=x=x+_|0)>>>16|L<<16)|0)>>>20|_<<12,P=(P^=T=T+(N=(N^=A=A+P|0)>>>16|N<<16)|0)>>>20|P<<12,O=(O^=S=S+(j=(j^=C=C+O|0)>>>16|j<<16)|0)>>>20|O<<12,I=(I^=k=k+(R=(R^=E=E+I|0)>>>16|R<<16)|0)>>>20|I<<12,O=(O^=S=S+(j=(j^=C=C+O|0)>>>24|j<<8)|0)>>>25|O<<7,I=(I^=k=k+(R=(R^=E=E+I|0)>>>24|R<<8)|0)>>>25|I<<7,P=(P^=T=T+(N=(N^=A=A+P|0)>>>24|N<<8)|0)>>>25|P<<7,_=(_^=M=M+(L=(L^=x=x+_|0)>>>24|L<<8)|0)>>>25|_<<7;n.writeUint32LE(x+i|0,e,0),n.writeUint32LE(A+s|0,e,4),n.writeUint32LE(C+a|0,e,8),n.writeUint32LE(E+c|0,e,12),n.writeUint32LE(I+l|0,e,16),n.writeUint32LE(_+u|0,e,20),n.writeUint32LE(P+h|0,e,24),n.writeUint32LE(O+d|0,e,28),n.writeUint32LE(S+p|0,e,32),n.writeUint32LE(k+f|0,e,36),n.writeUint32LE(M+m|0,e,40),n.writeUint32LE(T+g|0,e,44),n.writeUint32LE(N+w|0,e,48),n.writeUint32LE(j+b|0,e,52),n.writeUint32LE(R+v|0,e,56),n.writeUint32LE(L+y|0,e,60)}function a(e,t,r,n,o){if(void 0===o&&(o=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,t++;if(n>0)throw new Error("ChaCha: counter overflow")}t.streamXOR=a,t.stream=function(e,t,r,n){return void 0===n&&(n=0),i.wipe(r),a(e,t,r,r,n)}},5501:(e,t,r)=>{"use strict";var n=r(5439),i=r(3027),o=r(7309),s=r(8099),a=r(4153);t.Cv=32,t.WH=12,t.pg=16;var c=new Uint8Array(16),l=function(){function e(e){if(this.nonceLength=t.WH,this.tagLength=t.pg,e.length!==t.Cv)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);n.stream(this._key,s,a,4);var c,l=t.length+this.tagLength;if(i){if(i.length!==l)throw new Error("ChaCha20Poly1305: incorrect destination length");c=i}else c=new Uint8Array(l);return n.streamXOR(this._key,s,t,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),r),o.wipe(s),c},e.prototype.open=function(e,t,r,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&a.update(c.subarray(n.length%16))),a.update(r),r.length%16>0&&a.update(c.subarray(r.length%16));var l=new Uint8Array(8);n&&s.writeUint64LE(n.length,l),a.update(l),s.writeUint64LE(r.length,l),a.update(l);for(var u=a.digest(),h=0;h{"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},1050:(e,t,r)=>{"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0;r(1416);const n=r(3350);r(7309);function i(e){const t=new Float64Array(16);if(e)for(let r=0;r>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,d(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}function f(e){const t=new Uint8Array(32);return p(t,e),1&t[0]}function m(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function g(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function w(e,t,r){let n,i,o=0,s=0,a=0,c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=0,w=0,b=0,v=0,y=0,x=0,A=0,C=0,E=0,I=0,_=0,P=0,O=0,S=0,k=0,M=0,T=0,N=0,j=0,R=0,L=r[0],B=r[1],$=r[2],U=r[3],D=r[4],z=r[5],W=r[6],F=r[7],H=r[8],q=r[9],V=r[10],G=r[11],K=r[12],Z=r[13],Q=r[14],Y=r[15];n=t[0],o+=n*L,s+=n*B,a+=n*$,c+=n*U,l+=n*D,u+=n*z,h+=n*W,d+=n*F,p+=n*H,f+=n*q,m+=n*V,g+=n*G,w+=n*K,b+=n*Z,v+=n*Q,y+=n*Y,n=t[1],s+=n*L,a+=n*B,c+=n*$,l+=n*U,u+=n*D,h+=n*z,d+=n*W,p+=n*F,f+=n*H,m+=n*q,g+=n*V,w+=n*G,b+=n*K,v+=n*Z,y+=n*Q,x+=n*Y,n=t[2],a+=n*L,c+=n*B,l+=n*$,u+=n*U,h+=n*D,d+=n*z,p+=n*W,f+=n*F,m+=n*H,g+=n*q,w+=n*V,b+=n*G,v+=n*K,y+=n*Z,x+=n*Q,A+=n*Y,n=t[3],c+=n*L,l+=n*B,u+=n*$,h+=n*U,d+=n*D,p+=n*z,f+=n*W,m+=n*F,g+=n*H,w+=n*q,b+=n*V,v+=n*G,y+=n*K,x+=n*Z,A+=n*Q,C+=n*Y,n=t[4],l+=n*L,u+=n*B,h+=n*$,d+=n*U,p+=n*D,f+=n*z,m+=n*W,g+=n*F,w+=n*H,b+=n*q,v+=n*V,y+=n*G,x+=n*K,A+=n*Z,C+=n*Q,E+=n*Y,n=t[5],u+=n*L,h+=n*B,d+=n*$,p+=n*U,f+=n*D,m+=n*z,g+=n*W,w+=n*F,b+=n*H,v+=n*q,y+=n*V,x+=n*G,A+=n*K,C+=n*Z,E+=n*Q,I+=n*Y,n=t[6],h+=n*L,d+=n*B,p+=n*$,f+=n*U,m+=n*D,g+=n*z,w+=n*W,b+=n*F,v+=n*H,y+=n*q,x+=n*V,A+=n*G,C+=n*K,E+=n*Z,I+=n*Q,_+=n*Y,n=t[7],d+=n*L,p+=n*B,f+=n*$,m+=n*U,g+=n*D,w+=n*z,b+=n*W,v+=n*F,y+=n*H,x+=n*q,A+=n*V,C+=n*G,E+=n*K,I+=n*Z,_+=n*Q,P+=n*Y,n=t[8],p+=n*L,f+=n*B,m+=n*$,g+=n*U,w+=n*D,b+=n*z,v+=n*W,y+=n*F,x+=n*H,A+=n*q,C+=n*V,E+=n*G,I+=n*K,_+=n*Z,P+=n*Q,O+=n*Y,n=t[9],f+=n*L,m+=n*B,g+=n*$,w+=n*U,b+=n*D,v+=n*z,y+=n*W,x+=n*F,A+=n*H,C+=n*q,E+=n*V,I+=n*G,_+=n*K,P+=n*Z,O+=n*Q,S+=n*Y,n=t[10],m+=n*L,g+=n*B,w+=n*$,b+=n*U,v+=n*D,y+=n*z,x+=n*W,A+=n*F,C+=n*H,E+=n*q,I+=n*V,_+=n*G,P+=n*K,O+=n*Z,S+=n*Q,k+=n*Y,n=t[11],g+=n*L,w+=n*B,b+=n*$,v+=n*U,y+=n*D,x+=n*z,A+=n*W,C+=n*F,E+=n*H,I+=n*q,_+=n*V,P+=n*G,O+=n*K,S+=n*Z,k+=n*Q,M+=n*Y,n=t[12],w+=n*L,b+=n*B,v+=n*$,y+=n*U,x+=n*D,A+=n*z,C+=n*W,E+=n*F,I+=n*H,_+=n*q,P+=n*V,O+=n*G,S+=n*K,k+=n*Z,M+=n*Q,T+=n*Y,n=t[13],b+=n*L,v+=n*B,y+=n*$,x+=n*U,A+=n*D,C+=n*z,E+=n*W,I+=n*F,_+=n*H,P+=n*q,O+=n*V,S+=n*G,k+=n*K,M+=n*Z,T+=n*Q,N+=n*Y,n=t[14],v+=n*L,y+=n*B,x+=n*$,A+=n*U,C+=n*D,E+=n*z,I+=n*W,_+=n*F,P+=n*H,O+=n*q,S+=n*V,k+=n*G,M+=n*K,T+=n*Z,N+=n*Q,j+=n*Y,n=t[15],y+=n*L,x+=n*B,A+=n*$,C+=n*U,E+=n*D,I+=n*z,_+=n*W,P+=n*F,O+=n*H,S+=n*q,k+=n*V,M+=n*G,T+=n*K,N+=n*Z,j+=n*Q,R+=n*Y,o+=38*x,s+=38*A,a+=38*C,c+=38*E,l+=38*I,u+=38*_,h+=38*P,d+=38*O,p+=38*S,f+=38*k,m+=38*M,g+=38*T,w+=38*N,b+=38*j,v+=38*R,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=w+i+65535,i=Math.floor(n/65536),w=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=w+i+65535,i=Math.floor(n/65536),w=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=l,e[5]=u,e[6]=h,e[7]=d,e[8]=p,e[9]=f,e[10]=m,e[11]=g,e[12]=w,e[13]=b,e[14]=v,e[15]=y}function b(e,t){w(e,t,t)}function v(e,t){const r=i(),n=i(),o=i(),s=i(),c=i(),l=i(),u=i(),h=i(),d=i();g(r,e[1],e[0]),g(d,t[1],t[0]),w(r,r,d),m(n,e[0],e[1]),m(d,t[0],t[1]),w(n,n,d),w(o,e[3],t[3]),w(o,o,a),w(s,e[2],t[2]),m(s,s,s),g(c,n,r),g(l,s,o),m(u,s,o),m(h,n,r),w(e[0],c,l),w(e[1],h,u),w(e[2],u,l),w(e[3],c,h)}function y(e,t,r){for(let n=0;n<4;n++)d(e[n],t[n],r)}function x(e,t){const r=i(),n=i(),o=i();(function(e,t){const r=i();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)b(r,r),2!==n&&4!==n&&w(r,r,t);for(n=0;n<16;n++)e[n]=r[n]})(o,t[2]),w(r,t[0],o),w(n,t[1],o),p(e,n),e[31]^=f(r)<<7}function A(e,t){const r=[i(),i(),i(),i()];u(r[0],c),u(r[1],l),u(r[2],s),w(r[3],c,l),function(e,t,r){u(e[0],o),u(e[1],s),u(e[2],s),u(e[3],o);for(let n=255;n>=0;--n){const i=r[n/8|0]>>(7&n)&1;y(e,t,i),v(t,e),v(e,e),y(e,t,i)}}(e,r,t)}t._w=function(e){if(e.length!==t.aP)throw new Error(`ed25519: seed must be ${t.aP} bytes`);const r=(0,n.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const o=new Uint8Array(32),s=[i(),i(),i(),i()];A(s,r),x(o,s);const a=new Uint8Array(64);return a.set(e),a.set(o,32),{publicKey:o,secretKey:a}};const C=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function E(e,t){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>4)*C[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*C[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function I(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;E(e,t)}t.Xx=function(e,t){const r=new Float64Array(64),o=[i(),i(),i(),i()],s=(0,n.hash)(e.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;const a=new Uint8Array(64);a.set(s.subarray(32),32);const c=new n.SHA512;c.update(a.subarray(32)),c.update(t);const l=c.digest();c.clean(),I(l),A(o,l),x(a,o),c.reset(),c.update(a.subarray(0,32)),c.update(e.subarray(32)),c.update(t);const u=c.digest();I(u);for(let e=0;e<32;e++)r[e]=l[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=u[e]*s[t];return E(a.subarray(32),r),a}},9984:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},512:(e,t,r)=>{"use strict";var n=r(5629),i=r(7309),o=function(){function e(e,t,r,i){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=n.hmac(this._hash,r,t);this._hmac=new n.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9984),i=r(4153),o=r(7309),s=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},3027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4153),i=r(7309);t.DIGEST_LENGTH=16;var o=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=e[0]|e[1]<<8;this._r[0]=8191&r;var n=e[2]|e[3]<<8;this._r[1]=8191&(r>>>13|n<<3);var i=e[4]|e[5]<<8;this._r[2]=7939&(n>>>10|i<<6);var o=e[6]|e[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=e[8]|e[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=e[12]|e[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var l=e[14]|e[15]<<8;this._r[8]=8191&(c>>>8|l<<8),this._r[9]=l>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var n=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],l=this._h[5],u=this._h[6],h=this._h[7],d=this._h[8],p=this._h[9],f=this._r[0],m=this._r[1],g=this._r[2],w=this._r[3],b=this._r[4],v=this._r[5],y=this._r[6],x=this._r[7],A=this._r[8],C=this._r[9];r>=16;){var E=e[t+0]|e[t+1]<<8;i+=8191&E;var I=e[t+2]|e[t+3]<<8;o+=8191&(E>>>13|I<<3);var _=e[t+4]|e[t+5]<<8;s+=8191&(I>>>10|_<<6);var P=e[t+6]|e[t+7]<<8;a+=8191&(_>>>7|P<<9);var O=e[t+8]|e[t+9]<<8;c+=8191&(P>>>4|O<<12),l+=O>>>1&8191;var S=e[t+10]|e[t+11]<<8;u+=8191&(O>>>14|S<<2);var k=e[t+12]|e[t+13]<<8;h+=8191&(S>>>11|k<<5);var M=e[t+14]|e[t+15]<<8,T=0,N=T;N+=i*f,N+=o*(5*C),N+=s*(5*A),N+=a*(5*x),T=(N+=c*(5*y))>>>13,N&=8191,N+=l*(5*v),N+=u*(5*b),N+=h*(5*w),N+=(d+=8191&(k>>>8|M<<8))*(5*g);var j=T+=(N+=(p+=M>>>5|n)*(5*m))>>>13;j+=i*m,j+=o*f,j+=s*(5*C),j+=a*(5*A),T=(j+=c*(5*x))>>>13,j&=8191,j+=l*(5*y),j+=u*(5*v),j+=h*(5*b),j+=d*(5*w),T+=(j+=p*(5*g))>>>13,j&=8191;var R=T;R+=i*g,R+=o*m,R+=s*f,R+=a*(5*C),T=(R+=c*(5*A))>>>13,R&=8191,R+=l*(5*x),R+=u*(5*y),R+=h*(5*v),R+=d*(5*b);var L=T+=(R+=p*(5*w))>>>13;L+=i*w,L+=o*g,L+=s*m,L+=a*f,T=(L+=c*(5*C))>>>13,L&=8191,L+=l*(5*A),L+=u*(5*x),L+=h*(5*y),L+=d*(5*v);var B=T+=(L+=p*(5*b))>>>13;B+=i*b,B+=o*w,B+=s*g,B+=a*m,T=(B+=c*f)>>>13,B&=8191,B+=l*(5*C),B+=u*(5*A),B+=h*(5*x),B+=d*(5*y);var $=T+=(B+=p*(5*v))>>>13;$+=i*v,$+=o*b,$+=s*w,$+=a*g,T=($+=c*m)>>>13,$&=8191,$+=l*f,$+=u*(5*C),$+=h*(5*A),$+=d*(5*x);var U=T+=($+=p*(5*y))>>>13;U+=i*y,U+=o*v,U+=s*b,U+=a*w,T=(U+=c*g)>>>13,U&=8191,U+=l*m,U+=u*f,U+=h*(5*C),U+=d*(5*A);var D=T+=(U+=p*(5*x))>>>13;D+=i*x,D+=o*y,D+=s*v,D+=a*b,T=(D+=c*w)>>>13,D&=8191,D+=l*g,D+=u*m,D+=h*f,D+=d*(5*C);var z=T+=(D+=p*(5*A))>>>13;z+=i*A,z+=o*x,z+=s*y,z+=a*v,T=(z+=c*b)>>>13,z&=8191,z+=l*w,z+=u*g,z+=h*m,z+=d*f;var W=T+=(z+=p*(5*C))>>>13;W+=i*C,W+=o*A,W+=s*x,W+=a*y,T=(W+=c*v)>>>13,W&=8191,W+=l*b,W+=u*w,W+=h*g,W+=d*m,i=N=8191&(T=(T=((T+=(W+=p*f)>>>13)<<2)+T|0)+(N&=8191)|0),o=j+=T>>>=13,s=R&=8191,a=L&=8191,c=B&=8191,l=$&=8191,u=U&=8191,h=D&=8191,d=z&=8191,p=W&=8191,t+=16,r-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=l,this._h[6]=u,this._h[7]=h,this._h[8]=d,this._h[9]=p},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,n,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=r,r=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,s[0]=this._h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this._h[o]=this._h[o]&n|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,n=e.length;if(this._leftover){(t=16-this._leftover)>n&&(t=n);for(var i=0;i=16&&(t=n-n%16,this._blocks(e,r,t),r+=t,n-=t),n){for(i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const n=r(6008),i=r(8099),o=r(7309);function s(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const r=s(4,e),n=(0,i.readUint32LE)(r);return(0,o.wipe)(r),n};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let i="";const c=r.length,l=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/l),n);for(let n=0;n0;n++){const o=t[n];o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0,t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const n=r(7309);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(5883);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const n=r(5455),i=r(8871);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},3294:(e,t,r)=>{"use strict";var n=r(8099),i=r(7309);t.k=32,t.cn=64;var o=function(){function e(){this.digestLength=t.k,this.blockSize=t.cn,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.mE=o;var s=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(e,t,r,i,o){for(;o>=64;){for(var a=t[0],c=t[1],l=t[2],u=t[3],h=t[4],d=t[5],p=t[6],f=t[7],m=0;m<16;m++){var g=i+4*m;e[m]=n.readUint32BE(r,g)}for(m=16;m<64;m++){var w=e[m-2],b=(w>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,v=((w=e[m-15])>>>7|w<<25)^(w>>>18|w<<14)^w>>>3;e[m]=(b+e[m-7]|0)+(v+e[m-16]|0)}for(m=0;m<64;m++)b=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&d^~h&p)|0)+(f+(s[m]+e[m]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&l^c&l)|0,f=p,p=d,d=h,h=u+b|0,u=l,l=c,c=a,a=b+v|0;t[0]+=a,t[1]+=c,t[2]+=l,t[3]+=u,t[4]+=h,t[5]+=d,t[6]+=p,t[7]+=f,i+=64,o-=64}return i}t.vp=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},3350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8099),i=r(7309);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,o,a,c){for(var l,u,h,d,p,f,m,g,w=r[0],b=r[1],v=r[2],y=r[3],x=r[4],A=r[5],C=r[6],E=r[7],I=i[0],_=i[1],P=i[2],O=i[3],S=i[4],k=i[5],M=i[6],T=i[7];c>=128;){for(var N=0;N<16;N++){var j=8*N+a;e[N]=n.readUint32BE(o,j),t[N]=n.readUint32BE(o,j+4)}for(N=0;N<80;N++){var R,L,B=w,$=b,U=v,D=y,z=x,W=A,F=C,H=I,q=_,V=P,G=O,K=S,Z=k,Q=M;if(p=65535&(u=T),f=u>>>16,m=65535&(l=E),g=l>>>16,p+=65535&(u=(S>>>14|x<<18)^(S>>>18|x<<14)^(x>>>9|S<<23)),f+=u>>>16,m+=65535&(l=(x>>>14|S<<18)^(x>>>18|S<<14)^(S>>>9|x<<23)),g+=l>>>16,p+=65535&(u=S&k^~S&M),f+=u>>>16,m+=65535&(l=x&A^~x&C),g+=l>>>16,l=s[2*N],p+=65535&(u=s[2*N+1]),f+=u>>>16,m+=65535&l,g+=l>>>16,l=e[N%16],f+=(u=t[N%16])>>>16,m+=65535&l,g+=l>>>16,m+=(f+=(p+=65535&u)>>>16)>>>16,p=65535&(u=d=65535&p|f<<16),f=u>>>16,m=65535&(l=h=65535&m|(g+=m>>>16)<<16),g=l>>>16,p+=65535&(u=(I>>>28|w<<4)^(w>>>2|I<<30)^(w>>>7|I<<25)),f+=u>>>16,m+=65535&(l=(w>>>28|I<<4)^(I>>>2|w<<30)^(I>>>7|w<<25)),g+=l>>>16,f+=(u=I&_^I&P^_&P)>>>16,m+=65535&(l=w&b^w&v^b&v),g+=l>>>16,R=65535&(m+=(f+=(p+=65535&u)>>>16)>>>16)|(g+=m>>>16)<<16,L=65535&p|f<<16,p=65535&(u=G),f=u>>>16,m=65535&(l=D),g=l>>>16,f+=(u=d)>>>16,m+=65535&(l=h),g+=l>>>16,b=B,v=$,y=U,x=D=65535&(m+=(f+=(p+=65535&u)>>>16)>>>16)|(g+=m>>>16)<<16,A=z,C=W,E=F,w=R,_=H,P=q,O=V,S=G=65535&p|f<<16,k=K,M=Z,T=Q,I=L,N%16==15)for(j=0;j<16;j++)l=e[j],p=65535&(u=t[j]),f=u>>>16,m=65535&l,g=l>>>16,l=e[(j+9)%16],p+=65535&(u=t[(j+9)%16]),f+=u>>>16,m+=65535&l,g+=l>>>16,h=e[(j+1)%16],p+=65535&(u=((d=t[(j+1)%16])>>>1|h<<31)^(d>>>8|h<<24)^(d>>>7|h<<25)),f+=u>>>16,m+=65535&(l=(h>>>1|d<<31)^(h>>>8|d<<24)^h>>>7),g+=l>>>16,h=e[(j+14)%16],f+=(u=((d=t[(j+14)%16])>>>19|h<<13)^(h>>>29|d<<3)^(d>>>6|h<<26))>>>16,m+=65535&(l=(h>>>19|d<<13)^(d>>>29|h<<3)^h>>>6),g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,e[j]=65535&m|g<<16,t[j]=65535&p|f<<16}p=65535&(u=I),f=u>>>16,m=65535&(l=w),g=l>>>16,l=r[0],f+=(u=i[0])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[0]=w=65535&m|g<<16,i[0]=I=65535&p|f<<16,p=65535&(u=_),f=u>>>16,m=65535&(l=b),g=l>>>16,l=r[1],f+=(u=i[1])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[1]=b=65535&m|g<<16,i[1]=_=65535&p|f<<16,p=65535&(u=P),f=u>>>16,m=65535&(l=v),g=l>>>16,l=r[2],f+=(u=i[2])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[2]=v=65535&m|g<<16,i[2]=P=65535&p|f<<16,p=65535&(u=O),f=u>>>16,m=65535&(l=y),g=l>>>16,l=r[3],f+=(u=i[3])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[3]=y=65535&m|g<<16,i[3]=O=65535&p|f<<16,p=65535&(u=S),f=u>>>16,m=65535&(l=x),g=l>>>16,l=r[4],f+=(u=i[4])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[4]=x=65535&m|g<<16,i[4]=S=65535&p|f<<16,p=65535&(u=k),f=u>>>16,m=65535&(l=A),g=l>>>16,l=r[5],f+=(u=i[5])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[5]=A=65535&m|g<<16,i[5]=k=65535&p|f<<16,p=65535&(u=M),f=u>>>16,m=65535&(l=C),g=l>>>16,l=r[6],f+=(u=i[6])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[6]=C=65535&m|g<<16,i[6]=M=65535&p|f<<16,p=65535&(u=T),f=u>>>16,m=65535&(l=E),g=l>>>16,l=r[7],f+=(u=i[7])>>>16,m+=65535&l,g+=l>>>16,g+=(m+=(f+=(p+=65535&u)>>>16)>>>16)>>>16,r[7]=E=65535&m|g<<16,i[7]=T=65535&p|f<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},7309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t{"use strict";t.gi=t.Au=t.KS=t.kz=void 0;const n=r(1416),i=r(7309);function o(e){const t=new Float64Array(16);if(e)for(let r=0;r=0;--e){const t=r[e>>>3]>>>(7&e)&1;l(i,s,t),l(f,m,t),u(g,i,f),h(i,i,f),u(f,s,m),h(s,s,m),p(m,g),p(w,i),d(i,f,i),d(f,s,g),u(g,i,f),h(i,i,f),p(s,i),h(f,m,w),d(i,f,a),u(i,i,m),d(f,f,i),d(i,m,w),d(m,s,n),p(s,g),l(i,s,t),l(f,m,t)}for(let e=0;e<16;e++)n[e+16]=i[e],n[e+32]=f[e],n[e+48]=s[e],n[e+64]=m[e];const b=n.subarray(32),v=n.subarray(16);!function(e,t){const r=o();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)p(r,r),2!==e&&4!==e&&d(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(b,b),d(v,v,b);const y=new Uint8Array(32);return function(e,t){const r=o(),n=o();for(let e=0;e<16;e++)n[e]=t[e];c(n),c(n),c(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,l(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}(y,v),y}t.Au=function(e){const r=(0,n.randomBytes)(32,e),o=function(e){if(e.length!==t.KS)throw new Error(`x25519: seed must be ${t.KS} bytes`);const r=new Uint8Array(e);return{publicKey:(n=r,f(n,s)),secretKey:r};var n}(r);return(0,i.wipe)(r),o},t.gi=function(e,r,n=!1){if(e.length!==t.kz)throw new Error("X25519: incorrect secret key length");if(r.length!==t.kz)throw new Error("X25519: incorrect public key length");const i=f(e,r);if(n){let e=0;for(let t=0;t{"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){const e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},8618:(e,t)=>{"use strict";function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function n(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=r,t.isNode=n,t.isBrowser=function(){return!r()&&!n()}},1468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(926),t),n.__exportStar(r(8618),t)},9328:(e,t,r)=>{"use strict";r.d(t,{OPTIONAL_EVENTS:()=>Na,OPTIONAL_METHODS:()=>Ma,default:()=>qa});var n={};r.r(n),r.d(n,{identity:()=>B});var i={};r.r(i),r.d(i,{base2:()=>$});var o={};r.r(o),r.d(o,{base8:()=>U});var s={};r.r(s),r.d(s,{base10:()=>D});var a={};r.r(a),r.d(a,{base16:()=>z,base16upper:()=>W});var c={};r.r(c),r.d(c,{base32:()=>F,base32hex:()=>G,base32hexpad:()=>Z,base32hexpadupper:()=>Q,base32hexupper:()=>K,base32pad:()=>q,base32padupper:()=>V,base32upper:()=>H,base32z:()=>Y});var l={};r.r(l),r.d(l,{base36:()=>J,base36upper:()=>X});var u={};r.r(u),r.d(u,{base58btc:()=>ee,base58flickr:()=>te});var h={};r.r(h),r.d(h,{base64:()=>re,base64pad:()=>ne,base64url:()=>ie,base64urlpad:()=>oe});var d={};r.r(d),r.d(d,{base256emoji:()=>le});var p={};r.r(p),r.d(p,{sha256:()=>Me,sha512:()=>Te});var f={};r.r(f),r.d(f,{identity:()=>je});var m={};r.r(m),r.d(m,{code:()=>Le,decode:()=>$e,encode:()=>Be,name:()=>Re});var g={};r.r(g),r.d(g,{code:()=>We,decode:()=>He,encode:()=>Fe,name:()=>ze});var w=r(7187),b=r.n(w),v=r(5501),y=r(512),x=r(1416),A=r(3294),C=r(7664);function E(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function I(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?E(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function _(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=I(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return E(r)}const P=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var h=0,d=o-1;(0!==u||h>>0,s[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=h,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),m=n;p!==o;)f[m++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var h=t[i],d=0,p=s-1;(0!==h||d>>0,l[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var m=c.repeat(r);f{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class S{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class k{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return T(this,e)}}class M{constructor(e){this.decoders=e}or(e){return T(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const T=(e,t)=>new M({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class N{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new S(e,t,r),this.decoder=new k(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const j=({name:e,prefix:t,encode:r,decode:n})=>new N(e,t,r,n),R=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=P(r,t);return j({prefix:e,name:t,encode:n,decode:e=>O(i(e))})},L=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>j({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<((e,t,r,n)=>{const i={};for(let e=0;e=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),B=j({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)}),$=L({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),U=L({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),D=R({prefix:"9",name:"base10",alphabet:"0123456789"}),z=L({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),W=L({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),F=L({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),H=L({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),q=L({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),V=L({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),G=L({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),K=L({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Z=L({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Q=L({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Y=L({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),J=R({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),X=R({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ee=R({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),te=R({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),re=L({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ne=L({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ie=L({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),oe=L({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),se=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ae=se.reduce(((e,t,r)=>(e[r]=t,e)),[]),ce=se.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),le=j({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+ae[t]),"")},decode:function(e){const t=[];for(const r of e){const e=ce[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var ue=128,he=-128,de=Math.pow(2,31),pe=Math.pow(2,7),fe=Math.pow(2,14),me=Math.pow(2,21),ge=Math.pow(2,28),we=Math.pow(2,35),be=Math.pow(2,42),ve=Math.pow(2,49),ye=Math.pow(2,56),xe=Math.pow(2,63);const Ae=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=de;)r[n++]=255&t|ue,t/=128;for(;t&he;)r[n++]=255&t|ue,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},Ce=function(e){return e(Ae(e,t,r),t),Ie=e=>Ce(e),_e=(e,t)=>{const r=t.byteLength,n=Ie(e),i=n+Ie(r),o=new Uint8Array(i+r);return Ee(e,o,0),Ee(r,o,n),o.set(t,i),new Pe(e,r,t,o)};class Pe{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const Oe=({name:e,code:t,encode:r})=>new Se(e,t,r);class Se{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?_e(this.code,t):t.then((e=>_e(this.code,e)))}throw Error("Unknown type, must be binary type")}}const ke=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Me=Oe({name:"sha2-256",code:18,encode:ke("SHA-256")}),Te=Oe({name:"sha2-512",code:19,encode:ke("SHA-512")}),Ne=O,je={code:0,name:"identity",encode:Ne,digest:e=>_e(0,Ne(e))},Re="raw",Le=85,Be=e=>O(e),$e=e=>O(e),Ue=new TextEncoder,De=new TextDecoder,ze="json",We=512,Fe=e=>Ue.encode(JSON.stringify(e)),He=e=>JSON.parse(De.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const qe={...n,...i,...o,...s,...a,...c,...l,...u,...h,...d};function Ve(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Ge=Ve("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Ke=Ve("ascii","a",(e=>{let t="a";for(let r=0;r{const t=I((e=e.substring(1)).length);for(let r=0;r"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function Et(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var It=Object.defineProperty,_t=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,St=(e,t,r)=>t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kt=(e,t)=>{for(var r in t||(t={}))Pt.call(t,r)&&St(e,r,t[r]);if(_t)for(var r of _t(t))Ot.call(t,r)&&St(e,r,t[r]);return e};const Mt="ReactNative",Tt={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Nt="js";function jt(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Rt(){return!(0,ut.getDocument)()&&!!(0,ut.getNavigator)()&&navigator.product===Mt}function Lt(){return!jt()&&!!(0,ut.getNavigator)()}function Bt(){return Rt()?Tt.reactNative:jt()?Tt.node:Lt()?Tt.browser:Tt.unknown}function $t(e,t,n){const i=function(){if(typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}const e=t?ct(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new nt:"undefined"!=typeof navigator?ct(navigator.userAgent):"undefined"!=typeof process&&process.version?new et(process.version.slice(1)):null;var t;if(null===e)return"unknown";const n=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[n,e.name,e.version].join("-"):[n,e.version].join("-")}(),o=function(){var e;const t=Bt();return t===Tt.browser?[t,(null==(e=(0,ut.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[Nt,n].join("-"),i,o].join("/")}function Ut(e,t){return e.filter((e=>t.includes(e))).length===e.length}function Dt(e){return Object.fromEntries(e.entries())}function zt(e){return new Map(Object.entries(e))}function Wt(e=lt.FIVE_MINUTES,t){const r=(0,lt.toMiliseconds)(e||lt.FIVE_MINUTES);let n,i,o;return{resolve:e=>{o&&n&&(clearTimeout(o),n(e))},reject:e=>{o&&i&&(clearTimeout(o),i(e))},done:()=>new Promise(((e,s)=>{o=setTimeout((()=>{s(new Error(t))}),r),n=e,i=s}))}}function Ft(e,t,r){return new Promise((async(n,i)=>{const o=setTimeout((()=>i(new Error(r))),t);try{n(await e)}catch(e){i(e)}clearTimeout(o)}))}function Ht(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function qt(e){const[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);n.id=Number(r)}return n}function Vt(e,t){return(0,lt.fromMiliseconds)((t||Date.now())+(0,lt.toMiliseconds)(e))}function Gt(e){return Date.now()>=(0,lt.toMiliseconds)(e)}function Kt(e,t){return`${e}${t?`:${t}`:""}`}function Zt(e=[],t=[]){return[...new Set([...e,...t])]}function Qt(e){return e?.relay||{protocol:"irn"}}function Yt(e){const t=pt[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Jt=Object.defineProperty,Xt=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,rr=(e,t,r)=>t in e?Jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function nr(e,t="-"){const r={},n="relay"+t;return Object.keys(e).forEach((t=>{if(t.startsWith(n)){const i=t.replace(n,""),o=e[t];r[i]=o}})),r}function ir(e){return e.startsWith("//")?e.substring(2):e}function or(e){const t=[];return e.forEach((e=>{const[r,n]=e.split(":");t.push(`${r}:${n}`)})),t}function sr(e){return e.includes(":")}function ar(e){return sr(e)?e.split(":")[0]:e}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const cr={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},lr={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ur(e,t){const{message:r,code:n}=lr[e];return{message:t?`${r} ${t}`:r,code:n}}function hr(e,t){const{message:r,code:n}=cr[e];return{message:t?`${r} ${t}`:r,code:n}}function dr(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function pr(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function fr(e){return typeof e>"u"}function mr(e,t){return!(!t||!fr(e))||"string"==typeof e&&!!e.trim().length}function gr(e,t){return!(!t||!fr(e))||"number"==typeof e&&!isNaN(e)}function wr(e){return!(!mr(e,!1)||!e.includes(":"))&&2===e.split(":").length}function br(e){let t=!0;return dr(e)?e.length&&(t=e.every((e=>mr(e,!1)))):t=!1,t}function vr(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const n=function(e,t){let r=null;return br(e?.methods)?br(e?.events)||(r=hr("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=hr("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(e,`${t}, namespace`);n&&(r=n)})),r}function yr(e,t){let r=null;if(e&&pr(e)){const n=vr(e,t);n&&(r=n);const i=function(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const n=function(e,t){let r=null;return dr(e)?e.forEach((e=>{r||function(e){if(mr(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&wr(e)}}return!1}(e)||(r=hr("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))})):r=hr("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}(e?.accounts,`${t} namespace`);n&&(r=n)})),r}(e,t);i&&(r=i)}else r=ur("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function xr(e){return mr(e.protocol,!0)}function Ar(e){return typeof e<"u"&&null!==typeof e}function Cr(e,t){return!(!wr(t)||!function(e){const t=[];return Object.values(e).forEach((e=>{t.push(...or(e.accounts))})),t}(e).includes(t))}function Er(e,t,r){let n=null;const i=function(e){const t={};return Object.keys(e).forEach((r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach((n=>{t[n]={methods:e[r].methods,events:e[r].events}}))})),t}(e),o=function(e){const t={};return Object.keys(e).forEach((r=>{if(r.includes(":"))t[r]=e[r];else{const n=or(e[r].accounts);n?.forEach((n=>{t[n]={accounts:e[r].accounts.filter((e=>e.includes(`${n}:`))),methods:e[r].methods,events:e[r].events}}))}})),t}(t),s=Object.keys(i),a=Object.keys(o),c=Ir(Object.keys(e)),l=Ir(Object.keys(t)),u=c.filter((e=>!l.includes(e)));return u.length&&(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${u.toString()}\n Received: ${Object.keys(t).toString()}`)),Ut(s,a)||(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach((e=>{if(!e.includes(":")||n)return;const i=or(t[e].accounts);i.includes(e)||(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${i.toString()}`))})),s.forEach((e=>{n||(Ut(i[e].methods,o[e].methods)?Ut(i[e].events,o[e].events)||(n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=ur("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))})),n}function Ir(e){return[...new Set(e.map((e=>e.includes(":")?e.split(":")[0]:e)))]}var _r=r(5150),Pr=r(772),Or=r(9107),Sr=r(8200);class kr extends Sr.q{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Mr extends Sr.q{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class Tr{constructor(e,t){this.logger=e,this.core=t}}class Nr extends Sr.q{constructor(e,t){super(),this.relayer=e,this.logger=t}}class jr extends Sr.q{constructor(e){super()}}class Rr{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class Lr extends Sr.q{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Br extends Sr.q{constructor(e,t){super(),this.core=e,this.logger=t}}class $r{constructor(e,t){this.projectId=e,this.logger=t}}class Ur{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class Dr{constructor(e){this.client=e}}const zr=e=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString()+"n":t));function Wr(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return(e=>{const t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,((e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t))})(e)}catch(t){return e}}function Fr(e){return"string"==typeof e?e:zr(e)||""}var Hr=r(1050);const qr="base64url",Vr="utf8",Gr=":",Kr="did",Zr="key",Qr="base58btc",Yr="z",Jr="K36";function Xr(e){return Ye(Qe(Fr(e),Vr),qr)}function en(e){const t=Qe(Jr,Qr),r=Yr+Ye(_([t,e]),Qr);return[Kr,Zr,r].join(Gr)}function tn(e=(0,x.randomBytes)(32)){return Hr._w(e)}r(3014);const rn="INTERNAL_ERROR",nn="SERVER_ERROR",on=[-32700,-32600,-32601,-32602,-32603],sn={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[rn]:{code:-32603,message:"Internal error"},[nn]:{code:-32e3,message:"Server error"}},an=nn;function cn(e){return Object.keys(sn).includes(e)?sn[e]:sn[an]}function ln(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var un=r(1468);function hn(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function dn(e=6){return BigInt(hn(e))}function pn(e,t,r){return{id:r||hn(),jsonrpc:"2.0",method:e,params:t}}function fn(e,t){return{id:e,jsonrpc:"2.0",result:t}}function mn(e,t,r){return{id:e,jsonrpc:"2.0",error:gn(t,r)}}function gn(e,t){return void 0===e?cn(rn):("string"==typeof e&&(e=Object.assign(Object.assign({},cn(nn)),{message:e})),void 0!==t&&(e.data=t),r=e.code,on.includes(r)&&(e=function(e){return Object.values(sn).find((t=>t.code===e))||sn[an]}(e.code)),e);var r}class wn{}class bn extends wn{constructor(){super()}}class vn extends bn{constructor(e){super()}}function yn(e,t){const r=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function xn(e){return yn(e,"^https?:")}function An(e){return yn(e,"^wss?:")}function Cn(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function En(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function In(e){return En(e)&&"method"in e}function _n(e){return En(e)&&(Pn(e)||On(e))}function Pn(e){return"result"in e}function On(e){return"error"in e}class Sn extends vn{constructor(e){super(e),this.events=new w.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(pn(e.method,e.params||[],e.id||dn().toString()),t)}async requestStrict(e,t){return new Promise((async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,(e=>{On(e)?n(e.error):r(e.result)}));try{await this.connection.send(e,t)}catch(e){n(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_n(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(e=>this.onPayload(e))),this.connection.on("close",(e=>this.onClose(e))),this.connection.on("error",(e=>this.events.emit("error",e))),this.connection.on("register_error",(e=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const kn=void 0!==r.g&&void 0!==r.g.WebSocket?r.g.WebSocket:"undefined"!=typeof window&&void 0!==window.WebSocket?window.WebSocket:r(7026);var Mn=r(2307),Tn=r.n(Mn),Nn=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var h=0,d=o-1;(0!==u||h>>0,s[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=h,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),m=n;p!==o;)f[m++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var h=t[i],d=0,p=s-1;(0!==h||d>>0,l[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var m=c.repeat(r);f{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class Rn{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Ln{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return $n(this,e)}}class Bn{constructor(e){this.decoders=e}or(e){return $n(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const $n=(e,t)=>new Bn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Un{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Rn(e,t,r),this.decoder=new Ln(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Dn=({name:e,prefix:t,encode:r,decode:n})=>new Un(e,t,r,n),zn=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Nn(r,t);return Dn({prefix:e,name:t,encode:n,decode:e=>jn(i(e))})},Wn=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Dn({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<((e,t,r,n)=>{const i={};for(let e=0;e=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),Fn=Dn({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var Hn=Object.freeze({__proto__:null,identity:Fn});const qn=Wn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Vn=Object.freeze({__proto__:null,base2:qn});const Gn=Wn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Kn=Object.freeze({__proto__:null,base8:Gn});const Zn=zn({prefix:"9",name:"base10",alphabet:"0123456789"});var Qn=Object.freeze({__proto__:null,base10:Zn});const Yn=Wn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Jn=Wn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Xn=Object.freeze({__proto__:null,base16:Yn,base16upper:Jn});const ei=Wn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ti=Wn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ri=Wn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ni=Wn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ii=Wn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),oi=Wn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),si=Wn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ai=Wn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ci=Wn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var li=Object.freeze({__proto__:null,base32:ei,base32upper:ti,base32pad:ri,base32padupper:ni,base32hex:ii,base32hexupper:oi,base32hexpad:si,base32hexpadupper:ai,base32z:ci});const ui=zn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hi=zn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var di=Object.freeze({__proto__:null,base36:ui,base36upper:hi});const pi=zn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fi=zn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var mi=Object.freeze({__proto__:null,base58btc:pi,base58flickr:fi});const gi=Wn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),wi=Wn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),bi=Wn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),vi=Wn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yi=Object.freeze({__proto__:null,base64:gi,base64pad:wi,base64url:bi,base64urlpad:vi});const xi=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ai=xi.reduce(((e,t,r)=>(e[r]=t,e)),[]),Ci=xi.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),Ei=Dn({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+Ai[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Ci[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Ii=Object.freeze({__proto__:null,base256emoji:Ei}),_i=128,Pi=-128,Oi=Math.pow(2,31),Si=Math.pow(2,7),ki=Math.pow(2,14),Mi=Math.pow(2,21),Ti=Math.pow(2,28),Ni=Math.pow(2,35),ji=Math.pow(2,42),Ri=Math.pow(2,49),Li=Math.pow(2,56),Bi=Math.pow(2,63),$i=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=Oi;)r[n++]=255&t|_i,t/=128;for(;tΠ)r[n++]=255&t|_i,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},Ui=function(e){return e($i(e,t,r),t),zi=e=>Ui(e),Wi=(e,t)=>{const r=t.byteLength,n=zi(e),i=n+zi(r),o=new Uint8Array(i+r);return Di(e,o,0),Di(r,o,n),o.set(t,i),new Fi(e,r,t,o)};class Fi{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const Hi=({name:e,code:t,encode:r})=>new qi(e,t,r);class qi{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Wi(this.code,t):t.then((e=>Wi(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Vi=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Gi=Hi({name:"sha2-256",code:18,encode:Vi("SHA-256")}),Ki=Hi({name:"sha2-512",code:19,encode:Vi("SHA-512")});Object.freeze({__proto__:null,sha256:Gi,sha512:Ki});const Zi=jn,Qi={code:0,name:"identity",encode:Zi,digest:e=>Wi(0,Zi(e))};Object.freeze({__proto__:null,identity:Qi}),new TextEncoder,new TextDecoder;const Yi={...Hn,...Vn,...Kn,...Qn,...Xn,...li,...di,...mi,...yi,...Ii};function Ji(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Xi(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const eo=Xi("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),to=Xi("ascii","a",(e=>{let t="a";for(let r=0;r{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Ji(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=(0,Or.generateChildLogger)(t,this.name)}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Dt(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?zt(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class jo{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),en(tn(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const e=function(){const e=C.Au();return{privateKey:Ye(e.secretKey,gt),publicKey:Ye(e.publicKey,gt)}}();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();const t=tn(await this.getClientSeed()),r=vt(),n=ao;return await async function(e,t,r,n,i=(0,lt.fromMiliseconds)(Date.now())){const o={alg:"EdDSA",typ:"JWT"},s={iss:en(n.publicKey),sub:e,aud:t,iat:i,exp:i+r},a=Qe([Xr((c={header:o,payload:s}).header),Xr(c.payload)].join("."),"utf8");var c;return function(e){return[Xr(e.header),Xr(e.payload),(t=e.signature,Ye(t,qr))].join(".");var t}({header:o,payload:s,signature:Hr.Xx(n.secretKey,a)})}(r,e,n,t)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=C.gi(Qe(e,gt),Qe(t,gt));return Ye(new y.t(A.mE,r).expand(32),gt)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)},this.setSymKey=async(e,t)=>{this.isInitialized();const r=t||function(e){return Ye((0,A.vp)(Qe(e,gt)),gt)}(e);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();const n=Ct(r),i=Fr(t);if(Et(n)){const t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}const o=this.getSymKey(e),{type:s,senderPublicKey:a}=n;return function(e){const t=function(e){return Qe(`${e}`,mt)}(typeof e.type<"u"?e.type:0);if(1===xt(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?Qe(e.senderPublicKey,gt):void 0,n=typeof e.iv<"u"?Qe(e.iv,gt):(0,x.randomBytes)(12);return function(e){if(1===xt(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ye(_([e.type,e.senderPublicKey,e.iv,e.sealed]),wt)}return Ye(_([e.type,e.iv,e.sealed]),wt)}({type:t,sealed:new v.OK(Qe(e.symKey,gt)).seal(n,Qe(e.message,bt)),iv:n,senderPublicKey:r})}({type:s,symKey:o,message:i,senderPublicKey:a})},this.decode=async(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=At(e);return Ct({type:xt(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ye(r.senderPublicKey,gt):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(Et(n)){const t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}const i=function(e){const t=new v.OK(Qe(e.symKey,gt)),{sealed:r,iv:n}=At(e.encoded),i=t.open(n,r);if(null===i)throw new Error("Failed to decrypt");return Ye(i,bt)}({symKey:this.getSymKey(e),encoded:t});return Wr(i)},this.getPayloadType=e=>xt(At(e).type),this.getPayloadSenderPublicKey=e=>{const t=At(e);return t.senderPublicKey?Ye(t.senderPublicKey,gt):void 0},this.core=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.keychain=r||new No(this.core,this.logger)}get context(){return(0,Or.getLoggerContext)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(so)}catch{e=vt(),await this.keychain.set(so,e)}return function(e,t="utf8"){const r=ro[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):Ji(globalThis.Buffer.from(e,"utf-8"))}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Ro extends Tr{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=io,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();const r=yt(t);let n=this.messages.get(e);return typeof n>"u"&&(n={}),typeof n[r]<"u"||(n[r]=t,this.messages.set(e,n),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[yt(t)]<"u"),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=(0,Or.generateChildLogger)(e,this.name),this.core=t}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Dt(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?zt(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Lo extends Nr{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new w.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,lt.toMiliseconds)(lt.TEN_SECONDS),this.queueTimeout=(0,lt.toMiliseconds)(lt.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});try{const n=r?.ttl||co,i=Qt(r),o=r?.prompt||!1,s=r?.tag||0,a=r?.id||dn().toString(),c={topic:e,message:t,opts:{ttl:n,relay:i,prompt:o,tag:s,id:a}},l=setTimeout((()=>this.queue.set(a,c)),this.queueTimeout);try{await await Ft(this.rpcPublish(e,t,n,i,o,s,a),this.publishTimeout),clearTimeout(l),this.relayer.events.emit(wo,c)}catch{return this.logger.debug("Publishing Payload stalled"),void(this.needsTransportRestart=!0)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(e),e}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.registerEventListeners()}get context(){return(0,Or.getLoggerContext)(this.logger)}rpcPublish(e,t,r,n,i,o,s){var a,c,l,u;const h={method:Yt(n.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:o},id:s};return fr(null==(a=h.params)?void 0:a.prompt)&&(null==(c=h.params)||delete c.prompt),fr(null==(l=h.params)?void 0:l.tag)&&(null==(u=h.params)||delete u.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.request(h)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach((async e=>{const{topic:t,message:r,opts:n}=e;await this.publish(t,r,n)}))}registerEventListeners(){this.relayer.core.heartbeat.on(Pr.HEARTBEAT_EVENTS.pulse,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(mo);this.checkQueue()})),this.relayer.on(ho,(e=>{this.onPublish(e.id.toString())}))}}class Bo{constructor(){this.map=new Map,this.set=(e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const n=r.filter((e=>e!==t));n.length?this.map.set(e,n):this.map.delete(e)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var $o=Object.defineProperty,Uo=Object.defineProperties,Do=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,Wo=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,Ho=(e,t,r)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qo=(e,t)=>{for(var r in t||(t={}))Wo.call(t,r)&&Ho(e,r,t[r]);if(zo)for(var r of zo(t))Fo.call(t,r)&&Ho(e,r,t[r]);return e},Vo=(e,t)=>Uo(e,Do(t));class Go extends Lr{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new Bo,this.events=new w.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=io,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const r=Qt(t),n={topic:e,relay:r};this.pending.set(e,n);const i=await this.rpcSubscribe(e,r);return this.onSubscribe(i,n),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}}),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>!!this.topics.includes(e)||await new Promise(((t,r)=>{const n=new lt.Watch;n.start(this.pendingSubscriptionWatchLabel);const i=setInterval((()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(i),n.stop(this.pendingSubscriptionWatchLabel),t(!0)),n.elapsed(this.pendingSubscriptionWatchLabel)>=Co&&(clearInterval(i),n.stop(this.pendingSubscriptionWatchLabel),r(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1)),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.clientId=""}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map((async r=>await this.unsubscribeById(e,r,t))))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const n=Qt(r);await this.rpcUnsubscribe(e,t,n);const i=hr("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t){const r={method:Yt(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await Ft(this.relayer.request(r),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(mo)}return yt(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:Yt(e[0].relay.protocol).batchSubscribe,params:{topics:e.map((e=>e.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await Ft(this.relayer.request(t),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(mo)}}rpcUnsubscribe(e,t,r){const n={method:Yt(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,Vo(qo({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach((e=>{this.setSubscription(e.id,qo({},e)),this.pending.delete(e.topic)}))}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,qo({},t)),this.topicMap.set(t.topic,e),this.events.emit(yo,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(xo,Vo(qo({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit("subscription_sync")}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);dr(t)&&this.onBatchSubscribe(t.map(((t,r)=>Vo(qo({},e[r]),{id:t}))))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach((t=>{e.push(t)})),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Pr.HEARTBEAT_EVENTS.pulse,(async()=>{await this.checkPending()})),this.relayer.on(po,(async()=>{await this.onConnect()})),this.relayer.on(fo,(()=>{this.onDisconnect()})),this.events.on(yo,(async e=>{const t=yo;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})),this.events.on(xo,(async e=>{const t=xo;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise((e=>{const t=setInterval((()=>{this.restartInProgress||(clearInterval(t),e())}),this.pollingInterval)}))}}var Ko=Object.defineProperty,Zo=Object.getOwnPropertySymbols,Qo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Jo=(e,t,r)=>t in e?Ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Xo extends jr{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new w.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async e=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(e)}catch(e){throw this.logger.debug("Failed to Publish Request"),this.logger.error(e),e}},this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?(0,Or.generateChildLogger)(e.logger,this.name):(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e.logger||"error"})),this.messages=new Ro(this.logger,e.core),this.subscriber=new Go(this,this.logger),this.publisher=new Lo(this,this.logger),this.relayUrl=e?.relayUrl||lo,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout((async()=>{0===this.subscriber.topics.length&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)}),1e4)}get context(){return(0,Or.getLoggerContext)(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var r;this.isInitialized();let n=(null==(r=this.subscriber.topicMap.get(e))?void 0:r[0])||"";return n||(await Promise.all([new Promise((t=>{this.subscriber.once(yo,(r=>{r.topic===e&&t()}))})),new Promise((async r=>{n=await this.subscriber.subscribe(e,t),r()}))]),n)}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(go))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise((e=>{this.initialized||e(),this.subscriber.once(Ao,(()=>{e()}))})),await Promise.race([new Promise((async(e,t)=>{await Ft(this.provider.connect(),5e3,"socket stalled").catch((e=>t(e))).then((()=>e())).finally((()=>this.removeListener(go,this.rejectTransportOpen)))})),new Promise((e=>this.once(go,this.rejectTransportOpen)))])])}catch(e){this.logger.error(e);const t=e;if(!this.isConnectionStalled(t.message))throw e;this.events.emit(go)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise((e=>{this.provider.once(bo,(()=>{e()}))})),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some((t=>e.includes(t)))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Sn(new class{constructor(e){if(this.url=e,this.events=new w.EventEmitter,this.registering=!1,!An(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return void 0!==this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise(((e,t)=>{void 0!==this.socket?(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()):t(new Error("Connection already closed"))}))}async send(e,t){void 0===this.socket&&(this.socket=await this.register());try{this.socket.send(Fr(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!An(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),void 0===this.socket)return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)}))}))}return this.url=e,this.registering=!0,new Promise(((t,r)=>{const n=(0,un.isReactNative)()?void 0:{rejectUnauthorized:!Cn(e)},i=new kn(e,[],n);"undefined"!=typeof window?i.onerror=e=>{const t=e;r(this.emitError(t.error))}:i.on("error",(e=>{r(this.emitError(e))})),i.onopen=()=>{this.onOpen(i),t(i)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?Wr(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=mn(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return ln(e,t,"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error((null==e?void 0:e.message)||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",t),t}}(function({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:s}){const a=r.split("?"),c={auth:i,ua:$t(e,t,n),projectId:o,useOnCloseEvent:s||void 0},l=function(e,t){let r=dt.parse(e);return r=kt(kt({},r),t),dt.stringify(r)}(a[1]||"",c);return a[0]+"?"+l}({sdkVersion:"2.8.4",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;return!await this.subscriber.isSubscribed(t)||this.messages.has(t,r)}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),In(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:r,message:n,publishedAt:i}=t.data,o={topic:r,message:n,publishedAt:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(((e,t)=>{for(var r in t||(t={}))Qo.call(t,r)&&Jo(e,r,t[r]);if(Zo)for(var r of Zo(t))Yo.call(t,r)&&Jo(e,r,t[r]);return e})({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else _n(e)&&this.events.emit(ho,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(uo,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=fn(e.id,!0);await this.provider.connection.send(t)}registerProviderListeners(){this.provider.on("payload",(e=>this.onProviderPayload(e))),this.provider.on("connect",(()=>{this.events.emit(po)})),this.provider.on(bo,(()=>{this.onProviderDisconnect()})),this.provider.on("error",(e=>{this.logger.error(e),this.events.emit("relayer_error",e)}))}registerEventListeners(){this.events.on(mo,(async()=>{await this.restartTransport()}))}onProviderDisconnect(){this.events.emit(fo),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout((async()=>{await this.restartTransport()}),(0,lt.toMiliseconds)(vo))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise((e=>{const t=setInterval((()=>{this.connected&&(clearInterval(t),e())}),this.connectionStatusPollingInterval)}));await this.restartTransport()}}}var es=Object.defineProperty,ts=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,is=(e,t,r)=>t in e?es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,os=(e,t)=>{for(var r in t||(t={}))rs.call(t,r)&&is(e,r,t[r]);if(ts)for(var r of ts(t))ns.call(t,r)&&is(e,r,t[r]);return e};class ss extends Rr{constructor(e,t,r,n=io,i=void 0){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=io,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>{this.getKey&&null!==e&&!fr(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return e?.topic}(e)&&this.map.set(e.topic,e)})),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter((t=>Object.keys(e).every((r=>Tn()(t[r],e[r]))))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const r=os(os({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),await this.persist())},this.logger=(0,Or.generateChildLogger)(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class as{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(b()),this.initialized=!1,this.storagePrefix=io,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async()=>{this.isInitialized();const e=vt(),t=await this.core.crypto.setSymKey(e),r=Vt(lt.FIVE_MINUTES),n={protocol:"irn"},i={topic:t,expiry:r,relay:n,active:!1},o=function(e){return`${e.protocol}:${e.topic}@${e.version}?`+dt.stringify(((e,t)=>{for(var r in t||(t={}))er.call(t,r)&&rr(e,r,t[r]);if(Xt)for(var r of Xt(t))tr.call(t,r)&&rr(e,r,t[r]);return e})({symKey:e.symKey},function(e,t="-"){const r={};return Object.keys(e).forEach((n=>{const i="relay"+t+n;e[n]&&(r[i]=e[n])})),r}(e.relay)))}({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:e,relay:n});return await this.pairings.set(t,i),await this.core.relayer.subscribe(t),this.core.expirer.set(t,r),{topic:t,uri:o}},this.pair=async e=>{this.isInitialized(),this.isValidPair(e);const{topic:t,symKey:r,relay:n}=function(e){const t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),i=e.substring(t+1,r).split("@"),o=typeof r<"u"?e.substring(r):"",s=dt.parse(o);return{protocol:n,topic:ir(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:nr(s)}}(e.uri);if(this.pairings.keys.includes(t))throw new Error(`Pairing already exists: ${t}`);if(this.core.crypto.hasKeys(t))throw new Error(`Keychain already exists: ${t}`);const i=Vt(lt.FIVE_MINUTES),o={topic:t,relay:n,expiry:i,active:!1};return await this.pairings.set(t,o),await this.core.crypto.setSymKey(r,t),await this.core.relayer.subscribe(t,{relay:n}),this.core.expirer.set(t,i),e.activatePairing&&await this.activate({topic:t}),o},this.activate=async({topic:e})=>{this.isInitialized();const t=Vt(lt.THIRTY_DAYS);await this.pairings.update(e,{active:!0,expiry:t}),this.core.expirer.set(e,t)},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=Wt();this.events.once(Kt("pairing_ping",e),(({error:e})=>{e?i(e):n()})),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",hr("USER_DISCONNECTED")),await this.deletePairing(t))},this.sendRequest=async(e,t,r)=>{const n=pn(t,r),i=await this.core.crypto.encode(e,n),o=Eo[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,o),n.id},this.sendResult=async(e,t,r)=>{const n=fn(e,r),i=await this.core.crypto.encode(t,n),o=await this.core.history.get(t,e),s=Eo[o.request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)},this.sendError=async(e,t,r)=>{const n=mn(e,r),i=await this.core.crypto.encode(t,n),o=await this.core.history.get(t,e),s=Eo[o.request.method]?Eo[o.request.method].res:Eo.unregistered_method.res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,hr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{const e=this.pairings.getAll().filter((e=>Gt(e.expiry)));await Promise.all(e.map((e=>this.deletePairing(e.topic))))},this.onRelayEventRequest=e=>{const{topic:t,payload:r}=e,n=r.method;if(this.pairings.keys.includes(t))switch(n){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;if(this.pairings.keys.includes(t))return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)},this.onPairingPingRequest=async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit("pairing_ping",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{const{id:r}=t;setTimeout((()=>{Pn(t)?this.events.emit(Kt("pairing_ping",r),{}):On(t)&&this.events.emit(Kt("pairing_ping",r),{error:t.error})}),500)},this.onPairingDeleteRequest=async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit("pairing_delete",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{const{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;const t=hr("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(hr("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`pair() params: ${e}`);throw new Error(t)}if(!function(e){if(mr(e,!1))try{return typeof new URL(e)<"u"}catch{return!1}return!1}(e.uri)){const{message:t}=ur("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw new Error(t)}},this.isValidPing=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!mr(e,!1)){const{message:t}=ur("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=ur("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}},this.core=e,this.logger=(0,Or.generateChildLogger)(t,this.name),this.pairings=new ss(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,Or.getLoggerContext)(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(uo,(async e=>{const{topic:t,message:r}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const n=await this.core.crypto.decode(t,r);In(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):_n(n)&&(await this.core.history.resolve(n),this.onRelayEventResponse({topic:t,payload:n}))}))}registerExpirerEvents(){this.core.expirer.on(ko,(async e=>{const{topic:t}=qt(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit("pairing_expire",{topic:t}))}))}}class cs extends Mr{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new w.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=io,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.records.set(e.id,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;const n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r};this.records.set(n.id,n),this.events.emit(Io,n)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=On(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.events.emit(_o,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach((r=>{if(r.topic===e){if(typeof t<"u"&&r.id!==t)return;this.records.delete(r.id),this.events.emit(Po,r)}}))},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=(0,Or.generateChildLogger)(t,this.name)}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach((t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:pn(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)})),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit("history_sync")}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Io,(e=>{const t=Io;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(_o,(e=>{const t=_o;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()})),this.events.on(Po,(e=>{const t=Po;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ls extends Br{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new w.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=io,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.expirations.set(e.target,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}},this.set=(e,t)=>{this.isInitialized();const r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(Oo,{target:r,expiration:n})},this.get=e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(So,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=(0,Or.generateChildLogger)(t,this.name)}get context(){return(0,Or.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return Ht("topic",e)}(e);if("number"==typeof e)return function(e){return Ht("id",e)}(e);const{message:t}=ur("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit("expirer_sync")}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=ur("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=ur("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:r}=t;(0,lt.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(ko,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((e,t)=>this.checkExpiry(t,e)))}registerEventListeners(){this.core.heartbeat.on(Pr.HEARTBEAT_EVENTS.pulse,(()=>this.checkExpirations())),this.events.on(Oo,(e=>{const t=Oo;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(ko,(e=>{const t=ko;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(So,(e=>{const t=So;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}}class us extends $r{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Mo,this.initialized=!1,this.init=async e=>{Rt()||!Lt()||(this.verifyUrl=e?.verifyUrl||To,await this.createIframe())},this.register=async e=>{var t;if(this.initialized||await this.init(),this.iframe)try{null==(t=this.iframe.contentWindow)||t.postMessage(e.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${e.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async e=>{var t;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${e.attestationId}`);const r=this.startAbortTimer(lt.FIVE_SECONDS),n=await fetch(`${this.verifyUrl}/attestation/${e.attestationId}`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?null==(t=await n.json())?void 0:t.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise(((e,t)=>{if(document.getElementById(Mo))return e();const r=document.createElement("iframe");r.setAttribute("id",Mo),r.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),r.style.display="none",r.addEventListener("load",(()=>{this.initialized=!0,e()})),r.addEventListener("error",(e=>{t(e)})),document.body.append(r),this.iframe=r})),new Promise((e=>{setTimeout((()=>e("iframe load timeout")),(0,lt.toMiliseconds)(lt.ONE_SECOND/2))}))])}catch(e){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(e)}},this.logger=(0,Or.generateChildLogger)(t,this.name),this.verifyUrl=To,this.abortController=new AbortController,this.isDevEnv=jt()&&process.env.IS_VITEST}get context(){return(0,Or.getLoggerContext)(this.logger)}startAbortTimer(e){return setTimeout((()=>this.abortController.abort()),(0,lt.toMiliseconds)(e))}}var hs=Object.defineProperty,ds=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,fs=Object.prototype.propertyIsEnumerable,ms=(e,t,r)=>t in e?hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gs=(e,t)=>{for(var r in t||(t={}))ps.call(t,r)&&ms(e,r,t[r]);if(ds)for(var r of ds(t))fs.call(t,r)&&ms(e,r,t[r]);return e};class ws extends kr{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=no,this.events=new w.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||lo;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e?.logger||"error"}));this.logger=(0,Or.generateChildLogger)(t,this.name),this.heartbeat=new Pr.HeartBeat,this.crypto=new jo(this,this.logger,e?.keychain),this.history=new cs(this,this.logger),this.expirer=new ls(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new _r.ZP(gs(gs({},oo),e?.storageOptions)),this.relayer=new Xo({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new as(this,this.logger),this.verify=new us(this.projectId||"",this.logger)}static async init(e){const t=new ws(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return(0,Or.getLoggerContext)(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const bs=ws,vs="client",ys=`wc@2:${vs}:`,xs=vs,As="Proposal expired",Cs=lt.SEVEN_DAYS,Es={wc_sessionPropose:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:lt.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:lt.THIRTY_SECONDS,prompt:!1,tag:1115}}},Is={min:lt.FIVE_MINUTES,max:lt.SEVEN_DAYS},_s=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var Ps=Object.defineProperty,Os=Object.defineProperties,Ss=Object.getOwnPropertyDescriptors,ks=Object.getOwnPropertySymbols,Ms=Object.prototype.hasOwnProperty,Ts=Object.prototype.propertyIsEnumerable,Ns=(e,t,r)=>t in e?Ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,js=(e,t)=>{for(var r in t||(t={}))Ms.call(t,r)&&Ns(e,r,t[r]);if(ks)for(var r of ks(t))Ts.call(t,r)&&Ns(e,r,t[r]);return e},Rs=(e,t)=>Os(e,Ss(t));class Ls extends Dr{constructor(e){super(e),this.name="engine",this.events=new(b()),this.initialized=!1,this.ignoredPayloadTypes=[1],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Es)}),this.initialized=!0)},this.connect=async e=>{this.isInitialized();const t=Rs(js({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);const{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:o,relays:s}=t;let a,c=r,l=!1;if(c&&(l=this.client.core.pairing.pairings.get(c).active),!c||!l){const{topic:e,uri:t}=await this.client.core.pairing.create();c=e,a=t}const u=await this.client.core.crypto.generateKeyPair(),h=js({requiredNamespaces:n,optionalNamespaces:i,relays:s??[{protocol:"irn"}],proposer:{publicKey:u,metadata:this.client.metadata}},o&&{sessionProperties:o}),{reject:d,resolve:p,done:f}=Wt(lt.FIVE_MINUTES,As);if(this.events.once(Kt("session_connect"),(async({error:e,session:t})=>{if(e)d(e);else if(t){t.self.publicKey=u;const e=Rs(js({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:t.peer.metadata}),p(e)}})),!c){const{message:e}=ur("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(e)}const m=await this.sendRequest(c,"wc_sessionPropose",h),g=Vt(lt.FIVE_MINUTES);return await this.setProposal(m,js({id:m,expiry:g},h)),{uri:a,approval:f}},this.pair=async e=>(this.isInitialized(),await this.client.core.pairing.pair(e)),this.approve=async e=>{this.isInitialized(),await this.isValidApprove(e);const{id:t,relayProtocol:r,namespaces:n,sessionProperties:i}=e,o=this.client.proposal.get(t);let{pairingTopic:s,proposer:a,requiredNamespaces:c,optionalNamespaces:l}=o;s=s||"",pr(c)||(c=function(e,t){const r=yr(e,"approve()");if(r)throw new Error(r.message);const n={};for(const[t,r]of Object.entries(e))n[t]={methods:r.methods,events:r.events,chains:r.accounts.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))};return n}(n));const u=await this.client.core.crypto.generateKeyPair(),h=a.publicKey,d=await this.client.core.crypto.generateSharedKey(u,h);s&&t&&(await this.client.core.pairing.updateMetadata({topic:s,metadata:a.metadata}),await this.sendResult(t,s,{relay:{protocol:r??"irn"},responderPublicKey:u}),await this.client.proposal.delete(t,hr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:s}));const p=js({relay:{protocol:r??"irn"},namespaces:n,requiredNamespaces:c,optionalNamespaces:l,pairingTopic:s,controller:{publicKey:u,metadata:this.client.metadata},expiry:Vt(Cs)},i&&{sessionProperties:i});await this.client.core.relayer.subscribe(d),await this.sendRequest(d,"wc_sessionSettle",p);const f=Rs(js({},p),{topic:d,pairingTopic:s,acknowledged:!1,self:p.controller,peer:{publicKey:a.publicKey,metadata:a.metadata},controller:u});return await this.client.session.set(d,f),await this.setExpiry(d,Vt(Cs)),{topic:d,acknowledged:()=>new Promise((e=>setTimeout((()=>e(this.client.session.get(d))),500)))}},this.reject=async e=>{this.isInitialized(),await this.isValidReject(e);const{id:t,reason:r}=e,{pairingTopic:n}=this.client.proposal.get(t);n&&(await this.sendError(t,n,r),await this.client.proposal.delete(t,hr("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.isValidUpdate(e);const{topic:t,namespaces:r}=e,n=await this.sendRequest(t,"wc_sessionUpdate",{namespaces:r}),{done:i,resolve:o,reject:s}=Wt();return this.events.once(Kt("session_update",n),(({error:e})=>{e?s(e):o()})),await this.client.session.update(t,{namespaces:r}),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.isValidExtend(e);const{topic:t}=e,r=await this.sendRequest(t,"wc_sessionExtend",{}),{done:n,resolve:i,reject:o}=Wt();return this.events.once(Kt("session_extend",r),(({error:e})=>{e?o(e):i()})),await this.setExpiry(t,Vt(Cs)),{acknowledged:n}},this.request=async e=>{this.isInitialized(),await this.isValidRequest(e);const{chainId:t,request:n,topic:i,expiry:o}=e,s=await this.sendRequest(i,"wc_sessionRequest",{request:n,chainId:t},o),{done:a,resolve:c,reject:l}=Wt(o);return this.events.once(Kt("session_request",s),(({error:e,result:t})=>{e?l(e):c(t)})),this.client.events.emit("session_request_sent",{topic:i,request:n,chainId:t,id:s}),async function({id:e,topic:t,wcDeepLink:n}){try{if(!n)return;const i="string"==typeof n?JSON.parse(n):n;let o=i?.href;if("string"!=typeof o)return;o.endsWith("/")&&(o=o.slice(0,-1));const s=`${o}/wc?requestId=${e}&sessionTopic=${t}`,a=Bt();a===Tt.browser?window.open(s,"_self","noreferrer noopener"):a===Tt.reactNative&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(s)}catch(e){console.error(e)}}({id:s,topic:i,wcDeepLink:await this.client.core.storage.getItem("WALLETCONNECT_DEEPLINK_CHOICE")}),await a()},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:r}=e,{id:n}=r;Pn(r)?await this.sendResult(n,t,r.result):On(r)&&await this.sendError(n,t,r.error),this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=await this.sendRequest(t,"wc_sessionPing",{}),{done:r,resolve:n,reject:i}=Wt();this.events.once(Kt("session_ping",e),(({error:e})=>{e?i(e):n()})),await r()}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.isValidEmit(e);const{topic:t,event:r,chainId:n}=e;await this.sendRequest(t,"wc_sessionEvent",{event:r,chainId:n})},this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=dn().toString();let r;const n=t=>{t?.id.toString()===e&&(this.client.core.relayer.events.removeListener(ho,n),r())};await Promise.all([new Promise((e=>{r=e,this.client.core.relayer.on(ho,n)})),this.sendRequest(t,"wc_sessionDelete",hr("USER_DISCONNECTED"),void 0,e)]),await this.deleteSession(t)}else await this.client.core.pairing.disconnect({topic:t})},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter((t=>function(e,t){const{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r);let o=!0;return!!Ut(i,n)&&(n.forEach((t=>{const{accounts:n,methods:i,events:s}=e.namespaces[t],a=or(n),c=r[t];Ut(ft(t,c),a)&&Ut(c.methods,i)&&Ut(c.events,s)||(o=!1)})),o)}(t,e)))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic}));if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map((e=>this.client.core.pairing.disconnect({topic:e.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async(e,t)=>{const{self:r}=this.client.session.get(e);await this.client.core.relayer.unsubscribe(e),this.client.session.delete(e,hr("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(r.publicKey)&&await this.client.core.crypto.deleteKeyPair(r.publicKey),this.client.core.crypto.keychain.has(e)&&await this.client.core.crypto.deleteSymKey(e),t||this.client.core.expirer.del(e)},this.deleteProposal=async(e,t)=>{await Promise.all([this.client.proposal.delete(e,hr("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)])},this.deletePendingSessionRequest=async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&await this.client.session.update(e,{expiry:t}),this.client.core.expirer.set(e,t)},this.setProposal=async(e,t)=>{await this.client.proposal.set(e,t),this.client.core.expirer.set(e,t.expiry)},this.setPendingSessionRequest=async e=>{const t=Es.wc_sessionRequest.req.ttl,{id:r,topic:n,params:i}=e;await this.client.pendingRequest.set(r,{id:r,topic:n,params:i}),t&&this.client.core.expirer.set(r,Vt(t))},this.sendRequest=async(e,t,r,n,i)=>{const o=pn(t,r);if(Lt()&&_s.includes(t)){const e=yt(JSON.stringify(o));await this.client.core.verify.register({attestationId:e})}const s=await this.client.core.crypto.encode(e,o),a=Es[t].req;return n&&(a.ttl=n),i&&(a.id=i),this.client.core.history.set(e,o),this.client.core.relayer.publish(e,s,a),o.id},this.sendResult=async(e,t,r)=>{const n=fn(e,r),i=await this.client.core.crypto.encode(t,n),o=await this.client.core.history.get(t,e),s=Es[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(n)},this.sendError=async(e,t,r)=>{const n=mn(e,r),i=await this.client.core.crypto.encode(t,n),o=await this.client.core.history.get(t,e),s=Es[o.request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(n)},this.cleanup=async()=>{const e=[],t=[];this.client.session.getAll().forEach((t=>{Gt(t.expiry)&&e.push(t.topic)})),this.client.proposal.getAll().forEach((e=>{Gt(e.expiry)&&t.push(e.id)})),await Promise.all([...e.map((e=>this.deleteSession(e))),...t.map((e=>this.deleteProposal(e)))])},this.onRelayEventRequest=e=>{const{topic:t,payload:r}=e,n=r.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeRequest(t,r);case"wc_sessionSettle":return this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return this.onSessionExtendRequest(t,r);case"wc_sessionPing":return this.onSessionPingRequest(t,r);case"wc_sessionDelete":return this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return this.onSessionRequest(t,r);case"wc_sessionEvent":return this.onSessionEventRequest(t,r);default:return this.client.logger.info(`Unsupported request method ${n}`)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:r}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{const{topic:t}=e,{message:r}=ur("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)},this.onSessionProposeRequest=async(e,t)=>{const{params:r,id:n}=t;try{this.isValidConnect(js({},t.params));const i=Vt(lt.FIVE_MINUTES),o=js({id:n,pairingTopic:e,expiry:i},r);await this.setProposal(n,o);const s=yt(JSON.stringify(t)),a=await this.getVerifyContext(s,o.proposer.metadata);this.client.events.emit("session_proposal",{id:n,params:o,verifyContext:a})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionProposeResponse=async(e,t)=>{const{id:r}=t;if(Pn(t)){const{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});const i=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});const o=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const s=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:s});const a=await this.client.core.crypto.generateSharedKey(o,s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});const c=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else On(t)&&(await this.client.proposal.delete(r,hr("USER_DISCONNECTED")),this.events.emit(Kt("session_connect"),{error:t.error}))},this.onSessionSettleRequest=async(e,t)=>{const{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);const{relay:r,controller:i,expiry:o,namespaces:s,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:l,pairingTopic:u}=t.params,h=js({topic:e,relay:r,expiry:o,namespaces:s,acknowledged:!0,pairingTopic:u,requiredNamespaces:a,optionalNamespaces:c,controller:i.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},l&&{sessionProperties:l});await this.sendResult(t.id,e,!0),this.events.emit(Kt("session_connect"),{session:h}),this.cleanupDuplicatePairings(h)}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{const{id:r}=t;Pn(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(Kt("session_approve",r),{})):On(t)&&(await this.client.session.delete(e,hr("USER_DISCONNECTED")),this.events.emit(Kt("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{const{params:r,id:n}=t;try{this.isValidUpdate(js({topic:e},r)),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult(n,e,!0),this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionUpdateResponse=(e,t)=>{const{id:r}=t;Pn(t)?this.events.emit(Kt("session_update",r),{}):On(t)&&this.events.emit(Kt("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{const{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Vt(Cs)),await this.sendResult(r,e,!0),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{const{id:r}=t;Pn(t)?this.events.emit(Kt("session_extend",r),{}):On(t)&&this.events.emit(Kt("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{const{id:r}=t;setTimeout((()=>{Pn(t)?this.events.emit(Kt("session_ping",r),{}):On(t)&&this.events.emit(Kt("session_ping",r),{error:t.error})}),500)},this.onSessionDeleteRequest=async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise((t=>{this.client.core.relayer.once(wo,(async()=>{t(await this.deleteSession(e))}))})),this.sendResult(r,e,!0)]),this.client.events.emit("session_delete",{id:r,topic:e})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async(e,t)=>{const{id:r,params:n}=t;try{this.isValidRequest(js({topic:e},n)),await this.setPendingSessionRequest({id:r,topic:e,params:n});const i=yt(JSON.stringify(t)),o=this.client.session.get(e),s=await this.getVerifyContext(i,o.peer.metadata);this.client.events.emit("session_request",{id:r,topic:e,params:n,verifyContext:s})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionRequestResponse=(e,t)=>{const{id:r}=t;Pn(t)?this.events.emit(Kt("session_request",r),{result:t.result}):On(t)&&this.events.emit(Kt("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{const{id:r,params:n}=t;try{this.isValidEmit(js({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.isValidConnect=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:i,relays:o}=e;if(fr(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return e?e&&dr(e)&&e.length&&e.forEach((e=>{r=xr(e)})):r=!0,r}(o)){const{message:e}=ur("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(e)}!fr(r)&&0!==pr(r)&&this.validateNamespaces(r,"requiredNamespaces"),!fr(n)&&0!==pr(n)&&this.validateNamespaces(n,"optionalNamespaces"),fr(i)||this.validateSessionProps(i,"sessionProperties")},this.validateNamespaces=(e,t)=>{const r=function(e,t,r){let n=null;if(e&&pr(e)){const r=vr(e,t);r&&(n=r);const i=function(e,t){let r=null;return Object.entries(e).forEach((([e,n])=>{if(r)return;const i=function(e,t,r){let n=null;return dr(t)?t.forEach((t=>{n||(!wr(t)||!t.includes(e))&&(n=hr("UNSUPPORTED_CHAINS",`${r}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):n=hr("UNSUPPORTED_CHAINS",`${r}, chains ${t} should be an array of strings conforming to "namespace:chainId" format`),n}(e,ft(e,n),`${t} requiredNamespace`);i&&(r=i)})),r}(e,t);i&&(n=i)}else n=ur("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw new Error(r.message)},this.isValidApprove=async e=>{if(!Ar(e))throw new Error(ur("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:r,relayProtocol:n,sessionProperties:i}=e;await this.isValidProposalId(t);const o=this.client.proposal.get(t),s=yr(r,"approve()");if(s)throw new Error(s.message);const a=Er(o.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!mr(n,!0)){const{message:e}=ur("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw new Error(e)}fr(i)||this.validateSessionProps(i,"sessionProperties")},this.isValidReject=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:r}=e;if(await this.isValidProposalId(t),!function(e){return!!(e&&"object"==typeof e&&e.code&&gr(e.code,!1)&&e.message&&mr(e.message,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidSessionSettleRequest=e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:r,namespaces:n,expiry:i}=e;if(!xr(t)){const{message:e}=ur("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const o=function(e,t){let r=null;return mr(e?.publicKey,!1)||(r=ur("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),r}(r);if(o)throw new Error(o.message);const s=yr(n,"onSessionSettleRequest()");if(s)throw new Error(s.message);if(Gt(i)){const{message:e}=ur("EXPIRED","onSessionSettleRequest()");throw new Error(e)}},this.isValidUpdate=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:r}=e;await this.isValidSessionTopic(t);const n=this.client.session.get(t),i=yr(r,"update()");if(i)throw new Error(i.message);const o=Er(n.requiredNamespaces,r,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:r,chainId:n,expiry:i}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!Cr(o,n)){const{message:e}=ur("MISSING_OR_INVALID",`request() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(fr(e)||!mr(e.method,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(e)}if(!function(e,t,r){return!!mr(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{or(e.accounts).includes(t)&&r.push(...e.methods)})),r}(e,t).includes(r)}(o,n,r.method)){const{message:e}=ur("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(e)}if(i&&!function(e,t){return gr(e,!1)&&e<=t.max&&e>=t.min}(i,Is)){const{message:e}=ur("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${Is.min} and ${Is.max}`);throw new Error(e)}},this.isValidRespond=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:t,response:r}=e;if(await this.isValidSessionTopic(t),!function(e){return!(fr(e)||fr(e.result)&&fr(e.error)||!gr(e.id,!1)||!mr(e.jsonrpc,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidPing=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!Cr(i,n)){const{message:e}=ur("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(fr(e)||!mr(e.name,!1))}(r)){const{message:e}=ur("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}if(!function(e,t,r){return!!mr(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{or(e.accounts).includes(t)&&r.push(...e.events)})),r}(e,t).includes(r)}(i,n,r.name)){const{message:e}=ur("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidDisconnect=async e=>{if(!Ar(e)){const{message:t}=ur("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.getVerifyContext=async(e,t)=>{const r={verified:{verifyUrl:t.verifyUrl||"",validation:"UNKNOWN",origin:t.url||""}};try{const n=await this.client.core.verify.resolve({attestationId:e,verifyUrl:t.verifyUrl});n&&(r.verified.origin=n,r.verified.validation=n===t.url?"VALID":"INVALID")}catch(e){this.client.logger.error(e)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((e=>{if(!mr(e,!1)){const{message:r}=ur("MISSING_OR_INVALID",`${t} must be in Record format. Received: ${JSON.stringify(e)}`);throw new Error(r)}}))}}isInitialized(){if(!this.initialized){const{message:e}=ur("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(uo,(async e=>{const{topic:t,message:r}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(r)))return;const n=await this.client.core.crypto.decode(t,r);In(n)?(this.client.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):_n(n)?(await this.client.core.history.resolve(n),this.onRelayEventResponse({topic:t,payload:n})):this.onRelayEventUnknownPayload({topic:t,payload:n})}))}registerExpirerEvents(){this.client.core.expirer.on(ko,(async e=>{const{topic:t,id:r}=qt(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,ur("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession(t,!0),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))}))}isValidPairingTopic(e){if(!mr(e,!1)){const{message:t}=ur("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ur("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!mr(e,!1)){const{message:t}=ur("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:t}=ur("EXPIRED",`session topic: ${e}`);throw new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(mr(e,!1)){const{message:t}=ur("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=ur("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if("number"!=typeof e){const{message:t}=ur("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ur("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Gt(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:t}=ur("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class Bs extends ss{constructor(e,t){super(e,t,"proposal",ys),this.core=e,this.logger=t}}class $s extends ss{constructor(e,t){super(e,t,"session",ys),this.core=e,this.logger=t}}class Us extends ss{constructor(e,t){super(e,t,"request",ys,(e=>e.id)),this.core=e,this.logger=t}}class Ds extends Ur{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=xs,this.events=new w.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||xs,this.metadata=e?.metadata||(0,ht.D)()||{name:"",description:"",url:"",icons:[""]};const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e?.logger||"error"}));this.core=e?.core||new bs(e),this.logger=(0,Or.generateChildLogger)(t,this.name),this.session=new $s(this.core,this.logger),this.proposal=new Bs(this.core,this.logger),this.pendingRequest=new Us(this.core,this.logger),this.engine=new Ls(this)}static async init(e){const t=new Ds(e);return await t.initialize(),t}get context(){return(0,Or.getLoggerContext)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var zs=r(4098),Ws=r.n(zs);const Fs={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class Hs{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new w.EventEmitter,this.isAvailable=!1,this.registering=!1,!xn(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const t=Fr(e),r=await Ws()(this.url,Object.assign(Object.assign({},Fs),{body:t})),n=await r.json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!xn(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),void 0===this.isAvailable)return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=Fr({id:1,jsonrpc:"2.0",method:"test",params:[]});await Ws()(e,Object.assign(Object.assign({},Fs),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?Wr(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=mn(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return ln(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}const qs=Hs,Vs="error",Gs="wc@2:universal_provider:",Ks="default_chain_changed";var Zs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},Qs={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=32,a=128,c=1/0,l=9007199254740991,u=NaN,h=4294967295,d=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],p="[object Arguments]",f="[object Array]",m="[object Boolean]",g="[object Date]",w="[object Error]",b="[object Function]",v="[object GeneratorFunction]",y="[object Map]",x="[object Number]",A="[object Object]",C="[object Promise]",E="[object RegExp]",I="[object Set]",_="[object String]",P="[object Symbol]",O="[object WeakMap]",S="[object ArrayBuffer]",k="[object DataView]",M="[object Float32Array]",T="[object Float64Array]",N="[object Int8Array]",j="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",B="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",D=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,q=RegExp(F.source),V=RegExp(H.source),G=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(X.source),te=/^\s+/,re=/\s/,ne=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ae=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,de=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,fe=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,be=/['\n\r\u2028\u2029\\]/g,ve="\\ud800-\\udfff",ye="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_e="["+ve+"]",Pe="["+Ie+"]",Oe="["+ye+"]",Se="\\d+",ke="["+xe+"]",Me="["+Ae+"]",Te="[^"+ve+Ie+Se+xe+Ae+Ce+"]",Ne="\\ud83c[\\udffb-\\udfff]",je="[^"+ve+"]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+Ce+"]",$e="\\u200d",Ue="(?:"+Me+"|"+Te+")",De="(?:"+Be+"|"+Te+")",ze="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Fe="(?:"+Oe+"|"+Ne+")?",He="["+Ee+"]?",qe=He+Fe+"(?:"+$e+"(?:"+[je,Re,Le].join("|")+")"+He+Fe+")*",Ve="(?:"+[ke,Re,Le].join("|")+")"+qe,Ge="(?:"+[je+Oe+"?",Oe,Re,Le,_e].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(Oe,"g"),Qe=RegExp(Ne+"(?="+Ne+")|"+Ge+qe,"g"),Ye=RegExp([Be+"?"+Me+"+"+ze+"(?="+[Pe,Be,"$"].join("|")+")",De+"+"+We+"(?="+[Pe,Be+Ue,"$"].join("|")+")",Be+"?"+Ue+"+"+ze,Be+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Se,Ve].join("|"),"g"),Je=RegExp("["+$e+ve+ye+Ee+"]"),Xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,rt={};rt[M]=rt[T]=rt[N]=rt[j]=rt[R]=rt[L]=rt[B]=rt[$]=rt[U]=!0,rt[p]=rt[f]=rt[S]=rt[m]=rt[k]=rt[g]=rt[w]=rt[b]=rt[y]=rt[x]=rt[A]=rt[E]=rt[I]=rt[_]=rt[O]=!1;var nt={};nt[p]=nt[f]=nt[S]=nt[k]=nt[m]=nt[g]=nt[M]=nt[T]=nt[N]=nt[j]=nt[R]=nt[y]=nt[x]=nt[A]=nt[E]=nt[I]=nt[_]=nt[P]=nt[L]=nt[B]=nt[$]=nt[U]=!0,nt[w]=nt[b]=nt[O]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,st=parseInt,at="object"==typeof Zs&&Zs&&Zs.Object===Object&&Zs,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=at||ct||Function("return this")(),ut=t&&!t.nodeType&&t,ht=ut&&e&&!e.nodeType&&e,dt=ht&&ht.exports===ut,pt=dt&&at.process,ft=function(){try{return ht&&ht.require&&ht.require("util").types||pt&&pt.binding&&pt.binding("util")}catch{}}(),mt=ft&&ft.isArrayBuffer,gt=ft&&ft.isDate,wt=ft&&ft.isMap,bt=ft&&ft.isRegExp,vt=ft&&ft.isSet,yt=ft&&ft.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function At(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function Yt(e,t){for(var r=e.length;r--&&Bt(t,e[r],0)>-1;);return r}var Jt=Wt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Xt=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function er(e){return"\\"+it[e]}function tr(e){return Je.test(e)}function rr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function nr(e,t){return function(r){return e(t(r))}}function ir(e,t){for(var r=-1,n=e.length,i=0,s=[];++r",""":'"',"'":"'"}),ur=function e(t){var re=(t=null==t?lt:ur.defaults(lt.Object(),t,ur.pick(lt,et))).Array,ve=t.Date,ye=t.Error,xe=t.Function,Ae=t.Math,Ce=t.Object,Ee=t.RegExp,Ie=t.String,_e=t.TypeError,Pe=re.prototype,Oe=xe.prototype,Se=Ce.prototype,ke=t["__core-js_shared__"],Me=Oe.toString,Te=Se.hasOwnProperty,Ne=0,je=function(){var e=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Re=Se.toString,Le=Me.call(Ce),Be=lt._,$e=Ee("^"+Me.call(Te).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=dt?t.Buffer:r,De=t.Symbol,ze=t.Uint8Array,We=Ue?Ue.allocUnsafe:r,Fe=nr(Ce.getPrototypeOf,Ce),He=Ce.create,qe=Se.propertyIsEnumerable,Ve=Pe.splice,Ge=De?De.isConcatSpreadable:r,Qe=De?De.iterator:r,Je=De?De.toStringTag:r,it=function(){try{var e=so(Ce,"defineProperty");return e({},"",{}),e}catch{}}(),at=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,ct=ve&&ve.now!==lt.Date.now&&ve.now,ut=t.setTimeout!==lt.setTimeout&&t.setTimeout,ht=Ae.ceil,pt=Ae.floor,ft=Ce.getOwnPropertySymbols,jt=Ue?Ue.isBuffer:r,Wt=t.isFinite,hr=Pe.join,dr=nr(Ce.keys,Ce),pr=Ae.max,fr=Ae.min,mr=ve.now,gr=t.parseInt,wr=Ae.random,br=Pe.reverse,vr=so(t,"DataView"),yr=so(t,"Map"),xr=so(t,"Promise"),Ar=so(t,"Set"),Cr=so(t,"WeakMap"),Er=so(Ce,"create"),Ir=Cr&&new Cr,_r={},Pr=Ro(vr),Or=Ro(yr),Sr=Ro(xr),kr=Ro(Ar),Mr=Ro(Cr),Tr=De?De.prototype:r,Nr=Tr?Tr.valueOf:r,jr=Tr?Tr.toString:r;function Rr(e){if(Js(e)&&!zs(e)&&!(e instanceof Ur)){if(e instanceof $r)return e;if(Te.call(e,"__wrapped__"))return Lo(e)}return new $r(e)}var Lr=function(){function e(){}return function(t){if(!Ys(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function $r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Dr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function nn(e,t,n,i,o,s){var a,c=1&t,l=2&t,u=4&t;if(n&&(a=o?n(e,i,o,s):n(e)),a!==r)return a;if(!Ys(e))return e;var h=zs(e);if(h){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!c)return Ei(e,a)}else{var d=lo(e),f=d==b||d==v;if(qs(e))return bi(e,c);if(d==A||d==p||f&&!o){if(a=l||f?{}:ho(e),!c)return l?function(e,t){return Ii(e,co(e),t)}(e,function(e,t){return e&&Ii(t,Sa(t),e)}(a,e)):function(e,t){return Ii(e,ao(e),t)}(e,Xr(a,e))}else{if(!nt[d])return o?e:{};a=function(e,t,r){var n=e.constructor;switch(t){case S:return vi(e);case m:case g:return new n(+e);case k:return function(e,t){var r=t?vi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case M:case T:case N:case j:case R:case L:case B:case $:case U:return yi(e,r);case y:return new n;case x:case _:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new n;case P:return function(e){return Nr?Ce(Nr.call(e)):{}}(e)}}(e,d,c)}}s||(s=new Hr);var w=s.get(e);if(w)return w;s.set(e,a),na(e)?e.forEach((function(r){a.add(nn(r,t,n,r,e,s))})):Xs(e)&&e.forEach((function(r,i){a.set(i,nn(r,t,n,i,e,s))}));var C=h?r:(u?l?Xi:Ji:l?Sa:Oa)(e);return Ct(C||e,(function(r,i){C&&(r=e[i=r]),Qr(a,i,nn(r,t,n,i,e,s))})),a}function on(e,t,n){var i=n.length;if(null==e)return!i;for(e=Ce(e);i--;){var o=n[i],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function sn(e,t,i){if("function"!=typeof e)throw new _e(n);return _o((function(){e.apply(r,i)}),t)}function an(e,t,r,n){var i=-1,o=Pt,s=!0,a=e.length,c=[],l=t.length;if(!a)return c;r&&(t=St(t,Gt(r))),n?(o=Ot,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Fr(t));e:for(;++i-1},zr.prototype.set=function(e,t){var r=this.__data__,n=Yr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Dr,map:new(yr||zr),string:new Dr}},Wr.prototype.delete=function(e){var t=io(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return io(this,e).get(e)},Wr.prototype.has=function(e){return io(this,e).has(e)},Wr.prototype.set=function(e,t){var r=io(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Fr.prototype.add=Fr.prototype.push=function(e){return this.__data__.set(e,i),this},Fr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new zr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof zr){var n=r.__data__;if(!yr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var cn=Oi(gn),ln=Oi(wn,!0);function un(e,t){var r=!0;return cn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function hn(e,t,n){for(var i=-1,o=e.length;++i0&&r(a)?t>1?pn(a,t-1,r,n,i):kt(i,a):n||(i[i.length]=a)}return i}var fn=Si(),mn=Si(!0);function gn(e,t){return e&&fn(e,t,Oa)}function wn(e,t){return e&&mn(e,t,Oa)}function bn(e,t){return _t(t,(function(t){return Ks(e[t])}))}function vn(e,t){for(var n=0,i=(t=fi(t,e)).length;null!=e&&nt}function Cn(e,t){return null!=e&&Te.call(e,t)}function En(e,t){return null!=e&&t in Ce(e)}function In(e,t,n){for(var i=n?Ot:Pt,o=e[0].length,s=e.length,a=s,c=re(s),l=1/0,u=[];a--;){var h=e[a];a&&t&&(h=St(h,Gt(t))),l=fr(h.length,l),c[a]=!n&&(t||o>=120&&h.length>=120)?new Fr(a&&h):r}h=e[0];var d=-1,p=c[0];e:for(;++d=a?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Dn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)a!==e&&Ve.call(a,c,1),Ve.call(e,c,1);return e}function Wn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;fo(i)?Ve.call(e,i,1):si(e,i)}}return e}function Fn(e,t){return e+pt(wr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>l)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function qn(e,t){return Po(Ao(e,t,ec),e+"")}function Vn(e){return Vr(Ba(e))}function Gn(e,t){var r=Ba(e);return ko(r,rn(t,0,r.length))}function Kn(e,t,n,i){if(!Ys(e))return e;for(var o=-1,s=(t=fi(t,e)).length,a=s-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=re(i);++n>>1,s=e[o];null!==s&&!oa(s)&&(r?s<=t:s=200){var l=t?null:Hi(e);if(l)return or(l);s=!1,i=Zt,c=new Fr}else c=t?[]:a;e:for(;++n=i?e:Jn(e,t,n)}var wi=at||function(e){return lt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function vi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function yi(e,t){var r=t?vi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,s=oa(e),a=t!==r,c=null===t,l=t==t,u=oa(t);if(!c&&!u&&!s&&e>t||s&&a&&l&&!c&&!u||i&&a&&l||!n&&l||!o)return 1;if(!i&&!s&&!u&&e1?n[o-1]:r,a=o>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&mo(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=Ce(t);++i-1?o[s?t[a]:a]:r}}function ji(e){return Yi((function(t){var i=t.length,o=i,s=$r.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new _e(n);if(s&&!c&&"wrapper"==to(a))var c=new $r([],!0)}for(o=c?o:i;++o1&&v.reverse(),d&&uc))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&n?new Fr:r;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ne,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ct(d,(function(r){var n="_."+r[0];t&r[1]&&!Pt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(oe):[]}(n),r)))}function So(e){var t=0,n=0;return function(){var i=mr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function ko(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,rs(e,n)}));function ls(e){var t=Rr(e);return t.__chain__=!0,t}function us(e,t){return t(e)}var hs=Yi((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return tn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Ur&&fo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:us,args:[o],thisArg:r}),new $r(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)})),ds=_i((function(e,t,r){Te.call(e,r)?++e[r]:en(e,r,1)})),ps=Ni(Do),fs=Ni(zo);function ms(e,t){return(zs(e)?Ct:cn)(e,no(t,3))}function gs(e,t){return(zs(e)?Et:ln)(e,no(t,3))}var ws=_i((function(e,t,r){Te.call(e,r)?e[r].push(t):en(e,r,[t])})),bs=qn((function(e,t,r){var n=-1,i="function"==typeof t,o=Fs(e)?re(e.length):[];return cn(e,(function(e){o[++n]=i?xt(t,e,r):_n(e,t,r)})),o})),vs=_i((function(e,t,r){en(e,r,t)}));function ys(e,t){return(zs(e)?St:jn)(e,no(t,3))}var xs=_i((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),As=qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&mo(e,t[0],t[1])?t=[]:r>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Un(e,pn(t,1),[])})),Cs=ct||function(){return lt.Date.now()};function Es(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Vi(e,a,r,r,r,r,t)}function Is(e,t){var i;if("function"!=typeof t)throw new _e(n);return e=ha(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var _s=qn((function(e,t,r){var n=1;if(r.length){var i=ir(r,ro(_s));n|=s}return Vi(e,n,t,r,i)})),Ps=qn((function(e,t,r){var n=3;if(r.length){var i=ir(r,ro(Ps));n|=s}return Vi(t,n,e,r,i)}));function Os(e,t,i){var o,s,a,c,l,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new _e(n);function m(t){var n=o,i=s;return o=s=r,h=t,c=e.apply(i,n)}function g(e){var n=e-u;return u===r||n>=t||n<0||p&&e-h>=a}function w(){var e=Cs();if(g(e))return b(e);l=_o(w,function(e){var r=t-(e-u);return p?fr(r,a-(e-h)):r}(e))}function b(e){return l=r,f&&o?m(e):(o=s=r,c)}function v(){var e=Cs(),n=g(e);if(o=arguments,s=this,u=e,n){if(l===r)return function(e){return h=e,l=_o(w,t),d?m(e):c}(u);if(p)return wi(l),l=_o(w,t),m(u)}return l===r&&(l=_o(w,t)),c}return t=pa(t)||0,Ys(i)&&(d=!!i.leading,a=(p="maxWait"in i)?pr(pa(i.maxWait)||0,t):a,f="trailing"in i?!!i.trailing:f),v.cancel=function(){l!==r&&wi(l),h=0,o=u=s=l=r},v.flush=function(){return l===r?c:b(Cs())},v}var Ss=qn((function(e,t){return sn(e,1,t)})),ks=qn((function(e,t,r){return sn(e,pa(t)||0,r)}));function Ms(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Ms.Cache||Wr),r}function Ts(e){if("function"!=typeof e)throw new _e(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ms.Cache=Wr;var Ns=mi((function(e,t){var r=(t=1==t.length&&zs(t[0])?St(t[0],Gt(no())):St(pn(t,1),Gt(no()))).length;return qn((function(n){for(var i=-1,o=fr(n.length,r);++i=t})),Ds=Pn(function(){return arguments}())?Pn:function(e){return Js(e)&&Te.call(e,"callee")&&!qe.call(e,"callee")},zs=re.isArray,Ws=mt?Gt(mt):function(e){return Js(e)&&xn(e)==S};function Fs(e){return null!=e&&Qs(e.length)&&!Ks(e)}function Hs(e){return Js(e)&&Fs(e)}var qs=jt||pc,Vs=gt?Gt(gt):function(e){return Js(e)&&xn(e)==g};function Gs(e){if(!Js(e))return!1;var t=xn(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ta(e)}function Ks(e){if(!Ys(e))return!1;var t=xn(e);return t==b||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==ha(e)}function Qs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=l}function Ys(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Js(e){return null!=e&&"object"==typeof e}var Xs=wt?Gt(wt):function(e){return Js(e)&&lo(e)==y};function ea(e){return"number"==typeof e||Js(e)&&xn(e)==x}function ta(e){if(!Js(e)||xn(e)!=A)return!1;var t=Fe(e);if(null===t)return!0;var r=Te.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Le}var ra=bt?Gt(bt):function(e){return Js(e)&&xn(e)==E},na=vt?Gt(vt):function(e){return Js(e)&&lo(e)==I};function ia(e){return"string"==typeof e||!zs(e)&&Js(e)&&xn(e)==_}function oa(e){return"symbol"==typeof e||Js(e)&&xn(e)==P}var sa=yt?Gt(yt):function(e){return Js(e)&&Qs(e.length)&&!!rt[xn(e)]},aa=zi(Nn),ca=zi((function(e,t){return e<=t}));function la(e){if(!e)return[];if(Fs(e))return ia(e)?ar(e):Ei(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=lo(e);return(t==y?rr:t==I?or:Ba)(e)}function ua(e){return e?(e=pa(e))===c||e===-c?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ha(e){var t=ua(e),r=t%1;return t==t?r?t-r:t:0}function da(e){return e?rn(ha(e),0,h):0}function pa(e){if("number"==typeof e)return e;if(oa(e))return u;if(Ys(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ys(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Vt(e);var r=de.test(e);return r||fe.test(e)?st(e.slice(2),r?2:8):he.test(e)?u:+e}function fa(e){return Ii(e,Sa(e))}function ma(e){return null==e?"":ii(e)}var ga=Pi((function(e,t){if(vo(t)||Fs(t))Ii(t,Oa(t),e);else for(var r in t)Te.call(t,r)&&Qr(e,r,t[r])})),wa=Pi((function(e,t){Ii(t,Sa(t),e)})),ba=Pi((function(e,t,r,n){Ii(t,Sa(t),e,n)})),va=Pi((function(e,t,r,n){Ii(t,Oa(t),e,n)})),ya=Yi(tn),xa=qn((function(e,t){e=Ce(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&mo(t[0],t[1],o)&&(i=1);++n1),t})),Ii(e,Xi(e),r),n&&(r=nn(r,7,Zi));for(var i=t.length;i--;)si(r,t[i]);return r})),Na=Yi((function(e,t){return null==e?{}:function(e,t){return Dn(e,t,(function(t,r){return Ea(e,r)}))}(e,t)}));function ja(e,t){if(null==e)return{};var r=St(Xi(e),(function(e){return[e]}));return t=no(t),Dn(e,r,(function(e,r){return t(e,r[0])}))}var Ra=qi(Oa),La=qi(Sa);function Ba(e){return null==e?[]:Kt(e,Oa(e))}var $a=Mi((function(e,t,r){return t=t.toLowerCase(),e+(r?Ua(t):t)}));function Ua(e){return Ga(ma(e).toLowerCase())}function Da(e){return(e=ma(e))&&e.replace(ge,Jt).replace(Ze,"")}var za=Mi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=Mi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Fa=ki("toLowerCase"),Ha=Mi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),qa=Mi((function(e,t,r){return e+(r?" ":"")+Ga(t)})),Va=Mi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ga=ki("toUpperCase");function Ka(e,t,n){return e=ma(e),(t=n?r:t)===r?function(e){return Xe.test(e)}(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Za=qn((function(e,t){try{return xt(e,r,t)}catch(e){return Gs(e)?e:new ye(e)}})),Qa=Yi((function(e,t){return Ct(t,(function(t){t=jo(t),en(e,t,_s(e[t],e))})),e}));function Ya(e){return function(){return e}}var Ja=ji(),Xa=ji(!0);function ec(e){return e}function tc(e){return Mn("function"==typeof e?e:nn(e,1))}var rc=qn((function(e,t){return function(r){return _n(r,e,t)}})),nc=qn((function(e,t){return function(r){return _n(e,r,t)}}));function ic(e,t,r){var n=Oa(t),i=bn(t,n);null==r&&(!Ys(t)||!i.length&&n.length)&&(r=t,t=e,e=this,i=bn(t,Oa(t)));var o=!(Ys(r)&&"chain"in r&&!r.chain),s=Ks(e);return Ct(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ei(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,kt([this.value()],arguments))})})),e}function oc(){}var sc=$i(St),ac=$i(It),cc=$i(Nt);function lc(e){return go(e)?zt(jo(e)):function(e){return function(t){return vn(t,e)}}(e)}var uc=Di(),hc=Di(!0);function dc(){return[]}function pc(){return!1}var fc=Bi((function(e,t){return e+t}),0),mc=Fi("ceil"),gc=Bi((function(e,t){return e/t}),1),wc=Fi("floor"),bc=Bi((function(e,t){return e*t}),1),vc=Fi("round"),yc=Bi((function(e,t){return e-t}),0);return Rr.after=function(e,t){if("function"!=typeof t)throw new _e(n);return e=ha(e),function(){if(--e<1)return t.apply(this,arguments)}},Rr.ary=Es,Rr.assign=ga,Rr.assignIn=wa,Rr.assignInWith=ba,Rr.assignWith=va,Rr.at=ya,Rr.before=Is,Rr.bind=_s,Rr.bindAll=Qa,Rr.bindKey=Ps,Rr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zs(e)?e:[e]},Rr.chain=ls,Rr.chunk=function(e,t,n){t=(n?mo(e,t,n):t===r)?1:pr(ha(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=re(ht(i/t));oo?0:o+n),(i=i===r||i>o?o:ha(i))<0&&(i+=o),i=n>i?0:da(i);n>>0)?(e=ma(e))&&("string"==typeof t||null!=t&&!ra(t))&&!(t=ii(t))&&tr(e)?gi(ar(e),0,n):e.split(t,n):[]},Rr.spread=function(e,t){if("function"!=typeof e)throw new _e(n);return t=null==t?0:pr(ha(t),0),qn((function(r){var n=r[t],i=gi(r,0,t);return n&&kt(i,n),xt(e,this,i)}))},Rr.tail=function(e){var t=null==e?0:e.length;return t?Jn(e,1,t):[]},Rr.take=function(e,t,n){return e&&e.length?Jn(e,0,(t=n||t===r?1:ha(t))<0?0:t):[]},Rr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?Jn(e,(t=i-(t=n||t===r?1:ha(t)))<0?0:t,i):[]},Rr.takeRightWhile=function(e,t){return e&&e.length?ci(e,no(t,3),!1,!0):[]},Rr.takeWhile=function(e,t){return e&&e.length?ci(e,no(t,3)):[]},Rr.tap=function(e,t){return t(e),e},Rr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new _e(n);return Ys(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Os(e,t,{leading:i,maxWait:t,trailing:o})},Rr.thru=us,Rr.toArray=la,Rr.toPairs=Ra,Rr.toPairsIn=La,Rr.toPath=function(e){return zs(e)?St(e,jo):oa(e)?[e]:Ei(No(ma(e)))},Rr.toPlainObject=fa,Rr.transform=function(e,t,r){var n=zs(e),i=n||qs(e)||sa(e);if(t=no(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ys(e)&&Ks(o)?Lr(Fe(e)):{}}return(i?Ct:gn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Rr.unary=function(e){return Es(e,1)},Rr.union=Jo,Rr.unionBy=Xo,Rr.unionWith=es,Rr.uniq=function(e){return e&&e.length?oi(e):[]},Rr.uniqBy=function(e,t){return e&&e.length?oi(e,no(t,2)):[]},Rr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?oi(e,r,t):[]},Rr.unset=function(e,t){return null==e||si(e,t)},Rr.unzip=ts,Rr.unzipWith=rs,Rr.update=function(e,t,r){return null==e?e:ai(e,t,pi(r))},Rr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ai(e,t,pi(n),i)},Rr.values=Ba,Rr.valuesIn=function(e){return null==e?[]:Kt(e,Sa(e))},Rr.without=ns,Rr.words=Ka,Rr.wrap=function(e,t){return js(pi(t),e)},Rr.xor=is,Rr.xorBy=os,Rr.xorWith=ss,Rr.zip=as,Rr.zipObject=function(e,t){return hi(e||[],t||[],Qr)},Rr.zipObjectDeep=function(e,t){return hi(e||[],t||[],Kn)},Rr.zipWith=cs,Rr.entries=Ra,Rr.entriesIn=La,Rr.extend=wa,Rr.extendWith=ba,ic(Rr,Rr),Rr.add=fc,Rr.attempt=Za,Rr.camelCase=$a,Rr.capitalize=Ua,Rr.ceil=mc,Rr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=pa(n))==n?n:0),t!==r&&(t=(t=pa(t))==t?t:0),rn(pa(e),t,n)},Rr.clone=function(e){return nn(e,4)},Rr.cloneDeep=function(e){return nn(e,5)},Rr.cloneDeepWith=function(e,t){return nn(e,5,t="function"==typeof t?t:r)},Rr.cloneWith=function(e,t){return nn(e,4,t="function"==typeof t?t:r)},Rr.conformsTo=function(e,t){return null==t||on(e,t,Oa(t))},Rr.deburr=Da,Rr.defaultTo=function(e,t){return null==e||e!=e?t:e},Rr.divide=gc,Rr.endsWith=function(e,t,n){e=ma(e),t=ii(t);var i=e.length,o=n=n===r?i:rn(ha(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Rr.eq=Bs,Rr.escape=function(e){return(e=ma(e))&&V.test(e)?e.replace(H,Xt):e},Rr.escapeRegExp=function(e){return(e=ma(e))&&ee.test(e)?e.replace(X,"\\$&"):e},Rr.every=function(e,t,n){var i=zs(e)?It:un;return n&&mo(e,t,n)&&(t=r),i(e,no(t,3))},Rr.find=ps,Rr.findIndex=Do,Rr.findKey=function(e,t){return Rt(e,no(t,3),gn)},Rr.findLast=fs,Rr.findLastIndex=zo,Rr.findLastKey=function(e,t){return Rt(e,no(t,3),wn)},Rr.floor=wc,Rr.forEach=ms,Rr.forEachRight=gs,Rr.forIn=function(e,t){return null==e?e:fn(e,no(t,3),Sa)},Rr.forInRight=function(e,t){return null==e?e:mn(e,no(t,3),Sa)},Rr.forOwn=function(e,t){return e&&gn(e,no(t,3))},Rr.forOwnRight=function(e,t){return e&&wn(e,no(t,3))},Rr.get=Ca,Rr.gt=$s,Rr.gte=Us,Rr.has=function(e,t){return null!=e&&uo(e,t,Cn)},Rr.hasIn=Ea,Rr.head=Fo,Rr.identity=ec,Rr.includes=function(e,t,r,n){e=Fs(e)?e:Ba(e),r=r&&!n?ha(r):0;var i=e.length;return r<0&&(r=pr(i+r,0)),ia(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Bt(e,t,r)>-1},Rr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ha(r);return i<0&&(i=pr(n+i,0)),Bt(e,t,i)},Rr.inRange=function(e,t,n){return t=ua(t),n===r?(n=t,t=0):n=ua(n),function(e,t,r){return e>=fr(t,r)&&e=-l&&e<=l},Rr.isSet=na,Rr.isString=ia,Rr.isSymbol=oa,Rr.isTypedArray=sa,Rr.isUndefined=function(e){return e===r},Rr.isWeakMap=function(e){return Js(e)&&lo(e)==O},Rr.isWeakSet=function(e){return Js(e)&&"[object WeakSet]"==xn(e)},Rr.join=function(e,t){return null==e?"":hr.call(e,t)},Rr.kebabCase=za,Rr.last=Go,Rr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ha(n))<0?pr(i+o,0):fr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Lt(e,Ut,o,!0)},Rr.lowerCase=Wa,Rr.lowerFirst=Fa,Rr.lt=aa,Rr.lte=ca,Rr.max=function(e){return e&&e.length?hn(e,ec,An):r},Rr.maxBy=function(e,t){return e&&e.length?hn(e,no(t,2),An):r},Rr.mean=function(e){return Dt(e,ec)},Rr.meanBy=function(e,t){return Dt(e,no(t,2))},Rr.min=function(e){return e&&e.length?hn(e,ec,Nn):r},Rr.minBy=function(e,t){return e&&e.length?hn(e,no(t,2),Nn):r},Rr.stubArray=dc,Rr.stubFalse=pc,Rr.stubObject=function(){return{}},Rr.stubString=function(){return""},Rr.stubTrue=function(){return!0},Rr.multiply=bc,Rr.nth=function(e,t){return e&&e.length?$n(e,ha(t)):r},Rr.noConflict=function(){return lt._===this&&(lt._=Be),this},Rr.noop=oc,Rr.now=Cs,Rr.pad=function(e,t,r){e=ma(e);var n=(t=ha(t))?sr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ui(pt(i),r)+e+Ui(ht(i),r)},Rr.padEnd=function(e,t,r){e=ma(e);var n=(t=ha(t))?sr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=wr();return fr(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Fn(e,t)},Rr.reduce=function(e,t,r){var n=zs(e)?Mt:Ft,i=arguments.length<3;return n(e,no(t,4),r,i,cn)},Rr.reduceRight=function(e,t,r){var n=zs(e)?Tt:Ft,i=arguments.length<3;return n(e,no(t,4),r,i,ln)},Rr.repeat=function(e,t,n){return t=(n?mo(e,t,n):t===r)?1:ha(t),Hn(ma(e),t)},Rr.replace=function(){var e=arguments,t=ma(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rr.result=function(e,t,n){var i=-1,o=(t=fi(t,e)).length;for(o||(o=1,e=r);++il)return[];var r=h,n=fr(e,h);t=no(t),e-=h;for(var i=qt(n,t);++r=s)return e;var c=n-sr(i);if(c<1)return i;var l=a?gi(a,0,c).join(""):e.slice(0,c);if(o===r)return l+i;if(a&&(c+=l.length-c),ra(o)){if(e.slice(c).search(o)){var u,h=l;for(o.global||(o=Ee(o.source,ma(ue.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;l=l.slice(0,d===r?c:d)}}else if(e.indexOf(ii(o),c)!=c){var p=l.lastIndexOf(o);p>-1&&(l=l.slice(0,p))}return l+i},Rr.unescape=function(e){return(e=ma(e))&&q.test(e)?e.replace(F,lr):e},Rr.uniqueId=function(e){var t=++Ne;return ma(e)+t},Rr.upperCase=Va,Rr.upperFirst=Ga,Rr.each=ms,Rr.eachRight=gs,Rr.first=Fo,ic(Rr,function(){var e={};return gn(Rr,(function(t,r){Te.call(Rr.prototype,r)||(e[r]=t)})),e}(),{chain:!1}),Rr.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rr[e].placeholder=Rr})),Ct(["drop","take"],(function(e,t){Ur.prototype[e]=function(n){n=n===r?1:pr(ha(n),0);var i=this.__filtered__&&!t?new Ur(this):this.clone();return i.__filtered__?i.__takeCount__=fr(n,i.__takeCount__):i.__views__.push({size:fr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Ur.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:no(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ct(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Ur.prototype[e]=function(){return this[r](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Ur.prototype[e]=function(){return this.__filtered__?new Ur(this):this[r](1)}})),Ur.prototype.compact=function(){return this.filter(ec)},Ur.prototype.find=function(e){return this.filter(e).head()},Ur.prototype.findLast=function(e){return this.reverse().find(e)},Ur.prototype.invokeMap=qn((function(e,t){return"function"==typeof e?new Ur(this):this.map((function(r){return _n(r,e,t)}))})),Ur.prototype.reject=function(e){return this.filter(Ts(no(e)))},Ur.prototype.slice=function(e,t){e=ha(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ha(t))<0?n.dropRight(-t):n.take(t-e)),n)},Ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ur.prototype.toArray=function(){return this.take(h)},gn(Ur.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Rr[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(Rr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof Ur,l=a[0],u=c||zs(t),h=function(e){var t=o.apply(Rr,kt([e],a));return i&&d?t[0]:t};u&&n&&"function"==typeof l&&1!=l.length&&(c=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,m=c&&!p;if(!s&&u){t=m?t:new Ur(this);var g=e.apply(t,a);return g.__actions__.push({func:us,args:[h],thisArg:r}),new $r(g,d)}return f&&m?e.apply(this,a):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Rr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(zs(i)?i:[],e)}return this[r]((function(r){return t.apply(zs(r)?r:[],e)}))}})),gn(Ur.prototype,(function(e,t){var r=Rr[t];if(r){var n=r.name+"";Te.call(_r,n)||(_r[n]=[]),_r[n].push({name:t,func:r})}})),_r[Ri(r,2).name]=[{name:"wrapper",func:r}],Ur.prototype.clone=function(){var e=new Ur(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ur.prototype.reverse=function(){if(this.__filtered__){var e=new Ur(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ur.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=zs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Rr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Lo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Rr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var t=e;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:us,args:[Yo],thisArg:r}),new $r(t,this.__chain__)}return this.thru(Yo)},Rr.prototype.toJSON=Rr.prototype.valueOf=Rr.prototype.value=function(){return li(this.__wrapped__,this.__actions__)},Rr.prototype.first=Rr.prototype.head,Qe&&(Rr.prototype[Qe]=function(){return this}),Rr}();ht?((ht.exports=ur)._=ur,ut._=ur):lt._=ur}).call(Zs)}(Qs,Qs.exports);var Ys=Object.defineProperty,Js=Object.defineProperties,Xs=Object.getOwnPropertyDescriptors,ea=Object.getOwnPropertySymbols,ta=Object.prototype.hasOwnProperty,ra=Object.prototype.propertyIsEnumerable,na=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ia=(e,t)=>{for(var r in t||(t={}))ta.call(t,r)&&na(e,r,t[r]);if(ea)for(var r of ea(t))ra.call(t,r)&&na(e,r,t[r]);return e},oa=(e,t)=>Js(e,Xs(t));function sa(e,t,r){let n;const i=aa(e);return t.rpcMap&&(n=t.rpcMap[i]),n||(n=`https://rpc.walletconnect.com/v1?chainId=eip155:${i}&projectId=${r}`),n}function aa(e){return e.includes("eip155")?Number(e.split(":")[1]):Number(e)}function ca(e){var t,r,n,i;const o={};if(!pr(e))return o;for(const[s,a]of Object.entries(e)){const e=sr(s)?[s]:a.chains,c=a.methods||[],l=a.events||[],u=a.rpcMap||{},h=ar(s);o[h]=oa(ia(ia({},o[h]),a),{chains:Zt(e,null==(t=o[h])?void 0:t.chains),methods:Zt(c,null==(r=o[h])?void 0:r.methods),events:Zt(l,null==(n=o[h])?void 0:n.events),rpcMap:ia(ia({},u),null==(i=o[h])?void 0:i.rpcMap)})}return o}const la={},ua=e=>la[e],ha=(e,t)=>{la[e]=t};class da{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ks,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class pa{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){const r=aa(e);if(!this.httpProviders[r]){const e=t||sa(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!e)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,e)}this.chainId=r,this.events.emit(Ks,`${this.name}:${r}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new Hs(r,ua("disableProviderPing")))}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;const n=aa(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0";r=r.startsWith("0x")?r:`0x${r}`;const n=parseInt(r,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:e.chainId}),this.setDefaultChain(`${n}`)}return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class fa{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ks,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class ma{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ks,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class ga{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||this.getCardanoRPCUrl(e);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ks,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{const r=this.getCardanoRPCUrl(t);e[t]=this.createHttpProvider(t,r)})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||this.getCardanoRPCUrl(e);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class wa{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ks,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}class ba{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=ua("events"),this.client=ua("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||sa(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ks,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||sa(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Sn(new qs(r,ua("disableProviderPing")))}}var va=Object.defineProperty,ya=Object.defineProperties,xa=Object.getOwnPropertyDescriptors,Aa=Object.getOwnPropertySymbols,Ca=Object.prototype.hasOwnProperty,Ea=Object.prototype.propertyIsEnumerable,Ia=(e,t,r)=>t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_a=(e,t)=>{for(var r in t||(t={}))Ca.call(t,r)&&Ia(e,r,t[r]);if(Aa)for(var r of Aa(t))Ea.call(t,r)&&Ia(e,r,t[r]);return e},Pa=(e,t)=>ya(e,xa(t));class Oa{constructor(e){this.events=new(b()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:(0,Or.pino)((0,Or.getDefaultLoggerOptions)({level:e?.logger||Vs})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Oa(e);return await t.initialize(),t}async request(e,t){const[r,n]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(r).request({request:_a({},e),chainId:`${r}:${n}`,topic:this.session.topic})}sendAsync(e,t,r){this.request(e,r).then((e=>t(null,e))).catch((e=>t(e,void 0)))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:hr("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await n().then((e=>{this.session=e})).catch((e=>{if(e.message!==As)throw e;t++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{const[r,n]=this.validateChain(e);this.getProvider(r).setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(dr(t)){for(const r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Ds.init({logger:this.providerOpts.logger||Vs,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map((e=>ar(e))))];ha("client",this.client),ha("events",this.events),ha("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=function(e,t){const r=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!r.length)return[];const n=[];return r.forEach((e=>{const r=t.namespaces[e].accounts;n.push(...r)})),n}(e,this.session),r=function(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}(t),n=function(e,t={}){const r=ca(e),n=ca(t);return Qs.exports.merge(r,n)}(this.namespaces,this.optionalNamespaces),i=Pa(_a({},n[e]),{accounts:t,chains:r});switch(e){case"eip155":this.rpcProviders[e]=new pa({namespace:i});break;case"solana":this.rpcProviders[e]=new fa({namespace:i});break;case"cosmos":this.rpcProviders[e]=new ma({namespace:i});break;case"polkadot":this.rpcProviders[e]=new da({namespace:i});break;case"cip34":this.rpcProviders[e]=new ga({namespace:i});break;case"elrond":this.rpcProviders[e]=new wa({namespace:i});break;case"multiversx":this.rpcProviders[e]=new ba({namespace:i})}}))}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(e=>{this.events.emit("session_ping",e)})),this.client.on("session_event",(e=>{const{params:t}=e,{event:r}=t;"accountsChanged"===r.name?this.events.emit("accountsChanged",r.data):"chainChanged"===r.name?this.onChainChanged(t.chainId):this.events.emit(r.name,r.data),this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var r;const{namespaces:n}=t,i=null==(r=this.client)?void 0:r.session.get(e);this.session=Pa(_a({},i),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Pa(_a({},hr("USER_DISCONNECTED")),{data:e.topic}))})),this.on(Ks,(e=>{this.onChainChanged(e,!0)}))}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach((e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t,optionalNamespaces:r,sessionProperties:n}=e;if(!t||!Object.keys(t).length)throw new Error("Namespaces must be not empty");this.namespaces=t,this.optionalNamespaces=r,this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",r)}validateChain(e){const[t,r]=e?.split(":")||["",""];if(t&&!Object.keys(this.namespaces).map((e=>ar(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];const n=ar(Object.keys(this.namespaces)[0]);return[n,this.rpcProviders[n].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var r;const[n,i]=this.validateChain(e);t||this.getProvider(n).setDefaultChain(i),(null!=(r=this.namespaces[n])?r:this.namespaces[`${n}:${i}`]).defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Gs}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Gs}/${e}`)}}const Sa=Oa,ka=["eth_sendTransaction","personal_sign"],Ma=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ta=["chainChanged","accountsChanged"],Na=["message","disconnect","connect"];var ja=Object.defineProperty,Ra=Object.defineProperties,La=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ua=Object.prototype.propertyIsEnumerable,Da=(e,t,r)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,za=(e,t)=>{for(var r in t||(t={}))$a.call(t,r)&&Da(e,r,t[r]);if(Ba)for(var r of Ba(t))Ua.call(t,r)&&Da(e,r,t[r]);return e},Wa=(e,t)=>Ra(e,La(t));function Fa(e){return Number(e[0].split(":")[1])}function Ha(e){return`0x${e.toString(16)}`}class qa{constructor(){this.events=new w.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new qa;return await t.initialize(e),t}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:r}=function(e){const{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:s,rpcMap:a}=e;if(!dr(t))throw new Error("Invalid chains");const c=t,l=n||ka,u=o||Ta,h={chains:c,methods:l,events:u,rpcMap:{[Fa(c)]:a[Fa(c)]}},d=o?.filter((e=>!Ta.includes(e))),p=n?.filter((e=>!ka.includes(e)));return r||s||i||null!=d&&d.length||null!=p&&p.length?{required:h,optional:{chains:[...new Set(d?.length&&p?.length||!r?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(u.concat(s||[]))],rpcMap:a}}:{required:h}}(this.rpc);try{const n=await new Promise((async(n,i)=>{var o;this.rpc.showQrModal&&(null==(o=this.modal)||o.subscribeModal((e=>{!e.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),i(new Error("Connection request reset. Please try again.")))}))),await this.signer.connect(Wa(za({namespaces:{[this.namespace]:t}},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:e?.pairingTopic})).then((e=>{n(e)})).catch((e=>{i(new Error(e.message))}))}));if(!n)return;this.setChainIds(this.rpc.chains);const i=function(e,t=[]){const r=[];return Object.keys(e).forEach((n=>{if(t.length&&!t.includes(n))return;const i=e[n];r.push(...i.accounts)})),r}(n.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:Ha(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(e=>{const{params:t}=e,{event:r}=t;"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)})),this.signer.on("chainChanged",(e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Ha(this.chainId)),this.persist()})),this.signer.on("session_update",(e=>{this.events.emit("session_update",e)})),this.signer.on("session_delete",(e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Wa(za({},hr("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(e=>{var t,r;this.rpc.showQrModal&&(null==(t=this.modal)||t.closeModal(),null==(r=this.modal)||r.openModal({uri:e})),this.events.emit("display_uri",e)}))}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter((e=>this.isCompatibleChainId(e))).map((e=>this.parseChainId(e)));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Ha(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,r,n]=e.split(":");return{chainId:`${t}:${r}`,address:n}}setAccounts(e){this.accounts=e.filter((e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId)).map((e=>this.parseAccountId(e).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,r;return{chains:(null==(t=e.chains)?void 0:t.map((e=>this.formatChainId(e))))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map((e=>this.formatChainId(e))):void 0,methods:e?.methods||ka,events:e?.events||Ta,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:!(null==e||!e.showQrModal),qrModalOptions:null!=(r=e?.qrModalOptions)?r:void 0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const r={};return e.forEach((e=>{r[e]=this.getRpcUrl(e,t)})),r}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Fa(this.rpc.chains),this.signer=await Sa.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const{WalletConnectModal:t}=await Promise.resolve().then(r.bind(r,9343));e=t}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(za({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(e){throw this.signer.logger.error(e),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:r,rpcMap:n}=e;t&&dr(t)&&(this.rpc.chains=t.map((e=>this.formatChainId(e))),t.forEach((e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)}))),r&&dr(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map((e=>this.formatChainId(e))),r.forEach((e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)})))}getRpcUrl(e,t){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((e=>this.parseAccount(e)))}}},8200:(e,t,r)=>{"use strict";r.d(t,{q:()=>n});class n{}},997:(e,t,r)=>{"use strict";r.r(t),r.d(t,{IEvents:()=>n.q});var n=r(8200)},2568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HEARTBEAT_EVENTS=t.HEARTBEAT_INTERVAL=void 0;const n=r(6736);t.HEARTBEAT_INTERVAL=n.FIVE_SECONDS,t.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}},3401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(2568),t)},8969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeartBeat=void 0;const n=r(655),i=r(7187),o=r(6736),s=r(1614),a=r(3401);class c extends s.IHeartBeat{constructor(e){super(e),this.events=new i.EventEmitter,this.interval=a.HEARTBEAT_INTERVAL,this.interval=(null==e?void 0:e.interval)||a.HEARTBEAT_INTERVAL}static init(e){return n.__awaiter(this,void 0,void 0,(function*(){const t=new c(e);return yield t.init(),t}))}init(){return n.__awaiter(this,void 0,void 0,(function*(){yield this.initialize()}))}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}initialize(){return n.__awaiter(this,void 0,void 0,(function*(){this.intervalRef=setInterval((()=>this.pulse()),o.toMiliseconds(this.interval))}))}pulse(){this.events.emit(a.HEARTBEAT_EVENTS.pulse)}}t.HeartBeat=c},772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(8969),t),n.__exportStar(r(1614),t),n.__exportStar(r(3401),t)},4174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IHeartBeat=void 0;const n=r(997);class i extends n.IEvents{constructor(e){super()}}t.IHeartBeat=i},1614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(4174),t)},5150:(e,t,r)=>{"use strict";const n=r(655),i=r(3954),o=n.__importDefault(r(653)),s=r(9728);t.ZP=class{constructor(){this.localStorage=o.default}getKeys(){return n.__awaiter(this,void 0,void 0,(function*(){return Object.keys(this.localStorage)}))}getEntries(){return n.__awaiter(this,void 0,void 0,(function*(){return Object.entries(this.localStorage).map(s.parseEntry)}))}getItem(e){return n.__awaiter(this,void 0,void 0,(function*(){const t=this.localStorage.getItem(e);if(null!==t)return i.safeJsonParse(t)}))}setItem(e,t){return n.__awaiter(this,void 0,void 0,(function*(){this.localStorage.setItem(e,i.safeJsonStringify(t))}))}removeItem(e){return n.__awaiter(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}}},653:(e,t,r)=>{"use strict";!function(){let t;function n(){}t=n,t.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},t.prototype.setItem=function(e,t){this[e]=String(t)},t.prototype.removeItem=function(e){delete this[e]},t.prototype.clear=function(){const e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},t.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),void 0!==r.g&&r.g.localStorage?e.exports=r.g.localStorage:"undefined"!=typeof window&&window.localStorage?e.exports=window.localStorage:e.exports=new n}()},9728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(9076),t),n.__exportStar(r(496),t)},9076:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IKeyValueStorage=void 0,t.IKeyValueStorage=class{}},496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEntry=void 0;const n=r(3954);t.parseEntry=function(e){var t;return[e[0],n.safeJsonParse(null!==(t=e[1])&&void 0!==t?t:"")]}},5727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PINO_CUSTOM_CONTEXT_KEY=t.PINO_LOGGER_DEFAULTS=void 0,t.PINO_LOGGER_DEFAULTS={level:"info"},t.PINO_CUSTOM_CONTEXT_KEY="custom_context"},9107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const n=r(655),i=n.__importDefault(r(6559));Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return i.default}}),n.__exportStar(r(5727),t),n.__exportStar(r(8048),t)},8048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateChildLogger=t.formatChildLoggerContext=t.getLoggerContext=t.setBrowserLoggerContext=t.getBrowserLoggerContext=t.getDefaultLoggerOptions=void 0;const n=r(5727);function i(e,t=n.PINO_CUSTOM_CONTEXT_KEY){return e[t]||""}function o(e,t,r=n.PINO_CUSTOM_CONTEXT_KEY){return e[r]=t,e}function s(e,t=n.PINO_CUSTOM_CONTEXT_KEY){let r="";return r=void 0===e.bindings?i(e,t):e.bindings().context||"",r}function a(e,t,r=n.PINO_CUSTOM_CONTEXT_KEY){const i=s(e,r);return i.trim()?`${i}/${t}`:t}t.getDefaultLoggerOptions=function(e){return Object.assign(Object.assign({},e),{level:(null==e?void 0:e.level)||n.PINO_LOGGER_DEFAULTS.level})},t.getBrowserLoggerContext=i,t.setBrowserLoggerContext=o,t.getLoggerContext=s,t.formatChildLoggerContext=a,t.generateChildLogger=function(e,t,r=n.PINO_CUSTOM_CONTEXT_KEY){const i=a(e,t,r);return o(e.child({context:i}),i,r)}},1882:()=>{},3014:()=>{},6900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(6869),t),n.__exportStar(r(8033),t)},6869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},8033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},6736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(4273),t),n.__exportStar(r(7001),t),n.__exportStar(r(2939),t),n.__exportStar(r(6900),t)},2939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(8766),t)},8766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0,t.IWatch=class{}},3207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;const n=r(6900);t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},3873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}},4273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(3873),t),n.__exportStar(r(3207),t)},7001:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},6151:(e,t,r)=>{"use strict";const n=r(610),i=r(4020),o=r(500),s=r(2806),a=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function u(e,t){return t.decode?i(e):e}function h(e){return Array.isArray(e)?e.sort():"object"==typeof e?h(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const i="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!i&&u(r,e).includes(e.arrayFormatSeparator);r=o?u(r,e):r;const s=i||o?r.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===r?r:u(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=r?u(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const i of e.split("&")){if(""===i)continue;let[e,s]=o(t.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:u(s,t),r(u(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=f(r[e],t);else n[e]=f(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=h(r):e[t]=r,e}),Object.create(null))}t.extract=p,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",i,"]"].join("")]:[...r,[l(t,e),"[",l(i,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),":list="].join("")]:[...r,[l(t,e),":list=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[l(r,e),t,l(i,e)].join("")]:[[n,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),i={};for(const t of Object.keys(e))r(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{const i=e[r];return void 0===i?"":null===i?l(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":i.reduce(n(r),[]).join("&"):l(r,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(p(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const n=d(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),s=Object.assign(o,e.query);let c=t.stringify(s,r);c&&(c=`?${c}`);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u=`#${r[a]?l(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${c}${u}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:i,query:o,fragmentIdentifier:c}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:s(o,r),fragmentIdentifier:c},n)},t.exclude=(e,r,n)=>{const i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},2873:(e,t)=>{"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){const t=r(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},5755:(e,t,r)=>{"use strict";t.D=void 0;const n=r(2873);t.D=function(){let e,t;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function r(...t){const r=e.getElementsByTagName("meta");for(let e=0;en.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=n.getAttribute("content");if(e)return e}}return""}const i=function(){let t=r("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:r("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const r=e.getElementsByTagName("link"),n=[];for(let e=0;e-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{const n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){const r=t.protocol+e;n.push(r)}else n.push(e)}}return n}(),name:i}}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),u=0,h=c>0?s-4:s;for(r=0;r>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;al?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),a(e<0?0:0|f(e))}function d(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:V(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return A(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function R(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function $(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=J((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=J((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return $(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return $(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw F(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},w.call(v.prototype),w.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];x.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,r){return new Promise((function(n,o){var s=new v(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}C.polyfill=!0,e.fetch||(e.fetch=C,e.Headers=d,e.Request=v,e.Response=x),t.Headers=d,t.Request=v,t.Response=x,t.fetch=C,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},4020:e=>{"use strict";var t="%[a-f0-9]{2}",r=new RegExp("("+t+")|([^%]+?)","gi"),n=new RegExp("("+t+")+","gi");function i(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],i(r),i(n))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(r)||[],n=1;n{"use strict";var t={single_source_shortest_paths:function(e,r,n){var i={},o={};o[r]=0;var s,a,c,l,u,h,d,p=t.PriorityQueue.make();for(p.push(r,0);!p.empty();)for(c in a=(s=p.pop()).value,l=s.cost,u=e[a]||{})u.hasOwnProperty(c)&&(h=l+u[c],d=o[c],(void 0===o[c]||d>h)&&(o[c]=h,p.push(c,h),i[c]=a));if(void 0!==n&&void 0===o[n]){var f=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(f)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},2378:e=>{"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n=55296&&i<=56319&&r>n+1){var o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(i=1024*(i-55296)+o-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,s,l;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,u=f(c,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},2806:e=>{"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,u=-7,h=r?i-1:0,d=r?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,l=8*o-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*c-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(s=s<0;e[r+p]=255&s,p+=f,s/=256,l-=8);e[r+p-f]|=128*m}},2307:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",d="[object Error]",p="[object Function]",f="[object GeneratorFunction]",m="[object Map]",g="[object Number]",w="[object Null]",b="[object Object]",v="[object Promise]",y="[object Proxy]",x="[object RegExp]",A="[object Set]",C="[object String]",E="[object Undefined]",I="[object WeakMap]",_="[object ArrayBuffer]",P="[object DataView]",O=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[c]=k[_]=k[u]=k[P]=k[h]=k[d]=k[p]=k[m]=k[g]=k[b]=k[x]=k[A]=k[C]=k[I]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,N=M||T||Function("return this")(),j=t&&!t.nodeType&&t,R=j&&e&&!e.nodeType&&e,L=R&&R.exports===j,B=L&&M.process,$=function(){try{return B&&B.binding&&B.binding("util")}catch(e){}}(),U=$&&$.isTypedArray;function D(e,t){for(var r=-1,n=null==e?0:e.length;++rl))return!1;var h=a.get(e);if(h&&a.get(t))return h==t;var d=-1,p=!0,f=r&o?new _e:void 0;for(a.set(e,t),a.set(t,e);++d-1},Ee.prototype.set=function(e,t){var r=this.__data__,n=Oe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Ie.prototype.clear=function(){this.size=0,this.__data__={hash:new Ce,map:new(he||Ee),string:new Ce}},Ie.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Ie.prototype.get=function(e){return je(this,e).get(e)},Ie.prototype.has=function(e){return je(this,e).has(e)},Ie.prototype.set=function(e,t){var r=je(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},_e.prototype.add=_e.prototype.push=function(e){return this.__data__.set(e,n),this},_e.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.clear=function(){this.__data__=new Ee,this.size=0},Pe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ee){var n=r.__data__;if(!he||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ie(n)}return r.set(e,t),this.size=r.size,this};var Le=ae?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,i=null==t?0:t.length,o=0,s=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=s}function Ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ge(e){return null!=e&&"object"==typeof e}var Ke=U?function(e){return function(t){return e(t)}}(U):function(e){return Ge(e)&&qe(e.length)&&!!k[Se(e)]};function Ze(e){return null!=(t=e)&&qe(t.length)&&!He(t)?function(e,t){var r=We(e),n=!r&&ze(e),i=!r&&!n&&Fe(e),o=!r&&!n&&!i&&Ke(e),s=r||n||i||o,a=s?function(e,t){for(var r=-1,n=Array(e);++r{"use strict";r.d(t,{j:()=>ce});const n={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},i=e=>1e3*e,o=e=>e/1e3,s=()=>{},a=e=>e;function c(e,t=!0){if(e&&"finished"!==e.playState)try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch(e){}}const l=e=>e(),u=(e,t,r=n.duration)=>new Proxy({animations:e.map(l).filter(Boolean),duration:r,options:t},h),h={get:(e,t)=>{const r=e.animations[0];switch(t){case"duration":return e.duration;case"currentTime":return o((null==r?void 0:r[t])||0);case"playbackRate":case"playState":return null==r?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(d)).catch(s)),e.finished;case"stop":return()=>{e.animations.forEach((e=>c(e)))};case"forEachNative":return t=>{e.animations.forEach((r=>t(r,e)))};default:return void 0===(null==r?void 0:r[t])?void 0:()=>e.animations.forEach((e=>e[t]()))}},set:(e,t,r)=>{switch(t){case"currentTime":r=i(r);case"currentTime":case"playbackRate":for(let n=0;ne.finished,p=e=>"object"==typeof e&&Boolean(e.createAnimation),f=e=>"number"==typeof e,m=e=>Array.isArray(e)&&!f(e[0]),g=(e,t,r)=>-r*e+r*t+e,w=(e,t,r)=>t-e==0?1:(r-e)/(t-e);function b(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=w(0,t,n);e.push(g(r,1,i))}}const v=(e,t,r)=>Math.min(Math.max(r,e),t);const y=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,x=1e-7,A=12;function C(e,t,r,n){if(e===t&&r===n)return a;return i=>0===i||1===i?i:y(function(e,t,r,n,i){let o,s,a=0;do{s=t+(r-t)/2,o=y(s,n,i)-e,o>0?r=s:t=s}while(Math.abs(o)>x&&++a"function"==typeof e,I=e=>Array.isArray(e)&&f(e[0]),_={ease:C(.25,.1,.25,1),"ease-in":C(.42,0,1,1),"ease-in-out":C(.42,0,.58,1),"ease-out":C(0,0,.58,1)},P=/\((.*?)\)/;function O(e){if(E(e))return e;if(I(e))return C(...e);if(_[e])return _[e];if(e.startsWith("steps")){const t=P.exec(e);if(t){const e=t[1].split(",");return((e,t="end")=>r=>{const n=(r="end"===t?Math.min(r,.999):Math.max(r,.001))*e,i="end"===t?Math.floor(n):Math.ceil(n);return v(0,1,i/e)})(parseFloat(e[0]),e[1].trim())}}return a}class S{constructor(e,t=[0,1],{easing:r,duration:i=n.duration,delay:o=n.delay,endDelay:s=n.endDelay,repeat:c=n.repeat,offset:l,direction:u="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=a,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),r=r||n.easing,p(r)){const e=r.createAnimation(t);r=e.easing,t=e.keyframes||t,i=e.duration||i}this.repeat=c,this.easing=m(r)?a:O(r),this.updateDuration(i);const h=function(e,t=function(e){const t=[0];return b(t,e-1),t}(e.length),r=a){const n=e.length,i=n-t.length;return i>0&&b(t,i),i=>{let o=0;for(;o{const n=t-e;return((r-e)%n+n)%n+e})(0,e.length,t)]:e}(r,o);return s=a(s),g(e[o],e[o+1],s)}}(t,l,m(r)?r.map(O):a);this.tick=t=>{var r;let n=0;n=void 0!==this.pauseTime?this.pauseTime:(t-this.startTime)*this.rate,this.t=n,n/=1e3,n=Math.max(n-o,0),"finished"===this.playState&&void 0===this.pauseTime&&(n=this.totalDuration);const i=n/this.duration;let a=Math.floor(i),c=i%1;!c&&i>=1&&(c=1),1===c&&a--;const l=a%2;("reverse"===u||"alternate"===u&&l||"alternate-reverse"===u&&!l)&&(c=1-c);const d=n>=this.totalDuration?1:Math.min(c,1),p=h(this.easing(d));e(p),void 0===this.pauseTime&&("finished"===this.playState||n>=this.totalDuration+s)?(this.playState="finished",null===(r=this.resolve)||void 0===r||r.call(this,p)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(e=this.reject)||void 0===e||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){void 0!==this.pauseTime||0===this.rate?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}class k{setAnimation(e){this.animation=e,null==e||e.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const M=new WeakMap;function T(e){return M.has(e)||M.set(e,{transforms:[],values:new Map}),M.get(e)}const N=["","X","Y","Z"],j={x:"translateX",y:"translateY",z:"translateZ"},R={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},L={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:R,scale:{syntax:"",initialValue:1,toDefaultUnit:a},skew:R},B=new Map,$=e=>`--motion-${e}`,U=["x","y","z"];["translate","scale","rotate","skew"].forEach((e=>{N.forEach((t=>{U.push(e+t),B.set($(e+t),L[e])}))}));const D=(e,t)=>U.indexOf(e)-U.indexOf(t),z=new Set(U),W=e=>z.has(e),F=e=>e.sort(D).reduce(H,"").trim(),H=(e,t)=>`${e} ${t}(var(${$(t)}))`,q=e=>e.startsWith("--"),V=new Set,G=(e,t)=>document.createElement("div").animate(e,t),K={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{G({opacity:[1]})}catch(e){return!1}return!0},finished:()=>Boolean(G({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{G({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}},Z={},Q={};for(const e in K)Q[e]=()=>(void 0===Z[e]&&(Z[e]=K[e]()),Z[e]);const Y=(e,t)=>E(e)?Q.linearEasing()?`linear(${((e,t)=>{let r="";const n=Math.round(t/.015);for(let t=0;t`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function X(e){return j[e]&&(e=j[e]),W(e)?$(e):e}const ee=(e,t)=>{t=X(t);let r=q(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&0!==r){const e=B.get(t);e&&(r=e.initialValue)}return r},te=(e,t,r)=>{t=X(t),q(t)?e.style.setProperty(t,r):e.style[t]=r};function re(e,t,r,o={},l){const u=window.__MOTION_DEV_TOOLS_RECORD,h=!1!==o.record&&u;let d,{duration:g=n.duration,delay:w=n.delay,endDelay:b=n.endDelay,repeat:v=n.repeat,easing:y=n.easing,persist:x=!1,direction:A,offset:C,allowWebkitAcceleration:I=!1}=o;const _=T(e),P=W(t);let O=Q.waapi();P&&((e,t)=>{j[t]&&(t=j[t]);const{transforms:r}=T(e);var n,i;i=t,-1===(n=r).indexOf(i)&&n.push(i),e.style.transform=F(r)})(e,t);const S=X(t),M=function(e,t){return e.has(t)||e.set(t,new k),e.get(t)}(_.values,S),N=B.get(S);return c(M.animation,!(p(y)&&M.generator)&&!1!==o.record),()=>{const n=()=>{var t,r;return null!==(r=null!==(t=ee(e,S))&&void 0!==t?t:null==N?void 0:N.initialValue)&&void 0!==r?r:0};let c=function(e,t){for(let r=0;rArray.isArray(e)?e:[e])(r),n);const _=function(e,t){var r;let n=(null==t?void 0:t.toDefaultUnit)||a;const i=e[e.length-1];if("string"==typeof i){const e=(null===(r=i.match(/(-?[\d.]+)([a-z%]*)/))||void 0===r?void 0:r[2])||"";e&&(n=t=>t+e)}return n}(c,N);if(p(y)){const e=y.createAnimation(c,"opacity"!==t,n,S,M);y=e.easing,c=e.keyframes||c,g=e.duration||g}if(q(S)&&(Q.cssRegisterProperty()?function(e){if(!V.has(e)){V.add(e);try{const{syntax:t,initialValue:r}=B.has(e)?B.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch(e){}}}(S):O=!1),P&&!Q.linearEasing()&&(E(y)||m(y)&&y.some(E))&&(O=!1),O){N&&(c=c.map((e=>f(e)?N.toDefaultUnit(e):e))),1!==c.length||Q.partialKeyframes()&&!h||c.unshift(n());const t={delay:i(w),duration:i(g),endDelay:i(b),easing:m(y)?void 0:Y(y,g),direction:A,iterations:v+1,fill:"both"};d=e.animate({[S]:c,offset:C,easing:m(y)?y.map((e=>Y(e,g))):void 0},t),d.finished||(d.finished=new Promise(((e,t)=>{d.onfinish=e,d.oncancel=t})));const r=c[c.length-1];d.finished.then((()=>{x||(te(e,S,r),d.cancel())})).catch(s),I||(d.playbackRate=1.000001)}else if(l&&P)c=c.map((e=>"string"==typeof e?parseFloat(e):e)),1===c.length&&c.unshift(parseFloat(n())),d=new l((t=>{te(e,S,_?_(t):t)}),c,Object.assign(Object.assign({},o),{duration:g,easing:y}));else{const t=c[c.length-1];te(e,S,N&&f(t)?N.toDefaultUnit(t):t)}return h&&u(e,t,c,{duration:g,delay:w,easing:y,repeat:v,offset:C},"motion-one"),M.setAnimation(d),d}}const ne=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function ie(e,t,r){return E(e)?e(t,r):e}const oe=(se=S,function(e,t,r={}){const n=(e=function(e,t){return"string"==typeof e?e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}(e)).length;Boolean(n),Boolean(t);const i=[];for(let o=0;o{const r=new S(e,[0,1],t);return r.finished.catch((()=>{})),r}],t,t.duration)}function ce(e,t,r){return(E(e)?ae:oe)(e,t,r)}},2592:(e,t,r)=>{const n=r(7138),i=r(5115),o=r(6907),s=r(3776);function a(e,t,r,o,s){const a=[].slice.call(arguments,1),c=a.length,l="function"==typeof a[c-1];if(!l&&!n())throw new Error("Callback required as last argument");if(!l){if(c<1)throw new Error("Too few arguments provided");return 1===c?(r=t,t=o=void 0):2!==c||t.getContext||(o=r,r=t,t=void 0),new Promise((function(n,s){try{const s=i.create(r,o);n(e(s,t,o))}catch(e){s(e)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(s=r,r=t,t=o=void 0):3===c&&(t.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=t,t=void 0));try{const n=i.create(r,o);s(null,e(n,t,o))}catch(e){s(e)}}t.create=i.create,t.toCanvas=a.bind(null,o.render),t.toDataURL=a.bind(null,o.renderToDataURL),t.toString=a.bind(null,(function(e,t,r){return s.render(e,r)}))},7138:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},1845:(e,t,r)=>{const n=r(242).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),o=[r-7];for(let e=1;e{const n=r(6910),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(e){this.mode=n.ALPHANUMERIC,this.data=e}o.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=o},7245:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},3280:e=>{function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},3424:(e,t,r)=>{const n=r(2378),i=r(6910);function o(e){this.mode=i.BYTE,"string"==typeof e&&(e=n(e)),this.data=new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,r=this.data.length;t{const n=r(4908),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return o[4*(e-1)+0];case n.M:return o[4*(e-1)+1];case n.Q:return o[4*(e-1)+2];case n.H:return o[4*(e-1)+3];default:return}}},4908:(e,t)=>{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},6526:(e,t,r)=>{const n=r(242).getSymbolSize;t.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},1642:(e,t,r)=>{const n=r(242),i=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let o=r<<10;for(;n.getBCHDigit(o)-i>=0;)o^=1335<{const r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},5442:(e,t,r)=>{const n=r(6910),i=r(242);function o(e){this.mode=n.KANJI,this.data=e}o.getBitsLength=function(e){return 13*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=o},7126:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function r(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,n=0,i=0,o=null,s=null;for(let a=0;a=5&&(r+=n-5+3),o=t,n=1),t=e.get(c,a),t===s?i++:(i>=5&&(r+=i-5+3),s=t,i=1)}n>=5&&(r+=n-5+3),i>=5&&(r+=i-5+3)}return r},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(s,o),s>=10&&(1488===i||93===i)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n{const n=r(3114),i=r(7007);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},1085:(e,t,r)=>{const n=r(6910);function i(e){this.mode=n.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},e.exports=i},6143:(e,t,r)=>{const n=r(9729);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let i=0;i=0;){const e=r[0];for(let i=0;i{const n=r(242),i=r(4908),o=r(7245),s=r(3280),a=r(1845),c=r(6526),l=r(7126),u=r(5393),h=r(2882),d=r(3103),p=r(1642),f=r(6910),m=r(6130);function g(e,t,r){const n=e.size,i=p.getEncodedBits(t,r);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(n-15+o,8,s,!0),o<8?e.set(8,n-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(n-8,8,1,!0)}function w(e,t,r,i){let p;if(Array.isArray(e))p=m.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=m.rawSplit(e);n=d.getBestVersionForData(t,r)}p=m.fromString(e,n||40)}}const w=d.getBestVersionForData(p,r);if(!w)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,o+n,!0,!0):e.set(i+t,o+n,!1,!0))}}(y,t),function(e){const t=e.size;for(let r=8;r=7&&function(e,t){const r=e.size,n=d.getEncodedBits(t);let i,o,s;for(let t=0;t<18;t++)i=Math.floor(t/3),o=t%3+r-8-3,s=1==(n>>t&1),e.set(i,o,s,!0),e.set(o,i,s,!0)}(y,t),function(e,t){const r=e.size;let n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;s>>o&1)),e.set(i,a-r,n),o--,-1===o&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(y,b),isNaN(i)&&(i=l.getBestMask(y,g.bind(null,y,r))),l.applyMask(i,y),g(y,r,i),{modules:y,version:t,errorCorrectionLevel:r,maskPattern:i,segments:p}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,o,s=i.M;return void 0!==t&&(s=i.from(t.errorCorrectionLevel,i.M),r=d.from(t.version),o=l.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),w(e,r,s,o)}},2882:(e,t,r)=>{const n=r(6143);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=i},7007:(e,t)=>{const r="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";t.KANJI=new RegExp(n,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(i,"g"),t.NUMERIC=new RegExp(r,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const o=new RegExp("^"+n+"$"),s=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return o.test(e)},t.testNumeric=function(e){return s.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},6130:(e,t,r)=>{const n=r(6910),i=r(1085),o=r(8260),s=r(3424),a=r(5442),c=r(7007),l=r(242),u=r(5987);function h(e){return unescape(encodeURIComponent(e)).length}function d(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function p(e){const t=d(c.NUMERIC,n.NUMERIC,e),r=d(c.ALPHANUMERIC,n.ALPHANUMERIC,e);let i,o;return l.isKanjiModeEnabled()?(i=d(c.BYTE,n.BYTE,e),o=d(c.KANJI,n.KANJI,e)):(i=d(c.BYTE_KANJI,n.BYTE,e),o=[]),t.concat(r,i,o).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function f(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return o.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return s.getBitsLength(e)}}function m(e,t){let r;const c=n.getBestModeForData(e);if(r=n.from(t,c),r!==n.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[]))},t.rawSplit=function(e){return t.fromArray(p(e,l.isKanjiModeEnabled()))}},242:(e,t)=>{let r;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},3114:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},3103:(e,t,r)=>{const n=r(242),i=r(5393),o=r(4908),s=r(6910),a=r(3114),c=n.getBCHDigit(7973);function l(e,t){return s.getCharCountIndicator(e,t)+4}function u(e,t){let r=0;return e.forEach((function(e){const n=l(e.mode,t);r+=n+e.getBitsLength()})),r}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);const o=8*(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t));if(r===s.MIXED)return o;const c=o-l(r,e);switch(r){case s.NUMERIC:return Math.floor(c/10*3);case s.ALPHANUMERIC:return Math.floor(c/11*2);case s.KANJI:return Math.floor(c/13);case s.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let n;const i=o.from(r,o.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(u(e,n)<=t.getCapacity(n,r,s.MIXED))return n}(e,i);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-c>=0;)t^=7973<{const n=r(9653);t.render=function(e,t,r){let i=r,o=t;void 0!==i||t&&t.getContext||(i=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=n.getOptions(i);const s=n.getImageWidth(e.modules.size,i),a=o.getContext("2d"),c=a.createImageData(s,s);return n.qrToImageData(c.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,o,s),a.putImageData(c,0,0),o},t.renderToDataURL=function(e,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const o=t.render(e,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},3776:(e,t,r)=>{const n=r(9653);function i(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){const s=n.getOptions(t),a=e.modules.size,c=e.modules.data,l=a+2*s.margin,u=s.color.light.a?"':"",h="0&&l>0&&e[c-1]||(n+=s?o("M",l+r,.5+u+r):o("m",i,0),i=0,s=!1),l+1',d='viewBox="0 0 '+l+" "+l+'"',p=''+u+h+"\n";return"function"==typeof r&&r(null,p),p}},9653:(e,t)=>{function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const i=r.modules.size,o=r.modules.data,s=t.getScale(i,n),a=Math.floor((i+2*n.margin)*s),c=n.margin*s,l=[n.color.light,n.color.dark];for(let t=0;t=c&&r>=c&&t{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var o=r.length+1;if(1===o)return e;var s=new Array(o);s[0]=i(e);for(var a=1;a-1?h:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c)break;if(null==r[u])break;h=c)break;if(null==r[u])break;h=c)break;if(void 0===r[u])break;h",h=p+2,p++;break}l+=i(r[u]),h=p+2,p++;break;case 115:if(u>=c)break;h{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeJsonParse=function(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return JSON.parse(e)}catch(t){return e}},t.safeJsonStringify=function(e){return"string"==typeof e?e:JSON.stringify(e,((e,t)=>void 0===t?null:t))}},500:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},610:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},655:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>y,__asyncGenerator:()=>v,__asyncValues:()=>x,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>_,__createBinding:()=>d,__decorate:()=>a,__exportStar:()=>p,__extends:()=>i,__generator:()=>h,__importDefault:()=>E,__importStar:()=>C,__makeTemplateObject:()=>A,__metadata:()=>l,__param:()=>c,__read:()=>m,__rest:()=>s,__spread:()=>g,__spreadArrays:()=>w,__values:()=>f});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function h(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(c,l):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function y(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=f(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function _(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},5289:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:void 0!==r.g?n=r.g.WebSocket||r.g.MozWebSocket:"undefined"!=typeof window?n=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket);const i=n},7026:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},5883:()=>{},6559:(e,t,r)=>{"use strict";const n=r(5346);e.exports=s;const i=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},o={mapHttpRequest:d,mapHttpResponse:d,wrapRequestSerializer:p,wrapResponseSerializer:p,wrapErrorSerializer:p,req:d,res:d,err:function(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}};function s(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},o=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1),"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===e.enabled&&(e.level="silent");const p=e.level||"info",m=Object.create(r);m.log||(m.log=f),Object.defineProperty(m,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(m,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,a(g,m,"error","log"),a(g,m,"fatal","error"),a(g,m,"warn","error"),a(g,m,"info","log"),a(g,m,"debug","log"),a(g,m,"trace","log")}});const g={transmit:t,serialize:o,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:h(e)};return m.levels=s.levels,m.level=p,m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=f,m.serializers=n,m._serialize=o,m._stdErrSerialize=d,m.child=function(r,i){if(!r)throw new Error("missing bindings for child Pino");i=i||{},o&&r.serializers&&(i.serializers=r.serializers);const s=i.serializers;if(o&&s){var a=Object.assign({},n,s),h=!0===e.browser.serialize?Object.keys(a):o;delete r.serializers,c([r],h,a,this._stdErrSerialize)}function d(e){this._childLevel=1+(0|e._childLevel),this.error=l(e,r,"error"),this.fatal=l(e,r,"fatal"),this.warn=l(e,r,"warn"),this.info=l(e,r,"info"),this.debug=l(e,r,"debug"),this.trace=l(e,r,"trace"),a&&(this.serializers=a,this._serialize=h),t&&(this._logEvent=u([].concat(e._logEvent.bindings,r)))}return d.prototype=this,new d(this)},t&&(m._logEvent=u()),m}function a(e,t,r,o){const a=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?f:a[r]?a[r]:i[r]||i[o]||f,function(e,t,r){var o;(e.transmit||t[r]!==f)&&(t[r]=(o=t[r],function(){const a=e.timestamp(),l=new Array(arguments.length),h=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var d=0;d-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function l(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i{"use strict";r.d(t,{AV:()=>s,ConfigCtrl:()=>f,ExplorerCtrl:()=>S,OptionsCtrl:()=>d,ThemeCtrl:()=>$,ToastCtrl:()=>D,jb:()=>M,uA:()=>u,zv:()=>a});var n=r(6828),i=r(8764);const o=(0,n.sj)({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),s={state:o,subscribe:e=>(0,n.Ld)(o,(()=>e(o))),push(e,t){e!==o.view&&(o.view=e,t&&(o.data=t),o.history.push(e))},reset(e){o.view=e,o.history=[e]},replace(e){o.history.length>1&&(o.history[o.history.length-1]=e,o.view=e)},goBack(){if(o.history.length>1){o.history.pop();const[e]=o.history.slice(-1);o.view=e}},setData(e){o.data=e}},a={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>a.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return a.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,r){if(a.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,r){if(!a.isHttpUrl(e))return this.formatNativeUrl(e,t,r);let n=e;return n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))},setWalletConnectAndroidDeepLink(e){const[t]=e.split("?");localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(a.WALLETCONNECT_DEEPLINK_CHOICE)},setModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(a.WCM_VERSION,"2.5.4")},getWalletRouterData(){var e;const t=null==(e=s.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},c=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),l=(0,n.sj)({enabled:c,userSessionId:"",events:[],connectedWalletId:void 0}),u={state:l,subscribe:e=>(0,n.Ld)(l.events,(()=>e((0,n.CO)(l.events[l.events.length-1])))),initialize(){l.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(l.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){l.connectedWalletId=e},click(e){if(l.enabled){const t={type:"CLICK",name:e.name,userSessionId:l.userSessionId,timestamp:Date.now(),data:e};l.events.push(t)}},track(e){if(l.enabled){const t={type:"TRACK",name:e.name,userSessionId:l.userSessionId,timestamp:Date.now(),data:e};l.events.push(t)}},view(e){if(l.enabled){const t={type:"VIEW",name:e.name,userSessionId:l.userSessionId,timestamp:Date.now(),data:e};l.events.push(t)}}},h=(0,n.sj)({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),d={state:h,subscribe:e=>(0,n.Ld)(h,(()=>e(h))),setChains(e){h.chains=e},setWalletConnectUri(e){h.walletConnectUri=e},setIsCustomDesktop(e){h.isCustomDesktop=e},setIsCustomMobile(e){h.isCustomMobile=e},setIsDataLoaded(e){h.isDataLoaded=e},setIsUiLoaded(e){h.isUiLoaded=e},setIsAuth(e){h.isAuth=e}},p=(0,n.sj)({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),f={state:p,subscribe:e=>(0,n.Ld)(p,(()=>e(p))),setConfig(e){var t,r;u.initialize(),d.setChains(e.chains),d.setIsAuth(Boolean(e.enableAuthMode)),d.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),d.setIsCustomDesktop(Boolean(null==(r=e.desktopWallets)?void 0:r.length)),a.setModalVersionInStorage(),Object.assign(p,e)}},m="https://explorer-api.walletconnect.com";async function g(e,t){const r=new URL(e,m);return r.searchParams.append("projectId",f.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&r.searchParams.append(e,String(t))})),(await fetch(r)).json()}const w=async e=>g("/w3m/v1/getDesktopListings",e),b=async e=>g("/w3m/v1/getMobileListings",e),v=async e=>g("/w3m/v1/getAllListings",e),y=e=>`${m}/w3m/v1/getWalletImage/${e}?projectId=${f.state.projectId}`,x=e=>`${m}/w3m/v1/getAssetImage/${e}?projectId=${f.state.projectId}`;var A=Object.defineProperty,C=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,_=(e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const P=a.isMobile(),O=(0,n.sj)({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),S={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=f.state;if("NONE"===e||"ALL"===t&&!e)return O.recomendedWallets;if(a.isArray(e)){const t={recommendedIds:e.join(",")},{listings:r}=await v(t),n=Object.values(r);n.sort(((t,r)=>e.indexOf(t.id)-e.indexOf(r.id))),O.recomendedWallets=n}else{const{chains:e,isAuth:r}=d.state,n=e?.join(","),i=a.isArray(t),o={page:1,sdks:r?"auth_v1":void 0,entries:a.RECOMMENDED_WALLET_AMOUNT,chains:n,version:2,excludedIds:i?t.join(","):void 0},{listings:s}=P?await b(o):await w(o);O.recomendedWallets=Object.values(s)}return O.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var r in t||(t={}))E.call(t,r)&&_(e,r,t[r]);if(C)for(var r of C(t))I.call(t,r)&&_(e,r,t[r]);return e})({},e),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=f.state,{recomendedWallets:i}=O;if("ALL"===n)return O.wallets;t.search||(i.length?t.excludedIds=i.map((e=>e.id)).join(","):a.isArray(r)&&(t.excludedIds=r.join(","))),a.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),d.state.isAuth&&(t.sdks="auth_v1");const{page:o,search:s}=e,{listings:c,total:l}=P?await b(t):await w(t),u=Object.values(c),h=s?"search":"wallets";return O[h]={listings:[...O[h].listings,...u],total:l,page:o??1},{listings:u,total:l}},getWalletImageUrl:e=>y(e),getAssetImageUrl:e=>x(e),resetSearch(){O.search={listings:[],total:0,page:1}}},k=(0,n.sj)({open:!1}),M={state:k,subscribe:e=>(0,n.Ld)(k,(()=>e(k))),open:async e=>new Promise((t=>{const{isUiLoaded:r,isDataLoaded:n}=d.state;if(d.setWalletConnectUri(e?.uri),d.setChains(e?.chains),s.reset("ConnectWallet"),r&&n)k.open=!0,t();else{const e=setInterval((()=>{const r=d.state;r.isUiLoaded&&r.isDataLoaded&&(clearInterval(e),k.open=!0,t())}),200)}})),close(){k.open=!1}};var T=Object.defineProperty,N=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,L=(e,t,r)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const B=(0,n.sj)({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),$={state:B,subscribe:e=>(0,n.Ld)(B,(()=>e(B))),setThemeConfig(e){const{themeMode:t,themeVariables:r}=e;t&&(B.themeMode=t),r&&(B.themeVariables=((e,t)=>{for(var r in t||(t={}))j.call(t,r)&&L(e,r,t[r]);if(N)for(var r of N(t))R.call(t,r)&&L(e,r,t[r]);return e})({},r))}},U=(0,n.sj)({open:!1,message:"",variant:"success"}),D={state:U,subscribe:e=>(0,n.Ld)(U,(()=>e(U))),openToast(e,t){U.open=!0,U.message=e,U.variant=t},closeToast(){U.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=i.lW),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window))},141:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WcmModal:()=>Je,WcmQrCode:()=>oe});var n=r(9392),i=r(7408),o=r(623),s=r(672),a=r(3692),c=r(4213);const l=e=>null!=e?e:a.Ld;var u=r(2592),h=Object.defineProperty,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&m(e,r,t[r]);if(d)for(var r of d(t))f.call(t,r)&&m(e,r,t[r]);return e};const w={getPreset:e=>({"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}[e]),setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=s.ThemeCtrl.state;if(e){const r=g(g(g({},function(){var e;const t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[null!=(e=s.ThemeCtrl.state.themeMode)?e:"dark"];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}()),{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}),t);Object.entries(r).forEach((([t,r])=>e.style.setProperty(t,r)))}},globalCss:n.iv`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},b=n.iv`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,x=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?y(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&v(t,r,o),o};let A=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"wcm-icon-left":void 0!==this.iconLeft,"wcm-icon-right":void 0!==this.iconRight,"wcm-ghost":"ghost"===this.variant,"wcm-outline":"outline"===this.variant};let t="inverse";return"ghost"===this.variant&&(t="secondary"),"outline"===this.variant&&(t="accent"),n.dy``}};A.styles=[w.globalCss,b],x([(0,i.Cb)({type:Boolean})],A.prototype,"disabled",2),x([(0,i.Cb)()],A.prototype,"iconLeft",2),x([(0,i.Cb)()],A.prototype,"iconRight",2),x([(0,i.Cb)()],A.prototype,"onClick",2),x([(0,i.Cb)()],A.prototype,"variant",2),A=x([(0,i.Mo)("wcm-button")],A);const C=n.iv`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var E=Object.defineProperty,I=Object.getOwnPropertyDescriptor,_=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?I(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&E(t,r,o),o};let P=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"wcm-secondary":"secondary"===this.variant};return n.dy``}};P.styles=[w.globalCss,C],_([(0,i.Cb)({type:Boolean})],P.prototype,"disabled",2),_([(0,i.Cb)()],P.prototype,"variant",2),P=_([(0,i.Mo)("wcm-button-big")],P);const O=n.iv`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let S=class extends n.oi{render(){return n.dy`
`}};S.styles=[w.globalCss,O],S=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-info-footer")],S);const k={CROSS_ICON:a.YP``,WALLET_CONNECT_LOGO:a.YP``,WALLET_CONNECT_ICON:a.YP``,WALLET_CONNECT_ICON_COLORED:a.YP``,BACK_ICON:a.YP``,COPY_ICON:a.YP``,RETRY_ICON:a.YP``,DESKTOP_ICON:a.YP``,MOBILE_ICON:a.YP``,ARROW_DOWN_ICON:a.YP``,ARROW_UP_RIGHT_ICON:a.YP``,ARROW_RIGHT_ICON:a.YP``,QRCODE_ICON:a.YP``,SCAN_ICON:a.YP``,CHECKMARK_ICON:a.YP``,SEARCH_ICON:a.YP``,WALLET_PLACEHOLDER:a.YP``,GLOBE_ICON:a.YP``},M=n.iv`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let T=class extends n.oi{render(){return n.dy`
${k.WALLET_CONNECT_LOGO}
`}};T.styles=[w.globalCss,M],T=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-modal-backcard")],T);const N=n.iv`main{padding:20px;padding-top:0;width:100%}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let j=class extends n.oi{render(){return n.dy`
`}};j.styles=[w.globalCss,N],j=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-modal-content")],j);const R=n.iv`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let L=class extends n.oi{render(){return n.dy`
`}};L.styles=[w.globalCss,R],L=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-modal-footer")],L);const B=n.iv`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var $=Object.defineProperty,U=Object.getOwnPropertyDescriptor,D=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?U(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&$(t,r,o),o};let z=class extends n.oi{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return n.dy``}actionBtnTemplate(){return n.dy``}render(){const e={"wcm-border":this.border},t=s.AV.state.history.length>1,r=this.title?n.dy`${this.title}`:n.dy``;return n.dy`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};z.styles=[w.globalCss,B],D([(0,i.Cb)()],z.prototype,"title",2),D([(0,i.Cb)()],z.prototype,"onAction",2),D([(0,i.Cb)()],z.prototype,"actionIcon",2),D([(0,i.Cb)({type:Boolean})],z.prototype,"border",2),z=D([(0,i.Mo)("wcm-modal-header")],z);const W={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=s.ConfigCtrl.state;return null!=r&&r[e]?r[e]:t?s.ExplorerCtrl.getWalletImageUrl(t):""},getWalletName:(e,t=!1)=>t?e.split(" ")[0]:e,isMobileAnimation:()=>window.innerWidth<=W.MOBILE_BREAKPOINT,async preloadImage(e){const t=new Promise(((t,r)=>{const n=new Image;n.onload=t,n.onerror=r,n.src=e}));return Promise.race([t,s.zv.wait(3e3)])},getErrorMessage:e=>e instanceof Error?e.message:"Unknown Error",debounce(e,t=500){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout((function(){e(...n)}),t)}},handleMobileLinking(e){const{walletConnectUri:t}=s.OptionsCtrl.state,{mobile:r,name:n}=e,i=r?.native,o=r?.universal;W.setRecentWallet(e),t&&function(e){let t="";i?t=s.zv.formatUniversalUrl(i,e,n):o&&(t=s.zv.formatNativeUrl(o,e,n)),s.zv.openHref(t,"_self")}(t)},handleAndroidLinking(){const{walletConnectUri:e}=s.OptionsCtrl.state;e&&(s.zv.setWalletConnectAndroidDeepLink(e),s.zv.openHref(e,"_self"))},async handleUriCopy(){const{walletConnectUri:e}=s.OptionsCtrl.state;if(e)try{await navigator.clipboard.writeText(e),s.ToastCtrl.openToast("Link copied","success")}catch{s.ToastCtrl.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:e}=s.ConfigCtrl.state,t=Object.values(e??{});return Object.values(t)},truncate:(e,t=8)=>e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`,setRecentWallet(e){localStorage.setItem(W.WCM_RECENT_WALLET_DATA,JSON.stringify(e))},getRecentWallet(){const e=localStorage.getItem(W.WCM_RECENT_WALLET_DATA);if(e)return JSON.parse(e)},caseSafeIncludes:(e,t)=>e.toUpperCase().includes(t.toUpperCase()),openWalletExplorerUrl(){s.zv.openHref(W.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:e,mobile:t}=s.zv.getWalletRouterData(),r=Boolean(e?.native),n=Boolean(e?.universal);return{isDesktop:r,isMobile:Boolean(t?.native)||Boolean(t?.universal),isWeb:n}},goToConnectingView(e){s.AV.setData({Wallet:e});const t=s.zv.isMobile(),{isDesktop:r,isWeb:n,isMobile:i}=W.getCachedRouterWalletPlatforms();t?i?s.AV.push("MobileConnecting"):n?s.AV.push("WebConnecting"):s.AV.push("InstallWallet"):r?s.AV.push("DesktopConnecting"):n?s.AV.push("WebConnecting"):i?s.AV.push("MobileQrcodeConnecting"):s.AV.push("InstallWallet")}},F=n.iv`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var H=Object.defineProperty,q=Object.getOwnPropertyDescriptor,V=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?q(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&H(t,r,o),o};let G=class extends n.oi{constructor(){super(),this.view=s.AV.state.view,this.prevView=s.AV.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=s.AV.subscribe((e=>{this.view!==e.view&&this.onChangeRoute()}))}firstUpdated(){this.resizeObserver=new ResizeObserver((([e])=>{const t=`${e.contentRect.height}px`;"0px"!==this.oldHeight&&(0,c.j)(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t})),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;null==(e=this.unsubscribe)||e.call(this),null==(t=this.resizeObserver)||t.disconnect()}get routerEl(){return W.getShadowRootElement(this,".wcm-router")}get contentEl(){return W.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return n.dy``;case"DesktopConnecting":return n.dy``;case"MobileConnecting":return n.dy``;case"WebConnecting":return n.dy``;case"MobileQrcodeConnecting":return n.dy``;case"WalletExplorer":return n.dy``;case"Qrcode":return n.dy``;case"InstallWallet":return n.dy``;default:return n.dy`
Not Found
`}}async onChangeRoute(){await(0,c.j)(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=s.AV.state.view,(0,c.j)(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return n.dy`
${this.viewTemplate()}
`}};G.styles=[w.globalCss,F],V([(0,i.SB)()],G.prototype,"view",2),V([(0,i.SB)()],G.prototype,"prevView",2),G=V([(0,i.Mo)("wcm-modal-router")],G);const K=n.iv`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var Z=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,Y=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Q(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Z(t,r,o),o};let J=class extends n.oi{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=s.ToastCtrl.subscribe((e=>{e.open?(this.open=!0,this.timeout=setTimeout((()=>s.ToastCtrl.closeToast()),2200)):(this.open=!1,clearTimeout(this.timeout))}))}disconnectedCallback(){var e;null==(e=this.unsubscribe)||e.call(this),clearTimeout(this.timeout),s.ToastCtrl.closeToast()}render(){const{message:e,variant:t}=s.ToastCtrl.state,r={"wcm-success":"success"===t,"wcm-error":"error"===t};return this.open?n.dy`
${"success"===t?k.CHECKMARK_ICON:null} ${"error"===t?k.CROSS_ICON:null}${e}
`:null}};function X(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}J.styles=[w.globalCss,K],Y([(0,i.SB)()],J.prototype,"open",2),J=Y([(0,i.Mo)("wcm-modal-toast")],J);const ee={generate(e,t,r){const i="#141414",o=[],s=function(e,t){const r=Array.prototype.slice.call(u.create(e,{errorCorrectionLevel:"Q"}).modules.data,0),n=Math.sqrt(r.length);return r.reduce(((e,t,r)=>(r%n==0?e.push([t]):e[e.length-1].push(t))&&e),[])}(e),a=t/s.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach((({x:e,y:t})=>{const r=(s.length-7)*a*e,l=(s.length-7)*a*t;for(let e=0;e`)}}));const l=Math.floor((r+25)/a),h=s.length/2-l/2,d=s.length/2+l/2-1,p=[];s.forEach(((e,t)=>{e.forEach(((e,r)=>{if(s[t][r]&&!(t<7&&r<7||t>s.length-8&&r<7||t<7&&r>s.length-8)&&!(t>h&&th&&r{f[e]?f[e].push(t):f[e]=[t]})),Object.entries(f).map((([e,t])=>{const r=t.filter((e=>t.every((t=>!X(e,t,a)))));return[Number(e),r]})).forEach((([e,t])=>{t.forEach((t=>{o.push(n.YP``)}))})),Object.entries(f).filter((([e,t])=>t.length>1)).map((([e,t])=>{const r=t.filter((e=>t.some((t=>X(e,t,a)))));return[Number(e),r]})).map((([e,t])=>{t.sort(((e,t)=>et.some((t=>X(e,t,a)))));t?t.push(e):r.push([e])}return[e,r.map((e=>[e[0],e[e.length-1]]))]})).forEach((([e,t])=>{t.forEach((([t,r])=>{o.push(n.YP``)}))})),o}},te=n.iv`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var re=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ie=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ne(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&re(t,r,o),o};let oe=class extends n.oi{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e="light"===s.ThemeCtrl.state.themeMode?this.size:this.size-36;return n.YP`${ee.generate(this.uri,e,e/4)}`}render(){const e={"wcm-dark":"dark"===s.ThemeCtrl.state.themeMode};return n.dy`
${this.walletId||this.imageUrl?n.dy``:k.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};oe.styles=[w.globalCss,te],ie([(0,i.Cb)()],oe.prototype,"uri",2),ie([(0,i.Cb)({type:Number})],oe.prototype,"size",2),ie([(0,i.Cb)()],oe.prototype,"imageId",2),ie([(0,i.Cb)()],oe.prototype,"walletId",2),ie([(0,i.Cb)()],oe.prototype,"imageUrl",2),oe=ie([(0,i.Mo)("wcm-qrcode")],oe);const se=n.iv`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ce(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ae(t,r,o),o};let ue=class extends n.oi{constructor(){super(...arguments),this.onChange=()=>null}render(){return n.dy` ${k.SEARCH_ICON}`}};ue.styles=[w.globalCss,se],le([(0,i.Cb)()],ue.prototype,"onChange",2),ue=le([(0,i.Mo)("wcm-search-input")],ue);const he=n.iv`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let de=class extends n.oi{render(){return n.dy``}};de.styles=[w.globalCss,he],de=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-spinner")],de);const pe=n.iv`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var fe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,ge=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?me(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&fe(t,r,o),o};let we=class extends n.oi{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"wcm-big-bold":"big-bold"===this.variant,"wcm-medium-regular":"medium-regular"===this.variant,"wcm-small-regular":"small-regular"===this.variant,"wcm-small-thin":"small-thin"===this.variant,"wcm-xsmall-regular":"xsmall-regular"===this.variant,"wcm-xsmall-bold":"xsmall-bold"===this.variant,"wcm-color-primary":"primary"===this.color,"wcm-color-secondary":"secondary"===this.color,"wcm-color-tertiary":"tertiary"===this.color,"wcm-color-inverse":"inverse"===this.color,"wcm-color-accnt":"accent"===this.color,"wcm-color-error":"error"===this.color};return n.dy``}};we.styles=[w.globalCss,pe],ge([(0,i.Cb)()],we.prototype,"variant",2),ge([(0,i.Cb)()],we.prototype,"color",2),we=ge([(0,i.Mo)("wcm-text")],we);const be=n.iv`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,xe=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ye(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ve(t,r,o),o};let Ae=class extends n.oi{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?n.dy`RECENT`:this.installed?n.dy`INSTALLED`:null}handleClick(){s.uA.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return n.dy``}};Ae.styles=[w.globalCss,be],xe([(0,i.Cb)()],Ae.prototype,"onClick",2),xe([(0,i.Cb)()],Ae.prototype,"name",2),xe([(0,i.Cb)()],Ae.prototype,"walletId",2),xe([(0,i.Cb)()],Ae.prototype,"label",2),xe([(0,i.Cb)()],Ae.prototype,"imageId",2),xe([(0,i.Cb)({type:Boolean})],Ae.prototype,"installed",2),xe([(0,i.Cb)({type:Boolean})],Ae.prototype,"recent",2),Ae=xe([(0,i.Mo)("wcm-wallet-button")],Ae);const Ce=n.iv`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Ee=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,_e=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ie(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ee(t,r,o),o};let Pe=class extends n.oi{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=null!=(e=this.imageUrl)&&e.length?this.imageUrl:W.getWalletIcon({id:this.walletId,image_id:this.imageId});return n.dy`${t.length?n.dy`
${this.id}
`:k.WALLET_PLACEHOLDER}`}};Pe.styles=[w.globalCss,Ce],_e([(0,i.Cb)()],Pe.prototype,"walletId",2),_e([(0,i.Cb)()],Pe.prototype,"imageId",2),_e([(0,i.Cb)()],Pe.prototype,"imageUrl",2),Pe=_e([(0,i.Mo)("wcm-wallet-image")],Pe);var Oe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,ke=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Se(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Oe(t,r,o),o};let Me=class extends n.oi{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{null!=e&&e.length&&await Promise.all(e.map((async e=>W.preloadImage(e))))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){if(s.ConfigCtrl.state.enableExplorer){await s.ExplorerCtrl.getRecomendedWallets(),s.OptionsCtrl.setIsDataLoaded(!0);const{recomendedWallets:e}=s.ExplorerCtrl.state,t=e.map((e=>W.getWalletIcon(e)));await this.loadImages(t)}else s.OptionsCtrl.setIsDataLoaded(!0)}async preloadCustomImages(){const e=W.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),s.ToastCtrl.openToast("Failed preloading","error")}}};ke([(0,i.SB)()],Me.prototype,"preload",2),Me=ke([(0,i.Mo)("wcm-explorer-context")],Me);Object.defineProperty,Object.getOwnPropertyDescriptor;let Te=class extends n.oi{constructor(){super(),this.unsubscribeTheme=void 0,w.setTheme(),this.unsubscribeTheme=s.ThemeCtrl.subscribe(w.setTheme)}disconnectedCallback(){var e;null==(e=this.unsubscribeTheme)||e.call(this)}};Te=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-theme-context")],Te);const Ne=n.iv`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let je=class extends n.oi{onGoToQrcode(){s.AV.push("Qrcode")}render(){const{recomendedWallets:e}=s.ExplorerCtrl.state,t=[...e,...e],r=2*s.zv.RECOMMENDED_WALLET_AMOUNT;return n.dy`
${k.MOBILE_ICON}WalletConnect
${[...Array(r)].map(((e,r)=>{const i=t[r%t.length];return i?n.dy``:k.WALLET_PLACEHOLDER}))}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};je.styles=[w.globalCss,Ne],je=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-android-wallet-selection")],je);const Re=n.iv`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var Le=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,$e=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Be(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Le(t,r,o),o};let Ue=class extends n.oi{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=null!=(t=null==(e=s.ThemeCtrl.state.themeVariables)?void 0:e["--wcm-wallet-icon-large-border-radius"])?t:w.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;i=r.includes("%")?.88*parseInt(r,10):parseInt(r,10),i*=1.17;const o=317-1.57*i,a=425-1.8*i;return n.dy``}render(){const e={"wcm-error":this.isError,"wcm-stale":this.isStale};return n.dy`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};Ue.styles=[w.globalCss,Re],$e([(0,i.Cb)()],Ue.prototype,"walletId",2),$e([(0,i.Cb)()],Ue.prototype,"imageId",2),$e([(0,i.Cb)({type:Boolean})],Ue.prototype,"isError",2),$e([(0,i.Cb)({type:Boolean})],Ue.prototype,"isStale",2),$e([(0,i.Cb)()],Ue.prototype,"label",2),Ue=$e([(0,i.Mo)("wcm-connector-waiting")],Ue);const De={manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=s.ConfigCtrl.state,i=null==(e=De.recentWallet())?void 0:e.id,o=s.zv.isMobile()?r:n,a=o?.filter((e=>i!==e.id));return null!=(t=s.zv.isMobile()?a?.map((({id:e,name:t,links:r})=>({id:e,name:t,mobile:r,links:r}))):a?.map((({id:e,name:t,links:r})=>({id:e,name:t,desktop:r,links:r}))))?t:[]},recentWallet:()=>W.getRecentWallet(),recomendedWallets(e=!1){var t;const r=e||null==(t=De.recentWallet())?void 0:t.id,{recomendedWallets:n}=s.ExplorerCtrl.state;return n.filter((e=>r!==e.id))}},ze={onConnecting(e){W.goToConnectingView(e)},manualWalletsTemplate(){return De.manualWallets().map((e=>n.dy``))},recomendedWalletsTemplate(e=!1){return De.recomendedWallets(e).map((e=>n.dy``))},recentWalletTemplate(){const e=De.recentWallet();if(e)return n.dy``}},We=n.iv`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Fe=class extends n.oi{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=s.ConfigCtrl.state,r="ALL"!==e&&t,i=ze.manualWalletsTemplate(),o=ze.recomendedWalletsTemplate();let a=[ze.recentWalletTemplate(),...i,...o];a=a.filter(Boolean);const c=a.length>4||r;let l=[];l=c?a.slice(0,3):a;const u=Boolean(l.length);return n.dy`
${k.MOBILE_ICON}Mobile
${k.SCAN_ICON}Scan with your wallet
${u?n.dy`
${k.DESKTOP_ICON}Desktop
${l} ${c?n.dy``:null}
`:null}`}};Fe.styles=[w.globalCss,We],Fe=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-desktop-wallet-selection")],Fe);const He=n.iv`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let qe=class extends n.oi{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=s.ConfigCtrl.state;return e??t?n.dy`
By connecting your wallet to this app, you agree to the app's ${e?n.dy`Terms of Service`:null} ${e&&t?"and":null} ${t?n.dy`Privacy Policy`:null}
`:null}};qe.styles=[w.globalCss,He],qe=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-legal-notice")],qe);const Ve=n.iv`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Ge=class extends n.oi{onQrcode(){s.AV.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=s.ConfigCtrl.state,r="ALL"!==e&&t,i=ze.manualWalletsTemplate(),o=ze.recomendedWalletsTemplate();let a=[ze.recentWalletTemplate(),...i,...o];a=a.filter(Boolean);const c=a.length>8||r;let l=[];l=c?a.slice(0,7):a;const u=Boolean(l.length);return n.dy`${u?n.dy`
${l} ${c?n.dy``:null}
`:null}`}};Ge.styles=[w.globalCss,Ve],Ge=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-mobile-wallet-selection")],Ge);const Ke=n.iv`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var Ze=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,Ye=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Qe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ze(t,r,o),o};let Je=class extends n.oi{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=s.jb.subscribe((e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()}))}disconnectedCallback(){var e;null==(e=this.unsubscribeModal)||e.call(this)}get overlayEl(){return W.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return W.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(e){if(document.querySelector("body"))if(e){const e=document.getElementById("wcm-styles");e?.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(e){e.target===e.currentTarget&&s.jb.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout((async()=>{const e=W.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[0,1]},{delay:.1,duration:.2}).finished,(0,c.j)(this.containerEl,e,{delay:.1,duration:.2}).finished]),this.active=!0}),0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=W.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished,(0,c.j)(this.containerEl,e,{duration:.2}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",(e=>{var t;"Escape"===e.key?s.jb.close():"Tab"===e.key&&(null!=(t=e.target)&&t.tagName.includes("wcm-")||this.containerEl.focus())}),this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;null==(e=this.abortController)||e.abort(),this.abortController=void 0}render(){const e={"wcm-overlay":!0,"wcm-active":this.active};return n.dy`
${this.open?n.dy`
`:null}
`}};Je.styles=[w.globalCss,Ke],Ye([(0,i.SB)()],Je.prototype,"open",2),Ye([(0,i.SB)()],Je.prototype,"active",2),Je=Ye([(0,i.Mo)("wcm-modal")],Je);const Xe=n.iv`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var et=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,rt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?tt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&et(t,r,o),o};let nt=class extends n.oi{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){s.zv.isMobile()?s.AV.replace("MobileConnecting"):s.AV.replace("MobileQrcodeConnecting")}onDesktop(){s.AV.replace("DesktopConnecting")}onWeb(){s.AV.replace("WebConnecting")}render(){return n.dy`
${this.isRetry?n.dy``:null} ${this.isMobile?n.dy`Mobile`:null} ${this.isDesktop?n.dy`Desktop`:null} ${this.isWeb?n.dy`Web`:null}
`}};nt.styles=[w.globalCss,Xe],rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isMobile",2),rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isDesktop",2),rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isWeb",2),rt([(0,i.Cb)({type:Boolean})],nt.prototype,"isRetry",2),nt=rt([(0,i.Mo)("wcm-platform-selection")],nt);const it=n.iv`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let ot=class extends n.oi{onClick(){s.AV.push("WalletExplorer")}render(){const{recomendedWallets:e}=s.ExplorerCtrl.state,t=[...e,...De.manualWallets()].reverse().slice(0,4);return n.dy``}};ot.styles=[w.globalCss,it],ot=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-view-all-wallets-button")],ot);const st=n.iv`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ct(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&at(t,r,o),o};let ut=class extends n.oi{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout((()=>{const{walletConnectUri:e}=s.OptionsCtrl.state;this.uri=e}),0)}get overlayEl(){return W.getShadowRootElement(this,".wcm-qr-container")}render(){return n.dy`
${this.uri?n.dy``:n.dy``}
`}};ut.styles=[w.globalCss,st],lt([(0,i.Cb)()],ut.prototype,"walletId",2),lt([(0,i.Cb)()],ut.prototype,"imageId",2),lt([(0,i.SB)()],ut.prototype,"uri",2),ut=lt([(0,i.Mo)("wcm-walletconnect-qr")],ut);Object.defineProperty,Object.getOwnPropertyDescriptor;let ht=class extends n.oi{viewTemplate(){return s.zv.isAndroid()?n.dy``:s.zv.isMobile()?n.dy``:n.dy``}render(){return n.dy`${this.viewTemplate()}`}};ht.styles=[w.globalCss],ht=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-connect-wallet-view")],ht);const dt=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var pt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,mt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ft(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&pt(t,r,o),o};let gt=class extends n.oi{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(e){const{desktop:t,name:r}=s.zv.getWalletRouterData(),n=t?.native;if(n){const t=s.zv.formatNativeUrl(n,e,r);s.zv.openHref(t,"_self")}}openDesktopApp(){const{walletConnectUri:e}=s.OptionsCtrl.state,t=s.zv.getWalletRouterData();W.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=s.zv.getWalletRouterData(),{isMobile:i,isWeb:o}=W.getCachedRouterWalletPlatforms();return n.dy`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};gt.styles=[w.globalCss,dt],mt([(0,i.SB)()],gt.prototype,"isError",2),gt=mt([(0,i.Mo)("wcm-desktop-connecting-view")],gt);const wt=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let bt=class extends n.oi{onInstall(e){e&&s.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:i}=s.zv.getWalletRouterData();return n.dy`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};bt.styles=[w.globalCss,wt],bt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-install-wallet-view")],bt);const vt=n.iv`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var yt=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,At=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?xt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&yt(t,r,o),o};let Ct=class extends n.oi{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=s.zv.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!t){const t=s.zv.formatNativeUrl(i,e,n);s.zv.openHref(t,"_self")}else if(o){const t=s.zv.formatUniversalUrl(o,e,n);s.zv.openHref(t,"_self")}}openMobileApp(e=!1){const{walletConnectUri:t}=s.OptionsCtrl.state,r=s.zv.getWalletRouterData();W.setRecentWallet(r),t&&this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&s.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:i,mobile:o}=s.zv.getWalletRouterData(),{isWeb:a}=W.getCachedRouterWalletPlatforms(),c=i?.ios,u=o?.universal;return n.dy`Retry${u?n.dy`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};Ct.styles=[w.globalCss,vt],At([(0,i.SB)()],Ct.prototype,"isError",2),Ct=At([(0,i.Mo)("wcm-mobile-connecting-view")],Ct);const Et=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let It=class extends n.oi{render(){const{name:e,id:t,image_id:r}=s.zv.getWalletRouterData(),{isDesktop:i,isWeb:o}=W.getCachedRouterWalletPlatforms();return n.dy`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};It.styles=[w.globalCss,Et],It=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-mobile-qr-connecting-view")],It);Object.defineProperty,Object.getOwnPropertyDescriptor;let _t=class extends n.oi{render(){return n.dy``}};_t.styles=[w.globalCss],_t=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("wcm-qrcode-view")],_t);const Pt=n.iv`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var Ot=Object.defineProperty,St=Object.getOwnPropertyDescriptor,kt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?St(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ot(t,r,o),o};let Mt=class extends n.oi{constructor(){super(...arguments),this.loading=!s.ExplorerCtrl.state.wallets.listings.length,this.firstFetch=!s.ExplorerCtrl.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=W.debounce((e=>{e.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=e,s.ExplorerCtrl.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),s.ExplorerCtrl.resetSearch())}))}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;null==(e=this.intersectionObserver)||e.disconnect()}get placeholderEl(){return W.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver((([e])=>{e.isIntersecting&&(!this.search||!this.firstFetch)&&this.fetchWallets()})),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=s.ExplorerCtrl.state,{listings:r,total:n}=this.search?t:e;return n<=40||r.length>=n}async fetchWallets(){var e;const{wallets:t,search:r}=s.ExplorerCtrl.state,{listings:n,total:i,page:o}=this.search?r:t;if(!this.endReached&&(this.firstFetch||i>40&&n.lengthW.getWalletIcon(e)));await Promise.all([...n.map((async e=>W.preloadImage(e))),s.zv.wait(300)]),this.endReached=this.isLastPage()}catch(e){console.error(e),s.ToastCtrl.openToast(W.getErrorMessage(e),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){s.zv.isAndroid()?W.handleMobileLinking(e):W.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=s.ExplorerCtrl.state,{listings:r}=this.search?t:e,i=this.loading&&!r.length,a=this.search.length>=3;let c=ze.manualWalletsTemplate(),l=ze.recomendedWalletsTemplate(!0);a&&(c=c.filter((({values:e})=>W.caseSafeIncludes(e[0],this.search))),l=l.filter((({values:e})=>W.caseSafeIncludes(e[0],this.search))));const u=!this.loading&&!r.length&&!l.length,h={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return n.dy`
${i?null:c} ${i?null:l} ${i?null:r.map((e=>n.dy`${e?n.dy``:null}`))}
${u?n.dy`No results found`:null} ${!u&&this.loading?n.dy``:null}
`}};Mt.styles=[w.globalCss,Pt],kt([(0,i.SB)()],Mt.prototype,"loading",2),kt([(0,i.SB)()],Mt.prototype,"firstFetch",2),kt([(0,i.SB)()],Mt.prototype,"search",2),kt([(0,i.SB)()],Mt.prototype,"endReached",2),Mt=kt([(0,i.Mo)("wcm-wallet-explorer-view")],Mt);const Tt=n.iv`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Nt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,Rt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?jt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Nt(t,r,o),o};let Lt=class extends n.oi{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(e){const{desktop:t,name:r}=s.zv.getWalletRouterData(),n=t?.universal;if(n){const t=s.zv.formatUniversalUrl(n,e,r);s.zv.openHref(t,"_blank")}}openWebWallet(){const{walletConnectUri:e}=s.OptionsCtrl.state,t=s.zv.getWalletRouterData();W.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=s.zv.getWalletRouterData(),{isMobile:i,isDesktop:o}=W.getCachedRouterWalletPlatforms(),a=s.zv.isMobile();return n.dy`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};Lt.styles=[w.globalCss,Tt],Rt([(0,i.SB)()],Lt.prototype,"isError",2),Lt=Rt([(0,i.Mo)("wcm-web-connecting-view")],Lt)},9343:(e,t,r)=>{"use strict";r.d(t,{WalletConnectModal:()=>i});var n=r(672);class i{constructor(e){this.openModal=n.jb.open,this.closeModal=n.jb.close,this.subscribeModal=n.jb.subscribe,this.setTheme=n.ThemeCtrl.setThemeConfig,n.ThemeCtrl.setThemeConfig(e),n.ConfigCtrl.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(r.bind(r,141));const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),n.OptionsCtrl.setIsUiLoaded(!0)}}}},1475:(e,t,r)=>{"use strict";r.d(t,{AV:()=>c,AccountCtrl:()=>b,ConfigCtrl:()=>g,ExplorerCtrl:()=>j,Id:()=>s,OptionsCtrl:()=>f,ThemeCtrl:()=>q,ToastCtrl:()=>G,WcConnectionCtrl:()=>L,jb:()=>$,uA:()=>d,zv:()=>l});var n=r(6828),i=r(8764);let o;const s={ethereumClient:void 0,setEthereumClient(e){o=e},client(){if(o)return o;throw new Error("ClientCtrl has no client set")}},a=(0,n.sj)({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),c={state:a,subscribe:e=>(0,n.Ld)(a,(()=>e(a))),push(e,t){e!==a.view&&(a.view=e,t&&(a.data=t),a.history.push(e))},reset(e){a.view=e,a.history=[e]},replace(e){a.history.length>1&&(a.history[a.history.length-1]=e,a.view=e)},goBack(){if(a.history.length>1){a.history.pop();const[e]=a.history.slice(-1);a.view=e}},setData(e){a.data=e}},l={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>l.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return l.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,r){if(l.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,r){if(!l.isHttpUrl(e))return this.formatNativeUrl(e,t,r);let n=e;return n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r),`${n}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(l.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(l.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(l.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setWeb3ModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(l.W3M_VERSION,"2.6.1")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=null==(e=c.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t},getSwitchNetworkRouterData(){var e;const t=null==(e=c.state.data)?void 0:e.SwitchNetwork;if(!t)throw new Error('Missing "SwitchNetwork" view data');return t},isPreferInjectedFlag:()=>typeof location<"u"&&new URLSearchParams(location.search).has(l.W3M_PREFER_INJECTED_URL_FLAG)},u=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),h=(0,n.sj)({enabled:u,userSessionId:"",events:[],connectedWalletId:void 0}),d={state:h,subscribe:e=>(0,n.Ld)(h.events,(()=>e((0,n.CO)(h.events[h.events.length-1])))),initialize(){h.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(h.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){h.connectedWalletId=e},click(e){if(h.enabled){const t={type:"CLICK",name:e.name,userSessionId:h.userSessionId,timestamp:Date.now(),data:e};h.events.push(t)}},track(e){if(h.enabled){const t={type:"TRACK",name:e.name,userSessionId:h.userSessionId,timestamp:Date.now(),data:e};h.events.push(t)}},view(e){if(h.enabled){const t={type:"VIEW",name:e.name,userSessionId:h.userSessionId,timestamp:Date.now(),data:e};h.events.push(t)}}},p=(0,n.sj)({selectedChain:void 0,chains:void 0,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1}),f={state:p,subscribe:e=>(0,n.Ld)(p,(()=>e(p))),setChains(e){p.chains=e},getSelectedChain(){const e=s.client().getNetwork().chain;return e&&(p.selectedChain=e),p.selectedChain},setSelectedChain(e){p.selectedChain=e},setIsCustomDesktop(e){p.isCustomDesktop=e},setIsCustomMobile(e){p.isCustomMobile=e},setIsDataLoaded(e){p.isDataLoaded=e},setIsUiLoaded(e){p.isUiLoaded=e},setIsPreferInjected(e){p.isPreferInjected=e}},m=(0,n.sj)({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),g={state:m,subscribe:e=>(0,n.Ld)(m,(()=>e(m))),setConfig(e){var t,r;d.initialize(),f.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),f.setIsCustomDesktop(Boolean(null==(r=e.desktopWallets)?void 0:r.length)),f.setChains(s.client().chains),f.setIsPreferInjected(s.client().isInjectedProviderInstalled()&&l.isPreferInjectedFlag()),e.defaultChain&&f.setSelectedChain(e.defaultChain),l.setWeb3ModalVersionInStorage(),Object.assign(m,e)}},w=(0,n.sj)({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),b={state:w,subscribe:e=>(0,n.Ld)(w,(()=>e(w))),getAccount(){const e=s.client().getAccount();w.address=e.address,w.isConnected=e.isConnected},async fetchProfile(e,t){var r;try{w.profileLoading=!0;const n=t??w.address,i=null==(r=f.state.chains)?void 0:r.find((e=>1===e.id));if(n&&i){const t=await s.client().fetchEnsName({address:n,chainId:1});if(t){const r=await s.client().fetchEnsAvatar({name:t,chainId:1});r&&await e(r),w.profileAvatar=r}w.profileName=t}}finally{w.profileLoading=!1}},async fetchBalance(e){try{const{chain:t}=s.client().getNetwork(),{tokenContracts:r}=g.state;let n;t&&r&&(n=r[t.id]),w.balanceLoading=!0;const i=e??w.address;if(i){const e=await s.client().fetchBalance({address:i,token:n});w.balance={amount:e.formatted,symbol:e.symbol}}}finally{w.balanceLoading=!1}},setAddress(e){w.address=e},setIsConnected(e){w.isConnected=e},resetBalance(){w.balance=void 0},resetAccount(){w.address=void 0,w.isConnected=!1,w.profileName=void 0,w.profileAvatar=void 0,w.balance=void 0}},v="https://explorer-api.walletconnect.com";async function y(e,t){const r=new URL(e,v);return r.searchParams.append("projectId",g.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&r.searchParams.append(e,String(t))})),(await fetch(r)).json()}const x=async e=>y("/w3m/v1/getDesktopListings",e),A=async e=>y("/w3m/v1/getMobileListings",e),C=async e=>y("/w3m/v1/getInjectedListings",e),E=async e=>y("/w3m/v1/getAllListings",e),I=e=>`${v}/w3m/v1/getWalletImage/${e}?projectId=${g.state.projectId}`,_=e=>`${v}/w3m/v1/getAssetImage/${e}?projectId=${g.state.projectId}`;var P=Object.defineProperty,O=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,M=(e,t,r)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const T=l.isMobile(),N=(0,n.sj)({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),j={state:N,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=g.state;if("NONE"===e||"ALL"===t&&!e)return N.recomendedWallets;if(l.isArray(e)){const t={recommendedIds:e.join(",")},{listings:r}=await E(t),n=Object.values(r);n.sort(((t,r)=>e.indexOf(t.id)-e.indexOf(r.id))),N.recomendedWallets=n}else{const e=l.isArray(t),r={page:1,entries:l.RECOMMENDED_WALLET_AMOUNT,version:2,excludedIds:e?t.join(","):void 0},{listings:n}=T?await A(r):await x(r);N.recomendedWallets=Object.values(n)}return N.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var r in t||(t={}))S.call(t,r)&&M(e,r,t[r]);if(O)for(var r of O(t))k.call(t,r)&&M(e,r,t[r]);return e})({},e),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=g.state,{recomendedWallets:i}=N;if("ALL"===n)return N.wallets;i.length?t.excludedIds=i.map((e=>e.id)).join(","):l.isArray(r)&&(t.excludedIds=r.join(",")),l.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(","));const{page:o,search:s}=e,{listings:a,total:c}=T?await A(t):await x(t),u=Object.values(a),h=s?"search":"wallets";return N[h]={listings:[...N[h].listings,...u],total:c,page:o??1},{listings:u,total:c}},async getInjectedWallets(){const{listings:e}=await C({}),t=Object.values(e);return N.injectedWallets=t,N.injectedWallets},getWalletImageUrl:e=>I(e),getAssetImageUrl:e=>_(e),resetSearch(){N.search={listings:[],total:0,page:1}}},R=(0,n.sj)({pairingEnabled:!1,pairingUri:"",pairingError:!1}),L={state:R,subscribe:e=>(0,n.Ld)(R,(()=>e(R))),setPairingUri(e){R.pairingUri=e},setPairingError(e){R.pairingError=e},setPairingEnabled(e){R.pairingEnabled=e}},B=(0,n.sj)({open:!1}),$={state:B,subscribe:e=>(0,n.Ld)(B,(()=>e(B))),open:async e=>new Promise((t=>{const{isUiLoaded:r,isDataLoaded:n,isPreferInjected:i,selectedChain:o}=f.state,{isConnected:a}=b.state,{enableNetworkView:l}=g.state;if(L.setPairingEnabled(!0),null!=e&&e.route)c.reset(e.route);else if(a)c.reset("Account");else if(l)c.reset("SelectNetwork");else{if(i)return s.client().connectConnector("injected",o?.id).catch((e=>console.error(e))),void t();c.reset("ConnectWallet")}const{pairingUri:u}=L.state;if(r&&n&&(u||a))B.open=!0,t();else{const e=setInterval((()=>{const r=f.state,n=L.state;r.isUiLoaded&&r.isDataLoaded&&(n.pairingUri||a)&&(clearInterval(e),B.open=!0,t())}),200)}})),close(){B.open=!1}};var U=Object.defineProperty,D=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,F=(e,t,r)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const H=(0,n.sj)({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),q={state:H,subscribe:e=>(0,n.Ld)(H,(()=>e(H))),setThemeConfig(e){const{themeMode:t,themeVariables:r}=e;t&&(H.themeMode=t),r&&(H.themeVariables=((e,t)=>{for(var r in t||(t={}))z.call(t,r)&&F(e,r,t[r]);if(D)for(var r of D(t))W.call(t,r)&&F(e,r,t[r]);return e})({},r))}},V=(0,n.sj)({open:!1,message:"",variant:"success"}),G={state:V,subscribe:e=>(0,n.Ld)(V,(()=>e(V))),openToast(e,t){V.open=!0,V.message=e,V.variant=t},closeToast(){V.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=i.lW),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window))},8416:(e,t,r)=>{"use strict";r.r(t),r.d(t,{W3mAccountButton:()=>bt,W3mConnectButton:()=>Vt,W3mCoreButton:()=>tr,W3mModal:()=>dr,W3mNetworkSwitch:()=>wr,W3mQrCode:()=>Ie});var n=r(9392),i=r(7408),o=r(1475),s=r(623),a=r(3692),c=r(4213),l=r(2592),u=Object.defineProperty,h=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))d.call(t,r)&&f(e,r,t[r]);if(h)for(var r of h(t))p.call(t,r)&&f(e,r,t[r]);return e};const g={getPreset:e=>({"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)","--w3m-overlay-background-color":"rgba(0, 0, 0, 0.3)","--w3m-overlay-backdrop-filter":"none"}[e]),setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=o.ThemeCtrl.state;if(e){const r=m(m(m(m({},function(){var e;const t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[null!=(e=o.ThemeCtrl.state.themeMode)?e:"dark"];return{"--w3m-color-fg-1":t.foreground[1],"--w3m-color-fg-2":t.foreground[2],"--w3m-color-fg-3":t.foreground[3],"--w3m-color-bg-1":t.background[1],"--w3m-color-bg-2":t.background[2],"--w3m-color-bg-3":t.background[3],"--w3m-color-overlay":t.overlay}}()),{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)","--w3m-overlay-background-color":"rgba(0, 0, 0, 0.3)","--w3m-overlay-backdrop-filter":"none"}),t),function(){const{themeVariables:e}=o.ThemeCtrl.state;return{"--w3m-background-image-url":null!=e&&e["--w3m-background-image-url"]?`url(${e["--w3m-background-image-url"]})`:"none"}}());Object.entries(r).forEach((([t,r])=>e.style.setProperty(t,r)))}},globalCss:n.iv`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},w=n.iv`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}button:disabled{opacity:.7}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?v(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&b(t,r,o),o};let x=class extends n.oi{constructor(){super(...arguments),this.icon=void 0,this.label="",this.loading=!1,this.onClick=()=>null}render(){return n.dy``}};x.styles=[g.globalCss,w],y([(0,i.Cb)()],x.prototype,"icon",2),y([(0,i.Cb)()],x.prototype,"label",2),y([(0,i.Cb)()],x.prototype,"loading",2),y([(0,i.Cb)()],x.prototype,"onClick",2),x=y([(0,i.Mo)("w3m-box-button")],x);const A=n.iv`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var C=Object.defineProperty,E=Object.getOwnPropertyDescriptor,I=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?E(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&C(t,r,o),o};let _=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"w3m-icon-left":void 0!==this.iconLeft,"w3m-icon-right":void 0!==this.iconRight,"w3m-ghost":"ghost"===this.variant,"w3m-outline":"outline"===this.variant};let t="inverse";return"ghost"===this.variant&&(t="secondary"),"outline"===this.variant&&(t="accent"),n.dy``}};_.styles=[g.globalCss,A],I([(0,i.Cb)()],_.prototype,"disabled",2),I([(0,i.Cb)()],_.prototype,"iconLeft",2),I([(0,i.Cb)()],_.prototype,"iconRight",2),I([(0,i.Cb)()],_.prototype,"onClick",2),I([(0,i.Cb)()],_.prototype,"variant",2),_=I([(0,i.Mo)("w3m-button")],_);const P=n.iv`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var O=Object.defineProperty,S=Object.getOwnPropertyDescriptor,k=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?S(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&O(t,r,o),o};let M=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"w3m-secondary":"secondary"===this.variant};return n.dy``}};M.styles=[g.globalCss,P],k([(0,i.Cb)()],M.prototype,"disabled",2),k([(0,i.Cb)()],M.prototype,"variant",2),M=k([(0,i.Mo)("w3m-button-big")],M);const T=n.iv`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let N=class extends n.oi{render(){return n.dy`
`}};N.styles=[g.globalCss,T],N=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-info-footer")],N);const j={CROSS_ICON:a.YP``,WALLET_CONNECT_LOGO:a.YP``,WALLET_CONNECT_ICON:a.YP``,WALLET_CONNECT_ICON_COLORED:a.YP``,BACK_ICON:a.YP``,COPY_ICON:a.YP``,RETRY_ICON:a.YP``,DESKTOP_ICON:a.YP``,MOBILE_ICON:a.YP``,ARROW_DOWN_ICON:a.YP``,ARROW_UP_RIGHT_ICON:a.YP``,ARROW_RIGHT_ICON:a.YP``,QRCODE_ICON:a.YP``,SCAN_ICON:a.YP``,CHECKMARK_ICON:a.YP``,HELP_ETH_IMG:a.YP``,HELP_PAINTING_IMG:a.YP``,HELP_CHART_IMG:a.YP``,HELP_KEY_IMG:a.YP``,HELP_USER_IMG:a.YP``,HELP_LOCK_IMG:a.YP``,HELP_COMPAS_IMG:a.YP``,HELP_NOUN_IMG:a.YP``,HELP_DAO_IMG:a.YP``,SEARCH_ICON:a.YP``,HELP_ICON:a.YP``,WALLET_ICON:a.YP``,NETWORK_PLACEHOLDER:a.YP``,WALLET_PLACEHOLDER:a.YP``,TOKEN_PLACEHOLDER:a.YP``,ACCOUNT_COPY:a.YP``,ACCOUNT_DISCONNECT:a.YP``,GLOBE_ICON:a.YP``},R=n.iv`.w3m-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var L=Object.defineProperty,B=Object.getOwnPropertyDescriptor,$=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?B(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&L(t,r,o),o};let U=class extends n.oi{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=o.AV.subscribe((e=>{this.isHelp="Help"===e.view}))}disconnectedCallback(){var e;null==(e=this.unsubscribeRouter)||e.call(this)}onHelp(){o.AV.push("Help")}logoTemplate(){var e;const t=null==(e=o.ThemeCtrl.state.themeVariables)?void 0:e["--w3m-logo-image-url"];return t?n.dy``:j.WALLET_CONNECT_LOGO}render(){const e={"w3m-help-active":this.isHelp};return n.dy`
${this.logoTemplate()}
`}};U.styles=[g.globalCss,R],$([(0,i.SB)()],U.prototype,"isHelp",2),U=$([(0,i.Mo)("w3m-modal-backcard")],U);const D=n.iv`main{padding:20px;padding-top:0;width:100%}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let z=class extends n.oi{render(){return n.dy`
`}};z.styles=[g.globalCss,D],z=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-modal-content")],z);const W=n.iv`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let F=class extends n.oi{render(){return n.dy`
`}};F.styles=[g.globalCss,W],F=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-modal-footer")],F);const H=n.iv`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var q=Object.defineProperty,V=Object.getOwnPropertyDescriptor,G=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?V(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&q(t,r,o),o};let K=class extends n.oi{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return n.dy``}actionBtnTemplate(){return n.dy``}render(){const e={"w3m-border":this.border},t=o.AV.state.history.length>1,r=this.title?n.dy`${this.title}`:n.dy``;return n.dy`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};K.styles=[g.globalCss,H],G([(0,i.Cb)()],K.prototype,"title",2),G([(0,i.Cb)()],K.prototype,"onAction",2),G([(0,i.Cb)()],K.prototype,"actionIcon",2),G([(0,i.Cb)()],K.prototype,"border",2),K=G([(0,i.Mo)("w3m-modal-header")],K);const Z={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"},Q={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}},Y={externalWallets(){let e=o.Id.client().getConnectors();return e=e.filter((e=>"injected"!==e.id)),e},manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=o.ConfigCtrl.state,i=null==(e=Y.recentWallet())?void 0:e.id,s=o.zv.isMobile()?r:n,a=s?.filter((e=>i!==e.id));return null!=(t=o.zv.isMobile()?a?.map((({id:e,name:t,links:r})=>({id:e,name:t,mobile:r,links:r}))):a?.map((({id:e,name:t,links:r})=>({id:e,name:t,desktop:r,links:r}))))?t:[]},installedInjectedWallets(){if(!o.Id.client().isInjectedProviderInstalled())return[];const{namespace:e}=o.Id.client(),{injectedWallets:t}=o.ExplorerCtrl.state;let r=t.filter((({injected:t})=>Boolean(t.some((t=>o.Id.client().safeCheckInjectedProvider(t.injected_id)&&t.namespace===e)))));return r.length>1&&(r=r.filter((({injected:e})=>{const t=e.map((({injected_id:e})=>e));return Boolean(t.every((e=>"isMetaMask"!==e)))}))),r.length?r:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:t}=o.ConfigCtrl.state,r=o.zv.isMobile();if("ALL"===e||r)return[];const{namespace:n}=o.Id.client(),{injectedWallets:i}=o.ExplorerCtrl.state;return i.filter((({id:r,injected:i})=>{const s=o.zv.isArray(e)?e:[],a=o.zv.isArray(t)?t:[];return Boolean(i.some((e=>e.namespace===n&&!s.includes(r)&&!a.includes(r))))}))},recentWallet:()=>J.getRecentWallet(),recomendedWallets(e=!1){var t;const r=[...Y.installedInjectedWallets().map((({id:e})=>e)),e||null==(t=Y.recentWallet())?void 0:t.id],{recomendedWallets:n}=o.ExplorerCtrl.state;return n.filter((e=>!r.includes(e.id)))}},J={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_INFO:"W3M_RECENT_WALLET_INFO",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",WAGMI_WALLET:"wagmi.wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=o.ConfigCtrl.state;return null!=r&&r[e]?r[e]:t?o.ExplorerCtrl.getWalletImageUrl(t):""},getWalletName:(e,t=!1)=>t?e.split(" ")[0]:e,getChainIcon(e){var t;const r=Z[e],{projectId:n,chainImages:i}=o.ConfigCtrl.state;return null!=(t=i?.[e])?t:n&&r?o.ExplorerCtrl.getAssetImageUrl(r):""},getTokenIcon(e){var t,r;const n=null==(t=Q[e])?void 0:t.icon,{projectId:i,tokenImages:s}=o.ConfigCtrl.state;return null!=(r=s?.[e])?r:i&&n?o.ExplorerCtrl.getAssetImageUrl(n):""},isMobileAnimation:()=>window.innerWidth<=J.MOBILE_BREAKPOINT,async preloadImage(e){const t=new Promise(((t,r)=>{const n=new Image;n.onload=t,n.onerror=r,n.src=e}));return Promise.race([t,o.zv.wait(3e3)])},getErrorMessage:e=>e instanceof Error?e.message:"Unknown Error",debounce(e,t=500){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout((function(){e(...n)}),t)}},handleMobileLinking(e){const{pairingUri:t}=o.WcConnectionCtrl.state,{mobile:r,name:n}=e,i=r?.native,s=r?.universal;J.setRecentWallet(e),function(e){let t="";i?t=o.zv.formatUniversalUrl(i,e,n):s&&(t=o.zv.formatNativeUrl(s,e,n)),o.zv.openHref(t,"_self")}(t)},handleAndroidLinking(){const{pairingUri:e}=o.WcConnectionCtrl.state;o.zv.setWalletConnectAndroidDeepLink(e),o.zv.openHref(e,"_self")},async handleUriCopy(){try{const{pairingUri:e}=o.WcConnectionCtrl.state;await navigator.clipboard.writeText(e),o.ToastCtrl.openToast("Link copied","success")}catch{o.ToastCtrl.openToast("Failed to copy","error")}},async handleConnectorConnection(e,t){try{const{selectedChain:t}=o.OptionsCtrl.state;await o.Id.client().connectConnector(e,t?.id),o.jb.close()}catch(e){console.error(e),t?t():o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}},getCustomImageUrls(){const{chainImages:e,walletImages:t}=o.ConfigCtrl.state,r=Object.values(e??{}),n=Object.values(t??{});return Object.values([...r,...n])},truncate:(e,t=8)=>e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`,generateAvatarColors(e){var t;const r=null==(t=e.match(/.{1,7}/g))?void 0:t.splice(0,5),n=[];r?.forEach((e=>{let t=0;for(let r=0;r>8*e&255;r[e]=n}n.push(`rgb(${r[0]}, ${r[1]}, ${r[2]})`)}));const i=document.querySelector(":root");if(i){const e={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(e).forEach((([e,t])=>i.style.setProperty(e,t)))}},setRecentWallet(e){try{localStorage.setItem(J.W3M_RECENT_WALLET_INFO,JSON.stringify(e))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const e=localStorage.getItem(J.W3M_RECENT_WALLET_INFO);return e?JSON.parse(e):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes:(e,t)=>e.toUpperCase().includes(t.toUpperCase()),openWalletExplorerUrl(){o.zv.openHref(J.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:e,desktop:t,mobile:r,injected:n}=o.zv.getWalletRouterData(),i=Y.installedInjectedWallets(),s=Boolean(n?.length),a=i.some((t=>t.id===e)),c=Boolean(t?.native),l=Boolean(t?.universal);return{isInjectedInstalled:a,isInjected:s,isDesktop:c,isMobile:Boolean(r?.native)||Boolean(r?.universal),isWeb:l}},goToConnectingView(e){o.AV.setData({Wallet:e});const t=o.zv.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:s}=J.getCachedRouterWalletPlatforms();t?s?o.AV.push("InjectedConnecting"):i?o.AV.push("MobileConnecting"):n?o.AV.push("WebConnecting"):o.AV.push("InstallWallet"):s?o.AV.push("InjectedConnecting"):r?o.AV.push("DesktopConnecting"):n?o.AV.push("WebConnecting"):i?o.AV.push("MobileQrcodeConnecting"):o.AV.push("InstallWallet")},getWagmiWalletType:()=>localStorage.getItem(J.WAGMI_WALLET)},X=n.iv`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,re=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?te(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ee(t,r,o),o};let ne=class extends n.oi{constructor(){super(),this.view=o.AV.state.view,this.prevView=o.AV.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=o.AV.subscribe((e=>{this.view!==e.view&&this.onChangeRoute()}))}firstUpdated(){this.resizeObserver=new ResizeObserver((([e])=>{const t=`${e.contentRect.height}px`;"0px"!==this.oldHeight&&(0,c.j)(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t})),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;null==(e=this.unsubscribe)||e.call(this),null==(t=this.resizeObserver)||t.disconnect()}get routerEl(){return J.getShadowRootElement(this,".w3m-router")}get contentEl(){return J.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return n.dy``;case"SelectNetwork":return n.dy``;case"InjectedConnecting":return n.dy``;case"DesktopConnecting":return n.dy``;case"MobileConnecting":return n.dy``;case"WebConnecting":return n.dy``;case"MobileQrcodeConnecting":return n.dy``;case"GetWallet":return n.dy``;case"WalletExplorer":return n.dy``;case"Qrcode":return n.dy``;case"Help":return n.dy``;case"Account":return n.dy``;case"SwitchNetwork":return n.dy``;case"InstallWallet":return n.dy``;default:return n.dy`
Not Found
`}}async onChangeRoute(){await(0,c.j)(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=o.AV.state.view,(0,c.j)(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return n.dy`
${this.viewTemplate()}
`}};ne.styles=[g.globalCss,X],re([(0,i.SB)()],ne.prototype,"view",2),re([(0,i.SB)()],ne.prototype,"prevView",2),ne=re([(0,i.Mo)("w3m-modal-router")],ne);const ie=n.iv`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var oe=Object.defineProperty,se=Object.getOwnPropertyDescriptor,ae=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?se(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&oe(t,r,o),o};let ce=class extends n.oi{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=o.ToastCtrl.subscribe((e=>{e.open?(this.open=!0,this.timeout=setTimeout((()=>o.ToastCtrl.closeToast()),2200)):(this.open=!1,clearTimeout(this.timeout))}))}disconnectedCallback(){var e;null==(e=this.unsubscribe)||e.call(this),clearTimeout(this.timeout),o.ToastCtrl.closeToast()}render(){const{message:e,variant:t}=o.ToastCtrl.state,r={"w3m-success":"success"===t,"w3m-error":"error"===t};return this.open?n.dy`
${"success"===t?j.CHECKMARK_ICON:null} ${"error"===t?j.CROSS_ICON:null}${e}
`:null}};ce.styles=[g.globalCss,ie],ae([(0,i.SB)()],ce.prototype,"open",2),ce=ae([(0,i.Mo)("w3m-modal-toast")],ce);const le=n.iv`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var ue=Object.defineProperty,he=Object.getOwnPropertyDescriptor,de=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?he(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&ue(t,r,o),o};let pe=class extends n.oi{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const e={"w3m-unsupported":this.unsupported};return n.dy``}};pe.styles=[g.globalCss,le],de([(0,i.Cb)()],pe.prototype,"onClick",2),de([(0,i.Cb)()],pe.prototype,"name",2),de([(0,i.Cb)()],pe.prototype,"chainId",2),de([(0,i.Cb)()],pe.prototype,"unsupported",2),pe=de([(0,i.Mo)("w3m-network-button")],pe);const fe=n.iv`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}image{clip-path:path('M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z')}`;var me=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,we=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ge(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&me(t,r,o),o};let be=class extends n.oi{constructor(){super(...arguments),this.chainId=""}render(){const e=J.getChainIcon(this.chainId);return e?n.dy``:n.dy`${j.NETWORK_PLACEHOLDER}`}};function ve(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}be.styles=[g.globalCss,fe],we([(0,i.Cb)()],be.prototype,"chainId",2),be=we([(0,i.Mo)("w3m-network-image")],be);const ye={generate(e,t,r){const i="#141414",o=[],s=function(e,t){const r=Array.prototype.slice.call(l.create(e,{errorCorrectionLevel:"Q"}).modules.data,0),n=Math.sqrt(r.length);return r.reduce(((e,t,r)=>(r%n==0?e.push([t]):e[e.length-1].push(t))&&e),[])}(e),a=t/s.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach((({x:e,y:t})=>{const r=(s.length-7)*a*e,l=(s.length-7)*a*t;for(let e=0;e`)}}));const u=Math.floor((r+25)/a),h=s.length/2-u/2,d=s.length/2+u/2-1,p=[];s.forEach(((e,t)=>{e.forEach(((e,r)=>{if(s[t][r]&&!(t<7&&r<7||t>s.length-8&&r<7||t<7&&r>s.length-8)&&!(t>h&&th&&r{f[e]?f[e].push(t):f[e]=[t]})),Object.entries(f).map((([e,t])=>{const r=t.filter((e=>t.every((t=>!ve(e,t,a)))));return[Number(e),r]})).forEach((([e,t])=>{t.forEach((t=>{o.push(n.YP``)}))})),Object.entries(f).filter((([e,t])=>t.length>1)).map((([e,t])=>{const r=t.filter((e=>t.some((t=>ve(e,t,a)))));return[Number(e),r]})).map((([e,t])=>{t.sort(((e,t)=>et.some((t=>ve(e,t,a)))));t?t.push(e):r.push([e])}return[e,r.map((e=>[e[0],e[e.length-1]]))]})).forEach((([e,t])=>{t.forEach((([t,r])=>{o.push(n.YP``)}))})),o}},xe=n.iv`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.w3m-dark{background-color:#fff;border-radius:var(--w3m-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var Ae=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ce(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ae(t,r,o),o};let Ie=class extends n.oi{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e="light"===o.ThemeCtrl.state.themeMode?this.size:this.size-36;return n.YP`${ye.generate(this.uri,e,e/4)}`}render(){const e={"w3m-dark":"dark"===o.ThemeCtrl.state.themeMode};return n.dy`
${this.walletId||this.imageUrl?n.dy``:j.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};Ie.styles=[g.globalCss,xe],Ee([(0,i.Cb)()],Ie.prototype,"uri",2),Ee([(0,i.Cb)({type:Number})],Ie.prototype,"size",2),Ee([(0,i.Cb)()],Ie.prototype,"imageId",2),Ee([(0,i.Cb)()],Ie.prototype,"walletId",2),Ee([(0,i.Cb)()],Ie.prototype,"imageUrl",2),Ie=Ee([(0,i.Mo)("w3m-qrcode")],Ie);const _e=n.iv`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var Pe=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Se=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Oe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Pe(t,r,o),o};let ke=class extends n.oi{constructor(){super(...arguments),this.onChange=()=>null}render(){return n.dy` ${j.SEARCH_ICON}`}};ke.styles=[g.globalCss,_e],Se([(0,i.Cb)()],ke.prototype,"onChange",2),ke=Se([(0,i.Mo)("w3m-search-input")],ke);const Me=n.iv`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}:host{width:100%;height:100%;display:flex;justify-content:center;align-items:center}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite}.accent{stroke:var(--w3m-accent-color)}.fill{stroke:var(--w3m-accent-fill-color)}`;var Te=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,je=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ne(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Te(t,r,o),o};let Re=class extends n.oi{constructor(){super(...arguments),this.color="accent",this.size=24}render(){return n.dy``}};Re.styles=[g.globalCss,Me],je([(0,i.Cb)()],Re.prototype,"color",2),je([(0,i.Cb)({type:Number})],Re.prototype,"size",2),Re=je([(0,i.Mo)("w3m-spinner")],Re);const Le=n.iv`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:var(--w3m-font-feature-settings)}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var Be=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,Ue=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?$e(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Be(t,r,o),o};let De=class extends n.oi{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"w3m-big-bold":"big-bold"===this.variant,"w3m-medium-regular":"medium-regular"===this.variant,"w3m-small-regular":"small-regular"===this.variant,"w3m-small-thin":"small-thin"===this.variant,"w3m-xsmall-regular":"xsmall-regular"===this.variant,"w3m-xsmall-bold":"xsmall-bold"===this.variant,"w3m-color-primary":"primary"===this.color,"w3m-color-secondary":"secondary"===this.color,"w3m-color-tertiary":"tertiary"===this.color,"w3m-color-inverse":"inverse"===this.color,"w3m-color-accnt":"accent"===this.color,"w3m-color-error":"error"===this.color};return n.dy``}};De.styles=[g.globalCss,Le],Ue([(0,i.Cb)()],De.prototype,"variant",2),Ue([(0,i.Cb)()],De.prototype,"color",2),De=Ue([(0,i.Mo)("w3m-text")],De);const ze=n.iv`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var We=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,He=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Fe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&We(t,r,o),o};let qe=class extends n.oi{constructor(){super(...arguments),this.symbol=void 0}render(){var e;const t=J.getTokenIcon(null!=(e=this.symbol)?e:"");return t?n.dy`
${this.id}
`:j.TOKEN_PLACEHOLDER}};qe.styles=[g.globalCss,ze],He([(0,i.Cb)()],qe.prototype,"symbol",2),qe=He([(0,i.Mo)("w3m-token-image")],qe);const Ve=n.iv`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var Ge=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,Ze=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ke(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ge(t,r,o),o};let Qe=class extends n.oi{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?n.dy`RECENT`:this.installed?n.dy`INSTALLED`:null}handleClick(){o.uA.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return n.dy``}};Qe.styles=[g.globalCss,Ve],Ze([(0,i.Cb)()],Qe.prototype,"onClick",2),Ze([(0,i.Cb)()],Qe.prototype,"name",2),Ze([(0,i.Cb)()],Qe.prototype,"walletId",2),Ze([(0,i.Cb)()],Qe.prototype,"label",2),Ze([(0,i.Cb)()],Qe.prototype,"imageId",2),Ze([(0,i.Cb)()],Qe.prototype,"installed",2),Ze([(0,i.Cb)()],Qe.prototype,"recent",2),Qe=Ze([(0,i.Mo)("w3m-wallet-button")],Qe);const Ye=n.iv`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var Je=Object.defineProperty,Xe=Object.getOwnPropertyDescriptor,et=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Xe(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Je(t,r,o),o};let tt=class extends n.oi{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=null!=(e=this.imageUrl)&&e.length?this.imageUrl:J.getWalletIcon({id:this.walletId,image_id:this.imageId});return n.dy`${t.length?n.dy`
${this.id}
`:j.WALLET_PLACEHOLDER}`}};tt.styles=[g.globalCss,Ye],et([(0,i.Cb)()],tt.prototype,"walletId",2),et([(0,i.Cb)()],tt.prototype,"imageId",2),et([(0,i.Cb)()],tt.prototype,"imageUrl",2),tt=et([(0,i.Mo)("w3m-wallet-image")],tt);Object.defineProperty,Object.getOwnPropertyDescriptor;let rt=class extends n.oi{constructor(){super(),this.unwatchAccount=void 0,o.AccountCtrl.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=o.Id.client().watchAccount((e=>{const{address:t,isConnected:r}=o.AccountCtrl.state;e.isConnected&&e.address!==t&&(this.fetchProfile(e.address),this.fetchBalance(e.address),o.AccountCtrl.setAddress(e.address)),e.isConnected||o.AccountCtrl.resetAccount(),r!==e.isConnected&&o.jb.close(),!r&&e.isConnected?o.uA.track({name:"ACCOUNT_CONNECTED"}):r&&!e.isConnected&&o.uA.track({name:"ACCOUNT_DISCONNECTED"}),o.AccountCtrl.setIsConnected(e.isConnected)}))}disconnectedCallback(){var e;null==(e=this.unwatchAccount)||e.call(this)}async fetchProfile(e){var t;const r=null==(t=o.OptionsCtrl.state.chains)?void 0:t.find((e=>1===e.id));if(o.ConfigCtrl.state.enableAccountView&&r)try{await o.AccountCtrl.fetchProfile(J.preloadImage,e)}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}}async fetchBalance(e){if(o.ConfigCtrl.state.enableAccountView)try{await o.AccountCtrl.fetchBalance(e)}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}}};rt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-account-context")],rt);var nt=Object.defineProperty,it=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?it(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&nt(t,r,o),o};let st=class extends n.oi{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{null!=e&&e.length&&await Promise.all(e.map((async e=>J.preloadImage(e))))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){var e;if(o.ConfigCtrl.state.enableExplorer){const{chains:t}=o.OptionsCtrl.state;await Promise.all([o.ExplorerCtrl.getRecomendedWallets(),o.ExplorerCtrl.getInjectedWallets()]),o.OptionsCtrl.setIsDataLoaded(!0);const{recomendedWallets:r}=o.ExplorerCtrl.state,n=Y.installedInjectedWallets(),i=null!=(e=t?.map((e=>J.getChainIcon(e.id))))?e:[],s=r.map((e=>J.getWalletIcon(e))),a=n.map((e=>J.getWalletIcon(e)));await this.loadImages([...i,...s,...a])}else o.OptionsCtrl.setIsDataLoaded(!0)}async preloadCustomImages(){const e=J.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),o.ToastCtrl.openToast("Failed preloading","error")}}};ot([(0,i.SB)()],st.prototype,"preload",2),st=ot([(0,i.Mo)("w3m-explorer-context")],st);var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ct(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&at(t,r,o),o};let ut=class extends n.oi{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const e=o.OptionsCtrl.getSelectedChain();this.activeChainId=e?.id,this.unwatchNetwork=o.Id.client().watchNetwork((e=>{const t=e.chain;t&&this.activeChainId!==t.id&&(o.OptionsCtrl.setSelectedChain(t),this.activeChainId=t.id,o.AccountCtrl.resetBalance(),this.fetchBalance())}))}disconnectedCallback(){var e;null==(e=this.unwatchNetwork)||e.call(this)}async fetchBalance(){if(o.ConfigCtrl.state.enableAccountView)try{await o.AccountCtrl.fetchBalance()}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}}};lt([(0,i.SB)()],ut.prototype,"activeChainId",2),ut=lt([(0,i.Mo)("w3m-network-context")],ut);Object.defineProperty,Object.getOwnPropertyDescriptor;let ht=class extends n.oi{constructor(){super(),this.unsubscribeTheme=void 0,g.setTheme(),this.unsubscribeTheme=o.ThemeCtrl.subscribe(g.setTheme),this.preloadThemeImages()}disconnectedCallback(){var e;null==(e=this.unsubscribeTheme)||e.call(this)}async preloadThemeImages(){try{const{themeVariables:e}=o.ThemeCtrl.state,t=[e?.["--w3m-background-image-url"],e?.["--w3m-logo-image-url"]].filter(Boolean);t.length&&await Promise.all(t.map((async e=>J.preloadImage(e))))}catch{console.info("Unsuccessful attempt at preloading some images")}}};ht=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-theme-context")],ht);var dt;Object.defineProperty,Object.getOwnPropertyDescriptor;let pt=class extends n.oi{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.unwatchWcConnection=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=null==(dt=o.OptionsCtrl.state.selectedChain)?void 0:dt.id,this.isAccountConnected=o.AccountCtrl.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=o.OptionsCtrl.subscribe((e=>{var t,r;(null==(t=e.selectedChain)?void 0:t.id)!==this.selectedChainId&&(this.selectedChainId=null==(r=e.selectedChain)?void 0:r.id,this.connectAndWait())})),this.unwatchAccount=o.AccountCtrl.subscribe((e=>{(this.isAccountConnected!==e.isConnected||!this.isGenerated)&&(this.isAccountConnected=e.isConnected,this.connectAndWait())})),this.unwatchWcConnection=o.WcConnectionCtrl.subscribe((e=>{e.pairingEnabled&&!this.isGenerated&&this.connectAndWait()}))}disconnectedCallback(){var e,t,r;null==(e=this.unwatchOptions)||e.call(this),null==(t=this.unwatchAccount)||t.call(this),null==(r=this.unwatchWcConnection)||r.call(this)}async connectAndWait(){const{pairingEnabled:e}=o.WcConnectionCtrl.state;if(clearTimeout(this.timeout),!this.isAccountConnected&&e){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),24e4);try{const{selectedChain:e}=o.OptionsCtrl.state;await o.Id.client().connectWalletConnect((e=>o.WcConnectionCtrl.setPairingUri(e)),e?.id)}catch(e){console.error(e),o.WcConnectionCtrl.setPairingError(!0),o.ToastCtrl.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=1e3&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};pt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-wc-connection-context")],pt);const ft=n.iv`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var mt=Object.defineProperty,gt=Object.getOwnPropertyDescriptor,wt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?gt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&mt(t,r,o),o};let bt=class extends n.oi{constructor(){super(),this.balance="hide",this.avatar="show"}onOpen(){o.uA.click({name:"ACCOUNT_BUTTON"}),o.jb.open({route:"Account"})}accountTemplate(){const e="show"===this.avatar;return n.dy`${e?n.dy``:null}`}render(){const e="show"===this.balance,t={"w3m-no-avatar":"hide"===this.avatar};return e?n.dy`
`:n.dy`${this.accountTemplate()}`}};bt.styles=[g.globalCss,ft],wt([(0,i.Cb)()],bt.prototype,"balance",2),wt([(0,i.Cb)()],bt.prototype,"avatar",2),bt=wt([(0,i.Mo)("w3m-account-button")],bt);const vt=n.iv`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var yt=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,At=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?xt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&yt(t,r,o),o};let Ct=class extends n.oi{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:e}=o.OptionsCtrl.state;this.chainId=e?.id,this.label=e?.name,this.unsubscribeNetwork=o.OptionsCtrl.subscribe((({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name}))}disconnectedCallback(){var e;null==(e=this.unsubscribeNetwork)||e.call(this)}onClick(){o.AV.push("SelectNetwork")}render(){const{chains:e,selectedChain:t}=o.OptionsCtrl.state,r=e?.map((e=>e.id)),i=t&&r?.includes(t.id),s=e&&e.length<=1&&i;return n.dy``}};Ct.styles=[g.globalCss,vt],At([(0,i.SB)()],Ct.prototype,"chainId",2),At([(0,i.SB)()],Ct.prototype,"label",2),Ct=At([(0,i.Mo)("w3m-account-network-button")],Ct);const Et=n.iv`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var It=Object.defineProperty,_t=Object.getOwnPropertyDescriptor,Pt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?_t(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&It(t,r,o),o};let Ot=class extends n.oi{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=o.AccountCtrl.state.address,this.name=o.AccountCtrl.state.profileName,this.loading=Boolean(o.AccountCtrl.state.profileLoading),this.unsubscribeAccount=o.AccountCtrl.subscribe((({address:e,profileName:t,profileLoading:r})=>{this.address=e,this.name=t,this.loading=Boolean(r)}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){var e;const t="button"===this.variant,r={"w3m-loading":this.loading};return n.dy`${this.name?this.name:J.truncate(null!=(e=this.address)?e:"")}`}};Ot.styles=[g.globalCss,Et],Pt([(0,i.SB)()],Ot.prototype,"address",2),Pt([(0,i.SB)()],Ot.prototype,"name",2),Pt([(0,i.SB)()],Ot.prototype,"loading",2),Pt([(0,i.Cb)()],Ot.prototype,"variant",2),Ot=Pt([(0,i.Mo)("w3m-address-text")],Ot);const St={onConnecting(e){J.goToConnectingView(e)},onExternal(e){J.handleConnectorConnection(e)},manualWalletsTemplate(){return Y.manualWallets().map((e=>n.dy``))},recomendedWalletsTemplate(e=!1){return Y.recomendedWallets(e).map((e=>n.dy``))},externalWalletsTemplate(){return Y.externalWallets().map((e=>n.dy``))},recentWalletTemplate(){const e=Y.recentWallet();if(e)return n.dy``},installedInjectedWalletsTemplate(){return Y.installedInjectedWallets().map((e=>n.dy``))},injectedWalletsTemplate(){return Y.injectedWallets().map((e=>n.dy``))}},kt=n.iv`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Mt=class extends n.oi{onGoToQrcode(){o.AV.push("Qrcode")}onGetWallet(){o.AV.push("GetWallet")}render(){const{recomendedWallets:e}=o.ExplorerCtrl.state,t=[...e,...e],r=St.externalWalletsTemplate(),i=St.installedInjectedWalletsTemplate(),s=[...i,...r].length>0,a=2*o.zv.RECOMMENDED_WALLET_AMOUNT;return n.dy`
${j.MOBILE_ICON}WalletConnect
${[...Array(a)].map(((e,r)=>{const i=t[r%t.length];return i?n.dy``:j.WALLET_PLACEHOLDER}))}
Select Wallet
${s?n.dy`
${j.WALLET_ICON}Other
${i} ${r}
`:null}${"Choose WalletConnect to see supported apps on your device"+(s?", or select from other options":"")}I don't have a wallet`}};Mt.styles=[g.globalCss,kt],Mt=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-android-wallet-selection")],Mt);const Tt=n.iv`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var Nt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,Rt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?jt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Nt(t,r,o),o};let Lt=class extends n.oi{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=o.AccountCtrl.state.address,this.avatar=o.AccountCtrl.state.profileAvatar,this.loading=Boolean(o.AccountCtrl.state.profileLoading),this.unsubscribeAccount=o.AccountCtrl.subscribe((({address:e,profileAvatar:t,profileLoading:r})=>{this.address=e,this.avatar=t,this.loading=Boolean(r)}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){const e={"w3m-placeholder":!0,"w3m-small":"small"===this.size,"w3m-medium":"medium"===this.size};return this.avatar?n.dy``:this.address?(J.generateAvatarColors(this.address),n.dy`
${this.loading?n.dy`
`:null}
`):null}};Lt.styles=[g.globalCss,Tt],Rt([(0,i.SB)()],Lt.prototype,"address",2),Rt([(0,i.SB)()],Lt.prototype,"avatar",2),Rt([(0,i.SB)()],Lt.prototype,"loading",2),Rt([(0,i.Cb)()],Lt.prototype,"size",2),Lt=Rt([(0,i.Mo)("w3m-avatar")],Lt);const Bt=n.iv`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var $t=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Dt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ut(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&$t(t,r,o),o};let zt=class extends n.oi{constructor(){var e,t;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=null==(e=o.AccountCtrl.state.balance)?void 0:e.symbol,this.amount=null==(t=o.AccountCtrl.state.balance)?void 0:t.amount,this.unsubscribeAccount=o.AccountCtrl.subscribe((({balance:e})=>{this.symbol=e?.symbol,this.amount=e?.amount}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){let e="_._";return"0.0"===this.amount?e="0":"string"==typeof this.amount&&this.amount.length>6?e=this.amount.substring(0,6):"string"==typeof this.amount&&(e=this.amount),n.dy`
${e} ${this.symbol}
`}};zt.styles=[g.globalCss,Bt],Dt([(0,i.SB)()],zt.prototype,"symbol",2),Dt([(0,i.SB)()],zt.prototype,"amount",2),zt=Dt([(0,i.Mo)("w3m-balance")],zt);const Wt=n.iv`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var Ft=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,qt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ht(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Ft(t,r,o),o};let Vt=class extends n.oi{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,this.modalUnsub=o.jb.subscribe((e=>{e.open&&(this.loading=!0),e.open||(this.loading=!1)}))}disconnectedCallback(){var e;null==(e=this.modalUnsub)||e.call(this)}iconTemplate(){return"show"===this.icon?j.WALLET_CONNECT_ICON:null}onClick(){o.AccountCtrl.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,o.uA.click({name:"CONNECT_BUTTON"}),await o.jb.open(),o.jb.state.open||(this.loading=!1)}async onDisconnect(){o.uA.click({name:"DISCONNECT_BUTTON"}),await o.Id.client().disconnect()}render(){return n.dy`${this.loading?n.dy`Connecting...`:n.dy`${this.iconTemplate()}${this.label}`}`}};Vt.styles=[g.globalCss,Wt],qt([(0,i.SB)()],Vt.prototype,"loading",2),qt([(0,i.Cb)()],Vt.prototype,"label",2),qt([(0,i.Cb)()],Vt.prototype,"icon",2),Vt=qt([(0,i.Mo)("w3m-connect-button")],Vt);const Gt=n.iv`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var Kt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Qt=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Zt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Kt(t,r,o),o};let Yt=class extends n.oi{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=null!=(t=null==(e=o.ThemeCtrl.state.themeVariables)?void 0:e["--w3m-wallet-icon-large-border-radius"])?t:g.getPreset("--w3m-wallet-icon-large-border-radius");let i=0;i=r.includes("%")?.88*parseInt(r,10):parseInt(r,10),i*=1.17;const s=317-1.57*i,a=425-1.8*i;return n.dy``}render(){const e={"w3m-error":this.isError,"w3m-stale":this.isStale};return n.dy`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};Yt.styles=[g.globalCss,Gt],Qt([(0,i.Cb)()],Yt.prototype,"walletId",2),Qt([(0,i.Cb)()],Yt.prototype,"imageId",2),Qt([(0,i.Cb)()],Yt.prototype,"isError",2),Qt([(0,i.Cb)()],Yt.prototype,"isStale",2),Qt([(0,i.Cb)()],Yt.prototype,"label",2),Yt=Qt([(0,i.Mo)("w3m-connector-waiting")],Yt);var Jt=Object.defineProperty,Xt=Object.getOwnPropertyDescriptor,er=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Xt(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Jt(t,r,o),o};let tr=class extends n.oi{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,this.isConnected=o.AccountCtrl.state.isConnected,this.unsubscribeAccount=o.AccountCtrl.subscribe((({isConnected:e})=>{this.isConnected=e}))}disconnectedCallback(){var e;null==(e=this.unsubscribeAccount)||e.call(this)}render(){const{enableAccountView:e}=o.ConfigCtrl.state,t=this.balance,r=this.label,i=this.icon,s=this.avatar;return this.isConnected&&e?n.dy``:n.dy``}};er([(0,i.SB)()],tr.prototype,"isConnected",2),er([(0,i.Cb)()],tr.prototype,"label",2),er([(0,i.Cb)()],tr.prototype,"icon",2),er([(0,i.Cb)()],tr.prototype,"avatar",2),er([(0,i.Cb)()],tr.prototype,"balance",2),tr=er([(0,i.Mo)("w3m-core-button")],tr);const rr=n.iv`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let nr=class extends n.oi{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=o.ConfigCtrl.state,r="ALL"!==e&&t,i=St.manualWalletsTemplate(),s=St.recomendedWalletsTemplate(),a=St.externalWalletsTemplate(),c=St.recentWalletTemplate();let l=[...St.installedInjectedWalletsTemplate(),c,...a,...i,...s];l=l.filter(Boolean);const u=l.length>4||r;let h=[];h=u?l.slice(0,3):l;const d=Boolean(h.length);return n.dy`
${j.MOBILE_ICON}Mobile
${j.SCAN_ICON}Scan with your wallet
${d?n.dy`
${j.DESKTOP_ICON}Desktop
${h} ${u?n.dy``:null}
`:null}`}};nr.styles=[g.globalCss,rr],nr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-desktop-wallet-selection")],nr);const ir=n.iv`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let or=class extends n.oi{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=o.ConfigCtrl.state;return e??t?n.dy`
By connecting your wallet to this app, you agree to the app's ${e?n.dy`Terms of Service`:null} ${e&&t?"and":null} ${t?n.dy`Privacy Policy`:null}
`:null}};or.styles=[g.globalCss,ir],or=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-legal-notice")],or);const sr=n.iv`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let ar=class extends n.oi{onQrcode(){o.AV.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=o.ConfigCtrl.state,r="ALL"!==e&&t,i=St.manualWalletsTemplate(),s=St.recomendedWalletsTemplate(),a=St.externalWalletsTemplate(),c=St.recentWalletTemplate();let l=[...St.installedInjectedWalletsTemplate(),c,...a,...i,...s];l=l.filter(Boolean);const u=l.length>8||r;let h=[];h=u?l.slice(0,7):l;const d=Boolean(h.length);return n.dy`${d?n.dy`
${h} ${u?n.dy``:null}
`:null}`}};ar.styles=[g.globalCss,sr],ar=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-mobile-wallet-selection")],ar);const cr=n.iv`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--w3m-overlay-background-color);backdrop-filter:var(--w3m-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var lr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,hr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?ur(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&lr(t,r,o),o};let dr=class extends n.oi{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=o.jb.subscribe((e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()}))}disconnectedCallback(){var e;null==(e=this.unsubscribeModal)||e.call(this)}get overlayEl(){return J.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return J.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(e){if(document.querySelector("body"))if(e){const e=document.getElementById("w3m-styles");e?.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(e){e.target===e.currentTarget&&o.jb.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout((async()=>{const e=J.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[0,1]},{delay:.1,duration:.2}).finished,(0,c.j)(this.containerEl,e,{delay:.1,duration:.2}).finished]),this.active=!0}),0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=J.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]};await Promise.all([(0,c.j)(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished,(0,c.j)(this.containerEl,e,{duration:.2}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",(e=>{var t;"Escape"===e.key?o.jb.close():"Tab"===e.key&&(null!=(t=e.target)&&t.tagName.includes("W3M-")||this.containerEl.focus())}),this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;null==(e=this.abortController)||e.abort(),this.abortController=void 0}render(){const e={"w3m-overlay":!0,"w3m-active":this.active};return n.dy`
${this.open?n.dy`
`:null}
`}};dr.styles=[g.globalCss,cr],hr([(0,i.SB)()],dr.prototype,"open",2),hr([(0,i.SB)()],dr.prototype,"active",2),dr=hr([(0,i.Mo)("w3m-modal")],dr);const pr=n.iv`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var fr=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,gr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?mr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&fr(t,r,o),o};let wr=class extends n.oi{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0;const{selectedChain:e}=o.OptionsCtrl.state;this.onSetChainData(e),this.unsubscribeNetwork=o.OptionsCtrl.subscribe((({selectedChain:e})=>{this.onSetChainData(e)}))}disconnectedCallback(){var e;null==(e=this.unsubscribeNetwork)||e.call(this)}onSetChainData(e){if(e){const{chains:t}=o.OptionsCtrl.state,r=t?.map((e=>e.id));this.chainId=e.id.toString(),this.wrongNetwork=!(null!=r&&r.includes(e.id)),this.label=this.wrongNetwork?"Wrong Network":e.name}}onClick(){o.uA.click({name:"NETWORK_BUTTON"}),o.jb.open({route:"SelectNetwork"})}render(){var e;const{chains:t}=o.OptionsCtrl.state,r=t&&t.length>1;return n.dy`${null!=(e=this.label)&&e.length?this.label:"Select Network"}`}};wr.styles=[g.globalCss,pr],gr([(0,i.SB)()],wr.prototype,"chainId",2),gr([(0,i.SB)()],wr.prototype,"label",2),gr([(0,i.SB)()],wr.prototype,"wrongNetwork",2),wr=gr([(0,i.Mo)("w3m-network-switch")],wr);const br=n.iv`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var vr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,xr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?yr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&vr(t,r,o),o};let Ar=class extends n.oi{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return n.dy``}render(){const e={"w3m-error":this.isError};return n.dy`
${this.svgLoaderTemplate()}
${this.isError?"Switch declined":this.label}`}};Ar.styles=[g.globalCss,br],xr([(0,i.Cb)()],Ar.prototype,"chainId",2),xr([(0,i.Cb)()],Ar.prototype,"isError",2),xr([(0,i.Cb)()],Ar.prototype,"label",2),Ar=xr([(0,i.Mo)("w3m-network-waiting")],Ar);const Cr=n.iv`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var Er=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,_r=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Ir(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Er(t,r,o),o};let Pr=class extends n.oi{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){o.zv.isMobile()?o.AV.replace("MobileConnecting"):o.AV.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?o.AV.replace("InjectedConnecting"):o.AV.replace("InstallWallet")}onDesktop(){o.AV.replace("DesktopConnecting")}onWeb(){o.AV.replace("WebConnecting")}render(){return n.dy`
${this.isRetry?n.dy``:null} ${this.isMobile?n.dy`Mobile`:null} ${this.isInjected?n.dy`Browser`:null} ${this.isDesktop?n.dy`Desktop`:null} ${this.isWeb?n.dy`Web`:null}
`}};Pr.styles=[g.globalCss,Cr],_r([(0,i.Cb)()],Pr.prototype,"isMobile",2),_r([(0,i.Cb)()],Pr.prototype,"isInjected",2),_r([(0,i.Cb)()],Pr.prototype,"isInjectedInstalled",2),_r([(0,i.Cb)()],Pr.prototype,"isDesktop",2),_r([(0,i.Cb)()],Pr.prototype,"isWeb",2),_r([(0,i.Cb)()],Pr.prototype,"isRetry",2),Pr=_r([(0,i.Mo)("w3m-platform-selection")],Pr);const Or=n.iv`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Sr=class extends n.oi{onClick(){o.AV.push("WalletExplorer")}render(){const{recomendedWallets:e}=o.ExplorerCtrl.state,t=[...e,...Y.manualWallets()].reverse().slice(0,4);return n.dy``}};Sr.styles=[g.globalCss,Or],Sr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-view-all-wallets-button")],Sr);const kr=n.iv`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var Mr=Object.defineProperty,Tr=Object.getOwnPropertyDescriptor,Nr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Tr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Mr(t,r,o),o};let jr=class extends n.oi{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout((()=>{const{pairingUri:e}=o.WcConnectionCtrl.state;this.uri=e}),0),this.unwatchWcConnection=o.WcConnectionCtrl.subscribe((e=>{e.pairingUri&&(this.uri=e.pairingUri)}))}disconnectedCallback(){var e;null==(e=this.unwatchWcConnection)||e.call(this)}get overlayEl(){return J.getShadowRootElement(this,".w3m-qr-container")}render(){return n.dy`
${this.uri?n.dy``:n.dy``}
`}};jr.styles=[g.globalCss,kr],Nr([(0,i.Cb)()],jr.prototype,"walletId",2),Nr([(0,i.Cb)()],jr.prototype,"imageId",2),Nr([(0,i.SB)()],jr.prototype,"uri",2),jr=Nr([(0,i.Mo)("w3m-walletconnect-qr")],jr);const Rr=n.iv`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var Lr=Object.defineProperty,Br=Object.getOwnPropertyDescriptor,$r=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Br(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Lr(t,r,o),o};let Ur=class extends n.oi{constructor(){super(...arguments),this.loading=!1}async onDisconnect(){this.loading||(this.loading=!0,await o.Id.client().disconnect(),this.loading=!1)}async onCopyAddress(){var e;try{await navigator.clipboard.writeText(null!=(e=o.AccountCtrl.state.address)?e:""),o.ToastCtrl.openToast("Address copied","success")}catch{o.ToastCtrl.openToast("Failed to copy","error")}}render(){return n.dy`
Connected
`}};Ur.styles=[g.globalCss,Rr],$r([(0,i.SB)()],Ur.prototype,"loading",2),Ur=$r([(0,i.Mo)("w3m-account-view")],Ur);Object.defineProperty,Object.getOwnPropertyDescriptor;let Dr=class extends n.oi{viewTemplate(){return o.zv.isAndroid()?n.dy``:o.zv.isMobile()?n.dy``:n.dy``}render(){return n.dy`${this.viewTemplate()}`}};Dr.styles=[g.globalCss],Dr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-connect-wallet-view")],Dr);const zr=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var Wr=Object.defineProperty,Fr=Object.getOwnPropertyDescriptor,Hr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Fr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Wr(t,r,o),o};let qr=class extends n.oi{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=o.WcConnectionCtrl.subscribe((e=>{this.isError=e.pairingError}))}disconnectedCallback(){var e;null==(e=this.unwatchConnection)||e.call(this)}onFormatAndRedirect(e){const{desktop:t,name:r}=o.zv.getWalletRouterData(),n=t?.native;if(n){const t=o.zv.formatNativeUrl(n,e,r);o.zv.openHref(t,"_self")}}openDesktopApp(){o.WcConnectionCtrl.setPairingError(!1);const{pairingUri:e}=o.WcConnectionCtrl.state,t=o.zv.getWalletRouterData();J.setRecentWallet(t),this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isMobile:i,isInjected:s,isWeb:a}=J.getCachedRouterWalletPlatforms();return n.dy`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};qr.styles=[g.globalCss,zr],Hr([(0,i.SB)()],qr.prototype,"isError",2),qr=Hr([(0,i.Mo)("w3m-desktop-connecting-view")],qr);const Vr=n.iv`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Gr=class extends n.oi{onGet(e){o.zv.openHref(e,"_blank")}render(){const e=o.ExplorerCtrl.state.recomendedWallets.slice(0,5),t=Y.manualWallets().slice(0,5),r=e.length,i=t.length;return n.dy`${r?e.map((e=>n.dy`
${e.name}Get
`)):null} ${i?t.map((e=>n.dy`
${e.name}Get
`)):null}
`}};Gr.styles=[g.globalCss,Vr],Gr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-get-wallet-view")],Gr);const Kr=n.iv`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Zr=class extends n.oi{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){o.ConfigCtrl.state.enableExplorer?o.AV.push("GetWallet"):J.openWalletExplorerUrl()}onLearnMore(){o.zv.openHref(this.learnUrl,"_blank")}render(){return n.dy`
${j.HELP_CHART_IMG} ${j.HELP_PAINTING_IMG} ${j.HELP_ETH_IMG}
A home for your digital assetsA wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.
${j.HELP_KEY_IMG} ${j.HELP_USER_IMG} ${j.HELP_LOCK_IMG}
One login for all of web3Log in to any app by connecting your wallet. Say goodbye to countless passwords!
${j.HELP_COMPAS_IMG} ${j.HELP_NOUN_IMG} ${j.HELP_DAO_IMG}
Your gateway to a new webWith your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.
`}};Zr.styles=[g.globalCss,Kr],Zr=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-help-view")],Zr);const Qr=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var Yr=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Xr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Jr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Yr(t,r,o),o};let en=class extends n.oi{constructor(){super(),this.isError=!1,this.connector=o.Id.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:e}=this.connector;e&&(this.isError=!1,await J.handleConnectorConnection("injected",(()=>{this.isError=!0})))}render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isMobile:i,isDesktop:s,isWeb:a}=J.getCachedRouterWalletPlatforms();return n.dy`Connection can be declined if multiple wallets are installed or previous request is still activeRetry`}};en.styles=[g.globalCss,Qr],Xr([(0,i.SB)()],en.prototype,"isError",2),en=Xr([(0,i.Mo)("w3m-injected-connecting-view")],en);const tn=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let rn=class extends n.oi{onInstall(e){e&&o.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:i}=o.zv.getWalletRouterData();return n.dy`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};rn.styles=[g.globalCss,tn],rn=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-install-wallet-view")],rn);const nn=n.iv`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var on=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,an=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?sn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&on(t,r,o),o};let cn=class extends n.oi{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=o.WcConnectionCtrl.subscribe((e=>{this.isError=e.pairingError}))}disconnectedCallback(){var e;null==(e=this.unwatchConnection)||e.call(this)}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=o.zv.getWalletRouterData(),i=r?.native,s=r?.universal;if(i&&!t){const t=o.zv.formatNativeUrl(i,e,n);o.zv.openHref(t,"_self")}else if(s){const t=o.zv.formatUniversalUrl(s,e,n);o.zv.openHref(t,"_self")}}openMobileApp(e=!1){o.WcConnectionCtrl.setPairingError(!1);const{pairingUri:t}=o.WcConnectionCtrl.state,r=o.zv.getWalletRouterData();J.setRecentWallet(r),this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&o.zv.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:i,mobile:s}=o.zv.getWalletRouterData(),{isWeb:a}=J.getCachedRouterWalletPlatforms(),c=i?.ios,l=s?.universal;return n.dy`Retry${l?n.dy`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};cn.styles=[g.globalCss,nn],an([(0,i.SB)()],cn.prototype,"isError",2),cn=an([(0,i.Mo)("w3m-mobile-connecting-view")],cn);const ln=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;Object.defineProperty,Object.getOwnPropertyDescriptor;let un=class extends n.oi{render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isInjected:i,isDesktop:s,isWeb:a}=J.getCachedRouterWalletPlatforms();return n.dy`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};un.styles=[g.globalCss,ln],un=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-mobile-qr-connecting-view")],un);Object.defineProperty,Object.getOwnPropertyDescriptor;let hn=class extends n.oi{render(){return n.dy``}};hn.styles=[g.globalCss],hn=((e,t,r,n)=>{for(var i,o=t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=i(o)||o);return o})([(0,i.Mo)("w3m-qrcode-view")],hn);const dn=n.iv`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var pn=Object.defineProperty,fn=Object.defineProperties,mn=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,wn=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,yn=(e,t,r)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xn=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?mn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&pn(t,r,o),o};let An=class extends n.oi{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await o.Id.client().getConnectedChainIds()}async onSelectChain(e){try{const{selectedChain:t,isPreferInjected:r}=o.OptionsCtrl.state,{isConnected:n}=o.AccountCtrl.state;n?t?.id===e.id?o.AV.reset("Account"):'"walletConnect"'===J.getWagmiWalletType()?(await o.Id.client().switchNetwork({chainId:e.id}),o.AV.reset("Account")):o.AV.push("SwitchNetwork",{SwitchNetwork:e}):r?(o.OptionsCtrl.setSelectedChain(e),o.jb.close()):(o.OptionsCtrl.setSelectedChain(e),o.AV.push("ConnectWallet"))}catch(e){console.error(e),o.ToastCtrl.openToast("Unsupported chain","error")}}isUnsuportedChainId(e){return("string"==typeof this.connectedChains&&"ALL"!==this.connectedChains||!(!Array.isArray(this.connectedChains)||this.connectedChains.includes(String(e))))&&(this.isUnsupportedChains=!0,!0)}render(){const{chains:e}=o.OptionsCtrl.state,t=e?.map((e=>((e,t)=>fn(e,gn(t)))(((e,t)=>{for(var r in t||(t={}))bn.call(t,r)&&yn(e,r,t[r]);if(wn)for(var r of wn(t))vn.call(t,r)&&yn(e,r,t[r]);return e})({},e),{unsupported:this.isUnsuportedChainId(e.id)}))),r=t?.sort(((e,t)=>Number(e.unsupported)-Number(t.unsupported)));return n.dy`
${r?.map((e=>n.dy`${e.name}`))}
${this.isUnsupportedChains?n.dy`Your connected wallet may not support some of the networks available for this dapp`:null}`}};An.styles=[g.globalCss,dn],xn([(0,i.SB)()],An.prototype,"connectedChains",2),xn([(0,i.SB)()],An.prototype,"isUnsupportedChains",2),An=xn([(0,i.Mo)("w3m-select-network-view")],An);const Cn=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var En=Object.defineProperty,In=Object.getOwnPropertyDescriptor,_n=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?In(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&En(t,r,o),o};let Pn=class extends n.oi{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const e=o.zv.getSwitchNetworkRouterData();await o.Id.client().switchNetwork({chainId:e.id}),o.OptionsCtrl.setSelectedChain(e),o.AV.reset("Account")}catch{this.isError=!0}}render(){const{id:e,name:t}=o.zv.getSwitchNetworkRouterData();return n.dy`Switch can be declined if chain is not supported by a wallet or previous request is still activeTry Again`}};Pn.styles=[g.globalCss,Cn],_n([(0,i.SB)()],Pn.prototype,"isError",2),Pn=_n([(0,i.Mo)("w3m-switch-network-view")],Pn);const On=n.iv`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var Sn=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,Mn=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?kn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Sn(t,r,o),o};let Tn=class extends n.oi{constructor(){super(...arguments),this.loading=!o.ExplorerCtrl.state.wallets.listings.length,this.firstFetch=!o.ExplorerCtrl.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=J.debounce((e=>{e.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=e,o.ExplorerCtrl.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),o.ExplorerCtrl.resetSearch())}))}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;null==(e=this.intersectionObserver)||e.disconnect()}get placeholderEl(){return J.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver((([e])=>{e.isIntersecting&&(!this.search||!this.firstFetch)&&this.fetchWallets()})),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=o.ExplorerCtrl.state,{listings:r,total:n}=this.search?t:e;return n<=40||r.length>=n}async fetchWallets(){const{wallets:e,search:t,injectedWallets:r}=o.ExplorerCtrl.state,{listings:n,total:i,page:s}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>40&&n.lengthJ.getWalletIcon(e))),n=r.map((e=>J.getWalletIcon(e)));await Promise.all([...t.map((async e=>J.preloadImage(e))),...n.map((async e=>J.preloadImage(e))),o.zv.wait(300)]),this.endReached=this.isLastPage()}catch(e){console.error(e),o.ToastCtrl.openToast(J.getErrorMessage(e),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){o.zv.isAndroid()?J.handleMobileLinking(e):J.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=o.ExplorerCtrl.state,{listings:r}=this.search?t:e,i=this.loading&&!r.length,a=this.search.length>=3;let c=St.injectedWalletsTemplate(),l=St.manualWalletsTemplate(),u=St.recomendedWalletsTemplate(!0);a&&(c=c.filter((({values:e})=>J.caseSafeIncludes(e[0],this.search))),l=l.filter((({values:e})=>J.caseSafeIncludes(e[0],this.search))),u=u.filter((({values:e})=>J.caseSafeIncludes(e[0],this.search)))),c=c.filter((e=>!u.find((t=>J.caseSafeIncludes(e.values[0],t.values[0])))));const h=!(this.loading||r.length||c.length||u.length),d=Math.max(c.length,r.length),p={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return n.dy`
${i?null:u} ${i?null:[...Array(d)].map(((e,t)=>n.dy`${l[t]} ${c[t]} ${r[t]?n.dy``:null}`))}
${h?n.dy`No results found`:null} ${!h&&this.loading?n.dy``:null}
`}};Tn.styles=[g.globalCss,On],Mn([(0,i.SB)()],Tn.prototype,"loading",2),Mn([(0,i.SB)()],Tn.prototype,"firstFetch",2),Mn([(0,i.SB)()],Tn.prototype,"search",2),Mn([(0,i.SB)()],Tn.prototype,"endReached",2),Tn=Mn([(0,i.Mo)("w3m-wallet-explorer-view")],Tn);const Nn=n.iv`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var jn=Object.defineProperty,Rn=Object.getOwnPropertyDescriptor,Ln=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Rn(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&jn(t,r,o),o};let Bn=class extends n.oi{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=o.WcConnectionCtrl.subscribe((e=>{this.isError=e.pairingError}))}disconnectedCallback(){var e;null==(e=this.unwatchConnection)||e.call(this)}onFormatAndRedirect(e){const{desktop:t,name:r}=o.zv.getWalletRouterData(),n=t?.universal;if(n){const t=o.zv.formatUniversalUrl(n,e,r);o.zv.openHref(t,"_blank")}}openWebWallet(){o.WcConnectionCtrl.setPairingError(!1);const{pairingUri:e}=o.WcConnectionCtrl.state,t=o.zv.getWalletRouterData();J.setRecentWallet(t),this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=o.zv.getWalletRouterData(),{isMobile:i,isInjected:s,isDesktop:a}=J.getCachedRouterWalletPlatforms(),c=o.zv.isMobile();return n.dy`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};Bn.styles=[g.globalCss,Nn],Ln([(0,i.SB)()],Bn.prototype,"isError",2),Bn=Ln([(0,i.Mo)("w3m-web-connecting-view")],Bn)},3692:(e,t,r)=>{"use strict";var n;r.d(t,{Jb:()=>_,Ld:()=>P,YP:()=>I,dy:()=>E,sY:()=>W});const i=window,o=i.trustedTypes,s=o?o.createPolicy("lit-html",{createHTML:e=>e}):void 0,a="$lit$",c=`lit$${(Math.random()+"").slice(9)}$`,l="?"+c,u=`<${l}>`,h=document,d=()=>h.createComment(""),p=e=>null===e||"object"!=typeof e&&"function"!=typeof e,f=Array.isArray,m="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,w=/-->/g,b=/>/g,v=RegExp(`>|${m}(?:([^\\s"'>=/]+)(${m}*=${m}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),y=/'/g,x=/"/g,A=/^(?:script|style|textarea|title)$/i,C=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),E=C(1),I=C(2),_=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),O=new WeakMap,S=h.createTreeWalker(h,129,null,!1),k=(e,t)=>{const r=e.length-1,n=[];let i,o=2===t?"":"",l=g;for(let t=0;t"===h[0]?(l=null!=i?i:g,d=-1):void 0===h[1]?d=-2:(d=l.lastIndex-h[2].length,s=h[1],l=void 0===h[3]?v:'"'===h[3]?x:y):l===x||l===y?l=v:l===w||l===b?l=g:(l=v,i=void 0);const f=l===v&&e[t+1].startsWith("/>")?" ":"";o+=l===g?r+u:d>=0?(n.push(s),r.slice(0,d)+a+r.slice(d)+c+f):r+c+(-2===d?(n.push(void 0),t):f)}const h=o+(e[r]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==s?s.createHTML(h):h,n]};class M{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,s=0;const u=e.length-1,h=this.parts,[p,f]=k(e,t);if(this.el=M.createElement(p,r),S.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=S.nextNode())&&h.length0){n.textContent=o?o.emptyScript:"";for(let r=0;rf(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==P&&p(this._$AH)?this._$AA.nextSibling.data=e:this.$(h.createTextNode(e)),this._$AH=e}g(e){var t;const{values:r,_$litType$:n}=e,i="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=M.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===i)this._$AH.v(r);else{const e=new N(i,this),t=e.u(this.options);e.v(r),this.$(t),this._$AH=e}}_$AC(e){let t=O.get(e.strings);return void 0===t&&O.set(e.strings,t=new M(e)),t}T(e){f(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const i of e)n===t.length?t.push(r=new j(this.k(d()),this.k(d()),this,this.options)):r=t[n],r._$AI(i),n++;n2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=P}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){const i=this.strings;let o=!1;if(void 0===i)e=T(this,e,t,0),o=!p(e)||e!==this._$AH&&e!==_,o&&(this._$AH=e);else{const n=e;let s,a;for(e=i[0],s=0;s{var n,i;const o=null!==(n=null==r?void 0:r.renderBefore)&&void 0!==n?n:t;let s=o._$litPart$;if(void 0===s){const e=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:null;o._$litPart$=s=new j(t.insertBefore(d(),e),e,void 0,null!=r?r:{})}return s._$AI(e),s}},7408:(e,t,r)=>{"use strict";r.d(t,{Mo:()=>n,Cb:()=>s,SB:()=>a});const n=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:r,elements:n}=t;return{kind:r,elements:n,finisher(t){customElements.define(e,t)}}})(e,t),i=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(r){r.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(r){r.createProperty(t.key,e)}},o=(e,t,r)=>{t.constructor.createProperty(r,e)};function s(e){return(t,r)=>void 0!==r?o(e,t,r):i(e,t)}function a(e){return s({...e,state:!0})}var c;null===(c=window.HTMLSlotElement)||void 0===c||c.prototype.assignedElements},623:(e,t,r)=>{"use strict";r.d(t,{$:()=>o});var n=r(3692);class i{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const o=(s=class extends i{constructor(e){var t;if(super(e),1!==e.type||"class"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){var r,i;if(void 0===this.it){this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!(null===(r=this.nt)||void 0===r?void 0:r.has(e))&&this.it.add(e);return this.render(t)}const o=e.element.classList;this.it.forEach((e=>{e in t||(o.remove(e),this.it.delete(e))}));for(const e in t){const r=!!t[e];r===this.it.has(e)||(null===(i=this.nt)||void 0===i?void 0:i.has(e))||(r?(o.add(e),this.it.add(e)):(o.remove(e),this.it.delete(e)))}return n.Jb}},(...e)=>({_$litDirective$:s,values:e}));var s},9392:(e,t,r)=>{"use strict";r.d(t,{oi:()=>C,iv:()=>c,dy:()=>A.dy,YP:()=>A.YP});const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(e,t,r){if(this._$cssResult$=!0,r!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&s.set(t,e))}return e}toString(){return this.cssText}}const c=(e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,r,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[n+1]),e[0]);return new a(r,e,o)},l=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,o))(t)})(e):e;var u;const h=window,d=h.trustedTypes,p=d?d.emptyScript:"",f=h.reactiveElementPolyfillSupport,m={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},g=(e,t)=>t!==e&&(t==t||e==e),w={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:g},b="finalized";class v extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,r)=>{const n=this._$Ep(r,t);void 0!==n&&(this._$Ev.set(n,r),e.push(n))})),e}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const r="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,r,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(n){const i=this[e];this[t]=n,this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||w}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const r of t)this.createProperty(r,e[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Ep(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,r;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(r=e.hostConnected)||void 0===r||r.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{i?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const r=document.createElement("style"),i=n.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=t.cssText,e.appendChild(r)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=w){var n;const i=this.constructor._$Ep(e,r);if(void 0!==i&&!0===r.reflect){const o=(void 0!==(null===(n=r.converter)||void 0===n?void 0:n.toAttribute)?r.converter:m).toAttribute(t,r.type);this._$El=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(e,t){var r;const n=this.constructor,i=n._$Ev.get(e);if(void 0!==i&&this._$El!==i){const e=n.getPropertyOptions(i),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(r=e.converter)||void 0===r?void 0:r.fromAttribute)?e.converter:m;this._$El=i,this[i]=o.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,r){let n=!0;void 0!==e&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||g)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,r))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(r)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}v[b]=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==f||f({ReactiveElement:v}),(null!==(u=h.reactiveElementVersions)&&void 0!==u?u:h.reactiveElementVersions=[]).push("1.6.2");var y,x,A=r(3692);class C extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const r=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=r.firstChild),r}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,A.sY)(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return A.Jb}}C.finalized=!0,C._$litElement$=!0,null===(y=globalThis.litElementHydrateSupport)||void 0===y||y.call(globalThis,{LitElement:C});const E=globalThis.litElementPolyfillSupport;null==E||E({LitElement:C}),(null!==(x=globalThis.litElementVersions)&&void 0!==x?x:globalThis.litElementVersions=[]).push("3.3.2")},6828:(e,t,r)=>{"use strict";r.d(t,{sj:()=>h,CO:()=>p,Ld:()=>d}),Symbol();const n=Symbol(),i=Object.getPrototypeOf,o=new WeakMap,s=(e,t=!0)=>{o.set(e,t)},a=e=>"object"==typeof e&&null!==e,c=new WeakMap,l=new WeakSet,[u]=((e=Object.is,t=((e,t)=>new Proxy(e,t)),r=(e=>a(e)&&!l.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),u=(e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),h=new WeakMap,d=((e,t,r=u)=>{const n=h.get(e);if((null==n?void 0:n[0])===t)return n[1];const i=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return s(i,!0),h.set(e,[t,i]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(i,t))return;const n=Reflect.get(e,t),o={value:n,enumerable:!0,configurable:!0};if(l.has(n))s(n,!1);else if(n instanceof Promise)delete o.value,o.get=()=>r(n);else if(c.has(n)){const[e,t]=c.get(n);o.value=d(e,t(),r)}Object.defineProperty(i,t,o)})),i}),p=new WeakMap,f=[1,1],m=(s=>{if(!a(s))throw new Error("object required");const u=p.get(s);if(u)return u;let h=f[0];const g=new Set,w=(e,t=++f[0])=>{h!==t&&(h=t,g.forEach((r=>r(e,t))))};let b=f[1];const v=e=>(t,r)=>{const n=[...t];n[1]=[e,...n[1]],w(n,r)},y=new Map,x=e=>{var t;const r=y.get(e);r&&(y.delete(e),null==(t=r[1])||t.call(r))},A=Array.isArray(s)?[]:Object.create(Object.getPrototypeOf(s)),C=t(A,{deleteProperty(e,t){const r=Reflect.get(e,t);x(t);const n=Reflect.deleteProperty(e,t);return n&&w(["delete",[t],r]),n},set(t,s,u,h){const d=Reflect.has(t,s),f=Reflect.get(t,s,h);if(d&&(e(f,u)||p.has(u)&&e(f,p.get(u))))return!0;var b;x(s),a(u)&&(u=(e=>e&&(o.has(e)?o.get(e):i(e)===Object.prototype||i(e)===Array.prototype))(b=u)&&b[n]||null||u);let A=u;if(u instanceof Promise)u.then((e=>{u.status="fulfilled",u.value=e,w(["resolve",[s],e])})).catch((e=>{u.status="rejected",u.reason=e,w(["reject",[s],e])}));else{!c.has(u)&&r(u)&&(A=m(u));const e=!l.has(A)&&c.get(A);e&&((e,t)=>{if(y.has(e))throw new Error("prop listener already exists");if(g.size){const r=t[3](v(e));y.set(e,[t,r])}else y.set(e,[t])})(s,e)}return Reflect.set(t,s,A,h),w(["set",[s],u,f]),!0}});p.set(s,C);const E=[A,(e=++f[1])=>(b===e||g.size||(b=e,y.forEach((([t])=>{const r=t[1](e);r>h&&(h=r)}))),h),d,e=>(g.add(e),1===g.size&&y.forEach((([e,t],r)=>{if(t)throw new Error("remove already exists");const n=e[3](v(r));y.set(r,[e,n])})),()=>{g.delete(e),0===g.size&&y.forEach((([e,t],r)=>{t&&(t(),y.set(r,[e]))}))})];return c.set(C,E),Reflect.ownKeys(s).forEach((e=>{const t=Object.getOwnPropertyDescriptor(s,e);"value"in t&&(C[e]=s[e],delete t.value,delete t.writable),Object.defineProperty(A,e,t)})),C}))=>[m,c,l,e,t,r,u,h,d,p,f])();function h(e={}){return u(e)}function d(e,t,r){const n=c.get(e);let i;n||console.warn("Please use proxy object");const o=[],s=n[3];let a=!1;const l=s((e=>{o.push(e),r?t(o.splice(0)):i||(i=Promise.resolve().then((()=>{i=void 0,a&&t(o.splice(0))})))}));return a=!0,()=>{a=!1,l()}}function p(e,t){const r=c.get(e);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),t)}},1431:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}r.d(t,{T:()=>n})},5291:(e,t,r)=>{"use strict";r.d(t,{R:()=>b});var n=r(1431),i=r(1920);const o="0x82ad56cb";var s=r(9977),a=r(1973),c=r(6647),l=r(1826),u=r(6606),h=r(1786),d=r(6872),p=r(968),f=r(1019),m=r(3822),g=r(8583),w=r(3134);async function b(e,t){const{account:b,batch:v=Boolean(e.batch?.multicall),blockNumber:y,blockTag:x="latest",accessList:A,data:C,gas:E,gasPrice:I,maxFeePerGas:_,maxPriorityFeePerGas:P,nonce:O,to:S,value:k,...M}=t,T=b?(0,n.T)(b):void 0;try{(0,w.F)(t);const r=(y?(0,d.eC)(y):void 0)||x,n=e.chain?.formatters?.transactionRequest?.format||m.t,s=n({...(0,f.K)(M,{format:n}),from:T?.address,accessList:A,data:C,gas:E,gasPrice:I,maxFeePerGas:_,maxPriorityFeePerGas:P,nonce:O,to:S,value:k});if(v&&function({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(o)||!r||Object.values(n).filter((e=>void 0!==e)).length>0)}({request:s}))try{return await async function(e,t){const{batchSize:r=1024,wait:n=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:o,blockTag:s="latest",data:p,multicallAddress:f,to:m}=t;let w=f;if(!w){if(!e.chain)throw new a.pZ;w=(0,h.LI)({blockNumber:o,chain:e.chain,contract:"multicall3"})}const b=(o?(0,d.eC)(o):void 0)||s,{schedule:v}=(0,g.S)({id:`${e.uid}.${b}`,wait:n,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*r},fn:async t=>{const r=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),n=(0,u.R)({abi:i.F8,args:[r],functionName:"aggregate3"}),o=await e.request({method:"eth_call",params:[{data:n,to:w},b]});return(0,l.k)({abi:i.F8,args:[r],functionName:"aggregate3",data:o||"0x"})}}),[{returnData:y,success:x}]=await v({data:p,to:m});if(!x)throw new c.VQ({data:y});return"0x"===y?{data:void 0}:{data:y}}(e,{...s,blockNumber:y,blockTag:x})}catch(e){if(!(e instanceof a.pZ||e instanceof a.mm))throw e}const p=await e.request({method:"eth_call",params:r?[s,r]:[s]});return"0x"===p?{data:void 0}:{data:p}}catch(n){const i=function(e){if(!(e instanceof s.G))return;const t=e.walk();return"object"==typeof t.data?t.data.data:t.data}(n),{offchainLookup:o,offchainLookupSignature:a}=await Promise.resolve().then(r.bind(r,6663));if(i?.slice(0,10)===a&&S)return{data:await o(e,{data:i,to:S})};throw function(e,{docsPath:t,...r}){let n=e;return(0,p.B)(e)&&(n=(0,p.k)(e,r)),new c.cg(n,{docsPath:t,...r})}(n,{...t,account:T,chain:e.chain})}}},1920:(e,t,r)=>{"use strict";r.d(t,{$o:()=>a,Ei:()=>s,F8:()=>n,lD:()=>i,nZ:()=>o});const n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],i=[{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],o=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],s=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]}],a=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}]},5554:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,Up:()=>i,hZ:()=>o});const n={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},o={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},8617:(e,t,r)=>{"use strict";r.d(t,{Bd:()=>o,Zn:()=>i,ez:()=>n});const n={gwei:9,wei:18},i={ether:-9,wei:9},o={ether:-18,gwei:-9}},5555:(e,t,r)=>{"use strict";r.d(t,{CI:()=>C,FM:()=>f,Gy:()=>x,KY:()=>v,M4:()=>h,MX:()=>b,SM:()=>y,cO:()=>a,dh:()=>A,fM:()=>s,fs:()=>d,gr:()=>u,hn:()=>E,lC:()=>m,mv:()=>g,wM:()=>I,wb:()=>l,xB:()=>c,xL:()=>w,yP:()=>p});var n=r(1494),i=r(1756),o=r(9977);class s extends o.G{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class a extends o.G{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class c extends o.G{constructor({data:e,params:t,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${(0,n.h)(t,{includeName:!0})})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class l extends o.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class u extends o.G{constructor({expectedLength:e,givenLength:t,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class h extends o.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.d)(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class d extends o.G{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class p extends o.G{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"})}}class f extends o.G{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class m extends o.G{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class g extends o.G{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class w extends o.G{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class b extends o.G{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class v extends o.G{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class y extends o.G{constructor({abiItem:e,data:t,params:r,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${(0,n.h)(r,{includeName:!0})})`,`Data: ${t} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class x extends o.G{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.t)(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class A extends o.G{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class C extends o.G{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class E extends o.G{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class I extends o.G{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}},2960:(e,t,r)=>{"use strict";r.d(t,{b:()=>i});var n=r(9977);class i extends n.G{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},9977:(e,t,r)=>{"use strict";r.d(t,{G:()=>i});var n=r(3678);class i extends Error{constructor(e,t={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:(0,n.bo)()});const r=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof i&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: https://viem.sh${o}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return o(this,e)}}function o(e,t){return t?.(e)?e:e.cause?o(e.cause,t):e}},1973:(e,t,r)=>{"use strict";r.d(t,{Bk:()=>s,Yl:()=>o,mm:()=>i,pZ:()=>a});var n=r(9977);class i extends n.G{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class o extends n.G{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class s extends n.G{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class a extends n.G{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}},6647:(e,t,r)=>{"use strict";r.d(t,{cg:()=>m,uq:()=>g,Lu:()=>w,Dk:()=>b,VQ:()=>v});var n=r(1431),i=r(5554),o=r(1856),s=r(1494),a=r(1344);function c({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map(((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,a.P)(t[r]):t[r]}`)).join(", ")})`}var l=r(8604),u=r(6665),h=r(6283),d=r(9977),p=r(4574),f=r(3678);class m extends d.G{constructor(e,{account:t,docsPath:r,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:d,to:f,value:m}){const g=t?(0,n.T)(t):void 0,w=(0,p.xr)({from:g?.address,to:f,value:void 0!==m&&`${(0,u.d)(m)} ${i?.nativeCurrency.symbol||"ETH"}`,data:o,gas:s,gasPrice:void 0!==a&&`${(0,h.o)(a)} gwei`,maxFeePerGas:void 0!==c&&`${(0,h.o)(c)} gwei`,maxPriorityFeePerGas:void 0!==l&&`${(0,h.o)(l)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class g extends d.G{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:o,sender:a}){const u=(0,l.m)({abi:t,args:r,name:o}),h=u?c({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=u?(0,s.t)(u,{includeName:!0}):void 0,m=(0,p.xr)({address:n&&(0,f.CR)(n),function:d,args:h&&"()"!==h&&`${[...Array(o?.length??0).keys()].map((()=>" ")).join("")}${h}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",m].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=o,this.sender=a}}class w extends d.G{constructor({abi:e,data:t,functionName:r,message:n}){let a,l,u;if(t&&"0x"!==t){a=(0,o.p)({abi:e,data:t});const{abiItem:r,errorName:n,args:h}=a;if("Error"===n)u=h[0];else if("Panic"===n){const[e]=h;u=i.$[e]}else{const e=r?(0,s.t)(r,{includeName:!0}):void 0,t=r&&h?c({abiItem:r,args:h,includeFunctionName:!1,includeName:!1}):void 0;l=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(n?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}else n&&(u=n);super(u&&"execution reverted"!==u?[`The contract function "${r}" reverted with the following reason:`,u].join("\n"):`The contract function "${r}" reverted.`,{metaMessages:l}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.reason=u,this.data=a}}class b extends d.G{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class v extends d.G{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},8309:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,m:()=>i});var n=r(9977);class i extends n.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class o extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}},9466:(e,t,r)=>{"use strict";r.d(t,{Cd:()=>o,J5:()=>i,M6:()=>s});var n=r(9977);class i extends n.G{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class o extends n.G{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class s extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}},6054:(e,t,r)=>{"use strict";r.d(t,{C_:()=>h,G$:()=>a,Hh:()=>s,M_:()=>o,WF:()=>d,ZI:()=>c,cj:()=>g,cs:()=>m,dR:()=>p,pZ:()=>f,se:()=>u,vU:()=>l});var n=r(6283),i=r(9977);class o extends i.G{constructor({cause:e,message:t}={}){const r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class s extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class a extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class c extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class l extends i.G{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported/});class u extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class h extends i.G{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class d extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class p extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends i.G{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class m extends i.G{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.o)(r)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(m,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class g extends i.G{constructor({cause:e}){super(`An error occurred while executing: ${e?.message}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}},8822:(e,t,r)=>{"use strict";r.d(t,{Gg:()=>s,W5:()=>l,bs:()=>c,c9:()=>a});var n=r(1344),i=r(9977),o=r(3678);class s extends i.G{constructor({body:e,details:t,headers:r,status:i,url:s}){super("HTTP request failed.",{details:t,metaMessages:[i&&`Status: ${i}`,`URL: ${(0,o.Gr)(s)}`,e&&`Request body: ${(0,n.P)(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=r,this.status=i,this.url=s}}class a extends i.G{constructor({body:e,details:t,url:r}){super("WebSocket request failed.",{details:t,metaMessages:[`URL: ${(0,o.Gr)(r)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class c extends i.G{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,o.Gr)(r)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class l extends i.G{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,o.Gr)(t)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}},2455:(e,t,r)=>{"use strict";r.d(t,{B:()=>c,GD:()=>b,I0:()=>C,KB:()=>m,LX:()=>l,Og:()=>p,PE:()=>y,Pv:()=>w,Ts:()=>x,XS:()=>h,ab:()=>v,gS:()=>g,ir:()=>I,nY:()=>u,pT:()=>f,s7:()=>a,u5:()=>A,x3:()=>E,yR:()=>d});var n=r(9977),i=r(8822);class o extends n.G{constructor(e,{code:t,docsPath:r,metaMessages:n,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof i.bs?e.code:t??-1}}class s extends o{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class a extends o{constructor(e){super(e,{code:a.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class c extends o{constructor(e){super(e,{code:c.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class l extends o{constructor(e){super(e,{code:l.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends o{constructor(e){super(e,{code:u.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class h extends o{constructor(e){super(e,{code:h.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class d extends o{constructor(e){super(e,{code:d.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class p extends o{constructor(e){super(e,{code:p.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class f extends o{constructor(e){super(e,{code:f.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class m extends o{constructor(e){super(e,{code:m.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class g extends o{constructor(e){super(e,{code:g.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class w extends o{constructor(e){super(e,{code:w.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends o{constructor(e){super(e,{code:b.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class v extends s{constructor(e){super(e,{code:v.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class y extends s{constructor(e){super(e,{code:y.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends s{constructor(e){super(e,{code:x.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class A extends s{constructor(e){super(e,{code:A.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class C extends s{constructor(e){super(e,{code:C.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class E extends s{constructor(e){super(e,{code:E.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class I extends o{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}},4574:(e,t,r)=>{"use strict";r.d(t,{Bh:()=>l,Yb:()=>u,mc:()=>h,mk:()=>c,xY:()=>a,xr:()=>s});var n=r(6665),i=r(6283),o=r(9977);function s(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),r=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(r+1)} ${t}`)).join("\n")}class a extends o.G{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class c extends o.G{constructor(e,{account:t,docsPath:r,chain:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:h,nonce:d,to:p,value:f}){const m=s({chain:o&&`${o?.name} (id: ${o?.id})`,from:t?.address,to:p,value:void 0!==f&&`${(0,n.d)(f)} ${o?.nativeCurrency.symbol||"ETH"}`,data:a,gas:c,gasPrice:void 0!==l&&`${(0,i.o)(l)} gwei`,maxFeePerGas:void 0!==u&&`${(0,i.o)(u)} gwei`,maxPriorityFeePerGas:void 0!==h&&`${(0,i.o)(h)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class l extends o.G{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let o="Transaction";r&&void 0!==i&&(o=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(o=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(o=`Transaction at block number "${t}" at index "${i}"`),n&&(o=`Transaction with hash "${n}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class u extends o.G{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class h extends o.G{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}},3678:(e,t,r)=>{"use strict";r.d(t,{CR:()=>n,Gr:()=>i,bo:()=>o});const n=e=>e,i=e=>e,o=()=>"viem@1.1.7"},558:(e,t,r)=>{"use strict";r.d(t,{r:()=>u});var n=r(5555),i=r(2221),o=r(1756),s=r(3283),a=r(6873),c=r(169),l=r(2546);function u(e,t){if("0x"===t&&e.length>0)throw new n.wb;if((0,o.d)(t)&&(0,o.d)(t)<32)throw new n.xB({data:t,params:e,size:(0,o.d)(t)});return function({data:e,params:t}){const r=[];let i=0;for(let s=0;s=(0,o.d)(e))throw new n.xB({data:e,params:t,size:(0,o.d)(e)});const a=t[s],{consumed:c,value:l}=h({data:e,param:a,position:i});r.push(l),i+=c}return r}({data:t,params:e})}function h({data:e,param:t,position:r}){const o=(0,l.S)(t.type);if(o){const[n,i]=o;return function(e,{param:t,length:r,position:n}){if(!r){const r=(0,c.ly)((0,s.tP)(e,n,n+32,{strict:!0})),i=(0,c.ly)((0,s.tP)(e,r,r+32,{strict:!0}));let o=0;const a=[];for(let n=0;n!e)),i=n?[]:{};let o=0;if(d(t)){const a=(0,c.ly)((0,s.tP)(e,r,r+32,{strict:!0}));for(let r=0;r48?(0,c.y_)(e,{signed:r}):(0,c.ly)(e,{signed:r})}}(u,{param:t});if("address"===t.type)return function(e){return{consumed:32,value:(0,i.x)((0,s.tP)(e,-20))}}(u);if("bool"===t.type)return function(e){return{consumed:32,value:(0,c.XA)(e)}}(u);throw new n.CI(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function d(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(d);const r=(0,l.S)(e.type);return!(!r||!d({...e,type:r[1]}))}},1856:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var n=r(5554),i=r(5555),o=r(3283),s=r(507),a=r(558),c=r(1494);function l({abi:e,data:t}){const r=(0,o.tP)(t,0,4);if("0x"===r)throw new i.wb;const l=[...e||[],n.Up,n.hZ].find((e=>"error"===e.type&&r===(0,s.o)((0,c.t)(e))));if(!l)throw new i.yP(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:l,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,a.r)(l.inputs,(0,o.tP)(t,4)):void 0,errorName:l.name}}},1826:(e,t,r)=>{"use strict";r.d(t,{k:()=>a});var n=r(5555),i=r(558),o=r(8604);const s="/docs/contract/decodeFunctionResult";function a({abi:e,args:t,functionName:r,data:a}){let c=e[0];if(r&&(c=(0,o.m)({abi:e,args:t,name:r}),!c))throw new n.xL(r,{docsPath:s});if("function"!==c.type)throw new n.xL(void 0,{docsPath:s});if(!c.outputs)throw new n.MX(c.name,{docsPath:s});const l=(0,i.r)(c.outputs,a);return l&&l.length>1?l:l&&1===l.length?l[0]:void 0}},2546:(e,t,r)=>{"use strict";r.d(t,{E:()=>h,S:()=>f});var n=r(5555),i=r(2960),o=r(7451),s=r(9040),a=r(8795),c=r(1756),l=r(3283),u=r(6872);function h(e,t){if(e.length!==t.length)throw new n.fs({expectedLength:e.length,givenLength:t.length});const r=function({params:e,values:t}){const r=[];for(let n=0;n0?(0,s.zo)([t,e]):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,s.zo)(a.map((({encoded:e})=>e)))}}(t,{length:i,param:{...e,type:o}})}if("tuple"===e.type)return function(e,{param:t}){let r=!1;const n=[];for(let i=0;ie)))}}(t,{param:e});if("address"===e.type)return function(e){if(!(0,o.U)(e))throw new i.b({address:e});return{dynamic:!1,encoded:(0,a.gc)(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:(0,a.gc)((0,u.C4)(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return function(e,{signed:t}){return{dynamic:!1,encoded:(0,u.eC)(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")});if(e.type.startsWith("bytes"))return function(e,{param:t}){const[r,i]=t.type.split("bytes");if(!i){const t=Math.ceil((0,c.d)(e)/32),r=[];for(let n=0;n{"use strict";r.d(t,{R:()=>l});var n=r(5555),i=r(9040),o=r(507),s=r(2546),a=r(1494),c=r(8604);function l({abi:e,args:t,functionName:r}){let l=e[0];if(r&&(l=(0,c.m)({abi:e,args:t,name:r}),!l))throw new n.xL(r,{docsPath:"/docs/contract/encodeFunctionData"});if("function"!==l.type)throw new n.xL(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const u=(0,a.t)(l),h=(0,o.o)(u),d="inputs"in l&&l.inputs?(0,s.E)(l.inputs,t??[]):void 0;return(0,i.SM)([h,d??"0x"])}},1494:(e,t,r)=>{"use strict";r.d(t,{h:()=>o,t:()=>i});var n=r(5555);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.wM(e.type);return`${e.name}(${o(e.inputs,{includeName:t})})`}function o(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${o(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}},8604:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var n=r(7451);function i({abi:e,args:t=[],name:r}){const n=e.filter((e=>"name"in e&&e.name===r));if(0!==n.length){if(1===n.length)return n[0];for(const e of n)if("inputs"in e)if(t&&0!==t.length){if(e.inputs&&0!==e.inputs.length&&e.inputs.length===t.length&&t.every(((t,r)=>{const n="inputs"in e&&e.inputs[r];return!!n&&o(t,n)})))return e}else if(!e.inputs||0===e.inputs.length)return e;return n[0]}}function o(e,t){const r=typeof e,i=t.type;switch(i){case"address":return(0,n.U)(e);case"bool":return"boolean"===r;case"function":case"string":return"string"===r;default:return"tuple"===i&&"components"in t?Object.values(t.components).every(((t,r)=>o(Object.values(e)[r],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i)?"number"===r||"bigint"===r:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i)?"string"===r||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i)&&Array.isArray(e)&&e.every((e=>o(e,{...t,type:i.replace(/(\[[0-9]{0,}\])$/,"")})))}}},2221:(e,t,r)=>{"use strict";r.d(t,{K:()=>c,x:()=>a});var n=r(2960),i=r(1327),o=r(7871),s=r(7451);function a(e,t){const r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,o.w)((0,i.qX)(r),"bytes"),s=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&n[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());return`0x${s.join("")}`}function c(e,t){if(!(0,s.U)(e))throw new n.b({address:e});return a(e,t)}},7451:(e,t,r)=>{"use strict";r.d(t,{U:()=>i});const n=/^0x[a-fA-F0-9]{40}$/;function i(e){return n.test(e)}},6663:(e,t,r)=>{"use strict";r.d(t,{offchainLookup:()=>v,offchainLookupSignature:()=>w});var n=r(5291),i=r(1344),o=r(9977),s=r(3678);class a extends o.G{constructor({callbackSelector:e,cause:t,data:r,extraData:n,sender:i,urls:o}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map((e=>` ${(0,s.Gr)(e)}`))],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${e}`,` Extra data: ${n}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class c extends o.G{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,s.Gr)(t)}`,`Response: ${(0,i.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class l extends o.G{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}var u=r(8822),h=r(1856),d=r(2546),p=r(2960),f=r(7451),m=r(9040),g=r(5493);const w="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function v(e,{blockNumber:t,blockTag:r,data:o,to:s}){const{args:w}=(0,h.p)({data:o,abi:[b]}),[v,y,x,A,C]=w;try{if(!function(e,t){if(!(0,f.U)(e))throw new p.b({address:e});if(!(0,f.U)(t))throw new p.b({address:t});return e.toLowerCase()===t.toLowerCase()}(s,v))throw new l({sender:v,to:s});const o=await async function({data:e,sender:t,urls:r}){let n=new Error("An unknown error occurred.");for(let o=0;o{"use strict";r.d(t,{LI:()=>s,ax:()=>o,qg:()=>i});var n=r(1973);function i({chain:e,currentChainId:t}){if(!e)throw new n.Bk;if(t!==e.id)throw new n.Yl({chain:e,currentChainId:t})}function o(e,t){return{...e,formatters:t?.formatters,serializers:t?.serializers}}function s({blockNumber:e,chain:t,contract:r}){const i=t?.contracts?.[r];if(!i)throw new n.mm({chain:t,contract:{name:r}});if(e&&i.blockCreated&&i.blockCreated>e)throw new n.mm({blockNumber:e,chain:t,contract:{name:r,blockCreated:i.blockCreated}});return i.address}},9040:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(const r of e)t+=r.length;const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}r.d(t,{SM:()=>i,zo:()=>n})},5493:(e,t,r)=>{"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{v:()=>n})},8795:(e,t,r)=>{"use strict";r.d(t,{gc:()=>o,vk:()=>i});var n=r(8309);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?o(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.$({size:e.length,targetSize:r,type:"bytes"});const i=new Uint8Array(r);for(let n=0;n2*r)throw new n.$({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}},1756:(e,t,r)=>{"use strict";r.d(t,{d:()=>i});var n=r(5493);function i(e){return(0,n.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},3283:(e,t,r)=>{"use strict";r.d(t,{tP:()=>s});var n=r(8309),i=r(5493),o=r(1756);function s(e,t,r,{strict:n}={}){return(0,i.v)(e,{strict:!1})?function(e,t,r,{strict:n}={}){a(e,t);const i=`0x${e.replace("0x","").slice(2*(t??0),2*(r??e.length))}`;return n&&c(i,t,r),i}(e,t,r,{strict:n}):function(e,t,r,{strict:n}={}){a(e,t);const i=e.slice(t,r);return n&&c(i,t,r),i}(e,t,r,{strict:n})}function a(e,t){if("number"==typeof t&&t>0&&t>(0,o.d)(e)-1)throw new n.m({offset:t,position:"start",size:(0,o.d)(e)})}function c(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,o.d)(e)!==r-t)throw new n.m({offset:r,position:"end",size:(0,o.d)(e)})}},6873:(e,t,r)=>{"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,n=0;for(let e=0;en})},169:(e,t,r)=>{"use strict";r.d(t,{XA:()=>l,Yf:()=>a,ly:()=>u,rR:()=>h,y_:()=>c});var n=r(9466),i=r(1756),o=r(6873),s=r(1327);function a(e,{size:t}){if((0,i.d)(e)>t)throw new n.M6({givenSize:(0,i.d)(e),maxSize:t})}function c(e,t={}){const{signed:r}=t;t.size&&a(e,{size:t.size});const n=BigInt(e);if(!r)return n;const i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function l(e,t={}){let r=e;if(t.size&&(a(r,{size:t.size}),r=(0,o.f)(r)),"0x00"===(0,o.f)(r))return!1;if("0x01"===(0,o.f)(r))return!0;throw new n.Cd(r)}function u(e,t={}){return Number(c(e,t))}function h(e,t={}){let r=(0,s.nr)(e);return t.size&&(a(r,{size:t.size}),r=(0,o.f)(r,{dir:"right"})),(new TextDecoder).decode(r)}},1327:(e,t,r)=>{"use strict";r.d(t,{O0:()=>l,nr:()=>u,qX:()=>h});var n=r(9977),i=r(5493),o=r(8795),s=r(169),a=r(6872);const c=new TextEncoder;function l(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){return u((0,a.eC)(e,t))}(e,t):"boolean"==typeof e?function(e,t={}){const r=new Uint8Array(1);return r[0]=Number(e),"number"==typeof t.size?((0,s.Yf)(r,{size:t.size}),(0,o.vk)(r,{size:t.size})):r}(e,t):(0,i.v)(e)?u(e,t):h(e,t)}function u(e,t={}){let r=e;t.size&&((0,s.Yf)(r,{size:t.size}),r=(0,o.vk)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);const a=new Uint8Array(i.length/2);for(let e=0;e{"use strict";r.d(t,{$G:()=>d,C4:()=>c,NC:()=>a,ci:()=>l,eC:()=>u});var n=r(9466),i=r(8795),o=r(169);const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?d(e,t):"boolean"==typeof e?c(e,t):l(e,t)}function c(e,t={}){const r=`0x${Number(e)}`;return"number"==typeof t.size?((0,o.Yf)(r,{size:t.size}),(0,i.vk)(r,{size:t.size})):r}function l(e,t={}){let r="";for(let t=0;ta||s{"use strict";r.d(t,{B:()=>s,k:()=>a});var n=r(6054),i=r(8822),o=r(2455);function s(e){return e instanceof o.KB||e instanceof o.yR||e instanceof i.bs&&e.code===n.M_.code}function a(e,t){const r=e.details.toLowerCase();return n.Hh.nodeMessage.test(r)?new n.Hh({cause:e,maxFeePerGas:t?.maxFeePerGas}):n.G$.nodeMessage.test(r)?new n.G$({cause:e,maxFeePerGas:t?.maxFeePerGas}):n.ZI.nodeMessage.test(r)?new n.ZI({cause:e,nonce:t?.nonce}):n.vU.nodeMessage.test(r)?new n.vU({cause:e,nonce:t?.nonce}):n.se.nodeMessage.test(r)?new n.se({cause:e,nonce:t?.nonce}):n.C_.nodeMessage.test(r)?new n.C_({cause:e}):n.WF.nodeMessage.test(r)?new n.WF({cause:e,gas:t?.gas}):n.dR.nodeMessage.test(r)?new n.dR({cause:e,gas:t?.gas}):n.pZ.nodeMessage.test(r)?new n.pZ({cause:e}):n.cs.nodeMessage.test(r)?new n.cs({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):r.match(n.M_.nodeMessage)||"code"in e.cause&&e.cause?.code===n.M_.code?new n.M_({cause:e,message:e.cause.details||e.details}):new n.cj({cause:e.cause.cause})}},1019:(e,t,r)=>{"use strict";function n(e,{format:t}){return t?Object.keys(t({})).reduce(((t,r)=>(e?.hasOwnProperty(r)&&(t[r]=e[r]),t)),{}):{}}r.d(t,{K:()=>n})},5491:(e,t,r)=>{"use strict";function n(e,t){return({exclude:r,format:n})=>({format:e=>{const i=t(e);if(r)for(const e of r)delete i[e];return{...i,...n(e)}},type:e})}r.d(t,{$:()=>n})},3822:(e,t,r)=>{"use strict";r.d(t,{i:()=>o,t:()=>i});var n=r(6872);function i(e){return{...e,gas:void 0!==e.gas?(0,n.eC)(e.gas):void 0,gasPrice:void 0!==e.gasPrice?(0,n.eC)(e.gasPrice):void 0,maxFeePerGas:void 0!==e.maxFeePerGas?(0,n.eC)(e.maxFeePerGas):void 0,maxPriorityFeePerGas:void 0!==e.maxPriorityFeePerGas?(0,n.eC)(e.maxPriorityFeePerGas):void 0,nonce:void 0!==e.nonce?(0,n.eC)(e.nonce):void 0,value:void 0!==e.value?(0,n.eC)(e.value):void 0}}const o=(0,r(5491).$)("transactionRequest",i)},507:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(3283),i=r(3693);const o=e=>"string"==typeof e?(0,n.tP)((0,i.F)(e),0,4):(0,n.tP)((0,i.J)(e),0,4)},3693:(e,t,r)=>{"use strict";r.d(t,{J:()=>l,F:()=>c});const n=/((function|event)\s)?(.*)(\((.*)\))/;function i(e){const t=e.match(n),r=t?.[2]||void 0,i=t?.[3];return{type:r,name:i,params:t?.[5]||void 0}}var o=r(1327),s=r(7871);const a=e=>(0,s.w)((0,o.O0)(e));function c(e){const t=function(e){return i(e).name}(e),r=function(e){const t=i(e).params,r=t?.split(",").map((e=>e.trim().split(" ")));return r?.map((e=>({type:e[0],name:"indexed"===e[1]?e[2]:e[1],..."indexed"===e[1]?{indexed:!0}:{}})))}(e)||[];return a(`${t}(${r.map((({type:e})=>e)).join(",")})`)}function l(e){return a(`${e.name}(${e.inputs.map((({type:e})=>e)).join(",")})`)}},7871:(e,t,r)=>{"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}r.d(t,{w:()=>L});const o={number:n,bool:function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:i,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function(e,t){i(e);const r=t.outputLen;if(e.length>a&s)}:{h:0|Number(e>>a&s),l:0|Number(e&s)}}const l=function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;ie<>>32-r,h=(e,t,r)=>t<>>32-r,d=(e,t,r)=>t<>>64-r,p=(e,t,r)=>e<>>64-r;if("object"==typeof globalThis&&"crypto"in globalThis&&globalThis.crypto,68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function f(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));class m{clone(){return this._cloneInto()}}const[g,w,b]=[[],[],[]],v=BigInt(0),y=BigInt(1),x=BigInt(2),A=BigInt(7),C=BigInt(256),E=BigInt(113);for(let e=0,t=y,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],g.push(2*(5*n+r)),w.push((e+1)*(e+2)/2%64);let i=v;for(let e=0;e<7;e++)t=(t<>A)*E)%C,t&x&&(i^=y<<(y<r>32?d(e,t,r):u(e,t,r),O=(e,t,r)=>r>32?p(e,t,r):h(e,t,r);class S extends m{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,o.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=P(o,s,1)^r[n],c=O(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=w[r],o=P(t,i,n),s=O(t,i,n),a=g[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=I[n],e[1]^=_[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){o.exists(this);const{blockLen:t,state:r}=this,n=(e=f(e)).length;for(let i=0;i=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return o.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(o.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new S(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}const k=(e,t,r)=>function(e){const t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}((()=>new S(t,e,r))),M=(k(6,144,28),k(6,136,32),k(6,104,48),k(6,72,64),k(1,144,28),k(1,136,32)),T=(k(1,104,48),k(1,72,64),(e,t,r)=>function(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(((n={})=>new S(t,e,void 0===n.dkLen?r:n.dkLen,!0))));T(31,168,16),T(31,136,32);var N=r(5493),j=r(1327),R=r(6872);function L(e,t){const r=t||"hex",n=M((0,N.v)(e,{strict:!1})?(0,j.O0)(e):e);return"bytes"===r?n:(0,R.NC)(n)}},8583:(e,t,r)=>{"use strict";r.d(t,{S:()=>i});const n=new Map;function i({fn:e,id:t,shouldSplitBatch:r,wait:i=0}){const o=async()=>{const t=a();s();const r=t.map((({args:e})=>e));0!==r.length&&e(r).then((e=>{t.forEach((({pendingPromise:t},r)=>t.resolve?.([e[r],e])))})).catch((e=>{t.forEach((({pendingPromise:t})=>t.reject?.(e)))}))},s=()=>n.delete(t),a=()=>n.get(t)||[],c=e=>n.set(t,[...a(),e]);return{flush:s,async schedule(e){const t={},n=new Promise(((e,r)=>{t.resolve=e,t.reject=r})),s=r?.([...a().map((({args:e})=>e)),e]);return s&&o(),a().length>0?(c({args:e,pendingPromise:t}),n):(c({args:e,pendingPromise:t}),setTimeout(o,i),n)}}}},1344:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});const n=(e,t,r)=>JSON.stringify(e,((e,r)=>{const n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n}),r)},3134:(e,t,r)=>{"use strict";r.d(t,{F:()=>c});var n=r(1431),i=r(2960),o=r(6054),s=r(4574),a=r(7451);function c(e){const{account:t,gasPrice:r,maxFeePerGas:c,maxPriorityFeePerGas:l,to:u}=e,h=t?(0,n.T)(t):void 0;if(h&&!(0,a.U)(h.address))throw new i.b({address:h.address});if(u&&!(0,a.U)(u))throw new i.b({address:u});if(void 0!==r&&(void 0!==c||void 0!==l))throw new s.xY;if(c&&c>2n**256n-1n)throw new o.Hh({maxFeePerGas:c});if(l&&c&&l>c)throw new o.cs({maxFeePerGas:c,maxPriorityFeePerGas:l})}},6665:(e,t,r)=>{"use strict";r.d(t,{d:()=>o});var n=r(8617),i=r(263);function o(e,t="wei"){return(0,i.b)(e,n.ez[t])}},6283:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(8617),i=r(263);function o(e,t="wei"){return(0,i.b)(e,n.Zn[t])}},263:(e,t,r)=>{"use strict";function n(e,t){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[i,o]=[r.slice(0,r.length-t),r.slice(r.length-t)];return o=o.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${o?`.${o}`:""}`}r.d(t,{b:()=>n})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=r(6729),t={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0},n={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}},i=r(1786),o=r(169),s=r(6872);r(5491);const a={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function c(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,o.ly)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,o.ly)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?a[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip2930"===t.type&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t}function l(e){const t=e.transactions?.map((e=>"string"==typeof e?e:c(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,difficulty:e.difficulty?BigInt(e.difficulty):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}function u(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}const h={"0x0":"reverted","0x1":"success"};function d(e){return{...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>u(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,o.ly)(e.transactionIndex):null,status:e.status?h[e.status]:null,type:e.type?a[e.type]||e.type:null}}var p=r(3822);const f=(0,i.ax)(t),m=(0,i.ax)(n);var g=Object.defineProperty,w=(e,t,r)=>(((e,t,r)=>{t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),b=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},v=(e,t,r)=>(b(e,t,"read from private field"),r?r.call(e):t.get(e)),y=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},x=(e,t,r,n)=>(b(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),A=(e,t,r)=>(b(e,t,"access private method"),r),C=class extends e{constructor({chains:e=[m,f],options:t}){super(),w(this,"chains"),w(this,"options"),w(this,"storage"),this.chains=e,this.options=t}getBlockExplorerUrls(e){const{default:t,...r}=e.blockExplorers??{};if(t)return[t.url,...Object.values(r).map((e=>e.url))]}isChainUnsupported(e){return!this.chains.some((t=>t.id===e))}setStorage(e){this.storage=e}},E=class extends Error{constructor({chainId:e,connectorId:t}){super(`Chain "${e}" not configured for connector "${t}".`),w(this,"name","ChainNotConfiguredForConnectorError")}},I=class extends Error{constructor(){super(...arguments),w(this,"name","ConnectorNotFoundError"),w(this,"message","Connector not found")}};function _(e){return"string"==typeof e?Number.parseInt(e,"0x"===e.trim().substring(0,2)?16:10):"bigint"==typeof e?Number(e):e}var P=r(2221),O=r(2455),S=r(1431);const k=256;let M,T=k;function N(e=11){if(!M||T+e>2*k){M="",T=0;for(let e=0;e"type"in e&&"constructor"===e.type));if(!n)throw new L.fM({docsPath:U});if(!("inputs"in n))throw new L.cO({docsPath:U});if(!n.inputs||0===n.inputs.length)throw new L.cO({docsPath:U});const i=(0,$.E)(n.inputs,t);return(0,B.SM)([r,i])}var z=r(9977);class W extends z.G{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}var F=r(4574),H=r(968),q=r(1019),V=r(3134),G=r(6665),K=r(6283);class Z extends z.G{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:o,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:l,to:u,value:h}){const d=(0,F.xr)({from:t?.address,to:u,value:void 0!==h&&`${(0,G.d)(h)} ${n?.nativeCurrency.symbol||"ETH"}`,data:i,gas:o,gasPrice:void 0!==s&&`${(0,K.o)(s)} gwei`,maxFeePerGas:void 0!==a&&`${(0,K.o)(a)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${(0,K.o)(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",d].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}async function Q(e,t){const r=t.account??e.account;if(!r)throw new W({docsPath:"/docs/actions/public/estimateGas"});const n=(0,S.T)(r);try{const{accessList:r,blockNumber:i,blockTag:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:h,nonce:d,to:f,value:m,...g}="local"===n.type?await re(e,t):t,w=(i?(0,s.eC)(i):void 0)||o;(0,V.F)(t);const b=e.chain?.formatters?.transactionRequest?.format||p.t,v=b({...(0,q.K)(g,{format:b}),from:n.address,accessList:r,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:h,nonce:d,to:f,value:m}),y=await e.request({method:"eth_estimateGas",params:w?[v,w]:[v]});return BigInt(y)}catch(r){throw function(e,{docsPath:t,...r}){let n=e;return(0,H.B)(e)&&(n=(0,H.k)(e,r)),new Z(n,{docsPath:t,...r})}(r,{...t,account:n,chain:e.chain})}}class Y extends z.G{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function J(e,{blockHash:t,blockNumber:r,blockTag:n="latest",includeTransactions:i=!1}={}){const o=void 0!==r?(0,s.eC)(r):void 0;let a=null;if(a=t?await e.request({method:"eth_getBlockByHash",params:[t,i]}):await e.request({method:"eth_getBlockByNumber",params:[o||n,i]}),!a)throw new Y({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||l)(a)}async function X(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function ee(e,{address:t,blockTag:r="latest",blockNumber:n}){const i=await e.request({method:"eth_getTransactionCount",params:[t,n?(0,s.eC)(n):r]});return(0,o.ly)(i)}const te=1500000000n;async function re(e,t){const{account:r,gas:n,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:s,nonce:a}=t;if(!r)throw new W;const c=(0,S.T)(r),l=await J(e,{blockTag:"latest"}),u={...t,from:c.address};if(void 0===a&&(u.nonce=await ee(e,{address:c.address,blockTag:"pending"})),l.baseFeePerGas){if(void 0!==i)throw new z.G("Chain does not support legacy `gasPrice`.");if(void 0===o)u.maxPriorityFeePerGas=s??te,u.maxFeePerGas=120n*l.baseFeePerGas/100n+u.maxPriorityFeePerGas;else{if(void 0===s&&o{for(const r of e){const{name:e,type:n}=r,a=n,c=t[e],l=a.match(ue);if(l&&("number"==typeof c||"bigint"==typeof c)){const[e,t,r]=l;(0,s.eC)(c,{signed:"int"===t,size:parseInt(r)/8})}if("address"===a&&"string"==typeof c&&!(0,ae.U)(c))throw new se.b({address:c});const u=a.match(le);if(u){const[e,t]=u;if(t&&(0,ce.d)(c)!==parseInt(t))throw new L.KY({expectedSize:parseInt(t),givenSize:(0,ce.d)(c)})}const h=i[a];h&&o(h,c)}};if(i.EIP712Domain&&e&&o(i.EIP712Domain,e),"EIP712Domain"!==r){const e=i[r];o(e,t)}}var de=r(6606);const pe=e=>({addChain:t=>async function(e,{chain:t}){const{id:r,name:n,nativeCurrency:i,rpcUrls:o,blockExplorers:a}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:(0,s.eC)(r),chainName:n,nativeCurrency:i,rpcUrls:o.default.http,blockExplorerUrls:a?Object.values(a).map((({url:e})=>e)):void 0}]})}(e,t),deployContract:t=>function(e,{abi:t,args:r,bytecode:n,...i}){return ne(e,{...i,data:D({abi:t,args:r,bytecode:n})})}(e,t),getAddresses:()=>async function(e){return(await e.request({method:"eth_accounts"})).map((e=>(0,P.x)(e)))}(e),getChainId:()=>R(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"})}(e),requestAddresses:()=>async function(e){return(await e.request({method:"eth_requestAccounts"})).map((e=>(0,P.K)(e)))}(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]})}(e,t),sendTransaction:t=>ne(e,t),signMessage:t=>async function(e,{account:t=e.account,message:r}){if(!t)throw new W({docsPath:"/docs/actions/wallet/signMessage"});const n=(0,S.T)(t);if("local"===n.type)return n.signMessage({message:r});const i="string"==typeof r?(0,s.$G)(r):r.raw instanceof Uint8Array?(0,s.NC)(r.raw):r.raw;return e.request({method:"personal_sign",params:[i,n.address]})}(e,t),signTypedData:t=>async function(e,{account:t=e.account,domain:r,message:n,primaryType:i,types:o}){if(!t)throw new W({docsPath:"/docs/actions/wallet/signTypedData"});const s=(0,S.T)(t),a={EIP712Domain:["string"==typeof r?.name&&{name:"name",type:"string"},r?.version&&{name:"version",type:"string"},"number"==typeof r?.chainId&&{name:"chainId",type:"uint256"},r?.verifyingContract&&{name:"verifyingContract",type:"address"},r?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...o};if(he({domain:r,message:n,primaryType:i,types:a}),"local"===s.type)return s.signTypedData({domain:r,primaryType:i,types:a,message:n});const c=(0,oe.P)({domain:r??{},primaryType:i,types:a,message:n},((e,t)=>(0,ie.v)(t)?t.toLowerCase():t));return e.request({method:"eth_signTypedData_v4",params:[s.address,c]})}(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,s.eC)(t)}]})}(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t})}(e,t),writeContract:t=>async function(e,{abi:t,address:r,args:n,dataSuffix:i,functionName:o,...s}){const a=(0,de.R)({abi:t,args:n,functionName:o});return await ne(e,{data:`${a}${i?i.replace("0x",""):""}`,to:r,...s})}(e,t)});function fe({account:e,chain:t,transport:r,key:n="wallet",name:i="Wallet Client",pollingInterval:o}){const s={...j({chain:t,key:n,name:i,pollingInterval:o,transport:e=>r({...e,retryCount:0}),type:"walletClient"}),account:e?(0,S.T)(e):void 0};return{...s,...pe(s)}}var me=r(8822);async function ge(e){return new Promise((t=>setTimeout(t,e)))}function we(e,{delay:t=100,retryCount:r=2,shouldRetry:n=(()=>!0)}={}){return new Promise(((i,o)=>{const s=async({count:a=0}={})=>{try{const t=await e();i(t)}catch(e){if(a{const r="function"==typeof t?t({count:a,error:e}):t;r&&await ge(r),s({count:a+1})})({error:e});o(e)}};s()}))}const be=e=>"code"in e?-1!==e.code&&-32004!==e.code&&-32005!==e.code&&-32042!==e.code&&-32603!==e.code:!!(e instanceof me.Gg&&e.status)&&403!==e.status&&408!==e.status&&413!==e.status&&429!==e.status&&500!==e.status&&502!==e.status&&503!==e.status&&504!==e.status;function ve(e,{retryDelay:t=150,retryCount:r=3}={}){return async n=>we((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case O.s7.code:throw new O.s7(t);case O.B.code:throw new O.B(t);case O.LX.code:throw new O.LX(t);case O.nY.code:throw new O.nY(t);case O.XS.code:throw new O.XS(t);case O.yR.code:throw new O.yR(t);case O.Og.code:throw new O.Og(t);case O.pT.code:throw new O.pT(t);case O.KB.code:throw new O.KB(t);case O.gS.code:throw new O.gS(t);case O.Pv.code:throw new O.Pv(t);case O.GD.code:throw new O.GD(t);case O.ab.code:throw new O.ab(t);case O.PE.code:throw new O.PE(t);case O.Ts.code:throw new O.Ts(t);case O.u5.code:throw new O.u5(t);case O.I0.code:throw new O.I0(t);case O.x3.code:throw new O.x3(t);default:if(e instanceof z.G)throw e;throw new O.ir(t)}}}),{delay:({count:e,error:r})=>{if(r&&r instanceof me.Gg){const e=r?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return~~(1<!be(e)})}function ye({key:e,name:t,request:r,retryCount:n=3,retryDelay:i=150,timeout:o,type:s},a){return{config:{key:e,name:t,request:r,retryCount:n,retryDelay:i,timeout:o,type:s},request:ve(r,{retryCount:n,retryDelay:i}),value:a}}function xe(e,t={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=t;return({retryCount:o})=>ye({key:r,name:n,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:i,type:"custom"})}var Ae,Ce=class extends C{constructor({chains:e,options:t}={}){const r={shimDisconnect:!0,getProvider(){if("undefined"==typeof window)return;const e=window.ethereum;return e?.providers?e.providers[0]:e},...t};super({chains:e,options:r}),w(this,"id","injected"),w(this,"name"),w(this,"ready"),y(this,Ae,void 0),w(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),w(this,"onAccountsChanged",(e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,P.K)(e[0])})})),w(this,"onChainChanged",(e=>{const t=_(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})})),w(this,"onDisconnect",(async e=>{1013===e.code&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&this.storage?.removeItem(this.shimDisconnectKey))}));const n=r.getProvider();if("string"==typeof r.name)this.name=r.name;else if(n){const e=function(e){if(!e)return"Injected";const t=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isStatus?"Status":e.isTalisman?"Talisman":e.isTally?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0;if(e.providers?.length){const r=new Set;let n=1;for(const i of e.providers){let e=t(i);e||(e=`Unknown Wallet #${n}`,n+=1),r.add(e)}const i=[...r];return i.length?i:i[0]??"Injected"}return t(e)??"Injected"}(n);r.name?this.name=r.name(e):this.name="string"==typeof e?e:e[0]}else this.name="Injected";this.ready=!!n}async connect({chainId:e}={}){try{const t=await this.getProvider();if(!t)throw new I;t.on&&(t.on("accountsChanged",this.onAccountsChanged),t.on("chainChanged",this.onChainChanged),t.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const r=await t.request({method:"eth_requestAccounts"}),n=(0,P.K)(r[0]);let i=await this.getChainId(),o=this.isChainUnsupported(i);return e&&i!==e&&(i=(await this.switchChain(e)).id,o=this.isChainUnsupported(i)),this.options.shimDisconnect&&this.storage?.setItem(this.shimDisconnectKey,!0),{account:n,chain:{id:i,unsupported:o}}}catch(e){if(this.isUserRejectedRequestError(e))throw new O.ab(e);if(-32002===e.code)throw new O.pT(e);throw e}}async disconnect(){const e=await this.getProvider();e?.removeListener&&(e.removeListener("accountsChanged",this.onAccountsChanged),e.removeListener("chainChanged",this.onChainChanged),e.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&this.storage?.removeItem(this.shimDisconnectKey))}async getAccount(){const e=await this.getProvider();if(!e)throw new I;const t=await e.request({method:"eth_accounts"});return(0,P.K)(t[0])}async getChainId(){const e=await this.getProvider();if(!e)throw new I;return e.request({method:"eth_chainId"}).then(_)}async getProvider(){const e=this.options.getProvider();return e&&x(this,Ae,e),v(this,Ae)}async getWalletClient({chainId:e}={}){const[t,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find((t=>t.id===e));if(!t)throw new Error("provider is required.");return fe({account:r,chain:n,transport:xe(t)})}async isAuthorized(){try{if(this.options.shimDisconnect&&!this.storage?.getItem(this.shimDisconnectKey))return!1;if(!await this.getProvider())throw new I;return!!await this.getAccount()}catch{return!1}}async switchChain(e){const t=await this.getProvider();if(!t)throw new I;const r=(0,s.eC)(e);try{return await Promise.all([t.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),new Promise((t=>this.on("change",(({chain:r})=>{r?.id===e&&t()}))))]),this.chains.find((t=>t.id===e))??{id:e,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(n){const i=this.chains.find((t=>t.id===e));if(!i)throw new E({chainId:e,connectorId:this.id});if(4902===n.code||4902===n?.data?.originalError?.code)try{if(await t.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:i.name,nativeCurrency:i.nativeCurrency,rpcUrls:[i.rpcUrls.public?.http[0]??""],blockExplorerUrls:this.getBlockExplorerUrls(i)}]}),await this.getChainId()!==e)throw new O.ab(new Error("User rejected switch after adding network."));return i}catch(e){throw new O.ab(e)}if(this.isUserRejectedRequestError(n))throw new O.ab(n);throw new O.x3(n)}}async watchAsset({address:e,decimals:t=18,image:r,symbol:n}){const i=await this.getProvider();if(!i)throw new I;return i.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,decimals:t,image:r,symbol:n}}})}isUserRejectedRequestError(e){return 4001===e.code}};Ae=new WeakMap;var Ee=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Ie=(e,t,r)=>(Ee(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Pe=(e,t,r,n)=>(Ee(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Oe=r(1920),Se=r(6647),ke=r(1826),Me=r(6873),Te=r(1327),Ne=r(7871);function je(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return(0,ie.v)(t)?t:null}function Re(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,s.ci)(t);const r=e.split(".");for(let e=r.length-1;e>=0;e-=1){const n=je(r[e]),i=n?(0,Te.O0)(n):(0,Ne.w)((0,Te.qX)(r[e]),"bytes");t=(0,Ne.w)((0,B.zo)([t,i]),"bytes")}return(0,s.ci)(t)}function Le(e){const t=new Uint8Array(32).fill(0);return e?je(e)||(0,Ne.w)((0,Te.qX)(e)):(0,s.ci)(t)}function Be(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const r=new Uint8Array((0,Te.qX)(t).byteLength+2);let n=0;const i=t.split(".");for(let e=0;e255&&(t=(0,Te.qX)(`[${Le(i[e]).slice(2)}]`)),r[n]=t.length,r.set(t,n+1),n+=t.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const $e=3;function Ue(e,{abi:t,address:r,args:n,docsPath:i,functionName:o,sender:s}){const{code:a,data:c,message:l,shortMessage:u}=e instanceof Se.VQ?e:e instanceof z.G?e.walk((e=>"data"in e)):{};let h=e;return e instanceof L.wb?h=new Se.Dk({functionName:o}):a===$e&&(c||l||u)&&(h=new Se.Lu({abi:t,data:"object"==typeof c?c.data:c,functionName:o,message:u??l})),new Se.uq(h,{abi:t,args:n,contractAddress:r,docsPath:i,functionName:o,sender:s})}var De=r(5291);async function ze(e,{abi:t,address:r,args:n,functionName:i,...o}){const s=(0,de.R)({abi:t,args:n,functionName:i});try{const{data:a}=await(0,De.R)(e,{data:s,to:r,...o});return(0,ke.k)({abi:t,args:n,functionName:i,data:a||"0x"})}catch(e){throw Ue(e,{abi:t,address:r,args:n,docsPath:"/docs/contract/readContract",functionName:i})}}class We extends z.G{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class Fe extends z.G{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class He extends z.G{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class qe extends z.G{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Ve=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Ge=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,Ke=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Ze=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function Qe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Ye({uri:e,gatewayUrls:t}){const r=Ke.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};const n=Qe(t?.ipfs,"https://ipfs.io"),i=Qe(t?.arweave,"https://arweave.net"),o=e.match(Ve),{protocol:s,subpath:a,target:c,subtarget:l=""}=o?.groups||{},u="ipns:/"===s||"ipns/"===a,h="ipfs:/"===s||"ipfs/"===a||Ge.test(e);if(e.startsWith("http")&&!u&&!h){let r=e;return t?.arweave&&(r=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:r,isOnChain:!1,isEncoded:!1}}if((u||h)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===s&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(Ze,"");if(d.startsWith("{const r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e}))}}(r);if(i)return r;throw new He({uri:t})}async function et(e,{blockNumber:t,blockTag:r,name:n,key:o,universalResolverAddress:a}){let c=a;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=(0,i.LI)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const l=await ze(e,{address:c,abi:Oe.lD,functionName:"resolve",args:[(0,s.NC)(Be(n)),(0,de.R)({abi:Oe.nZ,functionName:"text",args:[Re(n),o]})],blockNumber:t,blockTag:r});if("0x"===l[0])return null;const u=(0,ke.k)({abi:Oe.nZ,functionName:"text",data:l[0]});return""===u?null:u}var tt=r(5554);function rt(e,{method:t}){const r={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:n,status:i,transport:o})=>{"success"===i&&t===e&&(r[n]=o.request)})),t=>r[t]||e.request}class nt extends z.G{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}var it=r(3693);const ot=e=>"string"==typeof e?(0,it.F)(e):(0,it.J)(e);var st=r(1494),at=r(8604);function ct({abi:e,eventName:t,args:r}){let n=e[0];if(t&&(n=(0,at.m)({abi:e,args:r,name:t}),!n))throw new L.mv(t,{docsPath:"/docs/contract/encodeEventTopics"});if("event"!==n.type)throw new L.mv(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const i=(0,st.t)(n),o=ot(i);let s=[];if(r&&"inputs"in n){const e=n.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(r)?r:Object.values(r).length>0?e?.map((e=>r[e.name]))??[]:[];t.length>0&&(s=e?.map(((e,r)=>Array.isArray(t[r])?t[r].map(((n,i)=>lt({param:e,value:t[r][i]}))):t[r]?lt({param:e,value:t[r]}):null))??[])}return[o,...s]}function lt({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return(0,Ne.w)((0,Te.O0)(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new nt(e.type);return(0,$.E)([e],[t])}async function ut(e,{address:t,abi:r,args:n,eventName:i,fromBlock:o,strict:a,toBlock:c}){const l=rt(e,{method:"eth_newFilter"}),u=i?ct({abi:r,args:n,eventName:i}):void 0,h=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof o?(0,s.eC)(o):o,toBlock:"bigint"==typeof c?(0,s.eC)(c):c,topics:u}]});return{abi:r,args:n,eventName:i,id:h,request:l(h),strict:a,type:"event"}}async function ht(e,{address:t,args:r,event:n,fromBlock:i,strict:o,toBlock:a}={}){const c=rt(e,{method:"eth_newFilter"});let l=[];n&&(l=ct({abi:[n],eventName:n.name,args:r}));const u=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?(0,s.eC)(i):i,toBlock:"bigint"==typeof a?(0,s.eC)(a):a,...l.length?{topics:l}:{}}]});return{abi:n?[n]:void 0,args:r,eventName:n?n.name:void 0,id:u,request:c(u),strict:o,type:"event"}}async function dt(e){const t=rt(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}const pt=new Map,ft=new Map;const mt=e=>`blockNumber.${e}`;async function gt(e,{maxAge:t=e.pollingInterval}={}){const r=await async function(e,{cacheKey:t,maxAge:r=1/0}){const n=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),r=t(e,pt),n=t(e,ft);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}(t),i=n.response.get();if(i&&r>0&&(new Date).getTime()-i.created.getTime()e.request({method:"eth_blockNumber"})),{cacheKey:mt(e.uid),maxAge:t});return BigInt(r)}var wt=r(558);const bt="/docs/contract/decodeEventLog";function vt({abi:e,data:t,strict:r,topics:n}){const i=r??!0,[o,...s]=n;if(!o)throw new L.FM({docsPath:bt});const a=e.find((e=>"event"===e.type&&o===ot((0,st.t)(e))));if(!a||!("name"in a)||"event"!==a.type)throw new L.lC(o,{docsPath:bt});const{name:c,inputs:l}=a,u=l?.some((e=>!("name"in e&&e.name)));let h=u?[]:{};const d=l.filter((e=>"indexed"in e&&e.indexed));if(s.length>0)for(let e=0;e!("indexed"in e&&e.indexed)));if(p.length>0)if(t&&"0x"!==t)try{const e=(0,wt.r)(p,t);if(e)if(u)h=[...h,...e];else for(let t=0;t0?h:void 0}}function yt({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,wt.r)([e],t)||[])[0]}async function xt(e,{filter:t}){const r="strict"in t&&t.strict;return(await t.request({method:"eth_getFilterChanges",params:[t.id]})).map((e=>{if("string"==typeof e)return e;try{const{eventName:n,args:i}="abi"in t&&t.abi?vt({abi:t.abi,data:e.data,topics:e.topics,strict:r}):{eventName:void 0,args:void 0};return u(e,{args:i,eventName:n})}catch(r){let n,i;if(r instanceof L.SM||r instanceof L.Gy){if("strict"in t&&t.strict)return;n=r.abiItem.name,i=r.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return u(e,{args:i?[]:{},eventName:n})}})).filter(Boolean)}async function At(e,{address:t,blockHash:r,fromBlock:n,toBlock:i,event:o,args:a,strict:c}={}){const l=c??!1;let h,d=[];return o&&(d=ct({abi:[o],eventName:o.name,args:a})),h=r?await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:"bigint"==typeof n?(0,s.eC)(n):n,toBlock:"bigint"==typeof i?(0,s.eC)(i):i}]}),h.map((e=>{try{const{eventName:t,args:r}=o?vt({abi:[o],data:e.data,topics:e.topics,strict:l}):{eventName:void 0,args:void 0};return u(e,{args:r,eventName:t})}catch(t){let r,n;if(t instanceof L.SM||t instanceof L.Gy){if(l)return;r=t.abiItem.name,n=t.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return u(e,{args:n?[]:{},eventName:r})}})).filter(Boolean)}async function Ct(e,{blockHash:t,blockNumber:r,blockTag:n="latest",hash:i,index:o}){const a=void 0!==r?(0,s.eC)(r):void 0;let l=null;if(i?l=await e.request({method:"eth_getTransactionByHash",params:[i]}):t?l=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,s.eC)(o)]}):(a||n)&&(l=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||n,(0,s.eC)(o)]})),!l)throw new F.Bh({blockHash:t,blockNumber:r,blockTag:n,hash:i,index:o});return(e.chain?.formatters?.transaction?.format||c)(l)}async function Et(e,{hash:t}){const r=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!r)throw new F.Yb({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||d)(r)}async function It(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const _t="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";async function Pt(e,{address:t,hash:r,signature:n,...i}){const o=(0,ie.v)(n)?n:(0,s.NC)(n);try{const{data:n}=await(0,De.R)(e,{data:D({abi:Oe.$o,args:[t,r,o],bytecode:_t}),...i});return a=n??"0x0",c="0x1",function(e,t){if(e.length!==t.length)return!1;for(let r=0;r`${t} ${e}`)).join(",")})`;return r}({primaryType:e,types:t}));return(0,Ne.w)(r)}function Tt({primaryType:e,types:t},r=new Set){const n=e.match(/^\w*/u),i=n?.[0];if(r.has(i)||void 0===t[i])return r;r.add(i);for(const e of t[i])Tt({primaryType:e.type,types:t},r);return r}function Nt({types:e,name:t,type:r,value:n}){if(void 0!==e[r])return[{type:"bytes32"},(0,Ne.w)(kt({data:n,primaryType:r,types:e}))];if("bytes"===r)return n="0x"+((n.length%2?"0":"")+n.slice(2)),[{type:"bytes32"},(0,Ne.w)(n)];if("string"===r)return[{type:"bytes32"},(0,Ne.w)((0,s.NC)(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),o=n.map((r=>Nt({name:t,type:i,types:e,value:r})));return[{type:"bytes32"},(0,Ne.w)((0,$.E)(o.map((([e])=>e)),o.map((([,e])=>e))))]}return[{type:r},n]}BigInt(0),BigInt(1),BigInt(2),Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const jt=new Map,Rt=new Map;let Lt=0;function Bt(e,t,r){const n=++Lt,i=()=>jt.get(e)||[],o=()=>{const t=Rt.get(e);1===i().length&&t&&t(),(()=>{const t=i();jt.set(e,t.filter((e=>e.id!==n)))})()},s=i();if(jt.set(e,[...s,{id:n,fns:t}]),s&&s.length>0)return o;const a={};for(const e in t)a[e]=(...t)=>{const r=i();0!==r.length&&r.forEach((r=>r.fns[e]?.(...t)))};const c=r(a);return"function"==typeof c&&Rt.set(e,c),o}function $t(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let i=!0;const o=()=>i=!1;return(async()=>{let s;t&&(s=await e({unpoll:o}));const a=await(r?.(s))??n;await ge(a);const c=async()=>{i&&(await e({unpoll:o}),await ge(n),c())};c()})(),o}function Ut(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:a=e.pollingInterval}){let c;return(void 0!==s?s:"webSocket"!==e.transport.type)?Bt((0,oe.P)(["watchBlockNumber",e.uid,t,r,a]),{onBlockNumber:n,onError:i},(n=>$t((async()=>{try{const t=await gt(e,{maxAge:0});if(c){if(t===c)return;if(t-c>1&&r)for(let e=c+1n;ec)&&(n.onBlockNumber(t,c),c=t)}catch(e){n.onError?.(e)}}),{emitOnBegin:t,interval:a}))):(()=>{let t=!0,r=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newHeads"],onData(e){if(!t)return;const r=(0,o.y_)(e.result?.number);n(r,c),c=r},onError(e){i?.(e)}});r=s,t||r()}catch(e){i?.(e)}})(),r})()}const Dt=e=>({call:t=>(0,De.R)(e,t),createBlockFilter:()=>async function(e){const t=rt(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}(e),createContractEventFilter:t=>ut(e,t),createEventFilter:t=>ht(e,t),createPendingTransactionFilter:()=>dt(e),estimateContractGas:t=>async function(e,{abi:t,address:r,args:n,functionName:i,...o}){const s=(0,de.R)({abi:t,args:n,functionName:i});try{return await Q(e,{data:s,to:r,...o})}catch(e){const s=o.account?(0,S.T)(o.account):void 0;throw Ue(e,{abi:t,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:i,sender:s?.address})}}(e,t),estimateGas:t=>Q(e,t),getBalance:t=>async function(e,{address:t,blockNumber:r,blockTag:n="latest"}){const i=r?(0,s.eC)(r):void 0,o=await e.request({method:"eth_getBalance",params:[t,i||n]});return BigInt(o)}(e,t),getBlock:t=>J(e,t),getBlockNumber:t=>gt(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){const i=void 0!==r?(0,s.eC)(r):void 0;let a;return a=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),(0,o.ly)(a)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:r,blockTag:n="latest"}){const i=void 0!==r?(0,s.eC)(r):void 0,o=await e.request({method:"eth_getCode",params:[t,i||n]});if("0x"!==o)return o}(e,t),getChainId:()=>R(e),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:r,name:n,universalResolverAddress:o}){let a=o;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=(0,i.LI)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=await ze(e,{address:a,abi:Oe.lD,functionName:"resolve",args:[(0,s.NC)(Be(n)),(0,de.R)({abi:Oe.Ei,functionName:"addr",args:[Re(n)]})],blockNumber:t,blockTag:r});if("0x"===i[0])return null;const o=(0,ke.k)({abi:Oe.Ei,functionName:"addr",data:i[0]});return"0x00"===(0,Me.f)(o)?null:o}catch(e){if(e instanceof Se.uq){const t=e.cause?.reason;if(t?.includes("Wildcard on non-extended resolvers is not supported"))return null}throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:r,gatewayUrls:n,name:i,universalResolverAddress:o}){const s=await et(e,{blockNumber:t,blockTag:r,key:"avatar",name:i,universalResolverAddress:o});if(!s)return null;try{return await async function(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?async function(e,{gatewayUrls:t,record:r}){const n=function(e){e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[t,r,n]=e.split("/"),[i,o]=t.split(":"),[s,a]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new Fe({reason:"Only EIP-155 supported"});if(!o)throw new Fe({reason:"Chain ID not found"});if(!a)throw new Fe({reason:"Contract address not found"});if(!n)throw new Fe({reason:"Token ID not found"});if(!s)throw new Fe({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:s.toLowerCase(),contractAddress:a,tokenID:n}}(r),i=await async function(e,{nft:t}){if("erc721"===t.namespace)return ze(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return ze(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new qe({namespace:t.namespace})}(e,{nft:n}),{uri:o,isOnChain:s,isEncoded:a}=Ye({uri:i,gatewayUrls:t});if(s&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const e=a?atob(o.replace("data:application/json;base64,","")):o;return Xe({uri:Je(JSON.parse(e)),gatewayUrls:t})}let c=n.tokenID;return"erc1155"===n.namespace&&(c=c.replace("0x","").padStart(64,"0")),async function({gatewayUrls:e,uri:t}){try{const r=await fetch(t).then((e=>e.json()));return await Xe({gatewayUrls:e,uri:Je(r)})}catch{throw new He({uri:t})}}({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:r}):Xe({uri:r,gatewayUrls:t})}(e,{record:s,gatewayUrls:n})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:r,blockTag:n,universalResolverAddress:o}){let a=o;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=(0,i.LI)({blockNumber:r,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{return(await ze(e,{address:a,abi:[{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],functionName:"reverse",args:[(0,s.NC)(Be(c))],blockNumber:r,blockTag:n}))[0]}catch(e){if(e instanceof Se.uq&&e.cause.reason===tt.$[50])return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:r,name:n,universalResolverAddress:o}){let a=o;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=(0,i.LI)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[c]=await ze(e,{address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,s.NC)(Be(n))],blockNumber:t,blockTag:r});return c}(e,t),getEnsText:t=>et(e,t),getFeeHistory:t=>async function(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const o=r?(0,s.eC)(r):void 0;return{baseFeePerGas:(a=await e.request({method:"eth_feeHistory",params:[(0,s.eC)(t),o||n,i]})).baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:a.gasUsedRatio,oldestBlock:BigInt(a.oldestBlock),reward:a.reward?.map((e=>e.map((e=>BigInt(e)))))};var a}(e,t),getFilterChanges:e=>xt(0,e),getFilterLogs:e=>async function(e,{filter:t}){const r=t.strict??!1;return(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>{try{const{eventName:n,args:i}="abi"in t&&t.abi?vt({abi:t.abi,data:e.data,topics:e.topics,strict:r}):{eventName:void 0,args:void 0};return u(e,{args:i,eventName:n})}catch(r){let n,i;if(r instanceof L.SM||r instanceof L.Gy){if("strict"in t&&t.strict)return;n=r.abiItem.name,i=r.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return u(e,{args:i?[]:{},eventName:n})}})).filter(Boolean)}(0,e),getGasPrice:()=>X(e),getLogs:t=>At(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:r,blockTag:n="latest",slot:i}){const o=void 0!==r?(0,s.eC)(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,i,o||n]})}(e,t),getTransaction:t=>Ct(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:r}){const[n,i]=await Promise.all([gt(e),t?Ct(e,{hash:t}):void 0]),o=r?.blockNumber||i?.blockNumber;return o?n-o+1n:0n}(e,t),getTransactionCount:t=>ee(e,t),getTransactionReceipt:t=>Et(e,t),multicall:t=>async function(e,t){const{allowFailure:r=!0,batchSize:n,blockNumber:o,blockTag:s,contracts:a,multicallAddress:c}=t,l=n??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024),u=a;let h=c;if(!h){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");h=(0,i.LI)({blockNumber:o,chain:e.chain,contract:"multicall3"})}const d=[[]];let p=0,f=0;for(let e=0;e0&&f>l&&(p++,f=(e.length-2)/2,d[p]=[]),d[p]=[...d[p],{allowFailure:!0,callData:e,target:n}]}catch(e){const s=Ue(e,{abi:t,address:n,args:i,docsPath:"/docs/contract/multicall",functionName:o});if(!r)throw s;d[p]=[...d[p],{allowFailure:!0,callData:"0x",target:n}]}}return(await Promise.all(d.map((t=>ze(e,{abi:Oe.F8,address:h,args:[t],blockNumber:o,blockTag:s,functionName:"aggregate3"}))))).flat().map((({returnData:e,success:t},n)=>{const i=d.flat(),{callData:o}=i[n],{abi:s,address:a,functionName:c,args:l}=u[n];try{if("0x"===o)throw new L.wb;if(!t)throw new Se.VQ({data:e});const n=(0,ke.k)({abi:s,data:e,functionName:c});return r?{result:n,status:"success"}:n}catch(e){const t=Ue(e,{abi:s,address:a,args:l,docsPath:"/docs/contract/multicall",functionName:c});if(!r)throw t;return{error:t,result:void 0,status:"failure"}}}))}(e,t),readContract:t=>ze(e,t),simulateContract:t=>async function(e,{abi:t,address:r,args:n,dataSuffix:i,functionName:o,...s}){const a=s.account?(0,S.T)(s.account):void 0,c=(0,de.R)({abi:t,args:n,functionName:o});try{const{data:a}=await(0,De.R)(e,{batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...s});return{result:(0,ke.k)({abi:t,args:n,functionName:o,data:a||"0x"}),request:{abi:t,address:r,args:n,functionName:o,...s}}}catch(e){throw Ue(e,{abi:t,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:o,sender:a?.address})}}(e,t),verifyMessage:t=>async function(e,{address:t,message:r,signature:n,...i}){const o=function(e,t){const r="string"==typeof e?(0,Te.qX)(e):e.raw instanceof Uint8Array?e.raw:(0,Te.O0)(e.raw),n=(0,Te.qX)(`Ethereum Signed Message:\n${r.length}`);return(0,Ne.w)((0,B.zo)([n,r]),void 0)}(r);return Pt(e,{address:t,hash:o,signature:n,...i})}(e,t),verifyTypedData:t=>async function(e,{address:t,signature:r,message:n,primaryType:i,types:o,domain:s,...a}){return Pt(e,{address:t,hash:Ot({message:n,primaryType:i,types:o,domain:s}),signature:r,...a})}(e,t),uninstallFilter:e=>It(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:r,onReplaced:n,pollingInterval:i=e.pollingInterval,timeout:o}){const s=(0,oe.P)(["waitForTransactionReceipt",e.uid,r]);let a,c,l,u=!1;return new Promise(((h,d)=>{o&&setTimeout((()=>d(new F.mc({hash:r}))),o);const p=Bt(s,{onReplaced:n,resolve:h,reject:d},(n=>{const o=Ut(e,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(i){if(u)return;let s=i;const h=async e=>{o(),e(),p()};try{if(l){if(s-l.blockNumber+1nn.resolve(l)))}if(a||(u=!0,await we((async()=>{a=await Ct(e,{hash:r}),a.blockNumber&&(s=a.blockNumber)}),{delay:({count:e})=>200*~~(1<0&&s-l.blockNumber+1nn.resolve(l)))}catch(r){if(a&&(r instanceof F.Bh||r instanceof F.Yb)){c=a;const r=(await J(e,{blockNumber:s,includeTransactions:!0})).transactions.find((({from:e,nonce:t})=>e===c.from&&t===c.nonce));if(!r)return;if(l=await Et(e,{hash:r.hash}),s-l.blockNumber+1n{n.onReplaced?.({reason:i,replacedTransaction:c,transaction:r,transactionReceipt:l}),n.resolve(l)}))}else h((()=>n.reject(r)))}}});return o}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:o,includeTransactions:s=!1,poll:a,pollingInterval:c=e.pollingInterval}){let u;return(void 0!==a?a:"webSocket"!==e.transport.type)?Bt((0,oe.P)(["watchBlocks",e.uid,r,n,s,c]),{onBlock:i,onError:o},(i=>$t((async()=>{try{const n=await J(e,{blockTag:t,includeTransactions:s});if(n.number&&u?.number){if(n.number===u.number)return;if(n.number-u.number>1&&r)for(let t=u?.number+1n;tu.number)&&(i.onBlock(n,u),u=n)}catch(e){i.onError?.(e)}}),{emitOnBegin:n,interval:c}))):(()=>{let t=!0,r=()=>t=!1;return(async()=>{try{const{unsubscribe:n}=await e.transport.subscribe({params:["newHeads"],onData(r){if(!t)return;const n=(e.chain?.formatters?.block?.format||l)(r.result);i(n,u),u=n},onError(e){o?.(e)}});r=n,t||r()}catch(e){o?.(e)}})(),r})()}(e,t),watchBlockNumber:t=>Ut(e,t),watchContractEvent:t=>function(e,{abi:t,address:r,args:n,batch:i=!0,eventName:o,onError:s,onLogs:a,pollingInterval:c=e.pollingInterval,strict:l}){const u=(0,oe.P)(["watchContractEvent",r,n,i,e.uid,o,c]),h=l??!1;return Bt(u,{onLogs:a,onError:s},(s=>{let a,l,u=!1;const d=$t((async()=>{if(u)try{let c;if(l)c=await xt(0,{filter:l});else{const i=await gt(e);c=a&&a!==i?await At(e,{address:r,args:n,fromBlock:a+1n,toBlock:i,event:(0,at.m)({abi:t,name:o})}):[],a=i}if(0===c.length)return;i?s.onLogs(c):c.forEach((e=>s.onLogs([e])))}catch(e){s.onError?.(e)}else{try{l=await ut(e,{abi:t,address:r,args:n,eventName:o,strict:h})}catch{}u=!0}}),{emitOnBegin:!0,interval:c});return async()=>{l&&await It(0,{filter:l}),d()}}))}(e,t),watchEvent:t=>function(e,{address:t,args:r,batch:n=!0,event:i,onError:o,onLogs:s,pollingInterval:a=e.pollingInterval,strict:c}){const l=(0,oe.P)(["watchEvent",t,r,n,e.uid,i,a]),u=c??!1;return Bt(l,{onLogs:s,onError:o},(o=>{let s,c,l=!1;const h=$t((async()=>{if(l)try{let a;if(c)a=await xt(0,{filter:c});else{const n=await gt(e);a=s&&s!==n?await At(e,{address:t,args:r,fromBlock:s+1n,toBlock:n,event:i}):[],s=n}if(0===a.length)return;n?o.onLogs(a):a.forEach((e=>o.onLogs([e])))}catch(e){o.onError?.(e)}else{try{c=await ht(e,{address:t,args:r,event:i,strict:u})}catch{}l=!0}}),{emitOnBegin:!0,interval:a});return async()=>{c&&await It(0,{filter:c}),h()}}))}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:r,onTransactions:n,poll:i,pollingInterval:o=e.pollingInterval}){return(void 0!==i?i:"webSocket"!==e.transport.type)?Bt((0,oe.P)(["watchPendingTransactions",e.uid,t,o]),{onTransactions:n,onError:r},(r=>{let n;const i=$t((async()=>{try{if(!n)try{return void(n=await dt(e))}catch(e){throw i(),e}const o=await xt(0,{filter:n});if(0===o.length)return;t?r.onTransactions(o):o.forEach((e=>r.onTransactions([e])))}catch(e){r.onError?.(e)}}),{emitOnBegin:!0,interval:o});return async()=>{n&&await It(0,{filter:n}),i()}})):(()=>{let t=!0,i=()=>t=!1;return(async()=>{try{const{unsubscribe:o}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const r=e.result;n([r])},onError(e){r?.(e)}});i=o,t||i()}catch(e){r?.(e)}})(),i})()}(e,t)});function zt({batch:e,chain:t,key:r="public",name:n="Public Client",transport:i,pollingInterval:o}){const s={batch:e,...j({chain:t,key:r,name:n,pollingInterval:o,transport:i,type:"publicClient"})};return{...s,...Dt(s)}}function Wt(e,t={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:o,retryDelay:s}=t;return({chain:t,pollingInterval:a=4e3,timeout:c})=>{let l=e,u=()=>{};const h=ye({key:r,name:n,async request({method:e,params:r}){const n=async(i=0)=>{const o=l[i]({chain:t,retryCount:0,timeout:c});try{const t=await o.request({method:e,params:r});return u({method:e,params:r,response:t,transport:o,status:"success"}),t}catch(t){if(u({error:t,method:e,params:r,transport:o,status:"error"}),be(t))throw t;if(i===l.length-1)throw t;return n(i+1)}};return n()},retryCount:o,retryDelay:s,type:"fallback"},{onResponse:e=>u=e,transports:l.map((e=>e({chain:t,retryCount:0})))});if(i){const e="object"==typeof i?i:{};!function({chain:e,interval:t=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:o,weights:s={}}){const{stability:a=.7,latency:c=.3}=s,l=[],u=async()=>{const s=await Promise.all(o.map((async t=>{const r=t({chain:e,retryCount:0,timeout:i}),n=Date.now();let o,s;try{await r.request({method:"net_listening"}),s=1}catch{s=0}finally{o=Date.now()}return{latency:o-n,success:s}})));l.push(s),l.length>n&&l.shift();const h=Math.max(...l.map((e=>Math.max(...e.map((({latency:e})=>e)))))),d=o.map(((e,t)=>{const r=l.map((e=>e[t].latency)),n=1-r.reduce(((e,t)=>e+t),0)/r.length/h,i=l.map((e=>e[t].success)),o=i.reduce(((e,t)=>e+t),0)/i.length;return 0===o?[0,t]:[c*n+a*o,t]})).sort(((e,t)=>t[0]-e[0]));r(d.map((([,e])=>o[e]))),await ge(t),u()};u()}({chain:t,interval:e.interval??a,onTransports:e=>l=e,sampleCount:e.sampleCount,timeout:e.timeout,transports:l,weights:e.weights})}return h}}class Ft extends z.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}var Ht=r(8583);function qt(e,{errorInstance:t,timeout:r,signal:n}){return new Promise(((i,o)=>{(async()=>{let s;try{const a=new AbortController;r>0&&(s=setTimeout((()=>{n?a.abort():o(t)}),r)),i(await e({signal:a?.signal}))}catch(e){"AbortError"===e.name&&o(t),o(e)}finally{clearTimeout(s)}})()}))}let Vt=0;const Gt=new Map;async function Kt(e){const t=new URL(e),n=t.toString();let i=Gt.get(n);if(i)return i;const{schedule:o}=(0,Ht.S)({id:n,fn:async()=>{let e=await Promise.resolve().then(r.bind(r,5289));e=e.default?.constructor?e.default:e.WebSocket;const o=new e(t),s=new Map,a=new Map,c=({data:e})=>{const t=JSON.parse(e),r="eth_subscription"===t.method,n=r?t.params.subscription:t.id,i=r?a:s,o=i.get(n);o&&o({data:e}),r||i.delete(n)},l=()=>{Gt.delete(n),o.removeEventListener("close",l),o.removeEventListener("message",c)};return o.addEventListener("close",l),o.addEventListener("message",c),o.readyState===e.CONNECTING&&await new Promise(((e,t)=>{o&&(o.onopen=e,o.onerror=t)})),i=Object.assign(o,{requests:s,subscriptions:a}),Gt.set(n,i),[i]}}),[s,[a]]=await o();return a}const Zt={http:async function(e,{body:t,fetchOptions:r={},timeout:n=1e4}){const{headers:i,method:o,signal:s}=r;try{const a=await qt((async({signal:a})=>await fetch(e,{...r,body:Array.isArray(t)?(0,oe.P)(t.map((e=>({jsonrpc:"2.0",id:Vt++,...e})))):(0,oe.P)({jsonrpc:"2.0",id:Vt++,...t}),headers:{...i,"Content-Type":"application/json"},method:o||"POST",signal:s||(n>0?a:void 0)})),{errorInstance:new me.W5({body:t,url:e}),timeout:n,signal:!0});let c;if(c=a.headers.get("Content-Type")?.startsWith("application/json")?await a.json():await a.text(),!a.ok)throw new me.Gg({body:t,details:(0,oe.P)(c.error)||a.statusText,headers:a.headers,status:a.status,url:e});return c}catch(r){if(r instanceof me.Gg)throw r;if(r instanceof me.W5)throw r;throw new me.Gg({body:t,details:r.message,url:e})}},webSocket:function(e,{body:t,onResponse:r}){if(e.readyState===e.CLOSED||e.readyState===e.CLOSING)throw new me.c9({body:t,url:e.url,details:"Socket is closed."});const n=Vt++,i=({data:o})=>{const s=JSON.parse(o);"number"==typeof s.id&&n!==s.id||(r?.(s),"eth_subscribe"===t.method&&"string"==typeof s.result&&e.subscriptions.set(s.result,i),"eth_unsubscribe"===t.method&&e.subscriptions.delete(t.params?.[0]))};return e.requests.set(n,i),e.send(JSON.stringify({jsonrpc:"2.0",...t,id:n})),e},webSocketAsync:async function(e,{body:t,timeout:r=1e4}){return qt((()=>new Promise((r=>Zt.webSocket(e,{body:t,onResponse:r})))),{errorInstance:new me.W5({body:t,url:e.url}),timeout:r})}};var Qt=r(8617);function Yt(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var n;const i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}const Jt=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then:e=>Jt(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>Jt(t)(e)}}},Xt=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=n?n:"object"!=typeof i)?i:Object.assign({},t,i),r.forEach((r=>r(t,e)))}},i=()=>t,o={setState:n,getState:i,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(n,i,o),o};var er=r(263);function tr(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,n]of e)if(!Object.is(n,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;ne[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const h=2**31,d=h>>>1,p=h-1;let f=0;for(let e=0;e<31;e++)f=f<<1|u();let m=[],g=0,w=h;for(;;){let e=Math.floor(((f-g+1)*i-1)/w),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|u(),s=s<<1^d,a=(a^d)<<1|d|1;g=s,w=1+a-s}let b=n-4;return m.map((t=>{switch(t-b){case 3:return b+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return b+256+(e[a++]<<8|e[a++]);case 1:return b+e[a++];default:return t-1}}))}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,r)=>t[e.charCodeAt(0)]=r));let r=e.length,n=new Uint8Array(6*r>>3);for(let i=0,o=0,s=0,a=0;i=8&&(n[o++]=a>>(s-=8));return n}(e)))}function nr(e){return 1&e?~e>>1:e>>1}function ir(e,t){let r=Array(e);for(let n=0,i=0;n{let t=or(e);if(t.length)return t}))}function ar(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(ur(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(hr(r,e))}return t.flat()}function cr(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function lr(e,t,r){let n=Array(e).fill().map((()=>[]));for(let i=0;in[t].push(e)));return n}function ur(e,t){let r=1+t(),n=t(),i=cr(t);return lr(i.length,1+e,t).flatMap(((e,t)=>{let[o,...s]=e;return Array(i[t]).fill().map(((e,t)=>{let i=t*n;return[o+t*r,s.map((e=>e+i))]}))}))}function hr(e,t){return lr(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}var dr=rr("AEgSbwjEDVYByQKaAQsBOQDpATQAngDUAHsAoABoANQAagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXAA0ADgAWAA8AFAAVBFsF1QEXE0o3xAXUALIArkABaACmAgPGAK6AMDAwMAE/qAYK7P4HQAblMgVYBVkAPSw5Afa3EgfJwgAPA8meNALGCjACjqIChtk/j2+KAsXMAoPzASDgCgDyrgFCAi6OCkCQAOQA4woWABjVuskNDD6eBBx4AP4COhi+D+wKBirqBgSCaA0cBy4ArABqku+mnIAAXAaUJAbqABwAPAyUFvyp/Mo8INAIvCoDshQ8APcubKQAon4ZABgEJtgXAR4AuhnOBPsKIE04CZgJiR8cVlpM5INDABQADQAWAA9sVQAiAA8ASO8W2T30OVnKluYvChEeX05ZPe0AFAANABYAD2wgXUCYAMPsABwAOgzGFryp/AHauQVcBeMC0KACxLEKTR2kZhR0Gm5M9gC8DmgC4gAMLjSKF8qSAoF8ARMcAL4OaALiAAwuAUlQJpJMCwMt/AUpCthqGK4B2EQAciwSeAIyFiIDKCi6OGwAOuIB9iYAyA7MtgEcZIIAsgYABgCK1EoFHNZsGACoKNIBogAAAAAAKy4DnABoAQoaPu43dQQZGACrAcgCIgDgLBJ0OvRQsTOiKDVJBfsoBVoFWbC5BWo7XkITO1hCmHuUZmCh+QwUA8YIJvJ4JASkTAJUVAJ2HKwoAZCkpjZcA0YYBIRiCgDSBqxAMCQHKgI6XgBsAWIgcgCEHhoAlgFKuAAoahgBsMYDOC4iRFQBcFoGZgJmAPJKGAMqAgYASkIArABeAHQALLYGCPTwGo6AAAAKIgAqALQcSAHSAdwIDDKXeYHpAAsAEgA1AD4AOTR3etTBEGAQXQJNCkxtOxUMAq0PpwvmERYM0irM09kANKoH7ANUB+wDVANUB+wH7ANUB+wDVANUA1QDVBwL8BvUwRBgD0kEbgWPBYwE1wiEJkoRggcpCNNUDnQfHEgDRgD9IyZJHTuUMwwlQ0wNTQQH/TZDbKh9OQNIMaxU9pCjA8wyUDltAh5yEqEAKw90HTW2Tn96SHGhCkxPr7WASWNOaAK/Oqk/+QoiCZRvvHdPBj4QGCeiEPQMMAGyATgN6kvVBO4GOATGH3oZFg/KlZkIoi3aDOom4C6egFcj8iqABepL8TzaC0pRZQ9WC2IJ4DpggUsDHgEKIogK2g02CGoQ8ArGaA3iEUIHNgPSSZcAogb+Cw4dMhWyJg1iqQsGOXQG+BrzC4wmrBMmevkF0BoeBkoBJhr8AMwu5IWtWi5cGU9cBgALIiPEFKVQHQ0iQLR4RRoYBxIlpgKOQ21KhFEzHpAh8zw6DWMuEFF5B/I8AhlMC348m0aoRQsRzz6KPUUiRkwpBDJ8LCwniAnMD4IMtnxvAVYJHgmuDG4TLhEUN8IINgcWKpchJxIIHkaSYJcE9JwD8BPOAwgFPAk+BxADshwqEysVJgUKgSHUAvA20i6wAoxWfQEUBcgPIh/cEE1H3Q7mCJgCYgOAJegAKhUeABQimAhAYABcj9VTAi7ICMRqaSNxA2QU5F4RcAeODlQHpBwwFbwc3nDFXgiGBSigrAlYAXIJlgFcBOAIBjVYjJ0gPmdQi1UYmCBeQTxd+QIuDGIVnES6h3UCiA9oEhgBMgFwBzYM/gJ0EeoRaBCSCOiGATWyM/U6IgRMIYAgDgokA0xsywskJvYM9WYBoBJfAwk0OnfrZ6hgsyEX+gcWMsJBXSHuC49PygyZGr4YP1QrGeEHvAPwGvAn50FUBfwDoAAQOkoz6wS6C2YIiAk8AEYOoBQH1BhnCm6MzQEuiAG0lgNUjoACbIwGNAcIAGQIhAV24gAaAqQIoAACAMwDVAA2AqoHmgAWAII+AToDJCwBHuICjAOQCC7IAZIsAfAmBBjADBIA9DRuRwLDrgKAZ2afBdpVAosCRjIBSiIEAktETgOsbt4A2ABIBhDcRAESqEfIF+BAAdxsKADEAPgAAjIHAj4BygHwagC0AVwLLgmfsLIBSuYmAIAAEmgB1AKGANoAMgB87gFQAEoFVvYF0AJMRgEOLhUoVF4BuAMcATABCgB2BsiKosYEHARqB9ACEBgV3gLvKweyAyLcE8pCwgK921IAMhMKNQqkCqNgWF0wAy5vPU0ACx+lPsQ/SwVOO1A7VTtQO1U7UDtVO1A7VTtQO1UDlLzfvN8KaV9CYegMow3RRMU6RhPYYE5gLxPFLbQUvhXLJVMZOhq5JwIl4VUGDwEt0GYtCCk0che5ADwpZYM+Y4MeLQpIHORTjlT1LRgArkufM6wNqRsSRD0FRHXqYicWCwofAmR+AmI/WEqsWDcdAqH0AmiVAmYGAp+BOBgIAmY4AmYjBGsEfAN/EAN+jzkDOXQUOX86ICACbBoCMjM4BwJtxAJtq+yHMGRCKAFkANsA3gBHAgeVDIoA+wi/AAqyAncsAnafPAJ5SEACeLcaWdhFq0bwAnw8AnrFAn0GAnztR/1IemAhACgSSVVKWBIUSskC0P4C0MlLJAOITAOH40TCkS8C8p5dAAMDq0vLTCoiAMxNSU2sAos8AorVvhgEGkBkArQCjjQCjlk9lH4CjtYCjll1UbFTMgdS0VSCApP4ApMJAOYAGVUbVaxVzQMsGCmSgzLeeGNFODYCl5wC769YHqUAViIClowClnmZAKZZqVoGfkoAOAKWsgKWS1xBXM4CmcgCmWFcx10EFgKcmDm/OpoCnBMCn5gCnrWHABoMLicMAp3uAp6PALI6YTFh7AKe0AKgawGmAp6cHAKeS6JjxWQkIigCJ6wCJnsCoPgCoEnUAqYsAqXLAqf8AHoCp+9oeWiuAABGahlqzgKs4AKsqwKtZAKs/wJXGgJV2QKx3tQDH0tslAKyugoCsuUUbN1tYG1FXAMlygK2WTg8bo0DKUICuFsCuUQSArkndHAzcN4CvRYDLa8DMg4CvoVx/wMzbgK+F3Mfc0wCw8gCwwFzf3RIMkJ03QM8pAM8lwM9vALFeQLGRALGDYYCyGZOAshBAslMAskrAmSaAt3PeHZeeKt5IkvNAxigZv8CYfEZ8JUhewhej164DgLPaALPaSxIUM/wEJwAw6oCz3ABJucDTg9+SAIC3CQC24cC0kwDUlkDU1wA/gNViYCGPMgT6l1CcoLLg4oC2sQC2duEDYRGpzkDhqIALANkC4ZuVvYAUgLfYgLetXB0AuIs7REB8y0kAfSYAfLPhALr8ALpbXYC6vYC6uEA9kQBtgLuhgLrmZanlwAC7jwDhd2YdnDdcZ4C8wAAZgOOE5mQAvcQA5FrA5KEAveVAvnWAvhjmhmaqLg0mxsDnYAC/vcBGAA2nxmfsAMFigOmZwOm1gDOwgMGZ6GFogIGAwxGAQwBHAdqBl62ZAIAuARovA6IHrAKABRyNgAgAzASSgOGfAFgJB4AjOwAHgDmoAScjgi0BhygwgCoBRK86h4+PxZ5BWk4P0EsQiJCtV9yEl+9AJbGBTMAkE0am7o7J2AzErrQDjAYxxiKyfcFWAVZBVgFWQVkBVkFWAVZBVgFWQVYBVkFWAVZRxYI2IZoAwMDCmVe6iwEygOyBjC8vAC8BKi8AOhBKhazBUc+aj5xQkBCt192OF/pAFgSM6wAjP/MbMv9puhGez4nJAUsFyg3Nn5u32vB8hnDLGoBbNdvMRgFYAVrycLJuQjQSlwBAQEKfV5+jL8AND+CAAQW0gbmriQGAIzEDAMCDgDlZh4+JSBLQrJCvUI5JF8oYDcoOSQJwj4KRT9EPnk+gj5xPnICikK9SkM8X8xPUGtOCy1sVTBrDG8gX+E0OxwJaJwKYyQsPR4nQqxCvSzMAsv9X8oPIC8KCQoAACN+nt9rOy5LGMmsya0JZsLMzQphQWAP5hCkEgCTjh5GQiYbqm06zjkKND9EPnFCQBwICx5NSG1cLS5a4rwTCn7uHixCQBxeCUsKDzRVREM4BTtEnC0KghwuQkAb9glUIyQZMTIBBo9i8F8KcmTKYAxgLiRvAERgGjoDHB9gtAcDbBFmT2BOEgIAZOhgFmCWYH5gtGBMYJJpFhgGtg/cVqq8WwtDF6wBvCzOwgMgFgEdBB8BegJtMDGWU4EBiwq5SBsA5SR0jwvLDqdN6wGcAoidUAVBYAD4AD4LATUXWHsMpg0lILuwSABQDTUAFhO4NVUC0wxLZhEcANlPBnYECx9bADIAtwKbKAsWcKwzOaAaAVwBhwn9A9ruEAarBksGugAey1aqWwq7YhOKCy1ADrwBvAEjA0hbKSkpIR8gIi0TJwciDY4AVQJvWJFKlgJvIA9ySAHUdRDPUiEaqrFN6wcSBU1gAPgAPgsBewAHJW0LiAymOTEuyLBXDgwAYL0MAGRKaFAiIhzAADIAtwKbKC08D88CkRh8ULxYyXRzjtilnA72mhU+G+0S2hIHDxwByAk7EJQGESwNNwwAPAC0zwEDAKUA4gCbizAAFQBcG8cvbXcrDsIRAzwlRNTiHR8MG34CfATCC6vxbQA4Oi4Opzkuz6IdB7wKABA7Ls8SGgB9rNsdD7wbSBzOoncfAT4qYB0C7KAJBE3z5R9mDL0M+wg9Cj8ABcELPgJMDbwIvQ09CT0KvS7PoisOvAaYAhwPjBriBBwLvBY8AKELPBC8BRihe90AO2wMPQACpwm9BRzR9QYFB2/LBnwAB7wSXBISvQECAOsCAAB1FVwHFswV/HAXvBg8AC68AuyovAAevAJWISuAAAG8AALkFT0VvCvso7zJqDwEAp8nTAACXADn3hm8CaVcD7/FAPUafAiiBQv/cQDfvKe8GNwavKOMeXMG/KmchAASvAcbDAADlABtvAcAC7ynPAIaPLsIopzLDvwHwak8AOF8L7dtvwNJAAPsABW8AAb8AAm8AGmMABq8AA68Axi8jmoV/AABXAAObAAuTB8ABrwAF7wIIgANSwC6vCcAA7wADpwq7ACyWwAcHAAbvAAB7AqiAAXHCxYV3AAHnABCvAEDAGm8AAt8AB28AAi8CaIABcsAbqAZ1gCSCCIABcsAATwAB9wAHZwIIgAGmwAJfAAbLABtHADmvIEACFwACDwAFLwAaPwJIgAGywDjjAAJPAuiDsX7YAAHPABunUBJAEgACrwFAAM8AAmuAzgABxwAGXwAAgym/AAKHAAKPAAJ/KfsBrwACRwAAwwAEDwBABQ8ABFsAA+MAA3sAA28ABkMBxYcABU8AG6cFrQBvAC7ABM8BABpLAsA4UwAAjwABFMAF3wFHAAG0QAYvB8BfClTADpGALAJBw4McwApK3EBpQYIXwJtJA0ACghwTG1gK4oggRVjLjcDogq1AALZABcC/ARvAXdzSFMVIgNQAhY/AS0GBHRHvnxTe0EAKgAyAvwAVAvcAHyRLQEsAHfmDhIzRwJLAFgGAAJRAQiLzQB5PAQhpgBbANcWAJZpOCCMAM5ssgDQ1RcJw3Z0HBlXHgrSAYmRrCNUVE5JEz3DivoAgB04QSos4RKYUABzASosMSlDGhADMVYE+MbvAExm3QBrAnICQBF7Osh4LzXWBhETIAUVCK6v/xPNACYAAQIbAIYAiQCONgDjALQA1QCdPQC7AKsApgChAOcAnwDTAJwA4AEBAPwAwAB6AFsAywDNAPwA1wDrAIkAogEqAOMA2ADVBAIIKzTT09PTtb/bzM/NQjEWAUsBVS5GAVMBYgFhAVQBRUpCRGcMAUwUBgkEMzcMBwAgDSQmKCs3OTk8PDw9Pg0/HVBQUFBSUlFSKFNUVlVVHFxgYF9hYCNlZ29ucXFxcXFxc3Nzc3Nzc3Nzc3N1dXZ1dFsAPesAQgCTAHEAKwBf8QCHAFAAUAAwAm/oAIT+8fEAXQCM6wCYAEgAWwBd+PipAH4AfgBiAE8AqgAdAK8AfAI5AjwA9QDgAPcA9wDhAPgA4gDiAOEA3wAoAnQBSgE5ATcBTQE3ATcBNwEyATEBMQExARUBURAAKgkBAEwYCxcEFhcPAIcAjwCfAEoAYxkCKgBvAGgAkAMOAyArAxpCP0gqAIoCSADAAlACnQC5Ao8CjwKPAo8CjwKPAoQCjwKPAo8CjwKPAo8CjgKOApECmQKQAo8CjwKNAo0CjQKNAosCjgJuAc0CkAKYAo8CjwKOF3oMAPcGA5gCWgIzGAFNETYC2xILLBQBRzgUTpIBdKU9AWJaAP4DOkgA/wCSKh4ZkGsAKmEAagAvAIoDlcyM8K+FWwa7LA/DEgKe1nUrCwQkWwGzAN5/gYB/gX+Cg4N/hIeFf4aJh4GIg4mDin+Lf4x/jYuOf49/kIORf5J/k3+Uf5WElomXg5h/AIMloQCEBDwEOQQ7BD4EPARCBD8EOgRABEIEQQQ9BD8EQgCkA4gAylIA0AINAPdbAPcBGgD3APUA9QD2APXVhSRmvwD3APUA9QD2APUdAIpbAPcAigEaAPcAigLtAPcAitWFJGa/HQD4WwEaAPcA9wD1APUA9gD1APgA9QD1APYA9dWFJGa/HQCKWwEaAPcAigD3AIoC7QD3AIrVhSRmvx0CRAE3AksBOgJMwgOfAu0Dn9WFJGa/HQCKWwEaA58AigOfAIoC7QOfAIrVhSRmvx0EMQCKBDIAigeOMm4hLQCKAT9vBCQA/gDHWwMAVVv/FDMDAIoDPtkASgMAigMAl2dBtv/TrfLzakaPh3aztmIuZQrR3ER2n5Yo+qNR2jK/aP/V04UK1njIJXLgkab9PjOxyJDVbIN3R/FZLoZVl2kYFQIZ7V6LpRqGDt9OdDohnJKp5yX/HLj0voPpLrneDaN11t5W3sSM4ALscgSw8fyWLVkKa/cNcQmjYOgTLZUgOLi2F05g4TR0RfgZ4PBdntxdV3qvdxQt8DeaMMgjJMgwUxYN3tUNpUNx21AvwADDAIa0+raTWaoBXmShAl5AThpMi282o+WzOKMlxjHj7a+DI6AM6VI9w+xyh3Eyg/1XvPmbqjeg2MGXugHt8wW03DQMRTd5iqqOhjLvyOCcKtViGwAHVLyl86KqvxVX7MxSW8HLq6KCrLpB8SspAOHO9IuOwCh9poLoMEha9CHCxlRAXJNDobducWjqhFHqCkzjTM2V9CHslwq4iU19IxqhIFZMve15lDTiMVZIPdADXGxTqzSTv0dDWyk1ht430yvaYCy9qY0MQ3cC5c1uw4mHcTGkMHTAGC99TkNXFAiLQgw9ZWhwKJjGCe+J5FIaMpYhhyUnEgfrF3zEtzn40DdgCIJUJfZ0mo3eXsDwneJ8AYCr7Vx2eHFnt2H6ZEyAHs9JoQ4Lzh5zBoGOGwAz37NOPuqSNmZf51hBEovtpm2T1wI79OBWDyvCFYkONqAKGVYgIL0F+uxTcMLSPtFbiNDbBPFgip8MGDmLLHbSyGXdCMO6f7teiW9EEmorZ+75KzanZwvUySgjoUQBTfHlOIerJs6Y9wLlgDw18AB1ne0tZRNgGjcrqHbtubSUooEpy4hWpDzTSrmvqw0H9AoXQLolMt9eOM+l9RitBB1OBnrdC1XL4yLFyXqZSgZhv7FnnDEXLUeffb4nVDqYTLY6X7gHVaK4ZZlepja2Oe6OhLDI/Ve5SQTCmJdH3HJeb14cw99XsBQAlDy5s5kil2sGezZA3tFok2IsNja7QuFgM30Hff3NGSsSVFYZLOcTBOvlPx8vLhjJrSI7xrNMA/BOzpBIJrdR1+v+zw4RZ7ry6aq4/tFfvPQxQCPDsXlcRvIZYl+E5g3kJ+zLMZon0yElBvEOQTh6SaAdIO6BwdqJqfvgU+e8Y65FQhdiHkZMVt9/39N2jGd26J6cNjq8cQIyp6RonRPgVn2fl89uRDcQ27GacaN0MPrcNyRlbUWelKfDfyrNVVGBG5sjd3jXzTx06ywyzuWn5jbvEfPPCTbpClkgEu9oPLKICxU5HuDe3jA1XnvU85IYYhaEtOU1YVWYhEFsa4/TQj3rHdsU2da2eVbF8YjSI0m619/8bLMZu3xildwqM7zf1cjn4Whx0PSYXcY5bR7wEQfGC7CTOXwZdmsdTO8q3uGm7Rh/RfCWwpzBHCAaVfjxgibL5vUeL0pH6bzDmI9yCXKC/okkmbc28OJvI87L/bjFzpq0DHepw4kT1Od+fL7cyuFaRgfaUWB2++TCFvz11J0leEtrGkpccfX9z2LY39sph4PBHCjNOOkd0ybUm+ZzS8GkFbqMpq8uiX2yHpa0jllTLfGTDBMYR6FT5FWLLDPMkYxt1Q0eyMvxJWztDjy0m6VvZPvamrFXjHmPpU6WxrZqH6WW//I37RwvqPQhPz8I3RPuXAk1C94ZprQWm9iGM/KgiGDO6SV9sjp+Jmk4TBajMNJ5zzWZ1k1jrteQQBp9C2dOvmbIeeEME8y573Q8TgGe+ZCzutM45gYLBzYm2LNvgq2kebAbMpHRDSyh6dQ27GbsAAdCqQVVXWC1C+zpwBM2Lr4eqtobmmu1vJEDlIQR1iN8CUWpztq50z7FFQBn3SKViX6wSqzVQCoYvAjByjeSa+h1PRnYWvBinTDB9cHt4eqDsPS4jcD3FwXJKT0RQsl8EvslI2SFaz2OtmYLFV8FwgvWroZ3fKmh7btewX9tfL2upXsrsqpLJzpzNGyNlnuZyetg7DIOxQTMBR7dqlrTlZ6FWi1g4j1NSjA2j1Yd7fzTH6k9LxCyUCneAKYCU581bnvKih6KJTeTeCX4Zhme/QIz7w2o+AdSgtLAkdrLS9nfweYEqrMLsrGGSWXtgWamAWp6+x6GM/Z8jNw3BqPNQ39hrzYLECn3tPvh/LqKbRSCiDGauDKBBj/kGbpnM1Bb/my8hv4NWStclkwjfl57y4oNDgw1JAG9VOti3QVVoSziMEsSdfEjaCPIDb7SgpLXykQsM+nbqbt97I0mIlzWv0uqFobLMAq8Rd9pszUBKxFhBPwOjf//gVOz2r7URJ2OnpviCXv9iz3a4X/YLBYbXoYwxBv/Kq0a5s4utQHzoTerJ7PmFW/no/ZAsid/hRIV82tD+Qabh5F1ssIM8Ri3chu0PuPD3sSJRMjDoxLAbwUbroiPAz/V52e8s3DIixxlO7OrvhMj3qfzA0kKxzwicr5wJmZwJxTXgrwYsqhRvpgC2Nfdyd+TYYxJSZgk+gk2g9KyHSlwQVAyPtWWgvVGyVBqsU2LpDlLNosSAtolC1uBKt5pQZLhAxTjeGCWIC/HVpagc5rRwkgpCHKEsjA8d+scp8aiMewwQBhp5dYTV5t/Nvl+HbDMu8F3S0psPyZb1bSnqlHPFUnMQeQqSqwDBT23fJO9gO3aVaa1icrXU0PKwlMM5K+iL3ATcVq2fFWKk0irCTF4LDVDG4gUpkyplq6efcZS+WDR1woApjD18x+2JQR9oOXzuA7uy4b+/91WsJd/tSd1QcAH8PVPXApieA37B7YXPhDPH1azP3PKR+HfHmOoDYLeuKsIi/ssSsdYs62qJo14Hw1P2N/6zpr8F3FTWmJ4ysAVcl84Iv/tl///Z8FaAWbBQbyMNDZjrZ2JwdRjtd1jOeNumSodFtr4/Zf45iRJf/8HSW+KIB/+GlKu8Rv1BPLr/4duoL+kFPRqrstEr41gfJupoJRf4hcYDWX93FOcfEBiIivxtjtV8g7mvOReiamYWKE7vfPbv3v2L9Kwq3cIDFGLyhyfOGuf/9vA5muH6Pjg7B4SUj2ydDXra9fSBI+DrsNHA6l51wfHssJb+11TfNk7B8OleUe3Y+ZmHboMFHdv7FFP2cfISFyeAQR0sk/Xv62HBTdW4HmnGSLFk/cqyWVVFJkdIIa+4hos3JRHcqLoRKM5h2Qtk1RZtzISMtlXTfTqIc77YsCCgQD0r61jtxskCctwJOtjE/pL8wC4LBD4AZFjh2wzzFCrT/PNqW0/DeBbkfMfzVm9yy06WiF+1mTdNNEAytVtohBKg3brWd2VQa+aF+cQ0mW5CvbwOlWCT07liX226PjiVLwFCRs/Ax2/u+ZNPjrNFIWIPf5GjHyUKp60OeXe9F01f7IaPf/SDTvyDAf7LSWWejtiZcsqtWZjrdn6A2MqBwnSeKhrZOlUMmgMionmiCIvXqKZfmhGZ1MwD3uMF4n9KJcfWLA3cL5pq48tm5NDYNh3SS/TKUtmFSlQR89MR4+kxcqJgpGbhm9gXneDELkyqAN5nitmIzTscKeJRXqd64RiaOALR2d295NWwbjHRNG2AU5oR9OS2oJg/5CY6BFPc1JvD2Mxdhp2/MZdI8dLePxiP4KRIp8VXmqfg+jqd/RNG7GNuq1U2SiI4735Bdc0MVFx6mH5UOWEa5HuhYykd6t4M1gYLVS8m1B+9bUqi5DziQq7qT8d94cxB6AB4WqMCOF/zPPtRSZUUaMSsvHOWxGASufywTX8ogy6HgUf9p+Z30wUEosl8qgmwm6o2AV6nO9HKQjRHpN6SUegI5pvR61RLnUJ1lqCtmfcsRQutEizVpAaPXN7xMp5UQ5OSZK6tniCK9CpyMd7LjR6+MxfoMEDPpWdf2p2m5N3KO4QMxf+V7vGdYjemQczQ+m2MGIkFNYDMf0Yop2eSx81sP36WHUczqEhKysp2iJSYAvfgJjinKwToPvRKb+HBi+7cJ96S5ngfLOXaHAFRLkulo4TnXTFO51gX0TCCo4ZUHdbpdgkMEwUZAPjh6M+hA8DzycbtxAgH3uD6i0nN1aTiIuQ4BYCE9dEHHwAmINU+4YEWx4EC3OZwFGfYZMPLScVlb+BAAJeARUh+gdWA3/gRqCrf1jecgqeFf1MdzrrP4SVlGm5mMihSP+zYYksAB7O+SBPwNQqSNMiLnkviY/klwgcRmvqtCqeWeA0gjuir4CMZqmw/ntP6M+l0pdN8/P9xI53aP7x/zavJbbKOz8VzO/nXxIr1tjparMnqd6iWdByHKw4lF4p/u57Yv07WeZPDnRl7wgmDVZZ44fQsjdYO/gmXQ+940PRGst8UMQApFC4OOV22e4N+lVOPyFLAOj4t8R3PFw/FjbSWy0ELuAFReNkee8ORcBOT2NPDcs7OfpUmzvn/F9Czk9o9naMyVYy/j8I5qVFmQDFcptBp65J/+sJA3w/j6y/eqUkKxTsf0CZjtNdRSBEmJ2tmfgmJbqpcsSagk+Ul9qdyV+NnqFBIJZFCB1XwPvWGDBOjVUmpWGHsWA5uDuMgLUNKZ4vlq5qfzY1LnRhCc/mh5/EX+hzuGdDy5aYYx4BAdwTTeZHcZpl3X0YyuxZFWNE6wFNppYs3LcFJePOyfKZ8KYb7dmRyvDOcORLPH0sytC6mH1US3JVj6paYM1GEr+CUmyHRnabHPqLlh6Kl0/BWd3ebziDfvpRQpPoR7N+LkUeYWtQ6Rn5v5+NtNeBPs2+DKDlzEVR5aYbTVPrZekJsZ9UC9qtVcP99thVIt1GREnN8zXP8mBfzS+wKYym8fcW6KqrE702Zco+hFQAEIR7qimo7dd7wO8B7R+QZPTuCWm1UAwblDTyURSbd85P4Pz+wBpQyGPeEpsEvxxIZkKsyfSOUcfE3UqzMFwZKYijb7sOkzpou+tC4bPXey5GI1GUAg9c3vLwIwAhcdPHRsYvpAfzkZHWY20vWxxJO0lvKfj6sG2g/pJ1vd/X2EBZkyEjLN4nUZOpOO7MewyHCrxQK8d5aF7rCeQlFX+XksK6l6z971BPuJqwdjj68ULOj9ZTDdOLopMdOLL0PFSS792SXE/EC9EDnIXZGYhr52aQb+9b2zEdBSnpkxAdBUkwJDqGCpZk/HkRidjdp0zKv/Cm52EenmfeKX6HkLUJgMbTTxxIZkIeL/6xuAaAAHbA7mONVduTHNX/UJj1nJEaI7f3HlUyiqKn7VfBE+bdb4HWln1HPJx001Ulq1tOxFf8WZEARvq5Da1+pE7fPVxLntGACz3nkoLsKcPdUqdCwwiyWkmXTd5+bv3j7HaReRt3ESn783Ew3SWsvkEjKtbocNksbrLmV+GVZn1+Uneo35MT1/4r8fngQX5/ptORfgmWfF6KSB/ssJmUSijXxQqUpzkANEkSkYgYj560OOjJr6uqckFuO15TRNgABEwNDjus1V3q2huLPYERMCLXUNmJJpbMrUQsSO7Qnxta55TvPWL6gWmMOvFknqETzqzFVO8SVkovEdYatypLGmDy9VWfgAc0KyIChiOhbd7UlbAeVLPZyEDp4POXKBwN/KP5pT6Cyqs6yaI00vXMn1ubk9OWT9Q/O2t/C25qlnO/zO0xcBzpMBCAB8vsdsh3U8fnPX1XlPEWfaYJxKVaTUgfCESWl4CCkIyjE6iQ5JFcwU6S4/IH0/Agacp8d5Gzq2+GzPnJ7+sqk40mfFQpKrDbAKwLlr3ONEati2k/ycLMSUu7V/7BBkDlNyXoN9tvqXCbbMc4SSQXgC/DBUY9QjtrCtQ+susEomCq8xcNJNNMWCH31GtlTw2BdCXkJBjT+/QNWlBWwQ5SWCh1LdQ99QVii/DyTxjSR6rmdap3l3L3aiplQpPYlrzNm9er88fXd2+ao+YdUNjtqmxiVxmyYPzJxl67OokDcTezEGqldkGgPbRdXA+fGcuZVkembZByo7J1dMnkGNjwwCny+FNcVcWvWYL9mg8oF7jACVWI3bA64EXpdM8bSIEVIAs5JJH+LHXgnCsgcMGPZyAAVBncvbLiexzg9YozcytjPXVlAbQAC7Tc4S0C8QN4LlAGjj4pQAVWrwkaDoUYGxxvkCWKRRHkdzJB5zpREleBDL1oDKEvAqmkDibVC4kTqF89YO6laUjgtJPebBfzr16tg4t10GmN1sJ5vezk2sUOq8blCn5mPZyT3ltaDcddKupQjqusNM9wtFVD0ABzv17fZDn7GPT1nkCtdcgYejcK1qOcTGtPxnCX1rErEjVWCnEJv5HaOAUjgpiKQjUKkQi64D5g2COgwas8FcgIl0Pw95H9dWxE3QG0VbMNffh6BPlAojLDf4es2/5Xfq7hw5NGcON2g8Qsy2UQm94KddKyy3kdJxWgpNaEc15xcylbLC3vnT26u8qS90qc2MU8LdOJc5VPF5KnSpXIhnj1eJJ/jszjZ01oR6JDFJRoeTPO/wh4IPFbdG9KljuSzeuI92p8JF/bpgDE8wG86/W2EBKgPrmzdLijxssQn8mM44ky/KLGOJcrSwXIpZa/Z3v7W6HCRk7ewds99LTsUW1LbeJytw8Q/BFZVZyfO9BUHOCe2suuEkO8DU4fLX0IQSQ2TdOkKXDtPf3sNV9tYhYFueuPRhfQlEEy+aYM/MCz7diDNmFSswYYlZZPmKr2Q5AxLsSVEqqBtn6hVl1BCFOFExnqnIsmyY/NA8jXnDaNzr7Zv3hu+I1Mf/PJjk0gALN2G8ABzdf9FNvWHvZHhv6xIoDCXf964MxG92vGZtx/LYU5PeZqgly8tT5tGeQGeJzMMsJc5p+a5Rn2PtEhiRzo/5Owjy1n0Lzx3ev8GHQmeWb8vagG6O5Qk5nrZuQTiKODI4UqL0LLAusS2Ve7j1Ivdxquu1BR9Rc4QkOiUPwQXJv6du2E8i5pDhVoQpUhyMWGUT2O2YODIhjAfI71gxep5r5zAY7GBUZpy51hAw0pcCCrhOmU8Wp6ujQTdZQsCjtq6SHX8QAMNiPCIIkoxhHEZPgsBcOlP4aErJZPhF7qvx6gHrn8hEwPwYbx8YmT/n7lbcmTip1v8kgsrIjFTAlvLY4Nuil0KDmgz3svYs0ZJ3O3Is/vSx4xpxF1e2VAtZE8dJxGYEIhCSuPvCjP54l/NSNDnwlKvAW8mG+AQkgp7a87Igh26uKMFGD0PoPHTSvoWxiHuk+su8XkQiHIjeYKl/RdcOHpxhQH3zHCNE3aARm83Bl6zGxU/vMltlVPQhubcqhW4RYkl6uXk5JdP/QpzaKFpw2M8zvysv2qj7xaQECuu2akM0Cssj/uB9+wDR7uA6XOnLNaoczalHoMj33eiiu+DRaFsUmlmUZuh9bjDY4INMNSSAivSh03uJvny4Gj+D+neudoa7iJi7c4VFlZ/J5gUR82308zSNAt/ZroBXDWw0fV3eVPAn3aX0mtJabF6RsUZmL+Ehn+wn51/4QipMjD+6y64t7bjL6bjENan2prQ4h7++hBJ9NXvX8CUocJqMC937IasLzm5K0qwXeFMAimMHkEIQIQI2LrQ9sLBfXuyp66zWvlsh74GPv7Xpabj993pRNNDuFud5oIcn/92isbADXdpRPbjmbCNOrwRbxGZx2XmYNGMiV5kjF4IKyxCBvKier9U4uVoheCdmk83rp5G0PihAm2fAtczI4b9BWqX+nrZTrJX5kSwQddi93NQrXG+Cl3eBGNkM77VBsMpEolhXex1MVvMkZN9fG59GGbciH11FEXaY1MxrArovaSjE/lUUqBg2cZBNmiWbvzCHCPJ4RVGFK2dTbObM1m+gJyEX53fa7u3+TZpm74mNEzWbkVL4vjNwfL9uzRCu1cgbrNx5Yv5dDruNrIOgwIk+UZWwJfdbu/WHul6PMmRflVCIzd7B37Pgm/Up/NuCiQW7RXyafevN3AL6ycciCc4ZPlTRzEu+aURGlUBOJbUEsheX7PPyrrhdUt5JAG12EEEZpY/N3Vhbl5uLAfT0CbC2XmpnryFkxZmBTs5prvEeuf0bn73i3O82WTiQtJWEPLsBXnQmdnKhB06NbbhLtlTZYJMxDMJpFeajSNRDB2v61BMUHqXggUwRJ19m6p5zl51v11q34T74lTXdJURuV6+bg2D6qpfGnLy7KGLuLZngobM4pIouz4+n0/UzFKxDgLM4h+fUwKZozQ9UGrHjcif51Ruonz7oIVZ56xWtZS8z7u5zay6J2LD4gCYh2RXoBRLDKsUlZ80R8kmoxlJiL8aZCy2wCAonnucFxCLT1HKoMhbPKt34D97EXPPh0joO93iJVF1Uruew61Qoy3ZUVNX9uIJDt9AQWKLLo+mSzmTibyLHq0D6hhzpvgUgI6ekyVEL3FD+Fi5R3A8MRHPXspN1VyKkfRlC+OGiNgPC4NREZpFETgVmdXrQ2TxChuS3aY+Ndc7CiYv5+CmzfiqeZrWIQJW/C4RvjbGUoJFf1K6ZdR2xL/bG4kVq1+I4jQWX+26YUijpp+lpN7o5c6ZodXJCF56UkFGsqz44sIg8jrdWvbjRCxi2Bk0iyM3a7ecAV93zB6h1Ei38c0s6+8nrbkopArccGP8vntQe1bFeEh2nJIFOHX/k3/UHb5PtKGpnzbkmnRETMX+9X/QduLZWw/feklW/kH/JnzToJe9Kgu9Hct1UGbH5BPCLo4OOtQnZonW0xnyCcdtKyPQ/sbLiSTYJdSx4sJqWLMnfn6fIqPB3WAgk00J+fCOkomPHqtS67pf0mFmKoItYZUlJu6BihSZ8qve8+/X+LX1MhQXF95AshfUleCtmdn6l6QFXzLg2sgLn1oyVFuZecv7fzsIHzoRlAGp0gwYDOn1S4qabWvB5xUaE+Svw4KmjWtxdnuQbI32dw87D4N95u8qQRJTSQg0wLxOLkxSrPMLEn1UIhNKjAa9VLs3WLaXGrtCIt8bKY2AQP/ZdyRU6zT/E8qP2ltyBE2CCZPgWgEYDoJJO4n92y61ylNaSFXKohJhLjkfvYWm592539sIpmBNLlDo1bExFBfmHJJ0lFEiC/fj8v42OoMC9Mo3whIoWvyHfq6Uacqq55mzFf/EGC+NP/gHjhd6urc6R0hES27VXux7UY8CGKPohplWIZtTrFSaPWslCWy78E22Pw8fvReSUZx/txqLtHrFqg1DY/Eus6Iq1heZdrdcqE0/c971Bz1HW/XNXHsXpUIbI4kHdOfCc6T5zHZzvzQJB0ggMFL6IGPAilU9bj/ASdPk6fNvNtZqPuwEDhMBtBnhCexo6D6VAGIOPvJPPV523Y8R8a9vCqZbswSZKzOT1291BsUbmUWehtbb1fdRX9hiJKXvwr1QX6GjnZMgyMvnwOo2Dr24amr7FqEAbVeJAjRNOceM2EQ1Mna9fInqPJ5mh5X8CzT1aDOv08An0blz0fF5Gq4mS2cwq5glwIOlY5nznE8X4j/UdZ3FJsVIXte1JH0A7iibuPfazStM5O/Vo3KXIpXBeGORV0M9XDXFvsYZUHGvFCUubWzTw248EHE0cpQM2zNg6rjavreq3NHCAWsoZ7wvVy7l5gvtKRmIj1MnvfWEm0yFnGcuOq192350a5WefpfKCcX3Sn+AgHU+qnpstNtddbdVebagJU390lq9ko4aI9rqdaWXYG8tv5O/ZQHSqDRYHC6zfH10l5z++opso7aOSaIczlQ13iAzXvLdEu0V7kwNUZ1c8Y8aq7SeIEe5p902FlNkW8DnwHyueHchbK8vVFJfmr9mz7P8nUSccl1ULaoWMRSI1ls32kvlK0h46h3J25Yd9AzfcJbp9qYF/SEt3H5j69mMdcsNxZcAzT/A89ov3tglTX54y/EwjMfuoDoxPwLJDm5I7q6F9Kp469yNy1zSxz0N4HbRRBj9xFFuogvBspv7DXUNIsGxTINEQfmctb42XImWAODgARNo7dfcTqFKq6aTfivmvunLmzP9f8yLsJvXD3JbcPcDGNriMAcjzeDTNr65t8YB5tsnFDFLa0Uwmd2OvUdkLMX9TsAUYUfooSv47sw5J88j7CpahRjjO3/UhOXjTS39W5YZAel2KTbQd1h7INOw9P23GW7GDAe4agIUFHP48MZr7ubq0efFmmtwYMyk7D0r1oeG/CGOODgb9Ur+JMHxkwzPbtCX2ZnENQuI0RN5SyTIZuoY4XS9Rd/tPe3vNAZGSHM/YYwqs9xkkENx0O+eC2YVW1cwOJ3ckE890nbQeHLKlW15L0P0W2VliyYrfNr0nrIYddoRyGaCtj4OYd2MT7ebApqZOAQIaSHJM4mphhfjNjtnjg6YRyx9qM2FT3xOiYIMqXPFWdzhSgFF8ItocqVV09CmIoO8k6U/oJB7++wSX/YksxfPXHyjSgAGZOj1aKEq9fSvXBqtp2wu8/FxEf5AxapAD06pPGuLVUYLdgEzHR8wqRGYEwiUO9MyYbgswstuLYhwYFpSVKOdzAihZ9LuHtD598EGhINU9xc9xhL+QgTLAstmPIvvm2xyRw/WTUPXkP3ZHu6GyPmj5xFH9/QGpkglKXRVUBgVmLOJx8uZO2AstxQYocZH2JhORlxawj66BAXUEs7K/gPxINIRAFyK3WLuyq9oBTF9wEbnmCot82WjIg7CPNwYK3KrZMrKAz5yFszg4wCVLJVnIL8+OYA0xRDH8cHQjQUiQ2i1mr/be32k/3Xej9sdf3iuGvZHyLFSJvPSqz/wltnxumTJYKZsrWXtx/Rmu39jjV9lFaJttfFn57/No2h/unsJmMHbrnZ8csxkp5HQ4xR1s0HH+t3Iz82a3iQWTUDGq/+l2W3TUYLE8zNdL8Y+5oXaIH/Y2UUcX67cXeN4WvENZjz4+8q7vjhowOI3rSjFhGZ6KzwmU7+5nFV+kGWAZ5z2UWvzq0TK0pk1hPwAN4jbw//1CApRvIaIjhSGhioY6TUmsToek9cF9XjJdHvLPcyyCV3lbR5Jiz/ts46ay2F820VjTXvllElwrGzKcNSyvQlWDXdwrUINXmHorAM3fE19ngLZmgeUaCJLsSITf2VcfAOuWwX7mTPdP8Zb/04KqRniufCpwnDUk7sP0RX6cud/sanFMagnzKInSRVey0YzlVSOtA/AjrofmSH6RYbJQ8b4NDeTkIGc6247+Mnbez/qhJ9GAv9fGNFercPnnrf285Qgs+UqThLRgflcAKFuqWhLzZaR4QqvSwa3xe0LPkqj9xJWub195r7NrrR0e78FR+0mRBNMPsraqZctAUVAJfYKehTDV1MGGQSeDsOK9J3sbUuKRIS/WilX/64CBms9jCZocBlsBSZaIAjWm/SUZ8daWL2a/cJFyUOFqE3Epc2RWbtjNyPwOGpWtzu32kUooUqsJud7IV4E8rstUBXM7tGEtBx99x60g1duhyvxeKJSl8s5E34HTMmADT0836aEdg5Dv9rVyCz8i2REOmiz6wtIVFN0HsjAoN37SrY0bV1Ms8CRUILhvZvvRaDzoVCaSI0u8EPuTe4b7OPowgRGODl22UBBmHSTUY8e4DyL+Bc7bngo+2T8HtNvzyATSL5iJZgFPKpmUyZv54vVL90+/RQGATUmNKnrIvcJMYON9fl83naW5sf6hRkbbTC9RUEE6XADwjgA46wWfUQ+QWZl0J4PVTWAln/YfAz/SV3q3J9+yCYDleruoN5uoc/wT2f4YONGTb6zTGq3V+3JqzmCOjwebKln+fExVLN7sqtqfMnsKVXWbb2Ai5m3D/fCTgX7oKYzTZvj+m28XnDqPbXuP4MyWdmPezcesdrh7rCzA7BWdObiuyDEKjjzBbQ0qnuwjliz+b+j7aPMKlkXyIznV3tGzAfYwIbzGGt098oh4eq3ruDjdgHtjxfFCjHrjjRbHajoz/YOY4raojPFQ910GIlBV7hq47UDgpyajBxQUmD8NctiLV1rTSLAEsQDLTeRKcmPBMVMFF0SPBBhZ5oXoxtD3lMhuAQXmA+57OcciczVW9e9zwSIAHS+FJmvfXMJGF1dMBsIUMaPjvgaVqUc3p32qVCMQYFEiRLzlVSOGMCmv/HJIxAHe3mL/XnoZ1IkWLeRZfgyByjnDbbeRK5KL7bYHSVJZ9UFq+yCiNKeRUaYjgbC3hVUvfJAhy/QNl/JqLKVvGMk9ZcfyGidNeo/VTxK9vUpodzfQI9Z2eAre4nmrkzgxKSnT5IJ1D69oHuUS5hp7pK9IAWuNrAOtOH0mAuwCrY8mXAtVXUeaNK3OXr6PRvmWg4VQqFSy+a1GZfFYgdsJELG8N0kvqmzvwZ02Plf5fH9QTy6br0oY/IDsEA+GBf9pEVWCIuBCjsup3LDSDqI+5+0IKSUFr7A96A2f0FbcU9fqljdqvsd8sG55KcKloHIFZem2Wb6pCLXybnVSB0sjCXzdS8IKvE");const pr=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),fr=4;function mr(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function gr(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let r=[];for(let n=0;n>24&255}function vr(e){return 16777215&e}const yr=new Map(sr(wr).flatMap(((e,t)=>e.map((e=>[e,t+1<<24]))))),xr=new Set(or(wr)),Ar=new Map,Cr=new Map;for(let[e,t]of ar(wr)){if(!xr.has(e)&&2==t.length){let[r,n]=t,i=Cr.get(r);i||(i=new Map,Cr.set(r,i)),i.set(n,e)}Ar.set(e,t.reverse())}const Er=44032,Ir=4352,_r=4449,Pr=4519,Or=28,Sr=21*Or,kr=Er+19*Sr,Mr=Ir+19,Tr=_r+21,Nr=Pr+Or;function jr(e){return e>=Er&&e=Ir&&e=_r&&tPr&&t0&&i(Pr+r)}else{let e=Ar.get(n);e?r.push(...e):i(n)}if(!r.length)break;n=r.pop()}if(n&&t.length>1){let e=br(t[0]);for(let r=1;r0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=s):r.push(s),i=e;else{let o=Rr(n,s);o>=0?n=o:0==i&&0==e?(t.push(n),n=s):(r.push(s),i=e)}}return n>=0&&t.push(n,...r),t}(Lr(e))}const Ur=65039,Dr=".",zr=1,Wr=45;function Fr(){return new Set(or(dr))}const Hr=new Map(ar(dr)),qr=Fr(),Vr=Fr(),Gr=new Set(or(dr).map((function(e){return this[e]}),[...Vr])),Kr=Fr(),Zr=(Fr(),sr(dr));function Qr(){return new Set([or(dr).map((e=>Zr[e])),or(dr)].flat(2))}const Yr=dr(),Jr=cr((e=>{let t=cr(dr).map((e=>e+96));if(t.length){let r=e>=Yr;t[0]-=32,t=gr(t),r&&(t=`Restricted[${t}]`);let n=Qr(),i=Qr(),o=[...n,...i].sort(((e,t)=>e-t));return{N:t,P:n,M:!dr(),R:r,V:new Set(o)}}})),Xr=Fr(),en=new Map;[...Xr,...Fr()].sort(((e,t)=>e-t)).map(((e,t,r)=>{let n=dr(),i=r[t]=n?r[t-n]:{V:[],M:new Map};i.V.push(e),Xr.has(e)||en.set(e,i)}));for(let{V:e,M:t}of new Set(en.values())){let r=[];for(let t of e){let e=Jr.filter((e=>e.V.has(t))),n=r.find((({G:t})=>e.some((e=>t.has(e)))));n||(n={G:new Set,V:[]},r.push(n)),n.V.push(t),e.forEach((e=>n.G.add(e)))}let n=r.flatMap((({G:e})=>[...e]));for(let{G:e,V:i}of r){let r=new Set(n.filter((t=>!e.has(t))));for(let e of i)t.set(e,r)}}let tn=new Set,rn=new Set;for(let e of Jr)for(let t of e.V)(tn.has(t)?rn:tn).add(t);for(let e of tn)en.has(e)||rn.has(e)||en.set(e,zr);const nn=new Set([...tn,...Br(tn)]),on=or(dr),sn=function e(t){let r=cr((()=>{let t=or(dr).map((e=>on[e]));if(t.length)return e(t)})).sort(((e,t)=>t.Q.size-e.Q.size)),n=dr(),i=n%3;n=n/3|0;let o=1&n;return n>>=1,{B:r,V:i,F:o,S:1&n,C:2&n,Q:new Set(t)}}([]);class an extends Array{get is_emoji(){return!0}}function cn(e,t=mr){let r=[];var n;n=e[0],Vr.has(n)&&r.push("◌");let i=0,o=e.length;for(let n=0;n0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}function dn(e){return Kr.has(e)}function pn(e,t){let r=0;return e.split(Dr).map((e=>{let n,i=function(e){let t=[];for(let r=0,n=e.length;r1||i.is_emoji;if(!a&&i.every((e=>e<128)))n=i,hn(n),function(e){if(e.length>=4&&e[2]==Wr&&e[3]==Wr)throw new Error("invalid label extension")}(n),e="ASCII";else if(a&&(o.emoji=!0,i=r.flatMap((e=>e.is_emoji?[]:e))),n=r.flatMap((e=>!t&&e.is_emoji?e.filter((e=>e!=Ur)):e)),hn(n),i.length){if(Vr.has(n[0]))throw gn("leading combining mark");for(let e=1;ee.V.has(r)));if(!e.length)throw t===Jr?fn(r):mn(t[0],r);if(t=e,1==e.length)break}return t}(t);!function(e,t){let{V:r,M:n}=e;for(let n of t)if(!r.has(n))throw mn(e,n);if(n){let e=Br(t);for(let t=1,r=e.length;tfr)throw new Error(`non-spacing marks: too many ${un(cn(e.slice(t-1,n)))} (${n-t}/${fr})`);t=n}}}(o,i),function(e,t){let r,n=[];for(let e of t){let t=en.get(e);if(t===zr)return;if(t){let n=t.M.get(e);if(r=r?r.filter((e=>n.has(e))):[...n],!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every((e=>t.V.has(e))))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(o,t),e=o.N}else e="Emoji"}o.type=e}catch(e){o.error=e}return o.output=n,o}))}function fn(e){return new Error(`disallowed character: ${ln(e)}`)}function mn(e,t){let r=ln(t),n=Jr.find((e=>e.P.has(t)));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function gn(e){return new Error(`illegal placement: ${e}`)}function wn(e,t){let r,n,i=sn,o=[],s=e.length;for(t&&(t.length=0);s;){let a=e[--s];if(i=i.B.find((e=>e.Q.has(a))),!i)break;if(i.S)n=a;else if(i.C&&a===n)break;o.push(a),i.F&&(o.push(Ur),s>0&&e[s-1]==Ur&&s--),i.V&&(r=bn(o,i),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}function bn(e,t){let r=an.from(e);return 2==t.V&&r.splice(1,1),r}function vn(e){return function(e){return(t=pn(e)).map((({input:e,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==t.length?n:`Invalid label ${un(cn(e))}: ${n}`)}return gr(n)})).join(Dr);var t}(e)}var yn=class extends Error{constructor({activeChain:e,targetChain:t}){super(`Chain mismatch: Expected "${t}", received "${e}".`),this.name="ChainMismatchError"}},xn=class extends Error{constructor({chainId:e,connectorId:t}){super(`Chain "${e}" not configured${t?` for connector "${t}"`:""}.`),this.name="ChainNotConfigured"}},An=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},Cn=class extends Error{constructor(){super(...arguments),this.name="ConfigChainsNotFound",this.message="No chains were found on the wagmi config. Some functions that require a chain may not work."}},En=class extends Error{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}},In=(e,{find:t,replace:r})=>e&&t(e)?r(e):"object"!=typeof e?e:Array.isArray(e)?e.map((e=>In(e,{find:t,replace:r}))):e instanceof Object?Object.entries(e).reduce(((e,[n,i])=>({...e,[n]:In(i,{find:t,replace:r})})),{}):e;function _n(e){const t=JSON.parse(e);return In(t,{find:e=>"string"==typeof e&&e.startsWith("#bigint."),replace:e=>BigInt(e.replace("#bigint.",""))})}function Pn(e){return"number"==typeof e?e:"wei"===e?0:Math.abs(Qt.Bd[e])}function On(e,t){return e.slice(0,t).join(".")||"."}function Sn(e,t){const{length:r}=e;for(let n=0;n{const n="bigint"==typeof r?`#bigint.${r.toString()}`:r;return t?.(e,n)||n}),n),r??void 0)}var Mn={getItem:e=>"",setItem:(e,t)=>null,removeItem:e=>null};function Tn({deserialize:e=_n,key:t="wagmi",serialize:r=kn,storage:n}){return{...n,getItem:(r,i=null)=>{const o=n.getItem(`${t}.${r}`);try{return o?e(o):i}catch(e){return console.warn(e),i}},setItem:(e,i)=>{if(null===i)n.removeItem(`${t}.${e}`);else try{n.setItem(`${t}.${e}`,r(i))}catch(e){console.error(e)}},removeItem:e=>n.removeItem(`${t}.${e}`)}}var Nn,jn,Rn,Ln,Bn,$n="store";function Un(){if(!Bn)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return Bn}async function Dn({chainId:e,connector:t}){const r=Un(),n=r.connector;if(n&&t.id===n.id)throw new An;try{r.setState((e=>({...e,status:"connecting"})));const n=await t.connect({chainId:e});return r.setLastUsedConnector(t.id),r.setState((e=>({...e,connector:t,chains:t?.chains,data:n,status:"connected"}))),r.storage.setItem("connected",!0),{...n,connector:t}}catch(e){throw r.setState((e=>({...e,status:e.connector?"connected":"disconnected"}))),e}}async function zn(){const e=Un();e.connector&&await e.connector.disconnect(),e.clearState(),e.storage.removeItem("connected")}Nn=new WeakMap,jn=new WeakMap,Rn=new WeakSet,Ln=function(){const e=e=>{this.setState((t=>({...t,data:{...t.data,...e}})))},t=()=>{this.clearState()},r=e=>{this.setState((t=>({...t,error:e})))};this.store.subscribe((({connector:e})=>e),((n,i)=>{i?.off?.("change",e),i?.off?.("disconnect",t),i?.off?.("error",r),n&&(n.on?.("change",e),n.on?.("disconnect",t),n.on?.("error",r))}));const{publicClient:n,webSocketPublicClient:i}=this.args;("function"==typeof n||"function"==typeof i)&&this.store.subscribe((({data:e})=>e?.chain?.id),(e=>{this.setState((t=>({...t,publicClient:this.getPublicClient({chainId:e}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:e})})))}))};var Wn=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Fn=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function Hn({chainId:e}={}){const t=Un();return e&&t.getPublicClient({chainId:e})||t.publicClient}async function qn({chainId:e}={}){const t=Un();return await(t.connector?.getWalletClient?.({chainId:e}))||null}async function Vn({address:e,account:t,chainId:r,abi:n,args:i,functionName:o,blockNumber:s,blockTag:a}){return Hn({chainId:r}).readContract({abi:n,address:e,account:t,functionName:o,args:i,blockNumber:s,blockTag:a})}async function Gn({contracts:e,blockNumber:t,blockTag:r,...n}){const{allowFailure:i=!0}=n;try{const n=Hn(),o=e.reduce(((e,t,r)=>{const i=t.chainId??n.chain.id;return{...e,[i]:[...e[i]||[],{contract:t,index:r}]}}),{}),s=()=>Object.entries(o).map((([e,n])=>async function({chainId:e,contracts:t,blockNumber:r,blockTag:n,...i}){const o=Hn({chainId:e});if(!o.chains)throw new Cn;if(e&&o.chain.id!==e)throw new xn({chainId:e});return o.multicall({allowFailure:i.allowFailure??!0,blockNumber:r,blockTag:n,contracts:t})}({allowFailure:i,chainId:parseInt(e),contracts:n.map((({contract:e})=>e)),blockNumber:t,blockTag:r}))),a=(await Promise.all(s())).flat(),c=Object.values(o).flatMap((e=>e.map((({index:e})=>e))));return a.reduce(((e,t,r)=>(e&&(e[c[r]]=t),e)),[])}catch(n){if(n instanceof Se.uq)throw n;const o=()=>e.map((e=>Vn({...e,blockNumber:t,blockTag:r})));return i?(await Promise.allSettled(o())).map((e=>"fulfilled"===e.status?{result:e.value,status:"success"}:{error:e.reason,result:void 0,status:"failure"})):await Promise.all(o())}}async function Kn({address:e,chainId:t,formatUnits:r,token:n}){const i=Un(),s=Hn({chainId:t});if(n){const i=async({abi:i})=>{const o={abi:i,address:n,chainId:t},[s,a,c]=await Gn({allowFailure:!1,contracts:[{...o,functionName:"balanceOf",args:[e]},{...o,functionName:"decimals"},{...o,functionName:"symbol"}]});return{decimals:a,formatted:(0,er.b)(s??"0",Pn(r??a)),symbol:c,value:s}};try{return await i({abi:Wn})}catch(e){if(e instanceof Se.uq){const{symbol:e,...t}=await i({abi:Fn});return{symbol:(0,o.rR)((0,Me.f)(e,{dir:"right"})),...t}}throw e}}const a=[...i.publicClient.chains||[],...i.chains??[]],c=await s.getBalance({address:e}),l=a.find((e=>e.id===s.chain.id));return{decimals:l?.nativeCurrency.decimals??18,formatted:(0,er.b)(c??"0",Pn(r??18)),symbol:l?.nativeCurrency.symbol??"ETH",value:c}}function Zn(){const{data:e,connector:t,status:r}=Un();switch(r){case"connected":return{address:e?.account,connector:t,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:e?.account,connector:t,isConnected:!!e?.account,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:e?.account,connector:t,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function Qn(){const e=Un(),t=e.data?.chain?.id,r=e.chains??[],n=[...e.publicClient?.chains||[],...r].find((e=>e.id===t))??{id:t,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:t?{...n,...e.data?.chain,id:t}:void 0,chains:r}}async function Yn({domain:e,message:t,primaryType:r,types:n}){const i=await qn();if(!i)throw new I;const{chainId:o}=e;return o&&ni({chainId:o}),i.signTypedData({message:t,primaryType:r,types:n,domain:e})}async function Jn({chainId:e}){const{connector:t}=Un();if(!t)throw new I;if(!t.switchChain)throw new En({connector:t});return t.switchChain(e)}function Xn(e,{selector:t=(e=>e)}={}){return Un().subscribe((({data:e,connector:r,status:n})=>t({address:e?.account,connector:r,status:n})),(()=>e(Zn())),{equalityFn:tr})}function ei(e,{selector:t=(e=>e)}={}){const r=Un().subscribe((({data:e,chains:r})=>t({chainId:e?.chain?.id,chains:r})),(()=>e(Qn())),{equalityFn:tr});return r}async function ti({name:e,chainId:t}){const r=Hn({chainId:t});return await r.getEnsAvatar({name:vn(e)})}async function ri({address:e,chainId:t}){return Hn({chainId:t}).getEnsName({address:(0,P.K)(e)})}function ni({chainId:e}){const{chain:t,chains:r}=Qn(),n=t?.id;if(n&&e!==n)throw new yn({activeChain:r.find((e=>e.id===n))?.name??`Chain ${n}`,targetChain:r.find((t=>t.id===e))?.name??`Chain ${e}`})}var ii,oi,si,ai,ci,li,ui,hi,di,pi,fi,mi,gi,wi,bi,vi,yi,xi,Ai,Ci,Ei="eip155",Ii="requestedChains",_i="wallet_addEthereumChain",Pi=class extends C{constructor(e){super({...e,options:{isNewChainsStale:!0,...e.options}}),y(this,si),y(this,ci),y(this,ui),y(this,di),y(this,fi),y(this,gi),y(this,bi),y(this,yi),y(this,Ai),w(this,"id","walletConnect"),w(this,"name","WalletConnect"),w(this,"ready",!0),y(this,ii,void 0),y(this,oi,void 0),w(this,"onAccountsChanged",(e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,P.K)(e[0])})})),w(this,"onChainChanged",(e=>{const t=Number(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})})),w(this,"onDisconnect",(()=>{A(this,gi,wi).call(this,[]),this.emit("disconnect")})),w(this,"onDisplayUri",(e=>{this.emit("message",{type:"display_uri",data:e})})),w(this,"onConnect",(()=>{this.emit("connect",{})})),A(this,si,ai).call(this)}async connect({chainId:e,pairingTopic:t}={}){try{let r=e;if(!r){const e=this.storage?.getItem("store"),t=e?.state?.data?.chain?.id;r=t&&!this.isChainUnsupported(t)?t:this.chains[0]?.id}if(!r)throw new Error("No chains found on connector.");const n=await this.getProvider();A(this,di,pi).call(this);const i=A(this,ui,hi).call(this);if(n.session&&i&&await n.disconnect(),!n.session||i){const e=this.chains.filter((e=>e.id!==r)).map((e=>e.id));this.emit("message",{type:"connecting"}),await n.connect({pairingTopic:t,chains:[r],optionalChains:e}),A(this,gi,wi).call(this,this.chains.map((({id:e})=>e)))}const o=await n.enable(),s=(0,P.K)(o[0]),a=await this.getChainId();return{account:s,chain:{id:a,unsupported:this.isChainUnsupported(a)}}}catch(e){if(/user rejected/i.test(e?.message))throw new O.ab(e);throw e}}async disconnect(){const e=await this.getProvider();try{await e.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{A(this,fi,mi).call(this),A(this,gi,wi).call(this,[])}}async getAccount(){const{accounts:e}=await this.getProvider();return(0,P.K)(e[0])}async getChainId(){const{chainId:e}=await this.getProvider();return e}async getProvider({chainId:e}={}){return v(this,ii)||await A(this,si,ai).call(this),e&&await this.switchChain(e),v(this,ii)}async getWalletClient({chainId:e}={}){const[t,r]=await Promise.all([this.getProvider({chainId:e}),this.getAccount()]),n=this.chains.find((t=>t.id===e));if(!t)throw new Error("provider is required.");return fe({account:r,chain:n,transport:xe(t)})}async isAuthorized(){try{const[e,t]=await Promise.all([this.getAccount(),this.getProvider()]),r=A(this,ui,hi).call(this);if(!e)return!1;if(r&&t.session){try{await t.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(e){const t=this.chains.find((t=>t.id===e));if(!t)throw new O.x3(new Error("chain not found on connector."));try{const r=await this.getProvider(),n=A(this,yi,xi).call(this),i=A(this,Ai,Ci).call(this);if(!n.includes(e)&&i.includes(_i)){await r.request({method:_i,params:[{chainId:(0,s.eC)(t.id),blockExplorerUrls:[t.blockExplorers?.default?.url],chainName:t.name,nativeCurrency:t.nativeCurrency,rpcUrls:[...t.rpcUrls.default.http]}]});const n=A(this,bi,vi).call(this);n.push(e),A(this,gi,wi).call(this,n)}return await r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,s.eC)(e)}]}),t}catch(e){if(/user rejected request/i.test("string"==typeof e?e:e?.message))throw new O.ab(e);throw new O.x3(e)}}};ii=new WeakMap,oi=new WeakMap,si=new WeakSet,ai=async function(){return v(this,oi)||"undefined"==typeof window||x(this,oi,A(this,ci,li).call(this)),v(this,oi)},ci=new WeakSet,li=async function(){const{default:e,OPTIONAL_EVENTS:t,OPTIONAL_METHODS:n}=await Promise.resolve().then(r.bind(r,9328)),[i,...o]=this.chains.map((({id:e})=>e));if(i){const{projectId:r,showQrModal:s=!0,qrModalOptions:a,metadata:c}=this.options;x(this,ii,await e.init({showQrModal:s,qrModalOptions:a,projectId:r,optionalMethods:n,optionalEvents:t,chains:[i],optionalChains:o,rpcMap:Object.fromEntries(this.chains.map((e=>[e.id,e.rpcUrls.default.http[0]]))),metadata:c}))}},ui=new WeakSet,hi=function(){if(A(this,Ai,Ci).call(this).includes(_i))return!1;if(!this.options.isNewChainsStale)return!1;const e=A(this,bi,vi).call(this),t=this.chains.map((({id:e})=>e)),r=A(this,yi,xi).call(this);return!(r.length&&!r.some((e=>t.includes(e)))||t.every((t=>e.includes(t))))},di=new WeakSet,pi=function(){v(this,ii)&&(A(this,fi,mi).call(this),v(this,ii).on("accountsChanged",this.onAccountsChanged),v(this,ii).on("chainChanged",this.onChainChanged),v(this,ii).on("disconnect",this.onDisconnect),v(this,ii).on("session_delete",this.onDisconnect),v(this,ii).on("display_uri",this.onDisplayUri),v(this,ii).on("connect",this.onConnect))},fi=new WeakSet,mi=function(){v(this,ii)&&(v(this,ii).removeListener("accountsChanged",this.onAccountsChanged),v(this,ii).removeListener("chainChanged",this.onChainChanged),v(this,ii).removeListener("disconnect",this.onDisconnect),v(this,ii).removeListener("session_delete",this.onDisconnect),v(this,ii).removeListener("display_uri",this.onDisplayUri),v(this,ii).removeListener("connect",this.onConnect))},gi=new WeakSet,wi=function(e){this.storage?.setItem(Ii,e)},bi=new WeakSet,vi=function(){return this.storage?.getItem(Ii)??[]},yi=new WeakSet,xi=function(){if(!v(this,ii))return[];const e=v(this,ii).session?.namespaces[Ei]?.chains?.map((e=>parseInt(e.split(":")[1]||"")));return e??[]},Ai=new WeakSet,Ci=function(){if(!v(this,ii))return[];const e=v(this,ii).session?.namespaces[Ei]?.methods;return e??[]};class Oi{constructor(e,t){this.wagmi={},this.chains=[],this.namespace="eip155",this.disconnect=zn,this.getAccount=Zn,this.watchAccount=Xn,this.fetchBalance=Kn,this.getNetwork=Qn,this.watchNetwork=ei,this.switchNetwork=Jn,this.fetchEnsName=ri,this.fetchEnsAvatar=ti,this.wagmi=e,this.chains=t}getWalletConnectConnector(){const e=this.wagmi.connectors.find((e=>"walletConnect"===e.id));if(!e)throw new Error("WalletConnectConnector is required");return e}async connectWalletConnectProvider(e,t){return await e.getProvider(),new Promise((r=>{e.once("message",(e=>{"display_uri"===e.type&&(t(e.data),r())}))}))}getConnectorById(e){const t=this.wagmi.connectors.find((t=>t.id===e));if(!t)throw new Error(`Connector for id ${e} was not found`);return t}getConnectors(){return this.wagmi.connectors.filter((e=>!e.id.includes("walletConnect")))}async connectWalletConnect(e,t){const r=this.getWalletConnectConnector(),n={connector:r};return t&&(n.chainId=t),Promise.all([Dn(n),this.connectWalletConnectProvider(r,e)])}async connectConnector(e,t){const r={connector:this.getConnectorById(e)};return t&&(r.chainId=t),await Dn(r)}isInjectedProviderInstalled(){return typeof window.ethereum<"u"}safeCheckInjectedProvider(e){var t;try{const r=String(e);return Boolean(null==(t=window.ethereum)?void 0:t[r])}catch(e){return console.error(e),!1}}async getConnectedChainIds(){var e,t,r;const n=null==(t=null==(e=(await this.getWalletConnectConnector().getProvider()).signer)?void 0:e.session)?void 0:t.namespaces,i=null==(r=n?.[this.namespace])?void 0:r.methods;if(null!=i&&i.includes("wallet_addEthereumChain"))return"ALL";if(n){const e=[];return Object.keys(n).forEach((t=>{t.includes(this.namespace)&&e.push(...n[t].accounts)})),e?.map((e=>e.split(":")[1]))}return"ALL"}}function Si({projectId:e}){return function({rpc:e}){return function(t){const r=e(t);return r&&""!==r.http?{chain:{...t,rpcUrls:{...t.rpcUrls,default:{http:[r.http]}}},rpcUrls:{http:[r.http],webSocket:r.webSocket?[r.webSocket]:void 0}}:null}}({rpc:t=>{var r;return[1,3,4,5,10,42,56,69,97,100,137,280,324,420,42161,42220,43114,80001,421611,421613,1313161554,1313161555].includes(t.id)?{http:`https://rpc.walletconnect.com/v1/?chainId=eip155:${t.id}&projectId=${e}`}:{http:t.rpcUrls.default.http[0],webSocket:null==(r=t.rpcUrls.default.webSocket)?void 0:r[0]}}})}function ki({chains:e,projectId:t}){return[new Pi({chains:e,options:{projectId:t,showQrModal:!1}}),new Ce({chains:e,options:{shimDisconnect:!0}})]}var Mi=r(1475);class Ti{constructor(e,t){this.openModal=Mi.jb.open,this.closeModal=Mi.jb.close,this.subscribeModal=Mi.jb.subscribe,this.setTheme=Mi.ThemeCtrl.setThemeConfig,this.setDefaultChain=Mi.OptionsCtrl.setSelectedChain,this.subscribeEvents=Mi.uA.subscribe,Mi.ThemeCtrl.setThemeConfig(e),Mi.Id.setEthereumClient(t),Mi.ConfigCtrl.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(r.bind(r,8416));const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Mi.OptionsCtrl.setIsUiLoaded(!0)}}}const Ni=[{safeNetworkIdentifier:"mainnet",chain:{id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}},{safeNetworkIdentifier:"goerli",chain:{id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}},{safeNetworkIdentifier:"arbitrum",chain:{id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}},{chain:{id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}},{safeNetworkIdentifier:"optimism",chain:{id:10,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}}}},{chain:{id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0}},{chain:{id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]},public:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}},{chain:{id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}},{chain:{id:1101,name:"Polygon zkEVM",network:"polygon-zkevm",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]},public:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com"}}}}],ji={selectedAccount:null,signedByAccount:null,messageSignature:null,paymentDetails:null,signatureRequested:!1,transactionRequested:!1,transactionHashSubmitted:!1,lastOrderStatus:"",elements:{divPrepare:document.getElementById("prepare"),divError:document.getElementById("message-error"),divSuccess:document.getElementById("success"),divTransactionHash:document.getElementById("pretix-eth-transaction-hash"),aOrderDetailURL:document.getElementById("pretix-order-detail-url"),aNetworkData:document.getElementById("pretix-data-chain-info"),buttonConnect:document.getElementById("btn-connect"),submittedTransactionHash:document.getElementById("pretix-eth-submitted-transaction-hash"),paymentNetworkName:document.getElementById("payment-network-id")},selectors:{paymentSteps:document.querySelectorAll(".pretix-eth-payment-steps")},chains:[],web3Modal:null};function Ri(){return ji.elements.buttonConnect.getAttribute("data-transaction-details-url")}async function Li(e=!1){if(!e&&null!==ji.paymentDetails)return ji.paymentDetails;const t=await(Zn()?.address),r=Ri(),n=await fetch(r+"?"+new URLSearchParams({sender_address:t}));if(n.status>=400)throw"Failed to fetch order details. If this problem persists, please contact the organizer directly.";return await n.json()}function Bi(e){e+="=";const t=decodeURIComponent(document.cookie).split(";");for(let r=0;r{const e=`https://safe-transaction-${ji.safeNetworkIdentifier}.safe.global/api/v1/safes/${ji.selectedAccount}`;return(await fetch(e)).ok};if(!await t())return $i("This version of the crypto payment plugin only supports Safe wallet (on supported networks) and EOA wallets. Please connect another wallet."),void(ji.signatureRequested=!1);const r=await Yn(e),n=new URL(window.location.origin+window.__validateSignatureUrl);n.searchParams.append("signature",r),n.searchParams.append("sender",ji.selectedAccount);const i=Bi("pretix_csrftoken"),o=await fetch(n.href,{headers:{"Content-Type":"application/x-www-form-urlencoded","X-CSRF-TOKEN":i,"HTTP-X-CSRFTOKEN":i},method:"GET"});if(ji.messageSignature=r,ji.signedByAccount=ji.selectedAccount,!o.ok)return $i("EIP1271 error: unable to verify signature; your wallet may not be supported."),void(ji.signatureRequested=!1);await Wi()}else{const t=await Yn(e);ji.messageSignature=t,ji.signedByAccount=ji.selectedAccount,await Wi()}}}()}catch(e){$i(e),ji.signatureRequested=!1}}();else $i("Please wait for other payments from your wallet to be confirmed before submitting another transaction.");else $i("It seems that you have paid for this order already.")}()}catch(e){$i(e,!0)}}async function Wi(){try{await async function(){if(!0!==ji.transactionRequested)if(ji.transactionRequested=!0,ji.paymentDetails=await Li(),null!==ji.paymentDetails.erc20_contract_address){const e=ji.paymentDetails.erc20_contract_address,t=await Vn({abi:Wn,address:e,functionName:"balanceOf",args:[ji.selectedAccount]});if(BigInt(t)"name"in e&&e.name===i)),chainId:n},result:v}}(i);r=o.request}return{hash:await t.writeContract({...r,chain:null})}}({abi:Wn,address:e,functionName:"transfer",args:[ji.paymentDetails.recipient_address,ji.paymentDetails.amount]});await Fi(t)}catch(e){$i(e)}}else{Ui("send-transaction");try{const{hash:e}=await async function({accessList:e,account:t,chainId:r,data:n,gas:i,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,mode:c,nonce:l,to:u,value:h}){const d=await qn({chainId:r});if(!d)throw new I;let p;return r&&ni({chainId:r}),p="prepared"===c?{account:t,accessList:e,chain:null,data:n,gas:i,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:l,to:u,value:h}:await async function({accessList:e,account:t,chainId:r,data:n,gas:i,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:c,to:l,value:u,walletClient:h}){const d=Hn({chainId:r}),p=h??await qn({chainId:r});if(!p)throw new I;r&&ni({chainId:r});const f=(l&&!(0,ae.U)(l)?await async function({chainId:e,name:t}){const r=Hn({chainId:e}),n=await r.getEnsAddress({name:vn(t)});try{return"0x0000000000000000000000000000000000000000"===n?null:n?(0,P.K)(n):null}catch(e){return null}}({name:l}):l)||void 0;if(f&&!(0,ae.U)(f))throw new Error("Invalid address");return{accessList:e,account:t,data:n,gas:void 0===i?await d.estimateGas({accessList:e,account:p.account,data:n,gas:i??void 0,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:c,to:f,value:u}):i||void 0,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,mode:"prepared",nonce:c,to:f,value:u,...r?{chainId:r}:{}}}({accessList:e,account:t,chainId:r,data:n,gas:i||null,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:a,nonce:l,to:u,value:h}),{hash:await d.sendTransaction({...p,chain:null})}}({to:ji.paymentDetails.recipient_address,value:ji.paymentDetails.amount});await Fi(e)}catch(e){$i(e)}}else console.log("Transaction was already submitted.")}()}catch(e){$i(e,!0)}}async function Fi(e){try{await async function(e){const t=await(async e=>{try{const t=`https://safe-transaction-${ji.safeNetworkIdentifier}.safe.global/api/v1/multisig-transactions/${e}`;if((await fetch(t)).ok)return t}catch(e){return}})(e),r=Bi("pretix_csrftoken"),n=Ri();let i=new URLSearchParams({signedMessage:ji.messageSignature,transactionHash:e,selectedAccount:ji.signedByAccount,csrfmiddlewaretoken:r});t&&i.append("safeAppTransactionUrl",t),fetch(n,{headers:{"Content-Type":"application/x-www-form-urlencoded","X-CSRF-TOKEN":r,"HTTP-X-CSRFTOKEN":r},method:"POST",body:i}).then((async r=>{r.ok?(function(e,t){ji.transactionHashSubmitted=!0;const r=ji.elements.aNetworkData.getAttribute("data-chain-id");ji.elements.divTransactionHash.innerHTML=t||function(e,t){const r=Ni.filter((t=>t.chain.id===parseInt(e)));let n;r&&(n=r[0].chain);const i=n?.blockExplorers?.etherscan?.url;return i?''+t+"":t}(r,e),Ui(),ji.elements.divSuccess.style.display="block"}(e,t),await async function(){for(;;)await Di(),await new Promise((e=>setTimeout(e,5e3)))}()):$i("There was an error processing your payment, please contact support. Your payment was sent in transaction "+e+".",!1)}))}(e)}catch(e){$i(e,!0)}}!async function(){const e=ji.elements.buttonConnect.getAttribute("data-chain-id"),t=document.getElementById("web3modal").getAttribute("data-walletconnect-id");document.title="Pretix Payment";const r=Ni.filter((t=>t.chain.id===parseInt(e)));if(r.length<1)return void $i("Invalid chain ID");const{publicClient:n}=function(e,t,{batch:r={multicall:{wait:32}},pollingInterval:n=4e3,rank:i,retryCount:o,retryDelay:s,stallTimeout:a}={}){if(!e.length)throw new Error("must have at least one chain");let c=[];const l={},u={};for(const r of e){let e=!1;for(const n of t){const t=n(r);t&&(e=!0,c.some((({id:e})=>e===r.id))||(c=[...c,t.chain]),l[r.id]=[...l[r.id]||[],...t.rpcUrls.http],t.rpcUrls.webSocket&&(u[r.id]=[...u[r.id]||[],...t.rpcUrls.webSocket]))}if(!e)throw new Error([`Could not find valid provider configuration for chain "${r.name}".\n`,"You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.","Read more: https://wagmi.sh/core/providers/jsonRpc"].join("\n"))}return{chains:c,publicClient:({chainId:t})=>{const u=c.find((e=>e.id===t))??e[0],h=l[u.id];if(!h||!h[0])throw new Error(`No providers configured for chain "${u.id}"`);const d=zt({batch:r,chain:u,transport:Wt(h.map((e=>function(e,t={}){const{batch:r,fetchOptions:n,key:i="http",name:o="HTTP JSON-RPC",retryDelay:s}=t;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:h=0}="object"==typeof r?r:{},d=t.retryCount??c,p=l??t.timeout??1e4,f=e||a?.rpcUrls.default.http[0];if(!f)throw new Ft;return ye({key:i,name:o,async request({method:t,params:i}){const o={method:t,params:i},{schedule:s}=(0,Ht.S)({id:`${e}`,wait:h,shouldSplitBatch:e=>e.length>u,fn:e=>Zt.http(f,{body:e,fetchOptions:n,timeout:p})}),[{error:a,result:c}]=await(async e=>r?s(e):[await Zt.http(f,{body:e,fetchOptions:n,timeout:p})])(o);if(a)throw new me.bs({body:o,error:a,url:f});return c},retryCount:d,retryDelay:s,timeout:p,type:"http"},{url:e})}}(e,{timeout:a}))),{rank:i,retryCount:o,retryDelay:s}),pollingInterval:n});return Object.assign(d,{chains:c})},webSocketPublicClient:({chainId:t})=>{const l=c.find((e=>e.id===t))??e[0],h=u[l.id];if(!h||!h[0])return;const d=zt({batch:r,chain:l,transport:Wt(h.map((e=>function(e,t={}){const{key:r="webSocket",name:n="WebSocket JSON-RPC",retryDelay:i}=t;return({chain:o,retryCount:s,timeout:a})=>{const c=t.retryCount??s,l=a??t.timeout??1e4,u=e||o?.rpcUrls.default.webSocket?.[0];if(!u)throw new Ft;return ye({key:r,name:n,async request({method:e,params:t}){const r={method:e,params:t},n=await Kt(u),{error:i,result:o}=await Zt.webSocketAsync(n,{body:r,timeout:l});if(i)throw new me.bs({body:r,error:i,url:u});return o},retryCount:c,retryDelay:i,timeout:l,type:"webSocket"},{getSocket:()=>Kt(u),async subscribe({params:e,onData:t,onError:r}){const n=await Kt(u),{result:i}=await new Promise(((i,o)=>Zt.webSocket(n,{body:{method:"eth_subscribe",params:e},onResponse(e){if(e.error)return o(e.error),void r?.(e.error);"number"!=typeof e.id?"eth_subscription"===e.method&&t(e.params):i(e)}})));return{subscriptionId:i,unsubscribe:async()=>new Promise((e=>Zt.webSocket(n,{body:{method:"eth_unsubscribe",params:[i]},onResponse:e})))}}})}}(e,{timeout:a}))),{rank:i,retryCount:o,retryDelay:s}),pollingInterval:n});return Object.assign(d,{chains:c})}}}([r[0].chain],[Si({projectId:t})]),i=function(e){const t=new class{constructor({autoConnect:e=!1,connectors:t=[new Ce],publicClient:r,storage:n=Tn({storage:"undefined"!=typeof window?window.localStorage:Mn}),logger:i={warn:console.warn},webSocketPublicClient:o}){_e(this,Rn),this.publicClients=new Map,this.webSocketPublicClients=new Map,_e(this,Nn,void 0),_e(this,jn,void 0),this.args={autoConnect:e,connectors:t,logger:i,publicClient:r,storage:n,webSocketPublicClient:o};let s,a="disconnected";if(e)try{const e=n.getItem($n),t=e?.state?.data;a=t?.account?"reconnecting":"connecting",s=t?.chain?.id}catch(e){}const c="function"==typeof t?t():t;var l,u,h,d;c.forEach((e=>e.setStorage(n))),this.store=(d=((e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(r,n,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let l;try{l=o.getStorage()}catch(e){}if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...e)}),n,i);const u=Jt(o.serialize),h=()=>{const e=o.partialize({...n()});let t;const r=u({state:e,version:o.version}).then((e=>l.setItem(o.name,e))).catch((e=>{t=e}));if(t)throw t;return r},d=i.setState;i.setState=(e,t)=>{d(e,t),h()};const p=e(((...e)=>{r(...e),h()}),n,i);let f;const m=()=>{var e;if(!l)return;s=!1,a.forEach((e=>e(n())));const t=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,n()))||void 0;return Jt(l.getItem.bind(l))(o.name).then((e=>{if(e)return o.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return f=o.merge(e,null!=(t=n())?t:p),r(f,!0),h()})).then((()=>{null==t||t(f,void 0),s=!0,c.forEach((e=>e(f)))})).catch((e=>{null==t||t(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.getStorage&&(l=e.getStorage())},clearStorage:()=>{null==l||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),f||p})(e,t)):((e,t)=>(r,n,i)=>{let o={storage:Yt((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...e)}),n,i);const u=()=>{const e=o.partialize({...n()});return l.setItem(o.name,{state:e,version:o.version})},h=i.setState;i.setState=(e,t)=>{h(e,t),u()};const d=e(((...e)=>{r(...e),u()}),n,i);let p;const f=()=>{var e,t;if(!l)return;s=!1,a.forEach((e=>{var t;return e(null!=(t=n())?t:d)}));const i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=n())?e:d))||void 0;return Jt(l.getItem.bind(l))(o.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return p=o.merge(e,null!=(t=n())?t:d),r(p,!0),u()})).then((()=>{null==i||i(p,void 0),p=n(),s=!0,c.forEach((e=>e(p)))})).catch((e=>{null==i||i(void 0,e)}))};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},o.skipHydration||f(),p||d})(e,t))((()=>({connectors:c,publicClient:this.getPublicClient({chainId:s}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:s})})),{name:$n,storage:n,partialize:t=>({...e&&{data:{account:t?.data?.account,chain:t?.data?.chain}},chains:t?.chains}),version:2}),(h=(e,t,r)=>{const n=r.subscribe;return r.subscribe=(e,t,i)=>{let o=e;if(t){const n=(null==i?void 0:i.equalityFn)||Object.is;let s=e(r.getState());o=r=>{const i=e(r);if(!n(s,i)){const e=s;t(s=i,e)}},(null==i?void 0:i.fireImmediately)&&t(s,s)}return n(o)},d(e,t,r)})?Xt(h):Xt),this.storage=n,Pe(this,jn,n?.getItem("wallet")),(l=Rn,u=Ln,Ee(this,l,"access private method"),u).call(this),e&&"undefined"!=typeof window&&setTimeout((async()=>await this.autoConnect()),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){return this.data?.chain?.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(e){const t="function"==typeof e?e(this.store.getState()):e;this.store.setState(t,!0)}clearState(){this.setState((e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"})))}async destroy(){this.connector&&await(this.connector.disconnect?.()),Pe(this,Nn,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(Ie(this,Nn))return;Pe(this,Nn,!0),this.setState((e=>({...e,status:e.data?.account?"reconnecting":"connecting"})));const e=Ie(this,jn)?[...this.connectors].sort((e=>e.id===Ie(this,jn)?-1:1)):this.connectors;let t=!1;for(const r of e){if(!r.ready||!r.isAuthorized)continue;if(!await r.isAuthorized())continue;const e=await r.connect();this.setState((t=>({...t,connector:r,chains:r?.chains,data:e,status:"connected"}))),t=!0;break}return t||this.setState((e=>({...e,data:void 0,status:"disconnected"}))),Pe(this,Nn,!1),this.data}setConnectors(e){this.args={...this.args,connectors:e};const t="function"==typeof e?e():e;t.forEach((e=>e.setStorage(this.args.storage))),this.setState((e=>({...e,connectors:t})))}getPublicClient({chainId:e}={}){let t=this.publicClients.get(-1);if(t&&t?.chain.id===e)return t;if(t=this.publicClients.get(e??-1),t)return t;const{publicClient:r}=this.args;return t="function"==typeof r?r({chainId:e}):r,this.publicClients.set(e??-1,t),t}setPublicClient(e){const t=this.data?.chain?.id;this.args={...this.args,publicClient:e},this.publicClients.clear(),this.setState((e=>({...e,publicClient:this.getPublicClient({chainId:t})})))}getWebSocketPublicClient({chainId:e}={}){let t=this.webSocketPublicClients.get(-1);if(t&&t?.chain.id===e)return t;if(t=this.webSocketPublicClients.get(e??-1),t)return t;const{webSocketPublicClient:r}=this.args;return t="function"==typeof r?r({chainId:e}):r,t&&this.webSocketPublicClients.set(e??-1,t),t}setWebSocketPublicClient(e){const t=this.data?.chain?.id;this.args={...this.args,webSocketPublicClient:e},this.webSocketPublicClients.clear(),this.setState((e=>({...e,webSocketPublicClient:this.getWebSocketPublicClient({chainId:t})})))}setLastUsedConnector(e=null){this.storage?.setItem("wallet",e)}}(e);return Bn=t,t}({autoConnect:!0,connectors:[...ki({projectId:t,version:2,chains:[r[0].chain]})],publicClient:n}),o=new Oi(i,r);let s;ji.web3Modal=new Ti({projectId:t},o),ji.safeNetworkIdentifier=r[0].safeNetworkIdentifier,Xn((async e=>{if("connecting"===s&&"connected"===e.status)try{await zi()}catch(e){$i(e)}s=e.status})),ei((()=>{Ui("prepare")})),ji.elements.divPrepare.style.display="block",document.getElementById("spinner").style.display="none",ji.elements.buttonConnect.addEventListener("click",(async()=>{try{await async function(){try{if((await Zn()).isConnected)return!0;await ji.web3Modal.openModal()}catch(e){throw console.error(e,"Sign in failed"),e}return!1}()&&await zi()}catch(e){$i(error)}}))}()})()})(); \ No newline at end of file diff --git a/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js.LICENSE.txt b/pretix_eth/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js.LICENSE.txt similarity index 100% rename from pretix_eth/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js.LICENSE.txt rename to pretix_eth/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js.LICENSE.txt diff --git a/pretix_eth/static/pretix_eth/web3modal/src/chains.js b/pretix_eth/static/pretix_eth/web3modal/src/chains.js index 05d9da62..4ac18273 100644 --- a/pretix_eth/static/pretix_eth/web3modal/src/chains.js +++ b/pretix_eth/static/pretix_eth/web3modal/src/chains.js @@ -1,4 +1,4 @@ -import { arbitrum, arbitrumGoerli, mainnet, goerli, optimism, optimismGoerli, sepolia, zkSync } from "@wagmi/core/chains"; +import { arbitrum, arbitrumGoerli, mainnet, goerli, optimism, optimismGoerli, sepolia, zkSync, polygonZkEvm } from "@wagmi/core/chains"; // Safe is only supported on certain networks there doesn't seem to be any smart way to detect if a network is supported (it doesn't follow https://github.com/ethereum-lists/chains ?), so this has to be manually configured // Safe documentation: https://github.com/safe-global/safe-docs/blob/main/learn/safe-core/safe-core-api/available-services.md @@ -31,4 +31,7 @@ export default [ { chain: sepolia }, + { + chain: polygonZkEvm + } ]; \ No newline at end of file