diff --git a/assets/index-DAHiIkie.js b/assets/index-CeuvvY4b.js similarity index 99% rename from assets/index-DAHiIkie.js rename to assets/index-CeuvvY4b.js index ebe2a85..c0e3a51 100644 --- a/assets/index-DAHiIkie.js +++ b/assets/index-CeuvvY4b.js @@ -1,4 +1,4 @@ -import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-B1sGzfvq.js";import"./index-DZan3ykS.js";/** +import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-DktADLpu.js";import"./index-Cfjx0TSH.js";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/assets/index-DZan3ykS.js b/assets/index-Cfjx0TSH.js similarity index 99% rename from assets/index-DZan3ykS.js rename to assets/index-Cfjx0TSH.js index 134d82a..a7d6be5 100644 --- a/assets/index-DZan3ykS.js +++ b/assets/index-Cfjx0TSH.js @@ -879,6 +879,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 0; border: 0; right: 0; + z-index: 100; } .github-corner:hover .octo-arm { @@ -925,7 +926,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 - L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z`,fill:"currentColor",className:"octo-body"})]})})]})},C_e="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Contracts'%3e%3cg%20id='Subtract'%3e%3cpath%20d='M7%2017.5L7%209.89599C6.55852%209.7031%206.25%209.26258%206.25%208.75C6.25%208.05964%206.80964%207.5%207.5%207.5C8.19036%207.5%208.75%208.05964%208.75%208.75C8.75%209.26258%208.44148%209.7031%208%209.89599L8%2014.9244L10.7331%2013.8995V12.8884C10.3007%2012.6918%2010%2012.256%2010%2011.75C10%2011.0596%2010.5596%2010.5%2011.25%2010.5C11.9404%2010.5%2012.5%2011.0596%2012.5%2011.75C12.5%2012.2691%2012.1836%2012.7143%2011.7331%2012.9032V14.5925L8%2015.9924L8%2017.5L16%2017.5V8.64587L10.4552%208.64587V3.5H4V17.5L7%2017.5Z'%20fill='white'/%3e%3cpath%20d='M15.931%207.65688L11.5103%203.56422L11.5661%207.65688L15.931%207.65688Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",A_e="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Wallet'%3e%3cpath%20id='Exclude'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%206.54947C5%206.99261%205.38931%207.35185%205.86954%207.35185H16C16.5523%207.35185%2017%207.79957%2017%208.35185V15.5C17%2016.0523%2016.5523%2016.5%2016%2016.5H5.49505C4.11707%2016.5%203%2015.4692%203%2014.1977V6.80233C3%205.53079%204.11707%204.5%205.49505%204.5H13.8765C14.2208%204.5%2014.5%204.77917%2014.5%205.12355C14.5%205.46792%2014.2208%205.74709%2013.8765%205.74709H5.86955C5.38931%205.74709%205%206.10633%205%206.54947ZM12%2012C12%2011.1716%2012.6716%2010.5%2013.5%2010.5C14.3284%2010.5%2015%2011.1716%2015%2012C15%2012.8284%2014.3284%2013.5%2013.5%2013.5C12.6716%2013.5%2012%2012.8284%2012%2012Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",S_e="/assets/recovery-wallet-bg-D55NVi6t.jpg",__e="/assets/recovery-wallet-bg-mobile-CcgD3StS.jpg",vte="/assets/sequence-wallet-recovery-CmKFPNqR.svg",I_e={backgroundImage:`url(${S_e})`,backgroundSize:"cover",backgroundPosition:"center"};function T_e(){const t=Hu("isMobile"),e=ir(ai),r=Fr(e.isLoadingAccount),[n,i]=T.useState(""),[s,o]=T.useState(!1),[a,c]=T.useState(!1),[l,f]=T.useState(!1);T.useEffect(()=>{f(r)},[r]);const u=async()=>{try{await e.loadAccount(n)}catch(y){console.warn(y),c(!0)}},h=()=>{o(!0)},v=()=>{e.logout(),o(!1),e.isLoadingAccount.set(!1)};return j.jsxs(ve,{justifyContent:t?"center":"flex-start",style:t?{paddingTop:"40px"}:I_e,padding:t?"4":"20",paddingBottom:t?"14":"0",children:[j.jsxs(ve,{flexDirection:"column",justifyContent:t?"flex-start":"center",alignItems:t?"center":"flex-start",style:{maxWidth:"800px"},gap:"10",zIndex:"20",children:[j.jsxs(ve,{flexDirection:"column",justifyContent:"center",alignItems:t?"center":"flex-start",children:[j.jsx(Ln,{src:vte,height:"8",paddingX:"4"}),t&&j.jsx(Ln,{src:__e,style:{maxWidth:"calc(100% + 32px)"}}),j.jsx(Te,{textAlign:t?"center":"left",variant:"xlarge",color:"text100",paddingX:"4",style:t?{fontSize:"28px",lineHeight:"32px"}:{fontSize:"40px",lineHeight:"44px"},children:"A fully open source and forever accessible way to recover your Sequence Wallet"})]}),l?j.jsxs(j.Fragment,{children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",textAlign:"center",color:"text80",paddingX:"8",style:{marginBottom:"-16px"},children:"Enter your password to continue and unlock your wallet"}),j.jsxs(ve,{flexDirection:"column",gap:"4",width:"full",children:[j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Password"}),j.jsx(Sn,{type:"password",value:n,autoFocus:!0,onKeyPress:y=>{y.key==="Enter"&&u()},onChange:y=>{i(y.target.value),c(!1)}}),a&&j.jsx(Te,{variant:"small",color:"negative",marginLeft:"2",marginTop:"1",children:"Incorrect password"})]}),j.jsxs(ve,{flexDirection:"row",justifyContent:"flex-end",gap:"4",children:[j.jsx(Kt,{label:"Forgot password?",variant:"text",shape:"square",onClick:()=>h()}),j.jsx(Kt,{label:"Continue",variant:"primary",shape:"square",onClick:()=>u()})]})]})]}):j.jsxs(j.Fragment,{children:[j.jsxs(ve,{gap:"2",children:[j.jsx(Kt,{label:"Learn more",size:"md",onClick:()=>window.open("https://github.com/0xsequence/wallet-recovery-app")}),j.jsx(Kt,{as:eJ,to:"/recovery",label:"Start Recovery",variant:"primary",size:"md"})]}),j.jsxs(ve,{flexDirection:t?"column":"row",gap:"2",width:t?"full":"2/3",children:[j.jsxs(vn,{flexDirection:"column",gap:"2",children:[j.jsxs(ve,{flexDirection:"row",gap:"2",children:[j.jsx(Ln,{src:C_e}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Connect to apps"})]}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"Connect your wallet to any web3 application via WalletConnect"})]}),j.jsxs(vn,{flexDirection:"column",gap:"2",children:[j.jsxs(ve,{flexDirection:"row",gap:"2",children:[j.jsx(Ln,{src:A_e}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Move assets anywhere"})]}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"Transfer your assets securely to any wallet, fully decentralized"})]})]})]})]}),s&&j.jsx(oa,{size:"md",onClose:()=>o(!1),children:j.jsxs(ve,{flexDirection:"column",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",color:"text100",marginRight:"8",children:"Are you sure you want to sign out?"}),j.jsxs(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:["If you do not remember your password, you can reset and start over.",j.jsx("br",{})," This will require you to re-enter your mnemonic."]}),j.jsxs(ve,{flexDirection:"row",justifyContent:"flex-end",gap:"2",children:[j.jsx(Kt,{label:"Yes, reset",shape:"square",variant:"primary",onClick:()=>v()}),j.jsx(Kt,{label:"Cancel",shape:"square",onClick:()=>o(!1)})]})]})})]})}const P_e={"0x087Aa00C1f09464D1D6a9Ff0eE2377dBB7c7B324":[{wallet:"0xaf39AE56e001250FaCBd122b11A90d32A0aD6686",subdigest:"0x0f4490a7aa40f15929635252953ce594ba3342401c2c53eff56451dc147475da"}],"0x09A820a9109E5EC82DCfF24484b2047739a92Abc":[{wallet:"0xcF47342c7064AAA5BA0F4163bEA0c7545756b8BF",subdigest:"0xa598ddbe6372b985f60367a1a9c12cb99e20e38c782d9bc941ddaa9f4c9296e5"}],"0x0aBb5b9d20f06DAdF752CEeBe4df26E585A1d897":[{wallet:"0x3F00C5A7fEadD358429645b29b3d776C5f61892d",subdigest:"0x7c33d7864e6e6f92e39328b407fc8fa0206c6ebdb5a31d9056dcc96bba5eb108"}],"0x0f286489b5b85EAcC4E00e1902e138b5Aa662F1c":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x76009a037ebbb28a9f71f1e68c38291e3b2b1a4bf772a56a79e1a6336cbbc7ab"}],"0x1A535D13c62F240cC7985B05a0229182D546550e":[{wallet:"0x46Ba18e7eCB93362A1804cC47EaD90244945016D",subdigest:"0x0acff6ca38c72b9287ba8163569a452ce12c9ffd64c082feba8a5f7300546579"}],"0x1B9498d7177a09d98ABE532e472e1b9f32dAc9B8":[{wallet:"0x848045071DbdBa2F352dF2f0335e02ba61f205aC"}],"0x253ff3Dd87c440A9565814756f85219F487e2FFe":[{wallet:"0xd18a46E40b29FA6CFC0D9f5A930E72cD0EC1e4D2",subdigest:"0x12822b7fde91535103ee7757fe362bfdca0dc2e25211c6ca7c133c20a66d604f"}],"0x27D263a5707510378823fa496674EeC7656780B6":[{wallet:"0xBc4f7bB193ac09D7eC53eF0a499B073A296A94f0",subdigest:"0xbf3913760753e93aba2f40235dd03e693f85853d7c9f9c5f1f62ce7ee91c6313"}],"0x36fA6B68007575C100c1C2916942ee857dE0778E":[{wallet:"0x52CE3cab58639223cf870A73942175e6C7BA9A0C",subdigest:"0x455b01f5c47ece34a3f4dee5d9b3d3b590d524029f4e845b2d4eccb7e8d9472b"}],"0x3Ed9724712417687eb0eaBc2cA2e452E3d2DCdEc":[{wallet:"0x4955338954fFF19396Fe4bA17D93370cA8b77d2B",subdigest:"0x96c4ddf36a03af12b56cf6dc618ab83d814b86a01c69464f1b94bfca826e47fa"}],"0x3F0c7e32678Bc6dCf9dEfB6368EcaE7B88C69036":[{wallet:"0x592625C316A2F184F0C6a4b2952e9b40Ef111a26",subdigest:"0x5e9cf684e8dcf38d5b079a89ff4644de144c85ca16e3b618ab4ae490becff25f"},{wallet:"0xEBB418588FFc0785B6a2559a281A37c117679D6F",subdigest:"0x98be9228917ad8193e14102ed0a989689ec6af1f04bd731f3cca43c02c1abc07"}],"0x4577CAF3A5caBcaF2038863d361cb32f423d5d53":[{wallet:"0xF68f5A97abAAa940A9Ad3AeD723C2179F8551502",subdigest:"0x336448a71e4188cd95c39b278d6d26144d51dc5b3edfdd2af67c3b0425a2e2d3"}],"0x50d27302c45FE4FC8d7cc435920a22D477d3DEB2":[{wallet:"0x97692217ca8e06D7156ef7f4606faB4624bd10C0",subdigest:"0x898993e7c2394c1c9b63b2cfa637a8a2c7b04ce9387c9ecc9c56ef1f56ae58be"}],"0x57160B380fF4Edf3DA3b1c27e723dc2AB3f057Be":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x89f982d77ae08a8ea17d6755d297615f5756e5363db8a9b95758d5a981f8e4ae"}],"0x6647b94603e0D90265d8869a3656C1b0F9B6caC5":[{wallet:"0x6cDe6f20610FF172Cd838CDF69Aae3c27521CBa4",subdigest:"0xab2d0dbda84cffb9a3934412172236a9d98fd3d6b80d47b35956cc5f935c69de"}],"0x69DD1F76595E8a49252F16DDa69474c3a818E3c0":[{wallet:"0x756F9E22591e0aC2Aa0C365708aF0a516F269979",subdigest:"0x261126c464ac19bb769c407ec28fe026f297357938ba9024bd66bb5a48ca9349"}],"0x6Ae23160FBB280Ae4eE78C476ca9FDb51bBcC444":[{wallet:"0xDfA3338DD0147b5e7793cE040F92462177e00024",subdigest:"0xae67c59800e8dd98b955a5fb857c39971fe5fb29e3e5083246fd122b37c4ee88"}],"0x6B917b4459Db2C9cb774e0a9B0eee668273e191a":[{wallet:"0x676b5FaCD2380F51d4EB1A2492057A31FfB100c5",subdigest:"0x60a62db58b5be8277ff22e8104ead5c4d87d6d1173fd7b2b0174978e663974c7"}],"0x6b593de1F2c6cEf51693323edc4467c2A4D5B78B":[{wallet:"0xD9DF096A66A89e63eE977C5Fda59a65f872a6901",subdigest:"0x8ef909db0fd633cac1445a89dace09c5b2fa1bda2d85e5915f6afc2d547f6a87"}],"0x6c77214450C1060f2f6a093c8054278b77E8769b":[{wallet:"0x16b47E837ff421382D516cA5A79b76aFd8473675",subdigest:"0x67521db115964b2559b99d5854ab07bae09e6e6cb0c1cd3de3d1f553c31c515f"}],"0x70F2E179c95a6e3b9a2Fe742B88568a12FFF7f8B":[{wallet:"0x649ba7F76D856aB021C9EEB8bac3B46f3e72EfD0",subdigest:"0x178be5e2d834d0224794dfbe49cf9621127d3396b75246a32093a21e6db320eb"}],"0x77fCC4D33ae477f217a09Ec8dBEBC22E7e8F5e33":[{wallet:"0xD09C7A6Af7046F45343978A1620391D6237c3762",subdigest:"0xca780c4505a811222e215eceeb2b28f222c1a6b126e9ccc86560f5199c34d5da"}],"0x78C22edc81d7a7A1D690e6C91824Cf9Eff2760c8":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xd84553d4372b26e3eb96fa77bd157e4e1b593bff1c54c7e69ad8857673d2266e"}],"0x79621cB0c2c8FbB8Ca20E4177b7DF0Aa7a931e73":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0xbd64f6f75e64b49c6a4f46b2715ca3bf11e21a7e07702b89ea1607e3884e9d40"}],"0x79A7DF6E89da1AEa293bFa11987d7CE828223a7A":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x858235d87309c9e2d72dca9bfa41b61fbb635ac6d9e099b868ff8a8c99bf8c37"}],"0x7b1A301155c0Fad8e5b95055e2A100333D464eA3":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x31001033b765a3cc9407304daeafeeda015d318e73be3de8832a9dc1377f9340"}],"0x85c5B1f9464723A2cC81F69A71a11dA528E0CBCe":[{wallet:"0xF178cE73DB2bA1C575D5c63ecA490b09ec31949b",subdigest:"0x65e9c76ef7e14697c6fd1822fbd39719b43091f13d2d051c911d1373175c2c42"}],"0x943237FFB0024Bf758A79db00e043789FD8299f0":[{wallet:"0x639b6017C4b8F8a5322205A68a1331A817Dd46e2",subdigest:"0xa3bc90cafcccb0fe0b8c0939fa908216ddc667d6b022fe54efca05ec815c163c"}],"0x9EeA332285d7B3755CB46f7D0D49CF0edcC112Ef":[{wallet:"0x04EfBe99e49001b78bB68c35B0354CD4a2Ac4Fd8",subdigest:"0xd3c43ef36d4347d1b5323fa188cf8482de05631a86bc05b12b8ce3b661f4d2f9"}],"0x9b704574e65F8b785FD125F5f3C4F7E34690Bd02":[{wallet:"0xBA9498300dFE650a2b59A42271ec771B6Ed6a091",subdigest:"0x9894f57b20f78245e02d424a21f0d361038905285f53c51c1949e27f39a9fbb8"}],"0xA923984d96b7327c60f246da366b2525B34C6984":[{wallet:"0x7ae10aA190513577D9Ac9ae146128d97df4F4fF0",subdigest:"0x3b849360d50831070d92bec368b63cf0725525cd7b60f406cee5357731b75457"}],"0xACFC6D1DB5875Cb72E1b6BaddaCe28F45044ee6a":[{wallet:"0xAdAf943368aB95208763ccAcCD5ecB9a7772de40",subdigest:"0xb0d0da150a42bca8103e1c40e5e99c7a190043b3121f52c6d41ae473597d0ebe"}],"0xB278dd7c9FC754dBc82Ac29C6f78B6301BE8E8C6":[{wallet:"0xeCc653CB03a9B6587Bcb58A8372535b6Ea5a17d6",subdigest:"0x6fd9bb4768107b4bd0f3c8e11b00027ee5e6417b1d4ab3d5e56c1724eeb2e3b2"}],"0xBaA9D704C8244071e6B9bF6BcbC2c2281dB75096":[{wallet:"0xb547CcA265A91f7a92d9a97804807962B2A4D7d8",subdigest:"0xfca7ea635bf9e89d7034ce6d9378ff6948eaa340ab2d428e5b157efc82b9f8d5"}],"0xC29fD04F9079c36dC15549e8AAF8F058214F0Dae":[{wallet:"0xB7005885711d54BD3594Be1955266d37470BD053",subdigest:"0xb0bc66ea204ea2cb93ca190189471392b59fb8608cb75a69a7b01b7096338428"}],"0xD2751030a5007895968414443efae561BdCB1Af2":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0x2872f961dd02e7b3fabd4a7bed036259085de28fe2f1c0f49a5d1be6ae4c7b07"}],"0xD721d5849fDE7862E77D251B6fA711114f4579Ab":[{wallet:"0x77415fb6aFe8A13275b088f1e197Bd9EDa1AA95C",subdigest:"0xc775316600b59750707446a7915cf88cc6f1827ce931dd688bf5990a7b95ec29"}],"0xE1B6c2c194dF83A8E01F8C582ddA58840fE46318":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xde7ebed8b2c62552e8ff5a08d2e5b33d336d709e6cf2812b9874cd7b5fd5189e"}],"0xE5Ed2A916971Fa6fe07EbD4564DeAaF2c20A7684":[{wallet:"0xFDB7922bA08BAbad2e3e36b66e0521c7EEA0faEF"}],"0xF9ED1e54dc86Bf248FBe059D4aEfD8183F0A816F":[{wallet:"0xCdFdaDB6F2b2f3c7db93521AbD05a3C32aF6b226",subdigest:"0x0433c483ced183cee562b8061788fc93d0c9f666af896096a5e184076f787eac"}],"0xa3CF0b935AccFd8bbE569B984D9Bc7Ec775ce22d":[{wallet:"0x23C6B8E47fa9f40e73E6627598d13085130f3ed6",subdigest:"0x13e9cd21769bc2a4f779b0f73c1cc7ca6c96c6af3262721eec17ac72104fef32"}],"0xbe9f4fB13fbC98042a32dC8354A339258abf1456":[{wallet:"0x81fF1aD4232671403e0f3CC85D021144511E3B6e",subdigest:"0x130c5b993a04ab84b0b074ea69241d6f3c040eced24dbe7c2015263718526670"}],"0xd4b26195aD1487DE6a42Fd69bC81CEbc8b86f0b5":[{wallet:"0xF36A0bd53d85307b35f90756263984329FBfA176",subdigest:"0x13d918ac4e97df0477fcab1c210ef1f96a999abe64dd07e48017b96c4902f50b"}],"0xdaD0038b8BBf78Ac84a4566E75269339Daa0dEdC":[{wallet:"0x8Fd48EB1ecDc0652306de1A0A8BA5561Ba733351",subdigest:"0x3541d7b2f07d87fa8b30c9ef1594da2353d45c40830f0c8e01126e3c89b9b508"}],"0xe7d51Cd5097A287a3B63014dc453Cfb8D9A03152":[{wallet:"0x4E5B1F98F81372BD4B763Be9bF50Aa6C5B7b9913",subdigest:"0x818fbd74398f446b4d7fcb207bf6377393fa923732243995d8464844ec8d42ce"}],"0xed7F28464630398E06e0Fa0Fc04FEa2fe40427aB":[{wallet:"0x6D0f613C239ed1d409C4e41758ACd55E0b1Cb410",subdigest:"0xe6baef08a191785d5d3897cb3e96f3473585d2f034657a4134754c5206b87268"}],"0xf24d3aFE0768827EAe9f671F3C1c283BfFAF0C19":[{wallet:"0xf03Bf61943e00fa3557E496409e1E9c95a1c24E4",subdigest:"0x3d1192dcd531e9ec60795b4129b03eb54b9226bc2d08be3f2b2524ae80244afb"}],"0xf3bf75114bEf71abE4E87f8CA4dD82E372b948A9":[{wallet:"0x3e270820e36EC3C29903C2635B0f53f192Dc29ab",subdigest:"0x70f563cb3ba62214e88d61e55450a8f4245bc5666aa006c93802ad2e96d3ac05"}],"0xf95C86e3a52dEbf8b984983852CAc5d8652C8A9A":[{wallet:"0xb07d236F2B5d1f4AB12236e94ac8049dE40321F4",subdigest:"0x877c04b91ea48703e9cc936f4506d89943ed8b9ec32b15990eea41ce0c59dde7"}],"0xfed1D937a8708001A23AFD8AEd02f9E05de9f251":[{wallet:"0x6743b60A94898E228c5aa642A2e11cb595dCB1fB"}]};var gte={exports:{}};/*! + L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z`,fill:"currentColor",className:"octo-body"})]})})]})},C_e="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Contracts'%3e%3cg%20id='Subtract'%3e%3cpath%20d='M7%2017.5L7%209.89599C6.55852%209.7031%206.25%209.26258%206.25%208.75C6.25%208.05964%206.80964%207.5%207.5%207.5C8.19036%207.5%208.75%208.05964%208.75%208.75C8.75%209.26258%208.44148%209.7031%208%209.89599L8%2014.9244L10.7331%2013.8995V12.8884C10.3007%2012.6918%2010%2012.256%2010%2011.75C10%2011.0596%2010.5596%2010.5%2011.25%2010.5C11.9404%2010.5%2012.5%2011.0596%2012.5%2011.75C12.5%2012.2691%2012.1836%2012.7143%2011.7331%2012.9032V14.5925L8%2015.9924L8%2017.5L16%2017.5V8.64587L10.4552%208.64587V3.5H4V17.5L7%2017.5Z'%20fill='white'/%3e%3cpath%20d='M15.931%207.65688L11.5103%203.56422L11.5661%207.65688L15.931%207.65688Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",A_e="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Wallet'%3e%3cpath%20id='Exclude'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%206.54947C5%206.99261%205.38931%207.35185%205.86954%207.35185H16C16.5523%207.35185%2017%207.79957%2017%208.35185V15.5C17%2016.0523%2016.5523%2016.5%2016%2016.5H5.49505C4.11707%2016.5%203%2015.4692%203%2014.1977V6.80233C3%205.53079%204.11707%204.5%205.49505%204.5H13.8765C14.2208%204.5%2014.5%204.77917%2014.5%205.12355C14.5%205.46792%2014.2208%205.74709%2013.8765%205.74709H5.86955C5.38931%205.74709%205%206.10633%205%206.54947ZM12%2012C12%2011.1716%2012.6716%2010.5%2013.5%2010.5C14.3284%2010.5%2015%2011.1716%2015%2012C15%2012.8284%2014.3284%2013.5%2013.5%2013.5C12.6716%2013.5%2012%2012.8284%2012%2012Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",S_e="/assets/recovery-wallet-bg-D55NVi6t.jpg",__e="/assets/recovery-wallet-bg-mobile-CcgD3StS.jpg",vte="/assets/sequence-wallet-recovery-CmKFPNqR.svg",I_e={backgroundImage:`url(${S_e})`,backgroundSize:"cover",backgroundPosition:"center"};function T_e(){const t=Hu("isMobile"),e=ir(ai),r=Fr(e.isLoadingAccount),[n,i]=T.useState(""),[s,o]=T.useState(!1),[a,c]=T.useState(!1),[l,f]=T.useState(!1);T.useEffect(()=>{f(r)},[r]);const u=async()=>{try{await e.loadAccount(n)}catch(y){console.warn(y),c(!0)}},h=()=>{o(!0)},v=()=>{e.logout(),o(!1),e.isLoadingAccount.set(!1)};return j.jsxs(ve,{height:t?void 0:"vh",justifyContent:t?"center":"flex-start",style:t?{paddingTop:"40px"}:I_e,padding:t?"4":"20",paddingBottom:t?"14":"0",children:[j.jsxs(ve,{flexDirection:"column",justifyContent:t?"flex-start":"center",alignItems:t?"center":"flex-start",style:{maxWidth:"800px"},gap:"10",zIndex:"20",children:[j.jsxs(ve,{flexDirection:"column",justifyContent:"center",alignItems:t?"center":"flex-start",children:[j.jsx(Ln,{src:vte,height:"8",paddingX:"4"}),t&&j.jsx(Ln,{src:__e,style:{maxWidth:"calc(100% + 32px)"}}),j.jsx(Te,{textAlign:t?"center":"left",variant:"xlarge",color:"text100",paddingX:"4",style:t?{fontSize:"28px",lineHeight:"32px"}:{fontSize:"40px",lineHeight:"44px"},children:"A fully open source and forever accessible way to recover your Sequence Wallet"})]}),l?j.jsxs(j.Fragment,{children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",textAlign:"center",color:"text80",paddingX:"8",style:{marginBottom:"-16px"},children:"Enter your password to continue and unlock your wallet"}),j.jsxs(ve,{flexDirection:"column",gap:"4",width:"full",children:[j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Password"}),j.jsx(Sn,{type:"password",value:n,autoFocus:!0,onKeyPress:y=>{y.key==="Enter"&&u()},onChange:y=>{i(y.target.value),c(!1)}}),a&&j.jsx(Te,{variant:"small",color:"negative",marginLeft:"2",marginTop:"1",children:"Incorrect password"})]}),j.jsxs(ve,{flexDirection:"row",justifyContent:"flex-end",gap:"4",children:[j.jsx(Kt,{label:"Forgot password?",variant:"text",shape:"square",onClick:()=>h()}),j.jsx(Kt,{label:"Continue",variant:"primary",shape:"square",onClick:()=>u()})]})]})]}):j.jsxs(j.Fragment,{children:[j.jsxs(ve,{gap:"2",children:[j.jsx(Kt,{label:"Learn more",size:"md",onClick:()=>window.open("https://github.com/0xsequence/wallet-recovery-app")}),j.jsx(Kt,{as:eJ,to:"/recovery",label:"Start Recovery",variant:"primary",size:"md"})]}),j.jsxs(ve,{flexDirection:t?"column":"row",gap:"2",width:t?"full":"2/3",children:[j.jsxs(vn,{flexDirection:"column",gap:"2",children:[j.jsxs(ve,{flexDirection:"row",gap:"2",children:[j.jsx(Ln,{src:C_e}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Connect to apps"})]}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"Connect your wallet to any web3 application via WalletConnect"})]}),j.jsxs(vn,{flexDirection:"column",gap:"2",children:[j.jsxs(ve,{flexDirection:"row",gap:"2",children:[j.jsx(Ln,{src:A_e}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Move assets anywhere"})]}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"Transfer your assets securely to any wallet, fully decentralized"})]})]})]})]}),s&&j.jsx(oa,{size:"md",onClose:()=>o(!1),children:j.jsxs(ve,{flexDirection:"column",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",color:"text100",marginRight:"8",children:"Are you sure you want to sign out?"}),j.jsxs(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:["If you do not remember your password, you can reset and start over.",j.jsx("br",{})," This will require you to re-enter your mnemonic."]}),j.jsxs(ve,{flexDirection:"row",justifyContent:"flex-end",gap:"2",children:[j.jsx(Kt,{label:"Yes, reset",shape:"square",variant:"primary",onClick:()=>v()}),j.jsx(Kt,{label:"Cancel",shape:"square",onClick:()=>o(!1)})]})]})})]})}const P_e={"0x087Aa00C1f09464D1D6a9Ff0eE2377dBB7c7B324":[{wallet:"0xaf39AE56e001250FaCBd122b11A90d32A0aD6686",subdigest:"0x0f4490a7aa40f15929635252953ce594ba3342401c2c53eff56451dc147475da"}],"0x09A820a9109E5EC82DCfF24484b2047739a92Abc":[{wallet:"0xcF47342c7064AAA5BA0F4163bEA0c7545756b8BF",subdigest:"0xa598ddbe6372b985f60367a1a9c12cb99e20e38c782d9bc941ddaa9f4c9296e5"}],"0x0aBb5b9d20f06DAdF752CEeBe4df26E585A1d897":[{wallet:"0x3F00C5A7fEadD358429645b29b3d776C5f61892d",subdigest:"0x7c33d7864e6e6f92e39328b407fc8fa0206c6ebdb5a31d9056dcc96bba5eb108"}],"0x0f286489b5b85EAcC4E00e1902e138b5Aa662F1c":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x76009a037ebbb28a9f71f1e68c38291e3b2b1a4bf772a56a79e1a6336cbbc7ab"}],"0x1A535D13c62F240cC7985B05a0229182D546550e":[{wallet:"0x46Ba18e7eCB93362A1804cC47EaD90244945016D",subdigest:"0x0acff6ca38c72b9287ba8163569a452ce12c9ffd64c082feba8a5f7300546579"}],"0x1B9498d7177a09d98ABE532e472e1b9f32dAc9B8":[{wallet:"0x848045071DbdBa2F352dF2f0335e02ba61f205aC"}],"0x253ff3Dd87c440A9565814756f85219F487e2FFe":[{wallet:"0xd18a46E40b29FA6CFC0D9f5A930E72cD0EC1e4D2",subdigest:"0x12822b7fde91535103ee7757fe362bfdca0dc2e25211c6ca7c133c20a66d604f"}],"0x27D263a5707510378823fa496674EeC7656780B6":[{wallet:"0xBc4f7bB193ac09D7eC53eF0a499B073A296A94f0",subdigest:"0xbf3913760753e93aba2f40235dd03e693f85853d7c9f9c5f1f62ce7ee91c6313"}],"0x36fA6B68007575C100c1C2916942ee857dE0778E":[{wallet:"0x52CE3cab58639223cf870A73942175e6C7BA9A0C",subdigest:"0x455b01f5c47ece34a3f4dee5d9b3d3b590d524029f4e845b2d4eccb7e8d9472b"}],"0x3Ed9724712417687eb0eaBc2cA2e452E3d2DCdEc":[{wallet:"0x4955338954fFF19396Fe4bA17D93370cA8b77d2B",subdigest:"0x96c4ddf36a03af12b56cf6dc618ab83d814b86a01c69464f1b94bfca826e47fa"}],"0x3F0c7e32678Bc6dCf9dEfB6368EcaE7B88C69036":[{wallet:"0x592625C316A2F184F0C6a4b2952e9b40Ef111a26",subdigest:"0x5e9cf684e8dcf38d5b079a89ff4644de144c85ca16e3b618ab4ae490becff25f"},{wallet:"0xEBB418588FFc0785B6a2559a281A37c117679D6F",subdigest:"0x98be9228917ad8193e14102ed0a989689ec6af1f04bd731f3cca43c02c1abc07"}],"0x4577CAF3A5caBcaF2038863d361cb32f423d5d53":[{wallet:"0xF68f5A97abAAa940A9Ad3AeD723C2179F8551502",subdigest:"0x336448a71e4188cd95c39b278d6d26144d51dc5b3edfdd2af67c3b0425a2e2d3"}],"0x50d27302c45FE4FC8d7cc435920a22D477d3DEB2":[{wallet:"0x97692217ca8e06D7156ef7f4606faB4624bd10C0",subdigest:"0x898993e7c2394c1c9b63b2cfa637a8a2c7b04ce9387c9ecc9c56ef1f56ae58be"}],"0x57160B380fF4Edf3DA3b1c27e723dc2AB3f057Be":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x89f982d77ae08a8ea17d6755d297615f5756e5363db8a9b95758d5a981f8e4ae"}],"0x6647b94603e0D90265d8869a3656C1b0F9B6caC5":[{wallet:"0x6cDe6f20610FF172Cd838CDF69Aae3c27521CBa4",subdigest:"0xab2d0dbda84cffb9a3934412172236a9d98fd3d6b80d47b35956cc5f935c69de"}],"0x69DD1F76595E8a49252F16DDa69474c3a818E3c0":[{wallet:"0x756F9E22591e0aC2Aa0C365708aF0a516F269979",subdigest:"0x261126c464ac19bb769c407ec28fe026f297357938ba9024bd66bb5a48ca9349"}],"0x6Ae23160FBB280Ae4eE78C476ca9FDb51bBcC444":[{wallet:"0xDfA3338DD0147b5e7793cE040F92462177e00024",subdigest:"0xae67c59800e8dd98b955a5fb857c39971fe5fb29e3e5083246fd122b37c4ee88"}],"0x6B917b4459Db2C9cb774e0a9B0eee668273e191a":[{wallet:"0x676b5FaCD2380F51d4EB1A2492057A31FfB100c5",subdigest:"0x60a62db58b5be8277ff22e8104ead5c4d87d6d1173fd7b2b0174978e663974c7"}],"0x6b593de1F2c6cEf51693323edc4467c2A4D5B78B":[{wallet:"0xD9DF096A66A89e63eE977C5Fda59a65f872a6901",subdigest:"0x8ef909db0fd633cac1445a89dace09c5b2fa1bda2d85e5915f6afc2d547f6a87"}],"0x6c77214450C1060f2f6a093c8054278b77E8769b":[{wallet:"0x16b47E837ff421382D516cA5A79b76aFd8473675",subdigest:"0x67521db115964b2559b99d5854ab07bae09e6e6cb0c1cd3de3d1f553c31c515f"}],"0x70F2E179c95a6e3b9a2Fe742B88568a12FFF7f8B":[{wallet:"0x649ba7F76D856aB021C9EEB8bac3B46f3e72EfD0",subdigest:"0x178be5e2d834d0224794dfbe49cf9621127d3396b75246a32093a21e6db320eb"}],"0x77fCC4D33ae477f217a09Ec8dBEBC22E7e8F5e33":[{wallet:"0xD09C7A6Af7046F45343978A1620391D6237c3762",subdigest:"0xca780c4505a811222e215eceeb2b28f222c1a6b126e9ccc86560f5199c34d5da"}],"0x78C22edc81d7a7A1D690e6C91824Cf9Eff2760c8":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xd84553d4372b26e3eb96fa77bd157e4e1b593bff1c54c7e69ad8857673d2266e"}],"0x79621cB0c2c8FbB8Ca20E4177b7DF0Aa7a931e73":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0xbd64f6f75e64b49c6a4f46b2715ca3bf11e21a7e07702b89ea1607e3884e9d40"}],"0x79A7DF6E89da1AEa293bFa11987d7CE828223a7A":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x858235d87309c9e2d72dca9bfa41b61fbb635ac6d9e099b868ff8a8c99bf8c37"}],"0x7b1A301155c0Fad8e5b95055e2A100333D464eA3":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x31001033b765a3cc9407304daeafeeda015d318e73be3de8832a9dc1377f9340"}],"0x85c5B1f9464723A2cC81F69A71a11dA528E0CBCe":[{wallet:"0xF178cE73DB2bA1C575D5c63ecA490b09ec31949b",subdigest:"0x65e9c76ef7e14697c6fd1822fbd39719b43091f13d2d051c911d1373175c2c42"}],"0x943237FFB0024Bf758A79db00e043789FD8299f0":[{wallet:"0x639b6017C4b8F8a5322205A68a1331A817Dd46e2",subdigest:"0xa3bc90cafcccb0fe0b8c0939fa908216ddc667d6b022fe54efca05ec815c163c"}],"0x9EeA332285d7B3755CB46f7D0D49CF0edcC112Ef":[{wallet:"0x04EfBe99e49001b78bB68c35B0354CD4a2Ac4Fd8",subdigest:"0xd3c43ef36d4347d1b5323fa188cf8482de05631a86bc05b12b8ce3b661f4d2f9"}],"0x9b704574e65F8b785FD125F5f3C4F7E34690Bd02":[{wallet:"0xBA9498300dFE650a2b59A42271ec771B6Ed6a091",subdigest:"0x9894f57b20f78245e02d424a21f0d361038905285f53c51c1949e27f39a9fbb8"}],"0xA923984d96b7327c60f246da366b2525B34C6984":[{wallet:"0x7ae10aA190513577D9Ac9ae146128d97df4F4fF0",subdigest:"0x3b849360d50831070d92bec368b63cf0725525cd7b60f406cee5357731b75457"}],"0xACFC6D1DB5875Cb72E1b6BaddaCe28F45044ee6a":[{wallet:"0xAdAf943368aB95208763ccAcCD5ecB9a7772de40",subdigest:"0xb0d0da150a42bca8103e1c40e5e99c7a190043b3121f52c6d41ae473597d0ebe"}],"0xB278dd7c9FC754dBc82Ac29C6f78B6301BE8E8C6":[{wallet:"0xeCc653CB03a9B6587Bcb58A8372535b6Ea5a17d6",subdigest:"0x6fd9bb4768107b4bd0f3c8e11b00027ee5e6417b1d4ab3d5e56c1724eeb2e3b2"}],"0xBaA9D704C8244071e6B9bF6BcbC2c2281dB75096":[{wallet:"0xb547CcA265A91f7a92d9a97804807962B2A4D7d8",subdigest:"0xfca7ea635bf9e89d7034ce6d9378ff6948eaa340ab2d428e5b157efc82b9f8d5"}],"0xC29fD04F9079c36dC15549e8AAF8F058214F0Dae":[{wallet:"0xB7005885711d54BD3594Be1955266d37470BD053",subdigest:"0xb0bc66ea204ea2cb93ca190189471392b59fb8608cb75a69a7b01b7096338428"}],"0xD2751030a5007895968414443efae561BdCB1Af2":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0x2872f961dd02e7b3fabd4a7bed036259085de28fe2f1c0f49a5d1be6ae4c7b07"}],"0xD721d5849fDE7862E77D251B6fA711114f4579Ab":[{wallet:"0x77415fb6aFe8A13275b088f1e197Bd9EDa1AA95C",subdigest:"0xc775316600b59750707446a7915cf88cc6f1827ce931dd688bf5990a7b95ec29"}],"0xE1B6c2c194dF83A8E01F8C582ddA58840fE46318":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xde7ebed8b2c62552e8ff5a08d2e5b33d336d709e6cf2812b9874cd7b5fd5189e"}],"0xE5Ed2A916971Fa6fe07EbD4564DeAaF2c20A7684":[{wallet:"0xFDB7922bA08BAbad2e3e36b66e0521c7EEA0faEF"}],"0xF9ED1e54dc86Bf248FBe059D4aEfD8183F0A816F":[{wallet:"0xCdFdaDB6F2b2f3c7db93521AbD05a3C32aF6b226",subdigest:"0x0433c483ced183cee562b8061788fc93d0c9f666af896096a5e184076f787eac"}],"0xa3CF0b935AccFd8bbE569B984D9Bc7Ec775ce22d":[{wallet:"0x23C6B8E47fa9f40e73E6627598d13085130f3ed6",subdigest:"0x13e9cd21769bc2a4f779b0f73c1cc7ca6c96c6af3262721eec17ac72104fef32"}],"0xbe9f4fB13fbC98042a32dC8354A339258abf1456":[{wallet:"0x81fF1aD4232671403e0f3CC85D021144511E3B6e",subdigest:"0x130c5b993a04ab84b0b074ea69241d6f3c040eced24dbe7c2015263718526670"}],"0xd4b26195aD1487DE6a42Fd69bC81CEbc8b86f0b5":[{wallet:"0xF36A0bd53d85307b35f90756263984329FBfA176",subdigest:"0x13d918ac4e97df0477fcab1c210ef1f96a999abe64dd07e48017b96c4902f50b"}],"0xdaD0038b8BBf78Ac84a4566E75269339Daa0dEdC":[{wallet:"0x8Fd48EB1ecDc0652306de1A0A8BA5561Ba733351",subdigest:"0x3541d7b2f07d87fa8b30c9ef1594da2353d45c40830f0c8e01126e3c89b9b508"}],"0xe7d51Cd5097A287a3B63014dc453Cfb8D9A03152":[{wallet:"0x4E5B1F98F81372BD4B763Be9bF50Aa6C5B7b9913",subdigest:"0x818fbd74398f446b4d7fcb207bf6377393fa923732243995d8464844ec8d42ce"}],"0xed7F28464630398E06e0Fa0Fc04FEa2fe40427aB":[{wallet:"0x6D0f613C239ed1d409C4e41758ACd55E0b1Cb410",subdigest:"0xe6baef08a191785d5d3897cb3e96f3473585d2f034657a4134754c5206b87268"}],"0xf24d3aFE0768827EAe9f671F3C1c283BfFAF0C19":[{wallet:"0xf03Bf61943e00fa3557E496409e1E9c95a1c24E4",subdigest:"0x3d1192dcd531e9ec60795b4129b03eb54b9226bc2d08be3f2b2524ae80244afb"}],"0xf3bf75114bEf71abE4E87f8CA4dD82E372b948A9":[{wallet:"0x3e270820e36EC3C29903C2635B0f53f192Dc29ab",subdigest:"0x70f563cb3ba62214e88d61e55450a8f4245bc5666aa006c93802ad2e96d3ac05"}],"0xf95C86e3a52dEbf8b984983852CAc5d8652C8A9A":[{wallet:"0xb07d236F2B5d1f4AB12236e94ac8049dE40321F4",subdigest:"0x877c04b91ea48703e9cc936f4506d89943ed8b9ec32b15990eea41ce0c59dde7"}],"0xfed1D937a8708001A23AFD8AEd02f9E05de9f251":[{wallet:"0x6743b60A94898E228c5aa642A2e11cb595dCB1fB"}]};var gte={exports:{}};/*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 * @@ -1027,5 +1028,5 @@ __p += '`),Nr&&(qe+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+qe+`return __p -}`;var gr=SN(function(){return jr(se,Rt+"return "+qe).apply(r,he)});if(gr.source=qe,FA(gr))throw gr;return gr}function dfe(d){return Jr(d).toLowerCase()}function hfe(d){return Jr(d).toUpperCase()}function pfe(d,p,_){if(d=Jr(d),d&&(_||p===r))return nd(d);if(!d||!(p=Ho(p)))return d;var q=yo(d),J=yo(p),se=Bx(q,J),he=Lx(q,J)+1;return hd(q,se,he).join("")}function vfe(d,p,_){if(d=Jr(d),d&&(_||p===r))return d.slice(0,Dm(d)+1);if(!d||!(p=Ho(p)))return d;var q=yo(d),J=Lx(q,yo(p))+1;return hd(q,0,J).join("")}function gfe(d,p,_){if(d=Jr(d),d&&(_||p===r))return d.replace(Bt,"");if(!d||!(p=Ho(p)))return d;var q=yo(d),J=Bx(q,yo(p));return hd(q,J).join("")}function yfe(d,p){var _=ae,q=K;if(On(p)){var J="separator"in p?p.separator:J;_="length"in p?pr(p.length):_,q="omission"in p?Ho(p.omission):q}d=Jr(d);var se=d.length;if(Qr(d)){var he=yo(d);se=he.length}if(_>=se)return d;var me=_-Sf(q);if(me<1)return q;var Ce=he?hd(he,0,me).join(""):d.slice(0,me);if(J===r)return Ce+q;if(he&&(me+=Ce.length-me),jA(J)){if(d.slice(me).search(J)){var Be,Le=Ce;for(J.global||(J=Nm(J.source,Jr(tr.exec(J))+"g")),J.lastIndex=0;Be=J.exec(Le);)var qe=Be.index;Ce=Ce.slice(0,qe===r?me:qe)}}else if(d.indexOf(Ho(J),me)!=me){var ft=Ce.lastIndexOf(J);ft>-1&&(Ce=Ce.slice(0,ft))}return Ce+q}function mfe(d){return d=Jr(d),d&&Dt.test(d)?d.replace(sr,qx):d}var bfe=Z1(function(d,p,_){return d+(_?" ":"")+p.toUpperCase()}),qA=_D("toUpperCase");function AN(d,p,_){return d=Jr(d),p=_?r:p,p===r?Fx(d)?JC(d):UC(d):d.match(p)||[]}var SN=br(function(d,p){try{return fi(d,r,p)}catch(_){return FA(_)?_:new Xt(_)}}),wfe=Rf(function(d,p){return go(p,function(_){_=dl(_),Pf(d,_,BA(d[_],d))}),d});function xfe(d){var p=d==null?0:d.length,_=Wt();return d=p?ln(d,function(q){if(typeof q[1]!="function")throw new mo(o);return[_(q[0]),q[1]]}):[],br(function(q){for(var J=-1;++JE)return[];var _=P,q=hr(d,P);p=Wt(p),d-=P;for(var J=u0(q,p);++_0||p<0)?new kr(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),p!==r&&(p=pr(p),_=p<0?_.dropRight(-p):_.take(p-d)),_)},kr.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kr.prototype.toArray=function(){return this.take(P)},fl(kr.prototype,function(d,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),q=/^(?:head|last)$/.test(p),J=ne[q?"take"+(p=="last"?"Right":""):p],se=q||/^find/.test(p);J&&(ne.prototype[p]=function(){var he=this.__wrapped__,me=q?[1]:arguments,Ce=he instanceof kr,Be=me[0],Le=Ce||or(he),qe=function(Sr){var Nr=J.apply(ne,cl([Sr],me));return q&&ft?Nr[0]:Nr};Le&&_&&typeof Be=="function"&&Be.length!=1&&(Ce=Le=!1);var ft=this.__chain__,Rt=!!this.__actions__.length,Yt=se&&!ft,gr=Ce&&!Rt;if(!se&&Le){he=gr?he:new kr(this);var Qt=d.apply(he,me);return Qt.__actions__.push({func:l3,args:[qe],thisArg:r}),new Sa(Qt,ft)}return Yt&&gr?d.apply(this,me):(Qt=this.thru(qe),Yt?q?Qt.value()[0]:Qt.value():Qt)})}),go(["pop","push","shift","sort","splice","unshift"],function(d){var p=q1[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",q=/^(?:pop|shift)$/.test(d);ne.prototype[d]=function(){var J=arguments;if(q&&!this.__chain__){var se=this.value();return p.apply(or(se)?se:[],J)}return this[_](function(he){return p.apply(or(he)?he:[],J)})}}),fl(kr.prototype,function(d,p){var _=ne[p];if(_){var q=_.name+"";Wr.call(mc,q)||(mc[q]=[]),mc[q].push({name:p,func:_})}}),mc[r3(r,x).name]=[{name:"wrapper",func:r}],kr.prototype.clone=mse,kr.prototype.reverse=bse,kr.prototype.value=wse,ne.prototype.at=Yae,ne.prototype.chain=Qae,ne.prototype.commit=Jae,ne.prototype.next=Zae,ne.prototype.plant=ece,ne.prototype.reverse=tce,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=rce,ne.prototype.first=ne.prototype.head,z&&(ne.prototype[z]=Xae),ne},id=ZC();pn?((pn.exports=id)._=id,rn._=id):Ar._=id}).call(Ei)})(f8,f8.exports);var pVe=f8.exports,VT={exports:{}};(function(t,e){var r=typeof self<"u"?self:Ei,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(g){return g&&DataView.prototype.isPrototypeOf(g)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(g){return g&&l.indexOf(Object.prototype.toString.call(g))>-1};function u(g){if(typeof g!="string"&&(g=String(g)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(g))throw new TypeError("Invalid character in header field name");return g.toLowerCase()}function h(g){return typeof g!="string"&&(g=String(g)),g}function v(g){var b={next:function(){var M=g.shift();return{done:M===void 0,value:M}}};return a.iterable&&(b[Symbol.iterator]=function(){return b}),b}function y(g){this.map={},g instanceof y?g.forEach(function(b,M){this.append(M,b)},this):Array.isArray(g)?g.forEach(function(b){this.append(b[0],b[1])},this):g&&Object.getOwnPropertyNames(g).forEach(function(b){this.append(b,g[b])},this)}y.prototype.append=function(g,b){g=u(g),b=h(b);var M=this.map[g];this.map[g]=M?M+", "+b:b},y.prototype.delete=function(g){delete this.map[u(g)]},y.prototype.get=function(g){return g=u(g),this.has(g)?this.map[g]:null},y.prototype.has=function(g){return this.map.hasOwnProperty(u(g))},y.prototype.set=function(g,b){this.map[u(g)]=h(b)},y.prototype.forEach=function(g,b){for(var M in this.map)this.map.hasOwnProperty(M)&&g.call(b,this.map[M],M,this)},y.prototype.keys=function(){var g=[];return this.forEach(function(b,M){g.push(M)}),v(g)},y.prototype.values=function(){var g=[];return this.forEach(function(b){g.push(b)}),v(g)},y.prototype.entries=function(){var g=[];return this.forEach(function(b,M){g.push([M,b])}),v(g)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function m(g){if(g.bodyUsed)return Promise.reject(new TypeError("Already read"));g.bodyUsed=!0}function S(g){return new Promise(function(b,M){g.onload=function(){b(g.result)},g.onerror=function(){M(g.error)}})}function x(g){var b=new FileReader,M=S(b);return b.readAsArrayBuffer(g),M}function A(g){var b=new FileReader,M=S(b);return b.readAsText(g),M}function k(g){for(var b=new Uint8Array(g),M=new Array(b.length),B=0;B-1?b:g}function U(g,b){b=b||{};var M=b.body;if(g instanceof U){if(g.bodyUsed)throw new TypeError("Already read");this.url=g.url,this.credentials=g.credentials,b.headers||(this.headers=new y(g.headers)),this.method=g.method,this.mode=g.mode,this.signal=g.signal,!M&&g._bodyInit!=null&&(M=g._bodyInit,g.bodyUsed=!0)}else this.url=String(g);if(this.credentials=b.credentials||this.credentials||"same-origin",(b.headers||!this.headers)&&(this.headers=new y(b.headers)),this.method=I(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.signal=b.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function ie(g){var b=new FormData;return g.trim().split("&").forEach(function(M){if(M){var B=M.split("="),E=B.shift().replace(/\+/g," "),C=B.join("=").replace(/\+/g," ");b.append(decodeURIComponent(E),decodeURIComponent(C))}}),b}function ae(g){var b=new y,M=g.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(B){var E=B.split(":"),C=E.shift().trim();if(C){var w=E.join(":").trim();b.append(C,w)}}),b}L.call(U.prototype);function K(g,b){b||(b={}),this.type="default",this.status=b.status===void 0?200:b.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new y(b.headers),this.url=b.url||"",this._initBody(g)}L.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var g=new K(null,{status:0,statusText:""});return g.type="error",g};var R=[301,302,303,307,308];K.redirect=function(g,b){if(R.indexOf(b)===-1)throw new RangeError("Invalid status code");return new K(null,{status:b,headers:{location:g}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(b,M){this.message=b,this.name=M;var B=Error(b);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function D(g,b){return new Promise(function(M,B){var E=new U(g,b);if(E.signal&&E.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var C=new XMLHttpRequest;function w(){C.abort()}C.onload=function(){var P={status:C.status,statusText:C.statusText,headers:ae(C.getAllResponseHeaders()||"")};P.url="responseURL"in C?C.responseURL:P.headers.get("X-Request-URL");var O="response"in C?C.response:C.responseText;M(new K(O,P))},C.onerror=function(){B(new TypeError("Network request failed"))},C.ontimeout=function(){B(new TypeError("Network request failed"))},C.onabort=function(){B(new o.DOMException("Aborted","AbortError"))},C.open(E.method,E.url,!0),E.credentials==="include"?C.withCredentials=!0:E.credentials==="omit"&&(C.withCredentials=!1),"responseType"in C&&a.blob&&(C.responseType="blob"),E.headers.forEach(function(P,O){C.setRequestHeader(O,P)}),E.signal&&(E.signal.addEventListener("abort",w),C.onreadystatechange=function(){C.readyState===4&&E.signal.removeEventListener("abort",w)}),C.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return D.polyfill=!0,s.fetch||(s.fetch=D,s.Headers=y,s.Request=U,s.Response=K),o.Headers=y,o.Request=U,o.Response=K,o.fetch=D,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(VT,VT.exports);var vVe=VT.exports;const xV=qu(vVe);var gVe=Object.defineProperty,yVe=Object.defineProperties,mVe=Object.getOwnPropertyDescriptors,EV=Object.getOwnPropertySymbols,bVe=Object.prototype.hasOwnProperty,wVe=Object.prototype.propertyIsEnumerable,CV=(t,e,r)=>e in t?gVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AV=(t,e)=>{for(var r in e||(e={}))bVe.call(e,r)&&CV(t,r,e[r]);if(EV)for(var r of EV(e))wVe.call(e,r)&&CV(t,r,e[r]);return t},SV=(t,e)=>yVe(t,mVe(e));const xVe={Accept:"application/json","Content-Type":"application/json"},EVe="POST",_V={headers:xVe,method:EVe},IV=10;let nl=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new wa.EventEmitter,this.isAvailable=!1,this.registering=!1,!Wq(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}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){this.isAvailable||await this.register();try{const r=$u(e),n=await(await xV(this.url,SV(AV({},_V),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!Wq(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=$u({id:1,jsonrpc:"2.0",method:"test",params:[]});await xV(e,SV(AV({},_V),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}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(typeof e.data>"u")return;const r=typeof e.data=="string"?l1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=PC(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return oie(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>IV&&this.events.setMaxListeners(IV)}};const TV="error",CVe="wss://relay.walletconnect.org",AVe="wc",SVe="universal_provider",PV=`${AVe}@2:${SVe}:`,kie="https://rpc.walletconnect.org/v1/",Sv="generic",_Ve=`${kie}bundler`,pc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var IVe=Object.defineProperty,TVe=Object.defineProperties,PVe=Object.getOwnPropertyDescriptors,kV=Object.getOwnPropertySymbols,kVe=Object.prototype.hasOwnProperty,RVe=Object.prototype.propertyIsEnumerable,RV=(t,e,r)=>e in t?IVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E6=(t,e)=>{for(var r in e||(e={}))kVe.call(e,r)&&RV(t,r,e[r]);if(kV)for(var r of kV(e))RVe.call(e,r)&&RV(t,r,e[r]);return t},MVe=(t,e)=>TVe(t,PVe(e));function ga(t,e,r){var n;const i=Eg(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${kie}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function P1(t){return t.includes(":")?t.split(":")[1]:t}function Rie(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OVe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function p7(t={},e={}){const r=MV(t),n=MV(e);return pVe.merge(r,n)}function MV(t){var e,r,n,i;const s={};if(!pw(t))return s;for(const[o,a]of Object.entries(t)){const c=RO(o)?[o]:a.chains,l=a.methods||[],f=a.events||[],u=a.rpcMap||{},h=Gb(o);s[h]=MVe(E6(E6({},s[h]),a),{chains:S5(c,(e=s[h])==null?void 0:e.chains),methods:S5(l,(r=s[h])==null?void 0:r.methods),events:S5(f,(n=s[h])==null?void 0:n.events),rpcMap:E6(E6({},u),(i=s[h])==null?void 0:i.rpcMap)})}return s}function DVe(t){return t.includes(":")?t.split(":")[2]:t}function OV(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=RO(r)?[r]:n.chains?n.chains:Rie(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function v7(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Mie={},Hr=t=>Mie[t],g7=(t,e)=>{Mie[t]=e};class NVe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}var BVe=Object.defineProperty,LVe=Object.defineProperties,FVe=Object.getOwnPropertyDescriptors,DV=Object.getOwnPropertySymbols,jVe=Object.prototype.hasOwnProperty,UVe=Object.prototype.propertyIsEnumerable,NV=(t,e,r)=>e in t?BVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,BV=(t,e)=>{for(var r in e||(e={}))jVe.call(e,r)&&NV(t,r,e[r]);if(DV)for(var r of DV(e))UVe.call(e,r)&&NV(t,r,e[r]);return t},LV=(t,e)=>LVe(t,FVe(e));class $Ve{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}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,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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,r){const n=r||ga(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(P1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:LV(BV({},o.sessionProperties||{}),{capabilities:LV(BV({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ih("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${_Ve}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class qVe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class VVe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class zVe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){if(!this.httpProviders[e]){const n=r||ga(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hc(new nl(n,Hr("disableProviderPing")))}}class HVe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=P1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class GVe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class WVe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class KVe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ga(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace);return typeof n>"u"?void 0:new hc(new nl(n,Hr("disableProviderPing")))}}class YVe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ga(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace);return typeof n>"u"?void 0:new hc(new nl(n))}}class QVe{constructor(e){this.name=Sv,this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=Eg(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}var JVe=Object.defineProperty,ZVe=Object.defineProperties,XVe=Object.getOwnPropertyDescriptors,FV=Object.getOwnPropertySymbols,eze=Object.prototype.hasOwnProperty,tze=Object.prototype.propertyIsEnumerable,jV=(t,e,r)=>e in t?JVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C6=(t,e)=>{for(var r in e||(e={}))eze.call(e,r)&&jV(t,r,e[r]);if(FV)for(var r of FV(e))tze.call(e,r)&&jV(t,r,e[r]);return t},y7=(t,e)=>ZVe(t,XVe(e));let rze=class Oie{constructor(e){this.events=new aO,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Ix(IC({level:(e==null?void 0:e.logger)||TV})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new Oie(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:C6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,TC(s,o))).catch(o=>r(o,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:(e=this.session)==null?void 0:e.topic,reason:sn("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)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=OV(this.session.namespaces);this.namespaces=p7(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=OV(s.namespaces);this.namespaces=p7(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Pie)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===Sv?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(lf(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.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 OC.init({core:this.providerOpts.core,logger:this.providerOpts.logger||TV,relayUrl:this.providerOpts.relayUrl||CVe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),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(r=>Gb(r)))];g7("client",this.client),g7("events",this.events),g7("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=OVe(r,this.session),i=Rie(n),s=p7(this.namespaces,this.optionalNamespaces),o=y7(C6({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new $Ve({namespace:o});break;case"algorand":this.rpcProviders[r]=new zVe({namespace:o});break;case"solana":this.rpcProviders[r]=new qVe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new VVe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new NVe({namespace:o});break;case"cip34":this.rpcProviders[r]=new HVe({namespace:o});break;case"elrond":this.rpcProviders[r]=new GVe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new WVe({namespace:o});break;case"near":this.rpcProviders[r]=new KVe({namespace:o});break;case"tezos":this.rpcProviders[r]=new YVe({namespace:o});break;default:this.rpcProviders[Sv]?this.rpcProviders[Sv].updateNamespace(o):this.rpcProviders[Sv]=new QVe({namespace:o})}})}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:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&lf(i)&&this.events.emit("accountsChanged",i.map(DVe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Gb(i),a=v7(i)!==v7(s)?`${o}:${v7(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=y7(C6({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",y7(C6({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(pc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Sv]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>Gb(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Gb(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i: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,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${PV}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${PV}/${e}`)}};const nze=rze,ize="wc",sze="ethereum_provider",oze=`${ize}@2:${sze}:`,aze="https://rpc.walletconnect.org/v1/",zT=["eth_sendTransaction","personal_sign"],cze=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],HT=["chainChanged","accountsChanged"],lze=["chainChanged","accountsChanged","message","disconnect","connect"];var fze=Object.defineProperty,uze=Object.defineProperties,dze=Object.getOwnPropertyDescriptors,UV=Object.getOwnPropertySymbols,hze=Object.prototype.hasOwnProperty,pze=Object.prototype.propertyIsEnumerable,$V=(t,e,r)=>e in t?fze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_v=(t,e)=>{for(var r in e||(e={}))hze.call(e,r)&&$V(t,r,e[r]);if(UV)for(var r of UV(e))pze.call(e,r)&&$V(t,r,e[r]);return t},m7=(t,e)=>uze(t,dze(e));function u8(t){return Number(t[0].split(":")[1])}function A6(t){return`0x${t.toString(16)}`}function vze(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!lf(e))throw new Error("Invalid chains");const c={chains:e,methods:n||zT,events:s||HT,rpcMap:_v({},e.length?{[u8(e)]:a[u8(e)]}:{})},l=s==null?void 0:s.filter(v=>!HT.includes(v)),f=n==null?void 0:n.filter(v=>!zT.includes(v));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const u=(l==null?void 0:l.length)&&(f==null?void 0:f.length)||!r,h={chains:[...new Set(u?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:cze))],events:[...new Set(c.events.concat(o!=null&&o.length?o:lze))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?h:void 0}}let gze=class Die{constructor(){this.events=new wa.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=oze,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Die;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}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:r,optional:n}=vze(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(m7(_v({namespaces:_v({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=fq(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:A6(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(m7(_v({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=fq(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:A6(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}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:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",A6(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",m7(_v({},sn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",A6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||zT:[],c=i.length?(e==null?void 0:e.events)||HT:[],l=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],u=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(v=>this.formatChainId(v)),optionalChains:s.map(v=>this.formatChainId(v)),methods:a,events:c,optionalMethods:l,optionalEvents:f,rpcMap:u,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?u8(this.rpc.chains):u8(this.rpc.optionalChains),this.signer=await nze.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await bke(()=>import("./index-B1sGzfvq.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(_v({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&lf(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&lf(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${aze}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};const Nie=t=>({info:{walletId:"",uuid:"",name:"WalletConnect",icon:"https://avatars.githubusercontent.com/u/37784886"},provider:t});async function Bie(t){return await gze.init({projectId:cte,showQrModal:t,optionalChains:[1],metadata:{name:"Sequence Recovery Wallet External Wallet",description:"",url:"https://recovery.sequence.app",icons:[]}})}function yze(){const[t,e]=T.useState(null),n=ir(Rr).getLastConnectedExternalProviderInfo();return T.useEffect(()=>{async function i(){const s=await Bie(!1);await s.enable(),e(s)}return(n==null?void 0:n.name)==="WalletConnect"&&i(),()=>{t&&t.disconnect()}},[]),t}const qV=async(t,e,r=15)=>{let n,i=0;do{if(i>5&&await new Promise(s=>setTimeout(s,100*i)),n=await t.getTransactionReceipt(e),i===r){console.warn(`Could not get receipt for transaction ${e} after ${i} tries`);return}if(n)return n;i++}while(!n&&i<=r)};let S6=[];const b7={value:()=>S6,subscribe:t=>{function e(r){S6.some(n=>n.info.uuid===r.detail.info.uuid)||(S6=[...S6,r.detail],t())}return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new Event("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}},Lie=()=>T.useSyncExternalStore(b7.subscribe,b7.value,b7.value);class kx{constructor(e){ue(this,"authStore",ir(ai));ue(this,"accountAddress",this.authStore.accountAddress.get());ue(this,"isReady",wr(!1));ue(this,"signClient");ue(this,"currentRequestInfo");ue(this,"allSessions",wr([]));ue(this,"sessions",this.allSessions.readOnly());ue(this,"createSignClient",async()=>{this.signClient=await OC.init({projectId:cte,metadata:{name:"Sequence Recovery Wallet",description:"Sequence Recovery Wallet - Recover Your Wallet",url:"https://recovery.sequence.app",icons:["https://sequence.app/apple-touch-icon.png"]}}),this.signClient.on("session_proposal",this.onSessionProposal),this.signClient.on("session_request",this.onSessionRequest),this.signClient.on("session_ping",this.onSessionPing),this.signClient.on("session_event",this.onSessionEvent),this.signClient.on("session_update",this.onSessionUpdate),this.signClient.on("session_delete",this.onSessionDelete);const e=this.getSignClientSessions();e?this.allSessions.set(e):this.allSessions.set([]),this.isReady.set(!0)});ue(this,"getSignClientSessions",()=>this.signClient.session.getAll().filter(r=>r.self.metadata.name!=="Sequence Recovery Wallet External Wallet"));ue(this,"pair",async e=>{if(!this.signClient)throw new Error("WalletConnect signClient not initialized.");await this.signClient.core.pairing.pair({uri:e}),this.allSessions.set(this.getSignClientSessions())});ue(this,"rejectRequest",()=>{var e;this.currentRequestInfo&&((e=this.signClient)==null||e.respond({topic:this.currentRequestInfo.topic,response:{id:this.currentRequestInfo.id,jsonrpc:"2.0",error:{message:"User rejected.",code:4001}}}))});ue(this,"disconnectSession",async e=>{var n,i;const r=(n=this.signClient)==null?void 0:n.session.get(e);r&&(await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:r.topic,reason:{message:"User disconnected.",code:6e3}})),this.allSessions.set(this.getSignClientSessions()??[]))});ue(this,"disconnectAllSessions",async()=>{var r;(((r=this.signClient)==null?void 0:r.session.getAll())??[]).forEach(async n=>{var i;await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:n.topic,reason:{message:"User disconnected.",code:6e3}}))}),this.allSessions.set([])});ue(this,"onSessionProposal",async e=>{var l,f,u,h,v;console.log("onSessionProposal",e);const r=e.params.requiredNamespaces,n=e.params.optionalNamespaces,i=Object.keys(r).length===0?[]:r.eip155.chains??[],s=Object.keys(n).length===0?[]:n.eip155.chains??[],o=((l=i[0])==null?void 0:l.split(":").pop())??((f=s[0])==null?void 0:f.split(":").pop());if(!o)throw new Error("No chainId found in WalletConnect session proposal namespaces.");const a={app:e.params.proposer.metadata.name,origin:e.params.proposer.metadata.url,networkId:o,keepWalletOpened:!0},c=await this.store.get(Rr).walletRequestHandler.promptConnect(a);if(c&&c.connected){const m=this.store.get(In).networks.get(),S=i.map(I=>Number(I.split(":").pop())),x=s.map(I=>Number(I.split(":").pop())),N={eip155:{accounts:m.map(I=>I.chainId).filter(I=>[...S,...x].includes(I)).map(I=>"eip155:"+I+":"+this.accountAddress),methods:["eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v4","wallet_switchEthereumChain"],events:["chainChanged","accountsChanged","connect","disconnect"]}},L=await((u=this.signClient)==null?void 0:u.approve({id:e.id,namespaces:N})),V=await(L==null?void 0:L.acknowledged());console.log("session",V),this.allSessions.set(this.getSignClientSessions()??[]),(h=this.signClient)==null||h.core.pairing.getPairings().filter(I=>e.params.pairingTopic!==I.topic).forEach(async I=>{var U,ie;e.params.proposer.metadata.url===((U=I.peerMetadata)==null?void 0:U.url)&&await((ie=this.signClient)==null?void 0:ie.core.pairing.disconnect({topic:I.topic}))})}else(v=this.signClient)==null||v.reject({id:e.id,reason:{message:"User rejected.",code:5e3}})});ue(this,"onSessionRequest",async e=>{var o,a,c;console.log("onSessionRequest",e);const r=e.params.chainId.split(":").pop(),n={jsonrpc:"2.0",id:e.id,method:e.params.request.method,params:e.params.request.params,chainId:Number(r)};n.method==="eth_sendTransaction"&&Array.isArray(n.params)&&n.params.forEach(l=>{delete l.nonce});const i=(o=this.signClient)==null?void 0:o.session.get(e.topic),s={app:(i==null?void 0:i.peer.metadata.name)??"",origin:i==null?void 0:i.peer.metadata.url,networkId:r};this.store.get(Rr).walletRequestHandler.setConnectOptions(s),this.currentRequestInfo={topic:e.topic,id:e.id};try{const l=await this.store.get(Rr).walletRequestHandler.request(n);(a=this.signClient)==null||a.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",result:l}})}catch(l){(c=this.signClient)==null||c.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",error:{message:l.message,code:l.code??4001}}})}this.currentRequestInfo=void 0});ue(this,"onSessionPing",async e=>{console.log("onSessionPing",e)});ue(this,"onSessionEvent",async e=>{console.log("onSessionEvent",e)});ue(this,"onSessionUpdate",async e=>{console.log("onSessionUpdate",e)});ue(this,"onSessionDelete",async e=>{console.log("onSessionDelete",e),this.allSessions.set(this.getSignClientSessions()??[])});this.store=e,this.createSignClient()}}function mze({onClose:t}){var a;const e=ir(Rr),r=ir(ai),n=e.toSignMsgDetails.get(),i=r.accountAddress.get(),[s,o]=T.useState("");return T.useEffect(()=>{if(n!=null&&n.message.message){const c=X_e(n.message.message);try{o(Zp(c))}catch{o(ke(c))}}else n!=null&&n.message.typedData&&o(JSON.stringify(n.message.typedData,void 0,4))},[n]),j.jsx(ve,{children:n&&j.jsxs(j.Fragment,{children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Origin"}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:(a=n==null?void 0:n.origin)==null?void 0:a.split("//")[1]}),j.jsx(b1,{size:"xs",icon:G8,onClick:()=>window.open(n==null?void 0:n.origin,"_blank"),style:{width:"24px",height:"24px"}})]})]}),j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Network"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:um(Number(n.chainId))})]}),j.jsxs(vn,{flexDirection:"column",gap:"4",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Signee"}),j.jsx(vn,{children:j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",style:{fontFamily:"monospace"},children:`${i}`})})]}),j.jsx(iK,{label:"Message Content",children:j.jsx(vn,{children:j.jsx(Te,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:()=>{t()}}),j.jsx(Kt,{label:"Send",variant:"primary",size:"md",shape:"square",onClick:()=>t(n)})]})]})})}function bze({onClose:t,handleSignTxn:e}){var i;const n=ir(Rr).toSignTxnDetails.get();return T.useEffect(()=>{n&&e(n)},[n]),j.jsx(ve,{children:n&&j.jsxs(j.Fragment,{children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text100",children:"Waiting for external wallet confirmation"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Origin"}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:(i=n==null?void 0:n.origin)==null?void 0:i.split("//")[1]}),j.jsx(b1,{size:"xs",icon:G8,onClick:()=>window.open(n==null?void 0:n.origin,"_blank"),style:{width:"24px",height:"24px"}})]})]}),j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Network"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:um(Number(n.chainId))})]}),j.jsx(iK,{label:"Transaction Data",children:j.jsx(ve,{flexDirection:"column",gap:"2",children:n.txn.map((s,o)=>j.jsx(vn,{children:j.jsx(Te,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:JSON.stringify(s,null,4)||"Native token transfer"})},o))})})]})]}),j.jsx(pi,{marginY:"0"}),j.jsx(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:j.jsx(Kt,{label:"Ignore transaction",size:"md",shape:"square",onClick:()=>{t()}})})]})})}function wze({onClose:t}){var l;const e=Hu("isMobile"),r=ir(Rr),n=Fr(r.connectOptions),i=rm(),[s,o]=T.useState(!1),a=async()=>{if(s)return;o(!0);const f=await r.walletRequestHandler.connect(n);r.connectDetails.set(f),o(!1),i({variant:"success",title:"Dapp connection added successfully",description:"You can now receive dapp action requests."}),t()},c=()=>{r.connectDetails.set({connected:!1}),t()};return j.jsxs(ve,{style:{minWidth:e?"100vw":"500px"},children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Would you like to connect to this dapp?"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Origin"}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:(l=n==null?void 0:n.origin)==null?void 0:l.split("//")[1]}),j.jsx(b1,{size:"xs",icon:G8,onClick:()=>window.open(n==null?void 0:n.origin,"_blank"),style:{width:"24px",height:"24px"}})]})]}),j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Network"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:um(Number(n==null?void 0:n.networkId))})]})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:()=>c()}),j.jsx(Kt,{label:s?"Authorizing…":"Connect",variant:"primary",size:"md",shape:"square",disabled:s,onClick:()=>a()})]})]})}const d1=({icon:t,onClick:e,disabled:r=!1})=>j.jsx(Kt,{shape:"square",borderRadius:"sm",disabled:r,onClick:()=>{r||e()},label:j.jsx(ve,{justifyContent:"center",alignItems:"center",children:j.jsx(ve,{position:"absolute",children:t})}),style:{height:"40px",width:"40px",background:"rgba(255, 255, 255, 0.05)"}}),DC=({src:t,...e})=>j.jsx(ve,{justifyContent:"center",alignItems:"center",borderRadius:"sm",style:{height:"44px",width:"44px"},...e,children:j.jsx(Ln,{width:"10",height:"auto",src:t,borderRadius:"xs"})});function xze({sessionList:t}){const e=ir(kx);return j.jsx(j.Fragment,{children:t.map((r,n)=>j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"2",children:[j.jsxs(ve,{alignItems:"center",gap:"4",children:[j.jsx(DC,{background:"text80",src:r.peer.metadata.icons[0]}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name?r.peer.metadata.name:r.peer.metadata.url})]}),j.jsxs(ve,{gap:"2",children:[r.peer.metadata.url&&j.jsx(d1,{icon:j.jsx(G8,{color:"text100"}),onClick:()=>window.open(r.peer.metadata.url,"_blank")}),j.jsx(d1,{icon:j.jsx(Pu,{color:"text100"}),onClick:()=>e.disconnectSession(r.topic)})]})]},n))})}var Fie={},$o={};Object.defineProperty($o,"__esModule",{value:!0});$o.compactObject=$ie;$o.deprecated=kze;var Eze=$o.detectBrowser=Rze;$o.disableLog=Ize;$o.disableWarnings=Tze;$o.extractVersion=R5;$o.filterStats=Mze;$o.log=Pze;$o.walkStats=d8;$o.wrapPeerConnectionEvent=_ze;function Cze(t,e,r){return e=Aze(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aze(t){var e=Sze(t,"string");return Fh(e)=="symbol"?e:e+""}function Sze(t,e){if(Fh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fh(t){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fh(t)}var jie=!0,Uie=!0;function R5(t,e,r){var n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function _ze(t,e,r){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);var c=function(f){var u=r(f);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,c),i.apply(this,[o,c])};var s=n.removeEventListener;n.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);var c=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function Ize(t){return typeof t!="boolean"?new Error("Argument type: "+Fh(t)+". Please use a boolean."):(jie=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Tze(t){return typeof t!="boolean"?new Error("Argument type: "+Fh(t)+". Please use a boolean."):(Uie=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Pze(){if((typeof window>"u"?"undefined":Fh(window))==="object"){if(jie)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function kze(t,e){Uie&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Rze(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var r=t.navigator;if(r.userAgentData&&r.userAgentData.brands){var n=r.userAgentData.brands.find(function(i){return i.brand==="Chromium"});if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(r.mozGetUserMedia)e.browser="firefox",e.version=R5(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=R5(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=R5(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function VV(t){return Object.prototype.toString.call(t)==="[object Object]"}function $ie(t){return VV(t)?Object.keys(t).reduce(function(e,r){var n=VV(t[r]),i=n?$ie(t[r]):t[r],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,Cze({},r,i))},{}):t}function d8(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?d8(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(function(i){d8(t,t.get(i),r)})}))}function Mze(t,e,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;var s=[];return t.forEach(function(o){o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(function(o){t.forEach(function(a){a.type===n&&a.trackId===o.id&&d8(t,a,i)})}),i}Object.defineProperty(Fie,"__esModule",{value:!0});var Oze=Fie.shimGetUserMedia=Bze,Dze=Nze($o);function qie(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(qie=function(i){return i?r:e})(t)}function Nze(t,e){if(t&&t.__esModule)return t;if(t===null||Dd(t)!="object"&&typeof t!="function")return{default:t};var r=qie(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Dd(t){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dd(t)}var zV=Dze.log;function Bze(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(Dd(l)!=="object"||l.mandatory||l.optional)return l;var f={};return Object.keys(l).forEach(function(u){if(!(u==="require"||u==="advanced"||u==="mediaSource")){var h=Dd(l[u])==="object"?l[u]:{ideal:l[u]};h.exact!==void 0&&typeof h.exact=="number"&&(h.min=h.max=h.exact);var v=function(S,x){return S?S+x.charAt(0).toUpperCase()+x.slice(1):x==="deviceId"?"sourceId":x};if(h.ideal!==void 0){f.optional=f.optional||[];var y={};typeof h.ideal=="number"?(y[v("min",u)]=h.ideal,f.optional.push(y),y={},y[v("max",u)]=h.ideal,f.optional.push(y)):(y[v("",u)]=h.ideal,f.optional.push(y))}h.exact!==void 0&&typeof h.exact!="number"?(f.mandatory=f.mandatory||{},f.mandatory[v("",u)]=h.exact):["min","max"].forEach(function(m){h[m]!==void 0&&(f.mandatory=f.mandatory||{},f.mandatory[v(m,u)]=h[m])})}}),l.advanced&&(f.optional=(f.optional||[]).concat(l.advanced)),f},i=function(l,f){if(e.version>=61)return f(l);if(l=JSON.parse(JSON.stringify(l)),l&&Dd(l.audio)==="object"){var u=function(S,x,A){x in S&&!(A in S)&&(S[A]=S[x],delete S[x])};l=JSON.parse(JSON.stringify(l)),u(l.audio,"autoGainControl","googAutoGainControl"),u(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=n(l.audio)}if(l&&Dd(l.video)==="object"){var h=l.video.facingMode;h=h&&(Dd(h)==="object"?h:{ideal:h});var v=e.version<66;if(h&&(h.exact==="user"||h.exact==="environment"||h.ideal==="user"||h.ideal==="environment")&&!(r.mediaDevices.getSupportedConstraints&&r.mediaDevices.getSupportedConstraints().facingMode&&!v)){delete l.video.facingMode;var y;if(h.exact==="environment"||h.ideal==="environment"?y=["back","rear"]:(h.exact==="user"||h.ideal==="user")&&(y=["front"]),y)return r.mediaDevices.enumerateDevices().then(function(m){m=m.filter(function(x){return x.kind==="videoinput"});var S=m.find(function(x){return y.some(function(A){return x.label.toLowerCase().includes(A)})});return!S&&m.length&&y.includes("back")&&(S=m[m.length-1]),S&&(l.video.deviceId=h.exact?{exact:S.deviceId}:{ideal:S.deviceId}),l.video=n(l.video),zV("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return zV("chrome: "+JSON.stringify(l)),f(l)},s=function(l){return e.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(l,f,u){i(l,function(h){r.webkitGetUserMedia(h,f,function(v){u&&u(s(v))})})};if(r.getUserMedia=o.bind(r),r.mediaDevices.getUserMedia){var a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(c){return i(c,function(l){return a(l).then(function(f){if(l.audio&&!f.getAudioTracks().length||l.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(function(u){u.stop()}),new DOMException("","NotFoundError");return f},function(f){return Promise.reject(s(f))})})}}}}var Vie={};Object.defineProperty(Vie,"__esModule",{value:!0});var Lze=Vie.shimGetUserMedia=Uze,Fze=jze($o);function zie(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(zie=function(i){return i?r:e})(t)}function jze(t,e){if(t&&t.__esModule)return t;if(t===null||Ag(t)!="object"&&typeof t!="function")return{default:t};var r=zie(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Ag(t){"@babel/helpers - typeof";return Ag=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ag(t)}function Uze(t,e){var r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(c,l,f){Fze.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(c).then(l,f)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(l,f,u){f in l&&!(u in l)&&(l[u]=l[f],delete l[f])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(c){return Ag(c)==="object"&&Ag(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var o=n.prototype.getSettings;n.prototype.getSettings=function(){var c=o.apply(this,arguments);return i(c,"mozAutoGainControl","autoGainControl"),i(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var a=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&Ag(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c,"autoGainControl","mozAutoGainControl"),i(c,"noiseSuppression","mozNoiseSuppression")),a.apply(this,[c])}}}}var vf={};Object.defineProperty(vf,"__esModule",{value:!0});vf.shimAudioContext=Qze;vf.shimCallbacksAPI=Hze;vf.shimConstraints=Wie;vf.shimCreateOfferLegacy=Yze;var $ze=vf.shimGetUserMedia=Gze;vf.shimLocalStreamsAPI=Vze;vf.shimRTCIceServerUrls=Wze;vf.shimRemoteStreamsAPI=zze;vf.shimTrackEventTransceiver=Kze;var Hie=qze($o);function Gie(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Gie=function(i){return i?r:e})(t)}function qze(t,e){if(t&&t.__esModule)return t;if(t===null||jh(t)!="object"&&typeof t!="function")return{default:t};var r=Gie(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function Vze(t){if(!(jh(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(function(s){return e.call(i,s,n)}),n.getVideoTracks().forEach(function(s){return e.call(i,s,n)})},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=this,s=arguments.length,o=new Array(s>1?s-1:0),a=1;a=0)){n._remoteStreams.push(s);var o=new Event("addstream");o.stream=s,n.dispatchEvent(o)}})}),e.apply(n,arguments)}}}function Hze(t){if(!(jh(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],h=r.apply(this,[u]);return f?(h.then(l,f),Promise.resolve()):h},e.createAnswer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],h=n.apply(this,[u]);return f?(h.then(l,f),Promise.resolve()):h};var a=function(l,f,u){var h=i.apply(this,[l]);return u?(h.then(f,u),Promise.resolve()):h};e.setLocalDescription=a,a=function(l,f,u){var h=s.apply(this,[l]);return u?(h.then(f,u),Promise.resolve()):h},e.setRemoteDescription=a,a=function(l,f,u){var h=o.apply(this,[l]);return u?(h.then(f,u),Promise.resolve()):h},e.addIceCandidate=a}}function Gze(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=function(i){return n(Wie(i))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(s,o,a){e.mediaDevices.getUserMedia(s).then(o,a)}).bind(e))}function Wie(t){return t&&t.video!==void 0?Object.assign({},t,{video:Hie.compactObject(t.video)}):t}function Wze(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){for(var s=[],o=0;o{throw TypeError(t)},Yie=(t,e,r)=>e.has(t)||Kie("Cannot "+r),Jze=(t,e,r)=>(Yie(t,e,"read from private field"),r?r.call(t):e.get(t)),Zze=(t,e,r)=>e.has(t)?Kie("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Xze=(t,e,r,n)=>(Yie(t,e,"write to private field"),e.set(t,r),r);const HV=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function eHe(t){return t.join("|")}function tHe(t){const e=GV(t);let r=0,n=HV.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=HV[i],o=GV(s);if(o===e)return s;o{const r=t.match(/_(.+?)\.wasm$/);return r?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${r[1]}/${t}`:e+t}};let WV=new WeakMap;function FO(t,e){var r;const n=WV.get(t);if(n!=null&&n.modulePromise&&e===void 0)return n.modulePromise;const i=(r=n==null?void 0:n.moduleOverrides)!=null?r:cHe,s=t({...i});return WV.set(t,{moduleOverrides:i,modulePromise:s}),s}async function lHe(t,e,r=zy){const n={...zy,...r},i=await FO(t),{size:s}=e,o=new Uint8Array(await e.arrayBuffer()),a=i._malloc(s);i.HEAPU8.set(o,a);const c=i.readBarcodesFromImage(a,s,Qie(i,n));i._free(a);const l=[];for(let f=0;f{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(r={}){var n,i=r,s,o,a=new Promise((z,H)=>{s=z,o=H}),c=typeof window=="object",l=typeof Bun<"u",f=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var u=Object.assign({},i),h="./this.program",v="";function y(z){return i.locateFile?i.locateFile(z,v):v+z}var m,S;if(c||f||l){var x;f?v=self.location.href:typeof document<"u"&&((x=document.currentScript)===null||x===void 0?void 0:x.tagName.toUpperCase())==="SCRIPT"&&(v=document.currentScript.src),e&&(v=e),v.startsWith("blob:")?v="":v=v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),f&&(S=z=>{var H=new XMLHttpRequest;return H.open("GET",z,!1),H.responseType="arraybuffer",H.send(null),new Uint8Array(H.response)}),m=z=>fetch(z,{credentials:"same-origin"}).then(H=>H.ok?H.arrayBuffer():Promise.reject(new Error(H.status+" : "+H.url)))}var A=i.print||console.log.bind(console),k=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(h=i.thisProgram);var N=i.wasmBinary,L,V=!1,I,U,ie,ae,K,R,D,g;function b(){var z=L.buffer;i.HEAP8=I=new Int8Array(z),i.HEAP16=ie=new Int16Array(z),i.HEAPU8=U=new Uint8Array(z),i.HEAPU16=ae=new Uint16Array(z),i.HEAP32=K=new Int32Array(z),i.HEAPU32=R=new Uint32Array(z),i.HEAPF32=D=new Float32Array(z),i.HEAPF64=g=new Float64Array(z)}var M=[],B=[],E=[];function C(){var z=i.preRun;z&&(typeof z=="function"&&(z=[z]),z.forEach(O)),lt(M)}function w(){lt(B)}function P(){var z=i.postRun;z&&(typeof z=="function"&&(z=[z]),z.forEach(oe)),lt(E)}function O(z){M.unshift(z)}function G(z){B.unshift(z)}function oe(z){E.unshift(z)}var $=0,X=null;function W(z){var H;$++,(H=i.monitorRunDependencies)===null||H===void 0||H.call(i,$)}function Z(z){var H;if($--,(H=i.monitorRunDependencies)===null||H===void 0||H.call(i,$),$==0&&X){var re=X;X=null,re()}}function ee(z){var H;(H=i.onAbort)===null||H===void 0||H.call(i,z),z="Aborted("+z+")",k(z),V=!0,z+=". Build with -sASSERTIONS for more info.";var re=new WebAssembly.RuntimeError(z);throw o(re),re}var F="data:application/octet-stream;base64,",te=z=>z.startsWith(F);function fe(){var z="zxing_reader.wasm";return te(z)?z:y(z)}var xe;function _e(z){if(z==xe&&N)return new Uint8Array(N);if(S)return S(z);throw"both async and sync fetching of the wasm failed"}function Me(z){return N?Promise.resolve().then(()=>_e(z)):m(z).then(H=>new Uint8Array(H),()=>_e(z))}function Ke(z,H,re){return Me(z).then(ce=>WebAssembly.instantiate(ce,H)).then(re,ce=>{k(`failed to asynchronously prepare wasm: ${ce}`),ee(ce)})}function ze(z,H,re,ce){return!z&&typeof WebAssembly.instantiateStreaming=="function"&&!te(H)&&typeof fetch=="function"?fetch(H,{credentials:"same-origin"}).then(ge=>{var be=WebAssembly.instantiateStreaming(ge,re);return be.then(ce,function(Se){return k(`wasm streaming compile failed: ${Se}`),k("falling back to ArrayBuffer instantiation"),Ke(H,re,ce)})}):Ke(H,re,ce)}function Je(){return{a:KC}}function Xe(){var z,H=Je();function re(ge,be){return Qr=ge.exports,L=Qr.za,b(),O1=Qr.Da,G(Qr.Aa),Z(),Qr}W();function ce(ge){re(ge.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(H,re)}catch(ge){k(`Module.instantiateWasm callback failed with error: ${ge}`),o(ge)}return(z=xe)!==null&&z!==void 0||(xe=fe()),ze(N,xe,H,ce).catch(o),{}}var lt=z=>{z.forEach(H=>H(i))};i.noExitRuntime;var Re=z=>jx(z),$e=()=>Ux(),st=[],Qe=0,ct=z=>{var H=new at(z);return H.get_caught()||(H.set_caught(!0),Qe--),H.set_rethrown(!1),st.push(H),Sf(z),Om(z)},tt=0,He=()=>{nr(0,0);var z=st.pop();$x(z.excPtr),tt=0};class at{constructor(H){this.excPtr=H,this.ptr=H-24}set_type(H){R[this.ptr+4>>2]=H}get_type(){return R[this.ptr+4>>2]}set_destructor(H){R[this.ptr+8>>2]=H}get_destructor(){return R[this.ptr+8>>2]}set_caught(H){H=H?1:0,I[this.ptr+12]=H}get_caught(){return I[this.ptr+12]!=0}set_rethrown(H){H=H?1:0,I[this.ptr+13]=H}get_rethrown(){return I[this.ptr+13]!=0}init(H,re){this.set_adjusted_ptr(0),this.set_type(H),this.set_destructor(re)}set_adjusted_ptr(H){R[this.ptr+16>>2]=H}get_adjusted_ptr(){return R[this.ptr+16>>2]}}var pt=z=>{throw tt||(tt=z),tt},Ge=z=>p0(z),vt=z=>{var H=tt;if(!H)return Ge(0),0;var re=new at(H);re.set_adjusted_ptr(H);var ce=re.get_type();if(!ce)return Ge(0),H;for(var ge of z){if(ge===0||ge===ce)break;var be=re.ptr+16;if(yo(ge,ce,be))return Ge(ge),H}return Ge(ce),H},bt=()=>vt([]),Ze=z=>vt([z]),_t=(z,H)=>vt([z,H]),Ct=()=>{var z=st.pop();z||ee("no exception to throw");var H=z.excPtr;throw z.get_rethrown()||(st.push(z),z.set_rethrown(!0),z.set_caught(!1),Qe++),tt=H,tt},It=(z,H,re)=>{var ce=new at(z);throw ce.init(H,re),tt=z,Qe++,tt},er=()=>Qe,dr=()=>{ee("")},wt={},fr=z=>{for(;z.length;){var H=z.pop(),re=z.pop();re(H)}};function sr(z){return this.fromWireType(R[z>>2])}var Pt={},Dt={},Nt={},dt,Lt=z=>{throw new dt(z)},kt=(z,H,re)=>{z.forEach(Ae=>Nt[Ae]=H);function ce(Ae){var De=re(Ae);De.length!==z.length&&Lt("Mismatched type converter count");for(var We=0;We{Dt.hasOwnProperty(Ae)?ge[De]=Dt[Ae]:(be.push(Ae),Pt.hasOwnProperty(Ae)||(Pt[Ae]=[]),Pt[Ae].push(()=>{ge[De]=Dt[Ae],++Se,Se===be.length&&ce(ge)}))}),be.length===0&&ce(ge)},ut=z=>{var H=wt[z];delete wt[z];var re=H.rawConstructor,ce=H.rawDestructor,ge=H.fields,be=ge.map(Se=>Se.getterReturnType).concat(ge.map(Se=>Se.setterArgumentType));kt([z],be,Se=>{var Ae={};return ge.forEach((De,We)=>{var rt=De.fieldName,Ft=Se[We],Er=De.getter,Gt=De.getterContext,hr=Se[We+ge.length],Qn=De.setter,qn=De.setterContext;Ae[rt]={read:Mn=>Ft.fromWireType(Er(Gt,Mn)),write:(Mn,_f)=>{var mi=[];Qn(qn,Mn,hr.toWireType(mi,_f)),fr(mi)}}}),[{name:H.name,fromWireType:De=>{var We={};for(var rt in Ae)We[rt]=Ae[rt].read(De);return ce(De),We},toWireType:(De,We)=>{for(var rt in Ae)if(!(rt in We))throw new TypeError(`Missing field: "${rt}"`);var Ft=re();for(rt in Ae)Ae[rt].write(Ft,We[rt]);return De!==null&&De.push(ce,Ft),Ft},argPackAdvance:ot,readValueFromPointer:sr,destructorFunction:ce}]})},Vt=(z,H,re,ce,ge)=>{},zt=()=>{for(var z=new Array(256),H=0;H<256;++H)z[H]=String.fromCharCode(H);ht=z},ht,xt=z=>{for(var H="",re=z;U[re];)H+=ht[U[re++]];return H},Bt,Ve=z=>{throw new Bt(z)};function $t(z,H){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var ce=H.name;if(z||Ve(`type "${ce}" must have a positive integer typeid pointer`),Dt.hasOwnProperty(z)){if(re.ignoreDuplicateRegistrations)return;Ve(`Cannot register type '${ce}' twice`)}if(Dt[z]=H,delete Nt[z],Pt.hasOwnProperty(z)){var ge=Pt[z];delete Pt[z],ge.forEach(be=>be())}}function Et(z,H){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(z,H,re)}var ot=8,Ht=(z,H,re,ce)=>{H=xt(H),Et(z,{name:H,fromWireType:function(ge){return!!ge},toWireType:function(ge,be){return be?re:ce},argPackAdvance:ot,readValueFromPointer:function(ge){return this.fromWireType(U[ge])},destructorFunction:null})},Br=z=>({count:z.count,deleteScheduled:z.deleteScheduled,preservePointerOnDelete:z.preservePointerOnDelete,ptr:z.ptr,ptrType:z.ptrType,smartPtr:z.smartPtr,smartPtrType:z.smartPtrType}),Ut=z=>{function H(re){return re.$$.ptrType.registeredClass.name}Ve(H(z)+" instance already deleted")},Pr=!1,tr=z=>{},Dr=z=>{z.smartPtr?z.smartPtrType.rawDestructor(z.smartPtr):z.ptrType.registeredClass.rawDestructor(z.ptr)},vi=z=>{z.count.value-=1;var H=z.count.value===0;H&&Dr(z)},gi=(z,H,re)=>{if(H===re)return z;if(re.baseClass===void 0)return null;var ce=gi(z,H,re.baseClass);return ce===null?null:re.downcast(ce)},yi={},Ii={},Tn=(z,H)=>{for(H===void 0&&Ve("ptr should not be undefined");z.baseClass;)H=z.upcast(H),z=z.baseClass;return H},ps=(z,H)=>(H=Tn(z,H),Ii[H]),vs=(z,H)=>{(!H.ptrType||!H.ptr)&&Lt("makeClassHandle requires ptr and ptrType");var re=!!H.smartPtrType,ce=!!H.smartPtr;return re!==ce&&Lt("Both smartPtrType and smartPtr must be specified"),H.count={value:1},Hi(Object.create(z,{$$:{value:H,writable:!0}}))};function gs(z){var H=this.getPointee(z);if(!H)return this.destructor(z),null;var re=ps(this.registeredClass,H);if(re!==void 0){if(re.$$.count.value===0)return re.$$.ptr=H,re.$$.smartPtr=z,re.clone();var ce=re.clone();return this.destructor(z),ce}function ge(){return this.isSmartPointer?vs(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:H,smartPtrType:this,smartPtr:z}):vs(this.registeredClass.instancePrototype,{ptrType:this,ptr:z})}var be=this.registeredClass.getActualType(H),Se=yi[be];if(!Se)return ge.call(this);var Ae;this.isConst?Ae=Se.constPointerType:Ae=Se.pointerType;var De=gi(H,this.registeredClass,Ae.registeredClass);return De===null?ge.call(this):this.isSmartPointer?vs(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:De,smartPtrType:this,smartPtr:z}):vs(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:De})}var Hi=z=>typeof FinalizationRegistry>"u"?(Hi=H=>H,z):(Pr=new FinalizationRegistry(H=>{vi(H.$$)}),Hi=H=>{var re=H.$$,ce=!!re.smartPtr;if(ce){var ge={$$:re};Pr.register(H,ge,H)}return H},tr=H=>Pr.unregister(H),Hi(z)),ys=[],ms=()=>{for(;ys.length;){var z=ys.pop();z.$$.deleteScheduled=!1,z.delete()}},qs,ho=()=>{Object.assign(Pn.prototype,{isAliasOf(z){if(!(this instanceof Pn)||!(z instanceof Pn))return!1;var H=this.$$.ptrType.registeredClass,re=this.$$.ptr;z.$$=z.$$;for(var ce=z.$$.ptrType.registeredClass,ge=z.$$.ptr;H.baseClass;)re=H.upcast(re),H=H.baseClass;for(;ce.baseClass;)ge=ce.upcast(ge),ce=ce.baseClass;return H===ce&&re===ge},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var z=Hi(Object.create(Object.getPrototypeOf(this),{$$:{value:Br(this.$$)}}));return z.$$.count.value+=1,z.$$.deleteScheduled=!1,z},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ve("Object already scheduled for deletion"),tr(this),vi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ve("Object already scheduled for deletion"),ys.push(this),ys.length===1&&qs&&qs(ms),this.$$.deleteScheduled=!0,this}})};function Pn(){}var Gi=(z,H)=>Object.defineProperty(H,"name",{value:z}),po=(z,H,re)=>{if(z[H].overloadTable===void 0){var ce=z[H];z[H]=function(){for(var ge=arguments.length,be=new Array(ge),Se=0;Se{i.hasOwnProperty(z)?((re===void 0||i[z].overloadTable!==void 0&&i[z].overloadTable[re]!==void 0)&&Ve(`Cannot register public name '${z}' twice`),po(i,z,z),i.hasOwnProperty(re)&&Ve(`Cannot register multiple overloads of a function with the same number of arguments (${re})!`),i[z].overloadTable[re]=H):(i[z]=H,re!==void 0&&(i[z].numArguments=re))},gf=48,il=57,k1=z=>{z=z.replace(/[^a-zA-Z0-9_]/g,"$");var H=z.charCodeAt(0);return H>=gf&&H<=il?`_${z}`:z};function yf(z,H,re,ce,ge,be,Se,Ae){this.name=z,this.constructor=H,this.instancePrototype=re,this.rawDestructor=ce,this.baseClass=ge,this.getActualType=be,this.upcast=Se,this.downcast=Ae,this.pureVirtualFunctions=[]}var mf=(z,H,re)=>{for(;H!==re;)H.upcast||Ve(`Expected null or instance of ${re.name}, got an instance of ${H.name}`),z=H.upcast(z),H=H.baseClass;return z};function bf(z,H){if(H===null)return this.isReference&&Ve(`null is not a valid ${this.name}`),0;H.$$||Ve(`Cannot pass "${le(H)}" as a ${this.name}`),H.$$.ptr||Ve(`Cannot pass deleted object as a pointer of type ${this.name}`);var re=H.$$.ptrType.registeredClass,ce=mf(H.$$.ptr,re,this.registeredClass);return ce}function i0(z,H){var re;if(H===null)return this.isReference&&Ve(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),z!==null&&z.push(this.rawDestructor,re),re):0;(!H||!H.$$)&&Ve(`Cannot pass "${le(H)}" as a ${this.name}`),H.$$.ptr||Ve(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&H.$$.ptrType.isConst&&Ve(`Cannot convert argument of type ${H.$$.smartPtrType?H.$$.smartPtrType.name:H.$$.ptrType.name} to parameter type ${this.name}`);var ce=H.$$.ptrType.registeredClass;if(re=mf(H.$$.ptr,ce,this.registeredClass),this.isSmartPointer)switch(H.$$.smartPtr===void 0&&Ve("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:H.$$.smartPtrType===this?re=H.$$.smartPtr:Ve(`Cannot convert argument of type ${H.$$.smartPtrType?H.$$.smartPtrType.name:H.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:re=H.$$.smartPtr;break;case 2:if(H.$$.smartPtrType===this)re=H.$$.smartPtr;else{var ge=H.clone();re=this.rawShare(re,vo.toHandle(()=>ge.delete())),z!==null&&z.push(this.rawDestructor,re)}break;default:Ve("Unsupporting sharing policy")}return re}function wf(z,H){if(H===null)return this.isReference&&Ve(`null is not a valid ${this.name}`),0;H.$$||Ve(`Cannot pass "${le(H)}" as a ${this.name}`),H.$$.ptr||Ve(`Cannot pass deleted object as a pointer of type ${this.name}`),H.$$.ptrType.isConst&&Ve(`Cannot convert argument of type ${H.$$.ptrType.name} to parameter type ${this.name}`);var re=H.$$.ptrType.registeredClass,ce=mf(H.$$.ptr,re,this.registeredClass);return ce}var R1=()=>{Object.assign(Zu.prototype,{getPointee(z){return this.rawGetPointee&&(z=this.rawGetPointee(z)),z},destructor(z){var H;(H=this.rawDestructor)===null||H===void 0||H.call(this,z)},argPackAdvance:ot,readValueFromPointer:sr,fromWireType:gs})};function Zu(z,H,re,ce,ge,be,Se,Ae,De,We,rt){this.name=z,this.registeredClass=H,this.isReference=re,this.isConst=ce,this.isSmartPointer=ge,this.pointeeType=be,this.sharingPolicy=Se,this.rawGetPointee=Ae,this.rawConstructor=De,this.rawShare=We,this.rawDestructor=rt,!ge&&H.baseClass===void 0?ce?(this.toWireType=bf,this.destructorFunction=null):(this.toWireType=wf,this.destructorFunction=null):this.toWireType=i0}var s0=(z,H,re)=>{i.hasOwnProperty(z)||Lt("Replacing nonexistent public symbol"),i[z].overloadTable!==void 0&&re!==void 0?i[z].overloadTable[re]=H:(i[z]=H,i[z].argCount=re)},M1=(z,H,re)=>{z=z.replace(/p/g,"i");var ce=i["dynCall_"+z];return ce(H,...re)},vc=[],O1,mr=z=>{var H=vc[z];return H||(z>=vc.length&&(vc.length=z+1),vc[z]=H=O1.get(z)),H},Xu=function(z,H){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(z.includes("j"))return M1(z,H,re);var ce=mr(H)(...re);return ce},sl=(z,H)=>function(){for(var re=arguments.length,ce=new Array(re),ge=0;ge{z=xt(z);function re(){return z.includes("j")?sl(z,H):mr(H)}var ce=re();return typeof ce!="function"&&Ve(`unknown function pointer with signature ${z}: ${H}`),ce},D1=(z,H)=>{var re=Gi(H,function(ce){this.name=H,this.message=ce;var ge=new Error(ce).stack;ge!==void 0&&(this.stack=this.toString()+` +}`;var gr=SN(function(){return jr(se,Rt+"return "+qe).apply(r,he)});if(gr.source=qe,FA(gr))throw gr;return gr}function dfe(d){return Jr(d).toLowerCase()}function hfe(d){return Jr(d).toUpperCase()}function pfe(d,p,_){if(d=Jr(d),d&&(_||p===r))return nd(d);if(!d||!(p=Ho(p)))return d;var q=yo(d),J=yo(p),se=Bx(q,J),he=Lx(q,J)+1;return hd(q,se,he).join("")}function vfe(d,p,_){if(d=Jr(d),d&&(_||p===r))return d.slice(0,Dm(d)+1);if(!d||!(p=Ho(p)))return d;var q=yo(d),J=Lx(q,yo(p))+1;return hd(q,0,J).join("")}function gfe(d,p,_){if(d=Jr(d),d&&(_||p===r))return d.replace(Bt,"");if(!d||!(p=Ho(p)))return d;var q=yo(d),J=Bx(q,yo(p));return hd(q,J).join("")}function yfe(d,p){var _=ae,q=K;if(On(p)){var J="separator"in p?p.separator:J;_="length"in p?pr(p.length):_,q="omission"in p?Ho(p.omission):q}d=Jr(d);var se=d.length;if(Qr(d)){var he=yo(d);se=he.length}if(_>=se)return d;var me=_-Sf(q);if(me<1)return q;var Ce=he?hd(he,0,me).join(""):d.slice(0,me);if(J===r)return Ce+q;if(he&&(me+=Ce.length-me),jA(J)){if(d.slice(me).search(J)){var Be,Le=Ce;for(J.global||(J=Nm(J.source,Jr(tr.exec(J))+"g")),J.lastIndex=0;Be=J.exec(Le);)var qe=Be.index;Ce=Ce.slice(0,qe===r?me:qe)}}else if(d.indexOf(Ho(J),me)!=me){var ft=Ce.lastIndexOf(J);ft>-1&&(Ce=Ce.slice(0,ft))}return Ce+q}function mfe(d){return d=Jr(d),d&&Dt.test(d)?d.replace(sr,qx):d}var bfe=Z1(function(d,p,_){return d+(_?" ":"")+p.toUpperCase()}),qA=_D("toUpperCase");function AN(d,p,_){return d=Jr(d),p=_?r:p,p===r?Fx(d)?JC(d):UC(d):d.match(p)||[]}var SN=br(function(d,p){try{return fi(d,r,p)}catch(_){return FA(_)?_:new Xt(_)}}),wfe=Rf(function(d,p){return go(p,function(_){_=dl(_),Pf(d,_,BA(d[_],d))}),d});function xfe(d){var p=d==null?0:d.length,_=Wt();return d=p?ln(d,function(q){if(typeof q[1]!="function")throw new mo(o);return[_(q[0]),q[1]]}):[],br(function(q){for(var J=-1;++JE)return[];var _=P,q=hr(d,P);p=Wt(p),d-=P;for(var J=u0(q,p);++_0||p<0)?new kr(_):(d<0?_=_.takeRight(-d):d&&(_=_.drop(d)),p!==r&&(p=pr(p),_=p<0?_.dropRight(-p):_.take(p-d)),_)},kr.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kr.prototype.toArray=function(){return this.take(P)},fl(kr.prototype,function(d,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),q=/^(?:head|last)$/.test(p),J=ne[q?"take"+(p=="last"?"Right":""):p],se=q||/^find/.test(p);J&&(ne.prototype[p]=function(){var he=this.__wrapped__,me=q?[1]:arguments,Ce=he instanceof kr,Be=me[0],Le=Ce||or(he),qe=function(Sr){var Nr=J.apply(ne,cl([Sr],me));return q&&ft?Nr[0]:Nr};Le&&_&&typeof Be=="function"&&Be.length!=1&&(Ce=Le=!1);var ft=this.__chain__,Rt=!!this.__actions__.length,Yt=se&&!ft,gr=Ce&&!Rt;if(!se&&Le){he=gr?he:new kr(this);var Qt=d.apply(he,me);return Qt.__actions__.push({func:l3,args:[qe],thisArg:r}),new Sa(Qt,ft)}return Yt&&gr?d.apply(this,me):(Qt=this.thru(qe),Yt?q?Qt.value()[0]:Qt.value():Qt)})}),go(["pop","push","shift","sort","splice","unshift"],function(d){var p=q1[d],_=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",q=/^(?:pop|shift)$/.test(d);ne.prototype[d]=function(){var J=arguments;if(q&&!this.__chain__){var se=this.value();return p.apply(or(se)?se:[],J)}return this[_](function(he){return p.apply(or(he)?he:[],J)})}}),fl(kr.prototype,function(d,p){var _=ne[p];if(_){var q=_.name+"";Wr.call(mc,q)||(mc[q]=[]),mc[q].push({name:p,func:_})}}),mc[r3(r,x).name]=[{name:"wrapper",func:r}],kr.prototype.clone=mse,kr.prototype.reverse=bse,kr.prototype.value=wse,ne.prototype.at=Yae,ne.prototype.chain=Qae,ne.prototype.commit=Jae,ne.prototype.next=Zae,ne.prototype.plant=ece,ne.prototype.reverse=tce,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=rce,ne.prototype.first=ne.prototype.head,z&&(ne.prototype[z]=Xae),ne},id=ZC();pn?((pn.exports=id)._=id,rn._=id):Ar._=id}).call(Ei)})(f8,f8.exports);var pVe=f8.exports,VT={exports:{}};(function(t,e){var r=typeof self<"u"?self:Ei,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(g){return g&&DataView.prototype.isPrototypeOf(g)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(g){return g&&l.indexOf(Object.prototype.toString.call(g))>-1};function u(g){if(typeof g!="string"&&(g=String(g)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(g))throw new TypeError("Invalid character in header field name");return g.toLowerCase()}function h(g){return typeof g!="string"&&(g=String(g)),g}function v(g){var b={next:function(){var M=g.shift();return{done:M===void 0,value:M}}};return a.iterable&&(b[Symbol.iterator]=function(){return b}),b}function y(g){this.map={},g instanceof y?g.forEach(function(b,M){this.append(M,b)},this):Array.isArray(g)?g.forEach(function(b){this.append(b[0],b[1])},this):g&&Object.getOwnPropertyNames(g).forEach(function(b){this.append(b,g[b])},this)}y.prototype.append=function(g,b){g=u(g),b=h(b);var M=this.map[g];this.map[g]=M?M+", "+b:b},y.prototype.delete=function(g){delete this.map[u(g)]},y.prototype.get=function(g){return g=u(g),this.has(g)?this.map[g]:null},y.prototype.has=function(g){return this.map.hasOwnProperty(u(g))},y.prototype.set=function(g,b){this.map[u(g)]=h(b)},y.prototype.forEach=function(g,b){for(var M in this.map)this.map.hasOwnProperty(M)&&g.call(b,this.map[M],M,this)},y.prototype.keys=function(){var g=[];return this.forEach(function(b,M){g.push(M)}),v(g)},y.prototype.values=function(){var g=[];return this.forEach(function(b){g.push(b)}),v(g)},y.prototype.entries=function(){var g=[];return this.forEach(function(b,M){g.push([M,b])}),v(g)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function m(g){if(g.bodyUsed)return Promise.reject(new TypeError("Already read"));g.bodyUsed=!0}function S(g){return new Promise(function(b,M){g.onload=function(){b(g.result)},g.onerror=function(){M(g.error)}})}function x(g){var b=new FileReader,M=S(b);return b.readAsArrayBuffer(g),M}function A(g){var b=new FileReader,M=S(b);return b.readAsText(g),M}function k(g){for(var b=new Uint8Array(g),M=new Array(b.length),B=0;B-1?b:g}function U(g,b){b=b||{};var M=b.body;if(g instanceof U){if(g.bodyUsed)throw new TypeError("Already read");this.url=g.url,this.credentials=g.credentials,b.headers||(this.headers=new y(g.headers)),this.method=g.method,this.mode=g.mode,this.signal=g.signal,!M&&g._bodyInit!=null&&(M=g._bodyInit,g.bodyUsed=!0)}else this.url=String(g);if(this.credentials=b.credentials||this.credentials||"same-origin",(b.headers||!this.headers)&&(this.headers=new y(b.headers)),this.method=I(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.signal=b.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function ie(g){var b=new FormData;return g.trim().split("&").forEach(function(M){if(M){var B=M.split("="),E=B.shift().replace(/\+/g," "),C=B.join("=").replace(/\+/g," ");b.append(decodeURIComponent(E),decodeURIComponent(C))}}),b}function ae(g){var b=new y,M=g.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(B){var E=B.split(":"),C=E.shift().trim();if(C){var w=E.join(":").trim();b.append(C,w)}}),b}L.call(U.prototype);function K(g,b){b||(b={}),this.type="default",this.status=b.status===void 0?200:b.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new y(b.headers),this.url=b.url||"",this._initBody(g)}L.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var g=new K(null,{status:0,statusText:""});return g.type="error",g};var R=[301,302,303,307,308];K.redirect=function(g,b){if(R.indexOf(b)===-1)throw new RangeError("Invalid status code");return new K(null,{status:b,headers:{location:g}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(b,M){this.message=b,this.name=M;var B=Error(b);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function D(g,b){return new Promise(function(M,B){var E=new U(g,b);if(E.signal&&E.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var C=new XMLHttpRequest;function w(){C.abort()}C.onload=function(){var P={status:C.status,statusText:C.statusText,headers:ae(C.getAllResponseHeaders()||"")};P.url="responseURL"in C?C.responseURL:P.headers.get("X-Request-URL");var O="response"in C?C.response:C.responseText;M(new K(O,P))},C.onerror=function(){B(new TypeError("Network request failed"))},C.ontimeout=function(){B(new TypeError("Network request failed"))},C.onabort=function(){B(new o.DOMException("Aborted","AbortError"))},C.open(E.method,E.url,!0),E.credentials==="include"?C.withCredentials=!0:E.credentials==="omit"&&(C.withCredentials=!1),"responseType"in C&&a.blob&&(C.responseType="blob"),E.headers.forEach(function(P,O){C.setRequestHeader(O,P)}),E.signal&&(E.signal.addEventListener("abort",w),C.onreadystatechange=function(){C.readyState===4&&E.signal.removeEventListener("abort",w)}),C.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return D.polyfill=!0,s.fetch||(s.fetch=D,s.Headers=y,s.Request=U,s.Response=K),o.Headers=y,o.Request=U,o.Response=K,o.fetch=D,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(VT,VT.exports);var vVe=VT.exports;const xV=qu(vVe);var gVe=Object.defineProperty,yVe=Object.defineProperties,mVe=Object.getOwnPropertyDescriptors,EV=Object.getOwnPropertySymbols,bVe=Object.prototype.hasOwnProperty,wVe=Object.prototype.propertyIsEnumerable,CV=(t,e,r)=>e in t?gVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AV=(t,e)=>{for(var r in e||(e={}))bVe.call(e,r)&&CV(t,r,e[r]);if(EV)for(var r of EV(e))wVe.call(e,r)&&CV(t,r,e[r]);return t},SV=(t,e)=>yVe(t,mVe(e));const xVe={Accept:"application/json","Content-Type":"application/json"},EVe="POST",_V={headers:xVe,method:EVe},IV=10;let nl=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new wa.EventEmitter,this.isAvailable=!1,this.registering=!1,!Wq(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}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){this.isAvailable||await this.register();try{const r=$u(e),n=await(await xV(this.url,SV(AV({},_V),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!Wq(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=$u({id:1,jsonrpc:"2.0",method:"test",params:[]});await xV(e,SV(AV({},_V),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}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(typeof e.data>"u")return;const r=typeof e.data=="string"?l1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=PC(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return oie(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>IV&&this.events.setMaxListeners(IV)}};const TV="error",CVe="wss://relay.walletconnect.org",AVe="wc",SVe="universal_provider",PV=`${AVe}@2:${SVe}:`,kie="https://rpc.walletconnect.org/v1/",Sv="generic",_Ve=`${kie}bundler`,pc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var IVe=Object.defineProperty,TVe=Object.defineProperties,PVe=Object.getOwnPropertyDescriptors,kV=Object.getOwnPropertySymbols,kVe=Object.prototype.hasOwnProperty,RVe=Object.prototype.propertyIsEnumerable,RV=(t,e,r)=>e in t?IVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E6=(t,e)=>{for(var r in e||(e={}))kVe.call(e,r)&&RV(t,r,e[r]);if(kV)for(var r of kV(e))RVe.call(e,r)&&RV(t,r,e[r]);return t},MVe=(t,e)=>TVe(t,PVe(e));function ga(t,e,r){var n;const i=Eg(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${kie}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function P1(t){return t.includes(":")?t.split(":")[1]:t}function Rie(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OVe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function p7(t={},e={}){const r=MV(t),n=MV(e);return pVe.merge(r,n)}function MV(t){var e,r,n,i;const s={};if(!pw(t))return s;for(const[o,a]of Object.entries(t)){const c=RO(o)?[o]:a.chains,l=a.methods||[],f=a.events||[],u=a.rpcMap||{},h=Gb(o);s[h]=MVe(E6(E6({},s[h]),a),{chains:S5(c,(e=s[h])==null?void 0:e.chains),methods:S5(l,(r=s[h])==null?void 0:r.methods),events:S5(f,(n=s[h])==null?void 0:n.events),rpcMap:E6(E6({},u),(i=s[h])==null?void 0:i.rpcMap)})}return s}function DVe(t){return t.includes(":")?t.split(":")[2]:t}function OV(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=RO(r)?[r]:n.chains?n.chains:Rie(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function v7(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Mie={},Hr=t=>Mie[t],g7=(t,e)=>{Mie[t]=e};class NVe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}var BVe=Object.defineProperty,LVe=Object.defineProperties,FVe=Object.getOwnPropertyDescriptors,DV=Object.getOwnPropertySymbols,jVe=Object.prototype.hasOwnProperty,UVe=Object.prototype.propertyIsEnumerable,NV=(t,e,r)=>e in t?BVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,BV=(t,e)=>{for(var r in e||(e={}))jVe.call(e,r)&&NV(t,r,e[r]);if(DV)for(var r of DV(e))UVe.call(e,r)&&NV(t,r,e[r]);return t},LV=(t,e)=>LVe(t,FVe(e));class $Ve{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}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,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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,r){const n=r||ga(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(P1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:LV(BV({},o.sessionProperties||{}),{capabilities:LV(BV({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ih("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${_Ve}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class qVe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class VVe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class zVe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){if(!this.httpProviders[e]){const n=r||ga(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hc(new nl(n,Hr("disableProviderPing")))}}class HVe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=P1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class GVe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class WVe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=P1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}class KVe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ga(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace);return typeof n>"u"?void 0:new hc(new nl(n,Hr("disableProviderPing")))}}class YVe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ga(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace);return typeof n>"u"?void 0:new hc(new nl(n))}}class QVe{constructor(e){this.name=Sv,this.namespace=e.namespace,this.events=Hr("events"),this.client=Hr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(pc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=Eg(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ga(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new hc(new nl(n,Hr("disableProviderPing")))}}var JVe=Object.defineProperty,ZVe=Object.defineProperties,XVe=Object.getOwnPropertyDescriptors,FV=Object.getOwnPropertySymbols,eze=Object.prototype.hasOwnProperty,tze=Object.prototype.propertyIsEnumerable,jV=(t,e,r)=>e in t?JVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C6=(t,e)=>{for(var r in e||(e={}))eze.call(e,r)&&jV(t,r,e[r]);if(FV)for(var r of FV(e))tze.call(e,r)&&jV(t,r,e[r]);return t},y7=(t,e)=>ZVe(t,XVe(e));let rze=class Oie{constructor(e){this.events=new aO,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Ix(IC({level:(e==null?void 0:e.logger)||TV})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new Oie(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:C6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,TC(s,o))).catch(o=>r(o,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:(e=this.session)==null?void 0:e.topic,reason:sn("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)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=OV(this.session.namespaces);this.namespaces=p7(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=OV(s.namespaces);this.namespaces=p7(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Pie)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===Sv?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(lf(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.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 OC.init({core:this.providerOpts.core,logger:this.providerOpts.logger||TV,relayUrl:this.providerOpts.relayUrl||CVe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),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(r=>Gb(r)))];g7("client",this.client),g7("events",this.events),g7("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=OVe(r,this.session),i=Rie(n),s=p7(this.namespaces,this.optionalNamespaces),o=y7(C6({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new $Ve({namespace:o});break;case"algorand":this.rpcProviders[r]=new zVe({namespace:o});break;case"solana":this.rpcProviders[r]=new qVe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new VVe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new NVe({namespace:o});break;case"cip34":this.rpcProviders[r]=new HVe({namespace:o});break;case"elrond":this.rpcProviders[r]=new GVe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new WVe({namespace:o});break;case"near":this.rpcProviders[r]=new KVe({namespace:o});break;case"tezos":this.rpcProviders[r]=new YVe({namespace:o});break;default:this.rpcProviders[Sv]?this.rpcProviders[Sv].updateNamespace(o):this.rpcProviders[Sv]=new QVe({namespace:o})}})}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:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&lf(i)&&this.events.emit("accountsChanged",i.map(DVe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Gb(i),a=v7(i)!==v7(s)?`${o}:${v7(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=y7(C6({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",y7(C6({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(pc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Sv]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>Gb(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Gb(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i: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,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${PV}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${PV}/${e}`)}};const nze=rze,ize="wc",sze="ethereum_provider",oze=`${ize}@2:${sze}:`,aze="https://rpc.walletconnect.org/v1/",zT=["eth_sendTransaction","personal_sign"],cze=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],HT=["chainChanged","accountsChanged"],lze=["chainChanged","accountsChanged","message","disconnect","connect"];var fze=Object.defineProperty,uze=Object.defineProperties,dze=Object.getOwnPropertyDescriptors,UV=Object.getOwnPropertySymbols,hze=Object.prototype.hasOwnProperty,pze=Object.prototype.propertyIsEnumerable,$V=(t,e,r)=>e in t?fze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_v=(t,e)=>{for(var r in e||(e={}))hze.call(e,r)&&$V(t,r,e[r]);if(UV)for(var r of UV(e))pze.call(e,r)&&$V(t,r,e[r]);return t},m7=(t,e)=>uze(t,dze(e));function u8(t){return Number(t[0].split(":")[1])}function A6(t){return`0x${t.toString(16)}`}function vze(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!lf(e))throw new Error("Invalid chains");const c={chains:e,methods:n||zT,events:s||HT,rpcMap:_v({},e.length?{[u8(e)]:a[u8(e)]}:{})},l=s==null?void 0:s.filter(v=>!HT.includes(v)),f=n==null?void 0:n.filter(v=>!zT.includes(v));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const u=(l==null?void 0:l.length)&&(f==null?void 0:f.length)||!r,h={chains:[...new Set(u?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:cze))],events:[...new Set(c.events.concat(o!=null&&o.length?o:lze))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?h:void 0}}let gze=class Die{constructor(){this.events=new wa.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=oze,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Die;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}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:r,optional:n}=vze(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(m7(_v({namespaces:_v({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=fq(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:A6(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(m7(_v({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=fq(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:A6(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}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:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",A6(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",m7(_v({},sn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",A6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||zT:[],c=i.length?(e==null?void 0:e.events)||HT:[],l=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],u=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(v=>this.formatChainId(v)),optionalChains:s.map(v=>this.formatChainId(v)),methods:a,events:c,optionalMethods:l,optionalEvents:f,rpcMap:u,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?u8(this.rpc.chains):u8(this.rpc.optionalChains),this.signer=await nze.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await bke(()=>import("./index-DktADLpu.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(_v({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&lf(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&lf(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${aze}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};const Nie=t=>({info:{walletId:"",uuid:"",name:"WalletConnect",icon:"https://avatars.githubusercontent.com/u/37784886"},provider:t});async function Bie(t){return await gze.init({projectId:cte,showQrModal:t,optionalChains:[1],metadata:{name:"Sequence Recovery Wallet External Wallet",description:"",url:"https://recovery.sequence.app",icons:[]}})}function yze(){const[t,e]=T.useState(null),n=ir(Rr).getLastConnectedExternalProviderInfo();return T.useEffect(()=>{async function i(){const s=await Bie(!1);await s.enable(),e(s)}return(n==null?void 0:n.name)==="WalletConnect"&&i(),()=>{t&&t.disconnect()}},[]),t}const qV=async(t,e,r=15)=>{let n,i=0;do{if(i>5&&await new Promise(s=>setTimeout(s,100*i)),n=await t.getTransactionReceipt(e),i===r){console.warn(`Could not get receipt for transaction ${e} after ${i} tries`);return}if(n)return n;i++}while(!n&&i<=r)};let S6=[];const b7={value:()=>S6,subscribe:t=>{function e(r){S6.some(n=>n.info.uuid===r.detail.info.uuid)||(S6=[...S6,r.detail],t())}return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new Event("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}},Lie=()=>T.useSyncExternalStore(b7.subscribe,b7.value,b7.value);class kx{constructor(e){ue(this,"authStore",ir(ai));ue(this,"accountAddress",this.authStore.accountAddress.get());ue(this,"isReady",wr(!1));ue(this,"signClient");ue(this,"currentRequestInfo");ue(this,"allSessions",wr([]));ue(this,"sessions",this.allSessions.readOnly());ue(this,"createSignClient",async()=>{this.signClient=await OC.init({projectId:cte,metadata:{name:"Sequence Recovery Wallet",description:"Sequence Recovery Wallet - Recover Your Wallet",url:"https://recovery.sequence.app",icons:["https://sequence.app/apple-touch-icon.png"]}}),this.signClient.on("session_proposal",this.onSessionProposal),this.signClient.on("session_request",this.onSessionRequest),this.signClient.on("session_ping",this.onSessionPing),this.signClient.on("session_event",this.onSessionEvent),this.signClient.on("session_update",this.onSessionUpdate),this.signClient.on("session_delete",this.onSessionDelete);const e=this.getSignClientSessions();e?this.allSessions.set(e):this.allSessions.set([]),this.isReady.set(!0)});ue(this,"getSignClientSessions",()=>this.signClient.session.getAll().filter(r=>r.self.metadata.name!=="Sequence Recovery Wallet External Wallet"));ue(this,"pair",async e=>{if(!this.signClient)throw new Error("WalletConnect signClient not initialized.");await this.signClient.core.pairing.pair({uri:e}),this.allSessions.set(this.getSignClientSessions())});ue(this,"rejectRequest",()=>{var e;this.currentRequestInfo&&((e=this.signClient)==null||e.respond({topic:this.currentRequestInfo.topic,response:{id:this.currentRequestInfo.id,jsonrpc:"2.0",error:{message:"User rejected.",code:4001}}}))});ue(this,"disconnectSession",async e=>{var n,i;const r=(n=this.signClient)==null?void 0:n.session.get(e);r&&(await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:r.topic,reason:{message:"User disconnected.",code:6e3}})),this.allSessions.set(this.getSignClientSessions()??[]))});ue(this,"disconnectAllSessions",async()=>{var r;(((r=this.signClient)==null?void 0:r.session.getAll())??[]).forEach(async n=>{var i;await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:n.topic,reason:{message:"User disconnected.",code:6e3}}))}),this.allSessions.set([])});ue(this,"onSessionProposal",async e=>{var l,f,u,h,v;console.log("onSessionProposal",e);const r=e.params.requiredNamespaces,n=e.params.optionalNamespaces,i=Object.keys(r).length===0?[]:r.eip155.chains??[],s=Object.keys(n).length===0?[]:n.eip155.chains??[],o=((l=i[0])==null?void 0:l.split(":").pop())??((f=s[0])==null?void 0:f.split(":").pop());if(!o)throw new Error("No chainId found in WalletConnect session proposal namespaces.");const a={app:e.params.proposer.metadata.name,origin:e.params.proposer.metadata.url,networkId:o,keepWalletOpened:!0},c=await this.store.get(Rr).walletRequestHandler.promptConnect(a);if(c&&c.connected){const m=this.store.get(In).networks.get(),S=i.map(I=>Number(I.split(":").pop())),x=s.map(I=>Number(I.split(":").pop())),N={eip155:{accounts:m.map(I=>I.chainId).filter(I=>[...S,...x].includes(I)).map(I=>"eip155:"+I+":"+this.accountAddress),methods:["eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v4","wallet_switchEthereumChain"],events:["chainChanged","accountsChanged","connect","disconnect"]}},L=await((u=this.signClient)==null?void 0:u.approve({id:e.id,namespaces:N})),V=await(L==null?void 0:L.acknowledged());console.log("session",V),this.allSessions.set(this.getSignClientSessions()??[]),(h=this.signClient)==null||h.core.pairing.getPairings().filter(I=>e.params.pairingTopic!==I.topic).forEach(async I=>{var U,ie;e.params.proposer.metadata.url===((U=I.peerMetadata)==null?void 0:U.url)&&await((ie=this.signClient)==null?void 0:ie.core.pairing.disconnect({topic:I.topic}))})}else(v=this.signClient)==null||v.reject({id:e.id,reason:{message:"User rejected.",code:5e3}})});ue(this,"onSessionRequest",async e=>{var o,a,c;console.log("onSessionRequest",e);const r=e.params.chainId.split(":").pop(),n={jsonrpc:"2.0",id:e.id,method:e.params.request.method,params:e.params.request.params,chainId:Number(r)};n.method==="eth_sendTransaction"&&Array.isArray(n.params)&&n.params.forEach(l=>{delete l.nonce});const i=(o=this.signClient)==null?void 0:o.session.get(e.topic),s={app:(i==null?void 0:i.peer.metadata.name)??"",origin:i==null?void 0:i.peer.metadata.url,networkId:r};this.store.get(Rr).walletRequestHandler.setConnectOptions(s),this.currentRequestInfo={topic:e.topic,id:e.id};try{const l=await this.store.get(Rr).walletRequestHandler.request(n);(a=this.signClient)==null||a.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",result:l}})}catch(l){(c=this.signClient)==null||c.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",error:{message:l.message,code:l.code??4001}}})}this.currentRequestInfo=void 0});ue(this,"onSessionPing",async e=>{console.log("onSessionPing",e)});ue(this,"onSessionEvent",async e=>{console.log("onSessionEvent",e)});ue(this,"onSessionUpdate",async e=>{console.log("onSessionUpdate",e)});ue(this,"onSessionDelete",async e=>{console.log("onSessionDelete",e),this.allSessions.set(this.getSignClientSessions()??[])});this.store=e,this.createSignClient()}}function mze({onClose:t}){var a;const e=ir(Rr),r=ir(ai),n=e.toSignMsgDetails.get(),i=r.accountAddress.get(),[s,o]=T.useState("");return T.useEffect(()=>{if(n!=null&&n.message.message){const c=X_e(n.message.message);try{o(Zp(c))}catch{o(ke(c))}}else n!=null&&n.message.typedData&&o(JSON.stringify(n.message.typedData,void 0,4))},[n]),j.jsx(ve,{children:n&&j.jsxs(j.Fragment,{children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Origin"}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:(a=n==null?void 0:n.origin)==null?void 0:a.split("//")[1]}),j.jsx(b1,{size:"xs",icon:G8,onClick:()=>window.open(n==null?void 0:n.origin,"_blank"),style:{width:"24px",height:"24px"}})]})]}),j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Network"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:um(Number(n.chainId))})]}),j.jsxs(vn,{flexDirection:"column",gap:"4",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Signee"}),j.jsx(vn,{children:j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",style:{fontFamily:"monospace"},children:`${i}`})})]}),j.jsx(iK,{label:"Message Content",children:j.jsx(vn,{children:j.jsx(Te,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:()=>{t()}}),j.jsx(Kt,{label:"Send",variant:"primary",size:"md",shape:"square",onClick:()=>t(n)})]})]})})}function bze({onClose:t,handleSignTxn:e}){var i;const n=ir(Rr).toSignTxnDetails.get();return T.useEffect(()=>{n&&e(n)},[n]),j.jsx(ve,{children:n&&j.jsxs(j.Fragment,{children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text100",children:"Waiting for external wallet confirmation"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Origin"}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:(i=n==null?void 0:n.origin)==null?void 0:i.split("//")[1]}),j.jsx(b1,{size:"xs",icon:G8,onClick:()=>window.open(n==null?void 0:n.origin,"_blank"),style:{width:"24px",height:"24px"}})]})]}),j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Network"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:um(Number(n.chainId))})]}),j.jsx(iK,{label:"Transaction Data",children:j.jsx(ve,{flexDirection:"column",gap:"2",children:n.txn.map((s,o)=>j.jsx(vn,{children:j.jsx(Te,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:JSON.stringify(s,null,4)||"Native token transfer"})},o))})})]})]}),j.jsx(pi,{marginY:"0"}),j.jsx(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:j.jsx(Kt,{label:"Ignore transaction",size:"md",shape:"square",onClick:()=>{t()}})})]})})}function wze({onClose:t}){var l;const e=Hu("isMobile"),r=ir(Rr),n=Fr(r.connectOptions),i=rm(),[s,o]=T.useState(!1),a=async()=>{if(s)return;o(!0);const f=await r.walletRequestHandler.connect(n);r.connectDetails.set(f),o(!1),i({variant:"success",title:"Dapp connection added successfully",description:"You can now receive dapp action requests."}),t()},c=()=>{r.connectDetails.set({connected:!1}),t()};return j.jsxs(ve,{style:{minWidth:e?"100vw":"500px"},children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Would you like to connect to this dapp?"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Origin"}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:(l=n==null?void 0:n.origin)==null?void 0:l.split("//")[1]}),j.jsx(b1,{size:"xs",icon:G8,onClick:()=>window.open(n==null?void 0:n.origin,"_blank"),style:{width:"24px",height:"24px"}})]})]}),j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:"Network"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text100",children:um(Number(n==null?void 0:n.networkId))})]})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:()=>c()}),j.jsx(Kt,{label:s?"Authorizing…":"Connect",variant:"primary",size:"md",shape:"square",disabled:s,onClick:()=>a()})]})]})}const d1=({icon:t,onClick:e,disabled:r=!1})=>j.jsx(Kt,{shape:"square",borderRadius:"sm",disabled:r,onClick:()=>{r||e()},label:j.jsx(ve,{justifyContent:"center",alignItems:"center",children:j.jsx(ve,{position:"absolute",children:t})}),style:{height:"40px",width:"40px",background:"rgba(255, 255, 255, 0.05)"}}),DC=({src:t,...e})=>j.jsx(ve,{justifyContent:"center",alignItems:"center",borderRadius:"sm",style:{height:"44px",width:"44px"},...e,children:j.jsx(Ln,{width:"10",height:"auto",src:t,borderRadius:"xs"})});function xze({sessionList:t}){const e=ir(kx);return j.jsx(j.Fragment,{children:t.map((r,n)=>j.jsxs(vn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"2",children:[j.jsxs(ve,{alignItems:"center",gap:"4",children:[j.jsx(DC,{background:"text80",src:r.peer.metadata.icons[0]}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name?r.peer.metadata.name:r.peer.metadata.url})]}),j.jsxs(ve,{gap:"2",children:[r.peer.metadata.url&&j.jsx(d1,{icon:j.jsx(G8,{color:"text100"}),onClick:()=>window.open(r.peer.metadata.url,"_blank")}),j.jsx(d1,{icon:j.jsx(Pu,{color:"text100"}),onClick:()=>e.disconnectSession(r.topic)})]})]},n))})}var Fie={},$o={};Object.defineProperty($o,"__esModule",{value:!0});$o.compactObject=$ie;$o.deprecated=kze;var Eze=$o.detectBrowser=Rze;$o.disableLog=Ize;$o.disableWarnings=Tze;$o.extractVersion=R5;$o.filterStats=Mze;$o.log=Pze;$o.walkStats=d8;$o.wrapPeerConnectionEvent=_ze;function Cze(t,e,r){return e=Aze(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aze(t){var e=Sze(t,"string");return Fh(e)=="symbol"?e:e+""}function Sze(t,e){if(Fh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fh(t){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fh(t)}var jie=!0,Uie=!0;function R5(t,e,r){var n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function _ze(t,e,r){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);var c=function(f){var u=r(f);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,c),i.apply(this,[o,c])};var s=n.removeEventListener;n.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);var c=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function Ize(t){return typeof t!="boolean"?new Error("Argument type: "+Fh(t)+". Please use a boolean."):(jie=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Tze(t){return typeof t!="boolean"?new Error("Argument type: "+Fh(t)+". Please use a boolean."):(Uie=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Pze(){if((typeof window>"u"?"undefined":Fh(window))==="object"){if(jie)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function kze(t,e){Uie&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Rze(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var r=t.navigator;if(r.userAgentData&&r.userAgentData.brands){var n=r.userAgentData.brands.find(function(i){return i.brand==="Chromium"});if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(r.mozGetUserMedia)e.browser="firefox",e.version=R5(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=R5(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=R5(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function VV(t){return Object.prototype.toString.call(t)==="[object Object]"}function $ie(t){return VV(t)?Object.keys(t).reduce(function(e,r){var n=VV(t[r]),i=n?$ie(t[r]):t[r],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,Cze({},r,i))},{}):t}function d8(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?d8(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(function(i){d8(t,t.get(i),r)})}))}function Mze(t,e,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;var s=[];return t.forEach(function(o){o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(function(o){t.forEach(function(a){a.type===n&&a.trackId===o.id&&d8(t,a,i)})}),i}Object.defineProperty(Fie,"__esModule",{value:!0});var Oze=Fie.shimGetUserMedia=Bze,Dze=Nze($o);function qie(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(qie=function(i){return i?r:e})(t)}function Nze(t,e){if(t&&t.__esModule)return t;if(t===null||Dd(t)!="object"&&typeof t!="function")return{default:t};var r=qie(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Dd(t){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dd(t)}var zV=Dze.log;function Bze(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(Dd(l)!=="object"||l.mandatory||l.optional)return l;var f={};return Object.keys(l).forEach(function(u){if(!(u==="require"||u==="advanced"||u==="mediaSource")){var h=Dd(l[u])==="object"?l[u]:{ideal:l[u]};h.exact!==void 0&&typeof h.exact=="number"&&(h.min=h.max=h.exact);var v=function(S,x){return S?S+x.charAt(0).toUpperCase()+x.slice(1):x==="deviceId"?"sourceId":x};if(h.ideal!==void 0){f.optional=f.optional||[];var y={};typeof h.ideal=="number"?(y[v("min",u)]=h.ideal,f.optional.push(y),y={},y[v("max",u)]=h.ideal,f.optional.push(y)):(y[v("",u)]=h.ideal,f.optional.push(y))}h.exact!==void 0&&typeof h.exact!="number"?(f.mandatory=f.mandatory||{},f.mandatory[v("",u)]=h.exact):["min","max"].forEach(function(m){h[m]!==void 0&&(f.mandatory=f.mandatory||{},f.mandatory[v(m,u)]=h[m])})}}),l.advanced&&(f.optional=(f.optional||[]).concat(l.advanced)),f},i=function(l,f){if(e.version>=61)return f(l);if(l=JSON.parse(JSON.stringify(l)),l&&Dd(l.audio)==="object"){var u=function(S,x,A){x in S&&!(A in S)&&(S[A]=S[x],delete S[x])};l=JSON.parse(JSON.stringify(l)),u(l.audio,"autoGainControl","googAutoGainControl"),u(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=n(l.audio)}if(l&&Dd(l.video)==="object"){var h=l.video.facingMode;h=h&&(Dd(h)==="object"?h:{ideal:h});var v=e.version<66;if(h&&(h.exact==="user"||h.exact==="environment"||h.ideal==="user"||h.ideal==="environment")&&!(r.mediaDevices.getSupportedConstraints&&r.mediaDevices.getSupportedConstraints().facingMode&&!v)){delete l.video.facingMode;var y;if(h.exact==="environment"||h.ideal==="environment"?y=["back","rear"]:(h.exact==="user"||h.ideal==="user")&&(y=["front"]),y)return r.mediaDevices.enumerateDevices().then(function(m){m=m.filter(function(x){return x.kind==="videoinput"});var S=m.find(function(x){return y.some(function(A){return x.label.toLowerCase().includes(A)})});return!S&&m.length&&y.includes("back")&&(S=m[m.length-1]),S&&(l.video.deviceId=h.exact?{exact:S.deviceId}:{ideal:S.deviceId}),l.video=n(l.video),zV("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return zV("chrome: "+JSON.stringify(l)),f(l)},s=function(l){return e.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(l,f,u){i(l,function(h){r.webkitGetUserMedia(h,f,function(v){u&&u(s(v))})})};if(r.getUserMedia=o.bind(r),r.mediaDevices.getUserMedia){var a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(c){return i(c,function(l){return a(l).then(function(f){if(l.audio&&!f.getAudioTracks().length||l.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(function(u){u.stop()}),new DOMException("","NotFoundError");return f},function(f){return Promise.reject(s(f))})})}}}}var Vie={};Object.defineProperty(Vie,"__esModule",{value:!0});var Lze=Vie.shimGetUserMedia=Uze,Fze=jze($o);function zie(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(zie=function(i){return i?r:e})(t)}function jze(t,e){if(t&&t.__esModule)return t;if(t===null||Ag(t)!="object"&&typeof t!="function")return{default:t};var r=zie(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Ag(t){"@babel/helpers - typeof";return Ag=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ag(t)}function Uze(t,e){var r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(c,l,f){Fze.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(c).then(l,f)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(l,f,u){f in l&&!(u in l)&&(l[u]=l[f],delete l[f])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(c){return Ag(c)==="object"&&Ag(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var o=n.prototype.getSettings;n.prototype.getSettings=function(){var c=o.apply(this,arguments);return i(c,"mozAutoGainControl","autoGainControl"),i(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var a=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&Ag(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c,"autoGainControl","mozAutoGainControl"),i(c,"noiseSuppression","mozNoiseSuppression")),a.apply(this,[c])}}}}var vf={};Object.defineProperty(vf,"__esModule",{value:!0});vf.shimAudioContext=Qze;vf.shimCallbacksAPI=Hze;vf.shimConstraints=Wie;vf.shimCreateOfferLegacy=Yze;var $ze=vf.shimGetUserMedia=Gze;vf.shimLocalStreamsAPI=Vze;vf.shimRTCIceServerUrls=Wze;vf.shimRemoteStreamsAPI=zze;vf.shimTrackEventTransceiver=Kze;var Hie=qze($o);function Gie(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Gie=function(i){return i?r:e})(t)}function qze(t,e){if(t&&t.__esModule)return t;if(t===null||jh(t)!="object"&&typeof t!="function")return{default:t};var r=Gie(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function Vze(t){if(!(jh(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(function(s){return e.call(i,s,n)}),n.getVideoTracks().forEach(function(s){return e.call(i,s,n)})},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=this,s=arguments.length,o=new Array(s>1?s-1:0),a=1;a=0)){n._remoteStreams.push(s);var o=new Event("addstream");o.stream=s,n.dispatchEvent(o)}})}),e.apply(n,arguments)}}}function Hze(t){if(!(jh(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],h=r.apply(this,[u]);return f?(h.then(l,f),Promise.resolve()):h},e.createAnswer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],h=n.apply(this,[u]);return f?(h.then(l,f),Promise.resolve()):h};var a=function(l,f,u){var h=i.apply(this,[l]);return u?(h.then(f,u),Promise.resolve()):h};e.setLocalDescription=a,a=function(l,f,u){var h=s.apply(this,[l]);return u?(h.then(f,u),Promise.resolve()):h},e.setRemoteDescription=a,a=function(l,f,u){var h=o.apply(this,[l]);return u?(h.then(f,u),Promise.resolve()):h},e.addIceCandidate=a}}function Gze(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=function(i){return n(Wie(i))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(s,o,a){e.mediaDevices.getUserMedia(s).then(o,a)}).bind(e))}function Wie(t){return t&&t.video!==void 0?Object.assign({},t,{video:Hie.compactObject(t.video)}):t}function Wze(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){for(var s=[],o=0;o{throw TypeError(t)},Yie=(t,e,r)=>e.has(t)||Kie("Cannot "+r),Jze=(t,e,r)=>(Yie(t,e,"read from private field"),r?r.call(t):e.get(t)),Zze=(t,e,r)=>e.has(t)?Kie("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Xze=(t,e,r,n)=>(Yie(t,e,"write to private field"),e.set(t,r),r);const HV=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function eHe(t){return t.join("|")}function tHe(t){const e=GV(t);let r=0,n=HV.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=HV[i],o=GV(s);if(o===e)return s;o{const r=t.match(/_(.+?)\.wasm$/);return r?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${r[1]}/${t}`:e+t}};let WV=new WeakMap;function FO(t,e){var r;const n=WV.get(t);if(n!=null&&n.modulePromise&&e===void 0)return n.modulePromise;const i=(r=n==null?void 0:n.moduleOverrides)!=null?r:cHe,s=t({...i});return WV.set(t,{moduleOverrides:i,modulePromise:s}),s}async function lHe(t,e,r=zy){const n={...zy,...r},i=await FO(t),{size:s}=e,o=new Uint8Array(await e.arrayBuffer()),a=i._malloc(s);i.HEAPU8.set(o,a);const c=i.readBarcodesFromImage(a,s,Qie(i,n));i._free(a);const l=[];for(let f=0;f{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(r={}){var n,i=r,s,o,a=new Promise((z,H)=>{s=z,o=H}),c=typeof window=="object",l=typeof Bun<"u",f=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var u=Object.assign({},i),h="./this.program",v="";function y(z){return i.locateFile?i.locateFile(z,v):v+z}var m,S;if(c||f||l){var x;f?v=self.location.href:typeof document<"u"&&((x=document.currentScript)===null||x===void 0?void 0:x.tagName.toUpperCase())==="SCRIPT"&&(v=document.currentScript.src),e&&(v=e),v.startsWith("blob:")?v="":v=v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),f&&(S=z=>{var H=new XMLHttpRequest;return H.open("GET",z,!1),H.responseType="arraybuffer",H.send(null),new Uint8Array(H.response)}),m=z=>fetch(z,{credentials:"same-origin"}).then(H=>H.ok?H.arrayBuffer():Promise.reject(new Error(H.status+" : "+H.url)))}var A=i.print||console.log.bind(console),k=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(h=i.thisProgram);var N=i.wasmBinary,L,V=!1,I,U,ie,ae,K,R,D,g;function b(){var z=L.buffer;i.HEAP8=I=new Int8Array(z),i.HEAP16=ie=new Int16Array(z),i.HEAPU8=U=new Uint8Array(z),i.HEAPU16=ae=new Uint16Array(z),i.HEAP32=K=new Int32Array(z),i.HEAPU32=R=new Uint32Array(z),i.HEAPF32=D=new Float32Array(z),i.HEAPF64=g=new Float64Array(z)}var M=[],B=[],E=[];function C(){var z=i.preRun;z&&(typeof z=="function"&&(z=[z]),z.forEach(O)),lt(M)}function w(){lt(B)}function P(){var z=i.postRun;z&&(typeof z=="function"&&(z=[z]),z.forEach(oe)),lt(E)}function O(z){M.unshift(z)}function G(z){B.unshift(z)}function oe(z){E.unshift(z)}var $=0,X=null;function W(z){var H;$++,(H=i.monitorRunDependencies)===null||H===void 0||H.call(i,$)}function Z(z){var H;if($--,(H=i.monitorRunDependencies)===null||H===void 0||H.call(i,$),$==0&&X){var re=X;X=null,re()}}function ee(z){var H;(H=i.onAbort)===null||H===void 0||H.call(i,z),z="Aborted("+z+")",k(z),V=!0,z+=". Build with -sASSERTIONS for more info.";var re=new WebAssembly.RuntimeError(z);throw o(re),re}var F="data:application/octet-stream;base64,",te=z=>z.startsWith(F);function fe(){var z="zxing_reader.wasm";return te(z)?z:y(z)}var xe;function _e(z){if(z==xe&&N)return new Uint8Array(N);if(S)return S(z);throw"both async and sync fetching of the wasm failed"}function Me(z){return N?Promise.resolve().then(()=>_e(z)):m(z).then(H=>new Uint8Array(H),()=>_e(z))}function Ke(z,H,re){return Me(z).then(ce=>WebAssembly.instantiate(ce,H)).then(re,ce=>{k(`failed to asynchronously prepare wasm: ${ce}`),ee(ce)})}function ze(z,H,re,ce){return!z&&typeof WebAssembly.instantiateStreaming=="function"&&!te(H)&&typeof fetch=="function"?fetch(H,{credentials:"same-origin"}).then(ge=>{var be=WebAssembly.instantiateStreaming(ge,re);return be.then(ce,function(Se){return k(`wasm streaming compile failed: ${Se}`),k("falling back to ArrayBuffer instantiation"),Ke(H,re,ce)})}):Ke(H,re,ce)}function Je(){return{a:KC}}function Xe(){var z,H=Je();function re(ge,be){return Qr=ge.exports,L=Qr.za,b(),O1=Qr.Da,G(Qr.Aa),Z(),Qr}W();function ce(ge){re(ge.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(H,re)}catch(ge){k(`Module.instantiateWasm callback failed with error: ${ge}`),o(ge)}return(z=xe)!==null&&z!==void 0||(xe=fe()),ze(N,xe,H,ce).catch(o),{}}var lt=z=>{z.forEach(H=>H(i))};i.noExitRuntime;var Re=z=>jx(z),$e=()=>Ux(),st=[],Qe=0,ct=z=>{var H=new at(z);return H.get_caught()||(H.set_caught(!0),Qe--),H.set_rethrown(!1),st.push(H),Sf(z),Om(z)},tt=0,He=()=>{nr(0,0);var z=st.pop();$x(z.excPtr),tt=0};class at{constructor(H){this.excPtr=H,this.ptr=H-24}set_type(H){R[this.ptr+4>>2]=H}get_type(){return R[this.ptr+4>>2]}set_destructor(H){R[this.ptr+8>>2]=H}get_destructor(){return R[this.ptr+8>>2]}set_caught(H){H=H?1:0,I[this.ptr+12]=H}get_caught(){return I[this.ptr+12]!=0}set_rethrown(H){H=H?1:0,I[this.ptr+13]=H}get_rethrown(){return I[this.ptr+13]!=0}init(H,re){this.set_adjusted_ptr(0),this.set_type(H),this.set_destructor(re)}set_adjusted_ptr(H){R[this.ptr+16>>2]=H}get_adjusted_ptr(){return R[this.ptr+16>>2]}}var pt=z=>{throw tt||(tt=z),tt},Ge=z=>p0(z),vt=z=>{var H=tt;if(!H)return Ge(0),0;var re=new at(H);re.set_adjusted_ptr(H);var ce=re.get_type();if(!ce)return Ge(0),H;for(var ge of z){if(ge===0||ge===ce)break;var be=re.ptr+16;if(yo(ge,ce,be))return Ge(ge),H}return Ge(ce),H},bt=()=>vt([]),Ze=z=>vt([z]),_t=(z,H)=>vt([z,H]),Ct=()=>{var z=st.pop();z||ee("no exception to throw");var H=z.excPtr;throw z.get_rethrown()||(st.push(z),z.set_rethrown(!0),z.set_caught(!1),Qe++),tt=H,tt},It=(z,H,re)=>{var ce=new at(z);throw ce.init(H,re),tt=z,Qe++,tt},er=()=>Qe,dr=()=>{ee("")},wt={},fr=z=>{for(;z.length;){var H=z.pop(),re=z.pop();re(H)}};function sr(z){return this.fromWireType(R[z>>2])}var Pt={},Dt={},Nt={},dt,Lt=z=>{throw new dt(z)},kt=(z,H,re)=>{z.forEach(Ae=>Nt[Ae]=H);function ce(Ae){var De=re(Ae);De.length!==z.length&&Lt("Mismatched type converter count");for(var We=0;We{Dt.hasOwnProperty(Ae)?ge[De]=Dt[Ae]:(be.push(Ae),Pt.hasOwnProperty(Ae)||(Pt[Ae]=[]),Pt[Ae].push(()=>{ge[De]=Dt[Ae],++Se,Se===be.length&&ce(ge)}))}),be.length===0&&ce(ge)},ut=z=>{var H=wt[z];delete wt[z];var re=H.rawConstructor,ce=H.rawDestructor,ge=H.fields,be=ge.map(Se=>Se.getterReturnType).concat(ge.map(Se=>Se.setterArgumentType));kt([z],be,Se=>{var Ae={};return ge.forEach((De,We)=>{var rt=De.fieldName,Ft=Se[We],Er=De.getter,Gt=De.getterContext,hr=Se[We+ge.length],Qn=De.setter,qn=De.setterContext;Ae[rt]={read:Mn=>Ft.fromWireType(Er(Gt,Mn)),write:(Mn,_f)=>{var mi=[];Qn(qn,Mn,hr.toWireType(mi,_f)),fr(mi)}}}),[{name:H.name,fromWireType:De=>{var We={};for(var rt in Ae)We[rt]=Ae[rt].read(De);return ce(De),We},toWireType:(De,We)=>{for(var rt in Ae)if(!(rt in We))throw new TypeError(`Missing field: "${rt}"`);var Ft=re();for(rt in Ae)Ae[rt].write(Ft,We[rt]);return De!==null&&De.push(ce,Ft),Ft},argPackAdvance:ot,readValueFromPointer:sr,destructorFunction:ce}]})},Vt=(z,H,re,ce,ge)=>{},zt=()=>{for(var z=new Array(256),H=0;H<256;++H)z[H]=String.fromCharCode(H);ht=z},ht,xt=z=>{for(var H="",re=z;U[re];)H+=ht[U[re++]];return H},Bt,Ve=z=>{throw new Bt(z)};function $t(z,H){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var ce=H.name;if(z||Ve(`type "${ce}" must have a positive integer typeid pointer`),Dt.hasOwnProperty(z)){if(re.ignoreDuplicateRegistrations)return;Ve(`Cannot register type '${ce}' twice`)}if(Dt[z]=H,delete Nt[z],Pt.hasOwnProperty(z)){var ge=Pt[z];delete Pt[z],ge.forEach(be=>be())}}function Et(z,H){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(z,H,re)}var ot=8,Ht=(z,H,re,ce)=>{H=xt(H),Et(z,{name:H,fromWireType:function(ge){return!!ge},toWireType:function(ge,be){return be?re:ce},argPackAdvance:ot,readValueFromPointer:function(ge){return this.fromWireType(U[ge])},destructorFunction:null})},Br=z=>({count:z.count,deleteScheduled:z.deleteScheduled,preservePointerOnDelete:z.preservePointerOnDelete,ptr:z.ptr,ptrType:z.ptrType,smartPtr:z.smartPtr,smartPtrType:z.smartPtrType}),Ut=z=>{function H(re){return re.$$.ptrType.registeredClass.name}Ve(H(z)+" instance already deleted")},Pr=!1,tr=z=>{},Dr=z=>{z.smartPtr?z.smartPtrType.rawDestructor(z.smartPtr):z.ptrType.registeredClass.rawDestructor(z.ptr)},vi=z=>{z.count.value-=1;var H=z.count.value===0;H&&Dr(z)},gi=(z,H,re)=>{if(H===re)return z;if(re.baseClass===void 0)return null;var ce=gi(z,H,re.baseClass);return ce===null?null:re.downcast(ce)},yi={},Ii={},Tn=(z,H)=>{for(H===void 0&&Ve("ptr should not be undefined");z.baseClass;)H=z.upcast(H),z=z.baseClass;return H},ps=(z,H)=>(H=Tn(z,H),Ii[H]),vs=(z,H)=>{(!H.ptrType||!H.ptr)&&Lt("makeClassHandle requires ptr and ptrType");var re=!!H.smartPtrType,ce=!!H.smartPtr;return re!==ce&&Lt("Both smartPtrType and smartPtr must be specified"),H.count={value:1},Hi(Object.create(z,{$$:{value:H,writable:!0}}))};function gs(z){var H=this.getPointee(z);if(!H)return this.destructor(z),null;var re=ps(this.registeredClass,H);if(re!==void 0){if(re.$$.count.value===0)return re.$$.ptr=H,re.$$.smartPtr=z,re.clone();var ce=re.clone();return this.destructor(z),ce}function ge(){return this.isSmartPointer?vs(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:H,smartPtrType:this,smartPtr:z}):vs(this.registeredClass.instancePrototype,{ptrType:this,ptr:z})}var be=this.registeredClass.getActualType(H),Se=yi[be];if(!Se)return ge.call(this);var Ae;this.isConst?Ae=Se.constPointerType:Ae=Se.pointerType;var De=gi(H,this.registeredClass,Ae.registeredClass);return De===null?ge.call(this):this.isSmartPointer?vs(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:De,smartPtrType:this,smartPtr:z}):vs(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:De})}var Hi=z=>typeof FinalizationRegistry>"u"?(Hi=H=>H,z):(Pr=new FinalizationRegistry(H=>{vi(H.$$)}),Hi=H=>{var re=H.$$,ce=!!re.smartPtr;if(ce){var ge={$$:re};Pr.register(H,ge,H)}return H},tr=H=>Pr.unregister(H),Hi(z)),ys=[],ms=()=>{for(;ys.length;){var z=ys.pop();z.$$.deleteScheduled=!1,z.delete()}},qs,ho=()=>{Object.assign(Pn.prototype,{isAliasOf(z){if(!(this instanceof Pn)||!(z instanceof Pn))return!1;var H=this.$$.ptrType.registeredClass,re=this.$$.ptr;z.$$=z.$$;for(var ce=z.$$.ptrType.registeredClass,ge=z.$$.ptr;H.baseClass;)re=H.upcast(re),H=H.baseClass;for(;ce.baseClass;)ge=ce.upcast(ge),ce=ce.baseClass;return H===ce&&re===ge},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var z=Hi(Object.create(Object.getPrototypeOf(this),{$$:{value:Br(this.$$)}}));return z.$$.count.value+=1,z.$$.deleteScheduled=!1,z},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ve("Object already scheduled for deletion"),tr(this),vi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ve("Object already scheduled for deletion"),ys.push(this),ys.length===1&&qs&&qs(ms),this.$$.deleteScheduled=!0,this}})};function Pn(){}var Gi=(z,H)=>Object.defineProperty(H,"name",{value:z}),po=(z,H,re)=>{if(z[H].overloadTable===void 0){var ce=z[H];z[H]=function(){for(var ge=arguments.length,be=new Array(ge),Se=0;Se{i.hasOwnProperty(z)?((re===void 0||i[z].overloadTable!==void 0&&i[z].overloadTable[re]!==void 0)&&Ve(`Cannot register public name '${z}' twice`),po(i,z,z),i.hasOwnProperty(re)&&Ve(`Cannot register multiple overloads of a function with the same number of arguments (${re})!`),i[z].overloadTable[re]=H):(i[z]=H,re!==void 0&&(i[z].numArguments=re))},gf=48,il=57,k1=z=>{z=z.replace(/[^a-zA-Z0-9_]/g,"$");var H=z.charCodeAt(0);return H>=gf&&H<=il?`_${z}`:z};function yf(z,H,re,ce,ge,be,Se,Ae){this.name=z,this.constructor=H,this.instancePrototype=re,this.rawDestructor=ce,this.baseClass=ge,this.getActualType=be,this.upcast=Se,this.downcast=Ae,this.pureVirtualFunctions=[]}var mf=(z,H,re)=>{for(;H!==re;)H.upcast||Ve(`Expected null or instance of ${re.name}, got an instance of ${H.name}`),z=H.upcast(z),H=H.baseClass;return z};function bf(z,H){if(H===null)return this.isReference&&Ve(`null is not a valid ${this.name}`),0;H.$$||Ve(`Cannot pass "${le(H)}" as a ${this.name}`),H.$$.ptr||Ve(`Cannot pass deleted object as a pointer of type ${this.name}`);var re=H.$$.ptrType.registeredClass,ce=mf(H.$$.ptr,re,this.registeredClass);return ce}function i0(z,H){var re;if(H===null)return this.isReference&&Ve(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),z!==null&&z.push(this.rawDestructor,re),re):0;(!H||!H.$$)&&Ve(`Cannot pass "${le(H)}" as a ${this.name}`),H.$$.ptr||Ve(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&H.$$.ptrType.isConst&&Ve(`Cannot convert argument of type ${H.$$.smartPtrType?H.$$.smartPtrType.name:H.$$.ptrType.name} to parameter type ${this.name}`);var ce=H.$$.ptrType.registeredClass;if(re=mf(H.$$.ptr,ce,this.registeredClass),this.isSmartPointer)switch(H.$$.smartPtr===void 0&&Ve("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:H.$$.smartPtrType===this?re=H.$$.smartPtr:Ve(`Cannot convert argument of type ${H.$$.smartPtrType?H.$$.smartPtrType.name:H.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:re=H.$$.smartPtr;break;case 2:if(H.$$.smartPtrType===this)re=H.$$.smartPtr;else{var ge=H.clone();re=this.rawShare(re,vo.toHandle(()=>ge.delete())),z!==null&&z.push(this.rawDestructor,re)}break;default:Ve("Unsupporting sharing policy")}return re}function wf(z,H){if(H===null)return this.isReference&&Ve(`null is not a valid ${this.name}`),0;H.$$||Ve(`Cannot pass "${le(H)}" as a ${this.name}`),H.$$.ptr||Ve(`Cannot pass deleted object as a pointer of type ${this.name}`),H.$$.ptrType.isConst&&Ve(`Cannot convert argument of type ${H.$$.ptrType.name} to parameter type ${this.name}`);var re=H.$$.ptrType.registeredClass,ce=mf(H.$$.ptr,re,this.registeredClass);return ce}var R1=()=>{Object.assign(Zu.prototype,{getPointee(z){return this.rawGetPointee&&(z=this.rawGetPointee(z)),z},destructor(z){var H;(H=this.rawDestructor)===null||H===void 0||H.call(this,z)},argPackAdvance:ot,readValueFromPointer:sr,fromWireType:gs})};function Zu(z,H,re,ce,ge,be,Se,Ae,De,We,rt){this.name=z,this.registeredClass=H,this.isReference=re,this.isConst=ce,this.isSmartPointer=ge,this.pointeeType=be,this.sharingPolicy=Se,this.rawGetPointee=Ae,this.rawConstructor=De,this.rawShare=We,this.rawDestructor=rt,!ge&&H.baseClass===void 0?ce?(this.toWireType=bf,this.destructorFunction=null):(this.toWireType=wf,this.destructorFunction=null):this.toWireType=i0}var s0=(z,H,re)=>{i.hasOwnProperty(z)||Lt("Replacing nonexistent public symbol"),i[z].overloadTable!==void 0&&re!==void 0?i[z].overloadTable[re]=H:(i[z]=H,i[z].argCount=re)},M1=(z,H,re)=>{z=z.replace(/p/g,"i");var ce=i["dynCall_"+z];return ce(H,...re)},vc=[],O1,mr=z=>{var H=vc[z];return H||(z>=vc.length&&(vc.length=z+1),vc[z]=H=O1.get(z)),H},Xu=function(z,H){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(z.includes("j"))return M1(z,H,re);var ce=mr(H)(...re);return ce},sl=(z,H)=>function(){for(var re=arguments.length,ce=new Array(re),ge=0;ge{z=xt(z);function re(){return z.includes("j")?sl(z,H):mr(H)}var ce=re();return typeof ce!="function"&&Ve(`unknown function pointer with signature ${z}: ${H}`),ce},D1=(z,H)=>{var re=Gi(H,function(ce){this.name=H,this.message=ce;var ge=new Error(ce).stack;ge!==void 0&&(this.stack=this.toString()+` `+ge.replace(/^Error(:[^\n]*)?\n/,""))});return re.prototype=Object.create(z.prototype),re.prototype.constructor=re,re.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},re},o0,qo=z=>{var H=Fx(z),re=xt(H);return yc(H),re},xf=(z,H)=>{var re=[],ce={};function ge(be){if(!ce[be]&&!Dt[be]){if(Nt[be]){Nt[be].forEach(ge);return}re.push(be),ce[be]=!0}}throw H.forEach(ge),new o0(`${z}: `+re.map(qo).join([", "]))},N1=(z,H,re,ce,ge,be,Se,Ae,De,We,rt,Ft,Er)=>{rt=xt(rt),be=xn(ge,be),Ae&&(Ae=xn(Se,Ae)),We&&(We=xn(De,We)),Er=xn(Ft,Er);var Gt=k1(rt);Vs(Gt,function(){xf(`Cannot construct ${rt} due to unbound types`,[ce])}),kt([z,H,re],ce?[ce]:[],hr=>{hr=hr[0];var Qn,qn;ce?(Qn=hr.registeredClass,qn=Qn.instancePrototype):qn=Pn.prototype;var Mn=Gi(rt,function(){if(Object.getPrototypeOf(this)!==_f)throw new Bt("Use 'new' to construct "+rt);if(mi.constructor_body===void 0)throw new Bt(rt+" has no accessible constructor");for(var y0=arguments.length,mc=new Array(y0),Y1=0;Y1{for(var re=[],ce=0;ce>2]);return re};function B1(z){for(var H=1;H{var Se=ed(H,re);ge=xn(ce,ge),kt([],[z],Ae=>{Ae=Ae[0];var De=`constructor ${Ae.name}`;if(Ae.registeredClass.constructor_body===void 0&&(Ae.registeredClass.constructor_body=[]),Ae.registeredClass.constructor_body[H-1]!==void 0)throw new Bt(`Cannot register multiple constructors with identical number of parameters (${H-1}) for class '${Ae.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Ae.registeredClass.constructor_body[H-1]=()=>{xf(`Cannot construct ${Ae.name} due to unbound types`,Se)},kt([],Se,We=>(We.splice(1,0,null),Ae.registeredClass.constructor_body[H-1]=a0(De,We,null,ge,be),[])),[]})},c0=z=>{z=z.trim();const H=z.indexOf("(");return H!==-1?z.substr(0,H):z},L1=(z,H,re,ce,ge,be,Se,Ae,De,We)=>{var rt=ed(re,ce);H=xt(H),H=c0(H),be=xn(ge,be),kt([],[z],Ft=>{Ft=Ft[0];var Er=`${Ft.name}.${H}`;H.startsWith("@@")&&(H=Symbol[H.substring(2)]),Ae&&Ft.registeredClass.pureVirtualFunctions.push(H);function Gt(){xf(`Cannot call ${Er} due to unbound types`,rt)}var hr=Ft.registeredClass.instancePrototype,Qn=hr[H];return Qn===void 0||Qn.overloadTable===void 0&&Qn.className!==Ft.name&&Qn.argCount===re-2?(Gt.argCount=re-2,Gt.className=Ft.name,hr[H]=Gt):(po(hr,H,Er),hr[H].overloadTable[re-2]=Gt),kt([],rt,qn=>{var Mn=a0(Er,qn,Ft,be,Se);return hr[H].overloadTable===void 0?(Mn.argCount=re-2,hr[H]=Mn):hr[H].overloadTable[re-2]=Mn,[]}),[]})},ol=[],Vo=[],Ef=z=>{z>9&&--Vo[z+1]===0&&(Vo[z]=void 0,ol.push(z))},Sm=()=>Vo.length/2-5-ol.length,td=()=>{Vo.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=Sm},vo={toValue:z=>(z||Ve("Cannot use deleted val. handle = "+z),Vo[z]),toHandle:z=>{switch(z){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const H=ol.pop()||Vo.length;return Vo[H]=z,Vo[H+1]=1,H}}}},l0={name:"emscripten::val",fromWireType:z=>{var H=vo.toValue(z);return Ef(z),H},toWireType:(z,H)=>vo.toHandle(H),argPackAdvance:ot,readValueFromPointer:sr,destructorFunction:null},Cf=z=>Et(z,l0),F1=(z,H,re)=>{switch(H){case 1:return re?function(ce){return this.fromWireType(I[ce])}:function(ce){return this.fromWireType(U[ce])};case 2:return re?function(ce){return this.fromWireType(ie[ce>>1])}:function(ce){return this.fromWireType(ae[ce>>1])};case 4:return re?function(ce){return this.fromWireType(K[ce>>2])}:function(ce){return this.fromWireType(R[ce>>2])};default:throw new TypeError(`invalid integer width (${H}): ${z}`)}},_m=(z,H,re,ce)=>{H=xt(H);function ge(){}ge.values={},Et(z,{name:H,constructor:ge,fromWireType:function(be){return this.constructor.values[be]},toWireType:(be,Se)=>Se.value,argPackAdvance:ot,readValueFromPointer:F1(H,re,ce),destructorFunction:null}),Vs(H,ge)},Gr=(z,H)=>{var re=Dt[z];return re===void 0&&Ve(`${H} has unknown type ${qo(z)}`),re},Yr=(z,H,re)=>{var ce=Gr(z,"enum");H=xt(H);var ge=ce.constructor,be=Object.create(ce.constructor.prototype,{value:{value:re},constructor:{value:Gi(`${ce.name}_${H}`,function(){})}});ge.values[re]=be,ge[H]=be},le=z=>{if(z===null)return"null";var H=typeof z;return H==="object"||H==="array"||H==="function"?z.toString():""+z},Ee=(z,H)=>{switch(H){case 4:return function(re){return this.fromWireType(D[re>>2])};case 8:return function(re){return this.fromWireType(g[re>>3])};default:throw new TypeError(`invalid float width (${H}): ${z}`)}},Ue=(z,H,re)=>{H=xt(H),Et(z,{name:H,fromWireType:ce=>ce,toWireType:(ce,ge)=>ge,argPackAdvance:ot,readValueFromPointer:Ee(H,re),destructorFunction:null})},gt=(z,H,re,ce,ge,be,Se,Ae)=>{var De=ed(H,re);z=xt(z),z=c0(z),ge=xn(ce,ge),Vs(z,function(){xf(`Cannot call ${z} due to unbound types`,De)},H-1),kt([],De,We=>{var rt=[We[0],null].concat(We.slice(1));return s0(z,a0(z,rt,null,ge,be),H-1),[]})},tn=(z,H,re)=>{switch(H){case 1:return re?ce=>I[ce]:ce=>U[ce];case 2:return re?ce=>ie[ce>>1]:ce=>ae[ce>>1];case 4:return re?ce=>K[ce>>2]:ce=>R[ce>>2];default:throw new TypeError(`invalid integer width (${H}): ${z}`)}},rr=(z,H,re,ce,ge)=>{H=xt(H);var be=rt=>rt;if(ce===0){var Se=32-8*re;be=rt=>rt<>>Se}var Ae=H.includes("unsigned"),De=(rt,Ft)=>{},We;Ae?We=function(rt,Ft){return De(Ft,this.name),Ft>>>0}:We=function(rt,Ft){return De(Ft,this.name),Ft},Et(z,{name:H,fromWireType:be,toWireType:We,argPackAdvance:ot,readValueFromPointer:tn(H,re,ce!==0),destructorFunction:null})},hn=(z,H,re)=>{var ce=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ge=ce[H];function be(Se){var Ae=R[Se>>2],De=R[Se+4>>2];return new ge(I.buffer,De,Ae)}re=xt(re),Et(z,{name:re,fromWireType:be,argPackAdvance:ot,readValueFromPointer:be},{ignoreDuplicateRegistrations:!0})},$n=Object.assign({optional:!0},l0),Ar=(z,H)=>{Et(z,$n)},rn=(z,H,re,ce)=>{if(!(ce>0))return 0;for(var ge=re,be=re+ce-1,Se=0;Se=55296&&Ae<=57343){var De=z.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|De&1023}if(Ae<=127){if(re>=be)break;H[re++]=Ae}else if(Ae<=2047){if(re+1>=be)break;H[re++]=192|Ae>>6,H[re++]=128|Ae&63}else if(Ae<=65535){if(re+2>=be)break;H[re++]=224|Ae>>12,H[re++]=128|Ae>>6&63,H[re++]=128|Ae&63}else{if(re+3>=be)break;H[re++]=240|Ae>>18,H[re++]=128|Ae>>12&63,H[re++]=128|Ae>>6&63,H[re++]=128|Ae&63}}return H[re]=0,re-ge},pn=(z,H,re)=>rn(z,U,H,re),bs=z=>{for(var H=0,re=0;re=55296&&ce<=57343?(H+=4,++re):H+=3}return H},Rn=typeof TextDecoder<"u"?new TextDecoder:void 0,cn=function(z){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var ce=H+re,ge=H;z[ge]&&!(ge>=ce);)++ge;if(ge-H>16&&z.buffer&&Rn)return Rn.decode(z.subarray(H,ge));for(var be="";H>10,56320|We&1023)}}return be},Wi=(z,H)=>z?cn(U,z,H):"",zo=(z,H)=>{H=xt(H);var re=H==="std::string";Et(z,{name:H,fromWireType(ce){var ge=R[ce>>2],be=ce+4,Se;if(re)for(var Ae=be,De=0;De<=ge;++De){var We=be+De;if(De==ge||U[We]==0){var rt=We-Ae,Ft=Wi(Ae,rt);Se===void 0?Se=Ft:(Se+="\0",Se+=Ft),Ae=We+1}}else{for(var Er=new Array(ge),De=0;De>2]=be,re&&Se)pn(ge,De,be+1);else if(Se)for(var We=0;We255&&(yc(De),Ve("String has UTF-16 code units that do not fit in 8 bits")),U[De+We]=rt}else for(var We=0;We{for(var re=z,ce=re>>1,ge=ce+H/2;!(ce>=ge)&&ae[ce];)++ce;if(re=ce<<1,re-z>32&&zs)return zs.decode(U.subarray(z,re));for(var be="",Se=0;!(Se>=H/2);++Se){var Ae=ie[z+Se*2>>1];if(Ae==0)break;be+=String.fromCharCode(Ae)}return be},f0=(z,H,re)=>{var ce;if((ce=re)!==null&&ce!==void 0||(re=2147483647),re<2)return 0;re-=2;for(var ge=H,be=re>1]=Ae,H+=2}return ie[H>>1]=0,H-ge},Af=z=>z.length*2,fi=(z,H)=>{for(var re=0,ce="";!(re>=H/4);){var ge=K[z+re*4>>2];if(ge==0)break;if(++re,ge>=65536){var be=ge-65536;ce+=String.fromCharCode(55296|be>>10,56320|be&1023)}else ce+=String.fromCharCode(ge)}return ce},NC=(z,H,re)=>{var ce;if((ce=re)!==null&&ce!==void 0||(re=2147483647),re<4)return 0;for(var ge=H,be=ge+re-4,Se=0;Se=55296&&Ae<=57343){var De=z.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|De&1023}if(K[H>>2]=Ae,H+=4,H+4>be)break}return K[H>>2]=0,H-ge},go=z=>{for(var H=0,re=0;re=55296&&ce<=57343&&++re,H+=4}return H},BC=(z,H,re)=>{re=xt(re);var ce,ge,be,Se;H===2?(ce=Aa,ge=f0,Se=Af,be=Ae=>ae[Ae>>1]):H===4&&(ce=fi,ge=NC,Se=go,be=Ae=>R[Ae>>2]),Et(z,{name:re,fromWireType:Ae=>{for(var De=R[Ae>>2],We,rt=Ae+4,Ft=0;Ft<=De;++Ft){var Er=Ae+4+Ft*H;if(Ft==De||be(Er)==0){var Gt=Er-rt,hr=ce(rt,Gt);We===void 0?We=hr:(We+="\0",We+=hr),rt=Er+H}}return yc(Ae),We},toWireType:(Ae,De)=>{typeof De!="string"&&Ve(`Cannot pass non-string to C++ string type ${re}`);var We=Se(De),rt=h0(4+We+H);return R[rt>>2]=We/H,ge(De,rt+4,We+H),Ae!==null&&Ae.push(yc,rt),rt},argPackAdvance:ot,readValueFromPointer:sr,destructorFunction(Ae){yc(Ae)}})},Rx=(z,H,re,ce,ge,be)=>{wt[z]={name:xt(H),rawConstructor:xn(re,ce),rawDestructor:xn(ge,be),fields:[]}},al=(z,H,re,ce,ge,be,Se,Ae,De,We)=>{wt[z].fields.push({fieldName:xt(H),getterReturnType:re,getter:xn(ce,ge),getterContext:be,setterArgumentType:Se,setter:xn(Ae,De),setterContext:We})},j1=(z,H)=>{H=xt(H),Et(z,{isVoid:!0,name:H,argPackAdvance:0,fromWireType:()=>{},toWireType:(re,ce)=>{}})},Im=(z,H,re)=>U.copyWithin(z,H,H+re),ln=[],cl=(z,H,re,ce)=>(z=ln[z],H=vo.toValue(H),z(null,H,re,ce)),Tm={},LC=z=>{var H=Tm[z];return H===void 0?xt(z):H},U1=()=>{if(typeof globalThis=="object")return globalThis;function z(H){H.$$$embind_global$$$=H;var re=typeof $$$embind_global$$$=="object"&&H.$$$embind_global$$$==H;return re||delete H.$$$embind_global$$$,re}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&z(global)?$$$embind_global$$$=global:typeof self=="object"&&z(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},FC=z=>z===0?vo.toHandle(U1()):(z=LC(z),vo.toHandle(U1()[z])),jC=z=>{var H=ln.length;return ln.push(z),H},UC=(z,H)=>{for(var re=new Array(z),ce=0;ce>2],"parameter "+ce);return re},Mx=Reflect.construct,$1=(z,H,re)=>{var ce=[],ge=z.toWireType(ce,re);return ce.length&&(R[H>>2]=vo.toHandle(ce)),ge},rd=(z,H,re)=>{var ce=UC(z,H),ge=ce.shift();z--;var be=new Array(z),Se=(De,We,rt,Ft)=>{for(var Er=0,Gt=0;GtDe.name).join(", ")}) => ${ge.name}>`;return jC(Gi(Ae,Se))},$C=z=>{z>9&&(Vo[z+1]+=1)},Ox=z=>{var H=vo.toValue(z);fr(H),Ef(z)},Dx=(z,H)=>{z=Gr(z,"_emval_take_value");var re=z.readValueFromPointer(H);return vo.toHandle(re)},Pm=(z,H,re,ce)=>{var ge=new Date().getFullYear(),be=new Date(ge,0,1),Se=new Date(ge,6,1),Ae=be.getTimezoneOffset(),De=Se.getTimezoneOffset(),We=Math.max(Ae,De);R[z>>2]=We*60,K[H>>2]=+(Ae!=De);var rt=Gt=>{var hr=Gt>=0?"-":"+",Qn=Math.abs(Gt),qn=String(Math.floor(Qn/60)).padStart(2,"0"),Mn=String(Qn%60).padStart(2,"0");return`UTC${hr}${qn}${Mn}`},Ft=rt(Ae),Er=rt(De);De2147483648,Nx=(z,H)=>Math.ceil(z/H)*H,qC=z=>{var H=L.buffer,re=(z-H.byteLength+65535)/65536|0;try{return L.grow(re),b(),1}catch{}},Rm=z=>{var H=U.length;z>>>=0;var re=km();if(z>re)return!1;for(var ce=1;ce<=4;ce*=2){var ge=H*(1+.2/ce);ge=Math.min(ge,z+100663296);var be=Math.min(re,Nx(Math.max(z,ge),65536)),Se=qC(be);if(Se)return!0}return!1},u0={},VC=()=>h||"./this.program",nd=()=>{if(!nd.strings){var z=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",H={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:z,_:VC()};for(var re in u0)u0[re]===void 0?delete H[re]:H[re]=u0[re];var ce=[];for(var re in H)ce.push(`${re}=${H[re]}`);nd.strings=ce}return nd.strings},Hs=(z,H)=>{for(var re=0;re{var re=0;return nd().forEach((ce,ge)=>{var be=H+re;R[z+ge*4>>2]=be,Hs(ce,be),re+=ce.length+1}),0},d0=(z,H)=>{var re=nd();R[z>>2]=re.length;var ce=0;return re.forEach(ge=>ce+=ge.length+1),R[H>>2]=ce,0},Bx=z=>52;function Lx(z,H,re,ce,ge){return 70}var zC=[null,[],[]],HC=(z,H)=>{var re=zC[z];H===0||H===10?((z===1?A:k)(cn(re)),re.length=0):re.push(H)},GC=(z,H,re,ce)=>{for(var ge=0,be=0;be>2],Ae=R[H+4>>2];H+=8;for(var De=0;De>2]=ge,0},WC=z=>z;dt=i.InternalError=class extends Error{constructor(z){super(z),this.name="InternalError"}},zt(),Bt=i.BindingError=class extends Error{constructor(z){super(z),this.name="BindingError"}},ho(),R1(),o0=i.UnboundTypeError=D1(Error,"UnboundTypeError"),td();var KC={t:ct,x:He,a:bt,j:Ze,k:_t,O:Ct,q:It,ga:er,d:pt,ca:dr,va:ut,ba:Vt,pa:Ht,ta:N1,sa:gc,E:L1,oa:Cf,F:_m,n:Yr,W:Ue,X:gt,y:rr,u:hn,ua:Ar,V:zo,P:BC,L:Rx,wa:al,qa:j1,ja:Im,T:cl,xa:Ef,ya:FC,U:rd,Y:$C,Z:Ox,ra:Dx,da:Pm,ha:Rm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r(z)(H)}catch(ce){if(Re(re),ce!==ce+0)throw ce;nr(1,0)}}function QC(z,H,re,ce){var ge=$e();try{mr(z)(H,re,ce)}catch(be){if(Re(ge),be!==be+0)throw be;nr(1,0)}}function JC(z,H,re){var ce=$e();try{mr(z)(H,re)}catch(ge){if(Re(ce),ge!==ge+0)throw ge;nr(1,0)}}function ZC(z,H,re,ce){var ge=$e();try{return mr(z)(H,re,ce)}catch(be){if(Re(ge),be!==be+0)throw be;nr(1,0)}}function id(z,H,re,ce,ge){var be=$e();try{return mr(z)(H,re,ce,ge)}catch(Se){if(Re(be),Se!==Se+0)throw Se;nr(1,0)}}function we(z,H){var re=$e();try{mr(z)(H)}catch(ce){if(Re(re),ce!==ce+0)throw ce;nr(1,0)}}function Oe(z,H,re){var ce=$e();try{return mr(z)(H,re)}catch(ge){if(Re(ce),ge!==ge+0)throw ge;nr(1,0)}}function Pe(z){var H=$e();try{mr(z)()}catch(re){if(Re(H),re!==re+0)throw re;nr(1,0)}}function mt(z,H,re,ce,ge,be,Se,Ae,De,We,rt){var Ft=$e();try{mr(z)(H,re,ce,ge,be,Se,Ae,De,We,rt)}catch(Er){if(Re(Ft),Er!==Er+0)throw Er;nr(1,0)}}function Xt(z,H,re,ce,ge){var be=$e();try{mr(z)(H,re,ce,ge)}catch(Se){if(Re(be),Se!==Se+0)throw Se;nr(1,0)}}function jr(z,H,re,ce,ge){var be=$e();try{return mr(z)(H,re,ce,ge)}catch(Se){if(Re(be),Se!==Se+0)throw Se;nr(1,0)}}function Yn(z,H,re,ce,ge,be){var Se=$e();try{return mr(z)(H,re,ce,ge,be)}catch(Ae){if(Re(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function nn(z,H,re,ce,ge,be){var Se=$e();try{mr(z)(H,re,ce,ge,be)}catch(Ae){if(Re(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function Nm(z,H,re,ce,ge,be,Se){var Ae=$e();try{return mr(z)(H,re,ce,ge,be,Se)}catch(De){if(Re(Ae),De!==De+0)throw De;nr(1,0)}}function XC(z,H,re,ce,ge,be,Se,Ae){var De=$e();try{mr(z)(H,re,ce,ge,be,Se,Ae)}catch(We){if(Re(De),We!==We+0)throw We;nr(1,0)}}function mo(z,H,re,ce,ge,be,Se,Ae,De){var We=$e();try{mr(z)(H,re,ce,ge,be,Se,Ae,De)}catch(rt){if(Re(We),rt!==rt+0)throw rt;nr(1,0)}}function q1(z){var H=$e();try{return mr(z)()}catch(re){if(Re(H),re!==re+0)throw re;nr(1,0)}}function eA(z,H,re,ce,ge,be,Se,Ae,De){var We=$e();try{return mr(z)(H,re,ce,ge,be,Se,Ae,De)}catch(rt){if(Re(We),rt!==rt+0)throw rt;nr(1,0)}}function sd(z,H,re,ce,ge,be,Se){var Ae=$e();try{return mr(z)(H,re,ce,ge,be,Se)}catch(De){if(Re(Ae),De!==De+0)throw De;nr(1,0)}}function V1(z,H,re,ce){var ge=$e();try{return mr(z)(H,re,ce)}catch(be){if(Re(ge),be!==be+0)throw be;nr(1,0)}}function z1(z,H,re,ce){var ge=$e();try{return mr(z)(H,re,ce)}catch(be){if(Re(ge),be!==be+0)throw be;nr(1,0)}}function Wr(z,H,re,ce,ge,be,Se,Ae){var De=$e();try{mr(z)(H,re,ce,ge,be,Se,Ae)}catch(We){if(Re(De),We!==We+0)throw We;nr(1,0)}}function tA(z,H,re,ce,ge,be){var Se=$e();try{return mr(z)(H,re,ce,ge,be)}catch(Ae){if(Re(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function Vx(z,H,re,ce,ge,be,Se,Ae,De,We){var rt=$e();try{return mr(z)(H,re,ce,ge,be,Se,Ae,De,We)}catch(Ft){if(Re(rt),Ft!==Ft+0)throw Ft;nr(1,0)}}function H1(z,H,re){var ce=$e();try{return mr(z)(H,re)}catch(ge){if(Re(ce),ge!==ge+0)throw ge;nr(1,0)}}function rA(z,H,re,ce,ge){var be=$e();try{return mr(z)(H,re,ce,ge)}catch(Se){if(Re(be),Se!==Se+0)throw Se;nr(1,0)}}function nA(z,H,re,ce,ge,be,Se,Ae,De,We){var rt=$e();try{mr(z)(H,re,ce,ge,be,Se,Ae,De,We)}catch(Ft){if(Re(rt),Ft!==Ft+0)throw Ft;nr(1,0)}}function iA(z,H,re,ce,ge,be,Se,Ae){var De=$e();try{return mr(z)(H,re,ce,ge,be,Se,Ae)}catch(We){if(Re(De),We!==We+0)throw We;nr(1,0)}}function G1(z,H,re,ce,ge,be,Se){var Ae=$e();try{mr(z)(H,re,ce,ge,be,Se)}catch(De){if(Re(Ae),De!==De+0)throw De;nr(1,0)}}function ll(z,H,re,ce){var ge=$e();try{return mr(z)(H,re,ce)}catch(be){if(Re(ge),be!==be+0)throw be;nr(1,0)}}function W1(z,H,re,ce,ge,be,Se,Ae,De,We,rt,Ft){var Er=$e();try{return mr(z)(H,re,ce,ge,be,Se,Ae,De,We,rt,Ft)}catch(Gt){if(Re(Er),Gt!==Gt+0)throw Gt;nr(1,0)}}function zx(z,H,re,ce,ge,be,Se,Ae,De,We,rt,Ft,Er,Gt,hr,Qn){var qn=$e();try{mr(z)(H,re,ce,ge,be,Se,Ae,De,We,rt,Ft,Er,Gt,hr,Qn)}catch(Mn){if(Re(qn),Mn!==Mn+0)throw Mn;nr(1,0)}}function K1(z,H,re,ce){var ge=$e();try{return Dm(z,H,re,ce)}catch(be){if(Re(ge),be!==be+0)throw be;nr(1,0)}}function Hx(z,H,re,ce,ge){var be=$e();try{return qx(z,H,re,ce,ge)}catch(Se){if(Re(be),Se!==Se+0)throw Se;nr(1,0)}}var v0,g0;X=function z(){v0||Bm(),v0||(X=z)};function Bm(){if($>0||!g0&&(g0=1,C(),$>0))return;function z(){var H;v0||(v0=1,i.calledRun=1,!V&&(w(),s(i),(H=i.onRuntimeInitialized)===null||H===void 0||H.call(i),P()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),z()},1)):z()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Bm(),n=a,n}})();function uHe(t){return FO(jO,t)}async function dHe(t,e){return lHe(jO,t,e)}async function hHe(t,e){return fHe(jO,t,e)}const Zie=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],pHe=[...Zie,["unknown"]].map(t=>t[0]),GT=new Map(Zie);function vHe(t){for(const[e,r]of GT)if(t===r)return e;return"unknown"}function gHe(t){if(Xie(t))return{width:t.naturalWidth,height:t.naturalHeight};if(ese(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(tse(t))return{width:t.videoWidth,height:t.videoHeight};if(nse(t))return{width:t.width,height:t.height};if(sse(t))return{width:t.displayWidth,height:t.displayHeight};if(rse(t))return{width:t.width,height:t.height};if(ise(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Xie(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLImageElement)}catch{return!1}}function ese(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.SVGImageElement)}catch{return!1}}function tse(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLVideoElement)}catch{return!1}}function rse(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLCanvasElement)}catch{return!1}}function nse(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function ise(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function sse(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function ose(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function yHe(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function mHe(t,e){try{const r=new OffscreenCanvas(t,e);if(r.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return r;throw void 0}catch{const r=document.createElement("canvas");return r.width=t,r.height=e,r}}async function ase(t){if(Xie(t)&&!await EHe(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ese(t)&&!await CHe(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(sse(t)&&AHe(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(tse(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(nse(t)&&_He(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:r}=gHe(t);if(e===0||r===0)return null;const n=mHe(e,r).getContext("2d");n.drawImage(t,0,0);try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function bHe(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let r="";try{r=URL.createObjectURL(t),e.src=r,await e.decode()}finally{URL.revokeObjectURL(r)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ase(e)}function wHe(t){const{width:e,height:r}=t;if(e===0||r===0)return null;const n=t.getContext("2d");try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xHe(t){if(ose(t))return await bHe(t);if(yHe(t)){if(SHe(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return rse(t)||ise(t)?wHe(t):await ase(t)}async function EHe(t){try{return await t.decode(),!0}catch{return!1}}async function CHe(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function AHe(t){return t.format===null}function SHe(t){return t.data.buffer.byteLength===0}function _He(t){return t.width===0&&t.height===0}function KV(t,e){return IHe(t)?new DOMException(`${e}: ${t.message}`,t.name):THe(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function IHe(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function THe(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var M5;class WT extends EventTarget{constructor(e={}){var r;super(),Zze(this,M5);try{const n=(r=e==null?void 0:e.formats)==null?void 0:r.filter(i=>i!=="unknown");if((n==null?void 0:n.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const i of n??[])if(!GT.has(i))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${i}' is not a valid enum value of type BarcodeFormat.`);Xze(this,M5,n??[]),uHe().then(i=>{this.dispatchEvent(new CustomEvent("load",{detail:i}))}).catch(i=>{this.dispatchEvent(new CustomEvent("error",{detail:i}))})}catch(n){throw KV(n,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return pHe.filter(e=>e!=="unknown")}async detect(e){try{const r=await xHe(e);if(r===null)return[];let n;const i={tryHarder:!0,returnCodabarStartEnd:!0,formats:Jze(this,M5).map(s=>GT.get(s))};try{ose(r)?n=await dHe(r,i):n=await hHe(r,i)}catch(s){throw console.error(s),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return n.map(s=>{const{topLeft:{x:o,y:a},topRight:{x:c,y:l},bottomLeft:{x:f,y:u},bottomRight:{x:h,y:v}}=s.position,y=Math.min(o,c,f,h),m=Math.min(a,l,u,v),S=Math.max(o,c,f,h),x=Math.max(a,l,u,v);return{boundingBox:new DOMRectReadOnly(y,m,S-y,x-m),rawValue:s.text,format:vHe(s.format),cornerPoints:[{x:o,y:a},{x:c,y:l},{x:h,y:v},{x:f,y:u}]}})}catch(r){throw KV(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}M5=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=WT);function PHe(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function kHe(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),qt.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function RHe(t){const{scanning:e,startScanning:r,stopScanning:n}=t,[i,s]=T.useState(!1);function o(){s(!0),e?n():r(),setTimeout(()=>s(!1),1e3)}return qt.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:i?"default":"pointer"}},e?qt.createElement(PHe,{disabled:i,onClick:o}):qt.createElement(kHe,{disabled:i,onClick:o}))}function MHe(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function OHe(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function DHe(t){const{status:e,scanning:r,torchToggle:n}=t;function i(s){n(s)}return r&&n?qt.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?qt.createElement(OHe,{onClick:()=>i(!1)}):qt.createElement(MHe,{onClick:()=>i(!0)})):null}function NHe(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function BHe(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function LHe(t){const{scanning:e,capabilities:r,onZoom:n,value:i}=t;if(!e||!n)return null;const s=(r.max-r.min)/3;return qt.createElement(T.Fragment,null,qt.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(BHe,{disabled:i<=r.min,onClick:function(){n(Math.max(i-s,r.min))}})),qt.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(NHe,{disabled:i>=r.max,onClick:function(){n(Math.min(i+s,r.max))}})))}function FHe(t){const{scanning:e,loading:r,capabilities:n,border:i=35,onOff:s,torch:o,zoom:a,startScanning:c,stopScanning:l}=t,f="rgba(255, 0, 0, 0.5)";return qt.createElement("div",{style:{position:"relative"}},qt.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${i>=35?i:35}px solid rgba(0, 0, 0, 0.2)`}},r&&qt.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",qt.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),qt.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:f,strokeWidth:3})),s&&qt.createElement(RHe,{scanning:e,startScanning:c,stopScanning:l}),o&&n.torch&&qt.createElement(DHe,{scanning:e,status:o.status,torchToggle:o.toggle}),a&&n.zoom&&qt.createElement(LHe,{scanning:e,capabilities:n.zoom,value:a.value,onZoom:a.onChange}))}const jHe={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},UHe={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},$He={width:"100%",height:"100%",position:"relative"},qHe={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var VHe=function(t){let e,r=!1;return(...n)=>(r||(e=t(n),r=!0),e)}(()=>{const t=Eze(window);switch(t.browser){case"chrome":Oze(window,t);break;case"firefox":Lze(window,t);break;case"safari":$ze(window,t);break;default:throw new Error("Unsupported browser")}});const zHe="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRg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VD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";var Wb=t=>t instanceof Date,cse=t=>t==null;const lse=t=>typeof t=="object";var YV=t=>!cse(t)&&!Array.isArray(t)&&lse(t)&&!Wb(t),QV=t=>cse(t)||!lse(t);function fse(t,e){if(QV(t)||QV(e))return t===e;if(Wb(t)&&Wb(e))return t.getTime()===e.getTime();const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r){const s=t[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=e[i];if(Wb(s)&&Wb(o)||YV(s)&&YV(o)||Array.isArray(s)&&Array.isArray(o)?!fse(s,o):s!==o)return!1}}return!0}function _6(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function HHe(t){var e;const{onScan:r,constraints:n,formats:i=["qr_code"],paused:s=!1,components:o,children:a,styles:c,classNames:l,allowMultiple:f,scanDelay:u,onError:h}=t,v=T.useRef(null),y=T.useRef(null),m=T.useRef(null),S=T.useMemo(()=>({...jHe,...n}),[n]),x=T.useMemo(()=>({...UHe,...o}),[o]),[A,k]=T.useState(!1),[N,L]=T.useState(!0),[V,I]=T.useState(S),U=function(){const g=T.useRef(Promise.resolve({type:"stop",data:{}})),b=T.useRef(null),M=T.useRef(null),[B,E]=T.useState({}),[C,w]=T.useState({}),P=T.useCallback(async(X,W)=>{var Z,ee,F;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Z=navigator==null?void 0:navigator.mediaDevices)===null||Z===void 0?void 0:Z.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");VHe();const te=await navigator.mediaDevices.getUserMedia({audio:!1,video:W});X.srcObject!==void 0?X.srcObject=te:X.mozSrcObject!==void 0?X.mozSrcObject=te:window.URL.createObjectURL?X.src=window.URL.createObjectURL(te):window.webkitURL?X.src=window.webkitURL.createObjectURL(te):X.src=te.id,await Promise.race([X.play(),new Promise(xe=>setTimeout(xe,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(xe=>setTimeout(xe,500));const[fe]=te.getVideoTracks();return w(fe.getSettings()),E((F=(ee=fe==null?void 0:fe.getCapabilities)===null||ee===void 0?void 0:ee.call(fe))!==null&&F!==void 0?F:{}),b.current=te,M.current=fe,{type:"start",data:{videoEl:X,stream:te,constraints:W}}},[]),O=T.useCallback(async(X,W)=>{X.src="",X.srcObject=null,X.load();for(const Z of W.getTracks())W.removeTrack(Z),Z.stop();return b.current=null,M.current=null,w({}),{type:"stop",data:{}}},[]),G=T.useCallback(async(X,{constraints:W,restart:Z=!1})=>{if(g.current=g.current.then(ee=>{if(ee.type==="start"){const{data:{videoEl:F,stream:te,constraints:fe}}=ee;return Z||X!==F||W!==fe?O(F,te).then(()=>P(X,W)):ee}return P(X,W)}),(await g.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[P,O]),oe=T.useCallback(async()=>{if(g.current=g.current.then(X=>{if(X.type==="stop")return X;const{data:{videoEl:W,stream:Z}}=X;return O(W,Z)}),(await g.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[O]),$=T.useCallback(async X=>{const W=M.current;if(!W)throw new Error("No active video track found.");{X.advanced&&X.advanced[0].zoom&&W.getCapabilities().torch&&await W.applyConstraints({advanced:[{torch:!1}]}),await W.applyConstraints(X);const Z=W.getCapabilities(),ee=W.getSettings();E(Z),w(ee)}},[]);return T.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:B,settings:C,startCamera:G,stopCamera:oe,updateConstraints:$}}(),{startScanning:ie,stopScanning:ae}=function(g){const{videoElementRef:b,onScan:M,onFound:B,retryDelay:E=100,scanDelay:C=0,formats:w=[],audio:P=!0,allowMultiple:O=!1}=g,G=T.useRef(new WT({formats:w})),oe=T.useRef(null),$=T.useRef(null);T.useEffect(()=>{G.current=new WT({formats:w})},[w]),T.useEffect(()=>{typeof window<"u"&&P&&(oe.current=new Audio(zHe))},[P]);const X=T.useCallback(W=>async Z=>{if(b.current!==null&&b.current.readyState>1){const{lastScan:ee,contentBefore:F,lastScanHadContent:te}=W;if(Z-ee!F.includes(ze.rawValue)),_e=fe.length>0;let Me=W.lastOnScan;(xe||O&&_e&&Z-Me>=C)&&(P&&oe.current&&oe.current.paused&&oe.current.play().catch(ze=>console.error("Error playing the sound",ze)),Me=Z,M(fe)),_e&&B(fe),!_e&&te&&B(fe);const Ke={lastScan:Z,lastOnScan:Me,lastScanHadContent:_e,contentBefore:xe?fe.map(ze=>ze.rawValue):F};$.current=window.requestAnimationFrame(X(Ke))}}},[b.current,M,B,E]);return{startScanning:T.useCallback(()=>{const W=performance.now(),Z={lastScan:W,lastOnScan:W,contentBefore:[],lastScanHadContent:!1};$.current=window.requestAnimationFrame(X(Z))},[X]),stopScanning:T.useCallback(()=>{$.current!==null&&(window.cancelAnimationFrame($.current),$.current=null)},[])}}({videoElementRef:v,onScan:r,onFound:g=>function(b,M,B,E){const C=B;if(C==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=M;if(w==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(b.length===0||E===void 0)_6(C);else{const P=w.offsetWidth,O=w.offsetHeight,G=w.videoWidth,oe=w.videoHeight,$=Math.max(P/G,O/oe),X=G*$,W=oe*$,Z=X/G,ee=W/oe,F=(P-X)/2,te=(O-W)/2,fe=({x:Ke,y:ze})=>({x:Math.floor(Ke*Z),y:Math.floor(ze*ee)}),xe=({x:Ke,y:ze})=>({x:Math.floor(Ke+F),y:Math.floor(ze+te)}),_e=b.map(Ke=>{const{boundingBox:ze,cornerPoints:Je}=Ke,{x:Xe,y:lt}=xe(fe({x:ze.x,y:ze.y})),{x:Re,y:$e}=fe({x:ze.width,y:ze.height});return{...Ke,cornerPoints:Je.map(st=>xe(fe(st))),boundingBox:DOMRectReadOnly.fromRect({x:Xe,y:lt,width:Re,height:$e})}});C.width=w.offsetWidth,C.height=w.offsetHeight;const Me=C.getContext("2d");if(Me===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");E(_e,Me)}}(g,v.current,m.current,x.tracker),formats:i,audio:x.audio,allowMultiple:f,retryDelay:x.tracker===void 0?500:10,scanDelay:u});T.useEffect(()=>(k(!0),()=>{k(!1)}),[]),T.useEffect(()=>{A&&(ae(),ie())},[o==null?void 0:o.tracker]),T.useEffect(()=>{if(!fse(S,V)){const g=S;n!=null&&n.deviceId&&delete g.facingMode,I(g)}},[n]);const K=T.useMemo(()=>({constraints:V,shouldStream:A&&!s}),[V,A,s]),R=async()=>{const g=v.current;if(g==null)throw new Error("Video should be defined when component is mounted.");const b=y.current;if(b==null)throw new Error("Canvas should be defined when component is mounted.");const M=b.getContext("2d");if(M==null)throw new Error("Canvas should be defined when component is mounted.");if(K.shouldStream){await U.stopCamera(),L(!1);try{await U.startCamera(g,K),g?L(!0):await U.stopCamera()}catch(B){h==null||h(B),console.error("error",B)}}else b.width=g.videoWidth,b.height=g.videoHeight,M.drawImage(g,0,0,g.videoWidth,g.videoHeight),await U.stopCamera(),L(!1)};T.useEffect(()=>{(async()=>await R())()},[K]);const D=T.useMemo(()=>K.shouldStream&&N,[K.shouldStream,N]);return T.useEffect(()=>{if(D){if(y.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(_6(y.current),m.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(_6(m.current),v.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");ie()}},[D]),qt.createElement("div",{style:{...$He,...c==null?void 0:c.container},className:l==null?void 0:l.container},qt.createElement("video",{ref:v,style:{...qHe,...c==null?void 0:c.video,visibility:s?"hidden":"visible"},className:l==null?void 0:l.video,autoPlay:!0,muted:!0,playsInline:!0}),qt.createElement("canvas",{ref:y,style:{display:s?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),qt.createElement("canvas",{ref:m,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),qt.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},x.finder&&qt.createElement(FHe,{scanning:N,capabilities:U.capabilities,loading:!1,onOff:x.onOff,zoom:x.zoom&&U.settings.zoom?{value:U.settings.zoom,onChange:async g=>{const b={...V,advanced:[{zoom:g}]};await U.updateConstraints(b)}}:void 0,torch:x.torch?{status:(e=U.settings.torch)!==null&&e!==void 0&&e,toggle:async g=>{const b={...V,advanced:[{torch:g}]};await U.updateConstraints(b)}}:void 0,startScanning:async()=>await R(),stopScanning:async()=>{await U.stopCamera(),_6(m.current),L(!1)},border:c==null?void 0:c.finderBorder}),a))}function GHe({onQrUri:t}){const e=Hu("isMobile"),r=ir(kx),[n,i]=T.useState(""),s=async()=>{if(n){console.log(n);try{await r.pair(n)}catch(o){console.error("Error pairing with dapp",o),t(!1);return}}t(!0)};return j.jsxs(ve,{flexDirection:"column",children:[j.jsxs(ve,{flexDirection:"column",justifyContent:"space-between",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Connect a Dapp"}),j.jsx(ve,{alignSelf:"center",style:{height:"280px",width:"280px"},children:j.jsx(HHe,{onScan:o=>{o[0].rawValue&&i(o[0].rawValue)},styles:{video:{transform:e?"scaleX(-1)":"scaleX(1)",borderRadius:"10px"}}})}),j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Paste connection string"}),j.jsx(Sn,{name:"signClientUri",value:n,onChange:o=>i(o.target.value)})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{size:"md",shape:"square",label:"Cancel",onClick:()=>{t(!1)}}),j.jsx(Kt,{variant:"primary",size:"md",shape:"square",label:"Connect Dapp",disabled:!n,onClick:()=>{n&&s()}})]})]})}const WHe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Link-Connection'%3e%3cg%20id='Vector'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.65098%205.00098L5.65098%2012.5868C5.65098%2012.8986%206.02798%2013.0547%206.24846%2012.8343L12.8342%206.24846C13.8737%205.20902%2015.651%205.9452%2015.651%207.41519V15.001H14.351V7.41519C14.351%207.10337%2013.974%206.94722%2013.7535%207.1677L7.1677%2013.7535C6.12826%2014.7929%204.35098%2014.0568%204.35098%2012.5868L4.35098%205.00098H5.65098Z'%20fill='white'/%3e%3cpath%20d='M5.00065%202.03125C3.3607%202.03125%202.03125%203.3607%202.03125%205.00065C2.03125%206.64061%203.3607%207.97005%205.00065%207.97005C6.64061%207.97005%207.97005%206.64061%207.97005%205.00065C7.97005%203.3607%206.64061%202.03125%205.00065%202.03125Z'%20fill='white'/%3e%3cpath%20d='M14.9997%2012.0312C13.3597%2012.0312%2012.0303%2013.3607%2012.0303%2015.0007C12.0303%2016.6406%2013.3597%2017.9701%2014.9997%2017.9701C16.6396%2017.9701%2017.9691%2016.6406%2017.9691%2015.0007C17.9691%2013.3607%2016.6396%2012.0312%2014.9997%2012.0312Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",use="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Warning'%3e%3cpath%20id='Subtract'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18%2017.4267L9.99998%203.57031L2%2017.4267H18ZM10.6778%2013.0944V7.32511H9.21569V13.0944H10.6778ZM9.94669%2016.1808C10.5481%2016.1808%2011.0356%2015.6933%2011.0356%2015.0919C11.0356%2014.4905%2010.5481%2014.003%209.94669%2014.003C9.3453%2014.003%208.85777%2014.4905%208.85777%2015.0919C8.85777%2015.6933%209.3453%2016.1808%209.94669%2016.1808Z'%20fill='%236D6D6D'/%3e%3c/g%3e%3c/svg%3e";function KHe(){const t=ir(Rr),e=Hu("isMobile"),r=ir(kx),n=Fr(r.allSessions),[i,s]=T.useState(!1),[o,a]=T.useState(!1),c=Fr(t.selectedExternalProvider),l=async()=>{a(!0)};return j.jsxs(ve,{flexDirection:"column",children:[j.jsxs(ve,{justifyContent:"space-between",alignItems:"center",gap:"2",children:[j.jsxs(ve,{alignItems:"center",gap:"2",children:[j.jsx(Ln,{src:WHe,width:"5",height:"5"}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Connected Dapps"})]}),j.jsx(Kt,{size:"sm",leftIcon:$w,label:"Connect",shape:"square",disabled:(c==null?void 0:c.info.name)==="WalletConnect",onClick:()=>s(!0)})]}),j.jsx(pi,{marginY:"2"}),n.length>0?j.jsx(xze,{sessionList:n}):j.jsx(vn,{flexDirection:"column",children:(c==null?void 0:c.info.name)==="WalletConnect"?j.jsxs(ve,{flexDirection:"column",alignItems:"center",gap:"4",children:[j.jsx(Ln,{src:use,color:"text50",width:"8",height:"8"}),j.jsx(Te,{textAlign:"center",variant:"normal",color:"text50",padding:"4",children:"To connect to Dapps, switch from WalletConnect to a different wallet as your External Wallet connection method."})]}):j.jsx(Te,{textAlign:"center",variant:"normal",color:"text50",padding:"4",children:"Connect a Dapp with WalletConnect to sign actions"})}),i&&j.jsx(oa,{size:"md",contentProps:{style:{width:e?"100%":"500px"}},onClose:()=>s(!1),children:j.jsx(GHe,{onQrUri:f=>{f&&l(),s(!1)}})}),o&&j.jsx(oa,{size:"md",onClose:()=>a(!1),children:j.jsx(wze,{onClose:()=>a(!1)})})]})}const YHe="data:image/svg+xml,%3csvg%20fill='none'%20height='400'%20viewBox='0%200%20400%20400'%20width='400'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cclipPath%20id='a'%3e%3cpath%20d='m0%200h400v400h-400z'/%3e%3c/clipPath%3e%3cg%20clip-path='url(%23a)'%3e%3ccircle%20cx='200'%20cy='200'%20fill='%233396ff'%20r='199.5'%20stroke='%2366b1ff'/%3e%3cpath%20d='m122.519%20148.965c42.791-41.729%20112.171-41.729%20154.962%200l5.15%205.022c2.14%202.086%202.14%205.469%200%207.555l-17.617%2017.18c-1.07%201.043-2.804%201.043-3.874%200l-7.087-6.911c-29.853-29.111-78.253-29.111-108.106%200l-7.59%207.401c-1.07%201.043-2.804%201.043-3.874%200l-17.617-17.18c-2.14-2.086-2.14-5.469%200-7.555zm191.397%2035.529%2015.679%2015.29c2.14%202.086%202.14%205.469%200%207.555l-70.7%2068.944c-2.139%202.087-5.608%202.087-7.748%200l-50.178-48.931c-.535-.522-1.402-.522-1.937%200l-50.178%2048.931c-2.139%202.087-5.608%202.087-7.748%200l-70.7015-68.945c-2.1396-2.086-2.1396-5.469%200-7.555l15.6795-15.29c2.1396-2.086%205.6085-2.086%207.7481%200l50.1789%2048.932c.535.522%201.402.522%201.937%200l50.177-48.932c2.139-2.087%205.608-2.087%207.748%200l50.179%2048.932c.535.522%201.402.522%201.937%200l50.179-48.931c2.139-2.087%205.608-2.087%207.748%200z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e";function QHe({onSelectProvider:t}){const e=ir(kx),r=Lie(),[n,i]=T.useState(!1),s=e.allSessions.get().length>0,o=async()=>{await e.disconnectAllSessions(),t();const a=await Bie(!0);await a.connect(),t(Nie(a))};return j.jsx(ve,{children:n?j.jsxs(ve,{flexDirection:"column",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Use WalletConnect for External Wallet?"}),j.jsxs(vn,{alignItems:"center",gap:"3",style:{background:"rgba(176, 126, 30, 0.3)"},children:[j.jsxs(ve,{flexDirection:"column",gap:"2",children:[j.jsx(Te,{variant:"medium",fontWeight:"bold",color:"text100",children:"Attention"}),s?j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"If you connect your external wallet using WalletConnect, you'll lose all Dapps connections you already made using WalletConnect."}):j.jsxs(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:["If you connect your external wallet using WalletConnect, you won't be able to connect to any other Dapps during this session. ",j.jsx("br",{})," ",j.jsx("br",{}),"If you need to connect Dapps, please consider using a different external wallet instead."]})]}),j.jsx(Ln,{src:use,width:"8",height:"8"})]}),j.jsxs(ve,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"6",children:[j.jsx(Kt,{width:"full",label:"Cancel",shape:"square",onClick:()=>t()}),j.jsx(Kt,{width:"full",variant:"primary",label:"Confirm",shape:"square",onClick:()=>o(),"data-id":"signingContinue"})]})]}):j.jsxs(ve,{flexDirection:"column",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Connect external wallet"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"You need an external wallet to relay transactions"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsx(vn,{flexDirection:"row",justifyContent:"center",gap:"2",cursor:"pointer",borderRadius:"circle",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>{i(!0)},children:j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Ln,{src:YHe,width:"5",height:"auto"}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Wallet Connect"})]})}),r.map(a=>j.jsx(vn,{flexDirection:"row",justifyContent:"center",gap:"2",cursor:"pointer",borderRadius:"circle",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>t(a),children:j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(Ln,{src:a.info.icon,width:"5",height:"auto"}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function JHe(){const t=ir(Rr),e=Fr(t.selectedExternalProvider),r=Fr(t.selectedExternalWalletAddress),[n,i]=T.useState(!1),[s,o]=T.useState(!1);T.useEffect(()=>{s&&setTimeout(()=>{o(!1)},2e3)},[s]);const a=async()=>{e===void 0&&i(!0)},c=async()=>{t.setExternalProvider(void 0);const f=e;(f==null?void 0:f.info.name)==="WalletConnect"&&f.provider.disconnect()},l=()=>{navigator.clipboard.writeText(r),o(!0)};return j.jsxs(ve,{flexDirection:"column",width:"full",children:[j.jsxs(ve,{justifyContent:"space-between",alignItems:"center",gap:"2",children:[j.jsxs(ve,{alignItems:"center",gap:"2",children:[j.jsx(oye,{color:"text100",width:"5",height:"5"}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"External Wallet"})]}),!e&&j.jsx(Kt,{size:"sm",leftIcon:$w,label:"Connect Wallet",variant:"primary",shape:"square",onClick:()=>a()})]}),j.jsx(pi,{marginY:"2"}),j.jsx(vn,{flexDirection:"column",children:e?j.jsxs(ve,{justifyContent:"space-between",alignItems:"center",children:[j.jsxs(ve,{flexDirection:"row",gap:"4",children:[j.jsx(DC,{background:"text80",src:e.info.icon}),j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text80",children:e.info.name}),j.jsxs(ve,{gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",width:"full",children:qW(r||"",10,4)}),s?j.jsx(qw,{color:"borderNormal",cursor:"pointer",onClick:()=>l()}):j.jsx(XW,{color:"borderNormal",cursor:"pointer",onClick:()=>l()})]})]})]}),j.jsx(d1,{icon:j.jsx(Pu,{color:"text100"}),onClick:()=>c()})]}):j.jsx(Te,{textAlign:"center",variant:"normal",color:"text50",padding:"4",children:"Connect an external wallet to relay transactions"})}),n&&j.jsx(oa,{size:"sm",onClose:()=>i(!1),children:j.jsx(QHe,{onSelectProvider:async f=>{var u,h;f&&(((u=t.selectedExternalProvider.get())==null?void 0:u.info.name)==="WalletConnect"&&await((h=t.selectedExternalProvider.get())==null?void 0:h.provider).disconnect(),t.setExternalProvider(f)),i(!1)}})})]})}function UO({chainId:t,paddingTop:e="0",paddingBottom:r="1"}){return j.jsx(ve,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:j.jsx(Te,{variant:"xsmall",color:"text80",style:{whiteSpace:"nowrap",maxWidth:"100px",overflow:"hidden",textOverflow:"ellipsis"},children:um(t)})})}function w7({symbol:t,chainId:e,to:r,amount:n}){return j.jsxs(ve,{flexDirection:"column",width:"full",gap:"5",paddingTop:"7",children:[j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text80",children:"Pending transactions"}),j.jsxs(ve,{background:"backgroundSecondary",borderRadius:"sm",alignItems:"center",padding:"4",gap:"5",children:[j.jsx(Jp,{size:"lg"}),j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"1",children:[j.jsxs(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:["Sending ",n," ",t," on"]}),j.jsx(UO,{chainId:e,paddingTop:"0",paddingBottom:"1"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"to"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",style:{fontFamily:"monospace"},children:r})]}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"Your external wallet will prompt you to confirm the transaction"})]})]})]})}function ZHe({...t}){var s,o;const e=ir(Rr),r=Fr(e.isSendingTokenTransaction),n=Fr(e.isSendingCollectibleTransaction),i=Fr(e.isSendingSignedTokenTransaction);return j.jsxs(ve,{flexDirection:"column",justifyContent:"center",alignItems:"center",width:"full",gap:"4",...t,children:[r&&j.jsx(w7,{symbol:((o=(s=r.tokenBalance)==null?void 0:s.contractInfo)==null?void 0:o.symbol)??"",chainId:r.tokenBalance.chainId,to:r.to,amount:r.amount}),n&&j.jsx(w7,{symbol:n.collectibleInfo.collectibleInfoResponse.name??"",chainId:n.collectibleInfo.collectibleInfoParams.chainId,to:n.to,amount:n.amount}),i&&j.jsx(w7,{symbol:"tokens",chainId:i.chainId,to:i.txn[0].to,amount:String(Number(i.txn[0].value))})]})}const JV=["https://dweb.link/ipfs/","https://gateway.pinata.cloud/ipfs/","https://nftstorage.link/ipfs/","https://flk-ipfs.io/ipfs/","https://storry.tv/ipfs/","https://ipfs.io/ipfs/","https://hardbin.com/ipfs/","https://ipfs.runfission.com/ipfs/","https://ipfs.eth.aragon.network/ipfs/","https://4everland.io/ipfs/","https://w3s.link/ipfs/","https://trustless-gateway.link/ipfs/"],XHe="QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1";class eGe{constructor(){ue(this,"gatewayURL");ue(this,"localStore");this.localStore=new hu($l.GATEWAY_ADDRESS),this.gatewayURL=this.localStore.get(),this.findAccessibleGateway()}async findAccessibleGateway(){const e=this.localStore.get();if(e&&await this.isGatewayAccessible(e)){this.gatewayURL=e;return}for(const r of JV)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=JV[0],console.warn("No accessible IPFS gateways found, falling back to default")}async isGatewayAccessible(e){try{return await fetch(`${e}${XHe}`,{signal:AbortSignal.timeout(3e3)}),!0}catch{return!1}}async fetch(e){this.gatewayURL||await this.findAccessibleGateway();const r=await this.getGatewayURL(e);return fetch(r,{signal:AbortSignal.timeout(3e3)})}async getGatewayURL(e){if(this.gatewayURL||await this.findAccessibleGateway(),!e.startsWith("ipfs://"))throw new Error("Invalid IPFS URI");return e.replace("ipfs://",this.gatewayURL)}}function tGe(t,e){e(t.get()),t.subscribe(e)}const rGe={ERC721:"ERC721",ERC1155:"ERC1155"};class dse{constructor(e){ue(this,"isFetchingBalances",wr(!1));ue(this,"isFetchingCollectibleInfo",wr(!1));ue(this,"ipfsGatewayHelper",new eGe);ue(this,"userCollectibles",wr([]));ue(this,"local",{userCollectibles:new hu($l.COLLECTIBLES)});this.store=e;const r=this.store.get(In);tGe(r.networks,n=>{const i=this.store.get(ai).accountAddress.get();i&&n.length>0&&this.loadBalances(i)})}async loadBalances(e){const r=this.local.userCollectibles.get()??[];if(r.length===0)return;this.isFetchingBalances.set(!0);const n=[],i=r.map(async s=>{const o=await this.getCollectibleInfo(s);if(!o.isOwner){this.removeCollectible({collectibleInfoParams:s,collectibleInfoResponse:o});return}n.push({collectibleInfoParams:s,collectibleInfoResponse:o})});await Promise.allSettled(i),this.userCollectibles.set(n),this.isFetchingBalances.set(!1)}async getCollectibleInfo(e){const r=this.store.get(ai).accountAddress.get();if(!r)throw new Error("No account found");const n=this.store.get(In).providerForChainId(e.chainId);this.isFetchingCollectibleInfo.set(!0);let i,s,o,a,c;if(e.contractType===Rh.ERC721){const f=new _i(e.address,hte,n),h=(await f.ownerOf(e.tokenId)).toLowerCase()===r.toLowerCase();if(!h)return this.isFetchingCollectibleInfo.set(!1),{isOwner:h,uri:""};i=await f.tokenURI(e.tokenId)}else if(e.contractType===Rh.ERC1155){const f=new _i(e.address,pte,n);if(a=await f.balanceOf(r,e.tokenId),!a)return this.isFetchingCollectibleInfo.set(!1),{isOwner:!1,uri:""};a=a??BigInt(1),i=await f.uri(e.tokenId)}if(!i)throw new Error("Could not get collectible URI");i.includes("{id}")&&(i=i.replace("{id}",e.tokenId.toString()));let l;try{i.startsWith("ipfs://")?l=await this.ipfsGatewayHelper.fetch(i).then(f=>f.json()):l=await fetch(i).then(f=>f.json()),l&&(c=l.decimals,s=l.image,o=l.name),s!=null&&s.startsWith("ipfs://")&&(s=await this.ipfsGatewayHelper.getGatewayURL(s))}catch{o||(o=`No Metadata Found Address: ${e.address} TokenId: ${e.tokenId}`)}return c=c??0,this.isFetchingCollectibleInfo.set(!1),{isOwner:!0,uri:i,image:s,name:o,balance:a,decimals:c}}async addCollectible(e){if(e.collectibleInfoResponse.isOwner){const r=this.local.userCollectibles.get()??[];if(r.some(n=>n.address===e.collectibleInfoParams.address&&n.tokenId===e.collectibleInfoParams.tokenId))throw new Error("Collectible already added");this.local.userCollectibles.set([...r,e.collectibleInfoParams]),this.isFetchingCollectibleInfo.set(!0),this.loadBalances(),this.isFetchingCollectibleInfo.set(!1)}}async removeCollectible(e){const n=(this.local.userCollectibles.get()??[]).filter(o=>o.address!==e.collectibleInfoParams.address||o.tokenId!==e.collectibleInfoParams.tokenId);this.local.userCollectibles.set(n);const s=this.userCollectibles.get().filter(o=>o.collectibleInfoParams.address!==e.collectibleInfoParams.address||o.collectibleInfoParams.tokenId!==e.collectibleInfoParams.tokenId);this.userCollectibles.set(s)}}const nGe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='collection'%3e%3cg%20id='Vector'%3e%3cpath%20d='M6.37183%2013.326V6.12354H13.5743V7.86282H8.11042V13.326H6.37183Z'%20fill='white'/%3e%3cpath%20d='M3%209.95247V2.75H10.2025V4.48928H4.7386V9.95247H3Z'%20fill='white'/%3e%3cpath%20d='M9.79834%2016.7508V9.54834H17.0008V16.7508H9.79834Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",hse="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Send%20(Default)'%3e%3cpath%20id='Subtract'%20d='M14.952%202.86937L3.33984%2010.6285C3.00008%2010.8569%202.89796%2011.3362%203.11176%2011.6991C3.2446%2011.9246%203.46815%2012.0521%203.6999%2012.0616L3.70388%2012.0651L3.708%2012.0686H6.28605C6.78202%2012.0686%207.26064%2011.8739%207.63066%2011.5216C8.1492%2011.0279%2010.4926%209.12312%2011.7011%208.14595C12.0915%207.83027%2012.8551%207.99125%2012.625%208.4375L11.2433%2010.9344C10.7104%2011.8479%2010.8913%2013.0409%2011.667%2013.7286L14.4613%2016.206L14.718%2016.4303L14.928%2016.6297L14.998%2016.6795L15.0641%2016.7149C15.0822%2016.7245%2015.1011%2016.7323%2015.1206%2016.738C15.1476%2016.746%2015.1755%2016.75%2015.2035%2016.75H15.3981C15.7996%2016.75%2016.125%2016.4024%2016.125%2015.9736L16.125%203.53132C16.125%203.11184%2015.8136%202.77006%2015.4242%202.75541C15.2649%202.73526%2015.0984%202.77102%2014.952%202.86937Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e";function iGe({collectibleInfo:t,onSendClick:e,onRemoveClick:r}){return j.jsxs(vn,{flexDirection:"row",alignItems:"center",gap:"3",children:[t.collectibleInfoResponse.image&&j.jsx(ve,{children:j.jsx(DC,{background:"buttonGlass",src:t.collectibleInfoResponse.image})}),j.jsxs(ve,{flexDirection:"column",justifyContent:"center",children:[j.jsxs(ve,{gap:"2",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text80",children:t.collectibleInfoResponse.name??"Collectible"}),j.jsxs(Te,{variant:"small",fontWeight:"bold",color:"text50",children:["#",t.collectibleInfoParams.tokenId]}),j.jsx(UO,{chainId:t.collectibleInfoParams.chainId})]}),j.jsx(ve,{children:j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(Ph(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})})]}),j.jsxs(ve,{marginLeft:"auto",gap:"3",children:[j.jsx(d1,{icon:j.jsx(Ln,{src:hse}),disabled:!1,onClick:e}),r&&j.jsx(d1,{icon:j.jsx(Pu,{color:"text100"}),onClick:()=>r==null?void 0:r()})]})]})}function sGe({onClose:t}){const r=ir(In).networks.get(),n=r.filter(U=>U.type===Mt.MAINNET),i=ir(dse),s=Fr(i.isFetchingCollectibleInfo),o=rm(),[a,c]=T.useState(),[l,f]=T.useState(),[u,h]=T.useState(),[v,y]=T.useState(),[m,S]=T.useState(),[x,A]=T.useState(!1),[k,N]=T.useState();T.useEffect(()=>{var U,ie;a&&N((ie=(U=r.find(ae=>ae.chainId===a.chainId))==null?void 0:U.blockExplorer)==null?void 0:ie.rootUrl),a&&l&&u&&v?i.getCollectibleInfo({chainId:a.chainId,address:l,tokenId:u,contractType:v}).then(ae=>{S(ae)}):S(void 0)},[a,l,u,v]);const L=n.filter(U=>!U.disabled).map(U=>({label:U.title,value:U.chainId.toString()})),V=async()=>{a&&l&&m&&u&&v&&(await i.addCollectible({collectibleInfoParams:{chainId:a.chainId,address:l,tokenId:u,contractType:v},collectibleInfoResponse:m}),A(!1),o({variant:"success",title:v===rGe.ERC721?"ERC721 collectible added successfully":"ERC1155 collectible added successfully",description:"You'll be able to see this collectible on your browser as long as you don't clear your cache."}),I(),t())},I=()=>{f(void 0),c(void 0),h(void 0),y(void 0)};return j.jsxs(ve,{flexDirection:"column",children:[j.jsxs(ve,{flexDirection:"column",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Import ERC721 or ERC1155 Collectible"}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Collectible Network"}),j.jsx(V_,{name:"collectibleNetwork",options:L,onValueChange:U=>c(r.find(ie=>ie.chainId===Number(U)))})]}),j.jsxs(ve,{flexDirection:"column",gap:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Collectible Address"}),j.jsxs(ve,{flexDirection:"row",gap:"1",paddingBottom:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"See addresses on network's"}),j.jsx(Te,{variant:"normal",color:"text50",underline:!!k,cursor:k?"pointer":"default",onClick:()=>{k&&window.open(k)},children:"directory"})]}),j.jsx(Sn,{name:"collectibleAddress",value:l??"",onChange:U=>{f(U.target.value)}})]}),j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Collectible Type"}),j.jsx(V_,{name:"collectibleType",options:[{value:"ERC721",label:"ERC721"},{value:"ERC1155",label:"ERC1155"}],onValueChange:U=>y(U)})]}),j.jsxs(ve,{flexDirection:"column",gap:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Collectible Token ID"}),j.jsx(Sn,{name:"collectibleTokenId",value:u??"",onKeyPress:U=>{/[0-9]/.test(U.key)||U.preventDefault()},onChange:U=>{if(U.target.value===""){h(void 0);return}h(U.target.value)}})]})]}),s&&j.jsx(ve,{alignItems:"center",justifyContent:"center",children:j.jsx(Jp,{size:"lg"})}),m&&!m.isOwner&&!s&&j.jsx(ve,{alignItems:"center",justifyContent:"center",children:j.jsx(Te,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),m&&m.isOwner&&!s&&j.jsxs(vn,{flexDirection:"row",gap:"6",children:[j.jsx(Ln,{src:m.image,style:{width:"120px",height:"auto"}}),j.jsxs(ve,{flexDirection:"column",gap:"2",children:[j.jsx(Te,{variant:"medium",fontWeight:"bold",color:"text80",children:m.name??""}),j.jsx(Te,{variant:"small",color:"text80",children:"Your Balance:"}),j.jsx(Te,{variant:"medium",fontWeight:"bold",color:"text80",children:Number(Ph(m.balance,m.decimals??0))})]})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{flexDirection:"row",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:t}),j.jsx(Kt,{label:"Add Collectible",variant:"primary",shape:"square",disabled:m===void 0||x,onClick:()=>{V()}})]})]})}function oGe({onSendClick:t}){const e=ir(dse),r=ir(In),n=Fr(e.isFetchingBalances),i=Fr(e.userCollectibles),s=T.useMemo(()=>i,[i]),o=T.useMemo(()=>s.filter(l=>{var f;return!((f=r.networks.get().find(u=>u.chainId===l.collectibleInfoParams.chainId))!=null&&f.disabled)}),[s,r]),[a,c]=T.useState(!1);return j.jsxs(ve,{width:"full",children:[j.jsxs(ve,{justifyContent:"space-between",alignItems:"center",children:[j.jsxs(ve,{alignItems:"center",gap:"2",children:[j.jsx(Ln,{src:nGe,width:"5",height:"5"}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Collectibles"})]}),j.jsx(Kt,{size:"sm",leftIcon:$w,label:"Import",shape:"square",onClick:()=>c(!0)})]}),j.jsx(pi,{marginY:"2"}),j.jsx(ve,{width:"full",flexDirection:"column",gap:"4",marginBottom:"8",children:n?j.jsx(ve,{marginTop:"4",alignItems:"center",justifyContent:"center",children:j.jsx(Jp,{size:"lg"})}):j.jsx(j.Fragment,{children:o.length>0?j.jsx(j.Fragment,{children:s.map(l=>j.jsx(ve,{children:j.jsx(iGe,{collectibleInfo:l,onSendClick:()=>{t(l)},onRemoveClick:()=>{e.removeCollectible(l)}})},l.collectibleInfoParams.chainId+l.collectibleInfoParams.address+l.collectibleInfoParams.tokenId))}):j.jsx(vn,{flexDirection:"column",children:j.jsx(Te,{textAlign:"center",variant:"normal",color:"text50",padding:"4",children:"Import ERC721 or ERC1155 Collectibles"})})})}),a&&j.jsx(oa,{size:"sm",onClose:()=>c(!1),children:j.jsx(sGe,{onClose:()=>c(!1)})})]})}function aGe({collectibleInfo:t,onClose:e}){var h,v,y;const r=Hu("isMobile"),n=ir(Rr),[i,s]=T.useState(void 0),[o,a]=T.useState(void 0),[c,l]=T.useState(!1);if(T.useEffect(()=>{const m=n.selectedExternalWalletAddress.get();c&&m&&a(n.selectedExternalWalletAddress.get())},[c]),!t)return null;const f=t.collectibleInfoParams.contractType==="ERC721",u=um(t.collectibleInfoParams.chainId);return j.jsxs(ve,{style:{minWidth:r?"100vw":"500px"},children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsxs(Te,{variant:"large",fontWeight:"bold",color:"text80",children:["Sending ",(h=t==null?void 0:t.collectibleInfoResponse)==null?void 0:h.name," on ",u]}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsxs(ve,{flexDirection:"column",gap:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Amount"}),j.jsxs(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:["Current Balance:"," ",Ph((v=t==null?void 0:t.collectibleInfoResponse)==null?void 0:v.balance,((y=t==null?void 0:t.collectibleInfoResponse)==null?void 0:y.decimals)??18)]})]}),j.jsx(Sn,{name:"amount",value:f?"1":i??"",disabled:f,onChange:m=>{s(m.target.value)},controls:j.jsx(Kt,{label:"Max",size:"xs",shape:"square",onClick:()=>{var m,S;s(Ph((m=t==null?void 0:t.collectibleInfoResponse)==null?void 0:m.balance,((S=t==null?void 0:t.collectibleInfoResponse)==null?void 0:S.decimals)??18))}})})]}),j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"To"}),j.jsx(Sn,{name:"to",value:o??"",placeholder:"0x...",disabled:c,onChange:m=>{a(m.target.value)}})]})]}),j.jsx(Kt,{variant:"text",label:j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(ux,{checked:c,size:"md"}),j.jsx(Te,{variant:"small",color:"text80",children:"Send to connected external wallet address"})]}),onClick:()=>l(!c)})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:()=>{e()}}),j.jsx(Kt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:f?!o:!o||!i,onClick:()=>{o&&i&&e(o,i)}})]})]})}function cGe({tokenBalance:t,onClose:e}){var u,h;const r=Hu("isMobile"),n=ir(Rr),[i,s]=T.useState(void 0),[o,a]=T.useState(void 0),[c,l]=T.useState(!1);if(T.useEffect(()=>{const v=n.selectedExternalWalletAddress.get();c&&v&&a(n.selectedExternalWalletAddress.get())},[c]),!t)return null;const f=um(t.chainId);return j.jsxs(ve,{style:{minWidth:r?"100vw":"500px"},children:[j.jsxs(ve,{flexDirection:"column",gap:"6",padding:"6",children:[j.jsxs(Te,{variant:"large",fontWeight:"bold",color:"text100",children:["Sending ",(u=t==null?void 0:t.contractInfo)==null?void 0:u.symbol," on ",f]}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsxs(ve,{flexDirection:"column",gap:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Amount"}),j.jsxs(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:["Current Balance:"," ",Ph(t==null?void 0:t.balance,((h=t==null?void 0:t.contractInfo)==null?void 0:h.decimals)??18)]})]}),j.jsx(Sn,{name:"amount",value:i??"",onChange:v=>{s(v.target.value)},controls:j.jsx(Kt,{label:"Max",size:"xs",shape:"square",onClick:()=>{var v;s(Ph(t==null?void 0:t.balance,((v=t==null?void 0:t.contractInfo)==null?void 0:v.decimals)??18))}})})]}),j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"To"}),j.jsx(Sn,{name:"to",value:o??"",placeholder:"0x...",disabled:c,onChange:v=>{a(v.target.value)}})]})]}),j.jsx(Kt,{variant:"text",label:j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"2",children:[j.jsx(ux,{checked:c,size:"md"}),j.jsx(Te,{variant:"small",color:"text80",children:"Send to connected external wallet address"})]}),onClick:()=>l(!c)})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{alignItems:"center",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:()=>{e()}}),j.jsx(Kt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!o||!i,onClick:()=>{o&&i&&e(o,i)}})]})]})}const lGe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='coins'%3e%3cg%20id='Vector'%3e%3cpath%20d='M11.1921%207.78597C11.1921%208.14419%2010.5971%208.69061%209.27961%209.03061C8.55711%209.23097%207.70711%209.33418%206.82068%209.33418C5.94032%209.33418%205.09032%209.23097%204.37389%209.03668C3.04425%208.69061%202.45532%208.15633%202.45532%207.78597C2.45532%207.15454%204.15532%206.23776%206.82068%206.23776C9.49211%206.23776%2011.1921%207.15454%2011.1921%207.78597Z'%20fill='white'/%3e%3cpath%20d='M9.62814%2015.1728C8.78725%2015.3938%207.81704%2015.5109%206.82132%2015.5109C5.82986%2015.5109%204.86207%2015.3944%204.02179%2015.1734C3.16996%2014.9481%202.49361%2014.6263%202%2014.2378V15.9815C2%2017.0865%204.15961%2017.9844%206.82193%2017.9844C9.49032%2017.9844%2011.6499%2017.0865%2011.6499%2015.9815V14.2378C11.1563%2014.6263%2010.48%2014.9481%209.62814%2015.1728Z'%20fill='white'/%3e%3cpath%20d='M9.50732%2010.5956C8.72836%2010.8112%207.79396%2010.9277%206.82071%2010.9277C5.85779%2010.9277%204.92946%2010.8136%204.13532%2010.5987C3.15661%2010.3437%202.43168%209.96298%202%209.50337V11.8512C2%2012.567%202.89796%2013.1887%204.25371%2013.5463C4.99443%2013.7412%205.87964%2013.8542%206.82132%2013.8542C7.76907%2013.8542%208.65429%2013.7412%209.39561%2013.5463C10.752%2013.1887%2011.6493%2012.5603%2011.6493%2011.8512V9.49002C11.214%209.95569%2010.4818%2010.3443%209.50732%2010.5956Z'%20fill='white'/%3e%3cpath%20d='M15.8134%204.56107C17.0151%204.25095%2017.5578%203.75254%2017.5578%203.42581C17.5578%202.84988%2016.0072%202.01367%2013.5706%202.01367C11.1395%202.01367%209.58887%202.84988%209.58887%203.42581C9.58887%203.76362%2010.126%204.25095%2011.3388%204.5666C11.9923%204.74381%2012.7676%204.83796%2013.5706%204.83796C14.3791%204.83796%2015.1544%204.74381%2015.8134%204.56107Z'%20fill='white'/%3e%3cpath%20d='M13.5711%2014.1821C14.4793%2014.1821%2015.3643%2014.0752%2016.1313%2013.8737C16.9082%2013.6688%2017.5251%2013.3753%2017.9754%2013.0208V14.6113C17.9754%2015.6192%2016.0056%2016.4382%2013.5717%2016.4382C13.4159%2016.4382%2013.2619%2016.4349%2013.1103%2016.4283C13.153%2016.2336%2013.1755%2016.0314%2013.1755%2015.824V14.1753C13.3067%2014.1798%2013.4387%2014.1821%2013.5711%2014.1821Z'%20fill='white'/%3e%3cpath%20d='M13.1755%2012.7206C13.306%2012.7255%2013.4382%2012.7279%2013.5717%2012.7279C16.0056%2012.7279%2017.9754%2011.9089%2017.9754%2010.901V9.31055C17.5251%209.66497%2016.9082%209.95848%2016.1313%2010.1634C15.3643%2010.365%2014.4793%2010.4718%2013.5711%2010.4718C13.4387%2010.4718%2013.3067%2010.4696%2013.1755%2010.465V12.7206Z'%20fill='white'/%3e%3cpath%20d='M13.1755%208.95334C13.3059%208.95819%2013.4379%208.96067%2013.5711%208.96067C14.4356%208.96067%2015.243%208.85767%2015.9192%208.6799C17.1563%208.35372%2017.9748%207.78056%2017.9748%207.13375V4.98009C17.5778%205.40484%2016.9099%205.75926%2016.0211%205.98853C15.3106%206.18512%2014.4583%206.29144%2013.5706%206.29144C13.3313%206.29144%2013.0943%206.28371%2012.8615%206.2685C13.0621%206.65495%2013.1755%207.09399%2013.1755%207.55951V8.95334Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function fGe({onClose:t}){const r=ir(In).networks.get(),n=r.filter(N=>N.type===Mt.MAINNET),i=ir(eC),s=Fr(i.isFetchingTokenInfo),o=rm(),[a,c]=T.useState(),[l,f]=T.useState(),[u,h]=T.useState(),[v,y]=T.useState(!1),[m,S]=T.useState();T.useEffect(()=>{var N,L;a&&S((L=(N=r.find(V=>V.chainId===a.chainId))==null?void 0:N.blockExplorer)==null?void 0:L.rootUrl),a&&l?i.getTokenInfo(a.chainId,l).then(V=>{h(V)}):h(void 0)},[a,l]);const x=n.filter(N=>!N.disabled).map(N=>({label:N.title,value:N.chainId.toString()})),A=async()=>{a&&l&&u&&(y(!0),await i.addToken({chainId:a.chainId,address:l,contractType:Rh.ERC20,symbol:u.symbol,decimals:u.decimals}),y(!1),o({variant:"success",title:"ERC20 token added sucessfully",description:"You'll be able to see this token on your browser as long as you don't clear your cache."}),k(),t())},k=()=>{f(void 0),c(void 0)};return j.jsxs(ve,{flexDirection:"column",children:[j.jsxs(ve,{flexDirection:"column",padding:"6",gap:"6",children:[j.jsx(Te,{variant:"large",fontWeight:"bold",color:"text80",children:"Import Token"}),j.jsxs(ve,{flexDirection:"column",children:[j.jsx(ve,{flexDirection:"row",style:{paddingBottom:"5px"},children:j.jsxs(ve,{children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",paddingY:"2",paddingX:"4",children:"ERC20 Token"}),j.jsx(pi,{color:"white",height:"0.5",position:"relative",marginY:"0",style:{top:"6px"}})]})}),j.jsx(pi,{marginY:"0"})]}),j.jsxs(ve,{flexDirection:"column",gap:"3",children:[j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Token Network"}),j.jsx(V_,{name:"tokenNetwork",options:x,onValueChange:N=>c(r.find(L=>L.chainId===Number(N)))})]}),j.jsxs(ve,{flexDirection:"column",gap:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Token Address"}),j.jsxs(ve,{flexDirection:"row",gap:"1",paddingBottom:"0.5",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:"See addresses on network's"}),j.jsx(Te,{variant:"normal",color:"text50",underline:!!m,cursor:m?"pointer":"default",onClick:()=>{m&&window.open(m)},children:"directory"})]}),j.jsx(Sn,{name:"tokenAddress",value:l??"",onChange:N=>{f(N.target.value)}})]})]}),s&&j.jsx(ve,{alignItems:"center",justifyContent:"center",children:j.jsx(Jp,{size:"lg"})}),!s&&u&&j.jsxs(vn,{flexDirection:"column",gap:"2",children:[j.jsx(Te,{variant:"medium",fontWeight:"bold",color:"text80",children:u.symbol??""}),j.jsx(Te,{variant:"small",color:"text80",children:"Your Balance:"}),j.jsx(Te,{variant:"medium",fontWeight:"bold",color:"text80",children:u.balance})]})]}),j.jsx(pi,{marginY:"0"}),j.jsxs(ve,{flexDirection:"row",justifyContent:"flex-end",padding:"6",gap:"2",children:[j.jsx(Kt,{label:"Cancel",size:"md",shape:"square",onClick:t}),j.jsx(Kt,{label:"Add Token",variant:"primary",shape:"square",disabled:u===void 0||v,onClick:()=>{A()}})]})]})}const uGe=(t,e)=>Math.floor(t*10**e)/10**e;function dGe({disabled:t,tokenBalance:e,onSendClick:r,onRemoveClick:n}){var o,a;const i=Ph(e.balance,((o=e.contractInfo)==null?void 0:o.decimals)??18),s=uGe(Number(i),5);return console.log(e),j.jsxs(vn,{flexDirection:"row",alignItems:"center",gap:"3",children:[j.jsx(DC,{background:"text80",src:mge(e==null?void 0:e.chainId,e==null?void 0:e.contractAddress)}),j.jsxs(ve,{flexDirection:"column",children:[j.jsxs(ve,{gap:"1",alignItems:"center",children:[j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native"}),j.jsx(UO,{chainId:e.chainId})]}),j.jsx(ve,{children:j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",children:s})})]}),j.jsxs(ve,{flexDirection:"row",alignItems:"center",marginLeft:"auto",gap:"3",children:[j.jsx(d1,{icon:j.jsx(Ln,{src:hse}),disabled:t,onClick:r}),n&&j.jsx(d1,{icon:j.jsx(Pu,{color:"text100"}),onClick:()=>n==null?void 0:n()})]})]})}function hGe({onSendClick:t}){const e=ir(Rr),r=ir(eC),n=ir(In),i=Fr(r.balances),s=Fr(r.isFetchingBalances),o=Fr(e.selectedExternalProvider)!==void 0,[a,c]=T.useState(!1),[l,f]=T.useState(!0),u=T.useMemo(()=>{const v=new Map,y=m=>!l||m.balance!=="0";return i.forEach(m=>{var x;if((x=n.networks.get().find(A=>A.chainId===m.chainId))!=null&&x.disabled)return;const S=`${m.contractAddress}-${m.chainId}`;!v.has(S)&&y(m)&&v.set(S,m)}),Array.from(v.values())},[i,l,s]),h=v=>v.contractType===Rh.NATIVE?void 0:()=>{var y,m;r.removeToken({chainId:v.chainId,address:v.contractAddress,contractType:v.contractType,decimals:(y=v.contractInfo)==null?void 0:y.decimals,symbol:(m=v.contractInfo)==null?void 0:m.symbol})};return j.jsxs(ve,{children:[j.jsxs(ve,{alignItems:"center",children:[j.jsxs(ve,{alignItems:"center",gap:"2",children:[j.jsx(Ln,{src:lGe,width:"5",height:"5"}),j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text100",children:"Coins"})]}),j.jsxs(ve,{gap:"4",marginLeft:"auto",children:[j.jsxs(ve,{flexDirection:"row",alignItems:"center",cursor:"pointer",gap:"2",onClick:()=>f(!l),children:[j.jsx(ux,{checked:l,size:"md"}),j.jsx(Te,{variant:"small",color:"text80",children:"Filter zero balances"})]}),j.jsx(Kt,{size:"sm",leftIcon:$w,label:"Import",shape:"square",onClick:()=>c(!0)})]})]}),j.jsx(pi,{marginY:"2"}),j.jsx(ve,{width:"full",flexDirection:"column",gap:"2",children:s?j.jsx(ve,{marginTop:"4",alignItems:"center",justifyContent:"center",children:j.jsx(Jp,{size:"lg"})}):j.jsx(j.Fragment,{children:u.length>0?j.jsx(j.Fragment,{children:u.map(v=>j.jsx(dGe,{tokenBalance:v,disabled:!o,onSendClick:()=>t(v),onRemoveClick:h(v)},v.contractAddress+v.chainId))}):j.jsx(vn,{flexDirection:"column",children:j.jsx(Te,{textAlign:"center",variant:"normal",color:"text50",padding:"4",children:"Import ERC 20 token address"})})})}),a&&j.jsx(oa,{size:"sm",onClose:()=>c(!1),children:j.jsx(fGe,{onClose:()=>c(!1)})})]})}const pse=800;function pGe(){const t=Lie(),e=ir(ai),r=ir(eC),n=ir(Rr),i=ir(In),s=ir(kx),o=Fr(e.accountAddress),a=Fr(n.isSigningTxn),c=Fr(n.isSigningMsg),l=Fr(n.isNetworkModalOpen),f=Fr(i.networks),u=rm(),h=Hu("isMobile"),v=yze();T.useEffect(()=>{o&&f.length>0&&r.loadBalances(o,f)},[o,f]),T.useEffect(()=>{if(v&&v.connected&&!n.selectedExternalProvider.get()){let b=Nie(v),M=n.availableExternalProviders.get();M?n.availableExternalProviders.set([b,...M]):n.availableExternalProviders.set([b])}},[v]),T.useEffect(()=>{t.length>0&&n.availableExternalProviders.set(t)},[t]);const[y,m]=T.useState(void 0),[S,x]=T.useState(void 0),[A,k]=T.useState(!1),[N,L]=T.useState(!1),[V,I]=T.useState(!1);T.useEffect(()=>{k(l)},[l]);const U=b=>{x(void 0),n.isSendingCollectibleTransaction.set(void 0),m(b),L(!0)},ie=b=>{m(void 0),n.isSendingTokenTransaction.set(void 0),x(b),I(!0)},ae=async(b,M)=>{if(!n.selectedExternalProvider.get()){console.warn("No external provider selected");return}var B;let E;try{if(y)B=y.chainId,E=await n.sendToken(y,b,M);else if(S)B=S.collectibleInfoParams.chainId,E=await n.sendCollectible(S,b,M);else{console.warn("No pending send found");return}}catch(P){P.code===4001&&u({variant:"error",title:"User denied transaction signature."}),console.error(P);return}const C=i.providerForChainId(B),w=await qV(C,E.hash);w&&u({variant:"success",title:"Transaction confirmed",description:"You can view the transaction details on your connected external wallet"}),y&&r.updateTokenBalance(y),m(void 0),x(void 0),n.isSendingTokenTransaction.set(void 0),n.isSendingCollectibleTransaction.set(void 0),console.log("receipt",w)},K=async(b,M)=>{const B=i.providerForChainId(M);await qV(B,b)&&(n.isSendingSignedTokenTransaction.set(void 0),u({variant:"success",title:"Sign transaction confirmed",description:"You can view the transaction details on your connected external wallet"}))},R=()=>{n.resetSignObservables(),s.rejectRequest(),n.toSignPermission.set("cancelled")};async function D(b){var w;const M=async(P,O)=>{try{const G=await n.getExternalProviderAddress(B);if(!G)throw new Error("No provider address found");return console.log("sendTransaction chainId",O),await n.sendTransaction(E,B,G,P,O)}catch(G){throw n.isSendingSignedTokenTransaction.set(void 0),G}},B=(w=n.selectedExternalProvider.get())==null?void 0:w.provider,E=e.account;let C;if(b)try{n.isSendingSignedTokenTransaction.set(b),C=await M(b.txn,b.chainId),K(C.hash,b.chainId),n.toSignResult.set(C),n.toSignPermission.set("approved"),n.isSigningTxn.set(!1)}catch(P){throw u({variant:"error",title:"Transaction failed",description:"Please try again."}),n.isSendingSignedTokenTransaction.set(void 0),R(),P}}async function g(b){const M=async(C,w)=>{try{let P;if(C.message)console.log("signMessage chainId",C.chainId),P=await B.signMessage(C.message,C.chainId,C.eip6492?"eip6492":"throw");else if(C.typedData){const O=C.typedData;P=await B.signTypedData(O.domain,O.types,O.message,C.chainId,C.eip6492?"eip6492":"throw")}if(!P)throw new Error("Account sign method failed");return{hash:P}}catch(P){throw P}},B=e.account;let E;if(b)try{E=await M(b.message),n.toSignResult.set(E),n.toSignPermission.set("approved")}catch(C){throw u({variant:"error",title:"Transaction failed",description:"Please try again."}),n.isSendingSignedTokenTransaction.set(void 0),R(),C}}return j.jsxs(ve,{children:[j.jsx(bre,{}),j.jsx(ve,{flexDirection:"column",alignItems:"center",children:j.jsx(ve,{flexDirection:"column",padding:"5",width:"full",style:{maxWidth:pse},paddingBottom:"20",children:j.jsxs(ve,{flexDirection:"column",children:[j.jsxs(ve,{flexDirection:"column",gap:"5",children:[j.jsx(Te,{variant:"small",fontWeight:"bold",color:"text50",children:"External connections"}),j.jsx(JHe,{}),j.jsx(KHe,{})]}),j.jsx(ZHe,{paddingY:"5"}),j.jsxs(ve,{flexDirection:"column",gap:"5",children:[j.jsx(Te,{variant:"small",fontWeight:"bold",color:"text50",children:"My Sequence wallet"}),j.jsx(hGe,{onSendClick:U}),j.jsx(oGe,{onSendClick:ie})]})]})})}),A&&j.jsx(oa,{onClose:()=>{n.isNetworkModalOpen.set(!1),i.discardUnsavedNetworkEdits(),i.isAddingNetwork.set(!1)},contentProps:{style:{scrollbarColor:"gray black",scrollbarWidth:"thin"}},children:j.jsx(Cte,{})}),a&&j.jsx(oa,{isDismissible:!1,size:"md",contentProps:{style:{width:h?"100%":"800px",maxHeight:"100%",overflowY:"auto"}},children:j.jsx(bze,{onClose:()=>{R()},handleSignTxn:b=>D(b)})}),c&&j.jsx(oa,{isDismissible:!1,size:"md",contentProps:{style:{width:h?"100%":"800px",maxHeight:"90%",overflowY:"auto"}},children:j.jsx(mze,{onClose:b=>{n.isSigningMsg.set(!1),b?g(b):R()}})}),N&&j.jsx(oa,{size:"md",onClose:()=>L(!1),children:j.jsx(cGe,{tokenBalance:y,onClose:(b,M)=>{L(!1),b&&M&&ae(b,M)}})}),V&&j.jsx(oa,{size:"md",onClose:()=>I(!1),children:j.jsx(aGe,{collectibleInfo:S,onClose:(b,M)=>{I(!1),(b&&(S==null?void 0:S.collectibleInfoParams.contractType)==="ERC721"||b&&M)&&ae(b,M)}})})]})}function vGe(){const t=Hu("isMobile"),e=ir(ai),r=ir(In),n=ir(Rr),i=r.networks.get(),[s,o]=T.useState(""),[a,c]=T.useState([]),[l,f]=T.useState(""),[u,h]=T.useState(""),[v,y]=T.useState(""),[m,S]=T.useState(!0),[x,A]=T.useState(!1),[k,N]=T.useState(!1),[L,V]=T.useState(!1),[I,U]=T.useState(!1),[ie,ae]=T.useState(!1),[K,R]=T.useState(!1),D=Fr(n.isNetworkModalOpen);T.useEffect(()=>{if(V(!1),!fg(s))return;ae(!0);const P=Zt(s);w(P)},[s]),T.useEffect(()=>{N(D)},[D]);const g=()=>{const P=Zt(s);e.signInWithRecoveryMnemonic(P,l.trim(),u)},b=(P=l)=>P.replace(/\s+/g," ").trim().split(" ").length==12,M=()=>(u==null?void 0:u.length)>=8,B=()=>s?fg(s):!0,E=async P=>{if(o(""),c([]),f(P),R(!1),!!b(P)){U(!0);try{const O=B4.fromPhrase(P),G=[...(await aT.walletsOfSigner({signer:O.address})).map(({wallet:oe})=>oe),...(P_e[O.address]??[]).map(({wallet:oe})=>oe)];c(G),G&&o(G[0])}catch(O){console.error(O)}U(!1)}},C=async P=>{s!==P&&(o(P),R(!1))},w=async P=>{try{const O=B4.fromPhrase(l),G=new JE([O]),X=(await new fx({address:P,tracker:aT,contexts:ate,orchestrator:G,networks:i}).status(ye.MAINNET)).config,ee=Ps.genericCoderFor(X.version).config.signersOf(X).some(F=>F.address===O.address);R(ee),ee||V(!0)}catch(O){V(!0),console.error("failed to validate wallet address",O)}ae(!1)};return j.jsxs(ve,{flexDirection:"column",background:"backgroundPrimary",children:[j.jsx(bre,{}),j.jsxs(ve,{alignSelf:"center",flexDirection:"column",marginY:"10",paddingX:"4",gap:"4",width:"full",style:{maxWidth:pse},children:[j.jsx(Kt,{leftIcon:ZW,label:"Back",size:"sm",as:eJ,to:"/"}),j.jsxs(ve,{flexDirection:"column",children:[j.jsx(Te,{variant:"xlarge",color:"text80",children:"Recover your wallet"}),j.jsx(pi,{marginY:"6"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Recovery phrase"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",marginBottom:"1",children:"Paste your 12-word mnemonic, with each word separated by a space."}),j.jsx(Sn,{name:"mnemonic",value:l,type:m?"text":"password",onChange:P=>E(P.target.value)}),l&&!b()&&j.jsx(Te,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),j.jsx(Kt,{variant:"text",label:j.jsxs(ve,{flexDirection:"row",alignItems:"center",gap:"1",children:[j.jsx(ux,{checked:m}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Show secret recovery phrase"})]}),onClick:()=>S(!m)}),j.jsxs(ve,{flexDirection:"column",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",children:"Create password"}),j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text50",marginBottom:"1",children:"Encrypt your mnemonic with an 8+ character password."}),j.jsx(Sn,{type:"password",name:"password",value:u,onChange:P=>h(P.target.value)}),u&&!M()&&j.jsx(Te,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),j.jsxs(ve,{flexDirection:"column",children:[j.jsx(Te,{variant:"normal",fontWeight:"medium",color:"text80",marginBottom:"1",children:"Confirm password"}),j.jsx(Sn,{type:"password",name:"confirmPassword",value:v,onChange:P=>y(P.target.value)}),u&&v&&u!==v&&j.jsx(Te,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Passwords must match"})]}),I&&j.jsxs(ve,{alignSelf:"center",alignItems:"center",gap:"1",children:[j.jsx(Jp,{size:"md"}),j.jsx(Te,{variant:"small",color:"text80",children:"Looking for wallet address..."})]}),a.length>0&&j.jsx(gke,{possibleWallets:a,handleSelectWallet:P=>C(P)}),x&&j.jsxs(ve,{flexDirection:"column",gap:"1",children:[j.jsx(Te,{variant:"normal",fontWeight:"bold",color:"text80",children:"Enter wallet address manually"}),j.jsx(Sn,{name:"wallet",labelLocation:"top",value:s,onChange:P=>C(P.target.value)})]}),ie&&j.jsxs(ve,{alignSelf:"center",alignItems:"center",gap:"1",children:[j.jsx(Jp,{size:"md"}),j.jsx(Te,{variant:"small",color:"text80",children:"Checking wallet address..."})]}),(L||!B())&&j.jsx(j.Fragment,{children:L?j.jsx(Te,{variant:"small",color:"negative",children:"No wallet match found. Try again in 10 min or enter a wallet address manually."}):j.jsx(Te,{variant:"small",color:"negative",children:"Invalid wallet address"})}),j.jsxs(ve,{flexDirection:"row",gap:"4",children:[!x&&j.jsx(Kt,{label:"Enter wallet address manually",size:t?"lg":"md",shape:"square",onClick:()=>A(!0),style:{whiteSpace:"normal"}}),j.jsx(Kt,{variant:"primary",size:t?"lg":"md",shape:"square",label:"Recover wallet",marginLeft:"auto",disabled:!l||!fg(s)||!u||u.length<8||u!==v||K===!1,onClick:()=>{g()},style:{whiteSpace:"normal"}})]})]}),k&&j.jsx(oa,{onClose:()=>n.isNetworkModalOpen.set(!1),children:j.jsx(Cte,{})})]})}const gGe=()=>{const t=ir(ai),e=Fr(t.accountAddress);return j.jsxs(k5e,{basename:"/",children:[j.jsxs(C5e,{children:[j.jsx(G6,{path:"/",element:e?j.jsx(Z9,{replace:!0,to:"/wallet"}):j.jsx(T_e,{})}),j.jsx(G6,{path:"recovery",element:e?j.jsx(Z9,{replace:!0,to:"/wallet"}):j.jsx(vGe,{})}),j.jsx(G6,{path:"wallet",element:e?j.jsx(pGe,{}):j.jsx(Z9,{replace:!0,to:"/"})})]}),j.jsx(E_e,{})]})},yGe=M6e();Y_.createRoot(document.getElementById("root")).render(j.jsx(qt.StrictMode,{children:j.jsx(O6e,{store:yGe,children:j.jsx(Bwe,{theme:"dark",children:j.jsx($3e,{children:j.jsx(gGe,{})})})})}));export{bke as _}; diff --git a/assets/index-B1sGzfvq.js b/assets/index-DktADLpu.js similarity index 98% rename from assets/index-B1sGzfvq.js rename to assets/index-DktADLpu.js index d17abc9..03f35fd 100644 --- a/assets/index-B1sGzfvq.js +++ b/assets/index-DktADLpu.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DAHiIkie.js","assets/index-DZan3ykS.js","assets/index-BJqNCU1U.css"])))=>i.map(i=>d[i]); -import{_ as pe}from"./index-DZan3ykS.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(w,!0),l.set(o,[g,w]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(w,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(w,j,A)}),Object.preventExtensions(w)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,w=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],w(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const k=r[3](A(U));y.set(U,[r,k])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),k=Reflect.get(i,a,h);if(U&&(e(k,r)||d.has(r)&&e(k,d.get(r))))return!0;Z(a),F(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,w(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,w(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),w(["set",[a],r,k]),!0}});d.set(o,R);const fe=[q,O,c,ue];return C.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,C,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.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(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},be=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:be,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({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}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Le=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=b.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=P({themeMode:Ue()?"dark":"light"}),ce={state:N,subscribe(e){return D(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-DAHiIkie.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,J as M,b as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CeuvvY4b.js","assets/index-Cfjx0TSH.js","assets/index-BJqNCU1U.css"])))=>i.map(i=>d[i]); +import{_ as pe}from"./index-Cfjx0TSH.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(w,!0),l.set(o,[g,w]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(w,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(w,j,A)}),Object.preventExtensions(w)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,w=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],w(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const k=r[3](A(U));y.set(U,[r,k])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),k=Reflect.get(i,a,h);if(U&&(e(k,r)||d.has(r)&&e(k,d.get(r))))return!0;Z(a),F(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,w(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,w(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),w(["set",[a],r,k]),!0}});d.set(o,R);const fe=[q,O,c,ue];return C.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,C,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.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(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},be=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:be,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({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}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Le=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=b.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=P({themeMode:Ue()?"dark":"light"}),ce={state:N,subscribe(e){return D(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-CeuvvY4b.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,J as M,b as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; diff --git a/index.html b/index.html index cc401f3..7f65cdb 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Sequence Recovery Wallet - +