@dcl/vesting-dashboard 3.4.0 → 3.4.1

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,4 +1,4 @@
1
- import{d as N,v as rn,B as $,w as Hu,g as nn,x as ur,y as pc,n as gc,p as _i,o as Uu}from"./index-9ab4b2f8.js";function Vu(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 Ti={},or={},sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.walletLogo=void 0;const Wu=(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 `}};sn.walletLogo=Wu;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.LINK_API_URL=void 0;on.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 an={},cn={};(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"}})(cn);Object.defineProperty(an,"__esModule",{value:!0});an.standardErrors=void 0;const ce=qe,mc=cn;an.standardErrors={rpc:{parse:e=>ve(ce.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ve(ce.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ve(ce.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ve(ce.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ve(ce.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(ce.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ve(ce.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ve(ce.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ve(ce.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ve(ce.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ve(ce.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>wt(ce.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>wt(ce.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>wt(ce.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>wt(ce.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>wt(ce.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>wt(ce.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 yc(t,r,n)}}};function ve(e,t){const[r,n]=_c(t);return new bc(e,r||(0,mc.getMessageFromCode)(e),n)}function wt(e,t){const[r,n]=_c(t);return new yc(e,r||(0,mc.getMessageFromCode)(e),n)}function _c(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 bc=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)}},yc=class extends bc{constructor(t,r,n){if(!zu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function zu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ln={},Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.isErrorResponse=void 0;function qu(e){return e.errorMessage!==void 0}Vt.isErrorResponse=qu;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.LIB_VERSION=void 0;Wt.LIB_VERSION="3.9.3";Object.defineProperty(ln,"__esModule",{value:!0});ln.serializeError=void 0;const Ju=Vt,Gu=Wt,Zu=qe,Qu=cn;function Ku(e,t){const r=(0,Qu.serialize)(Xu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Gu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=Yu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ln.serializeError=Ku;function Xu(e){return typeof e=="string"?{message:e,code:Zu.standardErrorCodes.rpc.internal}:(0,Ju.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Yu(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=an;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ln;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=cn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(dr);var se={};Object.defineProperty(se,"__esModule",{value:!0});se.ProviderType=se.RegExpString=se.IntNumber=se.BigIntString=se.AddressString=se.HexString=se.OpaqueType=void 0;function hr(){return e=>e}se.OpaqueType=hr;se.HexString=hr();se.AddressString=hr();se.BigIntString=hr();function ed(e){return Math.floor(e)}se.IntNumber=ed;se.RegExpString=hr();var Uo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Uo||(se.ProviderType=Uo={}));var td=N&&N.__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=td(rn),mt=dr,ke=se,wc=/^[0-9]*$/,vc=/^[a-f0-9]*$/;function rd(e){return Ec(crypto.getRandomValues(new Uint8Array(e)))}S.randomBytesHex=rd;function Ec(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}S.uint8ArrayToHex=Ec;function nd(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}S.hexStringToUint8Array=nd;function sd(e,t=!1){const r=e.toString("hex");return(0,ke.HexString)(t?`0x${r}`:r)}S.hexStringFromBuffer=sd;function id(e){return(0,ke.BigIntString)(e.toString(10))}S.bigIntStringFromBN=id;function od(e){return(0,ke.IntNumber)(new Ke.default(pr(e,!1),16).toNumber())}S.intNumberFromHexString=od;function ad(e){return(0,ke.HexString)(`0x${new Ke.default(e).toString(16)}`)}S.hexStringFromIntNumber=ad;function Mi(e){return e.startsWith("0x")||e.startsWith("0X")}S.has0xPrefix=Mi;function un(e){return Mi(e)?e.slice(2):e}S.strip0x=un;function Sc(e){return Mi(e)?`0x${e.slice(2)}`:`0x${e}`}S.prepend0x=Sc;function fr(e){if(typeof e!="string")return!1;const t=un(e).toLowerCase();return vc.test(t)}S.isHexString=fr;function Cc(e,t=!1){if(typeof e=="string"){const r=un(e).toLowerCase();if(vc.test(r))return(0,ke.HexString)(t?`0x${r}`:r)}throw mt.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}S.ensureHexString=Cc;function pr(e,t=!1){let r=Cc(e,!1);return r.length%2===1&&(r=(0,ke.HexString)(`0${r}`)),t?(0,ke.HexString)(`0x${r}`):r}S.ensureEvenLengthHexString=pr;function cd(e){if(typeof e=="string"){const t=un(e).toLowerCase();if(fr(t)&&t.length===40)return(0,ke.AddressString)(Sc(t))}throw mt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}S.ensureAddressString=cd;function ld(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 mt.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}S.ensureBuffer=ld;function kc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ke.IntNumber)(e);if(typeof e=="string"){if(wc.test(e))return(0,ke.IntNumber)(Number(e));if(fr(e))return(0,ke.IntNumber)(new Ke.default(pr(e,!1),16).toNumber())}throw mt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureIntNumber=kc;function ud(e){if(e instanceof RegExp)return(0,ke.RegExpString)(e.toString());throw mt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}S.ensureRegExpString=ud;function dd(e){if(e!==null&&(Ke.default.isBN(e)||Rc(e)))return new Ke.default(e.toString(10),10);if(typeof e=="number")return new Ke.default(kc(e));if(typeof e=="string"){if(wc.test(e))return new Ke.default(e,10);if(fr(e))return new Ke.default(pr(e,!1),16)}throw mt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureBN=dd;function hd(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw mt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}S.ensureParsedJSONObject=hd;function Rc(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=Rc;function fd(e,t){return Array.from({length:t-e},(r,n)=>e+n)}S.range=fd;function pd(){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=pd;function gd(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=gd;function Ic(){try{return window.frameElement!==null}catch{return!1}}S.isInIFrame=Ic;function md(){try{return Ic()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=md;function _d(){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=_d;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.ScopedLocalStorage=void 0;class bd{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}`}}dn.ScopedLocalStorage=bd;var Ot={},Ac={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(_=1,m=new Array(b-1);_<b;_++)m[_-1]=arguments[_];g.fn.apply(g.context,m)}else{var L=g.length,v;for(_=0;_<L;_++)switch(g[_].once&&this.removeListener(c,g[_].fn,void 0,!0),b){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,d);break;case 3:g[_].fn.call(g[_].context,d,u);break;case 4:g[_].fn.call(g[_].context,d,u,h);break;default:if(!m)for(v=1,m=new Array(b-1);v<b;v++)m[v-1]=arguments[v];g[_].fn.apply(g[_].context,m)}}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})(Ac);var yd=Ac.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 Vo=dr;Ce.WALLET_USER_NAME_KEY="walletUsername";Ce.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ce.APP_VERSION_KEY="AppVersion";class wd{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 Vo.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Vo.serializeError)(i,t.method);return s})}}Ce.RelayAbstract=wd;var qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.Session=void 0;const Wo=Hu,zo=S,qo="session:id",Jo="session:secret",Go="session:linked";class Pi{constructor(t,r,n,s){this._storage=t,this._id=r||(0,zo.randomBytesHex)(16),this._secret=n||(0,zo.randomBytesHex)(32),this._key=new Wo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(qo),n=t.getItem(Go),s=t.getItem(Jo);return r&&s?new Pi(t,r,s,n==="1"):null}static hash(t){return new Wo.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(qo,this._id),this._storage.setItem(Jo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Go,this._linked?"1":"0")}}qt.Session=Pi;var hn={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.Cipher=void 0;const Pr=S;class vd{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)}})()})}}fn.Cipher=vd;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.WalletLinkHTTP=void 0;class Ed{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}`)}}pn.WalletLinkHTTP=Ed;var $t={};Object.defineProperty($t,"__esModule",{value:!0});$t.WalletLinkWebSocket=$t.ConnectionState=void 0;var At;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(At||($t.ConnectionState=At={}));class Sd{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,At.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,At.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,At.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,At.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)}}$t.WalletLinkWebSocket=Sd;Object.defineProperty(hn,"__esModule",{value:!0});hn.WalletLinkConnection=void 0;const vt=se,Cd=fn,Me=zt,Zo=Ce,Et=qt,kd=pn,Or=$t,Qo=1e4,Rd=6e4;class Id{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,vt.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:Et.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(Zo.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Zo.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 Cd.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:Et.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()},Qo),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:Et.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:Et.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 kd.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:Et.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:Et.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,vt.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,vt.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>Qo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Rd){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,vt.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,vt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,vt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}hn.WalletLinkConnection=Id;var _r={},br={},Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.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 Ad=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.injectCssReset=void 0;const Nd=Ad(Oi);function Ld(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Nd.default)),document.documentElement.appendChild(e)}br.injectCssReset=Ld;var gn={},yr,q,Nc,Lc,it,Ko,Tc,bi,$i,yi,wi,Mc,ar={},Pc=[],Td=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mn=Array.isArray;function ze(e,t){for(var r in t)e[r]=t[r];return e}function Oc(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vi(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??++Nc,__i:-1,__u:0};return s==null&&q.vnode!=null&&q.vnode(i),i}function Md(){return{current:null}}function wr(e){return e.children}function nr(e,t){this.props=e,this.context=t}function xt(e,t){if(t==null)return e.__?xt(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"?xt(e):null}function $c(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 $c(e)}}function Ei(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!Zr.__r++||Ko!==q.debounceRendering)&&((Ko=q.debounceRendering)||Tc)(Zr)}function Zr(){var e,t,r,n,s,i,o,a;for(it.sort(bi);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,q.vnode&&q.vnode(n),xi(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,o,i??xt(s),!!(32&s.__u),a),n.__v=s.__v,n.__.__k[n.__i]=n,Bc(o,n,a),n.__e!=i&&$c(n)),it.length>t&&it.sort(bi));Zr.__r=0}function xc(e,t,r,n,s,i,o,a,l,c,d){var u,h,f,p,y,g=n&&n.__k||Pc,b=t.length;for(r.__d=l,Pd(r,t,g),l=r.__d,u=0;u<b;u++)(f=r.__k[u])!=null&&(h=f.__i===-1?ar:g[f.__i]||ar,f.__i=u,xi(e,f,h,s,i,o,a,l,c,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Fi(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=Fc(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 Pd(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++)(s=t[n])!=null&&typeof s!="boolean"&&typeof s!="function"?(o=n+u,(s=e.__k[n]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?rr(null,s,null,null,null):mn(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).__=e,s.__b=e.__b+1,i=null,(a=s.__i=Od(s,r,o,d))!==-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+1?u++:(a>o?u--:u++,s.__u|=65536))):s=e.__k[n]=null;if(d)for(n=0;n<c;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=xt(i)),Dc(i,i))}function Fc(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=Fc(n[s],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=xt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function jc(e,t){return t=t||[],e==null||typeof e=="boolean"||(mn(e)?e.some(function(r){jc(r,t)}):t.push(e)),t}function Od(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 Xo(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Td.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||Xo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Xo(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=$i,e.addEventListener(t,i?wi:yi,i)):e.removeEventListener(t,i?wi:yi,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Yo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=$i++;else if(t.t<r.u)return;return r(q.event?q.event(t):t)}}}function xi(e,t,r,n,s,i,o,a,l,c){var d,u,h,f,p,y,g,b,m,_,L,v,R,V,J,te,D=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=t.__e=r.__e]),(d=q.__b)&&d(t);e:if(typeof D=="function")try{if(b=t.props,m="prototype"in D&&D.prototype.render,_=(d=D.contextType)&&n[d.__c],L=d?_?_.props.value:d.__:n,r.__c?g=(u=t.__c=r.__c).__=u.__E:(m?t.__c=u=new D(b,L):(t.__c=u=new nr(b,L),u.constructor=D,u.render=xd),_&&_.sub(u),u.props=b,u.state||(u.state={}),u.context=L,u.__n=n,h=u.__d=!0,u.__h=[],u._sb=[]),m&&u.__s==null&&(u.__s=u.state),m&&D.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ze({},u.__s)),ze(u.__s,D.getDerivedStateFromProps(b,u.__s))),f=u.props,p=u.state,u.__v=t,h)m&&D.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),m&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(m&&D.getDerivedStateFromProps==null&&b!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,L),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,L)===!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.some(function(re){re&&(re.__=t)}),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,L),m&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,y)})}if(u.context=L,u.props=b,u.__P=e,u.__e=!1,R=q.__r,V=0,m){for(u.state=u.__s,u.__d=!1,R&&R(t),d=u.render(u.props,u.state,u.context),J=0;J<u._sb.length;J++)u.__h.push(u._sb[J]);u._sb=[]}else do u.__d=!1,R&&R(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++V<25);u.state=u.__s,u.getChildContext!=null&&(n=ze(ze({},n),u.getChildContext())),m&&!h&&u.getSnapshotBeforeUpdate!=null&&(y=u.getSnapshotBeforeUpdate(f,p)),xc(e,mn(te=d!=null&&d.type===wr&&d.key==null?d.props.children:d)?te:[te],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(re){if(t.__v=null,l||i!=null){for(t.__u|=l?160:128;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else t.__e=r.__e,t.__k=r.__k;q.__e(re,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=$d(r.__e,t,r,n,s,i,o,l,c);(d=q.diffed)&&d(t)}function Bc(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Fi(r[n],r[++n],r[++n]);q.__c&&q.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){q.__e(i,s.__v)}})}function $d(e,t,r,n,s,i,o,a,l){var c,d,u,h,f,p,y,g=r.props,b=t.props,m=t.type;if(m==="svg"?s="http://www.w3.org/2000/svg":m==="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==!!m&&(m?f.localName===m:f.nodeType===3)){e=f,i[c]=null;break}}if(e==null){if(m===null)return document.createTextNode(b);e=document.createElementNS(s,m,b.is&&b),a&&(q.__m&&q.__m(t,i),a=!1),i=null}if(m===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 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: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=""),xc(e,mn(h)?h:[h],t,r,n,m==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&xt(r,0),a,l),i!=null)for(c=i.length;c--;)Oc(i[c]);a||(c="value",m==="progress"&&p==null?e.removeAttribute("value"):p!==void 0&&(p!==e[c]||m==="progress"&&!p||m==="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 Fi(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){q.__e(s,r)}}function Dc(e,t,r){var n,s;if(q.unmount&&q.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Fi(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){q.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&Dc(n[s],t,r||typeof e.type!="function");r||Oc(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function xd(e,t,r){return this.constructor(e,r)}function Hc(e,t,r){var n,s,i,o;q.__&&q.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],xi(t,e=(!n&&r||t).__k=vi(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),Bc(i,e,o)}function Uc(e,t){Hc(e,t,Uc)}function Fd(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 jd(e,t){var r={__c:t="__cC"+Mc++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=new Set,(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&s.forEach(function(a){a.__e=!0,Ei(a)})},this.sub=function(o){s.add(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){s&&s.delete(o),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}yr=Pc.slice,q={__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}},Nc=0,Lc=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),Ei(this))},nr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ei(this))},nr.prototype.render=wr,it=[],Tc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bi=function(e,t){return e.__v.__b-t.__v.__b},Zr.__r=0,$i=0,yi=Yo(!1),wi=Yo(!0),Mc=0;const Bd=Object.freeze(Object.defineProperty({__proto__:null,Component:nr,Fragment:wr,cloneElement:Fd,createContext:jd,createElement:vi,createRef:Md,h:vi,hydrate:Uc,get isValidElement(){return Lc},get options(){return q},render:Hc,toChildArray:jc},Symbol.toStringTag,{value:"Module"})),me=nn(Bd);var _n={},Je,W,Gs,ea,Ft=0,Vc=[],K=q,ta=K.__b,ra=K.__r,na=K.diffed,sa=K.__c,ia=K.unmount,oa=K.__;function _t(e,t){K.__h&&K.__h(W,e,Ft||t),Ft=0;var r=W.__H||(W.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Wc(e){return Ft=1,zc(Jc,e)}function zc(e,t,r){var n=_t(Je++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Jc(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 Dd(e,t){var r=_t(Je++,3);!K.__s&&Bi(r.__H,t)&&(r.__=e,r.i=t,W.__H.__h.push(r))}function qc(e,t){var r=_t(Je++,4);!K.__s&&Bi(r.__H,t)&&(r.__=e,r.i=t,W.__h.push(r))}function Hd(e){return Ft=5,ji(function(){return{current:e}},[])}function Ud(e,t,r){Ft=6,qc(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 ji(e,t){var r=_t(Je++,7);return Bi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Vd(e,t){return Ft=8,ji(function(){return e},t)}function Wd(e){var t=W.context[e.__c],r=_t(Je++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(W)),t.props.value):e.__}function zd(e,t){K.useDebugValue&&K.useDebugValue(t?t(e):e)}function qd(e){var t=_t(Je++,10),r=Wc();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 Jd(){var e=_t(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 Gd(){for(var e;e=Vc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Jr),e.__H.__h.forEach(Si),e.__H.__h=[]}catch(t){e.__H.__h=[],K.__e(t,e.__v)}}K.__b=function(e){W=null,ta&&ta(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),oa&&oa(e,t)},K.__r=function(e){ra&&ra(e),Je=0;var t=(W=e.__c).__H;t&&(Gs===W?(t.__h=[],W.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Jr),t.__h.forEach(Si),t.__h=[],Je=0)),Gs=W},K.diffed=function(e){na&&na(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Vc.push(t)!==1&&ea===K.requestAnimationFrame||((ea=K.requestAnimationFrame)||Zd)(Gd)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Gs=W=null},K.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Jr),r.__h=r.__h.filter(function(n){return!n.__||Si(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],K.__e(n,r.__v)}}),sa&&sa(e,t)},K.unmount=function(e){ia&&ia(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Jr(n)}catch(s){t=s}}),r.__H=void 0,t&&K.__e(t,r.__v))};var aa=typeof requestAnimationFrame=="function";function Zd(e){var t,r=function(){clearTimeout(n),aa&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);aa&&(t=requestAnimationFrame(r))}function Jr(e){var t=W,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),W=t}function Si(e){var t=W;e.__c=e.__(),W=t}function Bi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Jc(e,t){return typeof t=="function"?t(e):t}const Qd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Vd,useContext:Wd,useDebugValue:zd,useEffect:Dd,useErrorBoundary:qd,useId:Jd,useImperativeHandle:Ud,useLayoutEffect:qc,useMemo:ji,useReducer:zc,useRef:Hd,useState:Wc},Symbol.toStringTag,{value:"Module"})),bn=nn(Qd);var jt={},yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.CloseIcon=void 0;const ca=me;function Kd(e){return(0,ca.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ca.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"}))}yn.CloseIcon=Kd;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.CoinbaseWalletRound=void 0;const xr=me;function Xd(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"}))}wn.CoinbaseWalletRound=Xd;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.QRCodeIcon=void 0;const Kt=me;function Yd(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"}))}vn.QRCodeIcon=Yd;var En={};function Gc(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))}Gc.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 Gc(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=Q.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=Q.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=Q.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=Q.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=Q.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 Zc,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),Q.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=Q.getErrorCorrectPolynomial(c),h=new Nt(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},Q={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;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15)>=0;)t^=Q.G15<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15);return(e<<10|t)^Q.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18)>=0;)t^=Q.G18<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Q.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 Nt([1],0),r=0;r<e;r++)t=t.multiply(new Nt([1,ae.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}},ae={glog:function(e){if(e<1)throw new Error("glog("+e+")");return ae.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return ae.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var le=0;le<8;le++)ae.EXP_TABLE[le]=1<<le;for(var le=8;le<256;le++)ae.EXP_TABLE[le]=ae.EXP_TABLE[le-4]^ae.EXP_TABLE[le-5]^ae.EXP_TABLE[le-6]^ae.EXP_TABLE[le-8];for(var le=0;le<255;le++)ae.LOG_TABLE[ae.EXP_TABLE[le]]=le;function Nt(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]}Nt.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]^=ae.gexp(ae.glog(this.get(r))+ae.glog(e.get(n)));return new Nt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=ae.glog(this.get(0))-ae.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]^=ae.gexp(ae.glog(e.get(n))+t);return new Nt(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 Zc(){this.buffer=[],this.length=0}Zc.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 Zs=[[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 Qc(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=Zs.length;f<=p;f++){var y=Zs[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>Zs.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()}Qc.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
1
+ import{d as N,v as rn,B as $,w as Hu,g as nn,x as ur,y as pc,n as gc,p as _i,o as Uu}from"./index-e375682a.js";function Vu(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 Ti={},or={},sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.walletLogo=void 0;const Wu=(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 `}};sn.walletLogo=Wu;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.LINK_API_URL=void 0;on.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 an={},cn={};(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"}})(cn);Object.defineProperty(an,"__esModule",{value:!0});an.standardErrors=void 0;const ce=qe,mc=cn;an.standardErrors={rpc:{parse:e=>ve(ce.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ve(ce.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ve(ce.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ve(ce.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ve(ce.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(ce.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ve(ce.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ve(ce.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ve(ce.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ve(ce.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ve(ce.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>wt(ce.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>wt(ce.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>wt(ce.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>wt(ce.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>wt(ce.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>wt(ce.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 yc(t,r,n)}}};function ve(e,t){const[r,n]=_c(t);return new bc(e,r||(0,mc.getMessageFromCode)(e),n)}function wt(e,t){const[r,n]=_c(t);return new yc(e,r||(0,mc.getMessageFromCode)(e),n)}function _c(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 bc=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)}},yc=class extends bc{constructor(t,r,n){if(!zu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function zu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ln={},Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.isErrorResponse=void 0;function qu(e){return e.errorMessage!==void 0}Vt.isErrorResponse=qu;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.LIB_VERSION=void 0;Wt.LIB_VERSION="3.9.3";Object.defineProperty(ln,"__esModule",{value:!0});ln.serializeError=void 0;const Ju=Vt,Gu=Wt,Zu=qe,Qu=cn;function Ku(e,t){const r=(0,Qu.serialize)(Xu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Gu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=Yu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ln.serializeError=Ku;function Xu(e){return typeof e=="string"?{message:e,code:Zu.standardErrorCodes.rpc.internal}:(0,Ju.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Yu(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=an;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ln;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=cn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(dr);var se={};Object.defineProperty(se,"__esModule",{value:!0});se.ProviderType=se.RegExpString=se.IntNumber=se.BigIntString=se.AddressString=se.HexString=se.OpaqueType=void 0;function hr(){return e=>e}se.OpaqueType=hr;se.HexString=hr();se.AddressString=hr();se.BigIntString=hr();function ed(e){return Math.floor(e)}se.IntNumber=ed;se.RegExpString=hr();var Uo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Uo||(se.ProviderType=Uo={}));var td=N&&N.__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=td(rn),mt=dr,ke=se,wc=/^[0-9]*$/,vc=/^[a-f0-9]*$/;function rd(e){return Ec(crypto.getRandomValues(new Uint8Array(e)))}S.randomBytesHex=rd;function Ec(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}S.uint8ArrayToHex=Ec;function nd(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}S.hexStringToUint8Array=nd;function sd(e,t=!1){const r=e.toString("hex");return(0,ke.HexString)(t?`0x${r}`:r)}S.hexStringFromBuffer=sd;function id(e){return(0,ke.BigIntString)(e.toString(10))}S.bigIntStringFromBN=id;function od(e){return(0,ke.IntNumber)(new Ke.default(pr(e,!1),16).toNumber())}S.intNumberFromHexString=od;function ad(e){return(0,ke.HexString)(`0x${new Ke.default(e).toString(16)}`)}S.hexStringFromIntNumber=ad;function Mi(e){return e.startsWith("0x")||e.startsWith("0X")}S.has0xPrefix=Mi;function un(e){return Mi(e)?e.slice(2):e}S.strip0x=un;function Sc(e){return Mi(e)?`0x${e.slice(2)}`:`0x${e}`}S.prepend0x=Sc;function fr(e){if(typeof e!="string")return!1;const t=un(e).toLowerCase();return vc.test(t)}S.isHexString=fr;function Cc(e,t=!1){if(typeof e=="string"){const r=un(e).toLowerCase();if(vc.test(r))return(0,ke.HexString)(t?`0x${r}`:r)}throw mt.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}S.ensureHexString=Cc;function pr(e,t=!1){let r=Cc(e,!1);return r.length%2===1&&(r=(0,ke.HexString)(`0${r}`)),t?(0,ke.HexString)(`0x${r}`):r}S.ensureEvenLengthHexString=pr;function cd(e){if(typeof e=="string"){const t=un(e).toLowerCase();if(fr(t)&&t.length===40)return(0,ke.AddressString)(Sc(t))}throw mt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}S.ensureAddressString=cd;function ld(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 mt.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}S.ensureBuffer=ld;function kc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ke.IntNumber)(e);if(typeof e=="string"){if(wc.test(e))return(0,ke.IntNumber)(Number(e));if(fr(e))return(0,ke.IntNumber)(new Ke.default(pr(e,!1),16).toNumber())}throw mt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureIntNumber=kc;function ud(e){if(e instanceof RegExp)return(0,ke.RegExpString)(e.toString());throw mt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}S.ensureRegExpString=ud;function dd(e){if(e!==null&&(Ke.default.isBN(e)||Rc(e)))return new Ke.default(e.toString(10),10);if(typeof e=="number")return new Ke.default(kc(e));if(typeof e=="string"){if(wc.test(e))return new Ke.default(e,10);if(fr(e))return new Ke.default(pr(e,!1),16)}throw mt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureBN=dd;function hd(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw mt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}S.ensureParsedJSONObject=hd;function Rc(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=Rc;function fd(e,t){return Array.from({length:t-e},(r,n)=>e+n)}S.range=fd;function pd(){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=pd;function gd(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=gd;function Ic(){try{return window.frameElement!==null}catch{return!1}}S.isInIFrame=Ic;function md(){try{return Ic()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=md;function _d(){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=_d;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.ScopedLocalStorage=void 0;class bd{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}`}}dn.ScopedLocalStorage=bd;var Ot={},Ac={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(_=1,m=new Array(b-1);_<b;_++)m[_-1]=arguments[_];g.fn.apply(g.context,m)}else{var L=g.length,v;for(_=0;_<L;_++)switch(g[_].once&&this.removeListener(c,g[_].fn,void 0,!0),b){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,d);break;case 3:g[_].fn.call(g[_].context,d,u);break;case 4:g[_].fn.call(g[_].context,d,u,h);break;default:if(!m)for(v=1,m=new Array(b-1);v<b;v++)m[v-1]=arguments[v];g[_].fn.apply(g[_].context,m)}}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})(Ac);var yd=Ac.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 Vo=dr;Ce.WALLET_USER_NAME_KEY="walletUsername";Ce.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ce.APP_VERSION_KEY="AppVersion";class wd{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 Vo.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Vo.serializeError)(i,t.method);return s})}}Ce.RelayAbstract=wd;var qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.Session=void 0;const Wo=Hu,zo=S,qo="session:id",Jo="session:secret",Go="session:linked";class Pi{constructor(t,r,n,s){this._storage=t,this._id=r||(0,zo.randomBytesHex)(16),this._secret=n||(0,zo.randomBytesHex)(32),this._key=new Wo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(qo),n=t.getItem(Go),s=t.getItem(Jo);return r&&s?new Pi(t,r,s,n==="1"):null}static hash(t){return new Wo.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(qo,this._id),this._storage.setItem(Jo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Go,this._linked?"1":"0")}}qt.Session=Pi;var hn={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.Cipher=void 0;const Pr=S;class vd{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)}})()})}}fn.Cipher=vd;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.WalletLinkHTTP=void 0;class Ed{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}`)}}pn.WalletLinkHTTP=Ed;var $t={};Object.defineProperty($t,"__esModule",{value:!0});$t.WalletLinkWebSocket=$t.ConnectionState=void 0;var At;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(At||($t.ConnectionState=At={}));class Sd{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,At.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,At.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,At.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,At.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)}}$t.WalletLinkWebSocket=Sd;Object.defineProperty(hn,"__esModule",{value:!0});hn.WalletLinkConnection=void 0;const vt=se,Cd=fn,Me=zt,Zo=Ce,Et=qt,kd=pn,Or=$t,Qo=1e4,Rd=6e4;class Id{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,vt.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:Et.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(Zo.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Zo.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 Cd.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:Et.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()},Qo),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:Et.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:Et.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 kd.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:Et.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:Et.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,vt.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,vt.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>Qo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Rd){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,vt.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,vt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,vt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}hn.WalletLinkConnection=Id;var _r={},br={},Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.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 Ad=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.injectCssReset=void 0;const Nd=Ad(Oi);function Ld(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Nd.default)),document.documentElement.appendChild(e)}br.injectCssReset=Ld;var gn={},yr,q,Nc,Lc,it,Ko,Tc,bi,$i,yi,wi,Mc,ar={},Pc=[],Td=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mn=Array.isArray;function ze(e,t){for(var r in t)e[r]=t[r];return e}function Oc(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vi(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??++Nc,__i:-1,__u:0};return s==null&&q.vnode!=null&&q.vnode(i),i}function Md(){return{current:null}}function wr(e){return e.children}function nr(e,t){this.props=e,this.context=t}function xt(e,t){if(t==null)return e.__?xt(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"?xt(e):null}function $c(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 $c(e)}}function Ei(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!Zr.__r++||Ko!==q.debounceRendering)&&((Ko=q.debounceRendering)||Tc)(Zr)}function Zr(){var e,t,r,n,s,i,o,a;for(it.sort(bi);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,q.vnode&&q.vnode(n),xi(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,o,i??xt(s),!!(32&s.__u),a),n.__v=s.__v,n.__.__k[n.__i]=n,Bc(o,n,a),n.__e!=i&&$c(n)),it.length>t&&it.sort(bi));Zr.__r=0}function xc(e,t,r,n,s,i,o,a,l,c,d){var u,h,f,p,y,g=n&&n.__k||Pc,b=t.length;for(r.__d=l,Pd(r,t,g),l=r.__d,u=0;u<b;u++)(f=r.__k[u])!=null&&(h=f.__i===-1?ar:g[f.__i]||ar,f.__i=u,xi(e,f,h,s,i,o,a,l,c,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Fi(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=Fc(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 Pd(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++)(s=t[n])!=null&&typeof s!="boolean"&&typeof s!="function"?(o=n+u,(s=e.__k[n]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?rr(null,s,null,null,null):mn(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).__=e,s.__b=e.__b+1,i=null,(a=s.__i=Od(s,r,o,d))!==-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+1?u++:(a>o?u--:u++,s.__u|=65536))):s=e.__k[n]=null;if(d)for(n=0;n<c;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=xt(i)),Dc(i,i))}function Fc(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=Fc(n[s],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=xt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function jc(e,t){return t=t||[],e==null||typeof e=="boolean"||(mn(e)?e.some(function(r){jc(r,t)}):t.push(e)),t}function Od(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 Xo(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Td.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||Xo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Xo(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=$i,e.addEventListener(t,i?wi:yi,i)):e.removeEventListener(t,i?wi:yi,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Yo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=$i++;else if(t.t<r.u)return;return r(q.event?q.event(t):t)}}}function xi(e,t,r,n,s,i,o,a,l,c){var d,u,h,f,p,y,g,b,m,_,L,v,R,V,J,te,D=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=t.__e=r.__e]),(d=q.__b)&&d(t);e:if(typeof D=="function")try{if(b=t.props,m="prototype"in D&&D.prototype.render,_=(d=D.contextType)&&n[d.__c],L=d?_?_.props.value:d.__:n,r.__c?g=(u=t.__c=r.__c).__=u.__E:(m?t.__c=u=new D(b,L):(t.__c=u=new nr(b,L),u.constructor=D,u.render=xd),_&&_.sub(u),u.props=b,u.state||(u.state={}),u.context=L,u.__n=n,h=u.__d=!0,u.__h=[],u._sb=[]),m&&u.__s==null&&(u.__s=u.state),m&&D.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ze({},u.__s)),ze(u.__s,D.getDerivedStateFromProps(b,u.__s))),f=u.props,p=u.state,u.__v=t,h)m&&D.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),m&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(m&&D.getDerivedStateFromProps==null&&b!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,L),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,L)===!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.some(function(re){re&&(re.__=t)}),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,L),m&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,y)})}if(u.context=L,u.props=b,u.__P=e,u.__e=!1,R=q.__r,V=0,m){for(u.state=u.__s,u.__d=!1,R&&R(t),d=u.render(u.props,u.state,u.context),J=0;J<u._sb.length;J++)u.__h.push(u._sb[J]);u._sb=[]}else do u.__d=!1,R&&R(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++V<25);u.state=u.__s,u.getChildContext!=null&&(n=ze(ze({},n),u.getChildContext())),m&&!h&&u.getSnapshotBeforeUpdate!=null&&(y=u.getSnapshotBeforeUpdate(f,p)),xc(e,mn(te=d!=null&&d.type===wr&&d.key==null?d.props.children:d)?te:[te],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(re){if(t.__v=null,l||i!=null){for(t.__u|=l?160:128;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else t.__e=r.__e,t.__k=r.__k;q.__e(re,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=$d(r.__e,t,r,n,s,i,o,l,c);(d=q.diffed)&&d(t)}function Bc(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Fi(r[n],r[++n],r[++n]);q.__c&&q.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){q.__e(i,s.__v)}})}function $d(e,t,r,n,s,i,o,a,l){var c,d,u,h,f,p,y,g=r.props,b=t.props,m=t.type;if(m==="svg"?s="http://www.w3.org/2000/svg":m==="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==!!m&&(m?f.localName===m:f.nodeType===3)){e=f,i[c]=null;break}}if(e==null){if(m===null)return document.createTextNode(b);e=document.createElementNS(s,m,b.is&&b),a&&(q.__m&&q.__m(t,i),a=!1),i=null}if(m===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 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: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=""),xc(e,mn(h)?h:[h],t,r,n,m==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&xt(r,0),a,l),i!=null)for(c=i.length;c--;)Oc(i[c]);a||(c="value",m==="progress"&&p==null?e.removeAttribute("value"):p!==void 0&&(p!==e[c]||m==="progress"&&!p||m==="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 Fi(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){q.__e(s,r)}}function Dc(e,t,r){var n,s;if(q.unmount&&q.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Fi(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){q.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&Dc(n[s],t,r||typeof e.type!="function");r||Oc(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function xd(e,t,r){return this.constructor(e,r)}function Hc(e,t,r){var n,s,i,o;q.__&&q.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],xi(t,e=(!n&&r||t).__k=vi(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),Bc(i,e,o)}function Uc(e,t){Hc(e,t,Uc)}function Fd(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 jd(e,t){var r={__c:t="__cC"+Mc++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=new Set,(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&s.forEach(function(a){a.__e=!0,Ei(a)})},this.sub=function(o){s.add(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){s&&s.delete(o),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}yr=Pc.slice,q={__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}},Nc=0,Lc=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),Ei(this))},nr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ei(this))},nr.prototype.render=wr,it=[],Tc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bi=function(e,t){return e.__v.__b-t.__v.__b},Zr.__r=0,$i=0,yi=Yo(!1),wi=Yo(!0),Mc=0;const Bd=Object.freeze(Object.defineProperty({__proto__:null,Component:nr,Fragment:wr,cloneElement:Fd,createContext:jd,createElement:vi,createRef:Md,h:vi,hydrate:Uc,get isValidElement(){return Lc},get options(){return q},render:Hc,toChildArray:jc},Symbol.toStringTag,{value:"Module"})),me=nn(Bd);var _n={},Je,W,Gs,ea,Ft=0,Vc=[],K=q,ta=K.__b,ra=K.__r,na=K.diffed,sa=K.__c,ia=K.unmount,oa=K.__;function _t(e,t){K.__h&&K.__h(W,e,Ft||t),Ft=0;var r=W.__H||(W.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Wc(e){return Ft=1,zc(Jc,e)}function zc(e,t,r){var n=_t(Je++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Jc(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 Dd(e,t){var r=_t(Je++,3);!K.__s&&Bi(r.__H,t)&&(r.__=e,r.i=t,W.__H.__h.push(r))}function qc(e,t){var r=_t(Je++,4);!K.__s&&Bi(r.__H,t)&&(r.__=e,r.i=t,W.__h.push(r))}function Hd(e){return Ft=5,ji(function(){return{current:e}},[])}function Ud(e,t,r){Ft=6,qc(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 ji(e,t){var r=_t(Je++,7);return Bi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Vd(e,t){return Ft=8,ji(function(){return e},t)}function Wd(e){var t=W.context[e.__c],r=_t(Je++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(W)),t.props.value):e.__}function zd(e,t){K.useDebugValue&&K.useDebugValue(t?t(e):e)}function qd(e){var t=_t(Je++,10),r=Wc();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 Jd(){var e=_t(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 Gd(){for(var e;e=Vc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Jr),e.__H.__h.forEach(Si),e.__H.__h=[]}catch(t){e.__H.__h=[],K.__e(t,e.__v)}}K.__b=function(e){W=null,ta&&ta(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),oa&&oa(e,t)},K.__r=function(e){ra&&ra(e),Je=0;var t=(W=e.__c).__H;t&&(Gs===W?(t.__h=[],W.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Jr),t.__h.forEach(Si),t.__h=[],Je=0)),Gs=W},K.diffed=function(e){na&&na(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Vc.push(t)!==1&&ea===K.requestAnimationFrame||((ea=K.requestAnimationFrame)||Zd)(Gd)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Gs=W=null},K.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Jr),r.__h=r.__h.filter(function(n){return!n.__||Si(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],K.__e(n,r.__v)}}),sa&&sa(e,t)},K.unmount=function(e){ia&&ia(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Jr(n)}catch(s){t=s}}),r.__H=void 0,t&&K.__e(t,r.__v))};var aa=typeof requestAnimationFrame=="function";function Zd(e){var t,r=function(){clearTimeout(n),aa&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);aa&&(t=requestAnimationFrame(r))}function Jr(e){var t=W,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),W=t}function Si(e){var t=W;e.__c=e.__(),W=t}function Bi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Jc(e,t){return typeof t=="function"?t(e):t}const Qd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Vd,useContext:Wd,useDebugValue:zd,useEffect:Dd,useErrorBoundary:qd,useId:Jd,useImperativeHandle:Ud,useLayoutEffect:qc,useMemo:ji,useReducer:zc,useRef:Hd,useState:Wc},Symbol.toStringTag,{value:"Module"})),bn=nn(Qd);var jt={},yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.CloseIcon=void 0;const ca=me;function Kd(e){return(0,ca.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ca.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"}))}yn.CloseIcon=Kd;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.CoinbaseWalletRound=void 0;const xr=me;function Xd(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"}))}wn.CoinbaseWalletRound=Xd;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.QRCodeIcon=void 0;const Kt=me;function Yd(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"}))}vn.QRCodeIcon=Yd;var En={};function Gc(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))}Gc.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 Gc(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=Q.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=Q.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=Q.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=Q.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=Q.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 Zc,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),Q.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=Q.getErrorCorrectPolynomial(c),h=new Nt(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},Q={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;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15)>=0;)t^=Q.G15<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15);return(e<<10|t)^Q.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18)>=0;)t^=Q.G18<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Q.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 Nt([1],0),r=0;r<e;r++)t=t.multiply(new Nt([1,ae.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}},ae={glog:function(e){if(e<1)throw new Error("glog("+e+")");return ae.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return ae.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var le=0;le<8;le++)ae.EXP_TABLE[le]=1<<le;for(var le=8;le<256;le++)ae.EXP_TABLE[le]=ae.EXP_TABLE[le-4]^ae.EXP_TABLE[le-5]^ae.EXP_TABLE[le-6]^ae.EXP_TABLE[le-8];for(var le=0;le<255;le++)ae.LOG_TABLE[ae.EXP_TABLE[le]]=le;function Nt(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]}Nt.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]^=ae.gexp(ae.glog(this.get(r))+ae.glog(e.get(n)));return new Nt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=ae.glog(this.get(0))-ae.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]^=ae.gexp(ae.glog(e.get(n))+t);return new Nt(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 Zc(){this.buffer=[],this.length=0}Zc.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 Zs=[[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 Qc(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=Zs.length;f<=p;f++){var y=Zs[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>Zs.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()}Qc.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
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;_<l;_++)for(var L=0;L<l;L++){var v=r[L][_];if(v){var R=L*c+t.padding*c,V=_*d+t.padding*d;if(h){var J=R;R=V,V=J}if(u){var te=c+R,D=d+V;R=Number.isInteger(R)?Number(R):R.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),te=Number.isInteger(te)?Number(te):te.toFixed(2),D=Number.isInteger(D)?Number(D):D.toFixed(2),m+="M"+R+","+V+" V"+D+" H"+te+" V"+V+" H"+R+" Z "}else p?b+=s+'<use x="'+R.toString()+'" y="'+V.toString()+'" href="#qrmodule" />'+i:b+=s+'<rect x="'+R.toString()+'" y="'+V.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="'+m+'" />');let re="";if(this.options.image!==void 0&&this.options.image.svg){const E=o*this.options.image.width/100,w=a*this.options.image.height/100,I=o/2-E/2,k=a/2-w/2;re+=`<svg x="${I}" y="${k}" width="${E}" height="${w}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,re+=this.options.image.svg+i,re+="</svg>"}var Y="";switch(e.container){case"svg":f&&(Y+='<?xml version="1.0" standalone="yes"?>'+i),Y+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,Y+=y+g+b,Y+=re,Y+="</svg>";break;case"svg-viewbox":f&&(Y+='<?xml version="1.0" standalone="yes"?>'+i),Y+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,Y+=y+g+b,Y+=re,Y+="</svg>";break;case"g":Y+='<g width="'+o+'" height="'+a+'">'+i,Y+=y+g+b,Y+=re,Y+="</g>";break;default:Y+=(y+g+b+re).replace(/^\s+/,"");break}return Y};var eh=Qc,th=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(En,"__esModule",{value:!0});En.QRCode=void 0;const rh=me,la=bn,nh=th(eh),sh=e=>{const[t,r]=(0,la.useState)("");return(0,la.useEffect)(()=>{var n,s;const i=new nh.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,rh.h)("img",{src:t,alt:"QR Code"}):null};En.QRCode=sh;var Sn={},Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.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 ih=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.Spinner=void 0;const Fr=me,oh=ih(Di),ah=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,oh.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}})))};Sn.Spinner=ah;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.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 Kc=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jt,"__esModule",{value:!0});jt.CoinbaseWalletSteps=jt.ConnectContent=void 0;const ht=Kc(ur),j=me,ch=S,lh=Wt,uh=yn,dh=wn,hh=vn,fh=En,ph=Sn,gh=Kc(Hi),Qs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Xc},mh=e=>e==="light"?"#FFFFFF":"#0A0B0D";function _h(e){const{theme:t}=e,r=(0,ch.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Qs.steps;return(0,j.h)("div",{"data-testid":"connect-content",className:(0,ht.default)("-cbwsdk-connect-content",t)},(0,j.h)("style",null,gh.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)(uh.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)(bh,{title:Qs.title,description:Qs.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)(fh.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,j.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:lh.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)(ph.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,j.h)("p",null,"Connecting...")))))}jt.ConnectContent=_h;function bh({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)(dh.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 Xc({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)(hh.QRCodeIcon,{fill:mh(e)})))))}jt.CoinbaseWalletSteps=Xc;var Cn={},kn={};Object.defineProperty(kn,"__esModule",{value:!0});kn.ArrowLeftIcon=void 0;const ua=me;function yh(e){return(0,ua.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,ua.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"}))}kn.ArrowLeftIcon=yh;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.LaptopIcon=void 0;const Ks=me;function wh(e){return(0,Ks.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ks.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ks.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"}))}Rn.LaptopIcon=wh;var In={};Object.defineProperty(In,"__esModule",{value:!0});In.SafeIcon=void 0;const da=me;function vh(e){return(0,da.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,da.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"}))}In.SafeIcon=vh;var Ui={};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.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 Yc=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.TryExtensionContent=void 0;const tt=Yc(ur),ne=me,Xs=bn,Eh=kn,Sh=Rn,Ch=In,kh=Yc(Ui);function Rh({theme:e}){const[t,r]=(0,Xs.useState)(!1),n=(0,Xs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,Xs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,ne.h)("div",{class:(0,tt.default)("-cbwsdk-try-extension",e)},(0,ne.h)("style",null,kh.default),(0,ne.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ne.h)("h3",{class:(0,tt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,ne.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ne.h)("button",{class:(0,tt.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,ne.h)("div",null,!t&&(0,ne.h)(Eh.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,ne.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ne.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ne.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ne.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ne.h)("span",{class:(0,tt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ne.h)(Sh.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ne.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,ne.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ne.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ne.h)("span",{class:(0,tt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ne.h)(Ch.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ne.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")))))}Cn.TryExtensionContent=Rh;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.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 el=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_n,"__esModule",{value:!0});_n.ConnectDialog=void 0;const Ys=el(ur),rt=me,ei=bn,Ih=jt,Ah=Cn,Nh=el(Vi),Lh=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,ei.useState)(!t),[i,o]=(0,ei.useState)(!t);(0,ei.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,Ys.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,rt.h)("style",null,Nh.default),(0,rt.h)("div",{class:(0,Ys.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,Ys.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,rt.h)(Ih.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)(Ah.TryExtensionContent,{theme:a}))))};_n.ConnectDialog=Lh;Object.defineProperty(gn,"__esModule",{value:!0});gn.LinkFlow=void 0;const ti=me,Th=_n;class Mh{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,ti.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,ti.render)((0,ti.h)(Th.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)}}gn.LinkFlow=Mh;var Wi={},zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.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=N&&N.__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=bn,i=t(zi),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 _=[window.setTimeout(()=>{y(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{_.forEach(window.clearTimeout)}});const m=()=>{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:m},(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((_,L)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",_.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:_.onClick,key:L},(0,n.h)("svg",{width:_.svgWidth,height:_.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":_.defaultFillRule,"clip-rule":_.defaultClipRule,d:_.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",_.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},_.info)))))};e.SnackbarInstance=d})(Wi);Object.defineProperty(_r,"__esModule",{value:!0});_r.WalletLinkRelayUI=void 0;const Ph=br,Oh=gn,$h=Wi;class xh{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new $h.Snackbar({darkMode:t.darkMode}),this.linkFlow=new Oh.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,Ph.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=xh;Object.defineProperty(mr,"__esModule",{value:!0});mr.WalletLinkRelay=void 0;const St=dr,Fh=se,Z=S,nt=zt,ha=Ce,Qe=qt,jh=hn,st=Vt,Bh=_r;class Ve extends ha.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(ha.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 jh.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,Z.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Z.hexStringFromBuffer)(t,!0),signature:(0,Z.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Z.bigIntStringFromBN)(t.weiValue),data:(0,Z.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Z.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Z.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Z.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Z.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,Z.bigIntStringFromBN)(t.weiValue),data:(0,Z.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Z.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Z.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Z.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Z.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Z.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Z.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,Z.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 Bh.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,St.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,Z.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=St.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,Z.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:Fh.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,Z.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,Z.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,Z.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(St.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,St.getErrorCode)(u))!==null&&h!==void 0?h:St.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",u instanceof Error?u:St.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={},An={},tl={};(function(e){var t=N&&N.__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=N&&N.__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(Wi,e)})(tl);var qi={};Object.defineProperty(qi,"__esModule",{value:!0});qi.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 rl=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(An,"__esModule",{value:!0});An.RedirectDialog=void 0;const Dh=rl(ur),xe=me,Hh=br,Uh=tl,Vh=rl(qi);class Wh{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,Hh.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)(zh,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}An.RedirectDialog=Wh;const zh=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,xe.h)(Uh.SnackbarContainer,{darkMode:r},(0,xe.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,xe.h)("style",null,Vh.default),(0,xe.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,xe.h)("div",{class:(0,Dh.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 qh=An;class Jh{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new qh.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=Jh;Object.defineProperty(gr,"__esModule",{value:!0});gr.MobileRelay=void 0;const Gh=S,Zh=mr,Qh=vr;class Kh 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,Gh.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=Kh;const{Transform:Xh}=pc;var Yh=e=>class nl extends Xh{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 nl(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:ef}=pc;var tf=e=>class sl extends ef{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!$.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 sl(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const rf=Yh,nf=tf;var sf=function(e){const t=rf(e),r=nf(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)}}},il={};const fa=[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];il.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,m=e[20]^h,_=e[21]^f,L=e[30]^h,v=e[31]^f,R=e[40]^h,V=e[41]^f;h=r^(o<<1|a>>>31),f=n^(a<<1|o>>>31);const J=e[2]^h,te=e[3]^f,D=e[12]^h,re=e[13]^f,Y=e[22]^h,E=e[23]^f,w=e[32]^h,I=e[33]^f,k=e[42]^h,A=e[43]^f;h=s^(l<<1|c>>>31),f=i^(c<<1|l>>>31);const C=e[4]^h,M=e[5]^f,U=e[14]^h,O=e[15]^f,z=e[24]^h,de=e[25]^f,G=e[34]^h,Ge=e[35]^f,Kn=e[44]^h,vo=e[45]^f;h=o^(d<<1|u>>>31),f=a^(u<<1|d>>>31);const Eo=e[6]^h,So=e[7]^f,Co=e[16]^h,ko=e[17]^f,Ro=e[26]^h,Io=e[27]^f,Ao=e[36]^h,No=e[37]^f,Lo=e[46]^h,To=e[47]^f;h=l^(r<<1|n>>>31),f=c^(n<<1|r>>>31);const Mo=e[8]^h,Po=e[9]^f,Oo=e[18]^h,$o=e[19]^f,xo=e[28]^h,Fo=e[29]^f,jo=e[38]^h,Bo=e[39]^f,Do=e[48]^h,Ho=e[49]^f,Xn=p,Yn=y,es=b<<4|g>>>28,ts=g<<4|b>>>28,rs=m<<3|_>>>29,ns=_<<3|m>>>29,ss=v<<9|L>>>23,is=L<<9|v>>>23,os=R<<18|V>>>14,as=V<<18|R>>>14,cs=J<<1|te>>>31,ls=te<<1|J>>>31,us=re<<12|D>>>20,ds=D<<12|re>>>20,hs=Y<<10|E>>>22,fs=E<<10|Y>>>22,ps=I<<13|w>>>19,gs=w<<13|I>>>19,ms=k<<2|A>>>30,_s=A<<2|k>>>30,bs=M<<30|C>>>2,ys=C<<30|M>>>2,ws=U<<6|O>>>26,vs=O<<6|U>>>26,Es=de<<11|z>>>21,Ss=z<<11|de>>>21,Cs=G<<15|Ge>>>17,ks=Ge<<15|G>>>17,Rs=vo<<29|Kn>>>3,Is=Kn<<29|vo>>>3,As=Eo<<28|So>>>4,Ns=So<<28|Eo>>>4,Ls=ko<<23|Co>>>9,Ts=Co<<23|ko>>>9,Ms=Ro<<25|Io>>>7,Ps=Io<<25|Ro>>>7,Os=Ao<<21|No>>>11,$s=No<<21|Ao>>>11,xs=To<<24|Lo>>>8,Fs=Lo<<24|To>>>8,js=Mo<<27|Po>>>5,Bs=Po<<27|Mo>>>5,Ds=Oo<<20|$o>>>12,Hs=$o<<20|Oo>>>12,Us=Fo<<7|xo>>>25,Vs=xo<<7|Fo>>>25,Ws=jo<<8|Bo>>>24,zs=Bo<<8|jo>>>24,qs=Do<<14|Ho>>>18,Js=Ho<<14|Do>>>18;e[0]=Xn^~us&Es,e[1]=Yn^~ds&Ss,e[10]=As^~Ds&rs,e[11]=Ns^~Hs&ns,e[20]=cs^~ws&Ms,e[21]=ls^~vs&Ps,e[30]=js^~es&hs,e[31]=Bs^~ts&fs,e[40]=bs^~Ls&Us,e[41]=ys^~Ts&Vs,e[2]=us^~Es&Os,e[3]=ds^~Ss&$s,e[12]=Ds^~rs&ps,e[13]=Hs^~ns&gs,e[22]=ws^~Ms&Ws,e[23]=vs^~Ps&zs,e[32]=es^~hs&Cs,e[33]=ts^~fs&ks,e[42]=Ls^~Us&ss,e[43]=Ts^~Vs&is,e[4]=Es^~Os&qs,e[5]=Ss^~$s&Js,e[14]=rs^~ps&Rs,e[15]=ns^~gs&Is,e[24]=Ms^~Ws&os,e[25]=Ps^~zs&as,e[34]=hs^~Cs&xs,e[35]=fs^~ks&Fs,e[44]=Us^~ss&ms,e[45]=Vs^~is&_s,e[6]=Os^~qs&Xn,e[7]=$s^~Js&Yn,e[16]=ps^~Rs&As,e[17]=gs^~Is&Ns,e[26]=Ws^~os&cs,e[27]=zs^~as&ls,e[36]=Cs^~xs&js,e[37]=ks^~Fs&Bs,e[46]=ss^~ms&bs,e[47]=is^~_s&ys,e[8]=qs^~Xn&us,e[9]=Js^~Yn&ds,e[18]=Rs^~As&Ds,e[19]=Is^~Ns&Hs,e[28]=os^~cs&ws,e[29]=as^~ls&vs,e[38]=xs^~js&es,e[39]=Fs^~Bs&ts,e[48]=ms^~bs&Ls,e[49]=_s^~ys&Ts,e[0]^=fa[t*2],e[1]^=fa[t*2+1]}};const Qr=il;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&&(Qr.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&&Qr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Qr.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&&(Qr.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 of=Jt,af=sf(of);const cf=af,lf=rn;function ol(e){return $.allocUnsafe(e).fill(0)}function al(e,t,r){const n=ol(t);return e=Nn(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 uf(e,t){return al(e,t,!0)}function Nn(e){if(!$.isBuffer(e))if(Array.isArray(e))e=$.from(e);else if(typeof e=="string")cl(e)?e=$.from(ff(ll(e)),"hex"):e=$.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=$.allocUnsafe(0);else if(lf.isBN(e))e=e.toArrayLike($);else if(e.toArray)e=$.from(e.toArray());else throw new Error("invalid type");return e}function df(e){return e=Nn(e),"0x"+e.toString("hex")}function hf(e,t){return e=Nn(e),t||(t=256),cf("keccak"+t).update(e).digest()}function ff(e){return e.length%2?"0"+e:e}function cl(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function ll(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var ul={zeros:ol,setLength:al,setLengthRight:uf,isHexString:cl,stripHexPrefix:ll,toBuffer:Nn,bufferToHex:df,keccak:hf};const ft=ul,lt=rn;function dl(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 Lt(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function pa(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function hl(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 ft.isHexString(e)?new lt(ft.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(gf(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=hl(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,ft.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=Lt(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return ft.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Lt(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=Lt(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=pa(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=pa(e),$e("int256",ot(t).mul(new lt(2).pow(new lt(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function pf(e){return e==="string"||e==="bytes"||hl(e)==="dynamic"}function gf(e){return e.lastIndexOf("]")===e.length-1}function mf(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var o=dl(e[i]),a=t[i],l=$e(o,a);pf(o)?(r.push($e("uint256",s)),n.push(l),s+=l.length):r.push(l)}return $.concat(r.concat(n))}function fl(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=dl(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(ft.setLength(a,20));else if(o.startsWith("bytes")){if(r=Lt(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(ft.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Lt(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=Lt(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 _f(e,t){return ft.keccak(fl(e,t))}var bf={rawEncode:mf,solidityPack:fl,soliditySHA3:_f};const Ae=ul,sr=bf,pl={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"]},ri={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 pl.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 yf={TYPED_MESSAGE_SCHEMA:pl,TypedDataUtils:ri,hashForSignTypedDataLegacy:function(e){return wf(e.data)},hashForSignTypedData_v3:function(e){return ri.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return ri.hash(e.data)}};function wf(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 It=se,fe=S,vf=5*60*1e3,at={jsonrpc:"2.0",id:0};class Ef{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,It.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=gl(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:[ga(n)]})):jr()}makeFilterId(){return(0,It.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:[ga(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,It.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,It.IntNumber)(o))))).filter(o=>!!o),i=(0,It.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)},vf);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=Ef;function gl(e){return{fromBlock:ma(e.fromBlock),toBlock:ma(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Bt.filterFromParam=gl;function ga(e){const t={fromBlock:_a(e.fromBlock),toBlock:_a(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function ma(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,It.IntNumber)(0);if((0,fe.isHexString)(e))return(0,fe.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function _a(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 Ln={},ml={},Tn={},Ji=Sf;function Sf(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 ba=(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 Cf=(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):ba(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)?ba(i,t):i}return n},Er={},Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});const kf=gc;function ya(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Rf(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let If=class extends kf.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")ya(i,this,r);else{const o=i.length,a=Rf(i);for(let l=0;l<o;l+=1)ya(a[l],this,r)}return!0}};Sr.default=If;var Af=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Er,"__esModule",{value:!0});Er.BaseBlockTracker=void 0;const Nf=Af(Sr),Lf=1e3,Tf=(e,t)=>e+t,wa=["sync","latest"];class Mf extends Nf.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Lf,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){wa.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 wa.map(t=>this.listenerCount(t)).reduce(Tf)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=va(t),s=va(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=Mf;function va(e){return Number.parseInt(e,16)}var _l={},bl={},ue={};class yl 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 Pf(e){return Re(e)&&typeof e[Symbol.iterator]=="function"}function Re(e){return typeof e=="object"&&e!=null}function Ea(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ie(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Of(e){const{done:t,value:r}=e.next();return t?void 0:r}function $f(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: \`${ie(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:l}}function*Ci(e,t,r,n){Pf(e)||(e=[e]);for(const s of e){const i=$f(s,t,r,n);i&&(yield i)}}function*Gi(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=Gi(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 ee{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 Ci(d,c,this,l)}:this.validator=()=>[],i?this.refiner=(l,c)=>{const d=i(l,c);return Ci(d,c,this,l)}:this.refiner=()=>[]}assert(t,r){return wl(t,this,r)}create(t,r){return vl(t,this,r)}is(t){return Zi(t,this)}mask(t,r){return El(t,this,r)}validate(t,r={}){return Gt(t,this,r)}}function wl(e,t,r){const n=Gt(e,t,{message:r});if(n[0])throw n[0]}function vl(e,t,r){const n=Gt(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function El(e,t,r){const n=Gt(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Zi(e,t){return!Gt(e,t)[0]}function Gt(e,t,r={}){const n=Gi(e,t,r),s=Of(n);return s[0]?[new yl(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function xf(...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 ee({type:e,schema:null,validator:t})}function Ff(e,t){return new ee({...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 jf(e){return new ee({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 Bf(e){let t;return new ee({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 Df(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 Hf(e){const t=e instanceof ee,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Sl(r[n]);return t&&e.type==="type"?kr(r):Cr(r)}function Uf(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 Vf(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),_e(e,t)}function Wf(){return _e("any",()=>!0)}function zf(e){return new ee({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: ${ie(t)}`}})}function qf(){return _e("bigint",e=>typeof e=="bigint")}function Jf(){return _e("boolean",e=>typeof e=="boolean")}function Gf(){return _e("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${ie(e)}`)}function Zf(e){const t={},r=e.map(n=>ie(n)).join();for(const n of e)t[n]=n;return new ee({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${ie(n)}`}})}function Qf(){return _e("func",e=>typeof e=="function"||`Expected a function, but received: ${ie(e)}`)}function Kf(e){return _e("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ie(t)}`)}function Xf(){return _e("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ie(e)}`)}function Yf(e){return new ee({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 e0(e){const t=ie(e),r=typeof e;return new ee({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ie(n)}`}})}function t0(e,t){return new ee({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: ${ie(r)}`}})}function Qi(){return _e("never",()=>!1)}function r0(e){return new ee({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function n0(){return _e("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${ie(e)}`)}function Cr(e){const t=e?Object.keys(e):[],r=Qi();return new ee({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: ${ie(n)}`},coercer(n){return Re(n)?{...n}:n}})}function Sl(e){return new ee({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function s0(e,t){return new ee({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: ${ie(r)}`}})}function i0(){return _e("regexp",e=>e instanceof RegExp)}function o0(e){return new ee({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: ${ie(t)}`}})}function Cl(){return _e("string",e=>typeof e=="string"||`Expected a string, but received: ${ie(e)}`)}function a0(e){const t=Qi();return new ee({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: ${ie(r)}`}})}function kr(e){const t=Object.keys(e);return new ee({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: ${ie(r)}`},coercer(r){return Re(r)?{...r}:r}})}function c0(e){const t=e.map(r=>r.type).join(" | ");return new ee({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]=Gi(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: ${ie(r)}`,...s]}})}function kl(){return _e("unknown",()=>!0)}function Ki(e,t,r){return new ee({...e,coercer:(n,s)=>Zi(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function l0(e,t,r={}){return Ki(e,kl(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&Ea(n)&&Ea(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 u0(e){return Ki(e,Cl(),t=>t.trim())}function d0(e){return bt(e,"empty",t=>{const r=Rl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Rl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function h0(e,t,r={}){const{exclusive:n}=r;return bt(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function f0(e,t,r={}){const{exclusive:n}=r;return bt(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function p0(e){return bt(e,"nonempty",t=>Rl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function g0(e,t){return bt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function m0(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return bt(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 bt(e,t,r){return new ee({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=Ci(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const _0=Object.freeze(Object.defineProperty({__proto__:null,Struct:ee,StructError:yl,any:Wf,array:zf,assert:wl,assign:xf,bigint:qf,boolean:Jf,coerce:Ki,create:vl,date:Gf,defaulted:l0,define:_e,deprecated:Ff,dynamic:jf,empty:d0,enums:Zf,func:Qf,instance:Kf,integer:Xf,intersection:Yf,is:Zi,lazy:Bf,literal:e0,map:t0,mask:El,max:h0,min:f0,never:Qi,nonempty:p0,nullable:r0,number:n0,object:Cr,omit:Df,optional:Sl,partial:Hf,pattern:g0,pick:Uf,record:s0,refine:bt,regexp:i0,set:o0,size:m0,string:Cl,struct:Vf,trimmed:u0,tuple:a0,type:kr,union:c0,unknown:kl,validate:Gt},Symbol.toStringTag,{value:"Module"})),yt=nn(_0);Object.defineProperty(ue,"__esModule",{value:!0});ue.assertExhaustive=ue.assertStruct=ue.assert=ue.AssertionError=void 0;const b0=yt;function y0(e){return typeof e=="object"&&e!==null&&"message"in e}function w0(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 v0(e){const t=y0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Il(e,t){return w0(e)?new e({message:t}):e({message:t})}class Xi extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}ue.AssertionError=Xi;function E0(e,t="Assertion failed.",r=Xi){if(!e)throw t instanceof Error?t:Il(r,t)}ue.assert=E0;function S0(e,t,r="Assertion failed",n=Xi){try{(0,b0.assert)(e,t)}catch(s){throw Il(n,`${r}: ${v0(s)}.`)}}ue.assertStruct=S0;function C0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}ue.assertExhaustive=C0;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.base64=void 0;const k0=yt,R0=ue,I0=(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,R0.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,k0.pattern)(e,a)};Rr.base64=I0;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=yt,r=ue;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=ue,ki=Ir,Sa=48,Ca=58,ka=87;function A0(){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 N0=A0();function Yi(e){return e instanceof Uint8Array}B.isBytes=Yi;function Zt(e){(0,we.assert)(Yi(e),"Value must be a Uint8Array.")}B.assertIsBytes=Zt;function Al(e){if(Zt(e),e.length===0)return"0x";const t=N0(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,ki.add0x)(r.join(""))}B.bytesToHex=Al;function Nl(e){Zt(e);const t=Al(e);return BigInt(t)}B.bytesToBigInt=Nl;function L0(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=L0;function T0(e){Zt(e);const t=Nl(e);return(0,we.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}B.bytesToNumber=T0;function M0(e){return Zt(e),new TextDecoder().decode(e)}B.bytesToString=M0;function Mn(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,ki.assertIsHexString)(e);const r=(0,ki.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<Ca?Sa:ka),c=a-(a<Ca?Sa:ka);s[i]=l*16+c}return s}B.hexToBytes=Mn;function Ll(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 Mn(t)}B.bigIntToBytes=Ll;function P0(e,t){(0,we.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function O0(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)(P0(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=O0;function Tl(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 Mn(t)}B.numberToBytes=Tl;function Ml(e){return(0,we.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}B.stringToBytes=Ml;function Pl(e){if(typeof e=="bigint")return Ll(e);if(typeof e=="number")return Tl(e);if(typeof e=="string")return e.startsWith("0x")?Mn(e):Ml(e);if(Yi(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}B.valueToBytes=Pl;function $0(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=Pl(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=$0;function x0(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=x0;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.ChecksumStruct=void 0;const Ra=yt,F0=Rr;Pn.ChecksumStruct=(0,Ra.size)((0,F0.base64)((0,Ra.string)(),{paddingRequired:!0}),44,44);var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.createHex=Be.createBytes=Be.createBigInt=Be.createNumber=void 0;const X=yt,j0=ue,Ol=B,On=Ir,$l=(0,X.union)([(0,X.number)(),(0,X.bigint)(),(0,X.string)(),On.StrictHexStruct]),B0=(0,X.coerce)((0,X.number)(),$l,Number),D0=(0,X.coerce)((0,X.bigint)(),$l,BigInt);(0,X.union)([On.StrictHexStruct,(0,X.instance)(Uint8Array)]);const H0=(0,X.coerce)((0,X.instance)(Uint8Array),(0,X.union)([On.StrictHexStruct]),Ol.hexToBytes),U0=(0,X.coerce)(On.StrictHexStruct,(0,X.instance)(Uint8Array),Ol.bytesToHex);function V0(e){try{const t=(0,X.create)(e,B0);return(0,j0.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof X.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Be.createNumber=V0;function W0(e){try{return(0,X.create)(e,D0)}catch(t){throw t instanceof X.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Be.createBigInt=W0;function z0(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,X.create)(e,H0)}catch(t){throw t instanceof X.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Be.createBytes=z0;function q0(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,X.create)(e,U0)}catch(t){throw t instanceof X.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Be.createHex=q0;var Dt={},xl=N&&N.__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=N&&N.__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 eo{constructor(t){Ie.set(this,void 0),xl(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=eo;class to{constructor(t){Pe.set(this,void 0),xl(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=to;Object.freeze(eo);Object.freeze(eo.prototype);Object.freeze(to);Object.freeze(to.prototype);var Fl={};Object.defineProperty(Fl,"__esModule",{value:!0});var jl={};(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=yt,r=ue,n=()=>(0,t.define)("finite number",v=>(0,t.is)(v,(0,t.number)())&&Number.isFinite(v));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(v,R)=>{function V(J,te){const re=[...te.validator(J,R)];return re.length>0?re:!0}try{const J=V(v,e.UnsafeJsonStruct);return J!==!0?J:V(JSON.parse(JSON.stringify(v)),e.UnsafeJsonStruct)}catch(J){return J instanceof RangeError?"Circular reference detected":!1}});function s(v){return(0,t.is)(v,e.JsonStruct)}e.isValidJson=s;function i(v){(0,r.assertStruct)(v,e.JsonStruct,"Invalid JSON value");const R=JSON.stringify(v);return new TextEncoder().encode(R).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(v){return(0,t.is)(v,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(v,R){(0,r.assertStruct)(v,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",R)}e.assertIsJsonRpcNotification=a;function l(v){return(0,t.is)(v,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function c(v,R){(0,r.assertStruct)(v,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",R)}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(v){return(0,t.is)(v,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=d;function u(v,R){(0,r.assertStruct)(v,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",R)}e.assertIsPendingJsonRpcResponse=u;function h(v){return(0,t.is)(v,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function f(v,R){(0,r.assertStruct)(v,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",R)}e.assertIsJsonRpcResponse=f;function p(v){return(0,t.is)(v,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=p;function y(v,R){(0,r.assertStruct)(v,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",R)}e.assertIsJsonRpcSuccess=y;function g(v){return(0,t.is)(v,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=g;function b(v,R){(0,r.assertStruct)(v,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",R)}e.assertIsJsonRpcFailure=b;function m(v){return(0,t.is)(v,e.JsonRpcErrorStruct)}e.isJsonRpcError=m;function _(v,R){(0,r.assertStruct)(v,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",R)}e.assertIsJsonRpcError=_;function L(v){const{permitEmptyString:R,permitFractions:V,permitNull:J}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},v);return D=>!!(typeof D=="number"&&(V||Number.isInteger(D))||typeof D=="string"&&(R||D.length>0)||J&&D===null)}e.getJsonRpcIdValidator=L})(jl);var Bl={};Object.defineProperty(Bl,"__esModule",{value:!0});var Ht={},Ri={exports:{}},ni,Ia;function J0(){if(Ia)return ni;Ia=1;var e=1e3,t=e*60,r=t*60,n=r*24,s=n*7,i=n*365.25;ni=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 ni}function G0(e){r.debug=r,r.default=r,r.coerce=l,r.disable=i,r.enable=s,r.enabled=o,r.humanize=J0(),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,m=Number(new Date),_=m-(u||m);b.diff=_,b.prev=u,b.curr=m,u=m,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let L=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(R,V)=>{if(R==="%%")return"%";L++;const J=r.formatters[V];if(typeof J=="function"){const te=g[L];R=J.call(b,te),g.splice(L,1),L--}return R}),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=G0;(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 _i<"u"&&"env"in _i&&(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}}})(Ri,Ri.exports);var Q0=Ri.exports,K0=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.createModuleLogger=Ht.createProjectLogger=void 0;const X0=K0(Q0),Y0=(0,X0.default)("metamask");function e1(e){return Y0.extend(e)}Ht.createProjectLogger=e1;function t1(e,t){return e.extend(t)}Ht.createModuleLogger=t1;var Dl={};(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})(Dl);var De={};Object.defineProperty(De,"__esModule",{value:!0});De.hexToBigInt=De.hexToNumber=De.bigIntToHex=De.numberToHex=void 0;const Tt=ue,cr=Ir,r1=e=>((0,Tt.assert)(typeof e=="number","Value must be a number."),(0,Tt.assert)(e>=0,"Value must be a non-negative number."),(0,Tt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,cr.add0x)(e.toString(16)));De.numberToHex=r1;const n1=e=>((0,Tt.assert)(typeof e=="bigint","Value must be a bigint."),(0,Tt.assert)(e>=0,"Value must be a non-negative bigint."),(0,cr.add0x)(e.toString(16)));De.bigIntToHex=n1;const s1=e=>{(0,cr.assertIsHexString)(e);const t=parseInt(e,16);return(0,Tt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};De.hexToNumber=s1;const i1=e=>((0,cr.assertIsHexString)(e),BigInt((0,cr.add0x)(e)));De.hexToBigInt=i1;var Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});var Ul={};(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})(Ul);var Vl={};Object.defineProperty(Vl,"__esModule",{value:!0});var Wl={},Ii={exports:{}};const o1="2.0.0",zl=256,a1=Number.MAX_SAFE_INTEGER||9007199254740991,c1=16,l1=zl-6,u1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var $n={MAX_LENGTH:zl,MAX_SAFE_COMPONENT_LENGTH:c1,MAX_SAFE_BUILD_LENGTH:l1,MAX_SAFE_INTEGER:a1,RELEASE_TYPES:u1,SEMVER_SPEC_VERSION:o1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const d1=typeof _i=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var xn=d1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=$n,i=xn;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 m=f(g),_=d++;i(y,_,g),c[y]=_,l[_]=g,o[_]=new RegExp(g,b?"g":void 0),a[_]=new RegExp(m,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*$")})(Ii,Ii.exports);var Ar=Ii.exports;const h1=Object.freeze({loose:!0}),f1=Object.freeze({}),p1=e=>e?typeof e!="object"?h1:e:f1;var ro=p1;const Aa=/^[0-9]+$/,ql=(e,t)=>{const r=Aa.test(e),n=Aa.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},g1=(e,t)=>ql(t,e);var Jl={compareIdentifiers:ql,rcompareIdentifiers:g1};const Dr=xn,{MAX_LENGTH:Na,MAX_SAFE_INTEGER:Hr}=$n,{safeRe:La,t:Ta}=Ar,m1=ro,{compareIdentifiers:Ct}=Jl;let _1=class Oe{constructor(t,r){if(r=m1(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>Na)throw new TypeError(`version is longer than ${Na} characters`);Dr("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?La[Ta.LOOSE]:La[Ta.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)),Ct(this.major,t.major)||Ct(this.minor,t.minor)||Ct(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 Ct(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 Ct(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]),Ct(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=_1;const Ma=ge,b1=(e,t,r=!1)=>{if(e instanceof Ma)return e;try{return new Ma(e,t)}catch(n){if(!r)return null;throw n}};var Qt=b1;const y1=Qt,w1=(e,t)=>{const r=y1(e,t);return r?r.version:null};var v1=w1;const E1=Qt,S1=(e,t)=>{const r=E1(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var C1=S1;const Pa=ge,k1=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Pa(e instanceof Pa?e.version:e,r).inc(t,n,s).version}catch{return null}};var R1=k1;const Oa=Qt,I1=(e,t)=>{const r=Oa(e,null,!0),n=Oa(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 A1=I1;const N1=ge,L1=(e,t)=>new N1(e,t).major;var T1=L1;const M1=ge,P1=(e,t)=>new M1(e,t).minor;var O1=P1;const $1=ge,x1=(e,t)=>new $1(e,t).patch;var F1=x1;const j1=Qt,B1=(e,t)=>{const r=j1(e,t);return r&&r.prerelease.length?r.prerelease:null};var D1=B1;const $a=ge,H1=(e,t,r)=>new $a(e,r).compare(new $a(t,r));var Le=H1;const U1=Le,V1=(e,t,r)=>U1(t,e,r);var W1=V1;const z1=Le,q1=(e,t)=>z1(e,t,!0);var J1=q1;const xa=ge,G1=(e,t,r)=>{const n=new xa(e,r),s=new xa(t,r);return n.compare(s)||n.compareBuild(s)};var no=G1;const Z1=no,Q1=(e,t)=>e.sort((r,n)=>Z1(r,n,t));var K1=Q1;const X1=no,Y1=(e,t)=>e.sort((r,n)=>X1(n,r,t));var ep=Y1;const tp=Le,rp=(e,t,r)=>tp(e,t,r)>0;var Fn=rp;const np=Le,sp=(e,t,r)=>np(e,t,r)<0;var so=sp;const ip=Le,op=(e,t,r)=>ip(e,t,r)===0;var Gl=op;const ap=Le,cp=(e,t,r)=>ap(e,t,r)!==0;var Zl=cp;const lp=Le,up=(e,t,r)=>lp(e,t,r)>=0;var io=up;const dp=Le,hp=(e,t,r)=>dp(e,t,r)<=0;var oo=hp;const fp=Gl,pp=Zl,gp=Fn,mp=io,_p=so,bp=oo,yp=(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 fp(e,r,n);case"!=":return pp(e,r,n);case">":return gp(e,r,n);case">=":return mp(e,r,n);case"<":return _p(e,r,n);case"<=":return bp(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Ql=yp;const wp=ge,vp=Qt,{safeRe:Ur,t:Vr}=Ar,Ep=(e,t)=>{if(e instanceof wp)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 vp(`${n}.${s}.${i}${o}${a}`,t)};var Sp=Ep,si,Fa;function Cp(){return Fa||(Fa=1,si=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),si}var kp=H;H.Node=pt;H.create=H;function H(e){var t=this;if(t instanceof H||(t=new H),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}H.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};H.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++}};H.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++}};H.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ip(this,arguments[e]);return this.length};H.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Ap(this,arguments[e]);return this.length};H.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}};H.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}};H.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};H.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};H.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};H.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};H.prototype.map=function(e,t){t=t||this;for(var r=new H,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};H.prototype.mapReverse=function(e,t){t=t||this;for(var r=new H,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};H.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};H.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};H.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};H.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};H.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 H;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};H.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 H;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};H.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=Rp(this,s,r[n]);return i};H.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 Rp(e,t,r){var n=t===e.head?new pt(r,null,t,e):new pt(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function Ip(e,t){e.tail=new pt(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Ap(e,t){e.head=new pt(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function pt(e,t,r,n){if(!(this instanceof pt))return new pt(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{Cp()(H)}catch{}const Np=kp,ct=Symbol("max"),We=Symbol("length"),kt=Symbol("lengthCalculator"),ir=Symbol("allowStale"),ut=Symbol("maxAge"),He=Symbol("dispose"),ja=Symbol("noDisposeOnSet"),oe=Symbol("lruList"),Ne=Symbol("cache"),Kl=Symbol("updateAgeOnGet"),ii=()=>1;class Lp{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||ii;if(this[kt]=typeof r!="function"?ii: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[ja]=t.noDisposeOnSet||!1,this[Kl]=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=ii),t!==this[kt]&&(this[kt]=t,this[We]=0,this[oe].forEach(r=>{r.length=this[kt](r.value,r.key),this[We]+=r.length})),Xt(this)}get lengthCalculator(){return this[kt]}get length(){return this[We]}get itemCount(){return this[oe].length}rforEach(t,r){r=r||this;for(let n=this[oe].tail;n!==null;){const s=n.prev;Ba(this,t,n,r),n=s}}forEach(t,r){r=r||this;for(let n=this[oe].head;n!==null;){const s=n.next;Ba(this,t,n,r),n=s}}keys(){return this[oe].toArray().map(t=>t.key)}values(){return this[oe].toArray().map(t=>t.value)}reset(){this[He]&&this[oe]&&this[oe].length&&this[oe].forEach(t=>this[He](t.key,t.value)),this[Ne]=new Map,this[oe]=new Np,this[We]=0}dump(){return this[oe].map(t=>Kr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[oe]}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[kt](r,t);if(this[Ne].has(t)){if(i>this[ct])return Mt(this,this[Ne].get(t)),!1;const l=this[Ne].get(t).value;return this[He]&&(this[ja]||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 Tp(t,r,i,s,n);return o.length>this[ct]?(this[He]&&this[He](t,r),!1):(this[We]+=o.length,this[oe].unshift(o),this[Ne].set(t,this[oe].head),Xt(this),!0)}has(t){if(!this[Ne].has(t))return!1;const r=this[Ne].get(t).value;return!Kr(this,r)}get(t){return oi(this,t,!0)}peek(t){return oi(this,t,!1)}pop(){const t=this[oe].tail;return t?(Mt(this,t),t.value):null}del(t){Mt(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)=>oi(this,r,!1))}}const oi=(e,t,r)=>{const n=e[Ne].get(t);if(n){const s=n.value;if(Kr(e,s)){if(Mt(e,n),!e[ir])return}else r&&(e[Kl]&&(n.value.now=Date.now()),e[oe].unshiftNode(n));return s.value}},Kr=(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[oe].tail;e[We]>e[ct]&&t!==null;){const r=t.prev;Mt(e,t),t=r}},Mt=(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[oe].removeNode(t)}};class Tp{constructor(t,r,n,s,i){this.key=t,this.value=r,this.length=n,this.now=s,this.maxAge=i||0}}const Ba=(e,t,r,n)=>{let s=r.value;Kr(e,s)&&(Mt(e,r),e[ir]||(s=void 0)),s&&t.call(n,s.value,s.key,e)};var Mp=Lp,ai,Da;function Te(){if(Da)return ai;Da=1;class e{constructor(w,I){if(I=n(I),w instanceof e)return w.loose===!!I.loose&&w.includePrerelease===!!I.includePrerelease?w:new e(w.raw,I);if(w instanceof s)return this.raw=w.value,this.set=[[w]],this.format(),this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=w.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(A=>!p(A[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const A of this.set)if(A.length===1&&y(A[0])){this.set=[A];break}}}this.format()}format(){return this.range=this.set.map(w=>w.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(w){const k=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+w,A=r.get(k);if(A)return A;const C=this.options.loose,M=C?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];w=w.replace(M,re(this.options.includePrerelease)),i("hyphen replace",w),w=w.replace(a[l.COMPARATORTRIM],c),i("comparator trim",w),w=w.replace(a[l.TILDETRIM],d),i("tilde trim",w),w=w.replace(a[l.CARETTRIM],u),i("caret trim",w);let U=w.split(" ").map(G=>b(G,this.options)).join(" ").split(/\s+/).map(G=>D(G,this.options));C&&(U=U.filter(G=>(i("loose invalid filter",G,this.options),!!G.match(a[l.COMPARATORLOOSE])))),i("range list",U);const O=new Map,z=U.map(G=>new s(G,this.options));for(const G of z){if(p(G))return[G];O.set(G.value,G)}O.size>1&&O.has("")&&O.delete("");const de=[...O.values()];return r.set(k,de),de}intersects(w,I){if(!(w instanceof e))throw new TypeError("a Range is required");return this.set.some(k=>g(k,I)&&w.set.some(A=>g(A,I)&&k.every(C=>A.every(M=>C.intersects(M,I)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new o(w,this.options)}catch{return!1}for(let I=0;I<this.set.length;I++)if(Y(this.set[I],w,this.options))return!0;return!1}}ai=e;const t=Mp,r=new t({max:1e3}),n=ro,s=jn(),i=xn,o=ge,{safeRe:a,t:l,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:u}=Ar,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=$n,p=E=>E.value==="<0.0.0-0",y=E=>E.value==="",g=(E,w)=>{let I=!0;const k=E.slice();let A=k.pop();for(;I&&k.length;)I=k.every(C=>A.intersects(C,w)),A=k.pop();return I},b=(E,w)=>(i("comp",E,w),E=v(E,w),i("caret",E),E=_(E,w),i("tildes",E),E=V(E,w),i("xrange",E),E=te(E,w),i("stars",E),E),m=E=>!E||E.toLowerCase()==="x"||E==="*",_=(E,w)=>E.trim().split(/\s+/).map(I=>L(I,w)).join(" "),L=(E,w)=>{const I=w.loose?a[l.TILDELOOSE]:a[l.TILDE];return E.replace(I,(k,A,C,M,U)=>{i("tilde",E,k,A,C,M,U);let O;return m(A)?O="":m(C)?O=`>=${A}.0.0 <${+A+1}.0.0-0`:m(M)?O=`>=${A}.${C}.0 <${A}.${+C+1}.0-0`:U?(i("replaceTilde pr",U),O=`>=${A}.${C}.${M}-${U} <${A}.${+C+1}.0-0`):O=`>=${A}.${C}.${M} <${A}.${+C+1}.0-0`,i("tilde return",O),O})},v=(E,w)=>E.trim().split(/\s+/).map(I=>R(I,w)).join(" "),R=(E,w)=>{i("caret",E,w);const I=w.loose?a[l.CARETLOOSE]:a[l.CARET],k=w.includePrerelease?"-0":"";return E.replace(I,(A,C,M,U,O)=>{i("caret",E,A,C,M,U,O);let z;return m(C)?z="":m(M)?z=`>=${C}.0.0${k} <${+C+1}.0.0-0`:m(U)?C==="0"?z=`>=${C}.${M}.0${k} <${C}.${+M+1}.0-0`:z=`>=${C}.${M}.0${k} <${+C+1}.0.0-0`:O?(i("replaceCaret pr",O),C==="0"?M==="0"?z=`>=${C}.${M}.${U}-${O} <${C}.${M}.${+U+1}-0`:z=`>=${C}.${M}.${U}-${O} <${C}.${+M+1}.0-0`:z=`>=${C}.${M}.${U}-${O} <${+C+1}.0.0-0`):(i("no pr"),C==="0"?M==="0"?z=`>=${C}.${M}.${U}${k} <${C}.${M}.${+U+1}-0`:z=`>=${C}.${M}.${U}${k} <${C}.${+M+1}.0-0`:z=`>=${C}.${M}.${U} <${+C+1}.0.0-0`),i("caret return",z),z})},V=(E,w)=>(i("replaceXRanges",E,w),E.split(/\s+/).map(I=>J(I,w)).join(" ")),J=(E,w)=>{E=E.trim();const I=w.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return E.replace(I,(k,A,C,M,U,O)=>{i("xRange",E,k,A,C,M,U,O);const z=m(C),de=z||m(M),G=de||m(U),Ge=G;return A==="="&&Ge&&(A=""),O=w.includePrerelease?"-0":"",z?A===">"||A==="<"?k="<0.0.0-0":k="*":A&&Ge?(de&&(M=0),U=0,A===">"?(A=">=",de?(C=+C+1,M=0,U=0):(M=+M+1,U=0)):A==="<="&&(A="<",de?C=+C+1:M=+M+1),A==="<"&&(O="-0"),k=`${A+C}.${M}.${U}${O}`):de?k=`>=${C}.0.0${O} <${+C+1}.0.0-0`:G&&(k=`>=${C}.${M}.0${O} <${C}.${+M+1}.0-0`),i("xRange return",k),k})},te=(E,w)=>(i("replaceStars",E,w),E.trim().replace(a[l.STAR],"")),D=(E,w)=>(i("replaceGTE0",E,w),E.trim().replace(a[w.includePrerelease?l.GTE0PRE:l.GTE0],"")),re=E=>(w,I,k,A,C,M,U,O,z,de,G,Ge,Kn)=>(m(k)?I="":m(A)?I=`>=${k}.0.0${E?"-0":""}`:m(C)?I=`>=${k}.${A}.0${E?"-0":""}`:M?I=`>=${I}`:I=`>=${I}${E?"-0":""}`,m(z)?O="":m(de)?O=`<${+z+1}.0.0-0`:m(G)?O=`<${z}.${+de+1}.0-0`:Ge?O=`<=${z}.${de}.${G}-${Ge}`:E?O=`<${z}.${de}.${+G+1}-0`:O=`<=${O}`,`${I} ${O}`.trim()),Y=(E,w,I)=>{for(let k=0;k<E.length;k++)if(!E[k].test(w))return!1;if(w.prerelease.length&&!I.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 A=E[k].semver;if(A.major===w.major&&A.minor===w.minor&&A.patch===w.patch)return!0}return!1}return!0};return ai}var ci,Ha;function jn(){if(Ha)return ci;Ha=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(">")))}}ci=t;const r=ro,{safeRe:n,t:s}=Ar,i=Ql,o=xn,a=ge,l=Te();return ci}const Pp=Te(),Op=(e,t,r)=>{try{t=new Pp(t,r)}catch{return!1}return t.test(e)};var Bn=Op;const $p=Te(),xp=(e,t)=>new $p(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));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 Up=ge,Vp=Te(),Wp=(e,t,r)=>{let n=null,s=null,i=null;try{i=new Vp(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new Up(n,r))}),n};var zp=Wp;const li=ge,qp=Te(),Ua=Fn,Jp=(e,t)=>{e=new qp(e,t);let r=new li("0.0.0");if(e.test(r)||(r=new li("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 li(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Ua(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Ua(r,i))&&(r=i)}return r&&e.test(r)?r:null};var Gp=Jp;const Zp=Te(),Qp=(e,t)=>{try{return new Zp(e,t).range||"*"}catch{return null}};var Kp=Qp;const Xp=ge,Xl=jn(),{ANY:Yp}=Xl,eg=Te(),tg=Bn,Va=Fn,Wa=so,rg=oo,ng=io,sg=(e,t,r,n)=>{e=new Xp(e,n),t=new eg(t,n);let s,i,o,a,l;switch(r){case">":s=Va,i=rg,o=Wa,a=">",l=">=";break;case"<":s=Wa,i=ng,o=Va,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(tg(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===Yp&&(f=new Xl(">=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 ao=sg;const ig=ao,og=(e,t,r)=>ig(e,t,">",r);var ag=og;const cg=ao,lg=(e,t,r)=>cg(e,t,"<",r);var ug=lg;const za=Te(),dg=(e,t,r)=>(e=new za(e,r),t=new za(t,r),e.intersects(t,r));var hg=dg;const fg=Bn,pg=Le;var gg=(e,t,r)=>{const n=[];let s=null,i=null;const o=e.sort((d,u)=>pg(d,u,r));for(const d of o)fg(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 qa=Te(),co=jn(),{ANY:ui}=co,Yt=Bn,lo=Le,mg=(e,t,r={})=>{if(e===t)return!0;e=new qa(e,r),t=new qa(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const o=bg(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},_g=[new co(">=0.0.0-0")],Ja=[new co(">=0.0.0")],bg=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ui){if(t.length===1&&t[0].semver===ui)return!0;r.includePrerelease?e=_g:e=Ja}if(t.length===1&&t[0].semver===ui){if(r.includePrerelease)return!0;t=Ja}const n=new Set;let s,i;for(const f of e)f.operator===">"||f.operator===">="?s=Ga(s,f,r):f.operator==="<"||f.operator==="<="?i=Za(i,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(s&&i){if(o=lo(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=Ga(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=Za(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)},Ga=(e,t,r)=>{if(!e)return t;const n=lo(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Za=(e,t,r)=>{if(!e)return t;const n=lo(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var yg=mg;const di=Ar,Qa=$n,wg=ge,Ka=Jl,vg=Qt,Eg=v1,Sg=C1,Cg=R1,kg=A1,Rg=T1,Ig=O1,Ag=F1,Ng=D1,Lg=Le,Tg=W1,Mg=J1,Pg=no,Og=K1,$g=ep,xg=Fn,Fg=so,jg=Gl,Bg=Zl,Dg=io,Hg=oo,Ug=Ql,Vg=Sp,Wg=jn(),zg=Te(),qg=Bn,Jg=Fp,Gg=Hp,Zg=zp,Qg=Gp,Kg=Kp,Xg=ao,Yg=ag,em=ug,tm=hg,rm=gg,nm=yg;var sm={parse:vg,valid:Eg,clean:Sg,inc:Cg,diff:kg,major:Rg,minor:Ig,patch:Ag,prerelease:Ng,compare:Lg,rcompare:Tg,compareLoose:Mg,compareBuild:Pg,sort:Og,rsort:$g,gt:xg,lt:Fg,eq:jg,neq:Bg,gte:Dg,lte:Hg,cmp:Ug,coerce:Vg,Comparator:Wg,Range:zg,satisfies:qg,toComparators:Jg,maxSatisfying:Gg,minSatisfying:Zg,minVersion:Qg,validRange:Kg,outside:Xg,gtr:Yg,ltr:em,intersects:tm,simplifyRange:rm,subset:nm,SemVer:wg,re:di.re,src:di.src,tokens:di.t,SEMVER_SPEC_VERSION:Qa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Qa.RELEASE_TYPES,compareIdentifiers:Ka.compareIdentifiers,rcompareIdentifiers:Ka.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=sm,r=yt,n=ue;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})(Wl);(function(e){var t=N&&N.__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=N&&N.__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(ue,e),r(Rr,e),r(B,e),r(Pn,e),r(Be,e),r(Dt,e),r(Fl,e),r(Ir,e),r(jl,e),r(Bl,e),r(Ht,e),r(Dl,e),r(De,e),r(Hl,e),r(Ul,e),r(Vl,e),r(Wl,e)})(bl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=bl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(_l);var Yl=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.PollingBlockTracker=void 0;const im=Yl(Ji),om=Yl(Cf),am=Er,Xa=_l,Ya=(0,Xa.createModuleLogger)(Xa.projectLogger,"polling-block-tracker"),cm=(0,im.default)(),lm=1e3;class um extends am.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*lm,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=ec(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
3
  ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=ec(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:cm(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Ya("Making request",t);const r=await(0,om.default)(n=>this._provider.sendAsync(t,n))();if(Ya("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
4
  ${r.error.message}`);return r.result}}Tn.PollingBlockTracker=um;function ec(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Dn={},dm=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.SubscribeBlockTracker=void 0;const hm=dm(Ji),fm=Er,pm=(0,hm.default)();class gm extends fm.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:pm(),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)}}Dn.SubscribeBlockTracker=gm;(function(e){var t=N&&N.__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=N&&N.__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(Tn,e),r(Dn,e)})(ml);var uo={},Hn={},Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.getUniqueId=void 0;const eu=4294967295;let hi=Math.floor(Math.random()*eu);function mm(){return hi=(hi+1)%eu,hi}Nr.getUniqueId=mm;Object.defineProperty(Hn,"__esModule",{value:!0});Hn.createIdRemapMiddleware=void 0;const _m=Nr;function bm(){return(e,t,r,n)=>{const s=e.id,i=_m.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}Hn.createIdRemapMiddleware=bm;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.createAsyncMiddleware=void 0;function ym(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)}}}Un.createAsyncMiddleware=ym;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createScaffoldMiddleware=void 0;function wm(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())}}Vn.createScaffoldMiddleware=wm;var Lr={},ho={};Object.defineProperty(ho,"__esModule",{value:!0});const vm=gc;function tc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Em(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Sm=class extends vm.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")tc(i,this,r);else{const o=i.length,a=Em(i);for(let l=0;l<o;l+=1)tc(a[l],this,r)}return!0}};ho.default=Sm;var tu={},Ye={},Cm=lr;lr.default=lr;lr.stable=su;lr.stableStringify=su;var Xr="[...]",ru="[Circular]",gt=[],dt=[];function nu(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function lr(e,t,r,n){typeof n>"u"&&(n=nu()),Ai(e,"",0,[],void 0,0,n);var s;try{dt.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,iu(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;gt.length!==0;){var i=gt.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Pt(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),gt.push([n,r,t,s])):dt.push([t,r,e]):(n[r]=e,gt.push([n,r,t]))}function Ai(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){Pt(ru,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Pt(Xr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Pt(Xr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Ai(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];Ai(e[c],c,a,n,e,i,o)}}n.pop()}}function km(e,t){return e<t?-1:e>t?1:0}function su(e,t,r,n){typeof n>"u"&&(n=nu());var s=Ni(e,"",0,[],void 0,0,n)||e,i;try{dt.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,iu(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;gt.length!==0;){var o=gt.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Ni(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){Pt(ru,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Pt(Xr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Pt(Xr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Ni(e[a],a,a,n,e,i,o);else{var l={},c=Object.keys(e).sort(km);for(a=0;a<c.length;a++){var d=c[a];Ni(e[d],d,a,n,e,i,o),l[d]=e[d]}if(typeof s<"u")gt.push([s,t,e]),s[t]=l;else return l}n.pop()}}function iu(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 Rm=Cm;class ou 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 Rm.default(this.serialize(),Nm,2)}}Ye.EthereumRpcError=ou;class Im extends ou{constructor(t,r,n){if(!Am(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Ye.EthereumProviderError=Im;function Am(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Nm(e,t){if(t!=="[Circular]")return t}var fo={},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 _=h;b.code=_.code,_.message&&typeof _.message=="string"?(b.message=_.message,u(_,"data")&&(b.data=_.data)):(b.message=o(b.code),b.data={originalError:d(h)})}else{b.code=f.code;const _=(y=h)===null||y===void 0?void 0:y.message;b.message=_&&typeof _=="string"?_:f.message,b.data={originalError:d(h)}}const m=(g=h)===null||g===void 0?void 0:g.stack;return p&&h&&m&&typeof m=="string"&&(b.stack=m),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)}})(fo);var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.ethErrors=void 0;const po=Ye,au=fo,he=et;Wn.ethErrors={rpc:{parse:e=>Ee(he.errorCodes.rpc.parse,e),invalidRequest:e=>Ee(he.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ee(he.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ee(he.errorCodes.rpc.methodNotFound,e),internal:e=>Ee(he.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(he.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ee(he.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ee(he.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ee(he.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ee(he.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ee(he.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>er(he.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>er(he.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>er(he.errorCodes.provider.unsupportedMethod,e),disconnected:e=>er(he.errorCodes.provider.disconnected,e),chainDisconnected:e=>er(he.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 po.EthereumProviderError(t,r,n)}}};function Ee(e,t){const[r,n]=cu(t);return new po.EthereumRpcError(e,r||au.getMessageFromCode(e),n)}function er(e,t){const[r,n]=cu(t);return new po.EthereumProviderError(e,r||au.getMessageFromCode(e),n)}function cu(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=fo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Wn;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}})})(tu);var Lm=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.JsonRpcEngine=void 0;const Tm=Lm(ho),Se=tu;class Ue extends Tm.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: