@dcl/auth-site 4.12.1-23265207440.commit-a5ffaee → 4.13.0
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-M5yW8-jA.js → ConstantsUtil-DVDJ9-59.js} +1 -1
- package/assets/{ContentfulRichText-D5a4a3rf.js → ContentfulRichText-DWKKtbaL.js} +1 -1
- package/assets/{ExchangeController-K4dWpzlN.js → ExchangeController-B3daLrEK.js} +1 -1
- package/assets/{HelpersUtil-DlAzAF4O.js → HelpersUtil-BHAt7p7-.js} +1 -1
- package/assets/{NetworkUtil-BrV4QYNW.js → NetworkUtil-DR6mflW_.js} +1 -1
- package/assets/{SwapController-BhabUlNi.js → SwapController-CilNfc8_.js} +1 -1
- package/assets/{biconomy-DOWm-w-n.js → biconomy-I-I_-viH.js} +1 -1
- package/assets/{browser-Bd7g5QP2.js → browser-D_MxC_xM.js} +1 -1
- package/assets/{ccip-eVPQhOKi.js → ccip-BVm-SJRP.js} +1 -1
- package/assets/{chains-176Xw5JH.js → chains-BjggsxcF.js} +1 -1
- package/assets/{common-Cqs2IA5v.js → common-Cg9enf0K.js} +1 -1
- package/assets/{controller-DyfP9sLB.js → controller-YkSgIit7.js} +2 -2
- package/assets/{data-capture-D5_2fLso.js → data-capture-_0qp1I11.js} +1 -1
- package/assets/{email-DnEShvFk.js → email-BFU4tW-g.js} +1 -1
- package/assets/{embedded-wallet-DYXscQ66.js → embedded-wallet-0YSXlRLN.js} +1 -1
- package/assets/{engine-C-Yz7eXx.js → engine-BQ4cCNig.js} +1 -1
- package/assets/{estimate-l1-fee-XdVvOFs7.js → estimate-l1-fee-Da92HnxG.js} +1 -1
- package/assets/{ethereum-CEHvWqGp.js → ethereum-CSpZIkDL.js} +1 -1
- package/assets/{extractIPFS-D__CSQqh.js → extractIPFS-Dx0Y4SRE.js} +1 -1
- package/assets/{features-CZxuFnoj.js → features-DHcL4BPI.js} +1 -1
- package/assets/{fetchTokenMetadata-CG79NU3-.js → fetchTokenMetadata-DFQmdwU0.js} +1 -1
- package/assets/{fortmatic-DKEABnlX.js → fortmatic-PiPz63cA.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-3-CvIBpv.js → get-ecosystem-wallet-info-7SR8j0n3.js} +1 -1
- package/assets/{getBalance-C-HFrUIb.js → getBalance-B8pR12qo.js} +1 -1
- package/assets/{getInstalledModules-B-y2-Apy.js → getInstalledModules-C3CN3nsq.js} +1 -1
- package/assets/{getNFT-D-SQ3bNw.js → getNFT-CNx90u7Y.js} +2 -2
- package/assets/{getNFT-Cyqa8Plr.js → getNFT-DQ9pTnZz.js} +1 -1
- package/assets/{if-defined-CT5YX5TG.js → if-defined-iZO3hIik.js} +1 -1
- package/assets/{in-app-wallet-calls-C6XORNPV.js → in-app-wallet-calls-DK_8WpWI.js} +1 -1
- package/assets/{index-Bs_xOXhp.js → index-0-Kt-XuY.js} +1 -1
- package/assets/{index-DZqmV02G.js → index-B37hV-1M.js} +1 -1
- package/assets/{index-CL_MAWLe.js → index-BOxoe9iD.js} +1 -1
- package/assets/{index-BjAWPWu_.js → index-BZSJ7SQx.js} +1 -1
- package/assets/{index-DqcaeYJj.js → index-Bd59me9m.js} +1 -1
- package/assets/{index-DF9L3XKL.js → index-BflN8Fol.js} +1 -1
- package/assets/{index-BxsND-28.js → index-BgOYWWqu.js} +1 -1
- package/assets/{index-CgB_tpN6.js → index-BhHkIX9V.js} +1 -1
- package/assets/{index-BcQ2gsv4.js → index-ByDiAiaR.js} +1 -1
- package/assets/{index-CHDNpoUG.js → index-C-EtPQNp.js} +1 -1
- package/assets/{index-I2dplyKh.js → index-C2a-lbUm.js} +1 -1
- package/assets/{index-Dpk5wJEj.js → index-C7L8RvD2.js} +1 -1
- package/assets/{index-Dr-J0hnN.js → index-CCRTp4CS.js} +1 -1
- package/assets/{index-Bc2QoNvn.js → index-CMEPbAeF.js} +1 -1
- package/assets/{index-Cy4E4P8Q.js → index-CTWfmTjn.js} +1 -1
- package/assets/{index-_vzAsYiN.js → index-CZZQ1lyq.js} +1 -1
- package/assets/{index-b_vLmZ-7.js → index-ClM4RDfq.js} +1 -1
- package/assets/{index-DgZlGZQe.js → index-ClRj3W0F.js} +1 -1
- package/assets/{index-D-y6nvNL.js → index-CneAbBkn.js} +1 -1
- package/assets/{index-Dl7pBYho.js → index-Csg1UaG_.js} +1 -1
- package/assets/{index-BkIL5Y4C.js → index-Cu_eih66.js} +1 -1
- package/assets/{index-BaqR43pB.js → index-D1DJwSXv.js} +1 -1
- package/assets/{index-Dp6mOny_.js → index-D5-iUL2o.js} +1 -1
- package/assets/{index-CSo98Cv8.js → index-D9_ZabeD.js} +1 -1
- package/assets/{index-YohvwMrd.js → index-DBXXJ_WR.js} +1 -1
- package/assets/{index-Cve5bLpP.js → index-DDdwpWme.js} +1 -1
- package/assets/{index-NFJCpBUZ.js → index-DKO2Lqk9.js} +1 -1
- package/assets/{index-DBXc8GaK.js → index-DLGhVOZC.js} +1 -1
- package/assets/{index-BBNzpLJg.js → index-DPaCwYzC.js} +1 -1
- package/assets/{index-BJsIuSQS.js → index-DQYdE8eP.js} +4 -4
- package/assets/{index-Cbm6EVpv.js → index-DToUKYEP.js} +1 -1
- package/assets/{index-CxU3SPMY.js → index-DjJo22x7.js} +1 -1
- package/assets/{index-C2ZT7n-h.js → index-Djd4M15b.js} +1 -1
- package/assets/{index-MpTKcH0D.js → index-DmmR5d3o.js} +1 -1
- package/assets/{index-BWLGPCDE.js → index-Dpol20Vd.js} +2 -2
- package/assets/{index-BgyBq7wF.js → index-DthuVNQ1.js} +1 -1
- package/assets/{index-D_BjQmbB.js → index-DwZ8OrHm.js} +1 -1
- package/assets/{index-iqDoByK8.js → index-Dxnh_GgF.js} +1 -1
- package/assets/index-JBb9zsWZ.css +1 -0
- package/assets/{index-CUIi0dE5.js → index-KAbp35d_.js} +1 -1
- package/assets/{index-13DXQnYT.js → index-LKuo9a6w.js} +9 -9
- package/assets/{index-BsGGLSPc.js → index-Sb1wL6e8.js} +1 -1
- package/assets/{index-rFu5MCqn.js → index-Y5nwbQF0.js} +1 -1
- package/assets/{index-S7FdaTA_.js → index-npINf2bx.js} +1 -1
- package/assets/{index.es-dkT2ml83.js → index.es-BKa4G3np.js} +1 -1
- package/assets/{index.es-xpQlHN7l.js → index.es-C1dPuf3P.js} +1 -1
- package/assets/{index.es--3fyxn8y.js → index.es-PznRBg0j.js} +1 -1
- package/assets/{native-DFOEqv-a.js → native-DWDSv76y.js} +1 -1
- package/assets/{networks-BwFuUvvC.js → networks-CKRJjRvO.js} +1 -1
- package/assets/{onramp-D13xKkds.js → onramp-BuKsSlVi.js} +1 -1
- package/assets/{openzeppelin-DrUGNPMN.js → openzeppelin-C54adYNY.js} +1 -1
- package/assets/{ownerOf-DgwIkt-E.js → ownerOf-B8xWJ7sB.js} +1 -1
- package/assets/{parseNft-C0KgiGJ8.js → parseNft-CUnHB6I-.js} +2 -2
- package/assets/{pay-with-exchange-BUoAg3fJ.js → pay-with-exchange-DYs1OZpJ.js} +1 -1
- package/assets/{qr-overlay-JoNyL3_J.js → qr-overlay-CYUCNKUD.js} +3 -3
- package/assets/{receive-BgOG4IS6.js → receive-B99PnNJ_.js} +1 -1
- package/assets/{ref-Bbbt4Rvo.js → ref-HI9jQKHI.js} +1 -1
- package/assets/{resolveImplementation-HLsp9dy1.js → resolveImplementation-PkVc6wz5.js} +1 -1
- package/assets/{secp256k1-xSyt8XU9.js → secp256k1-DjC8XqRH.js} +1 -1
- package/assets/{send-CX8J2Bf6.js → send-D3KodVD_.js} +1 -1
- package/assets/{send-eip712-transaction-C88HGddx.js → send-eip712-transaction-DsSDYKPJ.js} +1 -1
- package/assets/{send-gasless-transaction-CG-T45-r.js → send-gasless-transaction-Bt02CTph.js} +2 -2
- package/assets/{session-proposal-C0kfr8bU.js → session-proposal-CXuSp5a6.js} +1 -1
- package/assets/{session-request-Bl3tqUKv.js → session-request-CqZZHlKp.js} +2 -2
- package/assets/{socials-Be-AypbT.js → socials-B6qFh_y-.js} +1 -1
- package/assets/{swaps-D_E6Q8ug.js → swaps-BHai77zi.js} +1 -1
- package/assets/{thirdweb-B4uPXbkw.js → thirdweb-BqnCxuFo.js} +5 -5
- package/assets/{totalSupply-BttU0uj3.js → totalSupply-CyM0J-JB.js} +1 -1
- package/assets/{transactions-BYQTZN1L.js → transactions-CAYX0Nwv.js} +1 -1
- package/assets/{ui-CSTbCQwk.js → ui-BBwYSKNx.js} +5 -5
- package/assets/{vendor-DahexbvH.js → vendor-DsHXTNqy.js} +1 -1
- package/assets/{w3m-modal-BoUklqWf.js → w3m-modal-hLuyv0Zr.js} +1 -1
- package/assets/{wallets-CZg5vQWs.js → wallets-BXXt9e5T.js} +5 -5
- package/assets/{web-connector-DB6vmoMW.js → web-connector-D9A_ue3s.js} +3 -3
- package/index.html +5 -5
- package/package.json +2 -2
- package/assets/index-BltYrK2m.css +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{B as N}from"./ui-CSTbCQwk.js";import{g as Lt,ax as At,ay as xt,az as Mt}from"./thirdweb-B4uPXbkw.js";import{c as ne}from"./clsx.m-DHulAg21.js";import{B as we,_ as P,h as Me,y as Rt}from"./hooks.module-MHgUT2ti.js";import"./vendor-DahexbvH.js";const Pt=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};class q{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let s=0;s<localStorage.length;s++){const r=localStorage.key(s);typeof r=="string"&&r.startsWith(e)&&n.push(r)}n.forEach(s=>localStorage.removeItem(s))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new q("CBWSDK").clear(),new q("walletlink").clear()}}const U={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}},be={"-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."}},tt="Unspecified error message.",Tt="Unspecified server error.";function Ee(t,e=tt){if(t&&Number.isInteger(t)){const n=t.toString();if(ye(be,n))return be[n].message;if(nt(t))return Tt}return e}function Ot(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(be[e]||nt(t))}function Nt(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&ye(t,"code")&&Ot(t.code)){const s=t;n.code=s.code,s.message&&typeof s.message=="string"?(n.message=s.message,ye(s,"data")&&(n.data=s.data)):(n.message=Ee(n.code),n.data={originalError:Re(t)})}else n.code=U.rpc.internal,n.message=Pe(t,"message")?t.message:tt,n.data={originalError:Re(t)};return e&&(n.stack=Pe(t,"stack")?t.stack:void 0),n}function nt(t){return t>=-32099&&t<=-32e3}function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function ye(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Pe(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const L={rpc:{parse:t=>W(U.rpc.parse,t),invalidRequest:t=>W(U.rpc.invalidRequest,t),invalidParams:t=>W(U.rpc.invalidParams,t),methodNotFound:t=>W(U.rpc.methodNotFound,t),internal:t=>W(U.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return W(e,t)},invalidInput:t=>W(U.rpc.invalidInput,t),resourceNotFound:t=>W(U.rpc.resourceNotFound,t),resourceUnavailable:t=>W(U.rpc.resourceUnavailable,t),transactionRejected:t=>W(U.rpc.transactionRejected,t),methodNotSupported:t=>W(U.rpc.methodNotSupported,t),limitExceeded:t=>W(U.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>$(U.provider.userRejectedRequest,t),unauthorized:t=>$(U.provider.unauthorized,t),unsupportedMethod:t=>$(U.provider.unsupportedMethod,t),disconnected:t=>$(U.provider.disconnected,t),chainDisconnected:t=>$(U.provider.chainDisconnected,t),unsupportedChain:t=>$(U.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:s}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new rt(e,n,s)}}};function W(t,e){const[n,s]=st(e);return new it(t,n||Ee(t),s)}function $(t,e){const[n,s]=st(e);return new rt(t,n||Ee(t),s)}function st(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class it extends Error{constructor(e,n,s){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,s!==void 0&&(this.data=s)}}class rt extends it{constructor(e,n,s){if(!Dt(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,s)}}function Dt(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ce(){return t=>t}const re=Ce(),Ut=Ce(),jt=Ce();function V(t){return Math.floor(t)}const at=/^[0-9]*$/,ot=/^[a-f0-9]*$/;function J(t){return Ie(crypto.getRandomValues(new Uint8Array(t)))}function Ie(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function oe(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function se(t,e=!1){const n=t.toString("hex");return re(e?`0x${n}`:n)}function de(t){return se(ve(t),!0)}function K(t){return jt(t.toString(10))}function Y(t){return re(`0x${BigInt(t).toString(16)}`)}function ct(t){return t.startsWith("0x")||t.startsWith("0X")}function Se(t){return ct(t)?t.slice(2):t}function dt(t){return ct(t)?`0x${t.slice(2)}`:`0x${t}`}function ce(t){if(typeof t!="string")return!1;const e=Se(t).toLowerCase();return ot.test(e)}function Ht(t,e=!1){if(typeof t=="string"){const n=Se(t).toLowerCase();if(ot.test(n))return re(e?`0x${n}`:n)}throw L.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function _e(t,e=!1){let n=Ht(t,!1);return n.length%2===1&&(n=re(`0${n}`)),e?re(`0x${n}`):n}function Z(t){if(typeof t=="string"){const e=Se(t).toLowerCase();if(ce(e)&&e.length===40)return Ut(dt(e))}throw L.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function ve(t){if(N.isBuffer(t))return t;if(typeof t=="string"){if(ce(t)){const e=_e(t,!1);return N.from(e,"hex")}return N.from(t,"utf8")}throw L.rpc.invalidParams(`Not binary data: ${String(t)}`)}function ie(t){if(typeof t=="number"&&Number.isInteger(t))return V(t);if(typeof t=="string"){if(at.test(t))return V(Number(t));if(ce(t))return V(Number(BigInt(_e(t,!0))))}throw L.rpc.invalidParams(`Not an integer: ${String(t)}`)}function ee(t){if(t!==null&&(typeof t=="bigint"||Wt(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(ie(t));if(typeof t=="string"){if(at.test(t))return BigInt(t);if(ce(t))return BigInt(_e(t,!0))}throw L.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Bt(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw L.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function Wt(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}function qt(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,s=t?t.getAttribute("href"):null;return!s||s.startsWith("javascript:")||s.startsWith("vbscript:")?`${e}//${n}/favicon.ico`:s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")?s:s.startsWith("//")?e+s:`${e}//${n}${s}`}async function Kt(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Vt(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function zt(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:s}}async function Ft(t,{iv:e,cipherText:n}){const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(s)}function lt(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function ht(t,e){const n=lt(t),s=await crypto.subtle.exportKey(n,e);return Ie(new Uint8Array(s))}async function ut(t,e){const n=lt(t),s=oe(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(s),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function Zt(t,e){const n=JSON.stringify(t,(s,r)=>{if(!(r instanceof Error))return r;const i=r;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return zt(e,n)}async function Gt(t,e){return JSON.parse(await Ft(e,t))}const le={storageKey:"ownPrivateKey",keyType:"private"},he={storageKey:"ownPublicKey",keyType:"public"},ue={storageKey:"peerPublicKey",keyType:"public"};class Yt{constructor(){this.storage=new q("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(he.storageKey),this.storage.removeItem(le.storageKey),this.storage.removeItem(ue.storageKey)}async generateKeyPair(){const e=await Kt();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(le,e.privateKey),await this.storeKey(he,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(le)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(he)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await Vt(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?ut(e.keyType,n):null}async storeKey(e,n){const s=await ht(e.keyType,n);this.storage.setItem(e.storageKey,s)}}const X="4.3.0",ft="@coinbase/wallet-sdk";async function Le(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}),s=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":X,"X-Cbw-Sdk-Platform":ft}}),{result:r,error:i}=await s.json();if(i)throw i;return r}function Jt(){return globalThis.coinbaseWalletExtension}function $t(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function pt({metadata:t,preference:e}){var n,s;const{appName:r,appLogoUrl:i,appChainIds:a}=t;if(e.options!=="smartWalletOnly"){const h=Jt();if(h)return(n=h.setAppInfo)===null||n===void 0||n.call(h,r,i,a,e),h}const o=$t();if(o!=null&&o.isCoinbaseBrowser)return(s=o.setAppInfo)===null||s===void 0||s.call(o,r,i,a,e),o}function Qt(t){if(!t||typeof t!="object"||Array.isArray(t))throw L.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw L.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw L.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw L.provider.unsupportedMethod()}}const Te="accounts",Oe="activeChain",Ne="availableChains",De="walletCapabilities";class Xt{constructor(e){var n,s,r;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new Yt,this.storage=new q("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(Te))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(Oe)||{id:(r=(s=e.metadata.appChainIds)===null||s===void 0?void 0:s[0])!==null&&r!==void 0?r:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,s,r,i;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const a=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(r=e.params)!==null&&r!==void 0?r:{})}}),o=await this.communicator.postRequestAndWaitForResponse(a);if("failure"in o.content)throw o.content.failure;const h=await ut("public",o.sender);await this.keyManager.setPeerPublicKey(h);const v=(await this.decryptResponseMessage(o)).result;if("error"in v)throw v.error;switch(e.method){case"eth_requestAccounts":{const k=v.value;this.accounts=k,this.storage.storeObject(Te,k),(i=this.callback)===null||i===void 0||i.call(this,"accountsChanged",k);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw L.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Y(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return Y(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(De);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw L.rpc.internal("No RPC URL set for chain");return Le(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,s;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const r=await this.sendEncryptedRequest(e),a=(await this.decryptResponseMessage(r)).result;if("error"in a)throw a.error;return a.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const s=e.params;if(!s||!(!((n=s[0])===null||n===void 0)&&n.chainId))throw L.rpc.invalidParams();const r=ie(s[0].chainId);if(this.updateChain(r))return null;const a=await this.sendRequestToPopup(e);return a===null&&this.updateChain(r),a}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw L.provider.unauthorized("No valid session found, try requestAccounts before other methods");const s=await Zt({action:e,chainId:this.chain.id},n),r=await this.createRequestMessage({encrypted:s});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){const n=await ht("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,s;const r=e.content;if("failure"in r)throw r.failure;const i=await this.keyManager.getSharedSecret();if(!i)throw L.provider.unauthorized("Invalid session");const a=await Gt(r.encrypted,i),o=(n=a.data)===null||n===void 0?void 0:n.chains;if(o){const p=Object.entries(o).map(([v,k])=>({id:Number(v),rpcUrl:k}));this.storage.storeObject(Ne,p),this.updateChain(this.chain.id,p)}const h=(s=a.data)===null||s===void 0?void 0:s.capabilities;return h&&this.storage.storeObject(De,h),a}updateChain(e,n){var s;const r=n??this.storage.loadObject(Ne),i=r==null?void 0:r.find(a=>a.id===e);return i?(i!==this.chain&&(this.chain=i,this.storage.storeObject(Oe,i),(s=this.callback)===null||s===void 0||s.call(this,"chainChanged",Y(i.id))),!0):!1}}var O={},G={},Ue;function gt(){if(Ue)return G;Ue=1,Object.defineProperty(G,"__esModule",{value:!0}),G.anumber=t,G.abytes=n,G.ahash=s,G.aexists=r,G.aoutput=i;function t(a){if(!Number.isSafeInteger(a)||a<0)throw new Error("positive integer expected, got "+a)}function e(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"}function n(a,...o){if(!e(a))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(a.length))throw new Error("Uint8Array expected of length "+o+", got length="+a.length)}function s(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(a.outputLen),t(a.blockLen)}function r(a,o=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(o&&a.finished)throw new Error("Hash#digest() has already been called")}function i(a,o){n(a);const h=o.outputLen;if(a.length<h)throw new Error("digestInto() expects output buffer of length at least "+h)}return G}var C={},je;function en(){if(je)return C;je=1,Object.defineProperty(C,"__esModule",{value:!0}),C.add5L=C.add5H=C.add4H=C.add4L=C.add3H=C.add3L=C.rotlBL=C.rotlBH=C.rotlSL=C.rotlSH=C.rotr32L=C.rotr32H=C.rotrBL=C.rotrBH=C.rotrSL=C.rotrSH=C.shrSL=C.shrSH=C.toBig=void 0,C.fromBig=n,C.split=s,C.add=A;const t=BigInt(2**32-1),e=BigInt(32);function n(g,f=!1){return f?{h:Number(g&t),l:Number(g>>e&t)}:{h:Number(g>>e&t)|0,l:Number(g&t)|0}}function s(g,f=!1){let m=new Uint32Array(g.length),d=new Uint32Array(g.length);for(let w=0;w<g.length;w++){const{h:_,l:R}=n(g[w],f);[m[w],d[w]]=[_,R]}return[m,d]}const r=(g,f)=>BigInt(g>>>0)<<e|BigInt(f>>>0);C.toBig=r;const i=(g,f,m)=>g>>>m;C.shrSH=i;const a=(g,f,m)=>g<<32-m|f>>>m;C.shrSL=a;const o=(g,f,m)=>g>>>m|f<<32-m;C.rotrSH=o;const h=(g,f,m)=>g<<32-m|f>>>m;C.rotrSL=h;const p=(g,f,m)=>g<<64-m|f>>>m-32;C.rotrBH=p;const v=(g,f,m)=>g>>>m-32|f<<64-m;C.rotrBL=v;const k=(g,f)=>f;C.rotr32H=k;const l=(g,f)=>g;C.rotr32L=l;const c=(g,f,m)=>g<<m|f>>>32-m;C.rotlSH=c;const u=(g,f,m)=>f<<m|g>>>32-m;C.rotlSL=u;const S=(g,f,m)=>f<<m-32|g>>>64-m;C.rotlBH=S;const E=(g,f,m)=>g<<m-32|f>>>64-m;C.rotlBL=E;function A(g,f,m,d){const w=(f>>>0)+(d>>>0);return{h:g+m+(w/2**32|0)|0,l:w|0}}const M=(g,f,m)=>(g>>>0)+(f>>>0)+(m>>>0);C.add3L=M;const D=(g,f,m,d)=>f+m+d+(g/2**32|0)|0;C.add3H=D;const y=(g,f,m,d)=>(g>>>0)+(f>>>0)+(m>>>0)+(d>>>0);C.add4L=y;const b=(g,f,m,d,w)=>f+m+d+w+(g/2**32|0)|0;C.add4H=b;const I=(g,f,m,d,w)=>(g>>>0)+(f>>>0)+(m>>>0)+(d>>>0)+(w>>>0);C.add5L=I;const x=(g,f,m,d,w,_)=>f+m+d+w+_+(g/2**32|0)|0;C.add5H=x;const T={fromBig:n,split:s,toBig:r,shrSH:i,shrSL:a,rotrSH:o,rotrSL:h,rotrBH:p,rotrBL:v,rotr32H:k,rotr32L:l,rotlSH:c,rotlSL:u,rotlBH:S,rotlBL:E,add:A,add3L:M,add3H:D,add4L:y,add4H:b,add5H:x,add5L:I};return C.default=T,C}var fe={},te={},He;function tn(){return He||(He=1,Object.defineProperty(te,"__esModule",{value:!0}),te.crypto=void 0,te.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),te}var Be;function nn(){return Be||(Be=1,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=s,t.u8=r,t.u32=i,t.createView=a,t.rotr=o,t.rotl=h,t.byteSwap=p,t.byteSwap32=v,t.bytesToHex=c,t.hexToBytes=E,t.asyncLoop=M,t.utf8ToBytes=D,t.toBytes=y,t.concatBytes=b,t.checkOpts=x,t.wrapConstructor=T,t.wrapConstructorWithOpts=g,t.wrapXOFConstructorWithOpts=f,t.randomBytes=m;const e=tn(),n=gt();function s(d){return d instanceof Uint8Array||ArrayBuffer.isView(d)&&d.constructor.name==="Uint8Array"}function r(d){return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}function i(d){return new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4))}function a(d){return new DataView(d.buffer,d.byteOffset,d.byteLength)}function o(d,w){return d<<32-w|d>>>w}function h(d,w){return d<<w|d>>>32-w>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function p(d){return d<<24&4278190080|d<<8&16711680|d>>>8&65280|d>>>24&255}t.byteSwapIfBE=t.isLE?d=>d:d=>p(d);function v(d){for(let w=0;w<d.length;w++)d[w]=p(d[w])}const k=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",l=Array.from({length:256},(d,w)=>w.toString(16).padStart(2,"0"));function c(d){if((0,n.abytes)(d),k)return d.toHex();let w="";for(let _=0;_<d.length;_++)w+=l[d[_]];return w}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function S(d){if(d>=u._0&&d<=u._9)return d-u._0;if(d>=u.A&&d<=u.F)return d-(u.A-10);if(d>=u.a&&d<=u.f)return d-(u.a-10)}function E(d){if(typeof d!="string")throw new Error("hex string expected, got "+typeof d);if(k)return Uint8Array.fromHex(d);const w=d.length,_=w/2;if(w%2)throw new Error("hex string expected, got unpadded hex of length "+w);const R=new Uint8Array(_);for(let j=0,H=0;j<_;j++,H+=2){const Ae=S(d.charCodeAt(H)),xe=S(d.charCodeAt(H+1));if(Ae===void 0||xe===void 0){const _t=d[H]+d[H+1];throw new Error('hex string expected, got non-hex character "'+_t+'" at index '+H)}R[j]=Ae*16+xe}return R}const A=async()=>{};t.nextTick=A;async function M(d,w,_){let R=Date.now();for(let j=0;j<d;j++){_(j);const H=Date.now()-R;H>=0&&H<w||(await(0,t.nextTick)(),R+=H)}}function D(d){if(typeof d!="string")throw new Error("utf8ToBytes expected string, got "+typeof d);return new Uint8Array(new TextEncoder().encode(d))}function y(d){return typeof d=="string"&&(d=D(d)),(0,n.abytes)(d),d}function b(...d){let w=0;for(let R=0;R<d.length;R++){const j=d[R];(0,n.abytes)(j),w+=j.length}const _=new Uint8Array(w);for(let R=0,j=0;R<d.length;R++){const H=d[R];_.set(H,j),j+=H.length}return _}class I{clone(){return this._cloneInto()}}t.Hash=I;function x(d,w){if(w!==void 0&&{}.toString.call(w)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(d,w)}function T(d){const w=R=>d().update(y(R)).digest(),_=d();return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=()=>d(),w}function g(d){const w=(R,j)=>d(j).update(y(R)).digest(),_=d({});return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=R=>d(R),w}function f(d){const w=(R,j)=>d(j).update(y(R)).digest(),_=d({});return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=R=>d(R),w}function m(d=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(d));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(d));throw new Error("crypto.getRandomValues must be defined")}}(fe)),fe}var We;function sn(){if(We)return O;We=1,Object.defineProperty(O,"__esModule",{value:!0}),O.shake256=O.shake128=O.keccak_512=O.keccak_384=O.keccak_256=O.keccak_224=O.sha3_512=O.sha3_384=O.sha3_256=O.sha3_224=O.Keccak=void 0,O.keccakP=E;const t=gt(),e=en(),n=nn(),s=[],r=[],i=[],a=BigInt(0),o=BigInt(1),h=BigInt(2),p=BigInt(7),v=BigInt(256),k=BigInt(113);for(let y=0,b=o,I=1,x=0;y<24;y++){[I,x]=[x,(2*I+3*x)%5],s.push(2*(5*x+I)),r.push((y+1)*(y+2)/2%64);let T=a;for(let g=0;g<7;g++)b=(b<<o^(b>>p)*k)%v,b&h&&(T^=o<<(o<<BigInt(g))-o);i.push(T)}const[l,c]=(0,e.split)(i,!0),u=(y,b,I)=>I>32?(0,e.rotlBH)(y,b,I):(0,e.rotlSH)(y,b,I),S=(y,b,I)=>I>32?(0,e.rotlBL)(y,b,I):(0,e.rotlSL)(y,b,I);function E(y,b=24){const I=new Uint32Array(10);for(let x=24-b;x<24;x++){for(let f=0;f<10;f++)I[f]=y[f]^y[f+10]^y[f+20]^y[f+30]^y[f+40];for(let f=0;f<10;f+=2){const m=(f+8)%10,d=(f+2)%10,w=I[d],_=I[d+1],R=u(w,_,1)^I[m],j=S(w,_,1)^I[m+1];for(let H=0;H<50;H+=10)y[f+H]^=R,y[f+H+1]^=j}let T=y[2],g=y[3];for(let f=0;f<24;f++){const m=r[f],d=u(T,g,m),w=S(T,g,m),_=s[f];T=y[_],g=y[_+1],y[_]=d,y[_+1]=w}for(let f=0;f<50;f+=10){for(let m=0;m<10;m++)I[m]=y[f+m];for(let m=0;m<10;m++)y[f+m]^=~I[(m+2)%10]&I[(m+4)%10]}y[0]^=l[x],y[1]^=c[x]}I.fill(0)}class A extends n.Hash{constructor(b,I,x,T=!1,g=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=b,this.suffix=I,this.outputLen=x,this.enableXOF=T,this.rounds=g,(0,t.anumber)(x),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}keccak(){n.isLE||(0,n.byteSwap32)(this.state32),E(this.state32,this.rounds),n.isLE||(0,n.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(b){(0,t.aexists)(this);const{blockLen:I,state:x}=this;b=(0,n.toBytes)(b);const T=b.length;for(let g=0;g<T;){const f=Math.min(I-this.pos,T-g);for(let m=0;m<f;m++)x[this.pos++]^=b[g++];this.pos===I&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:b,suffix:I,pos:x,blockLen:T}=this;b[x]^=I,I&128&&x===T-1&&this.keccak(),b[T-1]^=128,this.keccak()}writeInto(b){(0,t.aexists)(this,!1),(0,t.abytes)(b),this.finish();const I=this.state,{blockLen:x}=this;for(let T=0,g=b.length;T<g;){this.posOut>=x&&this.keccak();const f=Math.min(x-this.posOut,g-T);b.set(I.subarray(this.posOut,this.posOut+f),T),this.posOut+=f,T+=f}return b}xofInto(b){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(b)}xof(b){return(0,t.anumber)(b),this.xofInto(new Uint8Array(b))}digestInto(b){if((0,t.aoutput)(b,this),this.finished)throw new Error("digest() was already called");return this.writeInto(b),this.destroy(),b}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(b){const{blockLen:I,suffix:x,outputLen:T,rounds:g,enableXOF:f}=this;return b||(b=new A(I,x,T,f,g)),b.state32.set(this.state32),b.pos=this.pos,b.posOut=this.posOut,b.finished=this.finished,b.rounds=g,b.suffix=x,b.outputLen=T,b.enableXOF=f,b.destroyed=this.destroyed,b}}O.Keccak=A;const M=(y,b,I)=>(0,n.wrapConstructor)(()=>new A(b,y,I));O.sha3_224=M(6,144,224/8),O.sha3_256=M(6,136,256/8),O.sha3_384=M(6,104,384/8),O.sha3_512=M(6,72,512/8),O.keccak_224=M(1,144,224/8),O.keccak_256=M(1,136,256/8),O.keccak_384=M(1,104,384/8),O.keccak_512=M(1,72,512/8);const D=(y,b,I)=>(0,n.wrapXOFConstructorWithOpts)((x={})=>new A(b,y,x.dkLen===void 0?I:x.dkLen,!0));return O.shake128=D(31,168,128/8),O.shake256=D(31,136,256/8),O}var pe,qe;function mt(){if(qe)return pe;qe=1;const{keccak_256:t}=sn();function e(c){return N.allocUnsafe(c).fill(0)}function n(c){return c.toString(2).length}function s(c,u){let S=c.toString(16);S.length%2!==0&&(S="0"+S);const E=S.match(/.{1,2}/g).map(A=>parseInt(A,16));for(;E.length<u;)E.unshift(0);return N.from(E)}function r(c,u){const S=c<0n;let E;if(S){const A=(1n<<BigInt(u))-1n;E=(~c&A)+1n}else E=c;return E&=(1n<<BigInt(u))-1n,E}function i(c,u,S){const E=e(u);return c=o(c),S?c.length<u?(c.copy(E),E):c.slice(0,u):c.length<u?(c.copy(E,u-c.length),E):c.slice(-u)}function a(c,u){return i(c,u,!0)}function o(c){if(!N.isBuffer(c))if(Array.isArray(c))c=N.from(c);else if(typeof c=="string")k(c)?c=N.from(v(l(c)),"hex"):c=N.from(c);else if(typeof c=="number")c=intToBuffer(c);else if(c==null)c=N.allocUnsafe(0);else if(typeof c=="bigint")c=s(c);else if(c.toArray)c=N.from(c.toArray());else throw new Error("invalid type");return c}function h(c){return c=o(c),"0x"+c.toString("hex")}function p(c,u){if(c=o(c),u||(u=256),u!==256)throw new Error("unsupported");return N.from(t(new Uint8Array(c)))}function v(c){return c.length%2?"0"+c:c}function k(c){return typeof c=="string"&&c.match(/^0x[0-9A-Fa-f]*$/)}function l(c){return typeof c=="string"&&c.startsWith("0x")?c.slice(2):c}return pe={zeros:e,setLength:i,setLengthRight:a,isHexString:k,stripHexPrefix:l,toBuffer:o,bufferToHex:h,keccak:p,bitLengthFromBigInt:n,bufferBEFromBigInt:s,twosFromBigInt:r},pe}var ge,Ke;function rn(){if(Ke)return ge;Ke=1;const t=mt();function e(l){return l.startsWith("int[")?"int256"+l.slice(3):l==="int"?"int256":l.startsWith("uint[")?"uint256"+l.slice(4):l==="uint"?"uint256":l.startsWith("fixed[")?"fixed128x128"+l.slice(5):l==="fixed"?"fixed128x128":l.startsWith("ufixed[")?"ufixed128x128"+l.slice(6):l==="ufixed"?"ufixed128x128":l}function n(l){return Number.parseInt(/^\D+(\d+)$/.exec(l)[1],10)}function s(l){var c=/^\D+(\d+)x(\d+)$/.exec(l);return[Number.parseInt(c[1],10),Number.parseInt(c[2],10)]}function r(l){var c=l.match(/(.*)\[(.*?)\]$/);return c?c[2]===""?"dynamic":Number.parseInt(c[2],10):null}function i(l){var c=typeof l;if(c==="string"||c==="number")return BigInt(l);if(c==="bigint")return l;throw new Error("Argument is not a number")}function a(l,c){var u,S,E,A;if(l==="address")return a("uint160",i(c));if(l==="bool")return a("uint8",c?1:0);if(l==="string")return a("bytes",new N(c,"utf8"));if(h(l)){if(typeof c.length>"u")throw new Error("Not an array?");if(u=r(l),u!=="dynamic"&&u!==0&&c.length>u)throw new Error("Elements exceed array size: "+u);E=[],l=l.slice(0,l.lastIndexOf("[")),typeof c=="string"&&(c=JSON.parse(c));for(A in c)E.push(a(l,c[A]));if(u==="dynamic"){var M=a("uint256",c.length);E.unshift(M)}return N.concat(E)}else{if(l==="bytes")return c=new N(c),E=N.concat([a("uint256",c.length),c]),c.length%32!==0&&(E=N.concat([E,t.zeros(32-c.length%32)])),E;if(l.startsWith("bytes")){if(u=n(l),u<1||u>32)throw new Error("Invalid bytes<N> width: "+u);return t.setLengthRight(c,32)}else if(l.startsWith("uint")){if(u=n(l),u%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);S=i(c);const D=t.bitLengthFromBigInt(S);if(D>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+D);if(S<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(S,32)}else if(l.startsWith("int")){if(u=n(l),u%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);S=i(c);const D=t.bitLengthFromBigInt(S);if(D>u)throw new Error("Supplied int exceeds width: "+u+" vs "+D);const y=t.twosFromBigInt(S,256);return t.bufferBEFromBigInt(y,32)}else if(l.startsWith("ufixed")){if(u=s(l),S=i(c),S<0)throw new Error("Supplied ufixed is negative");return a("uint256",S*BigInt(2)**BigInt(u[1]))}else if(l.startsWith("fixed"))return u=s(l),a("int256",i(c)*BigInt(2)**BigInt(u[1]))}throw new Error("Unsupported or invalid type: "+l)}function o(l){return l==="string"||l==="bytes"||r(l)==="dynamic"}function h(l){return l.lastIndexOf("]")===l.length-1}function p(l,c){var u=[],S=[],E=32*l.length;for(var A in l){var M=e(l[A]),D=c[A],y=a(M,D);o(M)?(u.push(a("uint256",E)),S.push(y),E+=y.length):u.push(y)}return N.concat(u.concat(S))}function v(l,c){if(l.length!==c.length)throw new Error("Number of types are not matching the values");for(var u,S,E=[],A=0;A<l.length;A++){var M=e(l[A]),D=c[A];if(M==="bytes")E.push(D);else if(M==="string")E.push(new N(D,"utf8"));else if(M==="bool")E.push(new N(D?"01":"00","hex"));else if(M==="address")E.push(t.setLength(D,20));else if(M.startsWith("bytes")){if(u=n(M),u<1||u>32)throw new Error("Invalid bytes<N> width: "+u);E.push(t.setLengthRight(D,u))}else if(M.startsWith("uint")){if(u=n(M),u%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);S=i(D);const y=t.bitLengthFromBigInt(S);if(y>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+y);E.push(t.bufferBEFromBigInt(S,u/8))}else if(M.startsWith("int")){if(u=n(M),u%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);S=i(D);const y=t.bitLengthFromBigInt(S);if(y>u)throw new Error("Supplied int exceeds width: "+u+" vs "+y);const b=t.twosFromBigInt(S,u);E.push(t.bufferBEFromBigInt(b,u/8))}else throw new Error("Unsupported or invalid type: "+M)}return N.concat(E)}function k(l,c){return t.keccak(v(l,c))}return ge={rawEncode:p,solidityPack:v,soliditySHA3:k},ge}var me,Ve;function an(){if(Ve)return me;Ve=1;const t=mt(),e=rn(),n={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"]},s={encodeData(i,a,o,h=!0){const p=["bytes32"],v=[this.hashType(i,o)];if(h){const k=(l,c,u)=>{if(o[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(c,u,o,h))];if(u===void 0)throw new Error(`missing value for field ${l} of type ${c}`);if(c==="bytes")return["bytes32",t.keccak(u)];if(c==="string")return typeof u=="string"&&(u=N.from(u,"utf8")),["bytes32",t.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const S=c.slice(0,c.lastIndexOf("[")),E=u.map(A=>k(l,S,A));return["bytes32",t.keccak(e.rawEncode(E.map(([A])=>A),E.map(([,A])=>A)))]}return[c,u]};for(const l of o[i]){const[c,u]=k(l.name,l.type,a[l.name]);p.push(c),v.push(u)}}else for(const k of o[i]){let l=a[k.name];if(l!==void 0)if(k.type==="bytes")p.push("bytes32"),l=t.keccak(l),v.push(l);else if(k.type==="string")p.push("bytes32"),typeof l=="string"&&(l=N.from(l,"utf8")),l=t.keccak(l),v.push(l);else if(o[k.type]!==void 0)p.push("bytes32"),l=t.keccak(this.encodeData(k.type,l,o,h)),v.push(l);else{if(k.type.lastIndexOf("]")===k.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");p.push(k.type),v.push(l)}}return e.rawEncode(p,v)},encodeType(i,a){let o="",h=this.findTypeDependencies(i,a).filter(p=>p!==i);h=[i].concat(h.sort());for(const p of h){if(!a[p])throw new Error("No type definition specified: "+p);o+=p+"("+a[p].map(({name:k,type:l})=>l+" "+k).join(",")+")"}return o},findTypeDependencies(i,a,o=[]){if(i=i.match(/^\w*/)[0],o.includes(i)||a[i]===void 0)return o;o.push(i);for(const h of a[i])for(const p of this.findTypeDependencies(h.type,a,o))!o.includes(p)&&o.push(p);return o},hashStruct(i,a,o,h=!0){return t.keccak(this.encodeData(i,a,o,h))},hashType(i,a){return t.keccak(this.encodeType(i,a))},sanitizeData(i){const a={};for(const o in n.properties)i[o]&&(a[o]=i[o]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(i,a=!0){const o=this.sanitizeData(i),h=[N.from("1901","hex")];return h.push(this.hashStruct("EIP712Domain",o.domain,o.types,a)),o.primaryType!=="EIP712Domain"&&h.push(this.hashStruct(o.primaryType,o.message,o.types,a)),t.keccak(N.concat(h))}};me={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:s,hashForSignTypedDataLegacy:function(i){return r(i.data)},hashForSignTypedData_v3:function(i){return s.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return s.hash(i.data)}};function r(i){const a=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw a;const o=i.map(function(v){return v.type==="bytes"?t.toBuffer(v.value):v.value}),h=i.map(function(v){return v.type}),p=i.map(function(v){if(!v.name)throw a;return v.type+" "+v.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(i.length).fill("string"),p),e.soliditySHA3(h,o)])}return me}var on=an();const ae=Lt(on),cn="walletUsername",ke="Addresses",dn="AppVersion";function B(t){return t.errorMessage!==void 0}class ln{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const s=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",oe(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},r,i.encode(e)),o=16,h=a.slice(a.byteLength-o),p=a.slice(0,a.byteLength-o),v=new Uint8Array(h),k=new Uint8Array(p),l=new Uint8Array([...s,...v,...k]);return Ie(l)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((s,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",oe(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=oe(e),o=a.slice(0,12),h=a.slice(12,28),p=a.slice(28),v=new Uint8Array([...p,...h]),k={name:"AES-GCM",iv:new Uint8Array(o)};try{const l=await window.crypto.subtle.decrypt(k,i,v),c=new TextDecoder;s(c.decode(l))}catch(l){r(l)}})()})}}class hn{constructor(e,n,s){this.linkAPIUrl=e,this.sessionId=n;const r=`${n}:${s}`;this.auth=`Basic ${btoa(r)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:s,error:r}=await n.json();if(r)throw new Error(`Check unseen events failed: ${r}`);const i=(e=s==null?void 0:s.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${n.status}`)}}var F;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(F||(F={}));class un{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var s;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(i){n(i);return}(s=this.connectionStateListener)===null||s===void 0||s.call(this,F.CONNECTING),r.onclose=i=>{var a;this.clearWebSocket(),n(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,F.DISCONNECTED)},r.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,F.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},r.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,F.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const ze=1e4,fn=6e4;class pn{constructor({session:e,linkAPIUrl:n,listener:s}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=V(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=i=>{if(!i)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",o=>i.JsonRpcUrl&&this.handleChainUpdated(o,i.JsonRpcUrl)]]).forEach((o,h)=>{const p=i[h];p!==void 0&&o(p)})},this.handleDestroyed=i=>{var a;i==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async i=>{var a;const o=await this.cipher.decrypt(i);(a=this.listener)===null||a===void 0||a.accountUpdated(o)},this.handleMetadataUpdated=async(i,a)=>{var o;const h=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.metadataUpdated(i,h)},this.handleWalletUsernameUpdated=async i=>{this.handleMetadataUpdated(cn,i)},this.handleAppVersionUpdated=async i=>{this.handleMetadataUpdated(dn,i)},this.handleChainUpdated=async(i,a)=>{var o;const h=await this.cipher.decrypt(i),p=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.chainUpdated(h,p)},this.session=e,this.cipher=new ln(e.secret),this.listener=s;const r=new un(`${n}/rpc`,WebSocket);r.setConnectionStateListener(async i=>{let a=!1;switch(i){case F.DISCONNECTED:if(!this.destroyed){const o=async()=>{await new Promise(h=>setTimeout(h,5e3)),this.destroyed||r.connect().catch(()=>{o()})};o()}break;case F.CONNECTED:a=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},ze),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case F.CONNECTING:break}this.connected!==a&&(this.connected=a)}),r.setIncomingDataListener(i=>{var a;switch(i.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const o=i.type==="IsLinkedOK"?i.linked:void 0;this.linked=o||i.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(i.metadata);break}case"Event":{this.handleIncomingEvent(i);break}}i.id!==void 0&&((a=this.requestResolutions.get(i.id))===null||a===void 0||a(i))}),this.ws=r,this.http=new hn(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:V(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,s;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const s=await this.cipher.decrypt(e.data),r=JSON.parse(s);if(r.type!=="WEB3_RESPONSE")return;const{id:i,response:a}=r;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(i,a)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,s=!1){const r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:V(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:s};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>ze*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:fn}){const s=e.id;this.sendData(e);let r;return Promise.race([new Promise((i,a)=>{r=window.setTimeout(()=>{a(new Error(`request ${s} timed out`))},n.timeout)}),new Promise(i=>{this.requestResolutions.set(s,a=>{clearTimeout(r),i(a),this.requestResolutions.delete(s)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:V(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:V(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:V(this.nextReqId++),sessionId:this.session.id}),!0)}}class gn{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=dt(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}const Fe="session:id",Ze="session:secret",Ge="session:linked";class Q{constructor(e,n,s,r=!1){this.storage=e,this.id=n,this.secret=s,this.key=At(xt(`${n}, ${s} WalletLink`)),this._linked=!!r}static create(e){const n=J(16),s=J(32);return new Q(e,n,s).save()}static load(e){const n=e.getItem(Fe),s=e.getItem(Ge),r=e.getItem(Ze);return n&&r?new Q(e,n,r,s==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(Fe,this.id),this.storage.setItem(Ze,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(Ge,this._linked?"1":"0")}}function mn(){try{return window.frameElement!==null}catch{return!1}}function wn(){try{return mn()&&window.top?window.top.location:window.location}catch{return window.location}}function bn(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function wt(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const yn='@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}';function bt(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(yn)),document.documentElement.appendChild(t)}const vn=".-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}",kn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",En="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class Cn{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=wt()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const n=this.nextItemKey++;return this.items.set(n,e),this.render(),()=>{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&we(P("div",null,P(yt,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>P(In,Object.assign({},n,{key:e}))))),this.root)}}const yt=t=>P("div",{class:ne("-cbwsdk-snackbar-container")},P("style",null,vn),P("div",{class:"-cbwsdk-snackbar"},t.children)),In=({autoExpand:t,message:e,menuItems:n})=>{const[s,r]=Me(!0),[i,a]=Me(t??!1);Rt(()=>{const h=[window.setTimeout(()=>{r(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{h.forEach(window.clearTimeout)}});const o=()=>{a(!i)};return P("div",{class:ne("-cbwsdk-snackbar-instance",s&&"-cbwsdk-snackbar-instance-hidden",i&&"-cbwsdk-snackbar-instance-expanded")},P("div",{class:"-cbwsdk-snackbar-instance-header",onClick:o},P("img",{src:kn,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",P("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),P("div",{class:"-gear-container"},!i&&P("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),P("img",{src:En,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&P("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((h,p)=>P("div",{class:ne("-cbwsdk-snackbar-instance-menu-item",h.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:h.onClick,key:p},P("svg",{width:h.svgWidth,height:h.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P("path",{"fill-rule":h.defaultFillRule,"clip-rule":h.defaultClipRule,d:h.path,fill:"#AAAAAA"})),P("span",{class:ne("-cbwsdk-snackbar-instance-menu-item-info",h.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},h.info)))))};class Sn{constructor(){this.attached=!1,this.snackbar=new Cn}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,bt()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={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:e.onResetConnection}]}:n={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:e.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:e.onResetConnection}]},this.snackbar.presentItem(n)}}const _n=".-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}";class Ln{constructor(){this.root=null,this.darkMode=wt()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),bt()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(we(null,this.root),e&&we(P(An,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const An=({title:t,buttonText:e,darkMode:n,onButtonClick:s,onDismiss:r})=>{const i=n?"dark":"light";return P(yt,{darkMode:n},P("div",{class:"-cbwsdk-redirect-dialog"},P("style",null,_n),P("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:r}),P("div",{class:ne("-cbwsdk-redirect-dialog-box",i)},P("p",null,t),P("button",{onClick:s},e))))},xn="https://keys.coinbase.com/connect",Mn="http://rpc.wallet.coinbase.com",Ye="https://www.walletlink.org",Rn="https://go.cb-w.com/walletlink";class Je{constructor(){this.attached=!1,this.redirectDialog=new Ln}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(Rn);n.searchParams.append("redirect_url",wn().href),e&&n.searchParams.append("wl_url",e);const s=document.createElement("a");s.target="cbw-opener",s.href=n.href,s.rel="noreferrer noopener",s.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class z{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=bn(),this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(ke);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),h=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!h&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(a,Number.parseInt(i,10)))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),z.accountRequestCallbackIds.size>0&&(Array.from(z.accountRequestCallbackIds.values()).forEach(a=>{this.invokeCallback(a,{method:"requestEthereumAccounts",result:[i]})}),z.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:s,connection:r}=this.subscribe();this._session=n,this.connection=r,this.relayEventManager=new gn,this.ui=s,this.ui.attach()}subscribe(){const e=Q.load(this.storage)||Q.create(this.storage),{linkAPIUrl:n}=this,s=new pn({session:e,linkAPIUrl:n,listener:this}),r=this.isMobileWeb?new Je:new Sn;return s.connect(),{session:e,ui:r,connection:s}}resetAndReload(){this.connection.destroy().then(()=>{const e=Q.load(this.storage);(e==null?void 0:e.id)===this._session.id&&q.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:K(e.weiValue),data:se(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?K(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?K(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?K(e.gasPriceInWei):null,gasLimit:e.gasLimit?K(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:K(e.weiValue),data:se(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?K(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?K(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?K(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?K(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:se(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const s=J(8),r=i=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,e.method,i),n==null||n()};return new Promise((i,a)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(s,o=>{if(n==null||n(),B(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,e)})}publishWeb3RequestEvent(e,n){const s={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",s,!0).then(r=>{}).catch(r=>{this.handleWeb3ResponseMessage(s.id,{method:n.method,errorMessage:r.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof Je)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,s){return this.connection.publishEvent(e,n,s)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){z.accountRequestCallbackIds.forEach(s=>this.invokeCallback(s,n)),z.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,s){var r;const i=(r=s==null?void 0:s.message)!==null&&r!==void 0?r:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:i})}invokeCallback(e,n){const s=this.relayEventManager.callbacks.get(e);s&&(s(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,s={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},r=J(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(r,o=>{if(B(o))return a(new Error(o.errorMessage));i(o)}),z.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,s)})}watchAsset(e,n,s,r,i,a){const o={method:"watchAsset",params:{type:e,options:{address:n,symbol:s,decimals:r,image:i},chainId:a}};let h=null;const p=J(8),v=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,k),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(h==null||h(),B(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,o)})}addEthereumChain(e,n,s,r,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:r,chainName:i,iconUrls:s,nativeCurrency:a}};let h=null;const p=J(8),v=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,k),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(h==null||h(),B(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,o)})}switchEthereumChain(e,n){const s={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let r=null;const i=J(8),a=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,o),r==null||r()};return r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:a,onResetConnection:this.resetAndReload}),new Promise((o,h)=>{this.relayEventManager.callbacks.set(i,p=>{if(r==null||r(),B(p)&&p.errorCode)return h(L.provider.custom({code:p.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(B(p))return h(new Error(p.errorMessage));o(p)}),this.publishWeb3RequestEvent(i,s)})}}z.accountRequestCallbackIds=new Set;const $e="DefaultChainId",Qe="DefaultJsonRpcUrl";class vt{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new q("walletlink",Ye),this.callback=e.callback||null;const n=this._storage.getItem(ke);if(n){const s=n.split(" ");s[0]!==""&&(this._addresses=s.map(r=>Z(r)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:s}=e.getWalletLinkSession();return{id:n,secret:s}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Qe))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(Qe,e)}updateProviderInfo(e,n){var s;this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem($e,n.toString(10)),ie(n)!==r&&((s=this.callback)===null||s===void 0||s.call(this,"chainChanged",Y(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw L.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw L.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw L.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw L.rpc.invalidParams("Address is required");const s=this.getChainId(),{address:r,symbol:i,image:a,decimals:o}=n.options,p=await this.initializeRelay().watchAsset(n.type,r,i,o,a,s==null?void 0:s.toString());return B(p)?!1:!!p.result}async addEthereumChain(e){var n,s;const r=e[0];if(((n=r.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw L.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!r.chainName||r.chainName.trim()==="")throw L.rpc.invalidParams("chainName is a required field");if(!r.nativeCurrency)throw L.rpc.invalidParams("nativeCurrency is a required field");const i=Number.parseInt(r.chainId,16);if(i===this.getChainId())return!1;const a=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:h=[],chainName:p,iconUrls:v=[],nativeCurrency:k}=r,l=await a.addEthereumChain(i.toString(),o,v,h,p,k);if(B(l))return!1;if(((s=l.result)===null||s===void 0?void 0:s.isApproved)===!0)return this.updateProviderInfo(o[0],i),null;throw L.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],s=Number.parseInt(n.chainId,16),i=await this.initializeRelay().switchEthereumChain(s.toString(10),this.selectedAddress||void 0);if(B(i))throw i;const a=i.result;return a.isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,s),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var s;if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>Z(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",r),this._storage.setItem(ke,r.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return Y(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);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":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw L.rpc.internal("No RPC URL set for chain");return Le(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=Z(e);if(!this._addresses.map(r=>Z(r)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?Z(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const s=e.to?Z(e.to):null,r=e.value!=null?ee(e.value):BigInt(0),i=e.data?ve(e.data):N.alloc(0),a=e.nonce!=null?ie(e.nonce):null,o=e.gasPrice!=null?ee(e.gasPrice):null,h=e.maxFeePerGas!=null?ee(e.maxFeePerGas):null,p=e.maxPriorityFeePerGas!=null?ee(e.maxPriorityFeePerGas):null,v=e.gas!=null?ee(e.gas):null,k=e.chainId?ie(e.chainId):this.getChainId();return{fromAddress:n,toAddress:s,weiValue:r,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:h,maxPriorityFeePerGas:p,gasLimit:v,chainId:k}}async ecRecover(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw L.rpc.invalidParams();const i=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:de(s[0]),signature:de(s[1]),addPrefix:n==="personal_ecRecover"}});if(B(i))throw i;return i.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem($e))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses;const r=await this.initializeRelay().requestEthereumAccounts();if(B(r))throw r;if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw L.rpc.invalidParams();const n=e[1],s=e[0];this._ensureKnownAddress(n);const i=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:Z(n),message:de(s),addPrefix:!0,typedDataJson:null}});if(B(i))throw i;return i.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signEthereumTransaction(n);if(B(r))throw r;return r.result}async _eth_sendRawTransaction(e){const n=ve(e[0]),r=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(B(r))throw r;return r.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(B(r))throw r;return r.result}async signTypedData(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw L.rpc.invalidParams();const r=p=>{const v={eth_signTypedData_v1:ae.hashForSignTypedDataLegacy,eth_signTypedData_v3:ae.hashForSignTypedData_v3,eth_signTypedData_v4:ae.hashForSignTypedData_v4,eth_signTypedData:ae.hashForSignTypedData_v4};return se(v[n]({data:Bt(p)}),!0)},i=s[n==="eth_signTypedData_v1"?1:0],a=s[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(i);const h=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:Z(i),message:r(a),typedDataJson:JSON.stringify(a,null,2),addPrefix:!1}});if(B(h))throw h;return h.result}initializeRelay(){return this._relay||(this._relay=new z({linkAPIUrl:Ye,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const kt="SignerType",Et=new q("CBWSDK","SignerConfigurator");function Pn(){return Et.getItem(kt)}function Tn(t){Et.setItem(kt,t)}async function On(t){const{communicator:e,metadata:n,handshakeRequest:s,callback:r}=t;Dn(e,n,r).catch(()=>{});const i={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:s})},{data:a}=await e.postRequestAndWaitForResponse(i);return a}function Nn(t){const{signerType:e,metadata:n,communicator:s,callback:r}=t;switch(e){case"scw":return new Xt({metadata:n,callback:r,communicator:s});case"walletlink":return new vt({metadata:n,callback:r})}}async function Dn(t,e,n){await t.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const s=new vt({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:s.getSession()}}),await s.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Un=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.
|
|
1
|
+
import{B as N}from"./ui-BBwYSKNx.js";import{g as Lt,ax as At,ay as xt,az as Mt}from"./thirdweb-BqnCxuFo.js";import{c as ne}from"./clsx.m-DHulAg21.js";import{B as we,_ as P,h as Me,y as Rt}from"./hooks.module-MHgUT2ti.js";import"./vendor-DsHXTNqy.js";const Pt=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};class q{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let s=0;s<localStorage.length;s++){const r=localStorage.key(s);typeof r=="string"&&r.startsWith(e)&&n.push(r)}n.forEach(s=>localStorage.removeItem(s))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new q("CBWSDK").clear(),new q("walletlink").clear()}}const U={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}},be={"-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."}},tt="Unspecified error message.",Tt="Unspecified server error.";function Ee(t,e=tt){if(t&&Number.isInteger(t)){const n=t.toString();if(ye(be,n))return be[n].message;if(nt(t))return Tt}return e}function Ot(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(be[e]||nt(t))}function Nt(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&ye(t,"code")&&Ot(t.code)){const s=t;n.code=s.code,s.message&&typeof s.message=="string"?(n.message=s.message,ye(s,"data")&&(n.data=s.data)):(n.message=Ee(n.code),n.data={originalError:Re(t)})}else n.code=U.rpc.internal,n.message=Pe(t,"message")?t.message:tt,n.data={originalError:Re(t)};return e&&(n.stack=Pe(t,"stack")?t.stack:void 0),n}function nt(t){return t>=-32099&&t<=-32e3}function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function ye(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Pe(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const L={rpc:{parse:t=>W(U.rpc.parse,t),invalidRequest:t=>W(U.rpc.invalidRequest,t),invalidParams:t=>W(U.rpc.invalidParams,t),methodNotFound:t=>W(U.rpc.methodNotFound,t),internal:t=>W(U.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return W(e,t)},invalidInput:t=>W(U.rpc.invalidInput,t),resourceNotFound:t=>W(U.rpc.resourceNotFound,t),resourceUnavailable:t=>W(U.rpc.resourceUnavailable,t),transactionRejected:t=>W(U.rpc.transactionRejected,t),methodNotSupported:t=>W(U.rpc.methodNotSupported,t),limitExceeded:t=>W(U.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>$(U.provider.userRejectedRequest,t),unauthorized:t=>$(U.provider.unauthorized,t),unsupportedMethod:t=>$(U.provider.unsupportedMethod,t),disconnected:t=>$(U.provider.disconnected,t),chainDisconnected:t=>$(U.provider.chainDisconnected,t),unsupportedChain:t=>$(U.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:s}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new rt(e,n,s)}}};function W(t,e){const[n,s]=st(e);return new it(t,n||Ee(t),s)}function $(t,e){const[n,s]=st(e);return new rt(t,n||Ee(t),s)}function st(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class it extends Error{constructor(e,n,s){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,s!==void 0&&(this.data=s)}}class rt extends it{constructor(e,n,s){if(!Dt(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,s)}}function Dt(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ce(){return t=>t}const re=Ce(),Ut=Ce(),jt=Ce();function V(t){return Math.floor(t)}const at=/^[0-9]*$/,ot=/^[a-f0-9]*$/;function J(t){return Ie(crypto.getRandomValues(new Uint8Array(t)))}function Ie(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function oe(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function se(t,e=!1){const n=t.toString("hex");return re(e?`0x${n}`:n)}function de(t){return se(ve(t),!0)}function K(t){return jt(t.toString(10))}function Y(t){return re(`0x${BigInt(t).toString(16)}`)}function ct(t){return t.startsWith("0x")||t.startsWith("0X")}function Se(t){return ct(t)?t.slice(2):t}function dt(t){return ct(t)?`0x${t.slice(2)}`:`0x${t}`}function ce(t){if(typeof t!="string")return!1;const e=Se(t).toLowerCase();return ot.test(e)}function Ht(t,e=!1){if(typeof t=="string"){const n=Se(t).toLowerCase();if(ot.test(n))return re(e?`0x${n}`:n)}throw L.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function _e(t,e=!1){let n=Ht(t,!1);return n.length%2===1&&(n=re(`0${n}`)),e?re(`0x${n}`):n}function Z(t){if(typeof t=="string"){const e=Se(t).toLowerCase();if(ce(e)&&e.length===40)return Ut(dt(e))}throw L.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function ve(t){if(N.isBuffer(t))return t;if(typeof t=="string"){if(ce(t)){const e=_e(t,!1);return N.from(e,"hex")}return N.from(t,"utf8")}throw L.rpc.invalidParams(`Not binary data: ${String(t)}`)}function ie(t){if(typeof t=="number"&&Number.isInteger(t))return V(t);if(typeof t=="string"){if(at.test(t))return V(Number(t));if(ce(t))return V(Number(BigInt(_e(t,!0))))}throw L.rpc.invalidParams(`Not an integer: ${String(t)}`)}function ee(t){if(t!==null&&(typeof t=="bigint"||Wt(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(ie(t));if(typeof t=="string"){if(at.test(t))return BigInt(t);if(ce(t))return BigInt(_e(t,!0))}throw L.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Bt(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw L.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function Wt(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}function qt(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,s=t?t.getAttribute("href"):null;return!s||s.startsWith("javascript:")||s.startsWith("vbscript:")?`${e}//${n}/favicon.ico`:s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")?s:s.startsWith("//")?e+s:`${e}//${n}${s}`}async function Kt(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Vt(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function zt(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:s}}async function Ft(t,{iv:e,cipherText:n}){const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(s)}function lt(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function ht(t,e){const n=lt(t),s=await crypto.subtle.exportKey(n,e);return Ie(new Uint8Array(s))}async function ut(t,e){const n=lt(t),s=oe(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(s),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function Zt(t,e){const n=JSON.stringify(t,(s,r)=>{if(!(r instanceof Error))return r;const i=r;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return zt(e,n)}async function Gt(t,e){return JSON.parse(await Ft(e,t))}const le={storageKey:"ownPrivateKey",keyType:"private"},he={storageKey:"ownPublicKey",keyType:"public"},ue={storageKey:"peerPublicKey",keyType:"public"};class Yt{constructor(){this.storage=new q("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(he.storageKey),this.storage.removeItem(le.storageKey),this.storage.removeItem(ue.storageKey)}async generateKeyPair(){const e=await Kt();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(le,e.privateKey),await this.storeKey(he,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(le)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(he)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await Vt(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?ut(e.keyType,n):null}async storeKey(e,n){const s=await ht(e.keyType,n);this.storage.setItem(e.storageKey,s)}}const X="4.3.0",ft="@coinbase/wallet-sdk";async function Le(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}),s=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":X,"X-Cbw-Sdk-Platform":ft}}),{result:r,error:i}=await s.json();if(i)throw i;return r}function Jt(){return globalThis.coinbaseWalletExtension}function $t(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function pt({metadata:t,preference:e}){var n,s;const{appName:r,appLogoUrl:i,appChainIds:a}=t;if(e.options!=="smartWalletOnly"){const h=Jt();if(h)return(n=h.setAppInfo)===null||n===void 0||n.call(h,r,i,a,e),h}const o=$t();if(o!=null&&o.isCoinbaseBrowser)return(s=o.setAppInfo)===null||s===void 0||s.call(o,r,i,a,e),o}function Qt(t){if(!t||typeof t!="object"||Array.isArray(t))throw L.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw L.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw L.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw L.provider.unsupportedMethod()}}const Te="accounts",Oe="activeChain",Ne="availableChains",De="walletCapabilities";class Xt{constructor(e){var n,s,r;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new Yt,this.storage=new q("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(Te))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(Oe)||{id:(r=(s=e.metadata.appChainIds)===null||s===void 0?void 0:s[0])!==null&&r!==void 0?r:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,s,r,i;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const a=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(r=e.params)!==null&&r!==void 0?r:{})}}),o=await this.communicator.postRequestAndWaitForResponse(a);if("failure"in o.content)throw o.content.failure;const h=await ut("public",o.sender);await this.keyManager.setPeerPublicKey(h);const v=(await this.decryptResponseMessage(o)).result;if("error"in v)throw v.error;switch(e.method){case"eth_requestAccounts":{const k=v.value;this.accounts=k,this.storage.storeObject(Te,k),(i=this.callback)===null||i===void 0||i.call(this,"accountsChanged",k);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw L.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Y(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return Y(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(De);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw L.rpc.internal("No RPC URL set for chain");return Le(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,s;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const r=await this.sendEncryptedRequest(e),a=(await this.decryptResponseMessage(r)).result;if("error"in a)throw a.error;return a.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const s=e.params;if(!s||!(!((n=s[0])===null||n===void 0)&&n.chainId))throw L.rpc.invalidParams();const r=ie(s[0].chainId);if(this.updateChain(r))return null;const a=await this.sendRequestToPopup(e);return a===null&&this.updateChain(r),a}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw L.provider.unauthorized("No valid session found, try requestAccounts before other methods");const s=await Zt({action:e,chainId:this.chain.id},n),r=await this.createRequestMessage({encrypted:s});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){const n=await ht("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,s;const r=e.content;if("failure"in r)throw r.failure;const i=await this.keyManager.getSharedSecret();if(!i)throw L.provider.unauthorized("Invalid session");const a=await Gt(r.encrypted,i),o=(n=a.data)===null||n===void 0?void 0:n.chains;if(o){const p=Object.entries(o).map(([v,k])=>({id:Number(v),rpcUrl:k}));this.storage.storeObject(Ne,p),this.updateChain(this.chain.id,p)}const h=(s=a.data)===null||s===void 0?void 0:s.capabilities;return h&&this.storage.storeObject(De,h),a}updateChain(e,n){var s;const r=n??this.storage.loadObject(Ne),i=r==null?void 0:r.find(a=>a.id===e);return i?(i!==this.chain&&(this.chain=i,this.storage.storeObject(Oe,i),(s=this.callback)===null||s===void 0||s.call(this,"chainChanged",Y(i.id))),!0):!1}}var O={},G={},Ue;function gt(){if(Ue)return G;Ue=1,Object.defineProperty(G,"__esModule",{value:!0}),G.anumber=t,G.abytes=n,G.ahash=s,G.aexists=r,G.aoutput=i;function t(a){if(!Number.isSafeInteger(a)||a<0)throw new Error("positive integer expected, got "+a)}function e(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"}function n(a,...o){if(!e(a))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(a.length))throw new Error("Uint8Array expected of length "+o+", got length="+a.length)}function s(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(a.outputLen),t(a.blockLen)}function r(a,o=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(o&&a.finished)throw new Error("Hash#digest() has already been called")}function i(a,o){n(a);const h=o.outputLen;if(a.length<h)throw new Error("digestInto() expects output buffer of length at least "+h)}return G}var C={},je;function en(){if(je)return C;je=1,Object.defineProperty(C,"__esModule",{value:!0}),C.add5L=C.add5H=C.add4H=C.add4L=C.add3H=C.add3L=C.rotlBL=C.rotlBH=C.rotlSL=C.rotlSH=C.rotr32L=C.rotr32H=C.rotrBL=C.rotrBH=C.rotrSL=C.rotrSH=C.shrSL=C.shrSH=C.toBig=void 0,C.fromBig=n,C.split=s,C.add=A;const t=BigInt(2**32-1),e=BigInt(32);function n(g,f=!1){return f?{h:Number(g&t),l:Number(g>>e&t)}:{h:Number(g>>e&t)|0,l:Number(g&t)|0}}function s(g,f=!1){let m=new Uint32Array(g.length),d=new Uint32Array(g.length);for(let w=0;w<g.length;w++){const{h:_,l:R}=n(g[w],f);[m[w],d[w]]=[_,R]}return[m,d]}const r=(g,f)=>BigInt(g>>>0)<<e|BigInt(f>>>0);C.toBig=r;const i=(g,f,m)=>g>>>m;C.shrSH=i;const a=(g,f,m)=>g<<32-m|f>>>m;C.shrSL=a;const o=(g,f,m)=>g>>>m|f<<32-m;C.rotrSH=o;const h=(g,f,m)=>g<<32-m|f>>>m;C.rotrSL=h;const p=(g,f,m)=>g<<64-m|f>>>m-32;C.rotrBH=p;const v=(g,f,m)=>g>>>m-32|f<<64-m;C.rotrBL=v;const k=(g,f)=>f;C.rotr32H=k;const l=(g,f)=>g;C.rotr32L=l;const c=(g,f,m)=>g<<m|f>>>32-m;C.rotlSH=c;const u=(g,f,m)=>f<<m|g>>>32-m;C.rotlSL=u;const S=(g,f,m)=>f<<m-32|g>>>64-m;C.rotlBH=S;const E=(g,f,m)=>g<<m-32|f>>>64-m;C.rotlBL=E;function A(g,f,m,d){const w=(f>>>0)+(d>>>0);return{h:g+m+(w/2**32|0)|0,l:w|0}}const M=(g,f,m)=>(g>>>0)+(f>>>0)+(m>>>0);C.add3L=M;const D=(g,f,m,d)=>f+m+d+(g/2**32|0)|0;C.add3H=D;const y=(g,f,m,d)=>(g>>>0)+(f>>>0)+(m>>>0)+(d>>>0);C.add4L=y;const b=(g,f,m,d,w)=>f+m+d+w+(g/2**32|0)|0;C.add4H=b;const I=(g,f,m,d,w)=>(g>>>0)+(f>>>0)+(m>>>0)+(d>>>0)+(w>>>0);C.add5L=I;const x=(g,f,m,d,w,_)=>f+m+d+w+_+(g/2**32|0)|0;C.add5H=x;const T={fromBig:n,split:s,toBig:r,shrSH:i,shrSL:a,rotrSH:o,rotrSL:h,rotrBH:p,rotrBL:v,rotr32H:k,rotr32L:l,rotlSH:c,rotlSL:u,rotlBH:S,rotlBL:E,add:A,add3L:M,add3H:D,add4L:y,add4H:b,add5H:x,add5L:I};return C.default=T,C}var fe={},te={},He;function tn(){return He||(He=1,Object.defineProperty(te,"__esModule",{value:!0}),te.crypto=void 0,te.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),te}var Be;function nn(){return Be||(Be=1,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=s,t.u8=r,t.u32=i,t.createView=a,t.rotr=o,t.rotl=h,t.byteSwap=p,t.byteSwap32=v,t.bytesToHex=c,t.hexToBytes=E,t.asyncLoop=M,t.utf8ToBytes=D,t.toBytes=y,t.concatBytes=b,t.checkOpts=x,t.wrapConstructor=T,t.wrapConstructorWithOpts=g,t.wrapXOFConstructorWithOpts=f,t.randomBytes=m;const e=tn(),n=gt();function s(d){return d instanceof Uint8Array||ArrayBuffer.isView(d)&&d.constructor.name==="Uint8Array"}function r(d){return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}function i(d){return new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4))}function a(d){return new DataView(d.buffer,d.byteOffset,d.byteLength)}function o(d,w){return d<<32-w|d>>>w}function h(d,w){return d<<w|d>>>32-w>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function p(d){return d<<24&4278190080|d<<8&16711680|d>>>8&65280|d>>>24&255}t.byteSwapIfBE=t.isLE?d=>d:d=>p(d);function v(d){for(let w=0;w<d.length;w++)d[w]=p(d[w])}const k=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",l=Array.from({length:256},(d,w)=>w.toString(16).padStart(2,"0"));function c(d){if((0,n.abytes)(d),k)return d.toHex();let w="";for(let _=0;_<d.length;_++)w+=l[d[_]];return w}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function S(d){if(d>=u._0&&d<=u._9)return d-u._0;if(d>=u.A&&d<=u.F)return d-(u.A-10);if(d>=u.a&&d<=u.f)return d-(u.a-10)}function E(d){if(typeof d!="string")throw new Error("hex string expected, got "+typeof d);if(k)return Uint8Array.fromHex(d);const w=d.length,_=w/2;if(w%2)throw new Error("hex string expected, got unpadded hex of length "+w);const R=new Uint8Array(_);for(let j=0,H=0;j<_;j++,H+=2){const Ae=S(d.charCodeAt(H)),xe=S(d.charCodeAt(H+1));if(Ae===void 0||xe===void 0){const _t=d[H]+d[H+1];throw new Error('hex string expected, got non-hex character "'+_t+'" at index '+H)}R[j]=Ae*16+xe}return R}const A=async()=>{};t.nextTick=A;async function M(d,w,_){let R=Date.now();for(let j=0;j<d;j++){_(j);const H=Date.now()-R;H>=0&&H<w||(await(0,t.nextTick)(),R+=H)}}function D(d){if(typeof d!="string")throw new Error("utf8ToBytes expected string, got "+typeof d);return new Uint8Array(new TextEncoder().encode(d))}function y(d){return typeof d=="string"&&(d=D(d)),(0,n.abytes)(d),d}function b(...d){let w=0;for(let R=0;R<d.length;R++){const j=d[R];(0,n.abytes)(j),w+=j.length}const _=new Uint8Array(w);for(let R=0,j=0;R<d.length;R++){const H=d[R];_.set(H,j),j+=H.length}return _}class I{clone(){return this._cloneInto()}}t.Hash=I;function x(d,w){if(w!==void 0&&{}.toString.call(w)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(d,w)}function T(d){const w=R=>d().update(y(R)).digest(),_=d();return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=()=>d(),w}function g(d){const w=(R,j)=>d(j).update(y(R)).digest(),_=d({});return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=R=>d(R),w}function f(d){const w=(R,j)=>d(j).update(y(R)).digest(),_=d({});return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=R=>d(R),w}function m(d=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(d));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(d));throw new Error("crypto.getRandomValues must be defined")}}(fe)),fe}var We;function sn(){if(We)return O;We=1,Object.defineProperty(O,"__esModule",{value:!0}),O.shake256=O.shake128=O.keccak_512=O.keccak_384=O.keccak_256=O.keccak_224=O.sha3_512=O.sha3_384=O.sha3_256=O.sha3_224=O.Keccak=void 0,O.keccakP=E;const t=gt(),e=en(),n=nn(),s=[],r=[],i=[],a=BigInt(0),o=BigInt(1),h=BigInt(2),p=BigInt(7),v=BigInt(256),k=BigInt(113);for(let y=0,b=o,I=1,x=0;y<24;y++){[I,x]=[x,(2*I+3*x)%5],s.push(2*(5*x+I)),r.push((y+1)*(y+2)/2%64);let T=a;for(let g=0;g<7;g++)b=(b<<o^(b>>p)*k)%v,b&h&&(T^=o<<(o<<BigInt(g))-o);i.push(T)}const[l,c]=(0,e.split)(i,!0),u=(y,b,I)=>I>32?(0,e.rotlBH)(y,b,I):(0,e.rotlSH)(y,b,I),S=(y,b,I)=>I>32?(0,e.rotlBL)(y,b,I):(0,e.rotlSL)(y,b,I);function E(y,b=24){const I=new Uint32Array(10);for(let x=24-b;x<24;x++){for(let f=0;f<10;f++)I[f]=y[f]^y[f+10]^y[f+20]^y[f+30]^y[f+40];for(let f=0;f<10;f+=2){const m=(f+8)%10,d=(f+2)%10,w=I[d],_=I[d+1],R=u(w,_,1)^I[m],j=S(w,_,1)^I[m+1];for(let H=0;H<50;H+=10)y[f+H]^=R,y[f+H+1]^=j}let T=y[2],g=y[3];for(let f=0;f<24;f++){const m=r[f],d=u(T,g,m),w=S(T,g,m),_=s[f];T=y[_],g=y[_+1],y[_]=d,y[_+1]=w}for(let f=0;f<50;f+=10){for(let m=0;m<10;m++)I[m]=y[f+m];for(let m=0;m<10;m++)y[f+m]^=~I[(m+2)%10]&I[(m+4)%10]}y[0]^=l[x],y[1]^=c[x]}I.fill(0)}class A extends n.Hash{constructor(b,I,x,T=!1,g=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=b,this.suffix=I,this.outputLen=x,this.enableXOF=T,this.rounds=g,(0,t.anumber)(x),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}keccak(){n.isLE||(0,n.byteSwap32)(this.state32),E(this.state32,this.rounds),n.isLE||(0,n.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(b){(0,t.aexists)(this);const{blockLen:I,state:x}=this;b=(0,n.toBytes)(b);const T=b.length;for(let g=0;g<T;){const f=Math.min(I-this.pos,T-g);for(let m=0;m<f;m++)x[this.pos++]^=b[g++];this.pos===I&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:b,suffix:I,pos:x,blockLen:T}=this;b[x]^=I,I&128&&x===T-1&&this.keccak(),b[T-1]^=128,this.keccak()}writeInto(b){(0,t.aexists)(this,!1),(0,t.abytes)(b),this.finish();const I=this.state,{blockLen:x}=this;for(let T=0,g=b.length;T<g;){this.posOut>=x&&this.keccak();const f=Math.min(x-this.posOut,g-T);b.set(I.subarray(this.posOut,this.posOut+f),T),this.posOut+=f,T+=f}return b}xofInto(b){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(b)}xof(b){return(0,t.anumber)(b),this.xofInto(new Uint8Array(b))}digestInto(b){if((0,t.aoutput)(b,this),this.finished)throw new Error("digest() was already called");return this.writeInto(b),this.destroy(),b}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(b){const{blockLen:I,suffix:x,outputLen:T,rounds:g,enableXOF:f}=this;return b||(b=new A(I,x,T,f,g)),b.state32.set(this.state32),b.pos=this.pos,b.posOut=this.posOut,b.finished=this.finished,b.rounds=g,b.suffix=x,b.outputLen=T,b.enableXOF=f,b.destroyed=this.destroyed,b}}O.Keccak=A;const M=(y,b,I)=>(0,n.wrapConstructor)(()=>new A(b,y,I));O.sha3_224=M(6,144,224/8),O.sha3_256=M(6,136,256/8),O.sha3_384=M(6,104,384/8),O.sha3_512=M(6,72,512/8),O.keccak_224=M(1,144,224/8),O.keccak_256=M(1,136,256/8),O.keccak_384=M(1,104,384/8),O.keccak_512=M(1,72,512/8);const D=(y,b,I)=>(0,n.wrapXOFConstructorWithOpts)((x={})=>new A(b,y,x.dkLen===void 0?I:x.dkLen,!0));return O.shake128=D(31,168,128/8),O.shake256=D(31,136,256/8),O}var pe,qe;function mt(){if(qe)return pe;qe=1;const{keccak_256:t}=sn();function e(c){return N.allocUnsafe(c).fill(0)}function n(c){return c.toString(2).length}function s(c,u){let S=c.toString(16);S.length%2!==0&&(S="0"+S);const E=S.match(/.{1,2}/g).map(A=>parseInt(A,16));for(;E.length<u;)E.unshift(0);return N.from(E)}function r(c,u){const S=c<0n;let E;if(S){const A=(1n<<BigInt(u))-1n;E=(~c&A)+1n}else E=c;return E&=(1n<<BigInt(u))-1n,E}function i(c,u,S){const E=e(u);return c=o(c),S?c.length<u?(c.copy(E),E):c.slice(0,u):c.length<u?(c.copy(E,u-c.length),E):c.slice(-u)}function a(c,u){return i(c,u,!0)}function o(c){if(!N.isBuffer(c))if(Array.isArray(c))c=N.from(c);else if(typeof c=="string")k(c)?c=N.from(v(l(c)),"hex"):c=N.from(c);else if(typeof c=="number")c=intToBuffer(c);else if(c==null)c=N.allocUnsafe(0);else if(typeof c=="bigint")c=s(c);else if(c.toArray)c=N.from(c.toArray());else throw new Error("invalid type");return c}function h(c){return c=o(c),"0x"+c.toString("hex")}function p(c,u){if(c=o(c),u||(u=256),u!==256)throw new Error("unsupported");return N.from(t(new Uint8Array(c)))}function v(c){return c.length%2?"0"+c:c}function k(c){return typeof c=="string"&&c.match(/^0x[0-9A-Fa-f]*$/)}function l(c){return typeof c=="string"&&c.startsWith("0x")?c.slice(2):c}return pe={zeros:e,setLength:i,setLengthRight:a,isHexString:k,stripHexPrefix:l,toBuffer:o,bufferToHex:h,keccak:p,bitLengthFromBigInt:n,bufferBEFromBigInt:s,twosFromBigInt:r},pe}var ge,Ke;function rn(){if(Ke)return ge;Ke=1;const t=mt();function e(l){return l.startsWith("int[")?"int256"+l.slice(3):l==="int"?"int256":l.startsWith("uint[")?"uint256"+l.slice(4):l==="uint"?"uint256":l.startsWith("fixed[")?"fixed128x128"+l.slice(5):l==="fixed"?"fixed128x128":l.startsWith("ufixed[")?"ufixed128x128"+l.slice(6):l==="ufixed"?"ufixed128x128":l}function n(l){return Number.parseInt(/^\D+(\d+)$/.exec(l)[1],10)}function s(l){var c=/^\D+(\d+)x(\d+)$/.exec(l);return[Number.parseInt(c[1],10),Number.parseInt(c[2],10)]}function r(l){var c=l.match(/(.*)\[(.*?)\]$/);return c?c[2]===""?"dynamic":Number.parseInt(c[2],10):null}function i(l){var c=typeof l;if(c==="string"||c==="number")return BigInt(l);if(c==="bigint")return l;throw new Error("Argument is not a number")}function a(l,c){var u,S,E,A;if(l==="address")return a("uint160",i(c));if(l==="bool")return a("uint8",c?1:0);if(l==="string")return a("bytes",new N(c,"utf8"));if(h(l)){if(typeof c.length>"u")throw new Error("Not an array?");if(u=r(l),u!=="dynamic"&&u!==0&&c.length>u)throw new Error("Elements exceed array size: "+u);E=[],l=l.slice(0,l.lastIndexOf("[")),typeof c=="string"&&(c=JSON.parse(c));for(A in c)E.push(a(l,c[A]));if(u==="dynamic"){var M=a("uint256",c.length);E.unshift(M)}return N.concat(E)}else{if(l==="bytes")return c=new N(c),E=N.concat([a("uint256",c.length),c]),c.length%32!==0&&(E=N.concat([E,t.zeros(32-c.length%32)])),E;if(l.startsWith("bytes")){if(u=n(l),u<1||u>32)throw new Error("Invalid bytes<N> width: "+u);return t.setLengthRight(c,32)}else if(l.startsWith("uint")){if(u=n(l),u%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);S=i(c);const D=t.bitLengthFromBigInt(S);if(D>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+D);if(S<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(S,32)}else if(l.startsWith("int")){if(u=n(l),u%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);S=i(c);const D=t.bitLengthFromBigInt(S);if(D>u)throw new Error("Supplied int exceeds width: "+u+" vs "+D);const y=t.twosFromBigInt(S,256);return t.bufferBEFromBigInt(y,32)}else if(l.startsWith("ufixed")){if(u=s(l),S=i(c),S<0)throw new Error("Supplied ufixed is negative");return a("uint256",S*BigInt(2)**BigInt(u[1]))}else if(l.startsWith("fixed"))return u=s(l),a("int256",i(c)*BigInt(2)**BigInt(u[1]))}throw new Error("Unsupported or invalid type: "+l)}function o(l){return l==="string"||l==="bytes"||r(l)==="dynamic"}function h(l){return l.lastIndexOf("]")===l.length-1}function p(l,c){var u=[],S=[],E=32*l.length;for(var A in l){var M=e(l[A]),D=c[A],y=a(M,D);o(M)?(u.push(a("uint256",E)),S.push(y),E+=y.length):u.push(y)}return N.concat(u.concat(S))}function v(l,c){if(l.length!==c.length)throw new Error("Number of types are not matching the values");for(var u,S,E=[],A=0;A<l.length;A++){var M=e(l[A]),D=c[A];if(M==="bytes")E.push(D);else if(M==="string")E.push(new N(D,"utf8"));else if(M==="bool")E.push(new N(D?"01":"00","hex"));else if(M==="address")E.push(t.setLength(D,20));else if(M.startsWith("bytes")){if(u=n(M),u<1||u>32)throw new Error("Invalid bytes<N> width: "+u);E.push(t.setLengthRight(D,u))}else if(M.startsWith("uint")){if(u=n(M),u%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);S=i(D);const y=t.bitLengthFromBigInt(S);if(y>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+y);E.push(t.bufferBEFromBigInt(S,u/8))}else if(M.startsWith("int")){if(u=n(M),u%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);S=i(D);const y=t.bitLengthFromBigInt(S);if(y>u)throw new Error("Supplied int exceeds width: "+u+" vs "+y);const b=t.twosFromBigInt(S,u);E.push(t.bufferBEFromBigInt(b,u/8))}else throw new Error("Unsupported or invalid type: "+M)}return N.concat(E)}function k(l,c){return t.keccak(v(l,c))}return ge={rawEncode:p,solidityPack:v,soliditySHA3:k},ge}var me,Ve;function an(){if(Ve)return me;Ve=1;const t=mt(),e=rn(),n={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"]},s={encodeData(i,a,o,h=!0){const p=["bytes32"],v=[this.hashType(i,o)];if(h){const k=(l,c,u)=>{if(o[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(c,u,o,h))];if(u===void 0)throw new Error(`missing value for field ${l} of type ${c}`);if(c==="bytes")return["bytes32",t.keccak(u)];if(c==="string")return typeof u=="string"&&(u=N.from(u,"utf8")),["bytes32",t.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const S=c.slice(0,c.lastIndexOf("[")),E=u.map(A=>k(l,S,A));return["bytes32",t.keccak(e.rawEncode(E.map(([A])=>A),E.map(([,A])=>A)))]}return[c,u]};for(const l of o[i]){const[c,u]=k(l.name,l.type,a[l.name]);p.push(c),v.push(u)}}else for(const k of o[i]){let l=a[k.name];if(l!==void 0)if(k.type==="bytes")p.push("bytes32"),l=t.keccak(l),v.push(l);else if(k.type==="string")p.push("bytes32"),typeof l=="string"&&(l=N.from(l,"utf8")),l=t.keccak(l),v.push(l);else if(o[k.type]!==void 0)p.push("bytes32"),l=t.keccak(this.encodeData(k.type,l,o,h)),v.push(l);else{if(k.type.lastIndexOf("]")===k.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");p.push(k.type),v.push(l)}}return e.rawEncode(p,v)},encodeType(i,a){let o="",h=this.findTypeDependencies(i,a).filter(p=>p!==i);h=[i].concat(h.sort());for(const p of h){if(!a[p])throw new Error("No type definition specified: "+p);o+=p+"("+a[p].map(({name:k,type:l})=>l+" "+k).join(",")+")"}return o},findTypeDependencies(i,a,o=[]){if(i=i.match(/^\w*/)[0],o.includes(i)||a[i]===void 0)return o;o.push(i);for(const h of a[i])for(const p of this.findTypeDependencies(h.type,a,o))!o.includes(p)&&o.push(p);return o},hashStruct(i,a,o,h=!0){return t.keccak(this.encodeData(i,a,o,h))},hashType(i,a){return t.keccak(this.encodeType(i,a))},sanitizeData(i){const a={};for(const o in n.properties)i[o]&&(a[o]=i[o]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(i,a=!0){const o=this.sanitizeData(i),h=[N.from("1901","hex")];return h.push(this.hashStruct("EIP712Domain",o.domain,o.types,a)),o.primaryType!=="EIP712Domain"&&h.push(this.hashStruct(o.primaryType,o.message,o.types,a)),t.keccak(N.concat(h))}};me={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:s,hashForSignTypedDataLegacy:function(i){return r(i.data)},hashForSignTypedData_v3:function(i){return s.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return s.hash(i.data)}};function r(i){const a=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw a;const o=i.map(function(v){return v.type==="bytes"?t.toBuffer(v.value):v.value}),h=i.map(function(v){return v.type}),p=i.map(function(v){if(!v.name)throw a;return v.type+" "+v.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(i.length).fill("string"),p),e.soliditySHA3(h,o)])}return me}var on=an();const ae=Lt(on),cn="walletUsername",ke="Addresses",dn="AppVersion";function B(t){return t.errorMessage!==void 0}class ln{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const s=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",oe(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},r,i.encode(e)),o=16,h=a.slice(a.byteLength-o),p=a.slice(0,a.byteLength-o),v=new Uint8Array(h),k=new Uint8Array(p),l=new Uint8Array([...s,...v,...k]);return Ie(l)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((s,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",oe(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=oe(e),o=a.slice(0,12),h=a.slice(12,28),p=a.slice(28),v=new Uint8Array([...p,...h]),k={name:"AES-GCM",iv:new Uint8Array(o)};try{const l=await window.crypto.subtle.decrypt(k,i,v),c=new TextDecoder;s(c.decode(l))}catch(l){r(l)}})()})}}class hn{constructor(e,n,s){this.linkAPIUrl=e,this.sessionId=n;const r=`${n}:${s}`;this.auth=`Basic ${btoa(r)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:s,error:r}=await n.json();if(r)throw new Error(`Check unseen events failed: ${r}`);const i=(e=s==null?void 0:s.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${n.status}`)}}var F;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(F||(F={}));class un{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var s;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(i){n(i);return}(s=this.connectionStateListener)===null||s===void 0||s.call(this,F.CONNECTING),r.onclose=i=>{var a;this.clearWebSocket(),n(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,F.DISCONNECTED)},r.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,F.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},r.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,F.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const ze=1e4,fn=6e4;class pn{constructor({session:e,linkAPIUrl:n,listener:s}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=V(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=i=>{if(!i)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",o=>i.JsonRpcUrl&&this.handleChainUpdated(o,i.JsonRpcUrl)]]).forEach((o,h)=>{const p=i[h];p!==void 0&&o(p)})},this.handleDestroyed=i=>{var a;i==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async i=>{var a;const o=await this.cipher.decrypt(i);(a=this.listener)===null||a===void 0||a.accountUpdated(o)},this.handleMetadataUpdated=async(i,a)=>{var o;const h=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.metadataUpdated(i,h)},this.handleWalletUsernameUpdated=async i=>{this.handleMetadataUpdated(cn,i)},this.handleAppVersionUpdated=async i=>{this.handleMetadataUpdated(dn,i)},this.handleChainUpdated=async(i,a)=>{var o;const h=await this.cipher.decrypt(i),p=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.chainUpdated(h,p)},this.session=e,this.cipher=new ln(e.secret),this.listener=s;const r=new un(`${n}/rpc`,WebSocket);r.setConnectionStateListener(async i=>{let a=!1;switch(i){case F.DISCONNECTED:if(!this.destroyed){const o=async()=>{await new Promise(h=>setTimeout(h,5e3)),this.destroyed||r.connect().catch(()=>{o()})};o()}break;case F.CONNECTED:a=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},ze),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case F.CONNECTING:break}this.connected!==a&&(this.connected=a)}),r.setIncomingDataListener(i=>{var a;switch(i.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const o=i.type==="IsLinkedOK"?i.linked:void 0;this.linked=o||i.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(i.metadata);break}case"Event":{this.handleIncomingEvent(i);break}}i.id!==void 0&&((a=this.requestResolutions.get(i.id))===null||a===void 0||a(i))}),this.ws=r,this.http=new hn(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:V(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,s;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const s=await this.cipher.decrypt(e.data),r=JSON.parse(s);if(r.type!=="WEB3_RESPONSE")return;const{id:i,response:a}=r;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(i,a)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,s=!1){const r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:V(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:s};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>ze*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:fn}){const s=e.id;this.sendData(e);let r;return Promise.race([new Promise((i,a)=>{r=window.setTimeout(()=>{a(new Error(`request ${s} timed out`))},n.timeout)}),new Promise(i=>{this.requestResolutions.set(s,a=>{clearTimeout(r),i(a),this.requestResolutions.delete(s)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:V(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:V(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:V(this.nextReqId++),sessionId:this.session.id}),!0)}}class gn{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=dt(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}const Fe="session:id",Ze="session:secret",Ge="session:linked";class Q{constructor(e,n,s,r=!1){this.storage=e,this.id=n,this.secret=s,this.key=At(xt(`${n}, ${s} WalletLink`)),this._linked=!!r}static create(e){const n=J(16),s=J(32);return new Q(e,n,s).save()}static load(e){const n=e.getItem(Fe),s=e.getItem(Ge),r=e.getItem(Ze);return n&&r?new Q(e,n,r,s==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(Fe,this.id),this.storage.setItem(Ze,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(Ge,this._linked?"1":"0")}}function mn(){try{return window.frameElement!==null}catch{return!1}}function wn(){try{return mn()&&window.top?window.top.location:window.location}catch{return window.location}}function bn(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function wt(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const yn='@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}';function bt(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(yn)),document.documentElement.appendChild(t)}const vn=".-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}",kn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",En="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class Cn{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=wt()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const n=this.nextItemKey++;return this.items.set(n,e),this.render(),()=>{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&we(P("div",null,P(yt,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>P(In,Object.assign({},n,{key:e}))))),this.root)}}const yt=t=>P("div",{class:ne("-cbwsdk-snackbar-container")},P("style",null,vn),P("div",{class:"-cbwsdk-snackbar"},t.children)),In=({autoExpand:t,message:e,menuItems:n})=>{const[s,r]=Me(!0),[i,a]=Me(t??!1);Rt(()=>{const h=[window.setTimeout(()=>{r(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{h.forEach(window.clearTimeout)}});const o=()=>{a(!i)};return P("div",{class:ne("-cbwsdk-snackbar-instance",s&&"-cbwsdk-snackbar-instance-hidden",i&&"-cbwsdk-snackbar-instance-expanded")},P("div",{class:"-cbwsdk-snackbar-instance-header",onClick:o},P("img",{src:kn,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",P("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),P("div",{class:"-gear-container"},!i&&P("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),P("img",{src:En,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&P("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((h,p)=>P("div",{class:ne("-cbwsdk-snackbar-instance-menu-item",h.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:h.onClick,key:p},P("svg",{width:h.svgWidth,height:h.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P("path",{"fill-rule":h.defaultFillRule,"clip-rule":h.defaultClipRule,d:h.path,fill:"#AAAAAA"})),P("span",{class:ne("-cbwsdk-snackbar-instance-menu-item-info",h.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},h.info)))))};class Sn{constructor(){this.attached=!1,this.snackbar=new Cn}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,bt()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={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:e.onResetConnection}]}:n={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:e.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:e.onResetConnection}]},this.snackbar.presentItem(n)}}const _n=".-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}";class Ln{constructor(){this.root=null,this.darkMode=wt()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),bt()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(we(null,this.root),e&&we(P(An,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const An=({title:t,buttonText:e,darkMode:n,onButtonClick:s,onDismiss:r})=>{const i=n?"dark":"light";return P(yt,{darkMode:n},P("div",{class:"-cbwsdk-redirect-dialog"},P("style",null,_n),P("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:r}),P("div",{class:ne("-cbwsdk-redirect-dialog-box",i)},P("p",null,t),P("button",{onClick:s},e))))},xn="https://keys.coinbase.com/connect",Mn="http://rpc.wallet.coinbase.com",Ye="https://www.walletlink.org",Rn="https://go.cb-w.com/walletlink";class Je{constructor(){this.attached=!1,this.redirectDialog=new Ln}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(Rn);n.searchParams.append("redirect_url",wn().href),e&&n.searchParams.append("wl_url",e);const s=document.createElement("a");s.target="cbw-opener",s.href=n.href,s.rel="noreferrer noopener",s.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class z{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=bn(),this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(ke);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),h=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!h&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(a,Number.parseInt(i,10)))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),z.accountRequestCallbackIds.size>0&&(Array.from(z.accountRequestCallbackIds.values()).forEach(a=>{this.invokeCallback(a,{method:"requestEthereumAccounts",result:[i]})}),z.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:s,connection:r}=this.subscribe();this._session=n,this.connection=r,this.relayEventManager=new gn,this.ui=s,this.ui.attach()}subscribe(){const e=Q.load(this.storage)||Q.create(this.storage),{linkAPIUrl:n}=this,s=new pn({session:e,linkAPIUrl:n,listener:this}),r=this.isMobileWeb?new Je:new Sn;return s.connect(),{session:e,ui:r,connection:s}}resetAndReload(){this.connection.destroy().then(()=>{const e=Q.load(this.storage);(e==null?void 0:e.id)===this._session.id&&q.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:K(e.weiValue),data:se(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?K(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?K(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?K(e.gasPriceInWei):null,gasLimit:e.gasLimit?K(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:K(e.weiValue),data:se(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?K(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?K(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?K(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?K(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:se(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const s=J(8),r=i=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,e.method,i),n==null||n()};return new Promise((i,a)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(s,o=>{if(n==null||n(),B(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,e)})}publishWeb3RequestEvent(e,n){const s={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",s,!0).then(r=>{}).catch(r=>{this.handleWeb3ResponseMessage(s.id,{method:n.method,errorMessage:r.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof Je)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,s){return this.connection.publishEvent(e,n,s)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){z.accountRequestCallbackIds.forEach(s=>this.invokeCallback(s,n)),z.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,s){var r;const i=(r=s==null?void 0:s.message)!==null&&r!==void 0?r:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:i})}invokeCallback(e,n){const s=this.relayEventManager.callbacks.get(e);s&&(s(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,s={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},r=J(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(r,o=>{if(B(o))return a(new Error(o.errorMessage));i(o)}),z.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,s)})}watchAsset(e,n,s,r,i,a){const o={method:"watchAsset",params:{type:e,options:{address:n,symbol:s,decimals:r,image:i},chainId:a}};let h=null;const p=J(8),v=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,k),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(h==null||h(),B(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,o)})}addEthereumChain(e,n,s,r,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:r,chainName:i,iconUrls:s,nativeCurrency:a}};let h=null;const p=J(8),v=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,k),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(h==null||h(),B(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,o)})}switchEthereumChain(e,n){const s={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let r=null;const i=J(8),a=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,o),r==null||r()};return r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:a,onResetConnection:this.resetAndReload}),new Promise((o,h)=>{this.relayEventManager.callbacks.set(i,p=>{if(r==null||r(),B(p)&&p.errorCode)return h(L.provider.custom({code:p.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(B(p))return h(new Error(p.errorMessage));o(p)}),this.publishWeb3RequestEvent(i,s)})}}z.accountRequestCallbackIds=new Set;const $e="DefaultChainId",Qe="DefaultJsonRpcUrl";class vt{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new q("walletlink",Ye),this.callback=e.callback||null;const n=this._storage.getItem(ke);if(n){const s=n.split(" ");s[0]!==""&&(this._addresses=s.map(r=>Z(r)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:s}=e.getWalletLinkSession();return{id:n,secret:s}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Qe))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(Qe,e)}updateProviderInfo(e,n){var s;this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem($e,n.toString(10)),ie(n)!==r&&((s=this.callback)===null||s===void 0||s.call(this,"chainChanged",Y(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw L.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw L.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw L.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw L.rpc.invalidParams("Address is required");const s=this.getChainId(),{address:r,symbol:i,image:a,decimals:o}=n.options,p=await this.initializeRelay().watchAsset(n.type,r,i,o,a,s==null?void 0:s.toString());return B(p)?!1:!!p.result}async addEthereumChain(e){var n,s;const r=e[0];if(((n=r.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw L.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!r.chainName||r.chainName.trim()==="")throw L.rpc.invalidParams("chainName is a required field");if(!r.nativeCurrency)throw L.rpc.invalidParams("nativeCurrency is a required field");const i=Number.parseInt(r.chainId,16);if(i===this.getChainId())return!1;const a=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:h=[],chainName:p,iconUrls:v=[],nativeCurrency:k}=r,l=await a.addEthereumChain(i.toString(),o,v,h,p,k);if(B(l))return!1;if(((s=l.result)===null||s===void 0?void 0:s.isApproved)===!0)return this.updateProviderInfo(o[0],i),null;throw L.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],s=Number.parseInt(n.chainId,16),i=await this.initializeRelay().switchEthereumChain(s.toString(10),this.selectedAddress||void 0);if(B(i))throw i;const a=i.result;return a.isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,s),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var s;if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>Z(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",r),this._storage.setItem(ke,r.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return Y(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);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":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw L.rpc.internal("No RPC URL set for chain");return Le(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=Z(e);if(!this._addresses.map(r=>Z(r)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?Z(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const s=e.to?Z(e.to):null,r=e.value!=null?ee(e.value):BigInt(0),i=e.data?ve(e.data):N.alloc(0),a=e.nonce!=null?ie(e.nonce):null,o=e.gasPrice!=null?ee(e.gasPrice):null,h=e.maxFeePerGas!=null?ee(e.maxFeePerGas):null,p=e.maxPriorityFeePerGas!=null?ee(e.maxPriorityFeePerGas):null,v=e.gas!=null?ee(e.gas):null,k=e.chainId?ie(e.chainId):this.getChainId();return{fromAddress:n,toAddress:s,weiValue:r,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:h,maxPriorityFeePerGas:p,gasLimit:v,chainId:k}}async ecRecover(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw L.rpc.invalidParams();const i=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:de(s[0]),signature:de(s[1]),addPrefix:n==="personal_ecRecover"}});if(B(i))throw i;return i.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem($e))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses;const r=await this.initializeRelay().requestEthereumAccounts();if(B(r))throw r;if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw L.rpc.invalidParams();const n=e[1],s=e[0];this._ensureKnownAddress(n);const i=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:Z(n),message:de(s),addPrefix:!0,typedDataJson:null}});if(B(i))throw i;return i.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signEthereumTransaction(n);if(B(r))throw r;return r.result}async _eth_sendRawTransaction(e){const n=ve(e[0]),r=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(B(r))throw r;return r.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(B(r))throw r;return r.result}async signTypedData(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw L.rpc.invalidParams();const r=p=>{const v={eth_signTypedData_v1:ae.hashForSignTypedDataLegacy,eth_signTypedData_v3:ae.hashForSignTypedData_v3,eth_signTypedData_v4:ae.hashForSignTypedData_v4,eth_signTypedData:ae.hashForSignTypedData_v4};return se(v[n]({data:Bt(p)}),!0)},i=s[n==="eth_signTypedData_v1"?1:0],a=s[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(i);const h=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:Z(i),message:r(a),typedDataJson:JSON.stringify(a,null,2),addPrefix:!1}});if(B(h))throw h;return h.result}initializeRelay(){return this._relay||(this._relay=new z({linkAPIUrl:Ye,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const kt="SignerType",Et=new q("CBWSDK","SignerConfigurator");function Pn(){return Et.getItem(kt)}function Tn(t){Et.setItem(kt,t)}async function On(t){const{communicator:e,metadata:n,handshakeRequest:s,callback:r}=t;Dn(e,n,r).catch(()=>{});const i={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:s})},{data:a}=await e.postRequestAndWaitForResponse(i);return a}function Nn(t){const{signerType:e,metadata:n,communicator:s,callback:r}=t;switch(e){case"scw":return new Xt({metadata:n,callback:r,communicator:s});case"walletlink":return new vt({metadata:n,callback:r})}}async function Dn(t,e,n){await t.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const s=new vt({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:s.getSession()}}),await s.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Un=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.
|
|
2
2
|
|
|
3
3
|
Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,jn=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,n=await fetch(e,{method:"HEAD"});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const s=n.headers.get("Cross-Origin-Opener-Policy");t=s??"null",t==="same-origin"&&console.error(Un)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:Ct,getCrossOriginOpenerPolicy:Hn}=jn(),Xe=420,et=540;function Bn(t){const e=(window.innerWidth-Xe)/2+window.screenX,n=(window.innerHeight-et)/2+window.screenY;qn(t);const s=`wallet_${crypto.randomUUID()}`,r=window.open(t,s,`width=${Xe}, height=${et}, left=${e}, top=${n}`);if(r==null||r.focus(),!r)throw L.rpc.internal("Pop up window failed to open");return r}function Wn(t){t&&!t.closed&&t.close()}function qn(t){const e={sdkName:ft,sdkVersion:X,origin:window.location.origin,coop:Hn()};for(const[n,s]of Object.entries(e))t.searchParams.append(n,s.toString())}class Kn{constructor({url:e=xn,metadata:n,preference:s}){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const i=this.onMessage(({requestId:a})=>a===r.id);return this.postMessage(r),await i},this.onMessage=async r=>new Promise((i,a)=>{const o=h=>{if(h.origin!==this.url.origin)return;const p=h.data;r(p)&&(i(p),window.removeEventListener("message",o),this.listeners.delete(o))};window.addEventListener("message",o),this.listeners.set(o,{reject:a})}),this.disconnect=()=>{Wn(this.popup),this.popup=null,this.listeners.forEach(({reject:r},i)=>{r(L.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",i)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=Bn(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:X,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw L.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=n,this.preference=s}}function Vn(t){const e=Nt(zn(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",X),n.searchParams.set("code",e.code.toString()),n.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:n.href})}function zn(t){var e;if(typeof t=="string")return{message:t,code:U.rpc.internal};if(B(t)){const n=t.errorMessage,s=(e=t.errorCode)!==null&&e!==void 0?e:n.match(/(denied|rejected)/i)?U.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:n,code:s,data:{method:t.method}})}return t}class Fn extends Mt{}var Zn=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n};class It extends Fn{constructor(e){var{metadata:n}=e,s=e.preference,{keysUrl:r}=s,i=Zn(s,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=n,this.preference=i,this.communicator=new Kn({url:r,metadata:n,preference:i});const a=Pn();a&&(this.signer=this.initSigner(a))}async request(e){try{if(Qt(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const n=await this.requestSignerSelection(e),s=this.initSigner(n);await s.handshake(e),this.signer=s,Tn(n);break}case"wallet_sendCalls":{const n=this.initSigner("scw");await n.handshake({method:"handshake"});const s=await n.request(e);return await n.cleanup(),s}case"wallet_getCallsStatus":return Le(e,Mn);case"net_version":return 1;case"eth_chainId":return Y(1);default:throw L.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(n){const{code:s}=n;return s===U.provider.unauthorized&&this.disconnect(),Promise.reject(Vn(n))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await((e=this.signer)===null||e===void 0?void 0:e.cleanup()),this.signer=null,q.clearAll(),this.emit("disconnect",L.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return On({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return Nn({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function St(t){if(t){if(!["all","smartWalletOnly","eoaOnly"].includes(t.options))throw new Error(`Invalid options: ${t.options}`);if(t.attribution&&t.attribution.auto!==void 0&&t.attribution.dataSuffix!==void 0)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}class ts{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||qt(),appChainIds:e.appChainIds||[]},this.storeLatestVersion(),Ct()}makeWeb3Provider(e={options:"all"}){var n;St(e);const s={metadata:this.metadata,preference:e};return(n=pt(s))!==null&&n!==void 0?n:new It(s)}getCoinbaseWalletLogo(e,n=240){return Pt(e,n)}storeLatestVersion(){new q("CBWSDK").setItem("VERSION",X)}}function Gn(t){var e;const n={metadata:t.metadata,preference:t.preference};return(e=pt(n))!==null&&e!==void 0?e:new It(n)}const Yn={options:"all"};function ns(t){var e;new q("CBWSDK").setItem("VERSION",X),Ct();const s={metadata:{appName:t.appName||"Dapp",appLogoUrl:t.appLogoUrl||"",appChainIds:t.appChainIds||[]},preference:Object.assign(Yn,(e=t.preference)!==null&&e!==void 0?e:{})};St(s.preference);let r=null;return{getProvider:()=>(r||(r=Gn(s)),r)}}export{ts as CoinbaseWalletSDK,ns as createCoinbaseWalletSDK,ts as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._button_149jw_1{min-height:46px}._icon_149jw_5{min-width:32px;min-height:32px;background-size:contain;background-repeat:no-repeat;background-position:center}._icon-metamask-mobile_149jw_13,._icon-metamask_149jw_13{background-image:url("data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%201025%201025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_542_3186)'%3e%3cpath%20d='M862.005%20871.546L689.114%20820.065L558.73%20898.006L467.763%20897.968L337.303%20820.065L164.488%20871.546L111.92%20694.087L164.488%20497.133L111.92%20330.613L164.488%20124.233L434.526%20285.567H591.967L862.005%20124.233L914.573%20330.613L862.005%20497.133L914.573%20694.087L862.005%20871.546Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M164.527%20124.233L434.566%20285.68L423.826%20396.479L164.527%20124.233Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M337.34%20694.163L456.155%20784.672L337.34%20820.065V694.163Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M446.659%20544.525L423.823%20396.554L277.65%20497.169L277.574%20497.132V497.207L278.026%20600.776L337.302%20544.525H337.34H446.659Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M862.005%20124.233L591.967%20285.68L602.669%20396.479L862.005%20124.233Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M689.19%20694.163L570.375%20784.672L689.19%20820.065V694.163Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M748.922%20497.207H748.96H748.922V497.132L748.884%20497.169L602.711%20396.554L579.875%20544.525H689.194L748.508%20600.776L748.922%20497.207Z'%20fill='%23FF5C16'/%3e%3cpath%20d='M337.303%20820.062L164.488%20871.544L111.92%20694.16H337.303V820.062Z'%20fill='%23E34807'/%3e%3cpath%20d='M446.623%20544.487L479.634%20758.4L433.886%20639.463L277.953%20600.776L337.267%20544.487H446.586H446.623Z'%20fill='%23E34807'/%3e%3cpath%20d='M689.188%20820.062L862.003%20871.544L914.571%20694.16H689.188V820.062Z'%20fill='%23E34807'/%3e%3cpath%20d='M579.87%20544.487L546.859%20758.4L592.607%20639.463L748.54%20600.776L689.189%20544.487H579.87Z'%20fill='%23E34807'/%3e%3cpath%20d='M111.92%20694.085L164.488%20497.131H277.538L277.952%20600.737L433.886%20639.424L479.633%20758.361L456.119%20784.556L337.304%20694.047H111.92V694.085Z'%20fill='%23FF8D5D'/%3e%3cpath%20d='M914.573%20694.085L862.004%20497.131H748.955L748.54%20600.737L592.607%20639.424L546.859%20758.361L570.374%20784.556L689.189%20694.047H914.573V694.085Z'%20fill='%23FF8D5D'/%3e%3cpath%20d='M591.969%20285.567H513.249H434.528L423.826%20396.366L479.635%20758.25H546.862L602.709%20396.366L591.969%20285.567Z'%20fill='%23FF8D5D'/%3e%3cpath%20d='M164.488%20124.233L111.92%20330.613L164.488%20497.133H277.538L423.787%20396.479L164.488%20124.233Z'%20fill='%23661800'/%3e%3cpath%20d='M413.951%20587.451H362.739L334.854%20614.781L433.923%20639.349L413.951%20587.413V587.451Z'%20fill='%23661800'/%3e%3cpath%20d='M862.006%20124.233L914.574%20330.613L862.006%20497.133H748.956L602.707%20396.479L862.006%20124.233Z'%20fill='%23661800'/%3e%3cpath%20d='M612.617%20587.451H663.904L691.79%20614.819L592.607%20639.424L612.617%20587.413V587.451Z'%20fill='%23661800'/%3e%3cpath%20d='M558.692%20827.41L570.373%20784.635L546.859%20758.44H479.594L456.08%20784.635L467.762%20827.41'%20fill='%23661800'/%3e%3cpath%20d='M558.689%20827.407V898.043H467.76V827.407H558.689Z'%20fill='%23C0C4CD'/%3e%3cpath%20d='M337.34%20819.99L467.837%20898.007V827.372L456.155%20784.597L337.34%20819.99Z'%20fill='%23E7EBF6'/%3e%3cpath%20d='M689.19%20819.99L558.693%20898.007V827.372L570.375%20784.597L689.19%20819.99Z'%20fill='%23E7EBF6'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_542_3186'%3e%3crect%20width='1024'%20height='1024'%20fill='white'%20transform='translate(0.986328%200.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}._icon-dapper_149jw_18{background-image:url(https://cdn.decentraland.org/@dcl/auth-site/4.13.0/assets/dapper-BT_mEW8_.png)}._icon-fortmatic_149jw_22{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAABYlAAAWJQFJUiTwAAAJ1klEQVR42u3dy4slZxnH8e7THcm48YYgiJCF/0AEE3VnJMbxlupLelR0I2TqdPfcIhJBXATEhZcQBC94IaA7VyIGFAfdBAXRhUQk6MIYHEFDVi6i05cqn7fqrdN1wiw6cWa6TvXnCz/e080kXbz1vt/3eevUqbO0BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAToDpWpXbOmVV5ISyksZhGeMxjUXcVgnocAxgHBb1sl64/Z3eSWC1LOrHon2iLKqvRStyyxNj7qsxBr8Rr8s8DpctSCew+kd7JrL3mY/X9eWtyDmRW59LMdYe/WRdx1b0t+0WoF4hgJMRwJ2Ra5E4GfX1JAOR25D/7G7GmCvqn+VxOCGAk6sA/rmz3gjgMItA5JYmtgD7Fx9qXl/N41AFQABCACAAIQAQgBAACEAIAAQgBAACEAIAAQgBgACEAEAAQgAgACEAEIAQAAhACAAEIAQAAhACAAEIAYAAhAAIgACEAAiAAIQACIAAhAAIwOAUAiAAEQIgABECIAARAiAAEQIgABECIAARAiAAEQIgABECIAARAiAAEQIgABECIAARAiAAEQIggOOmmrVFTryOgSMjyDQLoCyqmQDi9yYmAeQUWQDtYDmI1/syqvz3wmZzrn+ex+FEBUAAN5RAWilkXEmT/7OfaM7xr9M4jNVfBUAAc3vEw+31ZoC8GNmKnI18OErGD8kYUn9wWlRFnNN7swAilYlJALPV/3Bno2n/Pr2vWnbGRjwWrfwEcKMKYKetAK5F3pgHympkRRY/5dHrSVcBEAEBzFcA640Irk0frF/XCkAlABAAAAIAQAAACAAAAQAgAAAEAIAAABAAAAIACIAAAAIgAIAACAAgAAIACIAAAAIgAIAACAAgAAIACIAAAAIgAIAACAAgAAIACIAAAAIgAIAACAAgAAIACIAAAAIgAIAACAAgAAIACIAAAAIgAIAACAAggGELII6vacuPVs3r6VrXynFT5v5q+rGoZq9BAAtTAUzvMmj/X8pCHxLAAgpgereBezPYXtePBLBgAuhWrekHmlL2qXKt/ku0z8Sx/1GOlT9Efz0XW6dv5f6c2AIQwMJdA5jeX6fXz1/equudjbrelWMlndtHPtac36t5HK7YChDA4l0EbAXwbJr80e7HsR/IsXL94mZzrn+aK4CVdCEVBLCIFcCfd1sBDKf/hp/9iw817VNdBWALQAAEQAAgAAIgABAAARAACIAACAAEQAAEAAIgAAIAARAAAYAACIAAQAAEQAAgAAIgABAAARAACIAACAAEQAAEAAIgAAIAARAAAYAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAACIAATG4CIAACEAIgAAIQAiAAAhACIAACEAIggPEJoHq26b+i3oscDC5tn1bxuiIAEMBNFkBZVNeunKvrC5vDSppgu5t58qsAQAA3XwDl+5stwA8iT4cIrsYx/nIYqVN+Ecf0u9Sf5dAqgCILoOgEUK10fQoCGLwAmuM5O/wBG/149/YibAEKFQABLGAFkFev1I/L0S637QASEyof5z2DFECuAMriaAtQqgAIYFEEEKV1255tLgI2QhhYJn0BDHELcKnZAlQ/bvoxXQMgAAJYpC3AwEv/QQugzAIIkf5QBUAABHCKBFAWzbF0AnjiSACVE0cABHBqKoCtpn1UBUAABHDaKoC1mQDOtddU6pXzBEAABHBqBFDl1/dmAUycNQIggJELIB1HnNPD7fbcvhh5UxbA8sMqAAIggFNRARykW5Wj/U06xji+JIClKwRAAAQw/gog2r3Laf+/Vj3e7f9LdwESAAGcggqgPYauAvhIK4BqxRkjAAIYuwDi78dxtPv/tfqF/v5fBUAABHAatgDdDUBr9Y+640yT323ABEAAYxZAe/dfqgAOLm42P2/k41P+EwABjF0A+e8f7mw05/Rvkdfm8n9J+U8ABDBmAeS/W+ar//HzF/urPwEQAAGMuwJoVv/t9rz+O/K2fGzLUx8AIgACGLUAqnw+9y61q//X87hb6bYAIAACGKMAiua233b1X5+t/m/tzuWVCyY/ARDAaAVQFker/+X2k39fyKv+aj42J4oACGCMAugmf3fff/ztP0Xu6Ca+C38EQAAjFUC+37/KEjjcbd/6e29e/fPDSl38IwACGKMAqt4XkXSl/5f7F/48/psACGCcApj9jThve/mLP57ujqm74m/vTwAEMEYBHF30289flvpC5C158k/6EgABEMB4BFD13u8/yE/72Y/ckyf9ajf5rf4EQADjEkDVW/mbyZ/v+Hsgj6928tv3EwABjEwAxdzKv7+9Pvv9ejvpq/b9/nUrPwEQwKgEUPa+cjxd8Mtv9V2P3N8v++37CYAAxiSAYu5Kf9Xc499e7f9H5B39sj+xbfITAAGMQgBVWcyt+vvpd/l9/l9F3pz3+qu9Y/CkXwIggBEIoL/qpzGyl27vzVf7H5uV+t0n/NZrZT8BEMCCC6B62Tf4HKa9fjon+Su9fh//v3f19vmTLAEX/AiAABZWAO1z+6rex3kP0vf4pdU+l/v/it9f6q/63WrvrT4CIIDFE8DRKp//TV7t99MjvHc3Zyt+uqvvS5E39P5GU/J/erNd9a38BEAAAxdAr22u4pf5Wf3NRb32wl7z4M406fNbe8+URfVI9wz/XO6v9u/rt99fzAHStXc2b+HkBzdMu4Fwwkn7ze12kD5fZgGkL5Bw5o5HTNru3vt35kne79vZZE99nCZ8+uBOmvStdKu/xr/5dgj3vvKBo8mdyv1pPgf2+gtfAVT9CuClK+fyIBhI0rGkY2oeI/Vg/fosKwJ45RXAu9Pefa5/t+ZW+JdiMj8X7U+i/Xy07wkBnJmXSbPPbyf+hok/tgrgjji5j0f7ZOQ7ke8OIWV7LE/GYPxKVABn8kB04o5dAeQJW9R3Rb4f+V705zfTZ/Mjn4t8Kvr2fdG+/XxRv+YGC0Ss9tWkzA/u8EGeMQ6StcV5KktUAU7Yq5T8Ma8Jpe/nS3v7SZrsW2frpd38fn7p6T2jvgiYMklPaxla8p5z0k1+K9CrqvCW5vqz9zp9K2/zxZwxwdNEfzj/N+f182kYINXRAMlJA6H/80mm7LVlFoAtwCvaAsza8uX9GTk/m+wVsQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABo+R+M9RwtBsH6aAAAAABJRU5ErkJggg==)}._icon-wallet-connect_149jw_26{background-image:url(https://cdn.decentraland.org/@dcl/auth-site/4.13.0/assets/wallet-connect-CniBuHFv.png)}._icon-samsung-blockchain-wallet_149jw_30{background-image:url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20300%20300'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(0.766553,0,0,0.766553,35.0615,35.0613)'%3e%3cpath%20d='M297.462,105.461C293.768,77.602%20283.912,52.349%20266.521,33.86L266.515,33.86C248.024,16.47%20222.778,6.61%20194.918,2.919C168.309,-0.604%20150.189,0.26%20150.189,0.26C150.189,0.26%20132.07,-0.604%20105.46,2.919C77.595,6.611%2052.351,16.471%2033.86,33.86L33.857,33.86C16.469,52.35%206.61,77.603%202.914,105.461C-0.612,132.068%200.265,150.191%200.265,150.191C0.265,150.191%20-0.612,168.307%202.914,194.92C6.61,222.779%2016.469,248.025%2033.858,266.519L33.861,266.523C52.352,283.909%2077.596,293.77%20105.461,297.461C132.071,300.987%20150.19,300.119%20150.19,300.119C150.19,300.119%20168.309,300.987%20194.919,297.461C222.778,293.77%20248.024,283.908%20266.516,266.523L266.522,266.519C283.914,248.026%20293.769,222.78%20297.463,194.92C300.986,168.308%20300.118,150.191%20300.118,150.191C300.118,150.191%20300.985,132.069%20297.462,105.461'%20style='fill:rgb(30,75,198);fill-rule:nonzero;'/%3e%3cpath%20d='M233.959,176.377L233.959,124.004C240.433,121.056%20244.939,114.546%20244.939,106.97C244.939,96.631%20236.557,88.247%20226.217,88.247C222.378,88.247%20218.813,89.407%20215.842,91.387L169.111,64.408C169.126,64.09%20169.158,63.776%20169.158,63.452C169.158,53.112%20160.776,44.729%20150.434,44.729C140.094,44.729%20131.711,53.112%20131.711,63.452C131.711,63.694%20131.738,63.929%20131.748,64.17L84.984,91.17C82.086,89.328%2078.658,88.247%2074.969,88.247C64.629,88.247%2056.246,96.63%2056.246,106.97C56.246,114.257%2060.418,120.554%2066.493,123.649L66.493,176.73C60.418,179.826%2056.246,186.123%2056.246,193.411C56.246,203.75%2064.629,212.129%2074.969,212.129C78.657,212.129%2082.083,211.05%2084.981,209.209L131.748,236.211C131.737,236.451%20131.711,236.688%20131.711,236.929C131.711,247.269%20140.094,255.651%20150.434,255.651C160.776,255.651%20169.158,247.269%20169.158,236.929C169.158,236.608%20169.126,236.291%20169.111,235.972L215.845,208.993C218.813,210.972%20222.381,212.13%20226.217,212.13C236.557,212.13%20244.939,203.751%20244.939,193.412C244.939,185.832%20240.433,179.323%20233.959,176.377ZM207.49,193.411C207.49,194.234%20207.561,195.042%20207.664,195.836L161.984,222.209C158.801,219.708%20154.796,218.205%20150.434,218.205C145.989,218.205%20141.91,219.761%20138.7,222.351L93.454,196.227C93.595,195.305%2093.689,194.372%2093.689,193.412C93.689,185.548%2088.838,178.829%2081.97,176.055L81.97,124.327C88.838,121.555%2093.689,114.834%2093.689,106.972C93.689,106.013%2093.594,105.078%2093.454,104.158L138.701,78.034C141.911,80.621%20145.989,82.178%20150.433,82.178C154.795,82.178%20158.8,80.675%20161.98,78.173L207.663,104.548C207.56,105.344%20207.489,106.149%20207.489,106.972C207.489,114.548%20211.999,121.057%20218.473,124.005L218.473,176.379C212,179.323%20207.49,185.832%20207.49,193.411Z'%20style='fill:white;fill-rule:nonzero;'/%3e%3cpath%20d='M169.342,139.168C169.342,128.816%20160.948,120.418%20150.594,120.418C140.236,120.418%20131.84,128.816%20131.84,139.168C131.84,146.598%20136.171,152.994%20142.434,156.03L142.434,179.959L158.752,179.959L158.752,156.03C165.013,152.994%20169.342,146.599%20169.342,139.168'%20style='fill:rgb(69,210,249);'/%3e%3c/g%3e%3c/svg%3e")}._icon-coinbase_149jw_34,._icon-wallet-link_149jw_35{background-image:url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%201250%201250'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cpath%20d='M145.833,625.001c0,-264.46%20214.708,-479.168%20479.168,-479.168c264.458,0%20479.166,214.708%20479.166,479.168c-0,264.458%20-214.708,479.166%20-479.166,479.166c-264.46,-0%20-479.168,-214.708%20-479.168,-479.166Z'%20style='fill:url(%23_Linear1);'/%3e%3cpath%20d='M624.617,346.7c153.386,-0%20277.916,124.53%20277.916,277.917c0,153.386%20-124.53,277.916%20-277.916,277.916c-153.387,0%20-277.917,-124.53%20-277.917,-277.916c-0,-153.387%20124.53,-277.917%20277.917,-277.917Zm91.318,208.515c0,-12.096%20-9.821,-21.916%20-21.917,-21.916l-138.803,-0c-12.096,-0%20-21.916,9.82%20-21.916,21.916l-0,138.803c-0,12.096%209.82,21.917%2021.916,21.917l138.803,0c12.096,0%2021.917,-9.821%2021.917,-21.917l0,-138.803Z'%20style='fill:%23fff;'/%3e%3cdefs%3e%3clinearGradient%20id='_Linear1'%20x1='0'%20y1='0'%20x2='1'%20y2='0'%20gradientUnits='userSpaceOnUse'%20gradientTransform='matrix(5.8681e-14,-958.333,958.333,5.8681e-14,625.001,1104.17)'%3e%3cstop%20offset='0'%20style='stop-color:%23124bdc;stop-opacity:1'/%3e%3cstop%20offset='1'%20style='stop-color:%232d65f8;stop-opacity:1'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")}._icon-google_149jw_39{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1013_5889)'%3e%3cpath%20d='M12%2010.2725V13.9516H17.1127C16.8882%2015.1347%2016.2145%2016.1366%2015.2041%2016.8102L18.2872%2019.2025C20.0836%2017.5444%2021.1199%2015.1089%2021.1199%2012.2157C21.1199%2011.5421%2021.0595%2010.8943%2020.9472%2010.2726L12%2010.2725Z'%20fill='%234285F4'/%3e%3cpath%20d='M6.67582%2013.8081L5.98045%2014.3404L3.51904%2016.2576C5.08222%2019.3581%208.28607%2021.4999%2011.9997%2021.4999C14.5646%2021.4999%2016.715%2020.6536%2018.2869%2019.2027L15.2037%2016.8104C14.3574%2017.3804%2013.2778%2017.7259%2011.9997%2017.7259C9.5297%2017.7259%207.43112%2016.0591%206.6797%2013.8136L6.67582%2013.8081Z'%20fill='%2334A853'/%3e%3cpath%20d='M3.51902%207.74219C2.87132%209.02032%202.5%2010.4626%202.5%2011.9999C2.5%2013.5371%202.87132%2014.9794%203.51902%2016.2575C3.51902%2016.2661%206.67998%2013.8048%206.67998%2013.8048C6.48998%2013.2348%206.37768%2012.6303%206.37768%2011.9998C6.37768%2011.3692%206.48998%2010.7647%206.67998%2010.1947L3.51902%207.74219Z'%20fill='%23FBBC05'/%3e%3cpath%20d='M11.9999%206.28272C13.399%206.28272%2014.6426%206.76635%2015.6358%207.69909L18.3562%204.97867C16.7067%203.44142%2014.5649%202.5%2011.9999%202.5C8.28627%202.5%205.08222%204.63318%203.51904%207.74228L6.67991%2010.195C7.43123%207.94953%209.52989%206.28272%2011.9999%206.28272Z'%20fill='%23EA4335'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1013_5889'%3e%3crect%20width='19'%20height='19'%20fill='white'%20transform='translate(2.5%202.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}._icon-discord_149jw_43{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1013_5875)'%3e%3cpath%20d='M18.6534%205.99368C17.4294%205.44168%2016.1174%205.03368%2014.7454%204.80168C14.7332%204.79933%2014.7205%204.80084%2014.7092%204.806C14.6979%204.81116%2014.6884%204.81972%2014.6822%204.83048C14.5142%205.12568%2014.327%205.51048%2014.1958%205.81448C12.7407%205.59707%2011.2613%205.59707%209.8062%205.81448C9.66007%205.47756%209.49528%205.14906%209.3126%204.83048C9.30641%204.81958%209.29704%204.81084%209.28575%204.8054C9.27445%204.79997%209.26177%204.79811%209.2494%204.80008C7.8782%205.03208%206.5662%205.44008%205.3414%205.99288C5.33086%205.9973%205.32193%206.00483%205.3158%206.01448C2.8262%209.67448%202.1438%2013.2441%202.479%2016.7689C2.47993%2016.7775%202.48261%2016.7859%202.48687%2016.7934C2.49114%2016.801%202.4969%2016.8076%202.5038%2016.8129C3.95691%2017.8708%205.57767%2018.6767%207.2982%2019.1969C7.31019%2019.2006%207.32302%2019.2006%207.33501%2019.1968C7.347%2019.1931%207.35759%2019.1859%207.3654%2019.1761C7.73563%2018.6809%208.06372%2018.1556%208.3462%2017.6057C8.35012%2017.5982%208.35238%2017.5899%208.35282%2017.5814C8.35327%2017.5729%208.35189%2017.5645%208.34878%2017.5566C8.34567%2017.5487%208.3409%2017.5416%208.3348%2017.5357C8.32869%2017.5298%208.3214%2017.5253%208.3134%2017.5225C7.7966%2017.3279%207.29587%2017.093%206.8158%2016.8201C6.80717%2016.8152%206.7999%2016.8082%206.79464%2016.7997C6.78938%2016.7913%206.7863%2016.7817%206.78566%2016.7718C6.78503%2016.7619%206.78687%2016.752%206.79101%2016.7429C6.79515%2016.7339%206.80147%2016.7261%206.8094%2016.7201C6.9102%2016.6457%207.011%2016.5681%207.107%2016.4905C7.11564%2016.4835%207.12605%2016.4791%207.13707%2016.4776C7.14808%2016.4762%207.15928%2016.4779%207.1694%2016.4825C10.311%2017.8937%2013.7134%2017.8937%2016.8182%2016.4825C16.8283%2016.4776%2016.8397%2016.4757%2016.8508%2016.477C16.862%2016.4783%2016.8726%2016.4827%2016.8814%2016.4897C16.9774%2016.5681%2017.0774%2016.6457%2017.179%2016.7201C17.187%2016.7259%2017.1934%2016.7337%2017.1977%2016.7426C17.202%2016.7516%2017.204%2016.7615%2017.2035%2016.7714C17.203%2016.7813%2017.2001%2016.7909%2017.195%2016.7994C17.1899%2016.8079%2017.1827%2016.815%2017.1742%2016.8201C16.6958%2017.0953%2016.1982%2017.3281%2015.6758%2017.5217C15.6678%2017.5246%2015.6605%2017.5292%2015.6544%2017.5351C15.6483%2017.5411%2015.6435%2017.5483%2015.6404%2017.5563C15.6373%2017.5642%2015.6359%2017.5727%2015.6364%2017.5812C15.6368%2017.5898%2015.6391%2017.5981%2015.643%2017.6057C15.931%2018.1553%2016.2606%2018.6785%2016.623%2019.1753C16.6305%2019.1855%2016.641%2019.1931%2016.6531%2019.1971C16.6651%2019.2011%2016.6781%2019.2013%2016.6902%2019.1977C18.4137%2018.679%2020.0371%2017.8727%2021.4918%2016.8129C21.4989%2016.8079%2021.5049%2016.8015%2021.5093%2016.794C21.5137%2016.7866%2021.5165%2016.7783%2021.5174%2016.7697C21.9174%2012.6945%2020.847%209.15368%2018.6782%206.01608C18.6729%206.00588%2018.6641%205.99793%2018.6534%205.99368ZM8.8158%2014.6225C7.8702%2014.6225%207.0902%2013.7673%207.0902%2012.7185C7.0902%2011.6689%207.855%2010.8145%208.8158%2010.8145C9.7838%2010.8145%2010.5566%2011.6761%2010.5414%2012.7185C10.5414%2013.7681%209.7766%2014.6225%208.8158%2014.6225V14.6225ZM15.1958%2014.6225C14.2494%2014.6225%2013.4702%2013.7673%2013.4702%2012.7185C13.4702%2011.6689%2014.2342%2010.8145%2015.1958%2010.8145C16.1638%2010.8145%2016.9366%2011.6761%2016.9214%2012.7185C16.9214%2013.7681%2016.1646%2014.6225%2015.1958%2014.6225V14.6225Z'%20fill='%235865F2'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1013_5875'%3e%3crect%20width='19.2'%20height='19.2'%20fill='white'%20transform='translate(2.3999%202.3999)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}._icon-apple_149jw_47{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1013_5872)'%3e%3cpath%20d='M19.7521%2017.3068C19.4648%2017.9706%2019.1247%2018.5816%2018.7306%2019.1434C18.1935%2019.9092%2017.7537%2020.4393%2017.4147%2020.7337C16.8893%2021.2169%2016.3264%2021.4644%2015.7236%2021.4784C15.2908%2021.4784%2014.7689%2021.3553%2014.1614%2021.1055C13.5519%2020.8568%2012.9917%2020.7337%2012.4796%2020.7337C11.9424%2020.7337%2011.3664%2020.8568%2010.7502%2021.1055C10.133%2021.3553%209.63589%2021.4855%209.25579%2021.4984C8.67771%2021.523%208.10152%2021.2685%207.52637%2020.7337C7.15929%2020.4135%206.70013%2019.8647%206.15009%2019.0871C5.55994%2018.2567%205.07475%2017.2939%204.69464%2016.1961C4.28756%2015.0104%204.0835%2013.8622%204.0835%2012.7507C4.0835%2011.4773%204.35864%2010.3791%204.90974%209.45884C5.34285%208.71962%205.91905%208.1365%206.6402%207.70843C7.36136%207.28035%208.14057%207.06221%208.97971%207.04825C9.43886%207.04825%2010.041%207.19028%2010.7892%207.46941C11.5354%207.74947%2012.0145%207.8915%2012.2245%207.8915C12.3815%207.8915%2012.9138%207.72543%2013.816%207.39435C14.6692%207.08731%2015.3893%206.96018%2015.9792%207.01026C17.5778%207.13926%2018.7787%207.76941%2019.5774%208.90469C18.1477%209.77092%2017.4405%2010.9842%2017.4546%2012.5406C17.4675%2013.7529%2017.9073%2014.7618%2018.7717%2015.5628C19.1634%2015.9346%2019.6008%2016.2219%2020.0876%2016.426C19.982%2016.7321%2019.8706%2017.0253%2019.7521%2017.3068V17.3068ZM16.086%202.88011C16.086%203.83033%2015.7388%204.71754%2015.0468%205.53874C14.2118%206.51498%2013.2018%207.0791%2012.1065%206.99008C12.0926%206.87609%2012.0845%206.75611%2012.0845%206.63003C12.0845%205.71782%2012.4816%204.74158%2013.1868%203.94337C13.5389%203.53922%2013.9866%203.20318%2014.5296%202.93511C15.0715%202.67104%2015.584%202.52501%2016.066%202.5C16.0801%202.62703%2016.086%202.75407%2016.086%202.8801V2.88011Z'%20fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1013_5872'%3e%3crect%20width='19'%20height='19'%20fill='white'%20transform='translate(2.5%202.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}._icon-x_149jw_51{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5081%204.50732H20.1788L14.3442%2011.1759L21.2082%2020.2504H15.8337L11.6243%2014.7468L6.80771%2020.2504H4.13543L10.3761%2013.1176L3.7915%204.50732H9.30238L13.1074%209.53784L17.5081%204.50732ZM16.5708%2018.6519H18.0507L8.49827%206.02189H6.91024L16.5708%2018.6519Z'%20fill='black'/%3e%3c/svg%3e")}._container_16sx6_1{display:flex;flex-direction:column;width:100%;margin-bottom:24px}._label_16sx6_8{color:#ffffffb3;font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}._inputWrapper_16sx6_17{display:flex;align-items:center;gap:12px}._input_16sx6_17{flex:1;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:8px;padding:14px 16px;color:#fff;font-size:16px;outline:none;transition:border-color .2s,background-color .2s}._input_16sx6_17::placeholder{color:#ffffff80}._input_16sx6_17:focus{border-color:#fff6;background:#ffffff26}._input_16sx6_17:disabled{opacity:.6;cursor:not-allowed}._nextButton_16sx6_49{position:relative;background:#ff2d55;color:#fff;border:none;border-radius:8px;padding:14px 28px;font-size:14px;font-weight:600;letter-spacing:.5px;cursor:pointer;transition:background-color .2s,opacity .2s;min-width:90px;display:flex;align-items:center;justify-content:center}._textHidden_16sx6_67{visibility:hidden}._nextButton_16sx6_49:hover:not(:disabled){background:#e6284d}._nextButton_16sx6_49:disabled{opacity:.5;cursor:not-allowed}._spinner_16sx6_80{position:absolute;width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:_spin_16sx6_80 .8s linear infinite}@keyframes _spin_16sx6_80{to{transform:rotate(360deg)}}._inputError_16sx6_96{border-color:#ff6b6b}._inputError_16sx6_96:focus{border-color:#ff6b6b}._error_16sx6_104{color:#ff6b6b;font-size:13px;margin:8px 0 0}._error_16sx6_104:before{content:"⚠";margin-right:6px}._errorLogo_eokec_1{width:40px;height:40px;background-repeat:no-repeat;background-size:cover;background-position:right;background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='12'%20cy='12.5'%20rx='12'%20ry='12'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.6464%208.90655C15.9808%209.24055%2015.9806%209.78182%2015.6458%2010.1155L9.6422%2016.0993C9.30741%2016.433%208.76486%2016.4328%208.43038%2016.0988C8.0959%2015.7648%208.09615%2015.2235%208.43095%2014.8898L14.4345%208.90599C14.7693%208.5723%2015.3119%208.57255%2015.6464%208.90655Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.6464%2016.099C15.3119%2016.433%2014.7693%2016.4332%2014.4345%2016.0996L8.43095%2010.1157C8.09616%209.78204%208.0959%209.24077%208.43038%208.90677C8.76486%208.57277%209.30741%208.57252%209.64221%208.9062L15.6458%2014.89C15.9806%2015.2237%2015.9808%2015.765%2015.6464%2016.099Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e")}._logo_eokec_10{width:40px;height:40px;background-image:url("data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20%2040C31.0457%2040%2040%2031.0457%2040%2020C40%208.9543%2031.0457%200%2020%200C8.9543%200%200%208.9543%200%2020C0%2031.0457%208.9543%2040%2020%2040Z'%20fill='url(%23paint0_linear_997_9740)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%2036C11.34%2038.51%2015.5%2040%2020%2040C24.5%2040%2028.66%2038.51%2032%2036H8Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.00049%2032C5.14049%2033.51%206.49049%2034.86%208.00049%2036H32.0005C33.5105%2034.86%2034.8605%2033.51%2036.0005%2032H4.00049Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.8304%2028H1.67041C2.29041%2029.43%203.08041%2030.77%204.00041%2032H26.8404V28H26.8304Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.1704%2013V28H26.6704L14.1704%2013Z'%20fill='url(%23paint1_linear_997_9740)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.67041%2028H14.1704V13L1.67041%2028Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.8301%2021.0005V32.0005H36.0001L26.8301%2021.0005Z'%20fill='url(%23paint2_linear_997_9740)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.6699%2032.0005H26.8299V21.0005L17.6699%2032.0005Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.8301%2018C29.5915%2018%2031.8301%2015.7614%2031.8301%2013C31.8301%2010.2386%2029.5915%208%2026.8301%208C24.0687%208%2021.8301%2010.2386%2021.8301%2013C21.8301%2015.7614%2024.0687%2018%2026.8301%2018Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.1699%2010C15.5506%2010%2016.6699%208.88071%2016.6699%207.5C16.6699%206.11929%2015.5506%205%2014.1699%205C12.7892%205%2011.6699%206.11929%2011.6699%207.5C11.6699%208.88071%2012.7892%2010%2014.1699%2010Z'%20fill='%23FFC95B'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_997_9740'%20x1='20'%20y1='-8.28426'%20x2='-8.28426'%20y2='20'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_997_9740'%20x1='14.1662'%20y1='13'%20x2='14.1662'%20y2='28'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_997_9740'%20x1='26.827'%20y1='21.0005'%20x2='26.827'%20y2='32.0005'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")}._title_eokec_16{font-size:36px;font-weight:600;line-height:44px;margin-top:32px}._subtitle_eokec_23,._description_eokec_30{font-size:24px;font-weight:400;line-height:29.05px;margin-top:16px}._closeWindow_eokec_37{font-size:16px;font-weight:400;margin-top:40px}._errorMessage_eokec_43{padding:15px;border-radius:10px;margin-top:30px;line-break:anywhere;background-color:#201116bf;color:#fff;display:flex;align-items:flex-start;gap:8px}@media (max-width: 767px){._errorMessage_eokec_43{padding:15px;border-radius:10px;margin-top:30px;background-color:var(--primary);color:#fff}}.CustomWearablePreview{position:relative;width:100%;height:100%}.CustomWearablePreview .WearablePreview{background-color:unset}._main_1urbu_1{font-family:system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;color:var(--text);position:absolute;display:grid;grid-template-columns:50% 50%;height:100%;width:100%;justify-content:space-evenly}._left_1urbu_12{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;height:100%;width:100%;max-width:500px;margin-left:150px}._right_1urbu_23{height:100%}._right_1urbu_23 .CustomWearablePreview{right:8%}._changeAccount_1urbu_31{margin-top:150px;border-top:1px solid white;padding-top:20px;width:350px}._changeAccount_1urbu_31 a{color:#fff;text-decoration:underline;font-size:16px}@media (max-width: 767px){._main_1urbu_1{display:flex;flex-direction:column}._left_1urbu_12{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;max-width:inherit;width:100%;padding:20px;margin-left:0}}._container_15kql_1{font-family:system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;width:100%;height:100vh;display:flex;overflow:hidden}._background_15kql_9{position:fixed;height:100vh;width:100vw;background-size:cover;background-repeat:no-repeat;background-position:right;background-image:url(https://cdn.decentraland.org/@dcl/auth-site/4.13.0/assets/background-q68SxPSF.svg);z-index:-1}._left_15kql_20{flex:1;padding:1rem;color:#fff;display:flex;justify-content:center;align-items:center}._errorMessage_15kql_29{padding:15px;border-radius:10px;margin-top:30px;background-color:var(--primary);line-break:anywhere;color:#fff}._fieldLabel_15kql_38{color:#fff!important;opacity:70%;display:block;margin-bottom:4px;font-size:14px;font-weight:500}._fieldInput_15kql_47{width:100%;background:transparent;border:none;color:#fff;font-size:16px;padding:8px 0;outline:none}._fieldMessage_15kql_57{color:#fff!important;opacity:70%;margin-top:4px;font-size:13px}._field_15kql_38{margin-bottom:16px}._checkbox_15kql_68{width:18px;height:18px;margin-right:10px;cursor:pointer;accent-color:white}._randomizeButton_15kql_76{display:flex;align-items:center;justify-content:center;gap:8px}._container_15kql_1 input{border-bottom:2px solid rgba(255,255,255,.7)!important}._container_15kql_1 input::placeholder{color:#fff!important;opacity:70%}._leftInner_15kql_92{max-width:500px;display:flex;flex-direction:column}._logo_15kql_98{width:64px;height:64px}._title_15kql_103{font-size:30px;font-weight:600;line-height:36px;margin-top:24px}._subtitle_15kql_110{font-size:30px;font-weight:400;line-height:36px}._meetYourAvatar_15kql_116{font-size:18px;font-weight:600;line-height:22px;margin-top:24px}._meetYourAvatarDescription_15kql_123{font-size:14px;font-weight:400;line-height:17px;margin-top:24px}._randomize_15kql_76{margin-top:16px}._continue_15kql_135{width:75%;margin-top:24px}._logoSmall_15kql_140{width:40px;height:40px}._back_15kql_9{margin-top:26px;display:flex;align-items:center;gap:8px;cursor:pointer}._back_15kql_9>span{font-size:14px;font-weight:600;line-height:18px}._name_15kql_159{margin-top:24px}._agree_15kql_163{margin-top:24px;display:flex;align-items:center}._agree_15kql_163 a{color:#fff;font-weight:700;text-decoration:underline}._error_15kql_29{display:flex;align-items:center;gap:4px}._error_15kql_29>img{width:16px;height:16px}._emailError_15kql_187{margin-bottom:8px}._agreeError_15kql_191{opacity:70%;margin-top:8px;font-size:15px}._jumpIn_15kql_197{margin-top:24px}._right_15kql_201{flex:1;width:100%;position:relative;right:6.3%}@media screen and (max-width: 768px){._container_15kql_1{overflow:unset;height:unset}._mobileContainer_15kql_214{padding:24px;color:#fff}._meetYourAvatar_15kql_116,._meetYourAvatarDescription_15kql_123{margin-top:12px}._mobilePreviewContainer_15kql_227{position:relative;display:flex;flex-direction:column}._mobilePreviewOverlay_15kql_233{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:10}._mobilePreviewContainer_15kql_227 .CustomWearablePreview{height:500px}._mobileButtons_15kql_247{display:flex;gap:16px}._randomize_15kql_76{flex:1;margin-top:0}._continue_15kql_135{flex:1;margin-top:0;width:unset}._mobileCompleteYourProfile_15kql_263{margin-top:47px}._agree_15kql_163{display:flex}}._main_qbssu_1{background-color:#000;width:100%;height:100%}._warningImage_1yr2e_1{height:64px;width:64px;margin-bottom:24px}._content_1yr2e_7{display:flex;flex-direction:column;align-items:center}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}html{height:100%;overflow-x:hidden}body{margin:0;min-width:100%;min-height:100dvh;min-height:100vh;height:100%;overflow-x:hidden}#root{height:100%;min-height:100%}
|