@dcl/vesting-dashboard 3.3.0 → 3.4.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.
@@ -1,7 +0,0 @@
1
- import{d as A,f as nn,B as $,s as Fu,g as sn,h as ur,i as mc,e as _c,p as bi,b as ju}from"./index-6f7d51ea.js";function Bu(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Pi={},or={},on={};Object.defineProperty(on,"__esModule",{value:!0});on.walletLogo=void 0;const Du=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};on.walletLogo=Du;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.LINK_API_URL=void 0;an.LINK_API_URL="https://www.walletlink.org";var S={},dr={},qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.errorValues=qe.standardErrorCodes=void 0;qe.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};qe.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var cn={},ln={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=qe,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,f=r){if(h&&Number.isInteger(h)){const p=h.toString();if(d(t.errorValues,p))return t.errorValues[p].message;if(l(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||l(h))}e.isValidCode=s;function i(h){var f;if(typeof h=="number")return h;if(o(h))return(f=h.code)!==null&&f!==void 0?f:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:f=!1}={}){const p={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&s(h.code)){const y=h;p.code=y.code,y.message&&typeof y.message=="string"?(p.message=y.message,d(y,"data")&&(p.data=y.data)):(p.message=n(p.code),p.data={originalError:c(h)})}else p.code=t.standardErrorCodes.rpc.internal,p.message=u(h,"message")?h.message:r,p.data={originalError:c(h)};return f&&(p.stack=u(h,"stack")?h.stack:void 0),p}e.serialize=a;function l(h){return h>=-32099&&h<=-32e3}function c(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,f){return Object.prototype.hasOwnProperty.call(h,f)}function u(h,f){return typeof h=="object"&&h!==null&&f in h&&typeof h[f]=="string"}})(ln);Object.defineProperty(cn,"__esModule",{value:!0});cn.standardErrors=void 0;const ae=qe,bc=ln;cn.standardErrors={rpc:{parse:e=>ve(ae.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ve(ae.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ve(ae.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ve(ae.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ve(ae.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ve(t,e)},invalidInput:e=>ve(ae.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ve(ae.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ve(ae.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ve(ae.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ve(ae.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ve(ae.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>vt(ae.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>vt(ae.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>vt(ae.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>vt(ae.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>vt(ae.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>vt(ae.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new vc(t,r,n)}}};function ve(e,t){const[r,n]=yc(t);return new wc(e,r||(0,bc.getMessageFromCode)(e),n)}function vt(e,t){const[r,n]=yc(t);return new vc(e,r||(0,bc.getMessageFromCode)(e),n)}function yc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let wc=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},vc=class extends wc{constructor(t,r,n){if(!Hu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Hu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var un={},Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.isErrorResponse=void 0;function Uu(e){return e.errorMessage!==void 0}Vt.isErrorResponse=Uu;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.LIB_VERSION=void 0;Wt.LIB_VERSION="3.9.3";Object.defineProperty(un,"__esModule",{value:!0});un.serializeError=void 0;const Vu=Vt,Wu=Wt,zu=qe,qu=ln;function Ju(e,t){const r=(0,qu.serialize)(Gu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Wu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=Zu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}un.serializeError=Ju;function Gu(e){return typeof e=="string"?{message:e,code:zu.standardErrorCodes.rpc.internal}:(0,Vu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Zu(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=qe;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=cn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=un;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=ln;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(dr);var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.ProviderType=ne.RegExpString=ne.IntNumber=ne.BigIntString=ne.AddressString=ne.HexString=ne.OpaqueType=void 0;function hr(){return e=>e}ne.OpaqueType=hr;ne.HexString=hr();ne.AddressString=hr();ne.BigIntString=hr();function Qu(e){return Math.floor(e)}ne.IntNumber=Qu;ne.RegExpString=hr();var Wo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Wo||(ne.ProviderType=Wo={}));var Ku=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S,"__esModule",{value:!0});S.isMobileWeb=S.getLocation=S.isInIFrame=S.createQrUrl=S.getFavicon=S.range=S.isBigNumber=S.ensureParsedJSONObject=S.ensureBN=S.ensureRegExpString=S.ensureIntNumber=S.ensureBuffer=S.ensureAddressString=S.ensureEvenLengthHexString=S.ensureHexString=S.isHexString=S.prepend0x=S.strip0x=S.has0xPrefix=S.hexStringFromIntNumber=S.intNumberFromHexString=S.bigIntStringFromBN=S.hexStringFromBuffer=S.hexStringToUint8Array=S.uint8ArrayToHex=S.randomBytesHex=void 0;const Ke=Ku(nn),_t=dr,ke=ne,Ec=/^[0-9]*$/,Sc=/^[a-f0-9]*$/;function Xu(e){return Cc(crypto.getRandomValues(new Uint8Array(e)))}S.randomBytesHex=Xu;function Cc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}S.uint8ArrayToHex=Cc;function Yu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}S.hexStringToUint8Array=Yu;function ed(e,t=!1){const r=e.toString("hex");return(0,ke.HexString)(t?`0x${r}`:r)}S.hexStringFromBuffer=ed;function td(e){return(0,ke.BigIntString)(e.toString(10))}S.bigIntStringFromBN=td;function rd(e){return(0,ke.IntNumber)(new Ke.default(pr(e,!1),16).toNumber())}S.intNumberFromHexString=rd;function nd(e){return(0,ke.HexString)(`0x${new Ke.default(e).toString(16)}`)}S.hexStringFromIntNumber=nd;function Oi(e){return e.startsWith("0x")||e.startsWith("0X")}S.has0xPrefix=Oi;function dn(e){return Oi(e)?e.slice(2):e}S.strip0x=dn;function kc(e){return Oi(e)?`0x${e.slice(2)}`:`0x${e}`}S.prepend0x=kc;function fr(e){if(typeof e!="string")return!1;const t=dn(e).toLowerCase();return Sc.test(t)}S.isHexString=fr;function Rc(e,t=!1){if(typeof e=="string"){const r=dn(e).toLowerCase();if(Sc.test(r))return(0,ke.HexString)(t?`0x${r}`:r)}throw _t.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}S.ensureHexString=Rc;function pr(e,t=!1){let r=Rc(e,!1);return r.length%2===1&&(r=(0,ke.HexString)(`0${r}`)),t?(0,ke.HexString)(`0x${r}`):r}S.ensureEvenLengthHexString=pr;function sd(e){if(typeof e=="string"){const t=dn(e).toLowerCase();if(fr(t)&&t.length===40)return(0,ke.AddressString)(kc(t))}throw _t.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}S.ensureAddressString=sd;function id(e){if($.isBuffer(e))return e;if(typeof e=="string"){if(fr(e)){const t=pr(e,!1);return $.from(t,"hex")}return $.from(e,"utf8")}throw _t.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}S.ensureBuffer=id;function Ic(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ke.IntNumber)(e);if(typeof e=="string"){if(Ec.test(e))return(0,ke.IntNumber)(Number(e));if(fr(e))return(0,ke.IntNumber)(new Ke.default(pr(e,!1),16).toNumber())}throw _t.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureIntNumber=Ic;function od(e){if(e instanceof RegExp)return(0,ke.RegExpString)(e.toString());throw _t.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}S.ensureRegExpString=od;function ad(e){if(e!==null&&(Ke.default.isBN(e)||Ac(e)))return new Ke.default(e.toString(10),10);if(typeof e=="number")return new Ke.default(Ic(e));if(typeof e=="string"){if(Ec.test(e))return new Ke.default(e,10);if(fr(e))return new Ke.default(pr(e,!1),16)}throw _t.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureBN=ad;function cd(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw _t.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}S.ensureParsedJSONObject=cd;function Ac(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}S.isBigNumber=Ac;function ld(e,t){return Array.from({length:t-e},(r,n)=>e+n)}S.range=ld;function ud(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}S.getFavicon=ud;function dd(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}S.createQrUrl=dd;function Nc(){try{return window.frameElement!==null}catch{return!1}}S.isInIFrame=Nc;function hd(){try{return Nc()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=hd;function fd(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}S.isMobileWeb=fd;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.ScopedLocalStorage=void 0;class pd{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}hn.ScopedLocalStorage=pd;var $t={},Lc={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function i(l,c,d,u,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var f=new s(d,u||l,h),p=r?r+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],f]:l._events[p].push(f):(l._events[p]=f,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],d,u;if(this._eventsCount===0)return c;for(u in d=this._events)t.call(d,u)&&c.push(r?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(c){var d=r?r+c:c,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var h=0,f=u.length,p=new Array(f);h<f;h++)p[h]=u[h].fn;return p},a.prototype.listenerCount=function(c){var d=r?r+c:c,u=this._events[d];return u?u.fn?1:u.length:0},a.prototype.emit=function(c,d,u,h,f,p){var y=r?r+c:c;if(!this._events[y])return!1;var g=this._events[y],b=arguments.length,_,m;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),b){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,u),!0;case 4:return g.fn.call(g.context,d,u,h),!0;case 5:return g.fn.call(g.context,d,u,h,f),!0;case 6:return g.fn.call(g.context,d,u,h,f,p),!0}for(m=1,_=new Array(b-1);m<b;m++)_[m-1]=arguments[m];g.fn.apply(g.context,_)}else{var M=g.length,w;for(m=0;m<M;m++)switch(g[m].once&&this.removeListener(c,g[m].fn,void 0,!0),b){case 1:g[m].fn.call(g[m].context);break;case 2:g[m].fn.call(g[m].context,d);break;case 3:g[m].fn.call(g[m].context,d,u);break;case 4:g[m].fn.call(g[m].context,d,u,h);break;default:if(!_)for(w=1,_=new Array(b-1);w<b;w++)_[w-1]=arguments[w];g[m].fn.apply(g[m].context,_)}}return!0},a.prototype.on=function(c,d,u){return i(this,c,d,u,!1)},a.prototype.once=function(c,d,u){return i(this,c,d,u,!0)},a.prototype.removeListener=function(c,d,u,h){var f=r?r+c:c;if(!this._events[f])return this;if(!d)return o(this,f),this;var p=this._events[f];if(p.fn)p.fn===d&&(!h||p.once)&&(!u||p.context===u)&&o(this,f);else{for(var y=0,g=[],b=p.length;y<b;y++)(p[y].fn!==d||h&&!p[y].once||u&&p[y].context!==u)&&g.push(p[y]);g.length?this._events[f]=g.length===1?g[0]:g:o(this,f)}return this},a.prototype.removeAllListeners=function(c){var d;return c?(d=r?r+c:c,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a})(Lc);var gd=Lc.exports,gr={},mr={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.EVENTS=void 0;zt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.RelayAbstract=Ce.APP_VERSION_KEY=Ce.LOCAL_STORAGE_ADDRESSES_KEY=Ce.WALLET_USER_NAME_KEY=void 0;const zo=dr;Ce.WALLET_USER_NAME_KEY="walletUsername";Ce.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ce.APP_VERSION_KEY="AppVersion";class md{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw zo.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,zo.serializeError)(i,t.method);return s})}}Ce.RelayAbstract=md;var qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.Session=void 0;const qo=Fu,Jo=S,Go="session:id",Zo="session:secret",Qo="session:linked";class $i{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Jo.randomBytesHex)(16),this._secret=n||(0,Jo.randomBytesHex)(32),this._key=new qo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Go),n=t.getItem(Qo),s=t.getItem(Zo);return r&&s?new $i(t,r,s,n==="1"):null}static hash(t){return new qo.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Go,this._id),this._storage.setItem(Zo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Qo,this._linked?"1":"0")}}qt.Session=$i;var fn={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.Cipher=void 0;const Pr=S;class _d{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Pr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,l=o.slice(o.byteLength-a),c=o.slice(0,o.byteLength-a),d=new Uint8Array(l),u=new Uint8Array(c),h=new Uint8Array([...n,...d,...u]);return(0,Pr.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Pr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Pr.hexStringToUint8Array)(t),a=o.slice(0,12),l=o.slice(12,28),c=o.slice(28),d=new Uint8Array([...c,...l]),u={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(u,i,d),f=new TextDecoder;n(f.decode(h))}catch(h){s(h)}})()})}}pn.Cipher=_d;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.WalletLinkHTTP=void 0;class bd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}gn.WalletLinkHTTP=bd;var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.WalletLinkWebSocket=xt.ConnectionState=void 0;var Nt;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Nt||(xt.ConnectionState=Nt={}));class yd{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Nt.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Nt.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Nt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,l)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Nt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}xt.WalletLinkWebSocket=yd;Object.defineProperty(fn,"__esModule",{value:!0});fn.WalletLinkConnection=void 0;const Et=ne,wd=pn,Me=zt,Ko=Ce,St=qt,vd=gn,Or=xt,Xo=1e4,Ed=6e4;class Sd{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Et.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,d)=>{const u=a[d];u!==void 0&&c(u)})},this.handleDestroyed=a=>{var l,c;a==="1"&&((l=this.listener)===null||l===void 0||l.resetAndReload(),(c=this.diagnostic)===null||c===void 0||c.log(Me.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:St.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var l,c;try{const d=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.accountUpdated(d)}catch{(c=this.diagnostic)===null||c===void 0||c.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,l)=>{var c,d;try{const u=await this.cipher.decrypt(l);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,u)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Ko.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Ko.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,l)=>{var c,d;try{const u=await this.cipher.decrypt(a),h=await this.cipher.decrypt(l);(c=this.listener)===null||c===void 0||c.chainUpdated(u,h)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new wd.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new Or.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var l;(l=this.diagnostic)===null||l===void 0||l.log(Me.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:St.Session.hash(t.id)});let c=!1;switch(a){case Or.ConnectionState.DISCONNECTED:if(!this.destroyed){const d=async()=>{await new Promise(u=>setTimeout(u,5e3)),this.destroyed||o.connect().catch(()=>{d()})};d()}break;case Or.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),c=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Xo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Or.ConnectionState.CONNECTING:break}this.connected!==c&&(this.connected=c)}),o.setIncomingDataListener(a=>{var l,c,d;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const u=a.type==="IsLinkedOK"?a.linked:void 0;(l=this.diagnostic)===null||l===void 0||l.log(Me.EVENTS.LINKED,{sessionIdHash:St.Session.hash(t.id),linked:u,type:a.type,onlineGuests:a.onlineGuests}),this.linked=u||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(c=this.diagnostic)===null||c===void 0||c.log(Me.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:St.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((d=this.requestResolutions.get(a.id))===null||d===void 0||d(a))}),this.ws=o,this.http=new vd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Me.EVENTS.STARTED_CONNECTING,{sessionIdHash:St.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Me.EVENTS.DISCONNECTED,{sessionIdHash:St.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Me.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Et.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,Et.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Xo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Ed){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Et.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Et.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Et.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}fn.WalletLinkConnection=Sd;var _r={},br={},xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var Cd=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.injectCssReset=void 0;const kd=Cd(xi);function Rd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(kd.default)),document.documentElement.appendChild(e)}br.injectCssReset=Rd;var mn={},yr,J,Tc,Mc,it,Yo,Pc,yi,Fi,wi,vi,Oc,ar={},$c=[],Id=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_n=Array.isArray;function ze(e,t){for(var r in t)e[r]=t[r];return e}function xc(e){var t=e.parentNode;t&&t.removeChild(e)}function Ei(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?yr.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return rr(e,o,n,s,null)}function rr(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Tc,__i:-1,__u:0};return s==null&&J.vnode!=null&&J.vnode(i),i}function Ad(){return{current:null}}function wr(e){return e.children}function nr(e,t){this.props=e,this.context=t}function ft(e,t){if(t==null)return e.__?ft(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ft(e):null}function Fc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Fc(e)}}function Si(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!Qr.__r++||Yo!==J.debounceRendering)&&((Yo=J.debounceRendering)||Pc)(Qr)}function Qr(){var e,t,r,n,s,i,o,a;for(it.sort(yi);e=it.shift();)e.__d&&(t=it.length,n=void 0,i=(s=(r=e).__v).__e,o=[],a=[],r.__P&&((n=ze({},s)).__v=s.__v+1,J.vnode&&J.vnode(n),ji(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,o,i??ft(s),!!(32&s.__u),a),n.__v=s.__v,n.__.__k[n.__i]=n,Hc(o,n,a),n.__e!=i&&Fc(n)),it.length>t&&it.sort(yi));Qr.__r=0}function jc(e,t,r,n,s,i,o,a,l,c,d){var u,h,f,p,y,g=n&&n.__k||$c,b=t.length;for(r.__d=l,Nd(r,t,g),l=r.__d,u=0;u<b;u++)(f=r.__k[u])!=null&&typeof f!="boolean"&&typeof f!="function"&&(h=f.__i===-1?ar:g[f.__i]||ar,f.__i=u,ji(e,f,h,s,i,o,a,l,c,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Bi(h.ref,null,f),d.push(f.ref,f.__c||p,f)),y==null&&p!=null&&(y=p),65536&f.__u||h.__k===f.__k?(l&&!l.isConnected&&(l=ft(h)),l=Bc(f,l,e)):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:p&&(l=p.nextSibling),f.__d=void 0,f.__u&=-196609);r.__d=l,r.__e=y}function Nd(e,t,r){var n,s,i,o,a,l=t.length,c=r.length,d=c,u=0;for(e.__k=[],n=0;n<l;n++)o=n+u,(s=e.__k[n]=(s=t[n])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?rr(null,s,null,null,null):_n(s)?rr(wr,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?rr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,a=Ld(s,r,o,d),s.__i=a,i=null,a!==-1&&(d--,(i=r[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&u--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a===o+1?u++:a>o?d>l-o?u+=a-o:u--:a<o?a==o-1&&(u=a-o):u=0,a!==n+u&&(s.__u|=65536))):(i=r[o])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=ft(i)),Ci(i,i,!1),r[o]=null,d--);if(d)for(n=0;n<c;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=ft(i)),Ci(i,i))}function Bc(e,t,r){var n,s;if(typeof e.type=="function"){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=Bc(n[s],t,r));return t}e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Dc(e,t){return t=t||[],e==null||typeof e=="boolean"||(_n(e)?e.some(function(r){Dc(r,t)}):t.push(e)),t}function Ld(e,t,r,n){var s=e.key,i=e.type,o=r-1,a=r+1,l=t[r];if(l===null||l&&s==l.key&&i===l.type&&!(131072&l.__u))return r;if(n>(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&!(131072&l.__u)&&s==l.key&&i===l.type)return o;o--}if(a<t.length){if((l=t[a])&&!(131072&l.__u)&&s==l.key&&i===l.type)return a;a++}}return-1}function ea(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Id.test(t)?r:r+"px"}function $r(e,t,r,n,s){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||ea(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ea(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Fi,e.addEventListener(t,i?vi:wi,i)):e.removeEventListener(t,i?vi:wi,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function ta(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Fi++;else if(t.t<r.u)return;return r(J.event?J.event(t):t)}}}function ji(e,t,r,n,s,i,o,a,l,c){var d,u,h,f,p,y,g,b,_,m,M,w,N,U,G,V=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=t.__e=r.__e]),(d=J.__b)&&d(t);e:if(typeof V=="function")try{if(b=t.props,_=(d=V.contextType)&&n[d.__c],m=d?_?_.props.value:d.__:n,r.__c?g=(u=t.__c=r.__c).__=u.__E:("prototype"in V&&V.prototype.render?t.__c=u=new V(b,m):(t.__c=u=new nr(b,m),u.constructor=V,u.render=Md),_&&_.sub(u),u.props=b,u.state||(u.state={}),u.context=m,u.__n=n,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),V.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ze({},u.__s)),ze(u.__s,V.getDerivedStateFromProps(b,u.__s))),f=u.props,p=u.state,u.__v=t,h)V.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(V.getDerivedStateFromProps==null&&b!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,m),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,m)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=b,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(z){z&&(z.__=t)}),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,m),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,y)})}if(u.context=m,u.props=b,u.__P=e,u.__e=!1,w=J.__r,N=0,"prototype"in V&&V.prototype.render){for(u.state=u.__s,u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),U=0;U<u._sb.length;U++)u.__h.push(u._sb[U]);u._sb=[]}else do u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++N<25);u.state=u.__s,u.getChildContext!=null&&(n=ze(ze({},n),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(y=u.getSnapshotBeforeUpdate(f,p)),jc(e,_n(G=d!=null&&d.type===wr&&d.key==null?d.props.children:d)?G:[G],t,r,n,s,i,o,a,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&o.push(u),g&&(u.__E=u.__=null)}catch(z){t.__v=null,l||i!=null?(t.__e=a,t.__u|=l?160:32,i[i.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),J.__e(z,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Td(r.__e,t,r,n,s,i,o,l,c);(d=J.diffed)&&d(t)}function Hc(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Bi(r[n],r[++n],r[++n]);J.__c&&J.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){J.__e(i,s.__v)}})}function Td(e,t,r,n,s,i,o,a,l){var c,d,u,h,f,p,y,g=r.props,b=t.props,_=t.type;if(_==="svg"?s="http://www.w3.org/2000/svg":_==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!_&&(_?f.localName===_:f.nodeType===3)){e=f,i[c]=null;break}}if(e==null){if(_===null)return document.createTextNode(b);e=document.createElementNS(s,_,b.is&&b),i=null,a=!1}if(_===null)g===b||a&&e.data===b||(e.data=b);else{if(i=i&&yr.call(e.childNodes),g=r.props||ar,!a&&i!=null)for(g={},c=0;c<e.attributes.length;c++)g[(f=e.attributes[c]).name]=f.value;for(c in g)if(f=g[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=f;else if(c!=="key"&&!(c in b)){if(c=="value"&&"defaultValue"in b||c=="checked"&&"defaultChecked"in b)continue;$r(e,c,null,f,s)}}for(c in b)f=b[c],c=="children"?h=f:c=="dangerouslySetInnerHTML"?d=f:c=="value"?p=f:c=="checked"?y=f:c==="key"||a&&typeof f!="function"||g[c]===f||$r(e,c,f,g[c],s);if(d)a||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),jc(e,_n(h)?h:[h],t,r,n,_==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&ft(r,0),a,l),i!=null)for(c=i.length;c--;)i[c]!=null&&xc(i[c]);a||(c="value",p!==void 0&&(p!==e[c]||_==="progress"&&!p||_==="option"&&p!==g[c])&&$r(e,c,p,g[c],s),c="checked",y!==void 0&&y!==e[c]&&$r(e,c,y,g[c],s))}return e}function Bi(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){J.__e(n,r)}}function Ci(e,t,r){var n,s;if(J.unmount&&J.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Bi(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){J.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&Ci(n[s],t,r||typeof e.type!="function");r||e.__e==null||xc(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Md(e,t,r){return this.constructor(e,r)}function Uc(e,t,r){var n,s,i,o;J.__&&J.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],ji(t,e=(!n&&r||t).__k=Ei(wr,null,[e]),s||ar,ar,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?yr.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,o),Hc(i,e,o)}function Vc(e,t){Uc(e,t,Vc)}function Pd(e,t,r){var n,s,i,o,a=ze({},e.props);for(i in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?s=t[i]:a[i]=t[i]===void 0&&o!==void 0?o[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?yr.call(arguments,2):r),rr(e.type,a,n||e.key,s||e.ref,null)}function Od(e,t){var r={__c:t="__cC"+Oc++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&s.some(function(a){a.__e=!0,Si(a)})},this.sub=function(o){s.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){s.splice(s.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}yr=$c.slice,J={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},Tc=0,Mc=function(e){return e!=null&&e.constructor==null},nr.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ze({},this.state),typeof e=="function"&&(e=e(ze({},r),this.props)),e&&ze(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Si(this))},nr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Si(this))},nr.prototype.render=wr,it=[],Pc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yi=function(e,t){return e.__v.__b-t.__v.__b},Qr.__r=0,Fi=0,wi=ta(!1),vi=ta(!0),Oc=0;const $d=Object.freeze(Object.defineProperty({__proto__:null,Component:nr,Fragment:wr,cloneElement:Pd,createContext:Od,createElement:Ei,createRef:Ad,h:Ei,hydrate:Vc,get isValidElement(){return Mc},get options(){return J},render:Uc,toChildArray:Dc},Symbol.toStringTag,{value:"Module"})),me=sn($d);var bn={},Je,W,Zs,ra,Ft=0,Wc=[],Jr=[],X=J,na=X.__b,sa=X.__r,ia=X.diffed,oa=X.__c,aa=X.unmount,ca=X.__;function bt(e,t){X.__h&&X.__h(W,e,Ft||t),Ft=0;var r=W.__H||(W.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Jr}),r.__[e]}function zc(e){return Ft=1,qc(Gc,e)}function qc(e,t,r){var n=bt(Je++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Gc(void 0,t),function(a){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,a);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=W,!W.u)){var s=function(a,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!i||i.call(this,a,l,c);var u=!1;return d.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(u=!0)}}),!(!u&&n.__c.props===a)&&(!i||i.call(this,a,l,c))};W.u=!0;var i=W.shouldComponentUpdate,o=W.componentWillUpdate;W.componentWillUpdate=function(a,l,c){if(this.__e){var d=i;i=void 0,s(a,l,c),i=d}o&&o.call(this,a,l,c)},W.shouldComponentUpdate=s}return n.__N||n.__}function xd(e,t){var r=bt(Je++,3);!X.__s&&Hi(r.__H,t)&&(r.__=e,r.i=t,W.__H.__h.push(r))}function Jc(e,t){var r=bt(Je++,4);!X.__s&&Hi(r.__H,t)&&(r.__=e,r.i=t,W.__h.push(r))}function Fd(e){return Ft=5,Di(function(){return{current:e}},[])}function jd(e,t,r){Ft=6,Jc(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Di(e,t){var r=bt(Je++,7);return Hi(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Bd(e,t){return Ft=8,Di(function(){return e},t)}function Dd(e){var t=W.context[e.__c],r=bt(Je++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(W)),t.props.value):e.__}function Hd(e,t){X.useDebugValue&&X.useDebugValue(t?t(e):e)}function Ud(e){var t=bt(Je++,10),r=zc();return t.__=e,W.componentDidCatch||(W.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Vd(){var e=bt(Je++,11);if(!e.__){for(var t=W.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Wd(){for(var e;e=Wc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Gr),e.__H.__h.forEach(ki),e.__H.__h=[]}catch(t){e.__H.__h=[],X.__e(t,e.__v)}}X.__b=function(e){W=null,na&&na(e)},X.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ca&&ca(e,t)},X.__r=function(e){sa&&sa(e),Je=0;var t=(W=e.__c).__H;t&&(Zs===W?(t.__h=[],W.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Jr,r.__N=r.i=void 0})):(t.__h.forEach(Gr),t.__h.forEach(ki),t.__h=[],Je=0)),Zs=W},X.diffed=function(e){ia&&ia(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wc.push(t)!==1&&ra===X.requestAnimationFrame||((ra=X.requestAnimationFrame)||zd)(Wd)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Jr&&(r.__=r.__V),r.i=void 0,r.__V=Jr})),Zs=W=null},X.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Gr),r.__h=r.__h.filter(function(n){return!n.__||ki(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],X.__e(n,r.__v)}}),oa&&oa(e,t)},X.unmount=function(e){aa&&aa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Gr(n)}catch(s){t=s}}),r.__H=void 0,t&&X.__e(t,r.__v))};var la=typeof requestAnimationFrame=="function";function zd(e){var t,r=function(){clearTimeout(n),la&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);la&&(t=requestAnimationFrame(r))}function Gr(e){var t=W,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),W=t}function ki(e){var t=W;e.__c=e.__(),W=t}function Hi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Gc(e,t){return typeof t=="function"?t(e):t}const qd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Bd,useContext:Dd,useDebugValue:Hd,useEffect:xd,useErrorBoundary:Ud,useId:Vd,useImperativeHandle:jd,useLayoutEffect:Jc,useMemo:Di,useReducer:qc,useRef:Fd,useState:zc},Symbol.toStringTag,{value:"Module"})),yn=sn(qd);var jt={},wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.CloseIcon=void 0;const ua=me;function Jd(e){return(0,ua.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ua.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}wn.CloseIcon=Jd;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.CoinbaseWalletRound=void 0;const xr=me;function Gd(e){return(0,xr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,xr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,xr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,xr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}vn.CoinbaseWalletRound=Gd;var En={};Object.defineProperty(En,"__esModule",{value:!0});En.QRCodeIcon=void 0;const Kt=me;function Zd(e){return(0,Kt.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Kt.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Kt.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Kt.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Kt.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}En.QRCodeIcon=Zd;var Sn={};function Zc(e){this.mode=ye.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Zc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function je(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}je.prototype={addData:function(e){var t=new Zc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=je.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var o=i*s,a=0;a<this.modules[i].length;a++){var l=a*s,c=this.modules[i][a];c&&(n.beginFill(0,100),n.moveTo(l,o),n.lineTo(l+s,o),n.lineTo(l+s,o+s),n.lineTo(l,o+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=K.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)i==-2||i==2||o==-2||o==2||i==0&&o==0?this.modules[n+i][s+o]=!0:this.modules[n+i][s+o]=!1}},setupTypeNumber:function(e){for(var t=K.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=K.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var l=!1;i<e.length&&(l=(e[i]>>>s&1)==1);var c=K.getMask(t,n,o-a);c&&(l=!l),this.modules[n][o-a]=l,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};je.PAD0=236;je.PAD1=17;je.createData=function(e,t,r){for(var n=Fe.getRSBlocks(e,t),s=new Qc,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),K.getLengthInBits(o.mode,e)),o.write(s)}for(var a=0,i=0;i<n.length;i++)a+=n[i].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(je.PAD0,8),s.getLengthInBits()>=a*8));)s.put(je.PAD1,8);return je.createBytes(s,n)};je.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var l=t[a].dataCount,c=t[a].totalCount-l;n=Math.max(n,l),s=Math.max(s,c),i[a]=new Array(l);for(var d=0;d<i[a].length;d++)i[a][d]=255&e.buffer[d+r];r+=l;var u=K.getErrorCorrectPolynomial(c),h=new Lt(i[a],u.getLength()-1),f=h.mod(u);o[a]=new Array(u.getLength()-1);for(var d=0;d<o[a].length;d++){var p=d+f.getLength()-o[a].length;o[a][d]=p>=0?f.get(p):0}}for(var y=0,d=0;d<t.length;d++)y+=t[d].totalCount;for(var g=new Array(y),b=0,d=0;d<n;d++)for(var a=0;a<t.length;a++)d<i[a].length&&(g[b++]=i[a][d]);for(var d=0;d<s;d++)for(var a=0;a<t.length;a++)d<o[a].length&&(g[b++]=o[a][d]);return g};var ye={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Xe={L:1,M:0,Q:3,H:2},Ze={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},K={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(e<<10|t)^K.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return K.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ze.PATTERN000:return(t+r)%2==0;case Ze.PATTERN001:return t%2==0;case Ze.PATTERN010:return r%3==0;case Ze.PATTERN011:return(t+r)%3==0;case Ze.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ze.PATTERN101:return t*r%2+t*r%3==0;case Ze.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ze.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Lt([1],0),r=0;r<e;r++)t=t.multiply(new Lt([1,oe.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ye.MODE_NUMBER:return 10;case ye.MODE_ALPHA_NUM:return 9;case ye.MODE_8BIT_BYTE:return 8;case ye.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ye.MODE_NUMBER:return 12;case ye.MODE_ALPHA_NUM:return 11;case ye.MODE_8BIT_BYTE:return 16;case ye.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ye.MODE_NUMBER:return 14;case ye.MODE_ALPHA_NUM:return 13;case ye.MODE_8BIT_BYTE:return 16;case ye.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var l=-1;l<=1;l++)s+l<0||t<=s+l||a==0&&l==0||o==e.isDark(n+a,s+l)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var c=0;e.isDark(n,s)&&c++,e.isDark(n+1,s)&&c++,e.isDark(n,s+1)&&c++,e.isDark(n+1,s+1)&&c++,(c==0||c==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var d=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&d++;var u=Math.abs(100*d/t/t-50)/5;return r+=u*10,r}},oe={glog:function(e){if(e<1)throw new Error("glog("+e+")");return oe.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return oe.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ce=0;ce<8;ce++)oe.EXP_TABLE[ce]=1<<ce;for(var ce=8;ce<256;ce++)oe.EXP_TABLE[ce]=oe.EXP_TABLE[ce-4]^oe.EXP_TABLE[ce-5]^oe.EXP_TABLE[ce-6]^oe.EXP_TABLE[ce-8];for(var ce=0;ce<255;ce++)oe.LOG_TABLE[oe.EXP_TABLE[ce]]=ce;function Lt(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Lt.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=oe.gexp(oe.glog(this.get(r))+oe.glog(e.get(n)));return new Lt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=oe.glog(this.get(0))-oe.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=oe.gexp(oe.glog(e.get(n))+t);return new Lt(r,0).mod(e)}};function Fe(e,t){this.totalCount=e,this.dataCount=t}Fe.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Fe.getRSBlocks=function(e,t){var r=Fe.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var o=r[i*3+0],a=r[i*3+1],l=r[i*3+2],c=0;c<o;c++)s.push(new Fe(a,l));return s};Fe.getRsBlockTable=function(e,t){switch(t){case Xe.L:return Fe.RS_BLOCK_TABLE[(e-1)*4+0];case Xe.M:return Fe.RS_BLOCK_TABLE[(e-1)*4+1];case Xe.Q:return Fe.RS_BLOCK_TABLE[(e-1)*4+2];case Xe.H:return Fe.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Qc(){this.buffer=[],this.length=0}Qc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Qs=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Kc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(l){switch(l){case"L":return Xe.L;case"M":return Xe.M;case"Q":return Xe.Q;case"H":return Xe.H;default:throw new Error("Unknwon error correction level: "+l)}}function n(l,c){for(var d=s(l),u=1,h=0,f=0,p=Qs.length;f<=p;f++){var y=Qs[f];if(!y)throw new Error("Content too long: expected "+h+" but got "+d);switch(c){case"L":h=y[0];break;case"M":h=y[1];break;case"Q":h=y[2];break;case"H":h=y[3];break;default:throw new Error("Unknwon error correction level: "+c)}if(d<=h)break;u++}if(u>Qs.length)throw new Error("Content too long");return u}function s(l){var c=encodeURI(l).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return c.length+(c.length!=l?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new je(o,a),this.qrcode.addData(i),this.qrcode.make()}Kc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
2
- `:"",o=t.width,a=t.height,l=r.length,c=o/(l+2*t.padding),d=a/(l+2*t.padding),u=typeof t.join<"u"?!!t.join:!1,h=typeof t.swap<"u"?!!t.swap:!1,f=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,p=typeof t.predefined<"u"?!!t.predefined:!1,y=p?s+'<defs><path id="qrmodule" d="M0 0 h'+d+" v"+c+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",g=s+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,b="",_="",m=0;m<l;m++)for(var M=0;M<l;M++){var w=r[M][m];if(w){var N=M*c+t.padding*c,U=m*d+t.padding*d;if(h){var G=N;N=U,U=G}if(u){var V=c+N,z=d+U;N=Number.isInteger(N)?Number(N):N.toFixed(2),U=Number.isInteger(U)?Number(U):U.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),z=Number.isInteger(z)?Number(z):z.toFixed(2),_+="M"+N+","+U+" V"+z+" H"+V+" V"+U+" H"+N+" Z "}else p?b+=s+'<use x="'+N.toString()+'" y="'+U.toString()+'" href="#qrmodule" />'+i:b+=s+'<rect x="'+N.toString()+'" y="'+U.toString()+'" width="'+c+'" height="'+d+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}u&&(b=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+_+'" />');let he="";if(this.options.image!==void 0&&this.options.image.svg){const E=o*this.options.image.width/100,v=a*this.options.image.height/100,R=o/2-E/2,k=a/2-v/2;he+=`<svg x="${R}" y="${k}" width="${E}" height="${v}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,he+=this.options.image.svg+i,he+="</svg>"}var ee="";switch(e.container){case"svg":f&&(ee+='<?xml version="1.0" standalone="yes"?>'+i),ee+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,ee+=y+g+b,ee+=he,ee+="</svg>";break;case"svg-viewbox":f&&(ee+='<?xml version="1.0" standalone="yes"?>'+i),ee+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,ee+=y+g+b,ee+=he,ee+="</svg>";break;case"g":ee+='<g width="'+o+'" height="'+a+'">'+i,ee+=y+g+b,ee+=he,ee+="</g>";break;default:ee+=(y+g+b+he).replace(/^\s+/,"");break}return ee};var Qd=Kc,Kd=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.QRCode=void 0;const Xd=me,da=yn,Yd=Kd(Qd),eh=e=>{const[t,r]=(0,da.useState)("");return(0,da.useEffect)(()=>{var n,s;const i=new Yd.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),o=$.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Xd.h)("img",{src:t,alt:"QR Code"}):null};Sn.QRCode=eh;var Cn={},Ui={};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.default=(()=>".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}")();var th=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.Spinner=void 0;const Fr=me,rh=th(Ui),nh=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Fr.h)("div",{class:"-cbwsdk-spinner"},(0,Fr.h)("style",null,rh.default),(0,Fr.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Fr.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Cn.Spinner=nh;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}")();var Xc=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jt,"__esModule",{value:!0});jt.CoinbaseWalletSteps=jt.ConnectContent=void 0;const ht=Xc(ur),j=me,sh=S,ih=Wt,oh=wn,ah=vn,ch=En,lh=Sn,uh=Cn,dh=Xc(Vi),Ks={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Yc},hh=e=>e==="light"?"#FFFFFF":"#0A0B0D";function fh(e){const{theme:t}=e,r=(0,sh.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Ks.steps;return(0,j.h)("div",{"data-testid":"connect-content",className:(0,ht.default)("-cbwsdk-connect-content",t)},(0,j.h)("style",null,dh.default),(0,j.h)("div",{className:"-cbwsdk-connect-content-header"},(0,j.h)("h2",{className:(0,ht.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,j.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,j.h)(oh.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,j.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,j.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,j.h)(ph,{title:Ks.title,description:Ks.description,theme:t})),(0,j.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,j.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,j.h)(lh.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,j.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:ih.LIB_VERSION}),(0,j.h)("input",{type:"hidden",value:r})),(0,j.h)(n,{theme:t}),!e.isConnected&&(0,j.h)("div",{"data-testid":"connecting-spinner",className:(0,ht.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,j.h)(uh.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,j.h)("p",null,"Connecting...")))))}jt.ConnectContent=fh;function ph({title:e,description:t,theme:r}){return(0,j.h)("div",{className:(0,ht.default)("-cbwsdk-connect-item",r)},(0,j.h)("div",null,(0,j.h)(ah.CoinbaseWalletRound,null)),(0,j.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,j.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,j.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Yc({theme:e}){return(0,j.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,j.h)("li",{className:(0,ht.default)("-cbwsdk-wallet-steps-item",e)},(0,j.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,j.h)("li",{className:(0,ht.default)("-cbwsdk-wallet-steps-item",e)},(0,j.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,j.h)("span",null,"Tap ",(0,j.h)("strong",null,"Scan")," "),(0,j.h)("span",{className:(0,ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,j.h)(ch.QRCodeIcon,{fill:hh(e)})))))}jt.CoinbaseWalletSteps=Yc;var kn={},Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.ArrowLeftIcon=void 0;const ha=me;function gh(e){return(0,ha.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,ha.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Rn.ArrowLeftIcon=gh;var In={};Object.defineProperty(In,"__esModule",{value:!0});In.LaptopIcon=void 0;const Xs=me;function mh(e){return(0,Xs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Xs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Xs.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}In.LaptopIcon=mh;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.SafeIcon=void 0;const fa=me;function _h(e){return(0,fa.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,fa.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}An.SafeIcon=_h;var Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.default=(()=>".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}")();var el=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kn,"__esModule",{value:!0});kn.TryExtensionContent=void 0;const tt=el(ur),re=me,Ys=yn,bh=Rn,yh=In,wh=An,vh=el(Wi);function Eh({theme:e}){const[t,r]=(0,Ys.useState)(!1),n=(0,Ys.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,Ys.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,re.h)("div",{class:(0,tt.default)("-cbwsdk-try-extension",e)},(0,re.h)("style",null,vh.default),(0,re.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,re.h)("h3",{class:(0,tt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,re.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,re.h)("button",{class:(0,tt.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,re.h)("div",null,!t&&(0,re.h)(bh.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,re.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,re.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,re.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,re.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,re.h)("span",{class:(0,tt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,re.h)(yh.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,re.h)("div",{class:(0,tt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,re.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,re.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,re.h)("span",{class:(0,tt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,re.h)(wh.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,re.h)("div",{class:(0,tt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}kn.TryExtensionContent=Eh;var zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}")();var tl=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});bn.ConnectDialog=void 0;const ei=tl(ur),rt=me,ti=yn,Sh=jt,Ch=kn,kh=tl(zi),Rh=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,ti.useState)(!t),[i,o]=(0,ti.useState)(!t);(0,ti.useEffect)(()=>{const l=[window.setTimeout(()=>{o(!t)},10)];return t?s(!1):l.push(window.setTimeout(()=>{s(!0)},360)),()=>{l.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,rt.h)("div",{class:(0,ei.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,rt.h)("style",null,kh.default),(0,rt.h)("div",{class:(0,ei.default)("-cbwsdk-connect-dialog-backdrop",a,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,rt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,rt.h)("div",{class:(0,ei.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,rt.h)(Sh.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,rt.h)(Ch.TryExtensionContent,{theme:a}))))};bn.ConnectDialog=Rh;Object.defineProperty(mn,"__esModule",{value:!0});mn.LinkFlow=void 0;const ri=me,Ih=bn;class Ah{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,ri.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,ri.render)((0,ri.h)(Ih.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}mn.LinkFlow=Ah;var qi={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.default=(()=>".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}")();(function(e){var t=A&&A.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(ur),n=me,s=yn,i=t(Ji),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class l{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const f=this.nextItemKey++;return this.items.set(f,h),this.render(),()=>{this.items.delete(f),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,f])=>(0,n.h)(e.SnackbarInstance,Object.assign({},f,{key:h}))))),this.root)}}e.Snackbar=l;const c=u=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},u.children));e.SnackbarContainer=c;const d=({autoExpand:u,message:h,menuItems:f})=>{const[p,y]=(0,s.useState)(!0),[g,b]=(0,s.useState)(u??!1);(0,s.useEffect)(()=>{const m=[window.setTimeout(()=>{y(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{m.forEach(window.clearTimeout)}});const _=()=>{b(!g)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",p&&"-cbwsdk-snackbar-instance-hidden",g&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:_},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!g&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),f&&f.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},f.map((m,M)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:m.onClick,key:M},(0,n.h)("svg",{width:m.svgWidth,height:m.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":m.defaultFillRule,"clip-rule":m.defaultClipRule,d:m.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},m.info)))))};e.SnackbarInstance=d})(qi);Object.defineProperty(_r,"__esModule",{value:!0});_r.WalletLinkRelayUI=void 0;const Nh=br,Lh=mn,Th=qi;class Mh{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new Th.Snackbar({darkMode:t.darkMode}),this.linkFlow=new Lh.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,Nh.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}_r.WalletLinkRelayUI=Mh;Object.defineProperty(mr,"__esModule",{value:!0});mr.WalletLinkRelay=void 0;const Ct=dr,Ph=ne,Q=S,nt=zt,pa=Ce,Qe=qt,Oh=fn,st=Vt,$h=_r;class Ve extends pa.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const l=this.storage.getItem(pa.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,l){const c=l.split(" "),d=this.storage.getItem("IsStandaloneSigning")==="true";if(c[0]!==""&&!o&&this.session.linked&&!d){this.isUnlinkedErrorState=!0;const u=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(nt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),Ve.accountRequestCallbackIds.size>0&&(Array.from(Ve.accountRequestCallbackIds.values()).forEach(a=>{const l={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},l),{id:a}))}),Ve.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=Qe.Session.load(this.storage)||new Qe.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new Oh.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:o,session:t});return s.connect(),{session:t,ui:a,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(nt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=Qe.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(nt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Qe.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:o,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(nt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Q.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Q.hexStringFromBuffer)(t,!0),signature:(0,Q.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Q.bigIntStringFromBN)(t.weiValue),data:(0,Q.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Q.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Q.bigIntStringFromBN)(t.weiValue),data:(0,Q.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Q.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Q.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Q.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Q.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Q.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Q.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,l=>{if(r==null||r(),(0,st.isErrorResponse)(l))return a(new Error(l.errorMessage));o(l)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof $h.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=Qe.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(nt.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Qe.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(nt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Qe.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(nt.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ve.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),Ve.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const o=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,Ct.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Q.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,st.isErrorResponse)(a))return o(new Error(a.errorMessage));i(a)}),this.ui.inlineAccountsResponse()){const a=l=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:l}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=Ct.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}Ve.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Q.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},i=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,d=>{if((0,st.isErrorResponse)(d))return a(new Error(d.errorMessage));o(d)});const l=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Ph.ProviderType.Unselected}})},c=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:d}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:c,onCancel:l,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:o}};let l=null;const c=(0,Q.randomBytesHex)(8),d=h=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,h),l==null||l()};this.ui.inlineWatchAsset()||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));const u=new Promise((h,f)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,st.isErrorResponse)(g))return f(new Error(g.errorMessage));h(g)});const p=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"watchAsset",result:!1}})},y=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:y,onCancel:p,type:t,address:r,symbol:n,decimals:s,image:i,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(c,a)});return{cancel:d,promise:u}}addEthereumChain(t,r,n,s,i,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let l=null;const c=(0,Q.randomBytesHex)(8),d=h=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,h),l==null||l()};return this.ui.inlineAddEthereumChain(t)||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{promise:new Promise((h,f)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,st.isErrorResponse)(g))return f(new Error(g.errorMessage));h(g)});const p=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},y=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:g}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:p,onApprove:y,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(c,a)}),cancel:d}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a)};return{promise:new Promise((a,l)=>{this.relayEventManager.callbacks.set(s,u=>{if((0,st.isErrorResponse)(u)&&u.errorCode)return l(Ct.standardErrors.provider.custom({code:u.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,st.isErrorResponse)(u))return l(new Error(u.errorMessage));a(u)});const c=u=>{var h;if(u){const f=(h=(0,Ct.getErrorCode)(u))!==null&&h!==void 0?h:Ct.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",u instanceof Error?u:Ct.standardErrors.provider.unsupportedChain(t),f)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},d=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:u}}})};this.ui.switchEthereumChain({onCancel:c,onApprove:d,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Qe.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}mr.WalletLinkRelay=Ve;Ve.accountRequestCallbackIds=new Set;var vr={},Nn={},rl={};(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(qi,e)})(rl);var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.default=(()=>".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}")();var nl=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.RedirectDialog=void 0;const xh=nl(ur),xe=me,Fh=br,jh=rl,Bh=nl(Gi);class Dh{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Fh.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,xe.render)(null,this.root),t&&(0,xe.render)((0,xe.h)(Hh,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Nn.RedirectDialog=Dh;const Hh=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,xe.h)(jh.SnackbarContainer,{darkMode:r},(0,xe.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,xe.h)("style",null,Bh.default),(0,xe.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,xe.h)("div",{class:(0,xh.default)("-cbwsdk-redirect-dialog-box",i)},(0,xe.h)("p",null,e),(0,xe.h)("button",{onClick:n},t))))};Object.defineProperty(vr,"__esModule",{value:!0});vr.MobileRelayUI=void 0;const Uh=Nn;class Vh{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Uh.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}vr.MobileRelayUI=Vh;Object.defineProperty(gr,"__esModule",{value:!0});gr.MobileRelay=void 0;const Wh=S,zh=mr,qh=vr;class Jh extends zh.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Wh.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof qh.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}gr.MobileRelay=Jh;const{Transform:Gh}=mc;var Zh=e=>class sl extends Gh{constructor(r,n,s,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!$.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return $.isBuffer(r)||(r=$.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new sl(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Qh}=mc;var Kh=e=>class il extends Qh{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!$.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return $.isBuffer(r)||(r=$.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new il(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Xh=Zh,Yh=Kh;var ef=function(e){const t=Xh(e),r=Yh(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},ol={};const ga=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];ol.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],u=e[9]^e[19]^e[29]^e[39]^e[49];let h=d^(s<<1|i>>>31),f=u^(i<<1|s>>>31);const p=e[0]^h,y=e[1]^f,g=e[10]^h,b=e[11]^f,_=e[20]^h,m=e[21]^f,M=e[30]^h,w=e[31]^f,N=e[40]^h,U=e[41]^f;h=r^(o<<1|a>>>31),f=n^(a<<1|o>>>31);const G=e[2]^h,V=e[3]^f,z=e[12]^h,he=e[13]^f,ee=e[22]^h,E=e[23]^f,v=e[32]^h,R=e[33]^f,k=e[42]^h,I=e[43]^f;h=s^(l<<1|c>>>31),f=i^(c<<1|l>>>31);const C=e[4]^h,T=e[5]^f,H=e[14]^h,O=e[15]^f,q=e[24]^h,ue=e[25]^f,Z=e[34]^h,Ge=e[35]^f,Xn=e[44]^h,So=e[45]^f;h=o^(d<<1|u>>>31),f=a^(u<<1|d>>>31);const Co=e[6]^h,ko=e[7]^f,Ro=e[16]^h,Io=e[17]^f,Ao=e[26]^h,No=e[27]^f,Lo=e[36]^h,To=e[37]^f,Mo=e[46]^h,Po=e[47]^f;h=l^(r<<1|n>>>31),f=c^(n<<1|r>>>31);const Oo=e[8]^h,$o=e[9]^f,xo=e[18]^h,Fo=e[19]^f,jo=e[28]^h,Bo=e[29]^f,Do=e[38]^h,Ho=e[39]^f,Uo=e[48]^h,Vo=e[49]^f,Yn=p,es=y,ts=b<<4|g>>>28,rs=g<<4|b>>>28,ns=_<<3|m>>>29,ss=m<<3|_>>>29,is=w<<9|M>>>23,os=M<<9|w>>>23,as=N<<18|U>>>14,cs=U<<18|N>>>14,ls=G<<1|V>>>31,us=V<<1|G>>>31,ds=he<<12|z>>>20,hs=z<<12|he>>>20,fs=ee<<10|E>>>22,ps=E<<10|ee>>>22,gs=R<<13|v>>>19,ms=v<<13|R>>>19,_s=k<<2|I>>>30,bs=I<<2|k>>>30,ys=T<<30|C>>>2,ws=C<<30|T>>>2,vs=H<<6|O>>>26,Es=O<<6|H>>>26,Ss=ue<<11|q>>>21,Cs=q<<11|ue>>>21,ks=Z<<15|Ge>>>17,Rs=Ge<<15|Z>>>17,Is=So<<29|Xn>>>3,As=Xn<<29|So>>>3,Ns=Co<<28|ko>>>4,Ls=ko<<28|Co>>>4,Ts=Io<<23|Ro>>>9,Ms=Ro<<23|Io>>>9,Ps=Ao<<25|No>>>7,Os=No<<25|Ao>>>7,$s=Lo<<21|To>>>11,xs=To<<21|Lo>>>11,Fs=Po<<24|Mo>>>8,js=Mo<<24|Po>>>8,Bs=Oo<<27|$o>>>5,Ds=$o<<27|Oo>>>5,Hs=xo<<20|Fo>>>12,Us=Fo<<20|xo>>>12,Vs=Bo<<7|jo>>>25,Ws=jo<<7|Bo>>>25,zs=Do<<8|Ho>>>24,qs=Ho<<8|Do>>>24,Js=Uo<<14|Vo>>>18,Gs=Vo<<14|Uo>>>18;e[0]=Yn^~ds&Ss,e[1]=es^~hs&Cs,e[10]=Ns^~Hs&ns,e[11]=Ls^~Us&ss,e[20]=ls^~vs&Ps,e[21]=us^~Es&Os,e[30]=Bs^~ts&fs,e[31]=Ds^~rs&ps,e[40]=ys^~Ts&Vs,e[41]=ws^~Ms&Ws,e[2]=ds^~Ss&$s,e[3]=hs^~Cs&xs,e[12]=Hs^~ns&gs,e[13]=Us^~ss&ms,e[22]=vs^~Ps&zs,e[23]=Es^~Os&qs,e[32]=ts^~fs&ks,e[33]=rs^~ps&Rs,e[42]=Ts^~Vs&is,e[43]=Ms^~Ws&os,e[4]=Ss^~$s&Js,e[5]=Cs^~xs&Gs,e[14]=ns^~gs&Is,e[15]=ss^~ms&As,e[24]=Ps^~zs&as,e[25]=Os^~qs&cs,e[34]=fs^~ks&Fs,e[35]=ps^~Rs&js,e[44]=Vs^~is&_s,e[45]=Ws^~os&bs,e[6]=$s^~Js&Yn,e[7]=xs^~Gs&es,e[16]=gs^~Is&Ns,e[17]=ms^~As&Ls,e[26]=zs^~as&ls,e[27]=qs^~cs&us,e[36]=ks^~Fs&Bs,e[37]=Rs^~js&Ds,e[46]=is^~_s&ys,e[47]=os^~bs&ws,e[8]=Js^~Yn&ds,e[9]=Gs^~es&hs,e[18]=Is^~Ns&Hs,e[19]=As^~Ls&Us,e[28]=as^~ls&vs,e[29]=cs^~us&Es,e[38]=Fs^~Bs&ts,e[39]=js^~Ds&rs,e[48]=_s^~ys&Ts,e[49]=bs^~ws&Ms,e[0]^=ga[t*2],e[1]^=ga[t*2+1]}};const Kr=ol;function Jt(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Jt.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Jt.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Kr.p1600(this.state),this.count=0)};Jt.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Kr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Kr.p1600(this.state),this.count=0,this.squeezing=!0};Jt.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=$.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Kr.p1600(this.state),this.count=0);return t};Jt.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var tf=Jt,rf=ef(tf);const nf=rf,sf=nn;function al(e){return $.allocUnsafe(e).fill(0)}function cl(e,t,r){const n=al(t);return e=Ln(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function of(e,t){return cl(e,t,!0)}function Ln(e){if(!$.isBuffer(e))if(Array.isArray(e))e=$.from(e);else if(typeof e=="string")ll(e)?e=$.from(lf(ul(e)),"hex"):e=$.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=$.allocUnsafe(0);else if(sf.isBN(e))e=e.toArrayLike($);else if(e.toArray)e=$.from(e.toArray());else throw new Error("invalid type");return e}function af(e){return e=Ln(e),"0x"+e.toString("hex")}function cf(e,t){return e=Ln(e),t||(t=256),nf("keccak"+t).update(e).digest()}function lf(e){return e.length%2?"0"+e:e}function ll(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function ul(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var dl={zeros:al,setLength:cl,setLengthRight:of,isHexString:ll,stripHexPrefix:ul,toBuffer:Ln,bufferToHex:af,keccak:cf};const pt=dl,lt=nn;function hl(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Tt(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function ma(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function fl(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function ot(e){var t=typeof e;if(t==="string")return pt.isHexString(e)?new lt(pt.stripHexPrefix(e),16):new lt(e,10);if(t==="number")return new lt(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function $e(e,t){var r,n,s,i;if(e==="address")return $e("uint160",ot(t));if(e==="bool")return $e("uint8",t?1:0);if(e==="string")return $e("bytes",new $(t,"utf8"));if(df(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=fl(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push($e(e,t[i]));if(r==="dynamic"){var o=$e("uint256",t.length);s.unshift(o)}return $.concat(s)}else{if(e==="bytes")return t=new $(t),s=$.concat([$e("uint256",t.length),t]),t.length%32!==0&&(s=$.concat([s,pt.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=Tt(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return pt.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Tt(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=ot(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike($,"be",32)}else if(e.startsWith("int")){if(r=Tt(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=ot(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike($,"be",32)}else if(e.startsWith("ufixed")){if(r=ma(e),n=ot(t),n<0)throw new Error("Supplied ufixed is negative");return $e("uint256",n.mul(new lt(2).pow(new lt(r[1]))))}else if(e.startsWith("fixed"))return r=ma(e),$e("int256",ot(t).mul(new lt(2).pow(new lt(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function uf(e){return e==="string"||e==="bytes"||fl(e)==="dynamic"}function df(e){return e.lastIndexOf("]")===e.length-1}function hf(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var o=hl(e[i]),a=t[i],l=$e(o,a);uf(o)?(r.push($e("uint256",s)),n.push(l),s+=l.length):r.push(l)}return $.concat(r.concat(n))}function pl(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i<e.length;i++){var o=hl(e[i]),a=t[i];if(o==="bytes")s.push(a);else if(o==="string")s.push(new $(a,"utf8"));else if(o==="bool")s.push(new $(a?"01":"00","hex"));else if(o==="address")s.push(pt.setLength(a,20));else if(o.startsWith("bytes")){if(r=Tt(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(pt.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Tt(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=ot(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike($,"be",r/8))}else if(o.startsWith("int")){if(r=Tt(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=ot(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike($,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return $.concat(s)}function ff(e,t){return pt.keccak(pl(e,t))}var pf={rawEncode:hf,solidityPack:pl,soliditySHA3:ff};const Ae=dl,sr=pf,gl={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"]},ni={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const o=(a,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Ae.keccak(this.encodeData(l,c,r,n))];if(c===void 0)throw new Error(`missing value for field ${a} of type ${l}`);if(l==="bytes")return["bytes32",Ae.keccak(c)];if(l==="string")return typeof c=="string"&&(c=$.from(c,"utf8")),["bytes32",Ae.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const d=l.slice(0,l.lastIndexOf("[")),u=c.map(h=>o(a,d,h));return["bytes32",Ae.keccak(sr.rawEncode(u.map(([h])=>h),u.map(([,h])=>h)))]}return[l,c]};for(const a of r[e]){const[l,c]=o(a.name,a.type,t[a.name]);s.push(l),i.push(c)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")s.push("bytes32"),a=Ae.keccak(a),i.push(a);else if(o.type==="string")s.push("bytes32"),typeof a=="string"&&(a=$.from(a,"utf8")),a=Ae.keccak(a),i.push(a);else if(r[o.type]!==void 0)s.push("bytes32"),a=Ae.keccak(this.encodeData(o.type,a,r,n)),i.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(o.type),i.push(a)}}return sr.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return Ae.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Ae.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in gl.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[$.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Ae.keccak($.concat(n))}};var gf={TYPED_MESSAGE_SCHEMA:gl,TypedDataUtils:ni,hashForSignTypedDataLegacy:function(e){return mf(e.data)},hashForSignTypedData_v3:function(e){return ni.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return ni.hash(e.data)}};function mf(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?Ae.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return sr.soliditySHA3(["bytes32","bytes32"],[sr.soliditySHA3(new Array(e.length).fill("string"),s),sr.soliditySHA3(n,r)])}var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.filterFromParam=Bt.FilterPolyfill=void 0;const At=ne,fe=S,_f=5*60*1e3,at={jsonrpc:"2.0",id:0};class bf{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,At.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=ml(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,fe.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,fe.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,fe.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,fe.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,fe.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(jr())}async getFilterLogs(t){const r=(0,fe.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},at),{method:"eth_getLogs",params:[_a(n)]})):jr()}makeFilterId(){return(0,At.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return jr();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Br();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},at),{method:"eth_getLogs",params:[_a(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const a=o.result.map(c=>(0,fe.intNumberFromHexString)(c.blockNumber||"0x0")),l=Math.max(...a);if(l&&l>n){const c=(0,At.IntNumber)(l+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${c}`),this.cursors.set(t,c)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return jr();const n=await this.getCurrentBlockHeight();if(r>n)return Br();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,fe.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,At.IntNumber)(o))))).filter(o=>!!o),i=(0,At.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},at),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Br())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},_f);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},at),{method:"eth_blockNumber",params:[]}));return(0,fe.intNumberFromHexString)((0,fe.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},at),{method:"eth_getBlockByNumber",params:[(0,fe.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,fe.ensureHexString)(r.result.hash):null}}Bt.FilterPolyfill=bf;function ml(e){return{fromBlock:ba(e.fromBlock),toBlock:ba(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Bt.filterFromParam=ml;function _a(e){const t={fromBlock:ya(e.fromBlock),toBlock:ya(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function ba(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,At.IntNumber)(0);if((0,fe.isHexString)(e))return(0,fe.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function ya(e){return e==="latest"?e:(0,fe.hexStringFromIntNumber)(e)}function jr(){return Object.assign(Object.assign({},at),{error:{code:-32e3,message:"filter not found"}})}function Br(){return Object.assign(Object.assign({},at),{result:[]})}var Tn={},_l={},Mn={},Zi=yf;function yf(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const wa=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s<arguments.length;s++)n[s]=arguments[s];return new r((s,i)=>{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const l=new Array(arguments.length-1);for(let c=1;c<arguments.length;c++)l[c-1]=arguments[c];o?(l.unshift(o),i(l)):s(l)}else o?i(o):s(a)}):n.push(function(o){if(t.multiArgs){const a=new Array(arguments.length-1);for(let l=0;l<arguments.length;l++)a[l]=arguments[l];s(a)}else s(o)}),e.apply(this,n)})};var wf=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=o=>typeof o=="string"?s===o:o.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):wa(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?wa(i,t):i}return n},Er={},Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});const vf=_c;function va(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Ef(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Sf=class extends vf.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")va(i,this,r);else{const o=i.length,a=Ef(i);for(let l=0;l<o;l+=1)va(a[l],this,r)}return!0}};Sr.default=Sf;var Cf=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Er,"__esModule",{value:!0});Er.BaseBlockTracker=void 0;const kf=Cf(Sr),Rf=1e3,If=(e,t)=>e+t,Ea=["sync","latest"];class Af extends kf.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Rf,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Ea.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Ea.map(t=>this.listenerCount(t)).reduce(If)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Sa(t),s=Sa(r);return this._usePastBlocks&&n<s||n>s}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Er.BaseBlockTracker=Af;function Sa(e){return Number.parseInt(e,16)}var bl={},yl={},le={};class wl extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...o}=t,{path:a}=t,l=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??l),i!=null&&(this.cause=l),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Nf(e){return Re(e)&&typeof e[Symbol.iterator]=="function"}function Re(e){return typeof e=="object"&&e!=null}function Ca(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function se(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Lf(e){const{done:t,value:r}=e.next();return t?void 0:r}function Tf(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:l=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${se(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:l}}function*Ri(e,t,r,n){Nf(e)||(e=[e]);for(const s of e){const i=Tf(s,t,r,n);i&&(yield i)}}function*Qi(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:o=!1}=r,a={path:n,branch:s};if(i&&(e=t.coercer(e,a),o&&t.type!=="type"&&Re(t.schema)&&Re(e)&&!Array.isArray(e)))for(const c in e)t.schema[c]===void 0&&delete e[c];let l="valid";for(const c of t.validator(e,a))c.explanation=r.message,l="not_valid",yield[c,void 0];for(let[c,d,u]of t.entries(e,a)){const h=Qi(d,u,{path:c===void 0?n:[...n,c],branch:c===void 0?s:[...s,d],coerce:i,mask:o,message:r.message});for(const f of h)f[0]?(l=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):i&&(d=f[1],c===void 0?e=d:e instanceof Map?e.set(c,d):e instanceof Set?e.add(d):Re(e)&&(d!==void 0||c in e)&&(e[c]=d))}if(l!=="not_valid")for(const c of t.refiner(e,a))c.explanation=r.message,l="not_refined",yield[c,void 0];l==="valid"&&(yield[void 0,e])}class te{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:o=l=>l,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,s?this.validator=(l,c)=>{const d=s(l,c);return Ri(d,c,this,l)}:this.validator=()=>[],i?this.refiner=(l,c)=>{const d=i(l,c);return Ri(d,c,this,l)}:this.refiner=()=>[]}assert(t,r){return vl(t,this,r)}create(t,r){return El(t,this,r)}is(t){return Ki(t,this)}mask(t,r){return Sl(t,this,r)}validate(t,r={}){return Gt(t,this,r)}}function vl(e,t,r){const n=Gt(e,t,{message:r});if(n[0])throw n[0]}function El(e,t,r){const n=Gt(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Sl(e,t,r){const n=Gt(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Ki(e,t){return!Gt(e,t)[0]}function Gt(e,t,r={}){const n=Qi(e,t,r),s=Lf(n);return s[0]?[new wl(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function Mf(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?kr(n):Cr(n)}function _e(e,t){return new te({type:e,schema:null,validator:t})}function Pf(e,t){return new te({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function Of(e){return new te({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function $f(e){let t;return new te({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function xf(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return kr(n);default:return Cr(n)}}function Ff(e){const t=e instanceof te,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Cl(r[n]);return t&&e.type==="type"?kr(r):Cr(r)}function jf(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return kr(n);default:return Cr(n)}}function Bf(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),_e(e,t)}function Df(){return _e("any",()=>!0)}function Hf(e){return new te({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${se(t)}`}})}function Uf(){return _e("bigint",e=>typeof e=="bigint")}function Vf(){return _e("boolean",e=>typeof e=="boolean")}function Wf(){return _e("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${se(e)}`)}function zf(e){const t={},r=e.map(n=>se(n)).join();for(const n of e)t[n]=n;return new te({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${se(n)}`}})}function qf(){return _e("func",e=>typeof e=="function"||`Expected a function, but received: ${se(e)}`)}function Jf(e){return _e("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${se(t)}`)}function Gf(){return _e("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${se(e)}`)}function Zf(e){return new te({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function Qf(e){const t=se(e),r=typeof e;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${se(n)}`}})}function Kf(e,t){return new te({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${se(r)}`}})}function Xi(){return _e("never",()=>!1)}function Xf(e){return new te({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Yf(){return _e("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${se(e)}`)}function Cr(e){const t=e?Object.keys(e):[],r=Xi();return new te({type:"object",schema:e||null,*entries(n){if(e&&Re(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return Re(n)||`Expected an object, but received: ${se(n)}`},coercer(n){return Re(n)?{...n}:n}})}function Cl(e){return new te({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function e0(e,t){return new te({type:"record",schema:null,*entries(r){if(Re(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return Re(r)||`Expected an object, but received: ${se(r)}`}})}function t0(){return _e("regexp",e=>e instanceof RegExp)}function r0(e){return new te({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${se(t)}`}})}function kl(){return _e("string",e=>typeof e=="string"||`Expected a string, but received: ${se(e)}`)}function n0(e){const t=Xi();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${se(r)}`}})}function kr(e){const t=Object.keys(e);return new te({type:"type",schema:e,*entries(r){if(Re(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return Re(r)||`Expected an object, but received: ${se(r)}`},coercer(r){return Re(r)?{...r}:r}})}function s0(e){const t=e.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...o]=Qi(r,i,n),[a]=o;if(a[0])for(const[l]of o)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${se(r)}`,...s]}})}function Rl(){return _e("unknown",()=>!0)}function Yi(e,t,r){return new te({...e,coercer:(n,s)=>Ki(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function i0(e,t,r={}){return Yi(e,Rl(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&Ca(n)&&Ca(s)){const i={...n};let o=!1;for(const a in s)i[a]===void 0&&(i[a]=s[a],o=!0);if(o)return i}return n})}function o0(e){return Yi(e,kl(),t=>t.trim())}function a0(e){return yt(e,"empty",t=>{const r=Il(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Il(e){return e instanceof Map||e instanceof Set?e.size:e.length}function c0(e,t,r={}){const{exclusive:n}=r;return yt(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function l0(e,t,r={}){const{exclusive:n}=r;return yt(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function u0(e){return yt(e,"nonempty",t=>Il(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function d0(e,t){return yt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function h0(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return yt(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}else{const{length:o}=i;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}})}function yt(e,t,r){return new te({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=Ri(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const f0=Object.freeze(Object.defineProperty({__proto__:null,Struct:te,StructError:wl,any:Df,array:Hf,assert:vl,assign:Mf,bigint:Uf,boolean:Vf,coerce:Yi,create:El,date:Wf,defaulted:i0,define:_e,deprecated:Pf,dynamic:Of,empty:a0,enums:zf,func:qf,instance:Jf,integer:Gf,intersection:Zf,is:Ki,lazy:$f,literal:Qf,map:Kf,mask:Sl,max:c0,min:l0,never:Xi,nonempty:u0,nullable:Xf,number:Yf,object:Cr,omit:xf,optional:Cl,partial:Ff,pattern:d0,pick:jf,record:e0,refine:yt,regexp:t0,set:r0,size:h0,string:kl,struct:Bf,trimmed:o0,tuple:n0,type:kr,union:s0,unknown:Rl,validate:Gt},Symbol.toStringTag,{value:"Module"})),wt=sn(f0);Object.defineProperty(le,"__esModule",{value:!0});le.assertExhaustive=le.assertStruct=le.assert=le.AssertionError=void 0;const p0=wt;function g0(e){return typeof e=="object"&&e!==null&&"message"in e}function m0(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function _0(e){const t=g0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Al(e,t){return m0(e)?new e({message:t}):e({message:t})}class eo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}le.AssertionError=eo;function b0(e,t="Assertion failed.",r=eo){if(!e)throw t instanceof Error?t:Al(r,t)}le.assert=b0;function y0(e,t,r="Assertion failed",n=eo){try{(0,p0.assert)(e,t)}catch(s){throw Al(n,`${r}: ${_0(s)}.`)}}le.assertStruct=y0;function w0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}le.assertExhaustive=w0;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.base64=void 0;const v0=wt,E0=le,S0=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;i==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,E0.assert)(i==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return s?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,v0.pattern)(e,a)};Rr.base64=S0;var B={},Ir={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=wt,r=le;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(c){return(0,t.is)(c,e.HexStruct)}e.isHexString=n;function s(c){return(0,t.is)(c,e.StrictHexStruct)}e.isStrictHexString=s;function i(c){(0,r.assert)(n(c),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(c){(0,r.assert)(s(c),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(c){return c.startsWith("0x")?c:c.startsWith("0X")?`0x${c.substring(2)}`:`0x${c}`}e.add0x=a;function l(c){return c.startsWith("0x")||c.startsWith("0X")?c.substring(2):c}e.remove0x=l})(Ir);Object.defineProperty(B,"__esModule",{value:!0});B.createDataView=B.concatBytes=B.valueToBytes=B.stringToBytes=B.numberToBytes=B.signedBigIntToBytes=B.bigIntToBytes=B.hexToBytes=B.bytesToString=B.bytesToNumber=B.bytesToSignedBigInt=B.bytesToBigInt=B.bytesToHex=B.assertIsBytes=B.isBytes=void 0;const we=le,Ii=Ir,ka=48,Ra=58,Ia=87;function C0(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const k0=C0();function to(e){return e instanceof Uint8Array}B.isBytes=to;function Zt(e){(0,we.assert)(to(e),"Value must be a Uint8Array.")}B.assertIsBytes=Zt;function Nl(e){if(Zt(e),e.length===0)return"0x";const t=k0(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Ii.add0x)(r.join(""))}B.bytesToHex=Nl;function Ll(e){Zt(e);const t=Nl(e);return BigInt(t)}B.bytesToBigInt=Ll;function R0(e){Zt(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}B.bytesToSignedBigInt=R0;function I0(e){Zt(e);const t=Ll(e);return(0,we.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}B.bytesToNumber=I0;function A0(e){return Zt(e),new TextDecoder().decode(e)}B.bytesToString=A0;function Pn(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Ii.assertIsHexString)(e);const r=(0,Ii.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let i=0;i<s.length;i++){const o=n.charCodeAt(i*2),a=n.charCodeAt(i*2+1),l=o-(o<Ra?ka:Ia),c=a-(a<Ra?ka:Ia);s[i]=l*16+c}return s}B.hexToBytes=Pn;function Tl(e){(0,we.assert)(typeof e=="bigint","Value must be a bigint."),(0,we.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Pn(t)}B.bigIntToBytes=Tl;function N0(e,t){(0,we.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function L0(e,t){(0,we.assert)(typeof e=="bigint","Value must be a bigint."),(0,we.assert)(typeof t=="number","Byte length must be a number."),(0,we.assert)(t>0,"Byte length must be greater than 0."),(0,we.assert)(N0(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}B.signedBigIntToBytes=L0;function Ml(e){(0,we.assert)(typeof e=="number","Value must be a number."),(0,we.assert)(e>=0,"Value must be a non-negative number."),(0,we.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Pn(t)}B.numberToBytes=Ml;function Pl(e){return(0,we.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}B.stringToBytes=Pl;function Ol(e){if(typeof e=="bigint")return Tl(e);if(typeof e=="number")return Ml(e);if(typeof e=="string")return e.startsWith("0x")?Pn(e):Pl(e);if(to(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}B.valueToBytes=Ol;function T0(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=Ol(e[s]);t[s]=i,r+=i.length}const n=new Uint8Array(r);for(let s=0,i=0;s<t.length;s++)n.set(t[s],i),i+=t[s].length;return n}B.concatBytes=T0;function M0(e){if(typeof $<"u"&&e instanceof $){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}B.createDataView=M0;var On={};Object.defineProperty(On,"__esModule",{value:!0});On.ChecksumStruct=void 0;const Aa=wt,P0=Rr;On.ChecksumStruct=(0,Aa.size)((0,P0.base64)((0,Aa.string)(),{paddingRequired:!0}),44,44);var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.createHex=Be.createBytes=Be.createBigInt=Be.createNumber=void 0;const Y=wt,O0=le,$l=B,$n=Ir,xl=(0,Y.union)([(0,Y.number)(),(0,Y.bigint)(),(0,Y.string)(),$n.StrictHexStruct]),$0=(0,Y.coerce)((0,Y.number)(),xl,Number),x0=(0,Y.coerce)((0,Y.bigint)(),xl,BigInt);(0,Y.union)([$n.StrictHexStruct,(0,Y.instance)(Uint8Array)]);const F0=(0,Y.coerce)((0,Y.instance)(Uint8Array),(0,Y.union)([$n.StrictHexStruct]),$l.hexToBytes),j0=(0,Y.coerce)($n.StrictHexStruct,(0,Y.instance)(Uint8Array),$l.bytesToHex);function B0(e){try{const t=(0,Y.create)(e,$0);return(0,O0.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Y.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Be.createNumber=B0;function D0(e){try{return(0,Y.create)(e,x0)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Be.createBigInt=D0;function H0(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Y.create)(e,F0)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Be.createBytes=H0;function U0(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Y.create)(e,j0)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Be.createHex=U0;var Dt={},Fl=A&&A.__classPrivateFieldSet||function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},pe=A&&A.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ie,Pe;Object.defineProperty(Dt,"__esModule",{value:!0});Dt.FrozenSet=Dt.FrozenMap=void 0;class ro{constructor(t){Ie.set(this,void 0),Fl(this,Ie,new Map(t),"f"),Object.freeze(this)}get size(){return pe(this,Ie,"f").size}[(Ie=new WeakMap,Symbol.iterator)](){return pe(this,Ie,"f")[Symbol.iterator]()}entries(){return pe(this,Ie,"f").entries()}forEach(t,r){return pe(this,Ie,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return pe(this,Ie,"f").get(t)}has(t){return pe(this,Ie,"f").has(t)}keys(){return pe(this,Ie,"f").keys()}values(){return pe(this,Ie,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Dt.FrozenMap=ro;class no{constructor(t){Pe.set(this,void 0),Fl(this,Pe,new Set(t),"f"),Object.freeze(this)}get size(){return pe(this,Pe,"f").size}[(Pe=new WeakMap,Symbol.iterator)](){return pe(this,Pe,"f")[Symbol.iterator]()}entries(){return pe(this,Pe,"f").entries()}forEach(t,r){return pe(this,Pe,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return pe(this,Pe,"f").has(t)}keys(){return pe(this,Pe,"f").keys()}values(){return pe(this,Pe,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Dt.FrozenSet=no;Object.freeze(ro);Object.freeze(ro.prototype);Object.freeze(no);Object.freeze(no.prototype);var jl={};Object.defineProperty(jl,"__esModule",{value:!0});var Bl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=wt,r=le,n=()=>(0,t.define)("finite number",w=>(0,t.is)(w,(0,t.number)())&&Number.isFinite(w));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(w,N)=>{function U(G,V){const he=[...V.validator(G,N)];return he.length>0?he:!0}try{const G=U(w,e.UnsafeJsonStruct);return G!==!0?G:U(JSON.parse(JSON.stringify(w)),e.UnsafeJsonStruct)}catch(G){return G instanceof RangeError?"Circular reference detected":!1}});function s(w){return(0,t.is)(w,e.JsonStruct)}e.isValidJson=s;function i(w){(0,r.assertStruct)(w,e.JsonStruct,"Invalid JSON value");const N=JSON.stringify(w);return new TextEncoder().encode(N).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(w){return(0,t.is)(w,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(w,N){(0,r.assertStruct)(w,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",N)}e.assertIsJsonRpcNotification=a;function l(w){return(0,t.is)(w,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function c(w,N){(0,r.assertStruct)(w,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",N)}e.assertIsJsonRpcRequest=c,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function d(w){return(0,t.is)(w,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=d;function u(w,N){(0,r.assertStruct)(w,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",N)}e.assertIsPendingJsonRpcResponse=u;function h(w){return(0,t.is)(w,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function f(w,N){(0,r.assertStruct)(w,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",N)}e.assertIsJsonRpcResponse=f;function p(w){return(0,t.is)(w,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=p;function y(w,N){(0,r.assertStruct)(w,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",N)}e.assertIsJsonRpcSuccess=y;function g(w){return(0,t.is)(w,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=g;function b(w,N){(0,r.assertStruct)(w,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",N)}e.assertIsJsonRpcFailure=b;function _(w){return(0,t.is)(w,e.JsonRpcErrorStruct)}e.isJsonRpcError=_;function m(w,N){(0,r.assertStruct)(w,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",N)}e.assertIsJsonRpcError=m;function M(w){const{permitEmptyString:N,permitFractions:U,permitNull:G}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},w);return z=>!!(typeof z=="number"&&(U||Number.isInteger(z))||typeof z=="string"&&(N||z.length>0)||G&&z===null)}e.getJsonRpcIdValidator=M})(Bl);var Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});var Ht={},Ai={exports:{}},si,Na;function V0(){if(Na)return si;Na=1;var e=1e3,t=e*60,r=t*60,n=r*24,s=n*7,i=n*365.25;si=function(d,u){u=u||{};var h=typeof d;if(h==="string"&&d.length>0)return o(d);if(h==="number"&&isFinite(d))return u.long?l(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function o(d){if(d=String(d),!(d.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(u){var h=parseFloat(u[1]),f=(u[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*s;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(d){var u=Math.abs(d);return u>=n?Math.round(d/n)+"d":u>=r?Math.round(d/r)+"h":u>=t?Math.round(d/t)+"m":u>=e?Math.round(d/e)+"s":d+"ms"}function l(d){var u=Math.abs(d);return u>=n?c(d,u,n,"day"):u>=r?c(d,u,r,"hour"):u>=t?c(d,u,t,"minute"):u>=e?c(d,u,e,"second"):d+" ms"}function c(d,u,h,f){var p=u>=h*1.5;return Math.round(d/h)+" "+f+(p?"s":"")}return si}function W0(e){r.debug=r,r.default=r,r.coerce=l,r.disable=i,r.enable=s,r.enabled=o,r.humanize=V0(),r.destroy=c,Object.keys(e).forEach(d=>{r[d]=e[d]}),r.names=[],r.skips=[],r.formatters={};function t(d){let u=0;for(let h=0;h<d.length;h++)u=(u<<5)-u+d.charCodeAt(h),u|=0;return r.colors[Math.abs(u)%r.colors.length]}r.selectColor=t;function r(d){let u,h=null,f,p;function y(...g){if(!y.enabled)return;const b=y,_=Number(new Date),m=_-(u||_);b.diff=m,b.prev=u,b.curr=_,u=_,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let M=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";M++;const G=r.formatters[U];if(typeof G=="function"){const V=g[M];N=G.call(b,V),g.splice(M,1),M--}return N}),r.formatArgs.call(b,g),(b.log||r.log).apply(b,g)}return y.namespace=d,y.useColors=r.useColors(),y.color=r.selectColor(d),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==r.namespaces&&(f=r.namespaces,p=r.enabled(d)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(y),y}function n(d,u){const h=r(this.namespace+(typeof u>"u"?":":u)+d);return h.log=this.log,h}function s(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let u;const h=(typeof d=="string"?d:"").split(/[\s,]+/),f=h.length;for(u=0;u<f;u++)h[u]&&(d=h[u].replace(/\*/g,".*?"),d[0]==="-"?r.skips.push(new RegExp("^"+d.slice(1)+"$")):r.names.push(new RegExp("^"+d+"$")))}function i(){const d=[...r.names.map(a),...r.skips.map(a).map(u=>"-"+u)].join(",");return r.enable(""),d}function o(d){if(d[d.length-1]==="*")return!0;let u,h;for(u=0,h=r.skips.length;u<h;u++)if(r.skips[u].test(d))return!1;for(u=0,h=r.names.length;u<h;u++)if(r.names[u].test(d))return!0;return!1}function a(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function l(d){return d instanceof Error?d.stack||d.message:d}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var z0=W0;(function(e,t){t.formatArgs=n,t.save=s,t.load=i,t.useColors=r,t.storage=o(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let d=0,u=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(d++,h==="%c"&&(u=d))}),l.splice(u,0,c)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function i(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof bi<"u"&&"env"in bi&&(l={}.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=z0(t);const{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(Ai,Ai.exports);var q0=Ai.exports,J0=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.createModuleLogger=Ht.createProjectLogger=void 0;const G0=J0(q0),Z0=(0,G0.default)("metamask");function Q0(e){return Z0.extend(e)}Ht.createProjectLogger=Q0;function K0(e,t){return e.extend(t)}Ht.createModuleLogger=K0;var Hl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(c){return Array.isArray(c)&&c.length>0}e.isNonEmptyArray=t;function r(c){return c==null}e.isNullOrUndefined=r;function n(c){return!!c&&typeof c=="object"&&!Array.isArray(c)}e.isObject=n;const s=(c,d)=>Object.hasOwnProperty.call(c,d);e.hasProperty=s,function(c){c[c.Null=4]="Null",c[c.Comma=1]="Comma",c[c.Wrapper=1]="Wrapper",c[c.True=4]="True",c[c.False=5]="False",c[c.Quote=1]="Quote",c[c.Colon=1]="Colon",c[c.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(c){if(typeof c!="object"||c===null)return!1;try{let d=c;for(;Object.getPrototypeOf(d)!==null;)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(c)===d}catch{return!1}}e.isPlainObject=i;function o(c){return c.charCodeAt(0)<=127}e.isASCII=o;function a(c){var d;return c.split("").reduce((h,f)=>o(f)?h+1:h+2,0)+((d=c.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&d!==void 0?d:[]).length}e.calculateStringSize=a;function l(c){return c.toString().length}e.calculateNumberSize=l})(Hl);var De={};Object.defineProperty(De,"__esModule",{value:!0});De.hexToBigInt=De.hexToNumber=De.bigIntToHex=De.numberToHex=void 0;const Mt=le,cr=Ir,X0=e=>((0,Mt.assert)(typeof e=="number","Value must be a number."),(0,Mt.assert)(e>=0,"Value must be a non-negative number."),(0,Mt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,cr.add0x)(e.toString(16)));De.numberToHex=X0;const Y0=e=>((0,Mt.assert)(typeof e=="bigint","Value must be a bigint."),(0,Mt.assert)(e>=0,"Value must be a non-negative bigint."),(0,cr.add0x)(e.toString(16)));De.bigIntToHex=Y0;const e1=e=>{(0,cr.assertIsHexString)(e);const t=parseInt(e,16);return(0,Mt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};De.hexToNumber=e1;const t1=e=>((0,cr.assertIsHexString)(e),BigInt((0,cr.add0x)(e)));De.hexToBigInt=t1;var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});var Vl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,o)=>{if(!t(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function n(i,o){return r(i,"count"),i*o}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(Vl);var Wl={};Object.defineProperty(Wl,"__esModule",{value:!0});var zl={},Ni={exports:{}};const r1="2.0.0",ql=256,n1=Number.MAX_SAFE_INTEGER||9007199254740991,s1=16,i1=ql-6,o1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var xn={MAX_LENGTH:ql,MAX_SAFE_COMPONENT_LENGTH:s1,MAX_SAFE_BUILD_LENGTH:i1,MAX_SAFE_INTEGER:n1,RELEASE_TYPES:o1,SEMVER_SPEC_VERSION:r1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const a1=typeof bi=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Fn=a1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=xn,i=Fn;t=e.exports={};const o=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.t={};let d=0;const u="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[u,n]],f=y=>{for(const[g,b]of h)y=y.split(`${g}*`).join(`${g}{0,${b}}`).split(`${g}+`).join(`${g}{1,${b}}`);return y},p=(y,g,b)=>{const _=f(g),m=d++;i(y,m,g),c[y]=m,l[m]=g,o[m]=new RegExp(g,b?"g":void 0),a[m]=new RegExp(_,b?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${u}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ni,Ni.exports);var Ar=Ni.exports;const c1=Object.freeze({loose:!0}),l1=Object.freeze({}),u1=e=>e?typeof e!="object"?c1:e:l1;var so=u1;const La=/^[0-9]+$/,Jl=(e,t)=>{const r=La.test(e),n=La.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},d1=(e,t)=>Jl(t,e);var Gl={compareIdentifiers:Jl,rcompareIdentifiers:d1};const Dr=Fn,{MAX_LENGTH:Ta,MAX_SAFE_INTEGER:Hr}=xn,{safeRe:Ma,t:Pa}=Ar,h1=so,{compareIdentifiers:kt}=Gl;let f1=class Oe{constructor(t,r){if(r=h1(r),t instanceof Oe){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ta)throw new TypeError(`version is longer than ${Ta} characters`);Dr("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Ma[Pa.LOOSE]:Ma[Pa.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Hr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<Hr)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Dr("SemVer.compare",this.version,this.options,t),!(t instanceof Oe)){if(typeof t=="string"&&t===this.version)return 0;t=new Oe(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Oe||(t=new Oe(t,this.options)),kt(this.major,t.major)||kt(this.minor,t.minor)||kt(this.patch,t.patch)}comparePre(t){if(t instanceof Oe||(t=new Oe(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(Dr("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return kt(n,s)}while(++r)}compareBuild(t){t instanceof Oe||(t=new Oe(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(Dr("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return kt(n,s)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),kt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ge=f1;const Oa=ge,p1=(e,t,r=!1)=>{if(e instanceof Oa)return e;try{return new Oa(e,t)}catch(n){if(!r)return null;throw n}};var Qt=p1;const g1=Qt,m1=(e,t)=>{const r=g1(e,t);return r?r.version:null};var _1=m1;const b1=Qt,y1=(e,t)=>{const r=b1(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var w1=y1;const $a=ge,v1=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new $a(e instanceof $a?e.version:e,r).inc(t,n,s).version}catch{return null}};var E1=v1;const xa=Qt,S1=(e,t)=>{const r=xa(e,null,!0),n=xa(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const d=l?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};var C1=S1;const k1=ge,R1=(e,t)=>new k1(e,t).major;var I1=R1;const A1=ge,N1=(e,t)=>new A1(e,t).minor;var L1=N1;const T1=ge,M1=(e,t)=>new T1(e,t).patch;var P1=M1;const O1=Qt,$1=(e,t)=>{const r=O1(e,t);return r&&r.prerelease.length?r.prerelease:null};var x1=$1;const Fa=ge,F1=(e,t,r)=>new Fa(e,r).compare(new Fa(t,r));var Le=F1;const j1=Le,B1=(e,t,r)=>j1(t,e,r);var D1=B1;const H1=Le,U1=(e,t)=>H1(e,t,!0);var V1=U1;const ja=ge,W1=(e,t,r)=>{const n=new ja(e,r),s=new ja(t,r);return n.compare(s)||n.compareBuild(s)};var io=W1;const z1=io,q1=(e,t)=>e.sort((r,n)=>z1(r,n,t));var J1=q1;const G1=io,Z1=(e,t)=>e.sort((r,n)=>G1(n,r,t));var Q1=Z1;const K1=Le,X1=(e,t,r)=>K1(e,t,r)>0;var jn=X1;const Y1=Le,ep=(e,t,r)=>Y1(e,t,r)<0;var oo=ep;const tp=Le,rp=(e,t,r)=>tp(e,t,r)===0;var Zl=rp;const np=Le,sp=(e,t,r)=>np(e,t,r)!==0;var Ql=sp;const ip=Le,op=(e,t,r)=>ip(e,t,r)>=0;var ao=op;const ap=Le,cp=(e,t,r)=>ap(e,t,r)<=0;var co=cp;const lp=Zl,up=Ql,dp=jn,hp=ao,fp=oo,pp=co,gp=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return lp(e,r,n);case"!=":return up(e,r,n);case">":return dp(e,r,n);case">=":return hp(e,r,n);case"<":return fp(e,r,n);case"<=":return pp(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Kl=gp;const mp=ge,_p=Qt,{safeRe:Ur,t:Vr}=Ar,bp=(e,t)=>{if(e instanceof mp)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Ur[Vr.COERCEFULL]:Ur[Vr.COERCE]);else{const l=t.includePrerelease?Ur[Vr.COERCERTLFULL]:Ur[Vr.COERCERTL];let c;for(;(c=l.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return _p(`${n}.${s}.${i}${o}${a}`,t)};var yp=bp,ii,Ba;function wp(){return Ba||(Ba=1,ii=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),ii}var vp=D;D.Node=gt;D.create=D;function D(e){var t=this;if(t instanceof D||(t=new D),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(s){t.push(s)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}D.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};D.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};D.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};D.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Sp(this,arguments[e]);return this.length};D.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Cp(this,arguments[e]);return this.length};D.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};D.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};D.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};D.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};D.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};D.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};D.prototype.map=function(e,t){t=t||this;for(var r=new D,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};D.prototype.mapReverse=function(e,t){t=t||this;for(var r=new D,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};D.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;n!==null;s++)r=e(r,n.value,s),n=n.next;return r};D.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;n!==null;s--)r=e(r,n.value,s),n=n.prev;return r};D.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};D.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};D.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new D;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,s=this.head;s!==null&&n<e;n++)s=s.next;for(;s!==null&&n<t;n++,s=s.next)r.push(s.value);return r};D.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new D;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,s=this.tail;s!==null&&n>t;n--)s=s.prev;for(;s!==null&&n>e;n--,s=s.prev)r.push(s.value);return r};D.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,s=this.head;s!==null&&n<e;n++)s=s.next;for(var i=[],n=0;s&&n<t;n++)i.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var n=0;n<r.length;n++)s=Ep(this,s,r[n]);return i};D.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function Ep(e,t,r){var n=t===e.head?new gt(r,null,t,e):new gt(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function Sp(e,t){e.tail=new gt(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Cp(e,t){e.head=new gt(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function gt(e,t,r,n){if(!(this instanceof gt))return new gt(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{wp()(D)}catch{}const kp=vp,ct=Symbol("max"),We=Symbol("length"),Rt=Symbol("lengthCalculator"),ir=Symbol("allowStale"),ut=Symbol("maxAge"),He=Symbol("dispose"),Da=Symbol("noDisposeOnSet"),ie=Symbol("lruList"),Ne=Symbol("cache"),Xl=Symbol("updateAgeOnGet"),oi=()=>1;class Rp{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[ct]=t.max||1/0;const r=t.length||oi;if(this[Rt]=typeof r!="function"?oi:r,this[ir]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[ut]=t.maxAge||0,this[He]=t.dispose,this[Da]=t.noDisposeOnSet||!1,this[Xl]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[ct]=t||1/0,Xt(this)}get max(){return this[ct]}set allowStale(t){this[ir]=!!t}get allowStale(){return this[ir]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[ut]=t,Xt(this)}get maxAge(){return this[ut]}set lengthCalculator(t){typeof t!="function"&&(t=oi),t!==this[Rt]&&(this[Rt]=t,this[We]=0,this[ie].forEach(r=>{r.length=this[Rt](r.value,r.key),this[We]+=r.length})),Xt(this)}get lengthCalculator(){return this[Rt]}get length(){return this[We]}get itemCount(){return this[ie].length}rforEach(t,r){r=r||this;for(let n=this[ie].tail;n!==null;){const s=n.prev;Ha(this,t,n,r),n=s}}forEach(t,r){r=r||this;for(let n=this[ie].head;n!==null;){const s=n.next;Ha(this,t,n,r),n=s}}keys(){return this[ie].toArray().map(t=>t.key)}values(){return this[ie].toArray().map(t=>t.value)}reset(){this[He]&&this[ie]&&this[ie].length&&this[ie].forEach(t=>this[He](t.key,t.value)),this[Ne]=new Map,this[ie]=new kp,this[We]=0}dump(){return this[ie].map(t=>Xr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ie]}set(t,r,n){if(n=n||this[ut],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const s=n?Date.now():0,i=this[Rt](r,t);if(this[Ne].has(t)){if(i>this[ct])return Pt(this,this[Ne].get(t)),!1;const l=this[Ne].get(t).value;return this[He]&&(this[Da]||this[He](t,l.value)),l.now=s,l.maxAge=n,l.value=r,this[We]+=i-l.length,l.length=i,this.get(t),Xt(this),!0}const o=new Ip(t,r,i,s,n);return o.length>this[ct]?(this[He]&&this[He](t,r),!1):(this[We]+=o.length,this[ie].unshift(o),this[Ne].set(t,this[ie].head),Xt(this),!0)}has(t){if(!this[Ne].has(t))return!1;const r=this[Ne].get(t).value;return!Xr(this,r)}get(t){return ai(this,t,!0)}peek(t){return ai(this,t,!1)}pop(){const t=this[ie].tail;return t?(Pt(this,t),t.value):null}del(t){Pt(this,this[Ne].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const s=t[n],i=s.e||0;if(i===0)this.set(s.k,s.v);else{const o=i-r;o>0&&this.set(s.k,s.v,o)}}}prune(){this[Ne].forEach((t,r)=>ai(this,r,!1))}}const ai=(e,t,r)=>{const n=e[Ne].get(t);if(n){const s=n.value;if(Xr(e,s)){if(Pt(e,n),!e[ir])return}else r&&(e[Xl]&&(n.value.now=Date.now()),e[ie].unshiftNode(n));return s.value}},Xr=(e,t)=>{if(!t||!t.maxAge&&!e[ut])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[ut]&&r>e[ut]},Xt=e=>{if(e[We]>e[ct])for(let t=e[ie].tail;e[We]>e[ct]&&t!==null;){const r=t.prev;Pt(e,t),t=r}},Pt=(e,t)=>{if(t){const r=t.value;e[He]&&e[He](r.key,r.value),e[We]-=r.length,e[Ne].delete(r.key),e[ie].removeNode(t)}};class Ip{constructor(t,r,n,s,i){this.key=t,this.value=r,this.length=n,this.now=s,this.maxAge=i||0}}const Ha=(e,t,r,n)=>{let s=r.value;Xr(e,s)&&(Pt(e,r),e[ir]||(s=void 0)),s&&t.call(n,s.value,s.key,e)};var Ap=Rp,ci,Ua;function Te(){if(Ua)return ci;Ua=1;class e{constructor(v,R){if(R=n(R),v instanceof e)return v.loose===!!R.loose&&v.includePrerelease===!!R.includePrerelease?v:new e(v.raw,R);if(v instanceof s)return this.raw=v.value,this.set=[[v]],this.format(),this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=v.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(I=>!p(I[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const I of this.set)if(I.length===1&&y(I[0])){this.set=[I];break}}}this.format()}format(){return this.range=this.set.map(v=>v.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(v){const k=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+v,I=r.get(k);if(I)return I;const C=this.options.loose,T=C?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];v=v.replace(T,he(this.options.includePrerelease)),i("hyphen replace",v),v=v.replace(a[l.COMPARATORTRIM],c),i("comparator trim",v),v=v.replace(a[l.TILDETRIM],d),i("tilde trim",v),v=v.replace(a[l.CARETTRIM],u),i("caret trim",v);let H=v.split(" ").map(Z=>b(Z,this.options)).join(" ").split(/\s+/).map(Z=>z(Z,this.options));C&&(H=H.filter(Z=>(i("loose invalid filter",Z,this.options),!!Z.match(a[l.COMPARATORLOOSE])))),i("range list",H);const O=new Map,q=H.map(Z=>new s(Z,this.options));for(const Z of q){if(p(Z))return[Z];O.set(Z.value,Z)}O.size>1&&O.has("")&&O.delete("");const ue=[...O.values()];return r.set(k,ue),ue}intersects(v,R){if(!(v instanceof e))throw new TypeError("a Range is required");return this.set.some(k=>g(k,R)&&v.set.some(I=>g(I,R)&&k.every(C=>I.every(T=>C.intersects(T,R)))))}test(v){if(!v)return!1;if(typeof v=="string")try{v=new o(v,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(ee(this.set[R],v,this.options))return!0;return!1}}ci=e;const t=Ap,r=new t({max:1e3}),n=so,s=Bn(),i=Fn,o=ge,{safeRe:a,t:l,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:u}=Ar,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=xn,p=E=>E.value==="<0.0.0-0",y=E=>E.value==="",g=(E,v)=>{let R=!0;const k=E.slice();let I=k.pop();for(;R&&k.length;)R=k.every(C=>I.intersects(C,v)),I=k.pop();return R},b=(E,v)=>(i("comp",E,v),E=w(E,v),i("caret",E),E=m(E,v),i("tildes",E),E=U(E,v),i("xrange",E),E=V(E,v),i("stars",E),E),_=E=>!E||E.toLowerCase()==="x"||E==="*",m=(E,v)=>E.trim().split(/\s+/).map(R=>M(R,v)).join(" "),M=(E,v)=>{const R=v.loose?a[l.TILDELOOSE]:a[l.TILDE];return E.replace(R,(k,I,C,T,H)=>{i("tilde",E,k,I,C,T,H);let O;return _(I)?O="":_(C)?O=`>=${I}.0.0 <${+I+1}.0.0-0`:_(T)?O=`>=${I}.${C}.0 <${I}.${+C+1}.0-0`:H?(i("replaceTilde pr",H),O=`>=${I}.${C}.${T}-${H} <${I}.${+C+1}.0-0`):O=`>=${I}.${C}.${T} <${I}.${+C+1}.0-0`,i("tilde return",O),O})},w=(E,v)=>E.trim().split(/\s+/).map(R=>N(R,v)).join(" "),N=(E,v)=>{i("caret",E,v);const R=v.loose?a[l.CARETLOOSE]:a[l.CARET],k=v.includePrerelease?"-0":"";return E.replace(R,(I,C,T,H,O)=>{i("caret",E,I,C,T,H,O);let q;return _(C)?q="":_(T)?q=`>=${C}.0.0${k} <${+C+1}.0.0-0`:_(H)?C==="0"?q=`>=${C}.${T}.0${k} <${C}.${+T+1}.0-0`:q=`>=${C}.${T}.0${k} <${+C+1}.0.0-0`:O?(i("replaceCaret pr",O),C==="0"?T==="0"?q=`>=${C}.${T}.${H}-${O} <${C}.${T}.${+H+1}-0`:q=`>=${C}.${T}.${H}-${O} <${C}.${+T+1}.0-0`:q=`>=${C}.${T}.${H}-${O} <${+C+1}.0.0-0`):(i("no pr"),C==="0"?T==="0"?q=`>=${C}.${T}.${H}${k} <${C}.${T}.${+H+1}-0`:q=`>=${C}.${T}.${H}${k} <${C}.${+T+1}.0-0`:q=`>=${C}.${T}.${H} <${+C+1}.0.0-0`),i("caret return",q),q})},U=(E,v)=>(i("replaceXRanges",E,v),E.split(/\s+/).map(R=>G(R,v)).join(" ")),G=(E,v)=>{E=E.trim();const R=v.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return E.replace(R,(k,I,C,T,H,O)=>{i("xRange",E,k,I,C,T,H,O);const q=_(C),ue=q||_(T),Z=ue||_(H),Ge=Z;return I==="="&&Ge&&(I=""),O=v.includePrerelease?"-0":"",q?I===">"||I==="<"?k="<0.0.0-0":k="*":I&&Ge?(ue&&(T=0),H=0,I===">"?(I=">=",ue?(C=+C+1,T=0,H=0):(T=+T+1,H=0)):I==="<="&&(I="<",ue?C=+C+1:T=+T+1),I==="<"&&(O="-0"),k=`${I+C}.${T}.${H}${O}`):ue?k=`>=${C}.0.0${O} <${+C+1}.0.0-0`:Z&&(k=`>=${C}.${T}.0${O} <${C}.${+T+1}.0-0`),i("xRange return",k),k})},V=(E,v)=>(i("replaceStars",E,v),E.trim().replace(a[l.STAR],"")),z=(E,v)=>(i("replaceGTE0",E,v),E.trim().replace(a[v.includePrerelease?l.GTE0PRE:l.GTE0],"")),he=E=>(v,R,k,I,C,T,H,O,q,ue,Z,Ge,Xn)=>(_(k)?R="":_(I)?R=`>=${k}.0.0${E?"-0":""}`:_(C)?R=`>=${k}.${I}.0${E?"-0":""}`:T?R=`>=${R}`:R=`>=${R}${E?"-0":""}`,_(q)?O="":_(ue)?O=`<${+q+1}.0.0-0`:_(Z)?O=`<${q}.${+ue+1}.0-0`:Ge?O=`<=${q}.${ue}.${Z}-${Ge}`:E?O=`<${q}.${ue}.${+Z+1}-0`:O=`<=${O}`,`${R} ${O}`.trim()),ee=(E,v,R)=>{for(let k=0;k<E.length;k++)if(!E[k].test(v))return!1;if(v.prerelease.length&&!R.includePrerelease){for(let k=0;k<E.length;k++)if(i(E[k].semver),E[k].semver!==s.ANY&&E[k].semver.prerelease.length>0){const I=E[k].semver;if(I.major===v.major&&I.minor===v.minor&&I.patch===v.patch)return!0}return!1}return!0};return ci}var li,Va;function Bn(){if(Va)return li;Va=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(d,u){if(u=r(u),d instanceof t){if(d.loose===!!u.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),o("comparator",d,u),this.options=u,this.loose=!!u.loose,this.parse(d),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(d){const u=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=d.match(u);if(!h)throw new TypeError(`Invalid comparator: ${d}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(d){if(o("Comparator.test",d,this.options.loose),this.semver===e||d===e)return!0;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}return i(d,this.operator,this.semver,this.options)}intersects(d,u){if(!(d instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(d.value,u).test(this.value):d.operator===""?d.value===""?!0:new l(this.value,u).test(d.semver):(u=r(u),u.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||i(this.semver,"<",d.semver,u)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||i(this.semver,">",d.semver,u)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}li=t;const r=so,{safeRe:n,t:s}=Ar,i=Kl,o=Fn,a=ge,l=Te();return li}const Np=Te(),Lp=(e,t,r)=>{try{t=new Np(t,r)}catch{return!1}return t.test(e)};var Dn=Lp;const Tp=Te(),Mp=(e,t)=>new Tp(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Pp=Mp;const Op=ge,$p=Te(),xp=(e,t,r)=>{let n=null,s=null,i=null;try{i=new $p(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new Op(n,r))}),n};var Fp=xp;const jp=ge,Bp=Te(),Dp=(e,t,r)=>{let n=null,s=null,i=null;try{i=new Bp(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new jp(n,r))}),n};var Hp=Dp;const ui=ge,Up=Te(),Wa=jn,Vp=(e,t)=>{e=new Up(e,t);let r=new ui("0.0.0");if(e.test(r)||(r=new ui("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(o=>{const a=new ui(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Wa(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Wa(r,i))&&(r=i)}return r&&e.test(r)?r:null};var Wp=Vp;const zp=Te(),qp=(e,t)=>{try{return new zp(e,t).range||"*"}catch{return null}};var Jp=qp;const Gp=ge,Yl=Bn(),{ANY:Zp}=Yl,Qp=Te(),Kp=Dn,za=jn,qa=oo,Xp=co,Yp=ao,eg=(e,t,r,n)=>{e=new Gp(e,n),t=new Qp(t,n);let s,i,o,a,l;switch(r){case">":s=za,i=Xp,o=qa,a=">",l=">=";break;case"<":s=qa,i=Yp,o=za,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kp(e,t,n))return!1;for(let c=0;c<t.set.length;++c){const d=t.set[c];let u=null,h=null;if(d.forEach(f=>{f.semver===Zp&&(f=new Yl(">=0.0.0")),u=u||f,h=h||f,s(f.semver,u.semver,n)?u=f:o(f.semver,h.semver,n)&&(h=f)}),u.operator===a||u.operator===l||(!h.operator||h.operator===a)&&i(e,h.semver))return!1;if(h.operator===l&&o(e,h.semver))return!1}return!0};var lo=eg;const tg=lo,rg=(e,t,r)=>tg(e,t,">",r);var ng=rg;const sg=lo,ig=(e,t,r)=>sg(e,t,"<",r);var og=ig;const Ja=Te(),ag=(e,t,r)=>(e=new Ja(e,r),t=new Ja(t,r),e.intersects(t,r));var cg=ag;const lg=Dn,ug=Le;var dg=(e,t,r)=>{const n=[];let s=null,i=null;const o=e.sort((d,u)=>ug(d,u,r));for(const d of o)lg(d,t,r)?(i=d,s||(s=d)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const a=[];for(const[d,u]of n)d===u?a.push(d):!u&&d===o[0]?a.push("*"):u?d===o[0]?a.push(`<=${u}`):a.push(`${d} - ${u}`):a.push(`>=${d}`);const l=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return l.length<c.length?l:t};const Ga=Te(),uo=Bn(),{ANY:di}=uo,Yt=Dn,ho=Le,hg=(e,t,r={})=>{if(e===t)return!0;e=new Ga(e,r),t=new Ga(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const o=pg(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},fg=[new uo(">=0.0.0-0")],Za=[new uo(">=0.0.0")],pg=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===di){if(t.length===1&&t[0].semver===di)return!0;r.includePrerelease?e=fg:e=Za}if(t.length===1&&t[0].semver===di){if(r.includePrerelease)return!0;t=Za}const n=new Set;let s,i;for(const f of e)f.operator===">"||f.operator===">="?s=Qa(s,f,r):f.operator==="<"||f.operator==="<="?i=Ka(i,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(s&&i){if(o=ho(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const f of n){if(s&&!Yt(f,String(s),r)||i&&!Yt(f,String(i),r))return null;for(const p of t)if(!Yt(f,String(p),r))return!1;return!0}let a,l,c,d,u=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;u&&u.prerelease.length===1&&i.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const f of t){if(d=d||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",s){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=Qa(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!Yt(s.semver,String(f),r))return!1}if(i){if(u&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===u.major&&f.semver.minor===u.minor&&f.semver.patch===u.patch&&(u=!1),f.operator==="<"||f.operator==="<="){if(l=Ka(i,f,r),l===f&&l!==i)return!1}else if(i.operator==="<="&&!Yt(i.semver,String(f),r))return!1}if(!f.operator&&(i||s)&&o!==0)return!1}return!(s&&c&&!i&&o!==0||i&&d&&!s&&o!==0||h||u)},Qa=(e,t,r)=>{if(!e)return t;const n=ho(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Ka=(e,t,r)=>{if(!e)return t;const n=ho(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var gg=hg;const hi=Ar,Xa=xn,mg=ge,Ya=Gl,_g=Qt,bg=_1,yg=w1,wg=E1,vg=C1,Eg=I1,Sg=L1,Cg=P1,kg=x1,Rg=Le,Ig=D1,Ag=V1,Ng=io,Lg=J1,Tg=Q1,Mg=jn,Pg=oo,Og=Zl,$g=Ql,xg=ao,Fg=co,jg=Kl,Bg=yp,Dg=Bn(),Hg=Te(),Ug=Dn,Vg=Pp,Wg=Fp,zg=Hp,qg=Wp,Jg=Jp,Gg=lo,Zg=ng,Qg=og,Kg=cg,Xg=dg,Yg=gg;var em={parse:_g,valid:bg,clean:yg,inc:wg,diff:vg,major:Eg,minor:Sg,patch:Cg,prerelease:kg,compare:Rg,rcompare:Ig,compareLoose:Ag,compareBuild:Ng,sort:Lg,rsort:Tg,gt:Mg,lt:Pg,eq:Og,neq:$g,gte:xg,lte:Fg,cmp:jg,coerce:Bg,Comparator:Dg,Range:Hg,satisfies:Ug,toComparators:Vg,maxSatisfying:Wg,minSatisfying:zg,minVersion:qg,validRange:Jg,outside:Gg,gtr:Zg,ltr:Qg,intersects:Kg,simplifyRange:Xg,subset:Yg,SemVer:mg,re:hi.re,src:hi.src,tokens:hi.t,SEMVER_SPEC_VERSION:Xa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Xa.RELEASE_TYPES,compareIdentifiers:Ya.compareIdentifiers,rcompareIdentifiers:Ya.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=em,r=wt,n=le;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",u=>(0,t.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",u=>(0,t.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function s(u){return(0,r.is)(u,e.VersionStruct)}e.isValidSemVerVersion=s;function i(u){return(0,r.is)(u,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(u){(0,n.assertStruct)(u,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(u){(0,n.assertStruct)(u,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function l(u,h){return(0,t.gt)(u,h)}e.gtVersion=l;function c(u,h){return(0,t.gtr)(u,h)}e.gtRange=c;function d(u,h){return(0,t.satisfies)(u,h,{includePrerelease:!0})}e.satisfiesVersionRange=d})(zl);(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(le,e),r(Rr,e),r(B,e),r(On,e),r(Be,e),r(Dt,e),r(jl,e),r(Ir,e),r(Bl,e),r(Dl,e),r(Ht,e),r(Hl,e),r(De,e),r(Ul,e),r(Vl,e),r(Wl,e),r(zl,e)})(yl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=yl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(bl);var eu=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.PollingBlockTracker=void 0;const tm=eu(Zi),rm=eu(wf),nm=Er,ec=bl,tc=(0,ec.createModuleLogger)(ec.projectLogger,"polling-block-tracker"),sm=(0,tm.default)(),im=1e3;class om extends nm.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*im,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=rc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3
- ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=rc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:sm(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),tc("Making request",t);const r=await(0,rm.default)(n=>this._provider.sendAsync(t,n))();if(tc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
- ${r.error.message}`);return r.result}}Mn.PollingBlockTracker=om;function rc(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Hn={},am=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.SubscribeBlockTracker=void 0;const cm=am(Zi),lm=Er,um=(0,cm.default)();class dm extends lm.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:um(),method:t,params:r,jsonrpc:"2.0"},(i,o)=>{i?s(i):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Hn.SubscribeBlockTracker=dm;(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Mn,e),r(Hn,e)})(_l);var fo={},Un={},Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.getUniqueId=void 0;const tu=4294967295;let fi=Math.floor(Math.random()*tu);function hm(){return fi=(fi+1)%tu,fi}Nr.getUniqueId=hm;Object.defineProperty(Un,"__esModule",{value:!0});Un.createIdRemapMiddleware=void 0;const fm=Nr;function pm(){return(e,t,r,n)=>{const s=e.id,i=fm.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}Un.createIdRemapMiddleware=pm;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createAsyncMiddleware=void 0;function gm(e){return async(t,r,n,s)=>{let i;const o=new Promise(d=>{i=d});let a=null,l=!1;const c=async()=>{l=!0,n(d=>{a=d,i()}),await o};try{await e(t,r,c),l?(await o,a(null)):s(null)}catch(d){a?a(d):s(d)}}}Vn.createAsyncMiddleware=gm;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.createScaffoldMiddleware=void 0;function mm(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}Wn.createScaffoldMiddleware=mm;var Lr={},po={};Object.defineProperty(po,"__esModule",{value:!0});const _m=_c;function nc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function bm(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let ym=class extends _m.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")nc(i,this,r);else{const o=i.length,a=bm(i);for(let l=0;l<o;l+=1)nc(a[l],this,r)}return!0}};po.default=ym;var ru={},Ye={},wm=lr;lr.default=lr;lr.stable=iu;lr.stableStringify=iu;var Yr="[...]",nu="[Circular]",mt=[],dt=[];function su(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function lr(e,t,r,n){typeof n>"u"&&(n=su()),Li(e,"",0,[],void 0,0,n);var s;try{dt.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,ou(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;mt.length!==0;){var i=mt.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Ot(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),mt.push([n,r,t,s])):dt.push([t,r,e]):(n[r]=e,mt.push([n,r,t]))}function Li(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ot(nu,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Ot(Yr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Ot(Yr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Li(e[a],a,a,n,e,i,o);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var c=l[a];Li(e[c],c,a,n,e,i,o)}}n.pop()}}function vm(e,t){return e<t?-1:e>t?1:0}function iu(e,t,r,n){typeof n>"u"&&(n=su());var s=Ti(e,"",0,[],void 0,0,n)||e,i;try{dt.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,ou(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;mt.length!==0;){var o=mt.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Ti(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ot(nu,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Ot(Yr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Ot(Yr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Ti(e[a],a,a,n,e,i,o);else{var l={},c=Object.keys(e).sort(vm);for(a=0;a<c.length;a++){var d=c[a];Ti(e[d],d,a,n,e,i,o),l[d]=e[d]}if(typeof s<"u")mt.push([s,t,e]),s[t]=l;else return l}n.pop()}}function ou(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(dt.length>0)for(var n=0;n<dt.length;n++){var s=dt[n];if(s[1]===t&&s[0]===r){r=s[2],dt.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Ye,"__esModule",{value:!0});Ye.EthereumProviderError=Ye.EthereumRpcError=void 0;const Em=wm;class au extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Em.default(this.serialize(),km,2)}}Ye.EthereumRpcError=au;class Sm extends au{constructor(t,r,n){if(!Cm(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Ye.EthereumProviderError=Sm;function Cm(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function km(e,t){if(t!=="[Circular]")return t}var go={},et={};Object.defineProperty(et,"__esModule",{value:!0});et.errorValues=et.errorCodes=void 0;et.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};et.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=et,r=Ye,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,f=s){if(Number.isInteger(h)){const p=h.toString();if(u(t.errorValues,p))return t.errorValues[p].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||c(h))}e.isValidCode=a;function l(h,{fallbackError:f=i,shouldIncludeStack:p=!1}={}){var y,g;if(!f||!Number.isInteger(f.code)||typeof f.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const b={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&a(h.code)){const m=h;b.code=m.code,m.message&&typeof m.message=="string"?(b.message=m.message,u(m,"data")&&(b.data=m.data)):(b.message=o(b.code),b.data={originalError:d(h)})}else{b.code=f.code;const m=(y=h)===null||y===void 0?void 0:y.message;b.message=m&&typeof m=="string"?m:f.message,b.data={originalError:d(h)}}const _=(g=h)===null||g===void 0?void 0:g.stack;return p&&h&&_&&typeof _=="string"&&(b.stack=_),b}e.serializeError=l;function c(h){return h>=-32099&&h<=-32e3}function d(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,f){return Object.prototype.hasOwnProperty.call(h,f)}})(go);var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.ethErrors=void 0;const mo=Ye,cu=go,de=et;zn.ethErrors={rpc:{parse:e=>Ee(de.errorCodes.rpc.parse,e),invalidRequest:e=>Ee(de.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ee(de.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ee(de.errorCodes.rpc.methodNotFound,e),internal:e=>Ee(de.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ee(t,e)},invalidInput:e=>Ee(de.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ee(de.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ee(de.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ee(de.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ee(de.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ee(de.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>er(de.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>er(de.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>er(de.errorCodes.provider.unsupportedMethod,e),disconnected:e=>er(de.errorCodes.provider.disconnected,e),chainDisconnected:e=>er(de.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new mo.EthereumProviderError(t,r,n)}}};function Ee(e,t){const[r,n]=lu(t);return new mo.EthereumRpcError(e,r||cu.getMessageFromCode(e),n)}function er(e,t){const[r,n]=lu(t);return new mo.EthereumProviderError(e,r||cu.getMessageFromCode(e),n)}function lu(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ye;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=go;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=zn;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=et;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(ru);var Rm=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.JsonRpcEngine=void 0;const Im=Rm(po),Se=ru;class Ue extends Im.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await Ue._runAllMiddleware(t,r,this._middleware);return o?(await Ue._runReturnHandlers(a),s(i)):n(async l=>{try{await Ue._runReturnHandlers(a)}catch(c){return l(c)}return l()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new Se.EthereumRpcError(Se.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new Se.EthereumRpcError(Se.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(o){i=o}return i&&(delete s.result,s.error||(s.error=Se.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await Ue._runAllMiddleware(t,r,this._middleware);if(Ue._checkForCompletion(t,r,s),await Ue._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,o=!1;for(const a of n)if([i,o]=await Ue._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const o=l=>{const c=l||r.error;c&&(r.error=Se.serializeError(c)),i([c,!0])},a=l=>{r.error?o(r.error):(l&&(typeof l!="function"&&o(new Se.EthereumRpcError(Se.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof l}" for request:
5
- ${pi(t)}`,{request:t})),s.push(l)),i([null,!1]))};try{n(t,r,a,o)}catch(l){o(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,s)=>{r(i=>i?s(i):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Se.EthereumRpcError(Se.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
6
- ${pi(t)}`,{request:t});if(!n)throw new Se.EthereumRpcError(Se.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
7
- ${pi(t)}`,{request:t})}}Lr.JsonRpcEngine=Ue;function pi(e){return JSON.stringify(e,null,2)}var qn={};Object.defineProperty(qn,"__esModule",{value:!0});qn.mergeMiddleware=void 0;const Am=Lr;function Nm(e){const t=new Am.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}qn.mergeMiddleware=Nm;(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Un,e),r(Vn,e),r(Wn,e),r(Nr,e),r(Lr,e),r(qn,e)})(fo);var uu={},_o={},Mi=function(e,t){return Mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},Mi(e,t)};function du(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Mi(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var en=function(){return en=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},en.apply(this,arguments)};function hu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function fu(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}function pu(e,t){return function(r,n){t(r,n,e)}}function Lm(e,t,r,n,s,i){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=n.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!t&&e?n.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),u,h=!1,f=r.length-1;f>=0;f--){var p={};for(var y in n)p[y]=y==="access"?{}:n[y];for(var y in n.access)p.access[y]=n.access[y];p.addInitializer=function(b){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(b||null))};var g=(0,r[f])(a==="accessor"?{get:d.get,set:d.set}:d[l],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(u=o(g.get))&&(d.get=u),(u=o(g.set))&&(d.set=u),(u=o(g.init))&&s.unshift(u)}else(u=o(g))&&(a==="field"?s.unshift(u):d[l]=u)}c&&Object.defineProperty(c,n.name,d),h=!0}function Tm(e,t,r){for(var n=arguments.length>2,s=0;s<t.length;s++)r=n?t[s].call(e,r):t[s].call(e);return n?r:void 0}function Mm(e){return typeof e=="symbol"?e:"".concat(e)}function Pm(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function gu(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function mu(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{c(n.next(d))}catch(u){o(u)}}function l(d){try{c(n.throw(d))}catch(u){o(u)}}function c(d){d.done?i(d.value):s(d.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}function _u(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,s&&(i=c[0]&2?s.return:c[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;switch(s=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(d){c=[6,d],s=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var Jn=Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function bu(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Jn(t,e,r)}function tn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function bo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function yu(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(bo(arguments[t]));return e}function wu(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),s=0,t=0;t<r;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function vu(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Ut(e){return this instanceof Ut?(this.v=e,this):new Ut(e)}function Eu(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(h){n[h]&&(s[h]=function(f){return new Promise(function(p,y){i.push([h,f,p,y])>1||a(h,f)})})}function a(h,f){try{l(n[h](f))}catch(p){u(i[0][3],p)}}function l(h){h.value instanceof Ut?Promise.resolve(h.value.v).then(c,d):u(i[0][2],h)}function c(h){a("next",h)}function d(h){a("throw",h)}function u(h,f){h(f),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Su(e){var t,r;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,i){t[s]=e[s]?function(o){return(r=!r)?{value:Ut(e[s](o)),done:!1}:i?i(o):o}:i}}function Cu(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof tn=="function"?tn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(o){return new Promise(function(a,l){o=e[i](o),s(a,l,o.done,o.value)})}}function s(i,o,a,l){Promise.resolve(l).then(function(c){i({value:c,done:a})},o)}}function ku(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Om=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Ru(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Jn(t,e,r);return Om(t,e),t}function Iu(e){return e&&e.__esModule?e:{default:e}}function Au(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Nu(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}function Lu(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Tu(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var $m=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function Mu(e){function t(n){e.error=e.hasError?new $m(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}function r(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(r,function(i){return t(i),r()})}catch(i){t(i)}}if(e.hasError)throw e.error}return r()}const xm={__extends:du,__assign:en,__rest:hu,__decorate:fu,__param:pu,__metadata:gu,__awaiter:mu,__generator:_u,__createBinding:Jn,__exportStar:bu,__values:tn,__read:bo,__spread:yu,__spreadArrays:wu,__spreadArray:vu,__await:Ut,__asyncGenerator:Eu,__asyncDelegator:Su,__asyncValues:Cu,__makeTemplateObject:ku,__importStar:Ru,__importDefault:Iu,__classPrivateFieldGet:Au,__classPrivateFieldSet:Nu,__classPrivateFieldIn:Lu,__addDisposableResource:Tu,__disposeResources:Mu},Fm=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Tu,get __assign(){return en},__asyncDelegator:Su,__asyncGenerator:Eu,__asyncValues:Cu,__await:Ut,__awaiter:mu,__classPrivateFieldGet:Au,__classPrivateFieldIn:Lu,__classPrivateFieldSet:Nu,__createBinding:Jn,__decorate:fu,__disposeResources:Mu,__esDecorate:Lm,__exportStar:bu,__extends:du,__generator:_u,__importDefault:Iu,__importStar:Ru,__makeTemplateObject:ku,__metadata:gu,__param:pu,__propKey:Mm,__read:bo,__rest:hu,__runInitializers:Tm,__setFunctionName:Pm,__spread:yu,__spreadArray:vu,__spreadArrays:wu,__values:tn,default:xm},Symbol.toStringTag,{value:"Module"})),yo=sn(Fm);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});var sc=yo,jm=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(s){return t._queue.push(s)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return sc.__awaiter(this,void 0,void 0,function(){var r,n,s;return sc.__generator(this,function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:r=i.sent(),n=r[0],s=r[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,i.sent()];case 4:return s(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Gn.default=jm;Object.defineProperty(_o,"__esModule",{value:!0});var ic=yo,Bm=Gn,Dm=function(){function e(){this._semaphore=new Bm.default(1)}return e.prototype.acquire=function(){return ic.__awaiter(this,void 0,void 0,function(){var t,r;return ic.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();_o.default=Dm;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.withTimeout=void 0;var Wr=yo;function Hm(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(s,i){return Wr.__awaiter(n,void 0,void 0,function(){var o,a,l;return Wr.__generator(this,function(c){switch(c.label){case 0:return o=!1,setTimeout(function(){o=!0,i(r)},t),[4,e.acquire()];case 1:return a=c.sent(),o?(l=Array.isArray(a)?a[1]:a,l()):s(a),[2]}})})})},runExclusive:function(s){return Wr.__awaiter(this,void 0,void 0,function(){var i,o;return Wr.__generator(this,function(a){switch(a.label){case 0:i=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(i=o[1],[4,s(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return i=o,[4,s()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return i(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Zn.withTimeout=Hm;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=_o;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Gn;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Zn;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(uu);var Um=Wm,Vm=Object.prototype.hasOwnProperty;function Wm(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Vm.call(r,n)&&(e[n]=r[n])}return e}const zm=Um,qm=Zi();var Jm=L;function L(e){const t=this;t.currentProvider=e}L.prototype.getBalance=Tr(2,"eth_getBalance");L.prototype.getCode=Tr(2,"eth_getCode");L.prototype.getTransactionCount=Tr(2,"eth_getTransactionCount");L.prototype.getStorageAt=Tr(3,"eth_getStorageAt");L.prototype.call=Tr(2,"eth_call");L.prototype.protocolVersion=x("eth_protocolVersion");L.prototype.syncing=x("eth_syncing");L.prototype.coinbase=x("eth_coinbase");L.prototype.mining=x("eth_mining");L.prototype.hashrate=x("eth_hashrate");L.prototype.gasPrice=x("eth_gasPrice");L.prototype.accounts=x("eth_accounts");L.prototype.blockNumber=x("eth_blockNumber");L.prototype.getBlockTransactionCountByHash=x("eth_getBlockTransactionCountByHash");L.prototype.getBlockTransactionCountByNumber=x("eth_getBlockTransactionCountByNumber");L.prototype.getUncleCountByBlockHash=x("eth_getUncleCountByBlockHash");L.prototype.getUncleCountByBlockNumber=x("eth_getUncleCountByBlockNumber");L.prototype.sign=x("eth_sign");L.prototype.sendTransaction=x("eth_sendTransaction");L.prototype.sendRawTransaction=x("eth_sendRawTransaction");L.prototype.estimateGas=x("eth_estimateGas");L.prototype.getBlockByHash=x("eth_getBlockByHash");L.prototype.getBlockByNumber=x("eth_getBlockByNumber");L.prototype.getTransactionByHash=x("eth_getTransactionByHash");L.prototype.getTransactionByBlockHashAndIndex=x("eth_getTransactionByBlockHashAndIndex");L.prototype.getTransactionByBlockNumberAndIndex=x("eth_getTransactionByBlockNumberAndIndex");L.prototype.getTransactionReceipt=x("eth_getTransactionReceipt");L.prototype.getUncleByBlockHashAndIndex=x("eth_getUncleByBlockHashAndIndex");L.prototype.getUncleByBlockNumberAndIndex=x("eth_getUncleByBlockNumberAndIndex");L.prototype.getCompilers=x("eth_getCompilers");L.prototype.compileLLL=x("eth_compileLLL");L.prototype.compileSolidity=x("eth_compileSolidity");L.prototype.compileSerpent=x("eth_compileSerpent");L.prototype.newFilter=x("eth_newFilter");L.prototype.newBlockFilter=x("eth_newBlockFilter");L.prototype.newPendingTransactionFilter=x("eth_newPendingTransactionFilter");L.prototype.uninstallFilter=x("eth_uninstallFilter");L.prototype.getFilterChanges=x("eth_getFilterChanges");L.prototype.getFilterLogs=x("eth_getFilterLogs");L.prototype.getLogs=x("eth_getLogs");L.prototype.getWork=x("eth_getWork");L.prototype.submitWork=x("eth_submitWork");L.prototype.submitHashrate=x("eth_submitHashrate");L.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(Gm(e),function(n,s){if(!n&&s.error&&(n=new Error("EthQuery - RPC Error - "+s.error.message)),n)return t(n);t(null,s.result)})};function x(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Tr(e,t){return function(){const r=this;var n=[].slice.call(arguments),s=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},s)}}function Gm(e){return zm({id:qm(),jsonrpc:"2.0",params:[]},e)}const oc=(e,t,r,n)=>function(...s){const i=t.promiseModule;return new i((o,a)=>{t.multiArgs?s.push((...c)=>{t.errorFirst?c[0]?a(c):(c.shift(),o(c)):o(c)}):t.errorFirst?s.push((c,d)=>{c?a(c):o(d)}):s.push(o),Reflect.apply(e,this===r?n:this,s)})},ac=new WeakMap;var Zm=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,a)=>{let l=ac.get(o);if(l||(l={},ac.set(o,l)),a in l)return l[a];const c=p=>typeof p=="string"||typeof a=="symbol"?a===p:p.test(a),d=Reflect.getOwnPropertyDescriptor(o,a),u=d===void 0||d.writable||d.configurable,f=(t.include?t.include.some(c):!t.exclude.some(c))&&u;return l[a]=f,f},s=new WeakMap,i=new Proxy(e,{apply(o,a,l){const c=s.get(o);if(c)return Reflect.apply(c,a,l);const d=t.excludeMain?o:oc(o,t,i,o);return s.set(o,d),Reflect.apply(d,a,l)},get(o,a){const l=o[a];if(!n(o,a)||l===Function.prototype[a])return l;const c=s.get(l);if(c)return c;if(typeof l=="function"){const d=oc(l,t,i,o);return s.set(l,d),d}return l}});return i};const Qm=Sr.default;let Km=class extends Qm{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var wo=Km;const Xm=wo;let Ym=class extends Xm{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var e_=Ym,Mr={minBlockRef:t_,maxBlockRef:r_,sortBlockRefs:vo,bnToHex:n_,blockRefIsNumber:s_,hexToInt:rn,incrementHexInt:i_,intToHex:Pu,unsafeRandomBytes:o_};function t_(...e){return vo(e)[0]}function r_(...e){const t=vo(e);return t[t.length-1]}function vo(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:rn(t)-rn(r))}function n_(e){return"0x"+e.toString(16)}function s_(e){return e&&!["earliest","latest","pending"].includes(e)}function rn(e){return e==null?e:Number.parseInt(e,16)}function i_(e){if(e==null)return e;const t=rn(e);return Pu(t+1)}function Pu(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function o_(e){let t="0x";for(let r=0;r<e;r++)t+=cc(),t+=cc();return t}function cc(){return Math.floor(Math.random()*16).toString(16)}const a_=Jm,c_=Zm,l_=e_,{bnToHex:vb,hexToInt:zr,incrementHexInt:u_,minBlockRef:d_,blockRefIsNumber:h_}=Mr;let f_=class extends l_{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new a_(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=d_(this.params.toBlock,t),s=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(s);this.addInitialResults(i)}async update({oldBlock:t,newBlock:r}){const n=r;let s;t?s=u_(t):s=r;const i=Object.assign({},this.params,{fromBlock:s,toBlock:n}),a=(await this._fetchLogs(i)).filter(l=>this.matchLog(l));this.addResults(a)}async _fetchLogs(t){return await c_(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(zr(this.params.fromBlock)>=zr(t.blockNumber)||h_(this.params.toBlock)&&zr(this.params.toBlock)<=zr(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((s,i)=>{let o=t.topics[i];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(s)?s:[s];return a.includes(null)?!0:(a=a.map(d=>d.toLowerCase()),a.includes(o))})}};var p_=f_,Eo=g_;async function g_({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=lc(t),i=lc(r)-n+1,o=Array(i).fill().map((l,c)=>n+c).map(m_);let a=await Promise.all(o.map(l=>b_(e,"eth_getBlockByNumber",[l,!1])));return a=a.filter(l=>l!==null),a}function lc(e){return e==null?e:Number.parseInt(e,16)}function m_(e){return e==null?e:"0x"+e.toString(16)}function __(e,t){return new Promise((r,n)=>{e.sendAsync(t,(s,i)=>{s?n(s):i.error?n(i.error):i.result?r(i.result):n(new Error("Result was empty"))})})}async function b_(e,t,r){for(let n=0;n<3;n++)try{return await __(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(s){console.error(`provider.sendAsync failed: ${s.stack||s.message||s}`)}return null}const y_=wo,w_=Eo,{incrementHexInt:v_}=Mr;let E_=class extends y_{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,s=v_(t),o=(await w_({provider:this.provider,fromBlock:s,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var S_=E_;const C_=wo,k_=Eo,{incrementHexInt:R_}=Mr;let I_=class extends C_{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=R_(t),s=await k_({provider:this.provider,fromBlock:n,toBlock:r}),i=[];for(const o of s)i.push(...o.transactions);this.addResults(i)}};var A_=I_;const N_=uu.Mutex,{createAsyncMiddleware:L_,createScaffoldMiddleware:T_}=fo,M_=p_,P_=S_,O_=A_,{intToHex:Ou,hexToInt:gi}=Mr;var $_=x_;function x_({blockTracker:e,provider:t}){let r=0,n={};const s=new N_,i=F_({mutex:s}),o=T_({eth_newFilter:i(mi(l)),eth_newBlockFilter:i(mi(c)),eth_newPendingTransactionFilter:i(mi(d)),eth_uninstallFilter:i(Zr(f)),eth_getFilterChanges:i(Zr(u)),eth_getFilterLogs:i(Zr(h))}),a=async({oldBlock:_,newBlock:m})=>{if(n.length===0)return;const M=await s.acquire();try{await Promise.all(It(n).map(async w=>{try{await w.update({oldBlock:_,newBlock:m})}catch(N){console.error(N)}}))}catch(w){console.error(w)}M()};return o.newLogFilter=l,o.newBlockFilter=c,o.newPendingTransactionFilter=d,o.uninstallFilter=f,o.getFilterChanges=u,o.getFilterLogs=h,o.destroy=()=>{g()},o;async function l(_){const m=new M_({provider:t,params:_});return await p(m),m}async function c(){const _=new P_({provider:t});return await p(_),_}async function d(){const _=new O_({provider:t});return await p(_),_}async function u(_){const m=gi(_),M=n[m];if(!M)throw new Error(`No filter for index "${m}"`);return M.getChangesAndClear()}async function h(_){const m=gi(_),M=n[m];if(!M)throw new Error(`No filter for index "${m}"`);let w=[];return M.type==="log"&&(w=M.getAllResults()),w}async function f(_){const m=gi(_),w=!!n[m];return w&&await y(m),w}async function p(_){const m=It(n).length,M=await e.getLatestBlock();await _.initialize({currentBlock:M}),r++,n[r]=_,_.id=r,_.idHex=Ou(r);const w=It(n).length;return b({prevFilterCount:m,newFilterCount:w}),r}async function y(_){const m=It(n).length;delete n[_];const M=It(n).length;b({prevFilterCount:m,newFilterCount:M})}async function g(){const _=It(n).length;n={},b({prevFilterCount:_,newFilterCount:0})}function b({prevFilterCount:_,newFilterCount:m}){if(_===0&&m>0){e.on("sync",a);return}if(_>0&&m===0){e.removeListener("sync",a);return}}}function mi(e){return Zr(async(...t)=>{const r=await e(...t);return Ou(r.id)})}function Zr(e){return L_(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function F_({mutex:e}){return t=>async(r,n,s,i)=>{(await e.acquire())(),t(r,n,s,i)}}function It(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const j_=Sr.default,{createAsyncMiddleware:uc,createScaffoldMiddleware:B_}=fo,D_=$_,{unsafeRandomBytes:H_,incrementHexInt:U_}=Mr,V_=Eo;var W_=z_;function z_({blockTracker:e,provider:t}){const r={},n=D_({blockTracker:e,provider:t});let s=!1;const i=new j_,o=B_({eth_subscribe:uc(a),eth_unsubscribe:uc(l)});return o.destroy=d,{events:i,middleware:o};async function a(u,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=u.params[0],p=H_(16);let y;switch(f){case"newHeads":y=g({subId:p});break;case"logs":const _=u.params[1],m=await n.newLogFilter(_);y=b({subId:p,filter:m});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${f}"`)}r[p]=y,h.result=p;return;function g({subId:_}){const m={type:f,destroy:async()=>{e.removeListener("sync",m.update)},update:async({oldBlock:M,newBlock:w})=>{const N=w,U=U_(M);(await V_({provider:t,fromBlock:U,toBlock:N})).map(q_).filter(z=>z!==null).forEach(z=>{c(_,z)})}};return e.on("sync",m.update),m}function b({subId:_,filter:m}){return m.on("update",w=>c(_,w)),{type:f,destroy:async()=>await n.uninstallFilter(m.idHex)}}}async function l(u,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=u.params[0],p=r[f];if(!p){h.result=!1;return}delete r[f],await p.destroy(),h.result=!0}function c(u,h){i.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:u,result:h}})}function d(){i.removeAllListeners();for(const u in r)r[u].destroy(),delete r[u];s=!0}}function q_(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SubscriptionManager=void 0;const J_=_l,G_=W_,dc=()=>{};class Z_{constructor(t){const r=new J_.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:s}=G_({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=s}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,dc,dc),r}destroy(){this.subscriptionMiddleware.destroy()}}Tn.SubscriptionManager=Z_;var $u=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($t,"__esModule",{value:!0});$t.CoinbaseWalletProvider=void 0;const Q_=$u(nn),K_=gd,F=dr,P=S,X_=gr,hc=Ce,qr=qt,be=Vt,_i=$u(gf),tr=zt,Y_=Bt,eb=Tn,fc="DefaultChainId",pc="DefaultJsonRpcUrl";class tb extends K_.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new Y_.FilterPolyfill(this),this._subscriptionManager=new eb.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const s=this.getChainId(),i=(0,P.prepend0x)(s.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(hc.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(l=>(0,P.ensureAddressString)(l)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var l;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const c=a.data.data.chainId,d=(l=a.data.data.jsonRpcUrl)!==null&&l!==void 0?l:this.jsonRpcUrl;this.updateProviderInfo(d,Number(c))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,P.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(pc))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(pc,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(fc,r.toString(10)),((0,P.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,s,i,o){const l=await(await this.initializeRelay()).watchAsset(t,r,n,s,i,o==null?void 0:o.toString()).promise;return(0,be.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(t,r,n,s,i,o){var a,l;if((0,P.ensureIntNumber)(t)===this.getChainId())return!1;const c=await this.initializeRelay(),d=c.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!d&&await c.requestEthereumAccounts().promise;const u=await c.addEthereumChain(t.toString(),r,i,n,s,o).promise;return(0,be.isErrorResponse)(u)?!1:(((a=u.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((l=u.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,be.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===F.standardErrorCodes.provider.unsupportedChain?F.standardErrors.provider.unsupportedChain():F.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const s=n.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(tr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?qr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(s=>{throw(0,F.serializeError)(s,t)})}catch(n){throw(0,F.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const s=t,i=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:s,params:i};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const s=t,i=r;return this._sendAsync(s,i)}if(Array.isArray(t))return t.map(i=>this._sendRequest(i));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,F.serializeError)(n,t)})}catch(n){return Promise.reject((0,F.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const s=r;this._sendMultipleRequestsAsync(t).then(i=>s(null,i)).catch(i=>s(i,null));return}const n=r;return this._sendRequestAsync(t).then(s=>n(null,s)).catch(s=>n(s,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,F.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,F.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw F.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw F.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw F.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const s=n===void 0?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:s,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,P.ensureRegExpString)(t)).promise;if((0,be.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const s=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,be.isErrorResponse)(s))throw(0,F.serializeError)(s.errorMessage,"generic");if(typeof s.result!="string")throw(0,F.serializeError)("result was not a string","generic");return s.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?qr.Session.hash(this._relay.session.id):void 0});let n;try{const i=await this.initializeRelay();if(!(i instanceof X_.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await i.connectAndSignIn(t).promise,(0,be.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):i}if(!n.result)throw new Error("accounts received is empty");const{accounts:s}=n.result;return this._setAddresses(s),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,be.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(s=>(0,P.ensureAddressString)(s));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(hc.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const s=this._handleSynchronousMethods(t);if(s!==void 0)return r({jsonrpc:"2.0",id:t.id,result:s});const i=this._handleAsynchronousFilterMethods(t);if(i!==void 0){i.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(s){return n(s)}this._handleAsynchronousMethods(t).then(s=>s&&r(Object.assign(Object.assign({},s),{id:t.id}))).catch(s=>n(s))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(i=>{var o;throw(i.code===F.standardErrorCodes.rpc.methodNotFound||i.code===F.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(tr.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?qr.Session.hash(this._relay.session.id):void 0})),i})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,P.ensureAddressString)(t);return this._addresses.map(s=>(0,P.ensureAddressString)(s)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,P.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,P.ensureAddressString)(t.to):null,s=t.value!=null?(0,P.ensureBN)(t.value):new Q_.default(0),i=t.data?(0,P.ensureBuffer)(t.data):$.alloc(0),o=t.nonce!=null?(0,P.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,P.ensureBN)(t.gasPrice):null,l=t.maxFeePerGas!=null?(0,P.ensureBN)(t.maxFeePerGas):null,c=t.maxPriorityFeePerGas!=null?(0,P.ensureBN)(t.maxPriorityFeePerGas):null,d=t.gas!=null?(0,P.ensureBN)(t.gas):null,u=t.chainId?(0,P.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:s,data:i,nonce:o,gasPriceInWei:a,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:d,chainId:u}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw F.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw F.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,s){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,s).promise;if((0,be.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(t,r,n){const i=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,be.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,P.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(fc);if(!t)return(0,P.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,P.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(tr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?qr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,be.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,be.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,P.ensureBuffer)(t[0]),s=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,be.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,be.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,P.ensureParsedJSONObject)(t[0]),n=(0,P.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const s=_i.default.hashForSignTypedDataLegacy({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,n,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=_i.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=_i.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,s,i;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw F.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw F.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(s=o.blockExplorerUrls)!==null&&s!==void 0?s:[],o.chainName,(i=o.iconUrls)!==null&&i!==void 0?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw F.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw F.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw F.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw F.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:s,symbol:i,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,s,i,a,o,n)}}_eth_uninstallFilter(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}$t.CoinbaseWalletProvider=tb;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.RelayEventManager=void 0;const rb=S;class nb{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,rb.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Qn.RelayEventManager=nb;Object.defineProperty(or,"__esModule",{value:!0});or.CoinbaseWalletSDK=void 0;const sb=on,ib=an,gc=S,ob=hn,ab=$t,cb=gr,lb=vr,ub=Qn,db=_r,hb=mr,xu=Wt;class Kn{constructor(t){var r,n,s;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||ib.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(s=t.reloadOnDisconnect)!==null&&s!==void 0?s:!0;const o=new URL(i),a=`${o.protocol}//${o.host}`;if(this._storage=new ob.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Kn.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new ub.RelayEventManager;const l=(0,gc.isMobileWeb)(),c=t.uiConstructor||(u=>l?new lb.MobileRelayUI(u):new db.WalletLinkRelayUI(u)),d={linkAPIUrl:i,version:xu.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:c,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=l?new cb.MobileRelay(d):new hb.WalletLinkRelay(d),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const s=this.coinbaseBrowser;if(s)return s;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new ab.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,gc.getFavicon)();const s=this.walletExtension;s?this.isCipherProvider(s)||s.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,sb.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}or.CoinbaseWalletSDK=Kn;Kn.VERSION=xu.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=or,r=$t;var n=or;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var s=$t;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return s.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Pi);const fb=ju(Pi),kb=Bu({__proto__:null,default:fb},[Pi]);export{kb as i};