@dcl/account-site 6.3.0 → 6.3.1-21684392011.commit-24a0dbb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{ConstantsUtil-D8fCl46_.js → ConstantsUtil-CM0JoORy.js} +1 -1
- package/assets/{ExchangeController-DRQ2radf.js → ExchangeController-BDZUsRT9.js} +1 -1
- package/assets/{HelpersUtil-DF_7B-XT.js → HelpersUtil-CjQE0S9b.js} +1 -1
- package/assets/{NetworkUtil-C1pHDiA2.js → NetworkUtil-B7F2Jab-.js} +1 -1
- package/assets/{SwapController-DeJ_cEnB.js → SwapController-fAYHu1LB.js} +1 -1
- package/assets/{ccip-C7XgSPe9.js → ccip-CLGtWj91.js} +1 -1
- package/assets/{ccip-M7NINyJq.js → ccip-DNd23S5x.js} +1 -1
- package/assets/{data-capture-CT5fS2He.js → data-capture-CHLvpUV9.js} +1 -1
- package/assets/{email-BNj_QT2N.js → email-A9gtqSdv.js} +1 -1
- package/assets/{embedded-wallet-BZXJrOR3.js → embedded-wallet-ZDag0Xe1.js} +1 -1
- package/assets/{features-DbdRQbkb.js → features-Bk1VL8VI.js} +1 -1
- package/assets/{fortmatic-Bfeo988X.js → fortmatic-CU7f1C8O.js} +1 -1
- package/assets/{if-defined-CmDEyf7_.js → if-defined-CU5rjy4y.js} +1 -1
- package/assets/{index-Dk5ADCAT.js → index-AChAn5uS.js} +1 -1
- package/assets/{index-B07fJW_M.js → index-B-tlGQu6.js} +1 -1
- package/assets/{index-CLLZ1ipK.js → index-B15SRAmV.js} +1 -1
- package/assets/{index-DT2L_2ss.js → index-BIF8Dlvu.js} +1 -1
- package/assets/{index-BUIexZYW.js → index-BJ4UmNcx.js} +1 -1
- package/assets/{index-CM0VA1ux.js → index-BKTrJtK7.js} +1 -1
- package/assets/{index-Dmy6Zfrl.js → index-BUVFHLlr.js} +1 -1
- package/assets/{index-DSlUMu2W.js → index-BdBq6Igs.js} +1 -1
- package/assets/{index-CYilzGHg.js → index-BeofziA8.js} +1 -1
- package/assets/{index-Dw80EfE1.js → index-BhP3XbO4.js} +1 -1
- package/assets/{index-wfmWujYn.js → index-BkQvMrzE.js} +1 -1
- package/assets/{index-ChtzFhd8.js → index-BlzPmmvu.js} +1 -1
- package/assets/{index-WAgTn_p9.js → index-BocFeNiS.js} +1 -1
- package/assets/{index-Cks8Gva6.js → index-BpwH7C1A.js} +1 -1
- package/assets/{index-CR14xSZ1.js → index-CJwhDFs1.js} +1 -1
- package/assets/{index-CaCb5mI3.js → index-CTvRFCFv.js} +1 -1
- package/assets/{index-Cju0w4jG.js → index-CWD6uQYZ.js} +1 -1
- package/assets/{index--LkjqZ20.js → index-CfNMkRWR.js} +4 -4
- package/assets/{index-Ch0zegEi.js → index-CqqdXuN4.js} +1 -1
- package/assets/{index-BR4OFDim.js → index-CyVsfiK0.js} +1 -1
- package/assets/{index-Dex0-OU2.js → index-CzPBWTgH.js} +1 -1
- package/assets/{index-CgtsyC9I.js → index-DCUIXxx4.js} +1 -1
- package/assets/{index-CUhYMdk_.js → index-DFnpQY_f.js} +1 -1
- package/assets/index-DPJ73qp9.js +7 -0
- package/assets/{index-Dwcws8LC.js → index-DUSIVMYc.js} +1 -1
- package/assets/{index-CQ1cI-Zj.js → index-DVhkZrcL.js} +1 -1
- package/assets/{index-DyLZVEsN.js → index-DWL4mpG7.js} +1 -1
- package/assets/{index-DSPHxh5i.js → index-DeTa4egT.js} +1 -1
- package/assets/{index-DdQ0eE-G.js → index-Dnl66e78.js} +1 -1
- package/assets/{index-BrbSHYTX.js → index-JvpOadvV.js} +1 -1
- package/assets/{index-DcYDqrut.js → index-OJpijto3.js} +1 -1
- package/assets/{index-CsESCjxY.js → index-SEsKmThl.js} +1 -1
- package/assets/{index-BbseWAFJ.js → index-YXhPM253.js} +1 -1
- package/assets/{index-C7oGPpaL.js → index-g1eNt2DN.js} +16 -16
- package/assets/{index-BD7xvZvh.js → index-kAhp1ihs.js} +1 -1
- package/assets/{index-DfxzfZnN.js → index-oLft3y8M.js} +1 -1
- package/assets/{index-CsGx_C2i.css → index-ynbLn7L1.css} +3 -3
- package/assets/{index.web-BmX8cxMq.js → index.web-DtcGpmF5.js} +1 -1
- package/assets/{networks-D6RQiiGp.js → networks-CCE_PcUj.js} +1 -1
- package/assets/{onramp-HEbuIx5u.js → onramp-DLtAhTI1.js} +1 -1
- package/assets/{pay-with-exchange-D4wYtYZK.js → pay-with-exchange-DTwrcFgj.js} +1 -1
- package/assets/{receive-ChY0CPZY.js → receive-BxjN-oOv.js} +1 -1
- package/assets/{ref-D3SKCpzg.js → ref-Ci8-4xdm.js} +1 -1
- package/assets/{secp256k1-4xJu1xA7.js → secp256k1-DvlHmgU2.js} +1 -1
- package/assets/{send-Bl3nu8cH.js → send-DS95zySY.js} +1 -1
- package/assets/{socials-AtPv4rYZ.js → socials-CoaWTkpp.js} +1 -1
- package/assets/{swaps-CHm7AABh.js → swaps-BoF4Cvv2.js} +1 -1
- package/assets/{transactions-YcwaqPFH.js → transactions-CSR7vUH-.js} +1 -1
- package/assets/{verifyHash-DeY2ZqQJ.js → verifyHash-CpYy7CEV.js} +3 -3
- package/assets/{w3m-modal-DJIfB5Aq.js → w3m-modal-DvhpxcoR.js} +1 -1
- package/index.html +2 -2
- package/package.json +3 -3
- package/assets/index-CfncZko9.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{O as x,ax as Kr,a4 as O,ay as ja,az as Zl,aA as Ql,aB as Kl,aC as Xl,aD as Pt,aE as yi,aF as tr,aG as $a,ac as Ha,aH as Yl,b as eu,aI as wi,aJ as tu,g as ru}from"./index-g1eNt2DN.js";function nu(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var vi={},Kt={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.walletLogo=void 0;const su=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Xr.walletLogo=su;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.LINK_API_URL=void 0;Yr.LINK_API_URL="https://www.walletlink.org";var S={},rr={},We={};Object.defineProperty(We,"__esModule",{value:!0});We.errorValues=We.standardErrorCodes=void 0;We.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};We.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var en={},tn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=We,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,f=r){if(h&&Number.isInteger(h)){const b=h.toString();if(u(t.errorValues,b))return t.errorValues[b].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||c(h))}e.isValidCode=s;function i(h){var f;if(typeof h=="number")return h;if(o(h))return(f=h.code)!==null&&f!==void 0?f:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:f=!1}={}){const b={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&s(h.code)){const g=h;b.code=g.code,g.message&&typeof g.message=="string"?(b.message=g.message,u(g,"data")&&(b.data=g.data)):(b.message=n(b.code),b.data={originalError:l(h)})}else b.code=t.standardErrorCodes.rpc.internal,b.message=d(h,"message")?h.message:r,b.data={originalError:l(h)};return f&&(b.stack=d(h,"stack")?h.stack:void 0),b}e.serialize=a;function c(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,f){return Object.prototype.hasOwnProperty.call(h,f)}function d(h,f){return typeof h=="object"&&h!==null&&f in h&&typeof h[f]=="string"}})(tn);Object.defineProperty(en,"__esModule",{value:!0});en.standardErrors=void 0;const ue=We,Ua=tn;en.standardErrors={rpc:{parse:e=>ve(ue.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ve(ue.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ve(ue.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ve(ue.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ve(ue.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ve(t,e)},invalidInput:e=>ve(ue.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ve(ue.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ve(ue.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ve(ue.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ve(ue.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ve(ue.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>pt(ue.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>pt(ue.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>pt(ue.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>pt(ue.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>pt(ue.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>pt(ue.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new za(t,r,n)}}};function ve(e,t){const[r,n]=Va(t);return new Wa(e,r||(0,Ua.getMessageFromCode)(e),n)}function pt(e,t){const[r,n]=Va(t);return new za(e,r||(0,Ua.getMessageFromCode)(e),n)}function Va(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Wa=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},za=class extends Wa{constructor(t,r,n){if(!iu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function iu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var rn={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.isErrorResponse=void 0;function ou(e){return e.errorMessage!==void 0}Ot.isErrorResponse=ou;var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.LIB_VERSION=void 0;Bt.LIB_VERSION="3.9.3";Object.defineProperty(rn,"__esModule",{value:!0});rn.serializeError=void 0;const au=Ot,cu=Bt,lu=We,uu=tn;function du(e,t){const r=(0,uu.serialize)(hu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",cu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=fu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}rn.serializeError=du;function hu(e){return typeof e=="string"?{message:e,code:lu.standardErrorCodes.rpc.internal}:(0,au.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function fu(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=We;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=en;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=rn;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=tn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(rr);var ie={};Object.defineProperty(ie,"__esModule",{value:!0});ie.ProviderType=ie.RegExpString=ie.IntNumber=ie.BigIntString=ie.AddressString=ie.HexString=ie.OpaqueType=void 0;function nr(){return e=>e}ie.OpaqueType=nr;ie.HexString=nr();ie.AddressString=nr();ie.BigIntString=nr();function gu(e){return Math.floor(e)}ie.IntNumber=gu;ie.RegExpString=nr();var Eo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Eo||(ie.ProviderType=Eo={}));var pu=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S,"__esModule",{value:!0});S.isMobileWeb=S.getLocation=S.isInIFrame=S.createQrUrl=S.getFavicon=S.range=S.isBigNumber=S.ensureParsedJSONObject=S.ensureBN=S.ensureRegExpString=S.ensureIntNumber=S.ensureBuffer=S.ensureAddressString=S.ensureEvenLengthHexString=S.ensureHexString=S.isHexString=S.prepend0x=S.strip0x=S.has0xPrefix=S.hexStringFromIntNumber=S.intNumberFromHexString=S.bigIntStringFromBN=S.hexStringFromBuffer=S.hexStringToUint8Array=S.uint8ArrayToHex=S.randomBytesHex=void 0;const Ge=pu(Kr()),ut=rr,Ce=ie,qa=/^[0-9]*$/,Ja=/^[a-f0-9]*$/;function _u(e){return Ga(crypto.getRandomValues(new Uint8Array(e)))}S.randomBytesHex=_u;function Ga(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}S.uint8ArrayToHex=Ga;function mu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}S.hexStringToUint8Array=mu;function bu(e,t=!1){const r=e.toString("hex");return(0,Ce.HexString)(t?`0x${r}`:r)}S.hexStringFromBuffer=bu;function yu(e){return(0,Ce.BigIntString)(e.toString(10))}S.bigIntStringFromBN=yu;function wu(e){return(0,Ce.IntNumber)(new Ge.default(ir(e,!1),16).toNumber())}S.intNumberFromHexString=wu;function vu(e){return(0,Ce.HexString)(`0x${new Ge.default(e).toString(16)}`)}S.hexStringFromIntNumber=vu;function Ei(e){return e.startsWith("0x")||e.startsWith("0X")}S.has0xPrefix=Ei;function nn(e){return Ei(e)?e.slice(2):e}S.strip0x=nn;function Za(e){return Ei(e)?`0x${e.slice(2)}`:`0x${e}`}S.prepend0x=Za;function sr(e){if(typeof e!="string")return!1;const t=nn(e).toLowerCase();return Ja.test(t)}S.isHexString=sr;function Qa(e,t=!1){if(typeof e=="string"){const r=nn(e).toLowerCase();if(Ja.test(r))return(0,Ce.HexString)(t?`0x${r}`:r)}throw ut.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}S.ensureHexString=Qa;function ir(e,t=!1){let r=Qa(e,!1);return r.length%2===1&&(r=(0,Ce.HexString)(`0${r}`)),t?(0,Ce.HexString)(`0x${r}`):r}S.ensureEvenLengthHexString=ir;function Eu(e){if(typeof e=="string"){const t=nn(e).toLowerCase();if(sr(t)&&t.length===40)return(0,Ce.AddressString)(Za(t))}throw ut.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}S.ensureAddressString=Eu;function Su(e){if(O.isBuffer(e))return e;if(typeof e=="string"){if(sr(e)){const t=ir(e,!1);return O.from(t,"hex")}return O.from(e,"utf8")}throw ut.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}S.ensureBuffer=Su;function Ka(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Ce.IntNumber)(e);if(typeof e=="string"){if(qa.test(e))return(0,Ce.IntNumber)(Number(e));if(sr(e))return(0,Ce.IntNumber)(new Ge.default(ir(e,!1),16).toNumber())}throw ut.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureIntNumber=Ka;function ku(e){if(e instanceof RegExp)return(0,Ce.RegExpString)(e.toString());throw ut.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}S.ensureRegExpString=ku;function Cu(e){if(e!==null&&(Ge.default.isBN(e)||Xa(e)))return new Ge.default(e.toString(10),10);if(typeof e=="number")return new Ge.default(Ka(e));if(typeof e=="string"){if(qa.test(e))return new Ge.default(e,10);if(sr(e))return new Ge.default(ir(e,!1),16)}throw ut.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureBN=Cu;function Ru(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw ut.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}S.ensureParsedJSONObject=Ru;function Xa(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}S.isBigNumber=Xa;function Iu(e,t){return Array.from({length:t-e},(r,n)=>e+n)}S.range=Iu;function Au(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}S.getFavicon=Au;function xu(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}S.createQrUrl=xu;function Ya(){try{return window.frameElement!==null}catch{return!1}}S.isInIFrame=Ya;function Nu(){try{return Ya()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=Nu;function Lu(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}S.isMobileWeb=Lu;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.ScopedLocalStorage=void 0;class Mu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}sn.ScopedLocalStorage=Mu;var Rt={},or={},ar={},Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.EVENTS=void 0;Dt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ke={};Object.defineProperty(ke,"__esModule",{value:!0});ke.RelayAbstract=ke.APP_VERSION_KEY=ke.LOCAL_STORAGE_ADDRESSES_KEY=ke.WALLET_USER_NAME_KEY=void 0;const So=rr;ke.WALLET_USER_NAME_KEY="walletUsername";ke.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ke.APP_VERSION_KEY="AppVersion";class Tu{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw So.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,So.serializeError)(i,t.method);return s})}}ke.RelayAbstract=Tu;var Ft={},ec={exports:{}},oi={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=ja(),n=r.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(o,a,c){return n(o,a,c)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(oi,oi.exports);var dt=oi.exports,ai={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=ja(),n=r.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(o,a,c){return n(o,a,c)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(ai,ai.exports);var Pu=ai.exports,$s,ko;function Ou(){if(ko)return $s;ko=1;var e=Zl;return $s=function(r){return!!e(r)},$s}var Bu=Kl,Du=Ql,Fu=Du("TypedArray.prototype.buffer",!0),ju=Ou(),$u=Fu||function(t){if(!ju(t))throw new Bu("Not a Typed Array");return t.buffer},Ne=Pu.Buffer,Hu=Xl,Uu=$u,Vu=ArrayBuffer.isView||function(t){try{return Uu(t),!0}catch{return!1}},Wu=typeof Uint8Array<"u",tc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",zu=tc&&(Ne.prototype instanceof Uint8Array||Ne.TYPED_ARRAY_SUPPORT),qu=function(t,r){if(Ne.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Ne.from(t):t;if(typeof t=="string")return Ne.from(t,r);if(tc&&Vu(t)){if(t.byteLength===0)return Ne.alloc(0);if(zu){var n=Ne.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var s=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i=Ne.from(s);if(i.length===t.byteLength)return i}if(Wu&&t instanceof Uint8Array)return Ne.from(t);var o=Hu(t);if(o)for(var a=0;a<t.length;a+=1){var c=t[a];if(typeof c!="number"||c<0||c>255||~~c!==c)throw new RangeError("Array items must be numbers in the range 0-255.")}if(o||Ne.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Ne.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Ju=dt.Buffer,Gu=qu;function on(e,t){this._block=Ju.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}on.prototype.update=function(e,t){e=Gu(e,t||"utf8");for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,o=0;o<s;){for(var a=i%n,c=Math.min(s-o,n-a),l=0;l<c;l++)r[a+l]=e[o+l];i+=c,o+=c,i%n===0&&this._update(r)}return this._len+=s,this};on.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};on.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var jt=on,Zu=Pt,rc=jt,Qu=dt.Buffer,Ku=[1518500249,1859775393,-1894007588,-899497514],Xu=new Array(80);function cr(){this.init(),this._w=Xu,rc.call(this,64,56)}Zu(cr,rc);cr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Yu(e){return e<<5|e>>>27}function ed(e){return e<<30|e>>>2}function td(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}cr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var c=0;c<80;++c){var l=~~(c/20),u=Yu(r)+td(l,n,s,i)+o+t[c]+Ku[l]|0;o=i,i=s,s=ed(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};cr.prototype._hash=function(){var e=Qu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var rd=cr,nd=Pt,nc=jt,sd=dt.Buffer,id=[1518500249,1859775393,-1894007588,-899497514],od=new Array(80);function lr(){this.init(),this._w=od,nc.call(this,64,56)}nd(lr,nc);lr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ad(e){return e<<1|e>>>31}function cd(e){return e<<5|e>>>27}function ld(e){return e<<30|e>>>2}function ud(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}lr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=ad(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),u=cd(r)+ud(l,n,s,i)+o+t[c]+id[l]|0;o=i,i=s,s=ld(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};lr.prototype._hash=function(){var e=sd.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var dd=lr,hd=Pt,sc=jt,fd=dt.Buffer,gd=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],pd=new Array(64);function ur(){this.init(),this._w=pd,sc.call(this,64,56)}hd(ur,sc);ur.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function _d(e,t,r){return r^e&(t^r)}function md(e,t,r){return e&t|r&(e|t)}function bd(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function yd(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function wd(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function vd(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}ur.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<64;++u)t[u]=vd(t[u-2])+t[u-7]+wd(t[u-15])+t[u-16]|0;for(var d=0;d<64;++d){var h=l+yd(o)+_d(o,a,c)+gd[d]+t[d]|0,f=bd(r)+md(r,n,s)|0;l=c,c=a,a=o,o=i+h|0,i=s,s=n,n=r,r=h+f|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};ur.prototype._hash=function(){var e=fd.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ic=ur,Ed=Pt,Sd=ic,kd=jt,Cd=dt.Buffer,Rd=new Array(64);function an(){this.init(),this._w=Rd,kd.call(this,64,56)}Ed(an,Sd);an.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};an.prototype._hash=function(){var e=Cd.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Id=an,Ad=Pt,oc=jt,xd=dt.Buffer,Co=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Nd=new Array(160);function dr(){this.init(),this._w=Nd,oc.call(this,128,112)}Ad(dr,oc);dr.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ro(e,t,r){return r^e&(t^r)}function Io(e,t,r){return e&t|r&(e|t)}function Ao(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function xo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Ld(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Md(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Td(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Pd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ce(e,t){return e>>>0<t>>>0?1:0}dr.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,u=this._al|0,d=this._bl|0,h=this._cl|0,f=this._dl|0,b=this._el|0,g=this._fl|0,E=this._gl|0,y=this._hl|0,p=0;p<32;p+=2)t[p]=e.readInt32BE(p*4),t[p+1]=e.readInt32BE(p*4+4);for(;p<160;p+=2){var _=t[p-30],A=t[p-15*2+1],v=Ld(_,A),N=Md(A,_);_=t[p-2*2],A=t[p-2*2+1];var V=Td(_,A),Z=Pd(A,_),ee=t[p-7*2],z=t[p-7*2+1],W=t[p-16*2],H=t[p-16*2+1],se=N+z|0,w=v+ee+ce(se,N)|0;se=se+Z|0,w=w+V+ce(se,Z)|0,se=se+H|0,w=w+W+ce(se,H)|0,t[p]=w,t[p+1]=se}for(var m=0;m<160;m+=2){w=t[m],se=t[m+1];var R=Io(r,n,s),C=Io(u,d,h),I=Ao(r,u),k=Ao(u,r),L=xo(o,b),D=xo(b,o),T=Co[m],U=Co[m+1],ae=Ro(o,a,c),J=Ro(b,g,E),te=y+D|0,Ie=l+L+ce(te,y)|0;te=te+J|0,Ie=Ie+ae+ce(te,J)|0,te=te+U|0,Ie=Ie+T+ce(te,U)|0,te=te+se|0,Ie=Ie+w+ce(te,se)|0;var Wt=k+C|0,Nr=I+R+ce(Wt,k)|0;l=c,y=E,c=a,E=g,a=o,g=b,b=f+te|0,o=i+Ie+ce(b,f)|0,i=s,f=h,s=n,h=d,n=r,d=u,u=te+Wt|0,r=Ie+Nr+ce(u,te)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+h|0,this._dl=this._dl+f|0,this._el=this._el+b|0,this._fl=this._fl+g|0,this._gl=this._gl+E|0,this._hl=this._hl+y|0,this._ah=this._ah+r+ce(this._al,u)|0,this._bh=this._bh+n+ce(this._bl,d)|0,this._ch=this._ch+s+ce(this._cl,h)|0,this._dh=this._dh+i+ce(this._dl,f)|0,this._eh=this._eh+o+ce(this._el,b)|0,this._fh=this._fh+a+ce(this._fl,g)|0,this._gh=this._gh+c+ce(this._gl,E)|0,this._hh=this._hh+l+ce(this._hl,y)|0};dr.prototype._hash=function(){var e=xd.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var ac=dr,Od=Pt,Bd=ac,Dd=jt,Fd=dt.Buffer,jd=new Array(160);function cn(){this.init(),this._w=jd,Dd.call(this,128,112)}Od(cn,Bd);cn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};cn.prototype._hash=function(){var e=Fd.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var $d=cn;(function(e){e.exports=function(r){var n=r.toLowerCase(),s=e.exports[n];if(!s)throw new Error(n+" is not supported (we accept pull requests)");return new s},e.exports.sha=rd,e.exports.sha1=dd,e.exports.sha224=Id,e.exports.sha256=ic,e.exports.sha384=$d,e.exports.sha512=ac})(ec);var Hd=ec.exports;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.Session=void 0;const No=Hd,Lo=S,Mo="session:id",To="session:secret",Po="session:linked";class Si{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Lo.randomBytesHex)(16),this._secret=n||(0,Lo.randomBytesHex)(32),this._key=new No.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Mo),n=t.getItem(Po),s=t.getItem(To);return r&&s?new Si(t,r,s,n==="1"):null}static hash(t){return new No.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Mo,this._id),this._storage.setItem(To,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Po,this._linked?"1":"0")}}Ft.Session=Si;var ln={},un={};Object.defineProperty(un,"__esModule",{value:!0});un.Cipher=void 0;const Lr=S;class Ud{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Lr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),d=new Uint8Array(l),h=new Uint8Array([...n,...u,...d]);return(0,Lr.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Lr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Lr.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,i,u),f=new TextDecoder;n(f.decode(h))}catch(h){s(h)}})()})}}un.Cipher=Ud;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.WalletLinkHTTP=void 0;class Vd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}dn.WalletLinkHTTP=Vd;var It={};Object.defineProperty(It,"__esModule",{value:!0});It.WalletLinkWebSocket=It.ConnectionState=void 0;var vt;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(vt||(It.ConnectionState=vt={}));class Wd{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,vt.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,vt.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,vt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,vt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}It.WalletLinkWebSocket=Wd;Object.defineProperty(ln,"__esModule",{value:!0});ln.WalletLinkConnection=void 0;const _t=ie,zd=un,Me=Dt,Oo=ke,mt=Ft,qd=dn,Mr=It,Bo=1e4,Jd=6e4;class Gd{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,_t.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,u)=>{const d=a[u];d!==void 0&&l(d)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Me.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:mt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const u=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(u)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Oo.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Oo.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(a),h=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(d,h)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new zd.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new Mr.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Me.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:mt.Session.hash(t.id)});let l=!1;switch(a){case Mr.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(d=>setTimeout(d,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case Mr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Bo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Mr.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(Me.EVENTS.LINKED,{sessionIdHash:mt.Session.hash(t.id),linked:d,type:a.type,onlineGuests:a.onlineGuests}),this.linked=d||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Me.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:mt.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new qd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Me.EVENTS.STARTED_CONNECTING,{sessionIdHash:mt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Me.EVENTS.DISCONNECTED,{sessionIdHash:mt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,_t.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,_t.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Bo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Jd){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,_t.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,_t.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,_t.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}ln.WalletLinkConnection=Gd;var hr={},fr={},ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Zd=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fr,"__esModule",{value:!0});fr.injectCssReset=void 0;const Qd=Zd(ki);function Kd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Qd.default)),document.documentElement.appendChild(e)}fr.injectCssReset=Kd;var hn={},gr,G,cc,lc,rt,Do,uc,dc,hc,Ci,ci,li,fc,Xt={},gc=[],Xd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pr=Array.isArray;function Fe(e,t){for(var r in t)e[r]=t[r];return e}function Ri(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ui(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?gr.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Gt(e,o,n,s,null)}function Gt(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++cc,__i:-1,__u:0};return s==null&&G.vnode!=null&&G.vnode(i),i}function Yd(){return{current:null}}function _r(e){return e.children}function Zt(e,t){this.props=e,this.context=t}function At(e,t){if(t==null)return e.__?At(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?At(e):null}function pc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return pc(e)}}function di(e){(!e.__d&&(e.__d=!0)&&rt.push(e)&&!Jr.__r++||Do!=G.debounceRendering)&&((Do=G.debounceRendering)||uc)(Jr)}function Jr(){for(var e,t,r,n,s,i,o,a=1;rt.length;)rt.length>a&&rt.sort(dc),e=rt.shift(),a=rt.length,e.__d&&(r=void 0,n=void 0,s=(n=(t=e).__v).__e,i=[],o=[],t.__P&&((r=Fe({},n)).__v=n.__v+1,G.vnode&&G.vnode(r),Ii(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[s]:null,i,s??At(n),!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,yc(i,r,o),n.__e=n.__=null,r.__e!=s&&pc(r)));Jr.__r=0}function _c(e,t,r,n,s,i,o,a,c,l,u){var d,h,f,b,g,E,y,p=n&&n.__k||gc,_=t.length;for(c=eh(r,t,p,c,_),d=0;d<_;d++)(f=r.__k[d])!=null&&(h=f.__i==-1?Xt:p[f.__i]||Xt,f.__i=d,E=Ii(e,f,h,s,i,o,a,c,l,u),b=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Ai(h.ref,null,f),u.push(f.ref,f.__c||b,f)),g==null&&b!=null&&(g=b),(y=!!(4&f.__u))||h.__k===f.__k?c=mc(f,c,e,y):typeof f.type=="function"&&E!==void 0?c=E:b&&(c=b.nextSibling),f.__u&=-7);return r.__e=g,c}function eh(e,t,r,n,s){var i,o,a,c,l,u=r.length,d=u,h=0;for(e.__k=new Array(s),i=0;i<s;i++)(o=t[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[i]=Gt(null,o,null,null,null):pr(o)?o=e.__k[i]=Gt(_r,{children:o},null,null,null):o.constructor==null&&o.__b>0?o=e.__k[i]=Gt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[i]=o,c=i+h,o.__=e,o.__b=e.__b+1,(l=o.__i=th(o,r,c,d))!=-1&&(d--,(a=r[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(s>u?h--:s<u&&h++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,o.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)(a=r[i])!=null&&!(2&a.__u)&&(a.__e==n&&(n=At(a)),vc(a,a));return n}function mc(e,t,r,n){var s,i;if(typeof e.type=="function"){for(s=e.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=e,t=mc(s[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=At(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function bc(e,t){return t=t||[],e==null||typeof e=="boolean"||(pr(e)?e.some(function(r){bc(r,t)}):t.push(e)),t}function th(e,t,r,n){var s,i,o,a=e.key,c=e.type,l=t[r],u=l!=null&&(2&l.__u)==0;if(l===null&&a==null||u&&a==l.key&&c==l.type)return r;if(n>(u?1:0)){for(s=r-1,i=r+1;s>=0||i<t.length;)if((l=t[o=s>=0?s--:i++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return o}return-1}function Fo(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Xd.test(t)?r:r+"px"}function Tr(e,t,r,n,s){var i,o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Fo(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Fo(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(hc,"$1")),o=t.toLowerCase(),t=o in e||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Ci,e.addEventListener(t,i?li:ci,i)):e.removeEventListener(t,i?li:ci,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function jo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ci++;else if(t.t<r.u)return;return r(G.event?G.event(t):t)}}}function Ii(e,t,r,n,s,i,o,a,c,l){var u,d,h,f,b,g,E,y,p,_,A,v,N,V,Z,ee,z,W=t.type;if(t.constructor!=null)return null;128&r.__u&&(c=!!(32&r.__u),i=[a=t.__e=r.__e]),(u=G.__b)&&u(t);e:if(typeof W=="function")try{if(y=t.props,p="prototype"in W&&W.prototype.render,_=(u=W.contextType)&&n[u.__c],A=u?_?_.props.value:u.__:n,r.__c?E=(d=t.__c=r.__c).__=d.__E:(p?t.__c=d=new W(y,A):(t.__c=d=new Zt(y,A),d.constructor=W,d.render=nh),_&&_.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),p&&d.__s==null&&(d.__s=d.state),p&&W.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Fe({},d.__s)),Fe(d.__s,W.getDerivedStateFromProps(y,d.__s))),f=d.props,b=d.state,d.__v=t,h)p&&W.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),p&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(p&&W.getDerivedStateFromProps==null&&y!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,A),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,A)===!1){for(t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(H){H&&(H.__=t)}),v=0;v<d._sb.length;v++)d.__h.push(d._sb[v]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,A),p&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,b,g)})}if(d.context=A,d.props=y,d.__P=e,d.__e=!1,N=G.__r,V=0,p){for(d.state=d.__s,d.__d=!1,N&&N(t),u=d.render(d.props,d.state,d.context),Z=0;Z<d._sb.length;Z++)d.__h.push(d._sb[Z]);d._sb=[]}else do d.__d=!1,N&&N(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++V<25);d.state=d.__s,d.getChildContext!=null&&(n=Fe(Fe({},n),d.getChildContext())),p&&!h&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,b)),ee=u,u!=null&&u.type===_r&&u.key==null&&(ee=wc(u.props.children)),a=_c(e,pr(ee)?ee:[ee],t,r,n,s,i,o,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),E&&(d.__E=d.__=null)}catch(H){if(t.__v=null,c||i!=null)if(H.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else{for(z=i.length;z--;)Ri(i[z]);hi(t)}else t.__e=r.__e,t.__k=r.__k,H.then||hi(t);G.__e(H,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=rh(r.__e,t,r,n,s,i,o,c,l);return(u=G.diffed)&&u(t),128&t.__u?void 0:a}function hi(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(hi)}function yc(e,t,r){for(var n=0;n<r.length;n++)Ai(r[n],r[++n],r[++n]);G.__c&&G.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){G.__e(i,s.__v)}})}function wc(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:pr(e)?e.map(wc):Fe({},e)}function rh(e,t,r,n,s,i,o,a,c){var l,u,d,h,f,b,g,E=r.props||Xt,y=t.props,p=t.type;if(p=="svg"?s="http://www.w3.org/2000/svg":p=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!p&&(p?f.localName==p:f.nodeType==3)){e=f,i[l]=null;break}}if(e==null){if(p==null)return document.createTextNode(y);e=document.createElementNS(s,p,y.is&&y),a&&(G.__m&&G.__m(t,i),a=!1),i=null}if(p==null)E===y||a&&e.data==y||(e.data=y);else{if(i=i&&gr.call(e.childNodes),!a&&i!=null)for(E={},l=0;l<e.attributes.length;l++)E[(f=e.attributes[l]).name]=f.value;for(l in E)if(f=E[l],l!="children"){if(l=="dangerouslySetInnerHTML")d=f;else if(!(l in y)){if(l=="value"&&"defaultValue"in y||l=="checked"&&"defaultChecked"in y)continue;Tr(e,l,null,f,s)}}for(l in y)f=y[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?u=f:l=="value"?b=f:l=="checked"?g=f:a&&typeof f!="function"||E[l]===f||Tr(e,l,f,E[l],s);if(u)a||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),_c(t.type=="template"?e.content:e,pr(h)?h:[h],t,r,n,p=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&At(r,0),a,c),i!=null)for(l=i.length;l--;)Ri(i[l]);a||(l="value",p=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[l]||p=="progress"&&!b||p=="option"&&b!=E[l])&&Tr(e,l,b,E[l],s),l="checked",g!=null&&g!=e[l]&&Tr(e,l,g,E[l],s))}return e}function Ai(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){G.__e(s,r)}}function vc(e,t,r){var n,s;if(G.unmount&&G.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Ai(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){G.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&vc(n[s],t,r||typeof e.type!="function");r||Ri(e.__e),e.__c=e.__=e.__e=void 0}function nh(e,t,r){return this.constructor(e,r)}function Ec(e,t,r){var n,s,i,o;t==document&&(t=document.documentElement),G.__&&G.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],Ii(t,e=(!n&&r||t).__k=ui(_r,null,[e]),s||Xt,Xt,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?gr.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,o),yc(i,e,o)}function Sc(e,t){Ec(e,t,Sc)}function sh(e,t,r){var n,s,i,o,a=Fe({},e.props);for(i in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?s=t[i]:a[i]=t[i]===void 0&&o!=null?o[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?gr.call(arguments,2):r),Gt(e.type,a,n||e.key,s||e.ref,null)}function ih(e){function t(r){var n,s;return this.getChildContext||(n=new Set,(s={})[t.__c]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&n.forEach(function(o){o.__e=!0,di(o)})},this.sub=function(i){n.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){n&&n.delete(i),o&&o.call(i)}}),r.children}return t.__c="__cC"+fc++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t}gr=gc.slice,G={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},cc=0,lc=function(e){return e!=null&&e.constructor==null},Zt.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Fe({},this.state),typeof e=="function"&&(e=e(Fe({},r),this.props)),e&&Fe(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),di(this))},Zt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),di(this))},Zt.prototype.render=_r,rt=[],uc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,dc=function(e,t){return e.__v.__b-t.__v.__b},Jr.__r=0,hc=/(PointerCapture)$|Capture$/i,Ci=0,ci=jo(!1),li=jo(!0),fc=0;const oh=Object.freeze(Object.defineProperty({__proto__:null,Component:Zt,Fragment:_r,cloneElement:sh,createContext:ih,createElement:ui,createRef:Yd,h:ui,hydrate:Sc,get isValidElement(){return lc},get options(){return G},render:Ec,toChildArray:bc},Symbol.toStringTag,{value:"Module"})),_e=yi(oh);var fn={},ze,q,Hs,$o,xt=0,kc=[],X=G,Ho=X.__b,Uo=X.__r,Vo=X.diffed,Wo=X.__c,zo=X.unmount,qo=X.__;function ht(e,t){X.__h&&X.__h(q,e,xt||t),xt=0;var r=q.__H||(q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Cc(e){return xt=1,Rc(Ac,e)}function Rc(e,t,r){var n=ht(ze++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Ac(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=q,!q.__f)){var s=function(a,c,l){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!i||i.call(this,a,c,l);var d=n.__c.props!==a;return u.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(d=!0)}}),i&&i.call(this,a,c,l)||d};q.__f=!0;var i=q.shouldComponentUpdate,o=q.componentWillUpdate;q.componentWillUpdate=function(a,c,l){if(this.__e){var u=i;i=void 0,s(a,c,l),i=u}o&&o.call(this,a,c,l)},q.shouldComponentUpdate=s}return n.__N||n.__}function ah(e,t){var r=ht(ze++,3);!X.__s&&Ni(r.__H,t)&&(r.__=e,r.u=t,q.__H.__h.push(r))}function Ic(e,t){var r=ht(ze++,4);!X.__s&&Ni(r.__H,t)&&(r.__=e,r.u=t,q.__h.push(r))}function ch(e){return xt=5,xi(function(){return{current:e}},[])}function lh(e,t,r){xt=6,Ic(function(){if(typeof e=="function"){var n=e(t());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=t(),function(){return e.current=null}},r==null?r:r.concat(e))}function xi(e,t){var r=ht(ze++,7);return Ni(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function uh(e,t){return xt=8,xi(function(){return e},t)}function dh(e){var t=q.context[e.__c],r=ht(ze++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(q)),t.props.value):e.__}function hh(e,t){X.useDebugValue&&X.useDebugValue(t?t(e):e)}function fh(e){var t=ht(ze++,10),r=Cc();return t.__=e,q.componentDidCatch||(q.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function gh(){var e=ht(ze++,11);if(!e.__){for(var t=q.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function ph(){for(var e;e=kc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(zr),e.__H.__h.forEach(fi),e.__H.__h=[]}catch(t){e.__H.__h=[],X.__e(t,e.__v)}}X.__b=function(e){q=null,Ho&&Ho(e)},X.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),qo&&qo(e,t)},X.__r=function(e){Uo&&Uo(e),ze=0;var t=(q=e.__c).__H;t&&(Hs===q?(t.__h=[],q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(zr),t.__h.forEach(fi),t.__h=[],ze=0)),Hs=q},X.diffed=function(e){Vo&&Vo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(kc.push(t)!==1&&$o===X.requestAnimationFrame||(($o=X.requestAnimationFrame)||_h)(ph)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Hs=q=null},X.__c=function(e,t){t.some(function(r){try{r.__h.forEach(zr),r.__h=r.__h.filter(function(n){return!n.__||fi(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],X.__e(n,r.__v)}}),Wo&&Wo(e,t)},X.unmount=function(e){zo&&zo(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{zr(n)}catch(s){t=s}}),r.__H=void 0,t&&X.__e(t,r.__v))};var Jo=typeof requestAnimationFrame=="function";function _h(e){var t,r=function(){clearTimeout(n),Jo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Jo&&(t=requestAnimationFrame(r))}function zr(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function fi(e){var t=q;e.__c=e.__(),q=t}function Ni(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ac(e,t){return typeof t=="function"?t(e):t}const mh=Object.freeze(Object.defineProperty({__proto__:null,useCallback:uh,useContext:dh,useDebugValue:hh,useEffect:ah,useErrorBoundary:fh,useId:gh,useImperativeHandle:lh,useLayoutEffect:Ic,useMemo:xi,useReducer:Rc,useRef:ch,useState:Cc},Symbol.toStringTag,{value:"Module"})),gn=yi(mh);var Nt={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.CloseIcon=void 0;const Go=_e;function bh(e){return(0,Go.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Go.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}pn.CloseIcon=bh;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.CoinbaseWalletRound=void 0;const Pr=_e;function yh(e){return(0,Pr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Pr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Pr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,Pr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}_n.CoinbaseWalletRound=yh;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.QRCodeIcon=void 0;const zt=_e;function wh(e){return(0,zt.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,zt.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,zt.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,zt.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,zt.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}mn.QRCodeIcon=wh;var bn={};function xc(e){this.mode=ye.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}xc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function je(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}je.prototype={addData:function(e){var t=new xc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=je.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var o=i*s,a=0;a<this.modules[i].length;a++){var c=a*s,l=this.modules[i][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+s,o),n.lineTo(c+s,o+s),n.lineTo(c,o+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=K.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)i==-2||i==2||o==-2||o==2||i==0&&o==0?this.modules[n+i][s+o]=!0:this.modules[n+i][s+o]=!1}},setupTypeNumber:function(e){for(var t=K.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=K.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;i<e.length&&(c=(e[i]>>>s&1)==1);var l=K.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};je.PAD0=236;je.PAD1=17;je.createData=function(e,t,r){for(var n=De.getRSBlocks(e,t),s=new Nc,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),K.getLengthInBits(o.mode,e)),o.write(s)}for(var a=0,i=0;i<n.length;i++)a+=n[i].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(je.PAD0,8),s.getLengthInBits()>=a*8));)s.put(je.PAD1,8);return je.createBytes(s,n)};je.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),s=Math.max(s,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&e.buffer[u+r];r+=c;var d=K.getErrorCorrectPolynomial(l),h=new Et(i[a],d.getLength()-1),f=h.mod(d);o[a]=new Array(d.getLength()-1);for(var u=0;u<o[a].length;u++){var b=u+f.getLength()-o[a].length;o[a][u]=b>=0?f.get(b):0}}for(var g=0,u=0;u<t.length;u++)g+=t[u].totalCount;for(var E=new Array(g),y=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<i[a].length&&(E[y++]=i[a][u]);for(var u=0;u<s;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(E[y++]=o[a][u]);return E};var ye={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ze={L:1,M:0,Q:3,H:2},qe={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},K={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(e<<10|t)^K.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return K.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case qe.PATTERN000:return(t+r)%2==0;case qe.PATTERN001:return t%2==0;case qe.PATTERN010:return r%3==0;case qe.PATTERN011:return(t+r)%3==0;case qe.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case qe.PATTERN101:return t*r%2+t*r%3==0;case qe.PATTERN110:return(t*r%2+t*r%3)%2==0;case qe.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Et([1],0),r=0;r<e;r++)t=t.multiply(new Et([1,le.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ye.MODE_NUMBER:return 10;case ye.MODE_ALPHA_NUM:return 9;case ye.MODE_8BIT_BYTE:return 8;case ye.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ye.MODE_NUMBER:return 12;case ye.MODE_ALPHA_NUM:return 11;case ye.MODE_8BIT_BYTE:return 16;case ye.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ye.MODE_NUMBER:return 14;case ye.MODE_ALPHA_NUM:return 13;case ye.MODE_8BIT_BYTE:return 16;case ye.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)s+c<0||t<=s+c||a==0&&c==0||o==e.isDark(n+a,s+c)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var l=0;e.isDark(n,s)&&l++,e.isDark(n+1,s)&&l++,e.isDark(n,s+1)&&l++,e.isDark(n+1,s+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var u=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&u++;var d=Math.abs(100*u/t/t-50)/5;return r+=d*10,r}},le={glog:function(e){if(e<1)throw new Error("glog("+e+")");return le.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return le.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var de=0;de<8;de++)le.EXP_TABLE[de]=1<<de;for(var de=8;de<256;de++)le.EXP_TABLE[de]=le.EXP_TABLE[de-4]^le.EXP_TABLE[de-5]^le.EXP_TABLE[de-6]^le.EXP_TABLE[de-8];for(var de=0;de<255;de++)le.LOG_TABLE[le.EXP_TABLE[de]]=de;function Et(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Et.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=le.gexp(le.glog(this.get(r))+le.glog(e.get(n)));return new Et(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=le.glog(this.get(0))-le.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=le.gexp(le.glog(e.get(n))+t);return new Et(r,0).mod(e)}};function De(e,t){this.totalCount=e,this.dataCount=t}De.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];De.getRSBlocks=function(e,t){var r=De.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var o=r[i*3+0],a=r[i*3+1],c=r[i*3+2],l=0;l<o;l++)s.push(new De(a,c));return s};De.getRsBlockTable=function(e,t){switch(t){case Ze.L:return De.RS_BLOCK_TABLE[(e-1)*4+0];case Ze.M:return De.RS_BLOCK_TABLE[(e-1)*4+1];case Ze.Q:return De.RS_BLOCK_TABLE[(e-1)*4+2];case Ze.H:return De.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Nc(){this.buffer=[],this.length=0}Nc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Us=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Lc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Ze.L;case"M":return Ze.M;case"Q":return Ze.Q;case"H":return Ze.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var u=s(c),d=1,h=0,f=0,b=Us.length;f<=b;f++){var g=Us[f];if(!g)throw new Error("Content too long: expected "+h+" but got "+u);switch(l){case"L":h=g[0];break;case"M":h=g[1];break;case"Q":h=g[2];break;case"H":h=g[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(u<=h)break;d++}if(d>Us.length)throw new Error("Content too long");return d}function s(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new je(o,a),this.qrcode.addData(i),this.qrcode.make()}Lc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
|
|
2
|
+
`:"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),u=a/(c+2*t.padding),d=typeof t.join<"u"?!!t.join:!1,h=typeof t.swap<"u"?!!t.swap:!1,f=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,b=typeof t.predefined<"u"?!!t.predefined:!1,g=b?s+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+l+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",E=s+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,y="",p="",_=0;_<c;_++)for(var A=0;A<c;A++){var v=r[A][_];if(v){var N=A*l+t.padding*l,V=_*u+t.padding*u;if(h){var Z=N;N=V,V=Z}if(d){var ee=l+N,z=u+V;N=Number.isInteger(N)?Number(N):N.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),ee=Number.isInteger(ee)?Number(ee):ee.toFixed(2),z=Number.isInteger(z)?Number(z):z.toFixed(2),p+="M"+N+","+V+" V"+z+" H"+ee+" V"+V+" H"+N+" Z "}else b?y+=s+'<use x="'+N.toString()+'" y="'+V.toString()+'" href="#qrmodule" />'+i:y+=s+'<rect x="'+N.toString()+'" y="'+V.toString()+'" width="'+l+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}d&&(y=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+p+'" />');let W="";if(this.options.image!==void 0&&this.options.image.svg){const se=o*this.options.image.width/100,w=a*this.options.image.height/100,m=o/2-se/2,R=a/2-w/2;W+=`<svg x="${m}" y="${R}" width="${se}" height="${w}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,W+=this.options.image.svg+i,W+="</svg>"}var H="";switch(e.container){case"svg":f&&(H+='<?xml version="1.0" standalone="yes"?>'+i),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,H+=g+E+y,H+=W,H+="</svg>";break;case"svg-viewbox":f&&(H+='<?xml version="1.0" standalone="yes"?>'+i),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,H+=g+E+y,H+=W,H+="</svg>";break;case"g":H+='<g width="'+o+'" height="'+a+'">'+i,H+=g+E+y,H+=W,H+="</g>";break;default:H+=(g+E+y+W).replace(/^\s+/,"");break}return H};var vh=Lc,Eh=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});bn.QRCode=void 0;const Sh=_e,Zo=gn,kh=Eh(vh),Ch=e=>{const[t,r]=(0,Zo.useState)("");return(0,Zo.useEffect)(()=>{var n,s;const i=new kh.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),o=O.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Sh.h)("img",{src:t,alt:"QR Code"}):null};bn.QRCode=Ch;var yn={},Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Rh=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yn,"__esModule",{value:!0});yn.Spinner=void 0;const Or=_e,Ih=Rh(Li),Ah=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Or.h)("div",{class:"-cbwsdk-spinner"},(0,Or.h)("style",null,Ih.default),(0,Or.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Or.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};yn.Spinner=Ah;var Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var Mc=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.CoinbaseWalletSteps=Nt.ConnectContent=void 0;const at=Mc(tr),j=_e,xh=S,Nh=Bt,Lh=pn,Mh=_n,Th=mn,Ph=bn,Oh=yn,Bh=Mc(Mi),Vs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Tc},Dh=e=>e==="light"?"#FFFFFF":"#0A0B0D";function Fh(e){const{theme:t}=e,r=(0,xh.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Vs.steps;return(0,j.h)("div",{"data-testid":"connect-content",className:(0,at.default)("-cbwsdk-connect-content",t)},(0,j.h)("style",null,Bh.default),(0,j.h)("div",{className:"-cbwsdk-connect-content-header"},(0,j.h)("h2",{className:(0,at.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,j.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,j.h)(Lh.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,j.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,j.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,j.h)(jh,{title:Vs.title,description:Vs.description,theme:t})),(0,j.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,j.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,j.h)(Ph.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,j.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Nh.LIB_VERSION}),(0,j.h)("input",{type:"hidden",value:r})),(0,j.h)(n,{theme:t}),!e.isConnected&&(0,j.h)("div",{"data-testid":"connecting-spinner",className:(0,at.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,j.h)(Oh.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,j.h)("p",null,"Connecting...")))))}Nt.ConnectContent=Fh;function jh({title:e,description:t,theme:r}){return(0,j.h)("div",{className:(0,at.default)("-cbwsdk-connect-item",r)},(0,j.h)("div",null,(0,j.h)(Mh.CoinbaseWalletRound,null)),(0,j.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,j.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,j.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Tc({theme:e}){return(0,j.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,j.h)("li",{className:(0,at.default)("-cbwsdk-wallet-steps-item",e)},(0,j.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,j.h)("li",{className:(0,at.default)("-cbwsdk-wallet-steps-item",e)},(0,j.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,j.h)("span",null,"Tap ",(0,j.h)("strong",null,"Scan")," "),(0,j.h)("span",{className:(0,at.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,j.h)(Th.QRCodeIcon,{fill:Dh(e)})))))}Nt.CoinbaseWalletSteps=Tc;var wn={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.ArrowLeftIcon=void 0;const Qo=_e;function $h(e){return(0,Qo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Qo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}vn.ArrowLeftIcon=$h;var En={};Object.defineProperty(En,"__esModule",{value:!0});En.LaptopIcon=void 0;const Ws=_e;function Hh(e){return(0,Ws.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ws.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ws.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}En.LaptopIcon=Hh;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.SafeIcon=void 0;const Ko=_e;function Uh(e){return(0,Ko.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ko.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Sn.SafeIcon=Uh;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Pc=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wn,"__esModule",{value:!0});wn.TryExtensionContent=void 0;const Xe=Pc(tr),ne=_e,zs=gn,Vh=vn,Wh=En,zh=Sn,qh=Pc(Ti);function Jh({theme:e}){const[t,r]=(0,zs.useState)(!1),n=(0,zs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,zs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,ne.h)("div",{class:(0,Xe.default)("-cbwsdk-try-extension",e)},(0,ne.h)("style",null,qh.default),(0,ne.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ne.h)("h3",{class:(0,Xe.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,ne.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ne.h)("button",{class:(0,Xe.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,ne.h)("div",null,!t&&(0,ne.h)(Vh.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,ne.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ne.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ne.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ne.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ne.h)("span",{class:(0,Xe.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ne.h)(Wh.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ne.h)("div",{class:(0,Xe.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,ne.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ne.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ne.h)("span",{class:(0,Xe.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ne.h)(zh.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ne.h)("div",{class:(0,Xe.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}wn.TryExtensionContent=Jh;var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Oc=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.ConnectDialog=void 0;const qs=Oc(tr),Ye=_e,Js=gn,Gh=Nt,Zh=wn,Qh=Oc(Pi),Kh=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,Js.useState)(!t),[i,o]=(0,Js.useState)(!t);(0,Js.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!t)},10)];return t?s(!1):c.push(window.setTimeout(()=>{s(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,Ye.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Ye.h)("style",null,Qh.default),(0,Ye.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-backdrop",a,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Ye.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Ye.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,Ye.h)(Gh.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,Ye.h)(Zh.TryExtensionContent,{theme:a}))))};fn.ConnectDialog=Kh;Object.defineProperty(hn,"__esModule",{value:!0});hn.LinkFlow=void 0;const Gs=_e,Xh=fn;class Yh{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Gs.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Gs.render)((0,Gs.h)(Xh.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}hn.LinkFlow=Yh;var Oi={},Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=x&&x.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(tr),n=_e,s=gn,i=t(Bi),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const f=this.nextItemKey++;return this.items.set(f,h),this.render(),()=>{this.items.delete(f),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,f])=>(0,n.h)(e.SnackbarInstance,Object.assign({},f,{key:h}))))),this.root)}}e.Snackbar=c;const l=d=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));e.SnackbarContainer=l;const u=({autoExpand:d,message:h,menuItems:f})=>{const[b,g]=(0,s.useState)(!0),[E,y]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const _=[window.setTimeout(()=>{g(!1)},1),window.setTimeout(()=>{y(!0)},1e4)];return()=>{_.forEach(window.clearTimeout)}});const p=()=>{y(!E)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",b&&"-cbwsdk-snackbar-instance-hidden",E&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:p},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!E&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),f&&f.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},f.map((_,A)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",_.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:_.onClick,key:A},(0,n.h)("svg",{width:_.svgWidth,height:_.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":_.defaultFillRule,"clip-rule":_.defaultClipRule,d:_.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",_.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},_.info)))))};e.SnackbarInstance=u})(Oi);Object.defineProperty(hr,"__esModule",{value:!0});hr.WalletLinkRelayUI=void 0;const ef=fr,tf=hn,rf=Oi;class nf{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new rf.Snackbar({darkMode:t.darkMode}),this.linkFlow=new tf.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,ef.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}hr.WalletLinkRelayUI=nf;Object.defineProperty(ar,"__esModule",{value:!0});ar.WalletLinkRelay=void 0;const bt=rr,sf=ie,Q=S,et=Dt,Xo=ke,Je=Ft,of=ln,tt=Ot,af=hr;class Ve extends Xo.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const c=this.storage.getItem(Xo.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,c){const l=c.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const d=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(et.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:d})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),Ve.accountRequestCallbackIds.size>0&&(Array.from(Ve.accountRequestCallbackIds.values()).forEach(a=>{const c={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:a}))}),Ve.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=Je.Session.load(this.storage)||new Je.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new of.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:o,session:t});return s.connect(),{session:t,ui:a,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(et.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=Je.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(et.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Je.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:o,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(et.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Q.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Q.hexStringFromBuffer)(t,!0),signature:(0,Q.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Q.bigIntStringFromBN)(t.weiValue),data:(0,Q.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Q.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Q.bigIntStringFromBN)(t.weiValue),data:(0,Q.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Q.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Q.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Q.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Q.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Q.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Q.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,tt.isErrorResponse)(c))return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof af.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=Je.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(et.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Je.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(et.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Je.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(et.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ve.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),Ve.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const o=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,bt.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Q.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,tt.isErrorResponse)(a))return o(new Error(a.errorMessage));i(a)}),this.ui.inlineAccountsResponse()){const a=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=bt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}Ve.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider"},n=(0,Q.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},i=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,u=>{if((0,tt.isErrorResponse)(u))return a(new Error(u.errorMessage));o(u)});const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:sf.ProviderType.Unselected}})},l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:u}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:o}};let c=null;const l=(0,Q.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));const d=new Promise((h,f)=>{this.relayEventManager.callbacks.set(l,E=>{if(c==null||c(),(0,tt.isErrorResponse)(E))return f(new Error(E.errorMessage));h(E)});const b=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},g=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:g,onCancel:b,type:t,address:r,symbol:n,decimals:s,image:i,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:u,promise:d}}addEthereumChain(t,r,n,s,i,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,Q.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(t)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((h,f)=>{this.relayEventManager.callbacks.set(l,E=>{if(c==null||c(),(0,tt.isErrorResponse)(E))return f(new Error(E.errorMessage));h(E)});const b=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},g=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:E}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:b,onApprove:g,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:u}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(s,d=>{if((0,tt.isErrorResponse)(d)&&d.errorCode)return c(bt.standardErrors.provider.custom({code:d.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,tt.isErrorResponse)(d))return c(new Error(d.errorMessage));a(d)});const l=d=>{var h;if(d){const f=(h=(0,bt.getErrorCode)(d))!==null&&h!==void 0?h:bt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",d instanceof Error?d:bt.standardErrors.provider.unsupportedChain(t),f)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:d}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:u,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Je.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}ar.WalletLinkRelay=Ve;Ve.accountRequestCallbackIds=new Set;var mr={},kn={},Bc={};(function(e){var t=x&&x.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=x&&x.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Oi,e)})(Bc);var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Dc=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kn,"__esModule",{value:!0});kn.RedirectDialog=void 0;const cf=Dc(tr),Be=_e,lf=fr,uf=Bc,df=Dc(Di);class hf{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,lf.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Be.render)(null,this.root),t&&(0,Be.render)((0,Be.h)(ff,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}kn.RedirectDialog=hf;const ff=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,Be.h)(uf.SnackbarContainer,{darkMode:r},(0,Be.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Be.h)("style",null,df.default),(0,Be.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,Be.h)("div",{class:(0,cf.default)("-cbwsdk-redirect-dialog-box",i)},(0,Be.h)("p",null,e),(0,Be.h)("button",{onClick:n},t))))};Object.defineProperty(mr,"__esModule",{value:!0});mr.MobileRelayUI=void 0;const gf=kn;class pf{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new gf.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}mr.MobileRelayUI=pf;Object.defineProperty(or,"__esModule",{value:!0});or.MobileRelay=void 0;const _f=S,mf=ar,bf=mr;class yf extends mf.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,_f.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof bf.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}or.MobileRelay=yf;const{Transform:wf}=$a();var vf=e=>class Fc extends wf{constructor(r,n,s,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!O.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return O.isBuffer(r)||(r=O.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Fc(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Ef}=$a();var Sf=e=>class jc extends Ef{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!O.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return O.isBuffer(r)||(r=O.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new jc(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const kf=vf,Cf=Sf;var Rf=function(e){const t=kf(e),r=Cf(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},$c={};const Yo=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];$c.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=u^(s<<1|i>>>31),f=d^(i<<1|s>>>31);const b=e[0]^h,g=e[1]^f,E=e[10]^h,y=e[11]^f,p=e[20]^h,_=e[21]^f,A=e[30]^h,v=e[31]^f,N=e[40]^h,V=e[41]^f;h=r^(o<<1|a>>>31),f=n^(a<<1|o>>>31);const Z=e[2]^h,ee=e[3]^f,z=e[12]^h,W=e[13]^f,H=e[22]^h,se=e[23]^f,w=e[32]^h,m=e[33]^f,R=e[42]^h,C=e[43]^f;h=s^(c<<1|l>>>31),f=i^(l<<1|c>>>31);const I=e[4]^h,k=e[5]^f,L=e[14]^h,D=e[15]^f,T=e[24]^h,U=e[25]^f,ae=e[34]^h,J=e[35]^f,te=e[44]^h,Ie=e[45]^f;h=o^(u<<1|d>>>31),f=a^(d<<1|u>>>31);const Wt=e[6]^h,Nr=e[7]^f,no=e[16]^h,so=e[17]^f,io=e[26]^h,oo=e[27]^f,ao=e[36]^h,co=e[37]^f,lo=e[46]^h,uo=e[47]^f;h=c^(r<<1|n>>>31),f=l^(n<<1|r>>>31);const ho=e[8]^h,fo=e[9]^f,go=e[18]^h,po=e[19]^f,_o=e[28]^h,mo=e[29]^f,bo=e[38]^h,yo=e[39]^f,wo=e[48]^h,vo=e[49]^f,Wn=b,zn=g,qn=y<<4|E>>>28,Jn=E<<4|y>>>28,Gn=p<<3|_>>>29,Zn=_<<3|p>>>29,Qn=v<<9|A>>>23,Kn=A<<9|v>>>23,Xn=N<<18|V>>>14,Yn=V<<18|N>>>14,es=Z<<1|ee>>>31,ts=ee<<1|Z>>>31,rs=W<<12|z>>>20,ns=z<<12|W>>>20,ss=H<<10|se>>>22,is=se<<10|H>>>22,os=m<<13|w>>>19,as=w<<13|m>>>19,cs=R<<2|C>>>30,ls=C<<2|R>>>30,us=k<<30|I>>>2,ds=I<<30|k>>>2,hs=L<<6|D>>>26,fs=D<<6|L>>>26,gs=U<<11|T>>>21,ps=T<<11|U>>>21,_s=ae<<15|J>>>17,ms=J<<15|ae>>>17,bs=Ie<<29|te>>>3,ys=te<<29|Ie>>>3,ws=Wt<<28|Nr>>>4,vs=Nr<<28|Wt>>>4,Es=so<<23|no>>>9,Ss=no<<23|so>>>9,ks=io<<25|oo>>>7,Cs=oo<<25|io>>>7,Rs=ao<<21|co>>>11,Is=co<<21|ao>>>11,As=uo<<24|lo>>>8,xs=lo<<24|uo>>>8,Ns=ho<<27|fo>>>5,Ls=fo<<27|ho>>>5,Ms=go<<20|po>>>12,Ts=po<<20|go>>>12,Ps=mo<<7|_o>>>25,Os=_o<<7|mo>>>25,Bs=bo<<8|yo>>>24,Ds=yo<<8|bo>>>24,Fs=wo<<14|vo>>>18,js=vo<<14|wo>>>18;e[0]=Wn^~rs&gs,e[1]=zn^~ns&ps,e[10]=ws^~Ms&Gn,e[11]=vs^~Ts&Zn,e[20]=es^~hs&ks,e[21]=ts^~fs&Cs,e[30]=Ns^~qn&ss,e[31]=Ls^~Jn&is,e[40]=us^~Es&Ps,e[41]=ds^~Ss&Os,e[2]=rs^~gs&Rs,e[3]=ns^~ps&Is,e[12]=Ms^~Gn&os,e[13]=Ts^~Zn&as,e[22]=hs^~ks&Bs,e[23]=fs^~Cs&Ds,e[32]=qn^~ss&_s,e[33]=Jn^~is&ms,e[42]=Es^~Ps&Qn,e[43]=Ss^~Os&Kn,e[4]=gs^~Rs&Fs,e[5]=ps^~Is&js,e[14]=Gn^~os&bs,e[15]=Zn^~as&ys,e[24]=ks^~Bs&Xn,e[25]=Cs^~Ds&Yn,e[34]=ss^~_s&As,e[35]=is^~ms&xs,e[44]=Ps^~Qn&cs,e[45]=Os^~Kn&ls,e[6]=Rs^~Fs&Wn,e[7]=Is^~js&zn,e[16]=os^~bs&ws,e[17]=as^~ys&vs,e[26]=Bs^~Xn&es,e[27]=Ds^~Yn&ts,e[36]=_s^~As&Ns,e[37]=ms^~xs&Ls,e[46]=Qn^~cs&us,e[47]=Kn^~ls&ds,e[8]=Fs^~Wn&rs,e[9]=js^~zn&ns,e[18]=bs^~ws&Ms,e[19]=ys^~vs&Ts,e[28]=Xn^~es&hs,e[29]=Yn^~ts&fs,e[38]=As^~Ns&qn,e[39]=xs^~Ls&Jn,e[48]=cs^~us&Es,e[49]=ls^~ds&Ss,e[0]^=Yo[t*2],e[1]^=Yo[t*2+1]}};const Gr=$c;function $t(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}$t.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};$t.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Gr.p1600(this.state),this.count=0)};$t.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Gr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Gr.p1600(this.state),this.count=0,this.squeezing=!0};$t.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=O.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Gr.p1600(this.state),this.count=0);return t};$t.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var If=$t,Af=Rf(If);const xf=Af,Nf=Kr();function Hc(e){return O.allocUnsafe(e).fill(0)}function Uc(e,t,r){const n=Hc(t);return e=Cn(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Lf(e,t){return Uc(e,t,!0)}function Cn(e){if(!O.isBuffer(e))if(Array.isArray(e))e=O.from(e);else if(typeof e=="string")Vc(e)?e=O.from(Pf(Wc(e)),"hex"):e=O.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=O.allocUnsafe(0);else if(Nf.isBN(e))e=e.toArrayLike(O);else if(e.toArray)e=O.from(e.toArray());else throw new Error("invalid type");return e}function Mf(e){return e=Cn(e),"0x"+e.toString("hex")}function Tf(e,t){return e=Cn(e),t||(t=256),xf("keccak"+t).update(e).digest()}function Pf(e){return e.length%2?"0"+e:e}function Vc(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Wc(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var zc={zeros:Hc,setLength:Uc,setLengthRight:Lf,isHexString:Vc,stripHexPrefix:Wc,toBuffer:Cn,bufferToHex:Mf,keccak:Tf};const ct=zc,it=Kr();function qc(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function St(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function ea(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Jc(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function nt(e){var t=typeof e;if(t==="string")return ct.isHexString(e)?new it(ct.stripHexPrefix(e),16):new it(e,10);if(t==="number")return new it(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Oe(e,t){var r,n,s,i;if(e==="address")return Oe("uint160",nt(t));if(e==="bool")return Oe("uint8",t?1:0);if(e==="string")return Oe("bytes",new O(t,"utf8"));if(Bf(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Jc(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push(Oe(e,t[i]));if(r==="dynamic"){var o=Oe("uint256",t.length);s.unshift(o)}return O.concat(s)}else{if(e==="bytes")return t=new O(t),s=O.concat([Oe("uint256",t.length),t]),t.length%32!==0&&(s=O.concat([s,ct.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=St(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return ct.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=St(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=nt(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(O,"be",32)}else if(e.startsWith("int")){if(r=St(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=nt(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(O,"be",32)}else if(e.startsWith("ufixed")){if(r=ea(e),n=nt(t),n<0)throw new Error("Supplied ufixed is negative");return Oe("uint256",n.mul(new it(2).pow(new it(r[1]))))}else if(e.startsWith("fixed"))return r=ea(e),Oe("int256",nt(t).mul(new it(2).pow(new it(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Of(e){return e==="string"||e==="bytes"||Jc(e)==="dynamic"}function Bf(e){return e.lastIndexOf("]")===e.length-1}function Df(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var o=qc(e[i]),a=t[i],c=Oe(o,a);Of(o)?(r.push(Oe("uint256",s)),n.push(c),s+=c.length):r.push(c)}return O.concat(r.concat(n))}function Gc(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i<e.length;i++){var o=qc(e[i]),a=t[i];if(o==="bytes")s.push(a);else if(o==="string")s.push(new O(a,"utf8"));else if(o==="bool")s.push(new O(a?"01":"00","hex"));else if(o==="address")s.push(ct.setLength(a,20));else if(o.startsWith("bytes")){if(r=St(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(ct.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=St(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=nt(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike(O,"be",r/8))}else if(o.startsWith("int")){if(r=St(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=nt(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike(O,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return O.concat(s)}function Ff(e,t){return ct.keccak(Gc(e,t))}var jf={rawEncode:Df,solidityPack:Gc,soliditySHA3:Ff};const xe=zc,Qt=jf,Zc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Zs={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":xe.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",xe.keccak(l)];if(c==="string")return typeof l=="string"&&(l=O.from(l,"utf8")),["bytes32",xe.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const u=c.slice(0,c.lastIndexOf("[")),d=l.map(h=>o(a,u,h));return["bytes32",xe.keccak(Qt.rawEncode(d.map(([h])=>h),d.map(([,h])=>h)))]}return[c,l]};for(const a of r[e]){const[c,l]=o(a.name,a.type,t[a.name]);s.push(c),i.push(l)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")s.push("bytes32"),a=xe.keccak(a),i.push(a);else if(o.type==="string")s.push("bytes32"),typeof a=="string"&&(a=O.from(a,"utf8")),a=xe.keccak(a),i.push(a);else if(r[o.type]!==void 0)s.push("bytes32"),a=xe.keccak(this.encodeData(o.type,a,r,n)),i.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(o.type),i.push(a)}}return Qt.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return xe.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return xe.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Zc.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[O.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),xe.keccak(O.concat(n))}};var $f={TYPED_MESSAGE_SCHEMA:Zc,TypedDataUtils:Zs,hashForSignTypedDataLegacy:function(e){return Hf(e.data)},hashForSignTypedData_v3:function(e){return Zs.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Zs.hash(e.data)}};function Hf(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?xe.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return Qt.soliditySHA3(["bytes32","bytes32"],[Qt.soliditySHA3(new Array(e.length).fill("string"),s),Qt.soliditySHA3(n,r)])}var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.filterFromParam=Lt.FilterPolyfill=void 0;const wt=ie,ge=S,Uf=5*60*1e3,st={jsonrpc:"2.0",id:0};class Vf{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,wt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Qc(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,ge.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,ge.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,ge.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,ge.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,ge.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Br())}async getFilterLogs(t){const r=(0,ge.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},st),{method:"eth_getLogs",params:[ta(n)]})):Br()}makeFilterId(){return(0,wt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Br();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Dr();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},st),{method:"eth_getLogs",params:[ta(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,ge.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,wt.IntNumber)(c+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Br();const n=await this.getCurrentBlockHeight();if(r>n)return Dr();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,ge.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,wt.IntNumber)(o))))).filter(o=>!!o),i=(0,wt.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},st),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Dr())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},Uf);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},st),{method:"eth_blockNumber",params:[]}));return(0,ge.intNumberFromHexString)((0,ge.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},st),{method:"eth_getBlockByNumber",params:[(0,ge.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,ge.ensureHexString)(r.result.hash):null}}Lt.FilterPolyfill=Vf;function Qc(e){return{fromBlock:ra(e.fromBlock),toBlock:ra(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Lt.filterFromParam=Qc;function ta(e){const t={fromBlock:na(e.fromBlock),toBlock:na(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function ra(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,wt.IntNumber)(0);if((0,ge.isHexString)(e))return(0,ge.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function na(e){return e==="latest"?e:(0,ge.hexStringFromIntNumber)(e)}function Br(){return Object.assign(Object.assign({},st),{error:{code:-32e3,message:"filter not found"}})}function Dr(){return Object.assign(Object.assign({},st),{result:[]})}var Rn={},Kc={},In={},Fi=Wf;function Wf(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const sa=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s<arguments.length;s++)n[s]=arguments[s];return new r((s,i)=>{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)c[l-1]=arguments[l];o?(c.unshift(o),i(c)):s(c)}else o?i(o):s(a)}):n.push(function(o){if(t.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];s(a)}else s(o)}),e.apply(this,n)})};var zf=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=o=>typeof o=="string"?s===o:o.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):sa(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?sa(i,t):i}return n},br={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});const qf=Ha;function ia(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Jf(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Gf=class extends qf.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")ia(i,this,r);else{const o=i.length,a=Jf(i);for(let c=0;c<o;c+=1)ia(a[c],this,r)}return!0}};yr.default=Gf;var Zf=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.BaseBlockTracker=void 0;const Qf=Zf(yr),Kf=1e3,Xf=(e,t)=>e+t,oa=["sync","latest"];class Yf extends Qf.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Kf,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){oa.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return oa.map(t=>this.listenerCount(t)).reduce(Xf)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=aa(t),s=aa(r);return this._usePastBlocks&&n<s||n>s}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}br.BaseBlockTracker=Yf;function aa(e){return Number.parseInt(e,16)}var Xc={},Yc={},he={};class el extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...o}=t,{path:a}=t,c=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??c),i!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function e0(e){return Re(e)&&typeof e[Symbol.iterator]=="function"}function Re(e){return typeof e=="object"&&e!=null}function ca(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function oe(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function t0(e){const{done:t,value:r}=e.next();return t?void 0:r}function r0(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${oe(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:c}}function*gi(e,t,r,n){e0(e)||(e=[e]);for(const s of e){const i=r0(s,t,r,n);i&&(yield i)}}function*ji(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:o=!1}=r,a={path:n,branch:s};if(i&&(e=t.coercer(e,a),o&&t.type!=="type"&&Re(t.schema)&&Re(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let c="valid";for(const l of t.validator(e,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,a)){const h=ji(u,d,{path:l===void 0?n:[...n,l],branch:l===void 0?s:[...s,u],coerce:i,mask:o,message:r.message});for(const f of h)f[0]?(c=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):i&&(u=f[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):Re(e)&&(u!==void 0||l in e)&&(e[l]=u))}if(c!=="not_valid")for(const l of t.refiner(e,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,e])}class re{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,s?this.validator=(c,l)=>{const u=s(c,l);return gi(u,l,this,c)}:this.validator=()=>[],i?this.refiner=(c,l)=>{const u=i(c,l);return gi(u,l,this,c)}:this.refiner=()=>[]}assert(t,r){return tl(t,this,r)}create(t,r){return rl(t,this,r)}is(t){return $i(t,this)}mask(t,r){return nl(t,this,r)}validate(t,r={}){return Ht(t,this,r)}}function tl(e,t,r){const n=Ht(e,t,{message:r});if(n[0])throw n[0]}function rl(e,t,r){const n=Ht(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function nl(e,t,r){const n=Ht(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function $i(e,t){return!Ht(e,t)[0]}function Ht(e,t,r={}){const n=ji(e,t,r),s=t0(n);return s[0]?[new el(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function n0(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?vr(n):wr(n)}function me(e,t){return new re({type:e,schema:null,validator:t})}function s0(e,t){return new re({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function i0(e){return new re({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function o0(e){let t;return new re({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function a0(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return vr(n);default:return wr(n)}}function c0(e){const t=e instanceof re,r=t?{...e.schema}:{...e};for(const n in r)r[n]=sl(r[n]);return t&&e.type==="type"?vr(r):wr(r)}function l0(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return vr(n);default:return wr(n)}}function u0(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),me(e,t)}function d0(){return me("any",()=>!0)}function h0(e){return new re({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${oe(t)}`}})}function f0(){return me("bigint",e=>typeof e=="bigint")}function g0(){return me("boolean",e=>typeof e=="boolean")}function p0(){return me("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${oe(e)}`)}function _0(e){const t={},r=e.map(n=>oe(n)).join();for(const n of e)t[n]=n;return new re({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${oe(n)}`}})}function m0(){return me("func",e=>typeof e=="function"||`Expected a function, but received: ${oe(e)}`)}function b0(e){return me("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${oe(t)}`)}function y0(){return me("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${oe(e)}`)}function w0(e){return new re({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function v0(e){const t=oe(e),r=typeof e;return new re({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${oe(n)}`}})}function E0(e,t){return new re({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${oe(r)}`}})}function Hi(){return me("never",()=>!1)}function S0(e){return new re({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function k0(){return me("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${oe(e)}`)}function wr(e){const t=e?Object.keys(e):[],r=Hi();return new re({type:"object",schema:e||null,*entries(n){if(e&&Re(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return Re(n)||`Expected an object, but received: ${oe(n)}`},coercer(n){return Re(n)?{...n}:n}})}function sl(e){return new re({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function C0(e,t){return new re({type:"record",schema:null,*entries(r){if(Re(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return Re(r)||`Expected an object, but received: ${oe(r)}`}})}function R0(){return me("regexp",e=>e instanceof RegExp)}function I0(e){return new re({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${oe(t)}`}})}function il(){return me("string",e=>typeof e=="string"||`Expected a string, but received: ${oe(e)}`)}function A0(e){const t=Hi();return new re({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${oe(r)}`}})}function vr(e){const t=Object.keys(e);return new re({type:"type",schema:e,*entries(r){if(Re(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return Re(r)||`Expected an object, but received: ${oe(r)}`},coercer(r){return Re(r)?{...r}:r}})}function x0(e){const t=e.map(r=>r.type).join(" | ");return new re({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...o]=ji(r,i,n),[a]=o;if(a[0])for(const[c]of o)c&&s.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${oe(r)}`,...s]}})}function ol(){return me("unknown",()=>!0)}function Ui(e,t,r){return new re({...e,coercer:(n,s)=>$i(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function N0(e,t,r={}){return Ui(e,ol(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&ca(n)&&ca(s)){const i={...n};let o=!1;for(const a in s)i[a]===void 0&&(i[a]=s[a],o=!0);if(o)return i}return n})}function L0(e){return Ui(e,il(),t=>t.trim())}function M0(e){return ft(e,"empty",t=>{const r=al(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function al(e){return e instanceof Map||e instanceof Set?e.size:e.length}function T0(e,t,r={}){const{exclusive:n}=r;return ft(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function P0(e,t,r={}){const{exclusive:n}=r;return ft(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function O0(e){return ft(e,"nonempty",t=>al(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function B0(e,t){return ft(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function D0(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return ft(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}else{const{length:o}=i;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}})}function ft(e,t,r){return new re({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=gi(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const F0=Object.freeze(Object.defineProperty({__proto__:null,Struct:re,StructError:el,any:d0,array:h0,assert:tl,assign:n0,bigint:f0,boolean:g0,coerce:Ui,create:rl,date:p0,defaulted:N0,define:me,deprecated:s0,dynamic:i0,empty:M0,enums:_0,func:m0,instance:b0,integer:y0,intersection:w0,is:$i,lazy:o0,literal:v0,map:E0,mask:nl,max:T0,min:P0,never:Hi,nonempty:O0,nullable:S0,number:k0,object:wr,omit:a0,optional:sl,partial:c0,pattern:B0,pick:l0,record:C0,refine:ft,regexp:R0,set:I0,size:D0,string:il,struct:u0,trimmed:L0,tuple:A0,type:vr,union:x0,unknown:ol,validate:Ht},Symbol.toStringTag,{value:"Module"})),gt=yi(F0);Object.defineProperty(he,"__esModule",{value:!0});he.assertExhaustive=he.assertStruct=he.assert=he.AssertionError=void 0;const j0=gt;function $0(e){return typeof e=="object"&&e!==null&&"message"in e}function H0(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function U0(e){const t=$0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function cl(e,t){return H0(e)?new e({message:t}):e({message:t})}class Vi extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}he.AssertionError=Vi;function V0(e,t="Assertion failed.",r=Vi){if(!e)throw t instanceof Error?t:cl(r,t)}he.assert=V0;function W0(e,t,r="Assertion failed",n=Vi){try{(0,j0.assert)(e,t)}catch(s){throw cl(n,`${r}: ${U0(s)}.`)}}he.assertStruct=W0;function z0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}he.assertExhaustive=z0;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.base64=void 0;const q0=gt,J0=he,G0=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;i==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,J0.assert)(i==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return s?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,q0.pattern)(e,a)};Er.base64=G0;var $={},Sr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=gt,r=he;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function s(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=s;function i(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(l){(0,r.assert)(s(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=c})(Sr);Object.defineProperty($,"__esModule",{value:!0});$.createDataView=$.concatBytes=$.valueToBytes=$.stringToBytes=$.numberToBytes=$.signedBigIntToBytes=$.bigIntToBytes=$.hexToBytes=$.bytesToString=$.bytesToNumber=$.bytesToSignedBigInt=$.bytesToBigInt=$.bytesToHex=$.assertIsBytes=$.isBytes=void 0;const we=he,pi=Sr,la=48,ua=58,da=87;function Z0(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Q0=Z0();function Wi(e){return e instanceof Uint8Array}$.isBytes=Wi;function Ut(e){(0,we.assert)(Wi(e),"Value must be a Uint8Array.")}$.assertIsBytes=Ut;function ll(e){if(Ut(e),e.length===0)return"0x";const t=Q0(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,pi.add0x)(r.join(""))}$.bytesToHex=ll;function ul(e){Ut(e);const t=ll(e);return BigInt(t)}$.bytesToBigInt=ul;function K0(e){Ut(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}$.bytesToSignedBigInt=K0;function X0(e){Ut(e);const t=ul(e);return(0,we.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}$.bytesToNumber=X0;function Y0(e){return Ut(e),new TextDecoder().decode(e)}$.bytesToString=Y0;function An(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,pi.assertIsHexString)(e);const r=(0,pi.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let i=0;i<s.length;i++){const o=n.charCodeAt(i*2),a=n.charCodeAt(i*2+1),c=o-(o<ua?la:da),l=a-(a<ua?la:da);s[i]=c*16+l}return s}$.hexToBytes=An;function dl(e){(0,we.assert)(typeof e=="bigint","Value must be a bigint."),(0,we.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return An(t)}$.bigIntToBytes=dl;function e1(e,t){(0,we.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function t1(e,t){(0,we.assert)(typeof e=="bigint","Value must be a bigint."),(0,we.assert)(typeof t=="number","Byte length must be a number."),(0,we.assert)(t>0,"Byte length must be greater than 0."),(0,we.assert)(e1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}$.signedBigIntToBytes=t1;function hl(e){(0,we.assert)(typeof e=="number","Value must be a number."),(0,we.assert)(e>=0,"Value must be a non-negative number."),(0,we.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return An(t)}$.numberToBytes=hl;function fl(e){return(0,we.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}$.stringToBytes=fl;function gl(e){if(typeof e=="bigint")return dl(e);if(typeof e=="number")return hl(e);if(typeof e=="string")return e.startsWith("0x")?An(e):fl(e);if(Wi(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}$.valueToBytes=gl;function r1(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=gl(e[s]);t[s]=i,r+=i.length}const n=new Uint8Array(r);for(let s=0,i=0;s<t.length;s++)n.set(t[s],i),i+=t[s].length;return n}$.concatBytes=r1;function n1(e){if(typeof O<"u"&&e instanceof O){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}$.createDataView=n1;var xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.ChecksumStruct=void 0;const ha=gt,s1=Er;xn.ChecksumStruct=(0,ha.size)((0,s1.base64)((0,ha.string)(),{paddingRequired:!0}),44,44);var $e={};Object.defineProperty($e,"__esModule",{value:!0});$e.createHex=$e.createBytes=$e.createBigInt=$e.createNumber=void 0;const Y=gt,i1=he,pl=$,Nn=Sr,_l=(0,Y.union)([(0,Y.number)(),(0,Y.bigint)(),(0,Y.string)(),Nn.StrictHexStruct]),o1=(0,Y.coerce)((0,Y.number)(),_l,Number),a1=(0,Y.coerce)((0,Y.bigint)(),_l,BigInt);(0,Y.union)([Nn.StrictHexStruct,(0,Y.instance)(Uint8Array)]);const c1=(0,Y.coerce)((0,Y.instance)(Uint8Array),(0,Y.union)([Nn.StrictHexStruct]),pl.hexToBytes),l1=(0,Y.coerce)(Nn.StrictHexStruct,(0,Y.instance)(Uint8Array),pl.bytesToHex);function u1(e){try{const t=(0,Y.create)(e,o1);return(0,i1.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Y.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}$e.createNumber=u1;function d1(e){try{return(0,Y.create)(e,a1)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}$e.createBigInt=d1;function h1(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Y.create)(e,c1)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}$e.createBytes=h1;function f1(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Y.create)(e,l1)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}$e.createHex=f1;var Mt={},ml=x&&x.__classPrivateFieldSet||function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},pe=x&&x.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ae,Te;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.FrozenSet=Mt.FrozenMap=void 0;class zi{constructor(t){Ae.set(this,void 0),ml(this,Ae,new Map(t),"f"),Object.freeze(this)}get size(){return pe(this,Ae,"f").size}[(Ae=new WeakMap,Symbol.iterator)](){return pe(this,Ae,"f")[Symbol.iterator]()}entries(){return pe(this,Ae,"f").entries()}forEach(t,r){return pe(this,Ae,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return pe(this,Ae,"f").get(t)}has(t){return pe(this,Ae,"f").has(t)}keys(){return pe(this,Ae,"f").keys()}values(){return pe(this,Ae,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Mt.FrozenMap=zi;class qi{constructor(t){Te.set(this,void 0),ml(this,Te,new Set(t),"f"),Object.freeze(this)}get size(){return pe(this,Te,"f").size}[(Te=new WeakMap,Symbol.iterator)](){return pe(this,Te,"f")[Symbol.iterator]()}entries(){return pe(this,Te,"f").entries()}forEach(t,r){return pe(this,Te,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return pe(this,Te,"f").has(t)}keys(){return pe(this,Te,"f").keys()}values(){return pe(this,Te,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Mt.FrozenSet=qi;Object.freeze(zi);Object.freeze(zi.prototype);Object.freeze(qi);Object.freeze(qi.prototype);var bl={};Object.defineProperty(bl,"__esModule",{value:!0});var yl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=gt,r=he,n=()=>(0,t.define)("finite number",v=>(0,t.is)(v,(0,t.number)())&&Number.isFinite(v));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(v,N)=>{function V(Z,ee){const W=[...ee.validator(Z,N)];return W.length>0?W:!0}try{const Z=V(v,e.UnsafeJsonStruct);return Z!==!0?Z:V(JSON.parse(JSON.stringify(v)),e.UnsafeJsonStruct)}catch(Z){return Z instanceof RangeError?"Circular reference detected":!1}});function s(v){return(0,t.is)(v,e.JsonStruct)}e.isValidJson=s;function i(v){(0,r.assertStruct)(v,e.JsonStruct,"Invalid JSON value");const N=JSON.stringify(v);return new TextEncoder().encode(N).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(v){return(0,t.is)(v,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(v,N){(0,r.assertStruct)(v,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",N)}e.assertIsJsonRpcNotification=a;function c(v){return(0,t.is)(v,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function l(v,N){(0,r.assertStruct)(v,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",N)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function u(v){return(0,t.is)(v,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=u;function d(v,N){(0,r.assertStruct)(v,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",N)}e.assertIsPendingJsonRpcResponse=d;function h(v){return(0,t.is)(v,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function f(v,N){(0,r.assertStruct)(v,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",N)}e.assertIsJsonRpcResponse=f;function b(v){return(0,t.is)(v,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=b;function g(v,N){(0,r.assertStruct)(v,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",N)}e.assertIsJsonRpcSuccess=g;function E(v){return(0,t.is)(v,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=E;function y(v,N){(0,r.assertStruct)(v,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",N)}e.assertIsJsonRpcFailure=y;function p(v){return(0,t.is)(v,e.JsonRpcErrorStruct)}e.isJsonRpcError=p;function _(v,N){(0,r.assertStruct)(v,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",N)}e.assertIsJsonRpcError=_;function A(v){const{permitEmptyString:N,permitFractions:V,permitNull:Z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},v);return z=>!!(typeof z=="number"&&(V||Number.isInteger(z))||typeof z=="string"&&(N||z.length>0)||Z&&z===null)}e.getJsonRpcIdValidator=A})(yl);var wl={};Object.defineProperty(wl,"__esModule",{value:!0});var Tt={},g1=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.createModuleLogger=Tt.createProjectLogger=void 0;const p1=g1(Yl()),_1=(0,p1.default)("metamask");function m1(e){return _1.extend(e)}Tt.createProjectLogger=m1;function b1(e,t){return e.extend(t)}Tt.createModuleLogger=b1;var vl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const s=(l,u)=>Object.hasOwnProperty.call(l,u);e.hasProperty=s,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(l){if(typeof l!="object"||l===null)return!1;try{let u=l;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(l)===u}catch{return!1}}e.isPlainObject=i;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function a(l){var u;return l.split("").reduce((h,f)=>o(f)?h+1:h+2,0)+((u=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}e.calculateStringSize=a;function c(l){return l.toString().length}e.calculateNumberSize=c})(vl);var He={};Object.defineProperty(He,"__esModule",{value:!0});He.hexToBigInt=He.hexToNumber=He.bigIntToHex=He.numberToHex=void 0;const kt=he,Yt=Sr,y1=e=>((0,kt.assert)(typeof e=="number","Value must be a number."),(0,kt.assert)(e>=0,"Value must be a non-negative number."),(0,kt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Yt.add0x)(e.toString(16)));He.numberToHex=y1;const w1=e=>((0,kt.assert)(typeof e=="bigint","Value must be a bigint."),(0,kt.assert)(e>=0,"Value must be a non-negative bigint."),(0,Yt.add0x)(e.toString(16)));He.bigIntToHex=w1;const v1=e=>{(0,Yt.assertIsHexString)(e);const t=parseInt(e,16);return(0,kt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};He.hexToNumber=v1;const E1=e=>((0,Yt.assertIsHexString)(e),BigInt((0,Yt.add0x)(e)));He.hexToBigInt=E1;var El={};Object.defineProperty(El,"__esModule",{value:!0});var Sl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,o)=>{if(!t(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function n(i,o){return r(i,"count"),i*o}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(Sl);var kl={};Object.defineProperty(kl,"__esModule",{value:!0});var Cl={},_i={exports:{}};const S1="2.0.0",Rl=256,k1=Number.MAX_SAFE_INTEGER||9007199254740991,C1=16,R1=Rl-6,I1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ln={MAX_LENGTH:Rl,MAX_SAFE_COMPONENT_LENGTH:C1,MAX_SAFE_BUILD_LENGTH:R1,MAX_SAFE_INTEGER:k1,RELEASE_TYPES:I1,SEMVER_SPEC_VERSION:S1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Qs={};const A1=typeof eu=="object"&&Qs&&Qs.NODE_DEBUG&&/\bsemver\b/i.test(Qs.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Mn=A1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Ln,i=Mn;t=e.exports={};const o=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[h,n]],b=E=>{for(const[y,p]of f)E=E.split(`${y}*`).join(`${y}{0,${p}}`).split(`${y}+`).join(`${y}{1,${p}}`);return E},g=(E,y,p)=>{const _=b(y),A=d++;i(E,A,y),u[E]=A,c[A]=y,l[A]=_,o[A]=new RegExp(y,p?"g":void 0),a[A]=new RegExp(_,p?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),g("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${h}+`),g("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),g("FULL",`^${c[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),g("LOOSE",`^${c[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),g("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),g("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",c[u.COERCE],!0),g("COERCERTLFULL",c[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(_i,_i.exports);var kr=_i.exports;const x1=Object.freeze({loose:!0}),N1=Object.freeze({}),L1=e=>e?typeof e!="object"?x1:e:N1;var Ji=L1;const fa=/^[0-9]+$/,Il=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=fa.test(e),n=fa.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},M1=(e,t)=>Il(t,e);var Al={compareIdentifiers:Il,rcompareIdentifiers:M1};const Fr=Mn,{MAX_LENGTH:ga,MAX_SAFE_INTEGER:jr}=Ln,{safeRe:$r,t:Hr}=kr,T1=Ji,{compareIdentifiers:Ks}=Al;let P1=class Pe{constructor(t,r){if(r=T1(r),t instanceof Pe){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>ga)throw new TypeError(`version is longer than ${ga} characters`);Fr("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?$r[Hr.LOOSE]:$r[Hr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>jr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>jr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>jr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<jr)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Fr("SemVer.compare",this.version,this.options,t),!(t instanceof Pe)){if(typeof t=="string"&&t===this.version)return 0;t=new Pe(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Pe||(t=new Pe(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof Pe||(t=new Pe(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(Fr("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ks(n,s)}while(++r)}compareBuild(t){t instanceof Pe||(t=new Pe(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(Fr("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ks(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const s=`-${r}`.match(this.options.loose?$r[Hr.PRERELEASELOOSE]:$r[Hr.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Ks(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Cr=P1;const pa=Cr,O1=(e,t,r=!1)=>{if(e instanceof pa)return e;try{return new pa(e,t)}catch(n){if(!r)return null;throw n}};var B1=O1;const D1=B1,F1=(e,t)=>{const r=D1(e,t);return r?r.version:null};var j1=F1;const _a=Cr,$1=(e,t,r)=>new _a(e,r).compare(new _a(t,r));var Vt=$1;const H1=Vt,U1=(e,t,r)=>H1(e,t,r)>0;var Gi=U1;const V1=Vt,W1=(e,t,r)=>V1(e,t,r)<0;var xl=W1;const z1=Vt,q1=(e,t,r)=>z1(e,t,r)===0;var J1=q1;const G1=Vt,Z1=(e,t,r)=>G1(e,t,r)!==0;var Q1=Z1;const K1=Vt,X1=(e,t,r)=>K1(e,t,r)>=0;var Nl=X1;const Y1=Vt,eg=(e,t,r)=>Y1(e,t,r)<=0;var Ll=eg;const tg=J1,rg=Q1,ng=Gi,sg=Nl,ig=xl,og=Ll,ag=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return tg(e,r,n);case"!=":return rg(e,r,n);case">":return ng(e,r,n);case">=":return sg(e,r,n);case"<":return ig(e,r,n);case"<=":return og(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var cg=ag;const{safeRe:U_,t:V_}=kr;class lg{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var ug=lg,Xs,ma;function Le(){if(ma)return Xs;ma=1;const e=/\s+/g;class t{constructor(m,R){if(R=s(R),m instanceof t)return m.loose===!!R.loose&&m.includePrerelease===!!R.includePrerelease?m:new t(m.raw,R);if(m instanceof i)return this.raw=m.value,this.set=[[m]],this.formatted=void 0,this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=m.trim().replace(e," "),this.set=this.raw.split("||").map(C=>this.parseRange(C.trim())).filter(C=>C.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const C=this.set[0];if(this.set=this.set.filter(I=>!g(I[0])),this.set.length===0)this.set=[C];else if(this.set.length>1){for(const I of this.set)if(I.length===1&&E(I[0])){this.set=[I];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let m=0;m<this.set.length;m++){m>0&&(this.formatted+="||");const R=this.set[m];for(let C=0;C<R.length;C++)C>0&&(this.formatted+=" "),this.formatted+=R[C].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(m){const C=((this.options.includePrerelease&&f)|(this.options.loose&&b))+":"+m,I=n.get(C);if(I)return I;const k=this.options.loose,L=k?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];m=m.replace(L,H(this.options.includePrerelease)),o("hyphen replace",m),m=m.replace(c[l.COMPARATORTRIM],u),o("comparator trim",m),m=m.replace(c[l.TILDETRIM],d),o("tilde trim",m),m=m.replace(c[l.CARETTRIM],h),o("caret trim",m);let D=m.split(" ").map(J=>p(J,this.options)).join(" ").split(/\s+/).map(J=>W(J,this.options));k&&(D=D.filter(J=>(o("loose invalid filter",J,this.options),!!J.match(c[l.COMPARATORLOOSE])))),o("range list",D);const T=new Map,U=D.map(J=>new i(J,this.options));for(const J of U){if(g(J))return[J];T.set(J.value,J)}T.size>1&&T.has("")&&T.delete("");const ae=[...T.values()];return n.set(C,ae),ae}intersects(m,R){if(!(m instanceof t))throw new TypeError("a Range is required");return this.set.some(C=>y(C,R)&&m.set.some(I=>y(I,R)&&C.every(k=>I.every(L=>k.intersects(L,R)))))}test(m){if(!m)return!1;if(typeof m=="string")try{m=new a(m,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(se(this.set[R],m,this.options))return!0;return!1}}Xs=t;const r=ug,n=new r,s=Ji,i=Tn(),o=Mn,a=Cr,{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:h}=kr,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:b}=Ln,g=w=>w.value==="<0.0.0-0",E=w=>w.value==="",y=(w,m)=>{let R=!0;const C=w.slice();let I=C.pop();for(;R&&C.length;)R=C.every(k=>I.intersects(k,m)),I=C.pop();return R},p=(w,m)=>(w=w.replace(c[l.BUILD],""),o("comp",w,m),w=N(w,m),o("caret",w),w=A(w,m),o("tildes",w),w=Z(w,m),o("xrange",w),w=z(w,m),o("stars",w),w),_=w=>!w||w.toLowerCase()==="x"||w==="*",A=(w,m)=>w.trim().split(/\s+/).map(R=>v(R,m)).join(" "),v=(w,m)=>{const R=m.loose?c[l.TILDELOOSE]:c[l.TILDE];return w.replace(R,(C,I,k,L,D)=>{o("tilde",w,C,I,k,L,D);let T;return _(I)?T="":_(k)?T=`>=${I}.0.0 <${+I+1}.0.0-0`:_(L)?T=`>=${I}.${k}.0 <${I}.${+k+1}.0-0`:D?(o("replaceTilde pr",D),T=`>=${I}.${k}.${L}-${D} <${I}.${+k+1}.0-0`):T=`>=${I}.${k}.${L} <${I}.${+k+1}.0-0`,o("tilde return",T),T})},N=(w,m)=>w.trim().split(/\s+/).map(R=>V(R,m)).join(" "),V=(w,m)=>{o("caret",w,m);const R=m.loose?c[l.CARETLOOSE]:c[l.CARET],C=m.includePrerelease?"-0":"";return w.replace(R,(I,k,L,D,T)=>{o("caret",w,I,k,L,D,T);let U;return _(k)?U="":_(L)?U=`>=${k}.0.0${C} <${+k+1}.0.0-0`:_(D)?k==="0"?U=`>=${k}.${L}.0${C} <${k}.${+L+1}.0-0`:U=`>=${k}.${L}.0${C} <${+k+1}.0.0-0`:T?(o("replaceCaret pr",T),k==="0"?L==="0"?U=`>=${k}.${L}.${D}-${T} <${k}.${L}.${+D+1}-0`:U=`>=${k}.${L}.${D}-${T} <${k}.${+L+1}.0-0`:U=`>=${k}.${L}.${D}-${T} <${+k+1}.0.0-0`):(o("no pr"),k==="0"?L==="0"?U=`>=${k}.${L}.${D}${C} <${k}.${L}.${+D+1}-0`:U=`>=${k}.${L}.${D}${C} <${k}.${+L+1}.0-0`:U=`>=${k}.${L}.${D} <${+k+1}.0.0-0`),o("caret return",U),U})},Z=(w,m)=>(o("replaceXRanges",w,m),w.split(/\s+/).map(R=>ee(R,m)).join(" ")),ee=(w,m)=>{w=w.trim();const R=m.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return w.replace(R,(C,I,k,L,D,T)=>{o("xRange",w,C,I,k,L,D,T);const U=_(k),ae=U||_(L),J=ae||_(D),te=J;return I==="="&&te&&(I=""),T=m.includePrerelease?"-0":"",U?I===">"||I==="<"?C="<0.0.0-0":C="*":I&&te?(ae&&(L=0),D=0,I===">"?(I=">=",ae?(k=+k+1,L=0,D=0):(L=+L+1,D=0)):I==="<="&&(I="<",ae?k=+k+1:L=+L+1),I==="<"&&(T="-0"),C=`${I+k}.${L}.${D}${T}`):ae?C=`>=${k}.0.0${T} <${+k+1}.0.0-0`:J&&(C=`>=${k}.${L}.0${T} <${k}.${+L+1}.0-0`),o("xRange return",C),C})},z=(w,m)=>(o("replaceStars",w,m),w.trim().replace(c[l.STAR],"")),W=(w,m)=>(o("replaceGTE0",w,m),w.trim().replace(c[m.includePrerelease?l.GTE0PRE:l.GTE0],"")),H=w=>(m,R,C,I,k,L,D,T,U,ae,J,te)=>(_(C)?R="":_(I)?R=`>=${C}.0.0${w?"-0":""}`:_(k)?R=`>=${C}.${I}.0${w?"-0":""}`:L?R=`>=${R}`:R=`>=${R}${w?"-0":""}`,_(U)?T="":_(ae)?T=`<${+U+1}.0.0-0`:_(J)?T=`<${U}.${+ae+1}.0-0`:te?T=`<=${U}.${ae}.${J}-${te}`:w?T=`<${U}.${ae}.${+J+1}-0`:T=`<=${T}`,`${R} ${T}`.trim()),se=(w,m,R)=>{for(let C=0;C<w.length;C++)if(!w[C].test(m))return!1;if(m.prerelease.length&&!R.includePrerelease){for(let C=0;C<w.length;C++)if(o(w[C].semver),w[C].semver!==i.ANY&&w[C].semver.prerelease.length>0){const I=w[C].semver;if(I.major===m.major&&I.minor===m.minor&&I.patch===m.patch)return!0}return!1}return!0};return Xs}var Ys,ba;function Tn(){if(ba)return Ys;ba=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=r(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=u.match(d);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,d).test(u.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Ys=t;const r=Ji,{safeRe:n,t:s}=kr,i=cg,o=Mn,a=Cr,c=Le();return Ys}const dg=Le(),hg=(e,t,r)=>{try{t=new dg(t,r)}catch{return!1}return t.test(e)};var Ml=hg;Le();Le();Le();Le();const fg=Le(),gg=(e,t)=>{try{return new fg(e,t).range||"*"}catch{return null}};var pg=gg;const _g=Cr,Tl=Tn(),{ANY:mg}=Tl,bg=Le(),yg=Ml,ya=Gi,wa=xl,wg=Ll,vg=Nl,Eg=(e,t,r,n)=>{e=new _g(e,n),t=new bg(t,n);let s,i,o,a,c;switch(r){case">":s=ya,i=wg,o=wa,a=">",c=">=";break;case"<":s=wa,i=vg,o=ya,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(yg(e,t,n))return!1;for(let l=0;l<t.set.length;++l){const u=t.set[l];let d=null,h=null;if(u.forEach(f=>{f.semver===mg&&(f=new Tl(">=0.0.0")),d=d||f,h=h||f,s(f.semver,d.semver,n)?d=f:o(f.semver,h.semver,n)&&(h=f)}),d.operator===a||d.operator===c||(!h.operator||h.operator===a)&&i(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0};var Sg=Eg;const kg=Sg,Cg=(e,t,r)=>kg(e,t,">",r);var Rg=Cg;Le();Le();const Zi=Tn(),{ANY:W_}=Zi;new Zi(">=0.0.0-0");new Zi(">=0.0.0");const ei=kr,va=Ln,Ea=Al,Ig=j1,Ag=Gi;Tn();Le();const xg=Ml,Ng=pg,Lg=Rg;var Mg={valid:Ig,gt:Ag,satisfies:xg,validRange:Ng,gtr:Lg,re:ei.re,src:ei.src,tokens:ei.t,SEMVER_SPEC_VERSION:va.SEMVER_SPEC_VERSION,RELEASE_TYPES:va.RELEASE_TYPES,compareIdentifiers:Ea.compareIdentifiers,rcompareIdentifiers:Ea.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=Mg,r=gt,n=he;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",d=>(0,t.valid)(d)===null?`Expected SemVer version, got "${d}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",d=>(0,t.validRange)(d)===null?`Expected SemVer range, got "${d}"`:!0);function s(d){return(0,r.is)(d,e.VersionStruct)}e.isValidSemVerVersion=s;function i(d){return(0,r.is)(d,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(d){(0,n.assertStruct)(d,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(d){(0,n.assertStruct)(d,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function c(d,h){return(0,t.gt)(d,h)}e.gtVersion=c;function l(d,h){return(0,t.gtr)(d,h)}e.gtRange=l;function u(d,h){return(0,t.satisfies)(d,h,{includePrerelease:!0})}e.satisfiesVersionRange=u})(Cl);(function(e){var t=x&&x.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=x&&x.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(he,e),r(Er,e),r($,e),r(xn,e),r($e,e),r(Mt,e),r(bl,e),r(Sr,e),r(yl,e),r(wl,e),r(Tt,e),r(vl,e),r(He,e),r(El,e),r(Sl,e),r(kl,e),r(Cl,e)})(Yc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Yc;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Xc);var Pl=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(In,"__esModule",{value:!0});In.PollingBlockTracker=void 0;const Tg=Pl(Fi),Pg=Pl(zf),Og=br,Sa=Xc,ka=(0,Sa.createModuleLogger)(Sa.projectLogger,"polling-block-tracker"),Bg=(0,Tg.default)(),Dg=1e3;class Fg extends Og.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Dg,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Ca(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
3
|
+
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=Ca(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Bg(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),ka("Making request",t);const r=await(0,Pg.default)(n=>this._provider.sendAsync(t,n))();if(ka("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
|
+
${r.error.message}`);return r.result}}In.PollingBlockTracker=Fg;function Ca(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Pn={},jg=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.SubscribeBlockTracker=void 0;const $g=jg(Fi),Hg=br,Ug=(0,$g.default)();class Vg extends Hg.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:Ug(),method:t,params:r,jsonrpc:"2.0"},(i,o)=>{i?s(i):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Pn.SubscribeBlockTracker=Vg;(function(e){var t=x&&x.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=x&&x.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(In,e),r(Pn,e)})(Kc);var Qi={},On={},Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.getUniqueId=void 0;const Ol=4294967295;let ti=Math.floor(Math.random()*Ol);function Wg(){return ti=(ti+1)%Ol,ti}Rr.getUniqueId=Wg;Object.defineProperty(On,"__esModule",{value:!0});On.createIdRemapMiddleware=void 0;const zg=Rr;function qg(){return(e,t,r,n)=>{const s=e.id,i=zg.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}On.createIdRemapMiddleware=qg;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.createAsyncMiddleware=void 0;function Jg(e){return async(t,r,n,s)=>{let i;const o=new Promise(u=>{i=u});let a=null,c=!1;const l=async()=>{c=!0,n(u=>{a=u,i()}),await o};try{await e(t,r,l),c?(await o,a(null)):s(null)}catch(u){a?a(u):s(u)}}}Bn.createAsyncMiddleware=Jg;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.createScaffoldMiddleware=void 0;function Gg(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}Dn.createScaffoldMiddleware=Gg;var Ir={},Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});const Zg=Ha;function Ra(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Qg(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Kg=class extends Zg.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")Ra(i,this,r);else{const o=i.length,a=Qg(i);for(let c=0;c<o;c+=1)Ra(a[c],this,r)}return!0}};Ki.default=Kg;var Bl={},Qe={},Xg=er;er.default=er;er.stable=jl;er.stableStringify=jl;var Zr="[...]",Dl="[Circular]",lt=[],ot=[];function Fl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function er(e,t,r,n){typeof n>"u"&&(n=Fl()),mi(e,"",0,[],void 0,0,n);var s;try{ot.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,$l(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;lt.length!==0;){var i=lt.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Ct(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),lt.push([n,r,t,s])):ot.push([t,r,e]):(n[r]=e,lt.push([n,r,t]))}function mi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ct(Dl,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Ct(Zr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Ct(Zr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)mi(e[a],a,a,n,e,i,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];mi(e[l],l,a,n,e,i,o)}}n.pop()}}function Yg(e,t){return e<t?-1:e>t?1:0}function jl(e,t,r,n){typeof n>"u"&&(n=Fl());var s=bi(e,"",0,[],void 0,0,n)||e,i;try{ot.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,$l(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;lt.length!==0;){var o=lt.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function bi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ct(Dl,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Ct(Zr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Ct(Zr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)bi(e[a],a,a,n,e,i,o);else{var c={},l=Object.keys(e).sort(Yg);for(a=0;a<l.length;a++){var u=l[a];bi(e[u],u,a,n,e,i,o),c[u]=e[u]}if(typeof s<"u")lt.push([s,t,e]),s[t]=c;else return c}n.pop()}}function $l(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(ot.length>0)for(var n=0;n<ot.length;n++){var s=ot[n];if(s[1]===t&&s[0]===r){r=s[2],ot.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Qe,"__esModule",{value:!0});Qe.EthereumProviderError=Qe.EthereumRpcError=void 0;const ep=Xg;class Hl extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return ep.default(this.serialize(),np,2)}}Qe.EthereumRpcError=Hl;class tp extends Hl{constructor(t,r,n){if(!rp(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Qe.EthereumProviderError=tp;function rp(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function np(e,t){if(t!=="[Circular]")return t}var Xi={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.errorValues=Ke.errorCodes=void 0;Ke.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Ke.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ke,r=Qe,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,f=s){if(Number.isInteger(h)){const b=h.toString();if(d(t.errorValues,b))return t.errorValues[b].message;if(l(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||l(h))}e.isValidCode=a;function c(h,{fallbackError:f=i,shouldIncludeStack:b=!1}={}){var g,E;if(!f||!Number.isInteger(f.code)||typeof f.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const y={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&a(h.code)){const _=h;y.code=_.code,_.message&&typeof _.message=="string"?(y.message=_.message,d(_,"data")&&(y.data=_.data)):(y.message=o(y.code),y.data={originalError:u(h)})}else{y.code=f.code;const _=(g=h)===null||g===void 0?void 0:g.message;y.message=_&&typeof _=="string"?_:f.message,y.data={originalError:u(h)}}const p=(E=h)===null||E===void 0?void 0:E.stack;return b&&h&&p&&typeof p=="string"&&(y.stack=p),y}e.serializeError=c;function l(h){return h>=-32099&&h<=-32e3}function u(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,f){return Object.prototype.hasOwnProperty.call(h,f)}})(Xi);var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.ethErrors=void 0;const Yi=Qe,Ul=Xi,fe=Ke;Fn.ethErrors={rpc:{parse:e=>Ee(fe.errorCodes.rpc.parse,e),invalidRequest:e=>Ee(fe.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ee(fe.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ee(fe.errorCodes.rpc.methodNotFound,e),internal:e=>Ee(fe.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ee(t,e)},invalidInput:e=>Ee(fe.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ee(fe.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ee(fe.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ee(fe.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ee(fe.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ee(fe.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>qt(fe.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>qt(fe.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>qt(fe.errorCodes.provider.unsupportedMethod,e),disconnected:e=>qt(fe.errorCodes.provider.disconnected,e),chainDisconnected:e=>qt(fe.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Yi.EthereumProviderError(t,r,n)}}};function Ee(e,t){const[r,n]=Vl(t);return new Yi.EthereumRpcError(e,r||Ul.getMessageFromCode(e),n)}function qt(e,t){const[r,n]=Vl(t);return new Yi.EthereumProviderError(e,r||Ul.getMessageFromCode(e),n)}function Vl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Qe;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Xi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Fn;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=Ke;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(Bl);var sp=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.JsonRpcEngine=void 0;const ip=sp(Ki),Se=Bl;class Ue extends ip.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await Ue._runAllMiddleware(t,r,this._middleware);return o?(await Ue._runReturnHandlers(a),s(i)):n(async c=>{try{await Ue._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new Se.EthereumRpcError(Se.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new Se.EthereumRpcError(Se.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(o){i=o}return i&&(delete s.result,s.error||(s.error=Se.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await Ue._runAllMiddleware(t,r,this._middleware);if(Ue._checkForCompletion(t,r,s),await Ue._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,o=!1;for(const a of n)if([i,o]=await Ue._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const o=c=>{const l=c||r.error;l&&(r.error=Se.serializeError(l)),i([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Se.EthereumRpcError(Se.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
|
|
5
|
+
${ri(t)}`,{request:t})),s.push(c)),i([null,!1]))};try{n(t,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,s)=>{r(i=>i?s(i):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Se.EthereumRpcError(Se.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
6
|
+
${ri(t)}`,{request:t});if(!n)throw new Se.EthereumRpcError(Se.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
7
|
+
${ri(t)}`,{request:t})}}Ir.JsonRpcEngine=Ue;function ri(e){return JSON.stringify(e,null,2)}var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.mergeMiddleware=void 0;const op=Ir;function ap(e){const t=new op.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}jn.mergeMiddleware=ap;(function(e){var t=x&&x.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=x&&x.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(On,e),r(Bn,e),r(Dn,e),r(Rr,e),r(Ir,e),r(jn,e)})(Qi);var Wl={},eo={},$n={};Object.defineProperty($n,"__esModule",{value:!0});var Ia=wi,cp=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(s){return t._queue.push(s)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return Ia.__awaiter(this,void 0,void 0,function(){var r,n,s;return Ia.__generator(this,function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:r=i.sent(),n=r[0],s=r[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,i.sent()];case 4:return s(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();$n.default=cp;Object.defineProperty(eo,"__esModule",{value:!0});var Aa=wi,lp=$n,up=function(){function e(){this._semaphore=new lp.default(1)}return e.prototype.acquire=function(){return Aa.__awaiter(this,void 0,void 0,function(){var t,r;return Aa.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();eo.default=up;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.withTimeout=void 0;var Ur=wi;function dp(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(s,i){return Ur.__awaiter(n,void 0,void 0,function(){var o,a,c;return Ur.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,i(r)},t),[4,e.acquire()];case 1:return a=l.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):s(a),[2]}})})})},runExclusive:function(s){return Ur.__awaiter(this,void 0,void 0,function(){var i,o;return Ur.__generator(this,function(a){switch(a.label){case 0:i=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(i=o[1],[4,s(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return i=o,[4,s()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return i(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Hn.withTimeout=dp;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=eo;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=$n;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Hn;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Wl);var hp=gp,fp=Object.prototype.hasOwnProperty;function gp(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)fp.call(r,n)&&(e[n]=r[n])}return e}const pp=hp,_p=Fi();var mp=M;function M(e){const t=this;t.currentProvider=e}M.prototype.getBalance=Ar(2,"eth_getBalance");M.prototype.getCode=Ar(2,"eth_getCode");M.prototype.getTransactionCount=Ar(2,"eth_getTransactionCount");M.prototype.getStorageAt=Ar(3,"eth_getStorageAt");M.prototype.call=Ar(2,"eth_call");M.prototype.protocolVersion=B("eth_protocolVersion");M.prototype.syncing=B("eth_syncing");M.prototype.coinbase=B("eth_coinbase");M.prototype.mining=B("eth_mining");M.prototype.hashrate=B("eth_hashrate");M.prototype.gasPrice=B("eth_gasPrice");M.prototype.accounts=B("eth_accounts");M.prototype.blockNumber=B("eth_blockNumber");M.prototype.getBlockTransactionCountByHash=B("eth_getBlockTransactionCountByHash");M.prototype.getBlockTransactionCountByNumber=B("eth_getBlockTransactionCountByNumber");M.prototype.getUncleCountByBlockHash=B("eth_getUncleCountByBlockHash");M.prototype.getUncleCountByBlockNumber=B("eth_getUncleCountByBlockNumber");M.prototype.sign=B("eth_sign");M.prototype.sendTransaction=B("eth_sendTransaction");M.prototype.sendRawTransaction=B("eth_sendRawTransaction");M.prototype.estimateGas=B("eth_estimateGas");M.prototype.getBlockByHash=B("eth_getBlockByHash");M.prototype.getBlockByNumber=B("eth_getBlockByNumber");M.prototype.getTransactionByHash=B("eth_getTransactionByHash");M.prototype.getTransactionByBlockHashAndIndex=B("eth_getTransactionByBlockHashAndIndex");M.prototype.getTransactionByBlockNumberAndIndex=B("eth_getTransactionByBlockNumberAndIndex");M.prototype.getTransactionReceipt=B("eth_getTransactionReceipt");M.prototype.getUncleByBlockHashAndIndex=B("eth_getUncleByBlockHashAndIndex");M.prototype.getUncleByBlockNumberAndIndex=B("eth_getUncleByBlockNumberAndIndex");M.prototype.getCompilers=B("eth_getCompilers");M.prototype.compileLLL=B("eth_compileLLL");M.prototype.compileSolidity=B("eth_compileSolidity");M.prototype.compileSerpent=B("eth_compileSerpent");M.prototype.newFilter=B("eth_newFilter");M.prototype.newBlockFilter=B("eth_newBlockFilter");M.prototype.newPendingTransactionFilter=B("eth_newPendingTransactionFilter");M.prototype.uninstallFilter=B("eth_uninstallFilter");M.prototype.getFilterChanges=B("eth_getFilterChanges");M.prototype.getFilterLogs=B("eth_getFilterLogs");M.prototype.getLogs=B("eth_getLogs");M.prototype.getWork=B("eth_getWork");M.prototype.submitWork=B("eth_submitWork");M.prototype.submitHashrate=B("eth_submitHashrate");M.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(bp(e),function(n,s){if(!n&&s.error&&(n=new Error("EthQuery - RPC Error - "+s.error.message)),n)return t(n);t(null,s.result)})};function B(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Ar(e,t){return function(){const r=this;var n=[].slice.call(arguments),s=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},s)}}function bp(e){return pp({id:_p(),jsonrpc:"2.0",params:[]},e)}const xa=(e,t,r,n)=>function(...s){const i=t.promiseModule;return new i((o,a)=>{t.multiArgs?s.push((...l)=>{t.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):t.errorFirst?s.push((l,u)=>{l?a(l):o(u)}):s.push(o),Reflect.apply(e,this===r?n:this,s)})},Na=new WeakMap;var yp=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,a)=>{let c=Na.get(o);if(c||(c={},Na.set(o,c)),a in c)return c[a];const l=b=>typeof b=="string"||typeof a=="symbol"?a===b:b.test(a),u=Reflect.getOwnPropertyDescriptor(o,a),d=u===void 0||u.writable||u.configurable,f=(t.include?t.include.some(l):!t.exclude.some(l))&&d;return c[a]=f,f},s=new WeakMap,i=new Proxy(e,{apply(o,a,c){const l=s.get(o);if(l)return Reflect.apply(l,a,c);const u=t.excludeMain?o:xa(o,t,i,o);return s.set(o,u),Reflect.apply(u,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const l=s.get(c);if(l)return l;if(typeof c=="function"){const u=xa(c,t,i,o);return s.set(c,u),u}return c}});return i};const wp=yr.default;let vp=class extends wp{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var to=vp;const Ep=to;let Sp=class extends Ep{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var kp=Sp,xr={minBlockRef:Cp,bnToHex:Ip,blockRefIsNumber:Ap,hexToInt:Qr,incrementHexInt:xp,intToHex:zl,unsafeRandomBytes:Np};function Cp(...e){return Rp(e)[0]}function Rp(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Qr(t)-Qr(r))}function Ip(e){return"0x"+e.toString(16)}function Ap(e){return e&&!["earliest","latest","pending"].includes(e)}function Qr(e){return e==null?e:Number.parseInt(e,16)}function xp(e){if(e==null)return e;const t=Qr(e);return zl(t+1)}function zl(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Np(e){let t="0x";for(let r=0;r<e;r++)t+=La(),t+=La();return t}function La(){return Math.floor(Math.random()*16).toString(16)}const Lp=mp,Mp=yp,Tp=kp,{bnToHex:G_,hexToInt:Vr,incrementHexInt:Pp,minBlockRef:Op,blockRefIsNumber:Bp}=xr;let Dp=class extends Tp{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Lp(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=Op(this.params.toBlock,t),s=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(s);this.addInitialResults(i)}async update({oldBlock:t,newBlock:r}){const n=r;let s;t?s=Pp(t):s=r;const i=Object.assign({},this.params,{fromBlock:s,toBlock:n}),a=(await this._fetchLogs(i)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(t){return await Mp(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Vr(this.params.fromBlock)>=Vr(t.blockNumber)||Bp(this.params.toBlock)&&Vr(this.params.toBlock)<=Vr(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((s,i)=>{let o=t.topics[i];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(s)?s:[s];return a.includes(null)?!0:(a=a.map(u=>u.toLowerCase()),a.includes(o))})}};var Fp=Dp,ro=jp;async function jp({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Ma(t),i=Ma(r)-n+1,o=Array(i).fill().map((c,l)=>n+l).map($p);let a=await Promise.all(o.map(c=>Up(e,"eth_getBlockByNumber",[c,!1])));return a=a.filter(c=>c!==null),a}function Ma(e){return e==null?e:Number.parseInt(e,16)}function $p(e){return e==null?e:"0x"+e.toString(16)}function Hp(e,t){return new Promise((r,n)=>{e.sendAsync(t,(s,i)=>{s?n(s):i.error?n(i.error):i.result?r(i.result):n(new Error("Result was empty"))})})}async function Up(e,t,r){for(let n=0;n<3;n++)try{return await Hp(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(s){console.error(`provider.sendAsync failed: ${s.stack||s.message||s}`)}return null}const Vp=to,Wp=ro,{incrementHexInt:zp}=xr;let qp=class extends Vp{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,s=zp(t),o=(await Wp({provider:this.provider,fromBlock:s,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var Jp=qp;const Gp=to,Zp=ro,{incrementHexInt:Qp}=xr;let Kp=class extends Gp{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Qp(t),s=await Zp({provider:this.provider,fromBlock:n,toBlock:r}),i=[];for(const o of s)i.push(...o.transactions);this.addResults(i)}};var Xp=Kp;const Yp=Wl.Mutex,{createAsyncMiddleware:e_,createScaffoldMiddleware:t_}=Qi,r_=Fp,n_=Jp,s_=Xp,{intToHex:ql,hexToInt:ni}=xr;var i_=o_;function o_({blockTracker:e,provider:t}){let r=0,n={};const s=new Yp,i=a_({mutex:s}),o=t_({eth_newFilter:i(si(c)),eth_newBlockFilter:i(si(l)),eth_newPendingTransactionFilter:i(si(u)),eth_uninstallFilter:i(qr(f)),eth_getFilterChanges:i(qr(d)),eth_getFilterLogs:i(qr(h))}),a=async({oldBlock:p,newBlock:_})=>{if(n.length===0)return;const A=await s.acquire();try{await Promise.all(yt(n).map(async v=>{try{await v.update({oldBlock:p,newBlock:_})}catch(N){console.error(N)}}))}catch(v){console.error(v)}A()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=u,o.uninstallFilter=f,o.getFilterChanges=d,o.getFilterLogs=h,o.destroy=()=>{E()},o;async function c(p){const _=new r_({provider:t,params:p});return await b(_),_}async function l(){const p=new n_({provider:t});return await b(p),p}async function u(){const p=new s_({provider:t});return await b(p),p}async function d(p){const _=ni(p),A=n[_];if(!A)throw new Error(`No filter for index "${_}"`);return A.getChangesAndClear()}async function h(p){const _=ni(p),A=n[_];if(!A)throw new Error(`No filter for index "${_}"`);let v=[];return A.type==="log"&&(v=A.getAllResults()),v}async function f(p){const _=ni(p),v=!!n[_];return v&&await g(_),v}async function b(p){const _=yt(n).length,A=await e.getLatestBlock();await p.initialize({currentBlock:A}),r++,n[r]=p,p.id=r,p.idHex=ql(r);const v=yt(n).length;return y({prevFilterCount:_,newFilterCount:v}),r}async function g(p){const _=yt(n).length;delete n[p];const A=yt(n).length;y({prevFilterCount:_,newFilterCount:A})}async function E(){const p=yt(n).length;n={},y({prevFilterCount:p,newFilterCount:0})}function y({prevFilterCount:p,newFilterCount:_}){if(p===0&&_>0){e.on("sync",a);return}if(p>0&&_===0){e.removeListener("sync",a);return}}}function si(e){return qr(async(...t)=>{const r=await e(...t);return ql(r.id)})}function qr(e){return e_(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function a_({mutex:e}){return t=>async(r,n,s,i)=>{(await e.acquire())(),t(r,n,s,i)}}function yt(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const c_=yr.default,{createAsyncMiddleware:Ta,createScaffoldMiddleware:l_}=Qi,u_=i_,{unsafeRandomBytes:d_,incrementHexInt:h_}=xr,f_=ro;var g_=p_;function p_({blockTracker:e,provider:t}){const r={},n=u_({blockTracker:e,provider:t});let s=!1;const i=new c_,o=l_({eth_subscribe:Ta(a),eth_unsubscribe:Ta(c)});return o.destroy=u,{events:i,middleware:o};async function a(d,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=d.params[0],b=d_(16);let g;switch(f){case"newHeads":g=E({subId:b});break;case"logs":const p=d.params[1],_=await n.newLogFilter(p);g=y({subId:b,filter:_});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${f}"`)}r[b]=g,h.result=b;return;function E({subId:p}){const _={type:f,destroy:async()=>{e.removeListener("sync",_.update)},update:async({oldBlock:A,newBlock:v})=>{const N=v,V=h_(A);(await f_({provider:t,fromBlock:V,toBlock:N})).map(__).filter(z=>z!==null).forEach(z=>{l(p,z)})}};return e.on("sync",_.update),_}function y({subId:p,filter:_}){return _.on("update",v=>l(p,v)),{type:f,destroy:async()=>await n.uninstallFilter(_.idHex)}}}async function c(d,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=d.params[0],b=r[f];if(!b){h.result=!1;return}delete r[f],await b.destroy(),h.result=!0}function l(d,h){i.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:d,result:h}})}function u(){i.removeAllListeners();for(const d in r)r[d].destroy(),delete r[d];s=!0}}function __(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(Rn,"__esModule",{value:!0});Rn.SubscriptionManager=void 0;const m_=Kc,b_=g_,Pa=()=>{};class y_{constructor(t){const r=new m_.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:s}=b_({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=s}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Pa,Pa),r}destroy(){this.subscriptionMiddleware.destroy()}}Rn.SubscriptionManager=y_;var Jl=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.CoinbaseWalletProvider=void 0;const w_=Jl(Kr()),v_=tu(),F=rr,P=S,E_=or,Oa=ke,Wr=Ft,be=Ot,ii=Jl($f),Jt=Dt,S_=Lt,k_=Rn,Ba="DefaultChainId",Da="DefaultJsonRpcUrl";class C_ extends v_.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new S_.FilterPolyfill(this),this._subscriptionManager=new k_.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const s=this.getChainId(),i=(0,P.prepend0x)(s.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(Oa.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,P.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,u=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(u,Number(l))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,P.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Da))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Da,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(Ba,r.toString(10)),((0,P.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,s,i,o){const c=await(await this.initializeRelay()).watchAsset(t,r,n,s,i,o==null?void 0:o.toString()).promise;return(0,be.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(t,r,n,s,i,o){var a,c;if((0,P.ensureIntNumber)(t)===this.getChainId())return!1;const l=await this.initializeRelay(),u=l.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!u&&await l.requestEthereumAccounts().promise;const d=await l.addEthereumChain(t.toString(),r,i,n,s,o).promise;return(0,be.isErrorResponse)(d)?!1:(((a=d.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((c=d.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,be.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===F.standardErrorCodes.provider.unsupportedChain?F.standardErrors.provider.unsupportedChain():F.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const s=n.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(Jt.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Wr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(s=>{throw(0,F.serializeError)(s,t)})}catch(n){throw(0,F.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const s=t,i=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:s,params:i};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const s=t,i=r;return this._sendAsync(s,i)}if(Array.isArray(t))return t.map(i=>this._sendRequest(i));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,F.serializeError)(n,t)})}catch(n){return Promise.reject((0,F.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const s=r;this._sendMultipleRequestsAsync(t).then(i=>s(null,i)).catch(i=>s(i,null));return}const n=r;return this._sendRequestAsync(t).then(s=>n(null,s)).catch(s=>n(s,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,F.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,F.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw F.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw F.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw F.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const s=n===void 0?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:s,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,P.ensureRegExpString)(t)).promise;if((0,be.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const s=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,be.isErrorResponse)(s))throw(0,F.serializeError)(s.errorMessage,"generic");if(typeof s.result!="string")throw(0,F.serializeError)("result was not a string","generic");return s.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(Jt.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?Wr.Session.hash(this._relay.session.id):void 0});let n;try{const i=await this.initializeRelay();if(!(i instanceof E_.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await i.connectAndSignIn(t).promise,(0,be.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):i}if(!n.result)throw new Error("accounts received is empty");const{accounts:s}=n.result;return this._setAddresses(s),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,be.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(s=>(0,P.ensureAddressString)(s));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Oa.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const s=this._handleSynchronousMethods(t);if(s!==void 0)return r({jsonrpc:"2.0",id:t.id,result:s});const i=this._handleAsynchronousFilterMethods(t);if(i!==void 0){i.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(s){return n(s)}this._handleAsynchronousMethods(t).then(s=>s&&r(Object.assign(Object.assign({},s),{id:t.id}))).catch(s=>n(s))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(i=>{var o;throw(i.code===F.standardErrorCodes.rpc.methodNotFound||i.code===F.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(Jt.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?Wr.Session.hash(this._relay.session.id):void 0})),i})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,P.ensureAddressString)(t);return this._addresses.map(s=>(0,P.ensureAddressString)(s)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(Jt.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,P.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,P.ensureAddressString)(t.to):null,s=t.value!=null?(0,P.ensureBN)(t.value):new w_.default(0),i=t.data?(0,P.ensureBuffer)(t.data):O.alloc(0),o=t.nonce!=null?(0,P.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,P.ensureBN)(t.gasPrice):null,c=t.maxFeePerGas!=null?(0,P.ensureBN)(t.maxFeePerGas):null,l=t.maxPriorityFeePerGas!=null?(0,P.ensureBN)(t.maxPriorityFeePerGas):null,u=t.gas!=null?(0,P.ensureBN)(t.gas):null,d=t.chainId?(0,P.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:s,data:i,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:u,chainId:d}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw F.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw F.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,s){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,s).promise;if((0,be.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(t,r,n){const i=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,be.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,P.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Ba);if(!t)return(0,P.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,P.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(Jt.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Wr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,be.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,be.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,P.ensureBuffer)(t[0]),s=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,be.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,be.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,P.ensureParsedJSONObject)(t[0]),n=(0,P.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const s=ii.default.hashForSignTypedDataLegacy({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,n,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=ii.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=ii.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,s,i;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw F.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw F.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(s=o.blockExplorerUrls)!==null&&s!==void 0?s:[],o.chainName,(i=o.iconUrls)!==null&&i!==void 0?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw F.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw F.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw F.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw F.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:s,symbol:i,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,s,i,a,o,n)}}_eth_uninstallFilter(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Rt.CoinbaseWalletProvider=C_;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.RelayEventManager=void 0;const R_=S;class I_{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,R_.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Un.RelayEventManager=I_;Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CoinbaseWalletSDK=void 0;const A_=Xr,x_=Yr,Fa=S,N_=sn,L_=Rt,M_=or,T_=mr,P_=Un,O_=hr,B_=ar,Gl=Bt;class Vn{constructor(t){var r,n,s;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||x_.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(s=t.reloadOnDisconnect)!==null&&s!==void 0?s:!0;const o=new URL(i),a=`${o.protocol}//${o.host}`;if(this._storage=new N_.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Vn.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new P_.RelayEventManager;const c=(0,Fa.isMobileWeb)(),l=t.uiConstructor||(d=>c?new T_.MobileRelayUI(d):new O_.WalletLinkRelayUI(d)),u={linkAPIUrl:i,version:Gl.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:l,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=c?new M_.MobileRelay(u):new B_.WalletLinkRelay(u),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const s=this.coinbaseBrowser;if(s)return s;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new L_.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,Fa.getFavicon)();const s=this.walletExtension;s?this.isCipherProvider(s)||s.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,A_.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}Kt.CoinbaseWalletSDK=Vn;Vn.VERSION=Gl.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Kt,r=Rt;var n=Kt;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var s=Rt;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return s.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(vi);const D_=ru(vi),X_=nu({__proto__:null,default:D_},[vi]);export{X_ as i};
|