1import{fQ as e,hH as t,ha as r,ft as n,iF as s,f5 as i}from"./index-Cq7_ZeC-.js";import{r as o,a,b as c}from"./readable-browser-CP_bs_0z.js";import{r as l}from"./index-D248_CE7.js";import{c as u}from"./clsx.m-C-5BXhEe.js";var d,h={},p={},f={};function g(){if(d)return f;d=1,Object.defineProperty(f,"__esModule",{value:!0}),f.walletLogo=void 0;return f.walletLogo=(e,t)=>{let r;switch(e){case"standard":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 `;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.3
1V33.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.7
1h-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`}},f}var m,_={};function b(){return m||(m=1,Object.defineProperty(_,"__esModule",{value:!0}),_.LINK_API_URL=void 0,_.LINK_API_URL="https://www.walletlink.org"),_}var y,v={},w={},E={};function k(){return y||(y=1,Object.defineProperty(E,"__esModule",{value:!0}),E.errorValues=E.standardErrorCodes=void 0,E.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}},E.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."}}),E}var S,C,I={},R={};function x(){return S||(S=1,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=k(),r="Unspecified error message.";function n(n,s=r){if(n&&Number.isInteger(n)){const r=n.toString();if(a(t.errorValues,r))return t.errorValues[r].message;if(i(n))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}function s(e){if(!Number.isInteger(e))return!1;const r=e.toString();return!!t.errorValues[r]||!!i(e)}function i(e){return e>=-32099&&e<=-32e3}function o(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=n,e.isValidCode=s,e.getErrorCode=function(e){var t;return"number"==typeof e?e:function(e){return"object"==typeof e&&null!==e&&("number"==typeof e.code||"number"==typeof e.errorCode)}(e)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0},e.serialize=function(e,{shouldIncludeStack:i=!1}={}){const l={};if(e&&"object"==typeof e&&!Array.isArray(e)&&a(e,"code")&&s(e.code)){const t=e;l.code=t.code,t.message&&"string"==typeof t.message?(l.message=t.message,a(t,"data")&&(l.data=t.data)):(l.message=n(l.code),l.data={originalError:o(e)})}else l.code=t.standardErrorCodes.rpc.internal,l.message=c(e,"message")?e.message:r,l.data={originalError:o(e)};return i&&(l.stack=c(e,"stack")?e.stack:void 0),l}}(R)),R}function A(){if(C)return I;C=1,Object.defineProperty(I,"__esModule",{value:!0}),I.standardErrors=void 0;const e=k(),t=x();function r(e,r){const[n,o]=s(r);return new i(e,n||(0,t.getMessageFromCode)(e),o)}function n(e,r){const[n,i]=s(r);return new o(e,n||(0,t.getMessageFromCode)(e),i)}function s(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;
1if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}I.standardErrors={rpc:{parse:t=>r(e.standardErrorCodes.rpc.parse,t),invalidRequest:t=>r(e.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>r(e.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>r(e.standardErrorCodes.rpc.methodNotFound,t),internal:t=>r(e.standardErrorCodes.rpc.internal,t),server:e=>{if(!e||"object"!=typeof e||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 r(t,e)},invalidInput:t=>r(e.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>r(e.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>r(e.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>r(e.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>r(e.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>r(e.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>n(e.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>n(e.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>n(e.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>n(e.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>n(e.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>n(e.standardErrorCodes.provider.unsupportedChain,t),custom:e=>{if(!e||"object"!=typeof e||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||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new o(t,r,n)}}};class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}}class o extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}return I}var M,N={},L={};function P(){if(M)return L;return M=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isErrorResponse=void 0,L.isErrorResponse=function(e){return void 0!==e.errorMessage},L}var O,T,j,B={};function F(){return O||(O=1,Object.defineProperty(B,"__esModule",{value:!0}),B.LIB_VERSION=void 0,B.LIB_VERSION="3.9.3"),B}function D(){if(T)return N;T=1,Object.defineProperty(N,"__esModule",{value:!0}),N.serializeError=void 0;const e=P(),t=F(),r=k(),n=x();return N.serializeError=function(s,i){const o=(0,n.serialize)(function(t){if("string"==typeof t)return{message:t,code:r.standardErrorCodes.rpc.internal};if((0,e.isErrorResponse)(t))return Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}});return t}(s),{shouldIncludeStack:!0}),a=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");a.searchParams.set("version",t.LIB_VERSION),a.searchParams.set("code",o.code.toString());const c=function(e,t){const r=null==e?void 0:e.method;if(r)return r;if(void 0===t)return;if("string"==typeof t)return t;if(!Array.isArray(t))return t.method;if(t.length>0)return t[0].method;return}(o.data,i);return c&&a.searchParams.set("method",c),a.searchParams.set("message",o.message),Object.assign(Object.assign({},o),{docUrl:a.href})},N}function $(){return j||(j=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=k();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=A();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=D();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=x();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}
1),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})}(w)),w}var U,H,z={};function V(){if(U)return z;function e(){return e=>e}var t,r;return U=1,Object.defineProperty(z,"__esModule",{value:!0}),z.ProviderType=z.RegExpString=z.IntNumber=z.BigIntString=z.AddressString=z.HexString=z.OpaqueType=void 0,z.OpaqueType=e,z.HexString=e=>e,z.AddressString=e=>e,z.BigIntString=e=>e,z.IntNumber=function(e){return Math.floor(e)},z.RegExpString=e=>e,(r=t||(z.ProviderType=t={})).CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected="",z}function W(){if(H)return v;H=1;var t=v&&v.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v,"__esModule",{value:!0}),v.isMobileWeb=v.getLocation=v.isInIFrame=v.createQrUrl=v.getFavicon=v.range=v.isBigNumber=v.ensureParsedJSONObject=v.ensureBN=v.ensureRegExpString=v.ensureIntNumber=v.ensureBuffer=v.ensureAddressString=v.ensureEvenLengthHexString=v.ensureHexString=v.isHexString=v.prepend0x=v.strip0x=v.has0xPrefix=v.hexStringFromIntNumber=v.intNumberFromHexString=v.bigIntStringFromBN=v.hexStringFromBuffer=v.hexStringToUint8Array=v.uint8ArrayToHex=v.randomBytesHex=void 0;const r=t(o()),n=$(),s=V(),i=/^[0-9]*$/,a=/^[a-f0-9]*$/;function c(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function l(e){return e.startsWith("0x")||e.startsWith("0X")}function u(e){return l(e)?e.slice(2):e}function d(e){return l(e)?`0x${e.slice(2)}`:`0x${e}`}function h(e){if("string"!=typeof e)return!1;const t=u(e).toLowerCase();return a.test(t)}function p(e,t=!1){if("string"==typeof e){const r=u(e).toLowerCase();if(a.test(r))return(0,s.HexString)(t?`0x${r}`:r)}throw n.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}function f(e,t=!1){let r=p(e,!1);return r.length%2==1&&(r=(0,s.HexString)(`0${r}`)),t?(0,s.HexString)(`0x${r}`):r}function g(e){if("number"==typeof e&&Number.isInteger(e))return(0,s.IntNumber)(e);if("string"==typeof e){if(i.test(e))return(0,s.IntNumber)(Number(e));if(h(e))return(0,s.IntNumber)(new r.default(f(e,!1),16).toNumber())}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}function m(e){if(null==e||"function"!=typeof e.constructor)return!1;const{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}function _(){try{return null!==window.frameElement}catch(e){return!1}}return v.randomBytesHex=function(e){return c(crypto.getRandomValues(new Uint8Array(e)))},v.uint8ArrayToHex=c,v.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},v.hexStringFromBuffer=function(e,t=!1){const r=e.toString("hex");return(0,s.HexString)(t?`0x${r}`:r)},v.bigIntStringFromBN=function(e){return(0,s.BigIntString)(e.toString(10))},v.intNumberFromHexString=function(e){return(0,s.IntNumber)(new r.default(f(e,!1),16).toNumber())},v.hexStringFromIntNumber=function(e){return(0,s.HexString)(`0x${new r.default(e).toString(16)}`)}
1,v.has0xPrefix=l,v.strip0x=u,v.prepend0x=d,v.isHexString=h,v.ensureHexString=p,v.ensureEvenLengthHexString=f,v.ensureAddressString=function(e){if("string"==typeof e){const t=u(e).toLowerCase();if(h(t)&&40===t.length)return(0,s.AddressString)(d(t))}throw n.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)},v.ensureBuffer=function(t){if(e.isBuffer(t))return t;if("string"==typeof t){if(h(t)){const r=f(t,!1);return e.from(r,"hex")}return e.from(t,"utf8")}throw n.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)},v.ensureIntNumber=g,v.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,s.RegExpString)(e.toString());throw n.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)},v.ensureBN=function(e){if(null!==e&&(r.default.isBN(e)||m(e)))return new r.default(e.toString(10),10);if("number"==typeof e)return new r.default(g(e));if("string"==typeof e){if(i.test(e))return new r.default(e,10);if(h(e))return new r.default(f(e,!1),16)}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)},v.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw n.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)},v.isBigNumber=m,v.range=function(e,t){return Array.from({length:t-e},(t,r)=>e+r)},v.getFavicon=function(){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}`},v.createQrUrl=function(e,t,r,n,s,i){const o=n?"parent-id":"id";return`${r}/#/link?${new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString()}`},v.isInIFrame=_,v.getLocation=function(){try{return _()&&window.top?window.top.location:window.location}catch(e){return window.location}},v.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)},v}var q,J={};function G(){if(q)return J;q=1,Object.defineProperty(J,"__esModule",{value:!0}),J.ScopedLocalStorage=void 0;return J.ScopedLocalStorage=class{constructor(e){this.scope=e}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(e)&&t.push(n)}t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return`${this.scope}:${e}`}},J}var Z,Q={},Y={},X={},K={};function ee(){return Z||(Z=1,Object.defineProperty(K,"__esModule",{value:!0}),K.EVENTS=void 0,K.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"}),K}var te,re={};function ne(){if(te)return re;te=1,Object.defineProperty(re,"__esModule",{value:!0}),re.RelayAbstract=re.APP_VERSION_KEY=re.LOCAL_STORAGE_ADDRESSES_KEY=re.WALLET_USER_NAME_KEY=void 0;const e=$();re.WALLET_USER_NAME_KEY="walletUsername",re.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",re.APP_VERSION_KEY="AppVersion";return re.RelayAbstract=class{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(e=>e.json()).then(r=>{if(!r)throw e.standardErrors.rpc.parse({});const n=r,{error:s}=n;if(s)throw(0,e.serializeError)(s,t.method);return n})}},re}var se,ie={};function oe(){if(se)return ie;
1se=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.Session=void 0;const e=a(),t=W(),r="session:id",n="session:secret",s="session:linked";return ie.Session=class i{constructor(r,n,s,i){this._storage=r,this._id=n||(0,t.randomBytesHex)(16),this._secret=s||(0,t.randomBytesHex)(32),this._key=(new e.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const t=e.getItem(r),o=e.getItem(s),a=e.getItem(n);return t&&a?new i(e,t,a,"1"===o):null}static hash(t){return(new e.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(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(n,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(s,this._linked?"1":"0")}},ie}var ae,ce={},le={};function ue(){if(ae)return le;ae=1,Object.defineProperty(le,"__esModule",{value:!0}),le.Cipher=void 0;const e=W();return le.Cipher=class{constructor(e){this.secret=e}async encrypt(t){const r=this.secret;if(64!==r.length)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,e.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=o.slice(o.byteLength-16),c=o.slice(0,o.byteLength-16),l=new Uint8Array(a),u=new Uint8Array(c),d=new Uint8Array([...n,...l,...u]);return(0,e.uint8ArrayToHex)(d)}async decrypt(t){const r=this.secret;if(64!==r.length)throw Error("secret must be 256 bits");return new Promise((n,s)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,e.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const e=await window.crypto.subtle.decrypt(d,i,u),t=new TextDecoder;n(t.decode(e))}catch(h){s(h)}}()})}},le}var de,he={};function pe(){if(de)return he;de=1,Object.defineProperty(he,"__esModule",{value:!0}),he.WalletLinkHTTP=void 0;return he.WalletLinkHTTP=class{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;const n=`${t}:${r}`;this.auth=`Basic ${btoa(n)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>{})}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:r,error:n}=await t.json();if(n)throw new Error(`Check unseen events failed: ${n}`);const s=null!==(e=null==r?void 0:r.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${t.status}`)}},he}var fe,ge,me={};function _e(){if(fe)return me;var e,t;fe=1,Object.defineProperty(me,"__esModule",{value:!0}),me.WalletLinkWebSocket=me.ConnectionState=void 0,(t=e||(me.ConnectionState=e={}))[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED";return me.WalletLinkWebSocket=class{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){return void r(i)}null===(n=this.connectionStateListener)||void 0===n||n.call(this,e.CONNECTING),s.onclose
1=t=>{var n;this.clearWebSocket(),r(new Error(`websocket error ${t.code}: ${t.reason}`)),null===(n=this.connectionStateListener)||void 0===n||n.call(this,e.DISCONNECTED)},s.onopen=r=>{var n;if(t(),null===(n=this.connectionStateListener)||void 0===n||n.call(this,e.CONNECTED),this.pendingData.length>0){[...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[]}},s.onmessage=e=>{var t,r;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{const t=JSON.parse(e.data);null===(r=this.incomingDataListener)||void 0===r||r.call(this,t)}catch(n){}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),null===(t=this.connectionStateListener)||void 0===t||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch(n){}}}sendData(e){const{webSocket:t}=this;if(!t)return this.pendingData.push(e),void this.connect();t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}},me}function be(){if(ge)return ce;ge=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.WalletLinkConnection=void 0;const e=V(),t=ue(),r=ee(),n=ne(),s=oe(),i=pe(),o=_e();return ce.WalletLinkConnection=class{constructor({session:a,linkAPIUrl:c,listener:l,diagnostic:u,WebSocketClass:d=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{if(!e)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,r)=>{const n=e[r];void 0!==n&&t(n)})},this.handleDestroyed=e=>{var t,n;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload(),null===(n=this.diagnostic)||void 0===n||n.log(r.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:s.Session.hash(this.session.id)}))},this.handleAccountUpdated=async e=>{var t,n;try{const r=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(r)}catch(s){null===(n=this.diagnostic)||void 0===n||n.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(e,t)=>{var n,s;try{const r=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.metadataUpdated(e,r)}catch(i){null===(s=this.diagnostic)||void 0===s||s.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:e})}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated(n.WALLET_USER_NAME_KEY,e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated(n.APP_VERSION_KEY,e)},this.handleChainUpdated=async(e,t)=>{var n,s;try{const r=await this.cipher.decrypt(e),s=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.chainUpdated(r,s)}catch(i){null===(s=this.diagnostic)||void 0===s||s.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=a,this.cipher=new t.Cipher(a.secret),this.diagnostic=u,this.listener=l;const h=new o.WalletLinkWebSocket(`${c}/rpc`,d);h.setConnectionStateListener(async e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(r.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:s.Session.hash(a.id)});let n=!1;switch(e){case o.ConnectionState.DISCONNECTED:if(!this.destroyed){const e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||h.connect().catch(()=>{e()})};e()}break;case o.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),n=!0}catch(i){}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case o.ConnectionState.CONNECTING:}this.connected!==n&&(this.connected=n)}),h.setIncomingDataListener(e=>{var t,n,i;switch(e.type){case"Heartbeat":return void this.updateLastHeartbeat();case"IsLinkedOK":case"Linked":{const n="IsLinkedOK"===e.type?e.linked:void 0;null===(t=this.diagnostic)||void 0===t||t.log(r.EVENTS.LINKED,{sessionIdHash:s.Session.hash(a.id),linked:n,type:e.type,onlineGuests:e.onlineGuests}),this.linked=n||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":null===(n=this.diagnostic)||void 0===n||n.log(r.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:s.Session.hash(a.id),metadata_keys:e&&e.metadata?Object.keys(e.metadata):void 0}),this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null===(i=this.requestResolutions.get(e.id))||void 0===i||i(e))}),this.ws=h,this.http=new i.WalletLinkHTTP(c,a.id,a.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(r.EVENTS.STARTED_CONNECTING,{sessionIdHash:s.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(r.EVENTS.DISCONNECTED,{sessionIdHash:s.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t,r;this._connected=e,e&&(null===(t=this.onceConnected)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.connectedUpdated(e)}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t,n;if("Event"===e.type&&"Web3Response"===e.event)try{const r=await this.cipher.decrypt(e.data),n=JSON.parse(r);if("WEB3_RESPONSE"!==n.type)return;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(n)}catch(s){null===(n=this.diagnostic)||void 0===n||n.log(r.EVENTS.GENERAL_ER
1ROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(this.connected){await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){}}else this.shouldFetchUnseenEventsOnConnect=!0}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1;(await this.http.fetchUnseenEvents()).forEach(e=>this.handleIncomingEvent(e))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const e=await this.makeRequest(n);if("Fail"===e.type)throw new Error(e.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,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const e=await this.makeRequest(i);if("Fail"===e.type)throw new Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t=6e4){const r=e.id;let n;return this.sendData(e),Promise.race([new Promise((e,s)=>{n=window.setTimeout(()=>{s(new Error(`request ${r} timed out`))},t)}),new Promise(e=>{this.requestResolutions.set(r,t=>{clearTimeout(n),e(t),this.requestResolutions.delete(r)})})])}async authenticate(){const t={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if("Fail"===r.type)throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}},ce}var ye,ve,we={},Ee={},ke={};function Se(){return ye||(ye=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.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}')()),ke}
vendor: 4,978 bytes, line 1
1function Ce(){if(ve)return Ee;ve=1;var e=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.injectCssReset=void 0;const t=e(Se());return Ee.injectCssReset=function(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(t.default)),document.documentElement.appendChild(e)},Ee}var Ie,Re,xe,Ae,Me,Ne,Le,Pe,Oe,Te,je,Be,Fe,De,$e,Ue,He={},ze={},Ve=[],We=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qe=Array.isArray;function Je(e,t){for(var r in t)e[r]=t[r];return e}function Ge(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ze(e,t,r){var n,s,i,o={};for(i in t)"key"==i?n=t[i]:"ref"==i?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?Ie.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===o[i]&&(o[i]=e.defaultProps[i]);return Qe(e,o,n,s,null)}function Qe(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++xe:s,__i:-1,__u:0};return null==s&&null!=Re.vnode&&Re.vnode(i),i}function Ye(e){return e.children}function Xe(e,t){this.props=e,this.context=t}function Ke(e,t){if(null==t)return e.__?Ke(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Ke(e):null}function et(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],s=[],i=Je({},t);i.__v=t.__v+1,Re.vnode&&Re.vnode(i),ut(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,null==r?Ke(t):r,!!(32&t.__u),s),i.__v=t.__v,i.__.__k[i.__i]=i,ht(n,i,s),t.__e=t.__=null,i.__e!=r&&tt(i)}}function tt(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),tt(e)}function rt(e){(!e.__d&&(e.__d=!0)&&Me.push(e)&&!nt.__r++||Ne!=Re.debounceRendering)&&((Ne=Re.debounceRendering)||Le)(nt)}function nt(){try{for(var e,t=1;Me.length;)Me.length>t&&Me.sort(Pe),e=Me.shift(),t=Me.length,et(e)}finally{Me.length=nt.__r=0}}function st(e,t,r,n,s,i,o,a,c,l,u){var d,h,p,f,g,m,_,b=n&&n.__k||Ve,y=t.length;for(c=function(e,t,r,n,s){var i,o,a,c,l,u=r.length,d=u,h=0;for(e.__k=new Array(s),i=0;i<s;i++)null!=(o=t[i])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[i]=Qe(null,o,null,null,null):qe(o)?o=e.__k[i]=Qe(Ye,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[i]=Qe(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[i]=o,c=i+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(l=o.__i=ot(o,r,c,d))&&(d--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(s>u?h--:s<u&&h++),"function"!=typeof o.type&&(o.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,o.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)null!=(a=r[i])&&!(2&a.__u)&&(a.__e==n&&(n=Ke(a)),gt(a,a));return n}(r,t,b,c,y),d=0;d<y;d++)null!=(p=r.__k[d])&&(h=-1!=p.__i&&b[p.__i]||ze,p.__i=d,m=ut(e,p,h,s,i,o,a,c,l,u),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&ft(h.ref,null,p),u.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),(_=!!(4&p.__u))||h.__k===p.__k?(c=it(p,c,e,_),_&&h.__e&&(h.__e=null)):"function"==typeof p.type&&void 0!==m?c=m:f&&(c=f.nextSibling),p.__u&=-7);return r.__e=g,c}function it(e,t,r,n){var s,i;if("function"==typeof e.type){for(s=e.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=e,t=it(s[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Ke(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function ot(e,t,r,n){var s,i,o,a=e.key,c=e.type,l=t[r],u=null!=l&&!(2&l.__u);if(null===l&&null==a||u&&a==l.key&&c==l.type)return r;if(n>(u?1:0))for(s=r-1,i=r+1;s>=0||i<t.length;)if(null!=(l=t[o=s>=0?s--:i++])&&!(2&l.__u)&&a==l.key&&c==l.type)return o;return-1}function at(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||We.test(t)?r:r+"px"}function ct(e,t,r,n,s){var i,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||at(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||at(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(Be,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r[je]=n[je]:(r[je]=Fe,e.addEventListener(t,i?$e:De,i)):e.removeEventListener(t,i?$e:De,i);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(a){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function lt(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Te])t[Te]=Fe++;else if(t[Te]<r[je])return;
vendor: 5,734 bytes, line 1
1return r(Re.event?Re.event(t):t)}}}function ut(e,t,r,n,s,i,o,a,c,l){var u,d,h,p,f,g,m,_,b,y,v,w,E,k,S,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(c=!!(32&r.__u),i=[a=t.__e=r.__e]),(u=Re.__b)&&u(t);e:if("function"==typeof C)try{if(_=t.props,b=C.prototype&&C.prototype.render,y=(u=C.contextType)&&n[u.__c],v=u?y?y.props.value:u.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:(b?t.__c=d=new C(_,v):(t.__c=d=new Xe(_,v),d.constructor=C,d.render=mt),y&&y.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Je({},d.__s)),Je(d.__s,C.getDerivedStateFromProps(_,d.__s))),p=d.props,f=d.state,d.__v=t,h)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,v),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,v)){t.__v!=r.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),Ve.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,v),b&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,f,g)})}if(d.context=v,d.props=_,d.__P=e,d.__e=!1,w=Re.__r,E=0,b)d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),Ve.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++E<25);d.state=d.__s,null!=d.getChildContext&&(n=Je(Je({},n),d.getChildContext())),b&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,f)),k=null!=u&&u.type===Ye&&null==u.key?pt(u.props.children):u,a=st(e,qe(k)?k:[k],t,r,n,s,i,o,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(I){if(t.__v=null,c||null!=i)if(I.then){for(t.__u|=c?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else{for(S=i.length;S--;)Ge(i[S]);dt(t)}else t.__e=r.__e,t.__k=r.__k,I.then||dt(t);Re.__e(I,t,r)}else null==i&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,n,s,i,o,a,c){var l,u,d,h,p,f,g,m=r.props||ze,_=t.props,b=t.type;if("svg"==b?s="http://www.w3.org/2000/svg":"math"==b?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((p=i[l])&&"setAttribute"in p==!!b&&(b?p.localName==b:3==p.nodeType)){e=p,i[l]=null;break}if(null==e){if(null==b)return document.createTextNode(_);e=document.createElementNS(s,b,_.is&&_),a&&(Re.__m&&Re.__m(t,i),a=!1),i=null}if(null==b)m===_||a&&e.data==_||(e.data=_);else{if(i=i&&Ie.call(e.childNodes),!a&&null!=i)for(m={},l=0;l<e.attributes.length;l++)m[(p=e.attributes[l]).name]=p.value;for(l in m)p=m[l],"dangerouslySetInnerHTML"==l?d=p:"children"==l||l in _||"value"==l&&"defaultValue"in _||"checked"==l&&"defaultChecked"in _||ct(e,l,null,p,s);for(l in _)p=_[l],"children"==l?h=p:"dangerouslySetInnerHTML"==l?u=p:"value"==l?f=p:"checked"==l?g=p:a&&"function"!=typeof p||m[l]===p||ct(e,l,p,m[l],s);if(u)a||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),st("template"==t.type?e.content:e,qe(h)?h:[h],t,r,n,"foreignObject"==b?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&Ke(r,0),a,c),null!=i)for(l=i.length;l--;)Ge(i[l]);a||(l="value","progress"==b&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==b&&!f||"option"==b&&f!=m[l])&&ct(e,l,f,m[l],s),l="checked",null!=g&&g!=e[l]&&ct(e,l,g,m[l],s))}return e}(r.__e,t,r,n,s,i,o,c,l);return(u=Re.diffed)&&u(t),128&t.__u?void 0:a}function dt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(dt))}function ht(e,t,r){for(var n=0;n<r.length;n++)ft(r[n],r[++n],r[++n]);Re.__c&&Re.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(r){Re.__e(r,t.__v)}})}function pt(e){return"object"!=typeof e||null==e||e.__b>0?e:qe(e)?e.map(pt):Je({},e)}function ft(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(s){Re.__e(s,r)}}function gt(e,t,r){var n,s;if(Re.unmount&&Re.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ft(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Re.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&>(n[s],t,r||"function"!=typeof e.type);r||Ge(e.__e),e.__c=e.__=e.__e=void 0}function mt(e,t,r){return this.constructor(e,r)}function _t(e,t,r){var n,s,i,o;t==document&&(t=document.documentElement),Re.__&&Re.__(e,t),s=(n="function"==typeof r)?null:r&&r.__k||t.__k,i=[],o=[],ut(t,e=(!n&&r||t).__k=Ze(Ye,null,[e]),s||ze,ze,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?Ie.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,o),ht(i,e,o)}Ie=Ve.slice,Re={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&null!=i.getDerivedStateFromError&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},xe=0,Ae=function(e){return null!=e&&void 0===e.constructor},Xe.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Je({},this.state),"function"==typeof e&&(e=e(Je({},r),this.props)),e&&Je(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),rt(this))},Xe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rt(this))},Xe.prototype.render=Ye,Me=[],Le="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,Pe=function(e,t){return e.__v.__b-t.__v.__b},nt.__r=0,Oe=Math.random().toString(8),Te="__d"+Oe,je="__a"+Oe,Be=/(PointerCapture)$|Capture$/i,Fe=0,De=lt(!1),$e=lt(!0),Ue=0;const bt=Object.freeze(Object.defineProperty({__proto__:null,Component:Xe,Fragment:Ye,cloneElement:function(e,t,r){var n,s,i,o,a=Je({},e.props);for(i in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==i?n=t[i]:"ref"==i?s=t[i]:a[i]=void 0===t[i]&&null!=o?o[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?Ie.call(arguments,2):r),Qe(e.type,a,n||e.key,s||e.ref,null)},createContext:function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,rt(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ue++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createElement:Ze,createRef:function(){return{current:null}},h:Ze,hydrate:function e(t,r){_t(t,r,e)},get isValidElement(){return Ae},get options(){return Re},render:_t,toChildArray:function e(t,r){return r=r||[],null==t||"boolean"==typeof t||(qe(t)?t.some(function(t){e(t,r)}):r.push(t)),r}},Symbol.toStringTag,{value:"Module"})),yt=t(bt);var vt={};const wt=t(u);var Et,kt,St,Ct,It=0,Rt=[],xt=Re,At=xt.__b,Mt=xt.__r,Nt=xt.diffed,Lt=xt.__c,Pt=xt.unmount,Ot=xt.__;function Tt(e,t){xt.__h&&xt.__h(kt,e,It||t),It=0;var r=kt.__H||(kt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function jt(e){return It=1,Bt(qt,e)}function Bt(e,t,r){var n=Tt(Et++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):qt(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=kt,!kt.__f)){var s=function(e,t,r){if(!n.__c.__H)return!0;var s=n.__c.__H.__.filter(function(e){return e.__c});if(s.every(function(e){return!e.__N}))return!i||i.call(this,e,t,r);var o=n.__c.props!==e;return s.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),i&&i.call(this,e,t,r)||o};kt.__f=!0;var i=kt.shouldComponentUpdate,o=kt.componentWillUpdate;kt.componentWillUpdate=function(e,t,r){if(this.__e){var n=i;i=void 0,s(e,t,r),i=n}o&&o.call(this,e,t,r)},kt.shouldComponentUpdate=s}return n.__N||n.__}function Ft(e,t){var r=Tt(Et++,4);!xt.__s&&Wt(r.__H,t)&&(r.__=e,r.u=t,kt.__h.push(r))}function Dt(e,t){var r=Tt(Et++,7);return Wt(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function $t(){for(var e;e=Rt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(zt),t.__h.some(Vt),t.__h=[]}catch(r){t.__h=[],xt.__e(r,e.__v)}}}xt.__b=function(e){kt=null,At&&At(e)},xt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ot&&Ot(e,t)},xt.__r=function(e){Mt&&Mt(e),Et=0;var t=(kt=e.__c).__H;t&&(St===kt?(t.__h=[],kt.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(zt),t.__h.some(Vt),t.__h=[],Et=0)),St=kt},xt.diffed=function(e){Nt&&Nt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Rt.push(t)&&Ct===xt.requestAnimationFrame||((Ct=xt.requestAnimationFrame)||Ht)($t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),St=kt=null},xt.__c=function(e,t){t.some(function(e){try{e.__h.some(zt),e.__h=e.__h.filter(function(e){return!e.__||Vt(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],xt.__e(r,e.__v)}}),Lt&&Lt(e,t)},xt.unmount=function(e){Pt&&Pt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{zt(e)}catch(r){t=r}}),r.__H=void 0,t&&xt.__e(t,r.__v))};var Ut="function"==typeof requestAnimationFrame;function Ht(e){var t,r=function(){clearTimeout(n),Ut&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Ut&&(t=requestAnimationFrame(r))}function zt(e){var t=kt,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),kt=t}function Vt(e){var t=kt;e.__c=e.__(),kt=t}function Wt(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function qt(e,t){return"function"==typeof t?t(e):t}const Jt=t(Object.freeze(Object.defineProperty({__proto__:null,useCallback:function(e,t){return It=8,Dt(function(){return e},t)},useContext:function(e){var t=kt.context[e.__c],r=Tt(Et++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(kt)),t.props.value):e.__},useDebugValue:function(e,t){xt.useDebugValue&&xt.useDebugValue(t?t(e):e)},useEffect:function(e,t){var r=Tt(Et++,3);!xt.__s&&Wt(r.__H,t)&&(r.__=e,r.u=t,kt.__H.__h.push(r))}
1,useErrorBoundary:function(e){var t=Tt(Et++,10),r=jt();return t.__=e,kt.componentDidCatch||(kt.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]},useId:function(){var e=Tt(Et++,11);if(!e.__){for(var t=kt.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__},useImperativeHandle:function(e,t,r){It=6,Ft(function(){if("function"==typeof e){var r=e(t());return function(){e(null),r&&"function"==typeof r&&r()}}if(e)return e.current=t(),function(){return e.current=null}},null==r?r:r.concat(e))},useLayoutEffect:Ft,useMemo:Dt,useReducer:Bt,useRef:function(e){return It=5,Dt(function(){return{current:e}},[])},useState:jt},Symbol.toStringTag,{value:"Module"})));var Gt,Zt={},Qt={};function Yt(){if(Gt)return Qt;Gt=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.CloseIcon=void 0;const e=yt;return Qt.CloseIcon=function(t){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.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"}))},Qt}var Xt,Kt={};function er(){if(Xt)return Kt;Xt=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.CoinbaseWalletRound=void 0;const e=yt;return Kt.CoinbaseWalletRound=function(t){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))},Kt}var tr,rr={};function nr(){if(tr)return rr;tr=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.QRCodeIcon=void 0;const e=yt;return rr.QRCodeIcon=function(t){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))},rr}var sr,ir,or,ar={};function cr(){if(ir)return sr;function e(e){this.mode=r.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,n=this.data.length;t<n;t++){var s=[],i=this.data.charCodeAt(t);i>65536?(s[0]=240|(1835008&i)>>>18,s[1]=128|(258048&i)>>>12,s[2]=128|(4032&i)>>>6,s[3]=128|63&i):i>2048?(s[0]=224|(61440&i)>>>12,s[1]=128|(4032&i)>>>6,s[2]=128|63&i):i>128?(s[0]=192|(1984&i)>>>6,s[1]=128|63&i):s[0]=i,this.parsedData.push(s)}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))}function t(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}ir=1,e.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)}},t.prototype={addData:function(t){var r=new e(t);this.dataList.push(r),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,r){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var s=0;s<this.moduleCount;s++)this.modules[n][s]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,r),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=t.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},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||(this.modules[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=g.getLostPoint(this);(0==r||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r);this.make();for(var s=0;s<this.modules.length;s++)for(var i=1*s,o=0;o<this.modules[s].length;o++){var a=1*o;this.modules[s][o]&&(n.beginFill(0,100),n.moveTo(a,i),n.lineTo(a+1,i),n.lineTo(a+1,i+1),n.lineTo(a,i+1),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=g.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(null==this.modules[n][s])for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)this.modules[n+i][s+o]=-2==i||2==i||-2==o||2==o||0==i&&0==o}},setupTypeNumber:function(e){for(var t=g.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&1==(t>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++){n=!e&&1==(t>>r&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=g.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&1==(n>>s&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(s=0;s<15;s++){i=!e&&1==(n>>s&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(6==o&&o--;;){for(var a=0;a<2;a++)if(null==this.modules[n][o-a]){var c=!1;i<e.length&&(c=1==(e[i]>>>s&1)),g.getMask(t,n,o-a)&&(c=!c),this.modules[n][o-a]=c,-1==--s&&(i++,s=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},t.PAD0=236,t.PAD1=17,t.createData=function(e,r,n){for(var s=y.getRSBlocks(e,r),i=new v,o=0;o<n.length;o++){var a=n[o];i.put(a.mode,4),i.put(a.getLength(),g.getLengthInBits(a.mode,e)),a.write(i)}var c=0;for(o=0;o<s.length;o++)c+=s[o].dataCount;if(i.getLengthInBits()>8*c)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*c+")");for(i.getLengthInBits()+4<=8*c&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*c||(i.put(t.PAD0,8),i.getLengthInBits()>=8*c));)i.put(t.PAD1,8);return t.createBytes(i,s)},t.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),s=Math.max(s,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&e.buffer[u+r];r+=c;var d=g.getErrorCorrectPolynomial(l),h=new b(i[a],d.getLength()-1).mod(d);o[a]=new Array(d.getLength()-1);for(u=0;
vendor: 5,048 bytes, line 1
1u<o[a].length;u++){var p=u+h.getLength()-o[a].length;o[a][u]=p>=0?h.get(p):0}}var f=0;for(u=0;u<t.length;u++)f+=t[u].totalCount;var m=new Array(f),_=0;for(u=0;u<n;u++)for(a=0;a<t.length;a++)u<i[a].length&&(m[_++]=i[a][u]);for(u=0;u<s;u++)for(a=0;a<t.length;a++)u<o[a].length&&(m[_++]=o[a][u]);return m};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n=1,s=0,i=3,o=2,a=0,c=1,l=2,u=3,d=4,h=5,p=6,f=7,g={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;g.getBCHDigit(t)-g.getBCHDigit(g.G15)>=0;)t^=g.G15<<g.getBCHDigit(t)-g.getBCHDigit(g.G15);return(e<<10|t)^g.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;g.getBCHDigit(t)-g.getBCHDigit(g.G18)>=0;)t^=g.G18<<g.getBCHDigit(t)-g.getBCHDigit(g.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return g.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case a:return(t+r)%2==0;case c:return t%2==0;case l:return r%3==0;case u:return(t+r)%3==0;case d:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case h:return t*r%2+t*r%3==0;case p:return(t*r%2+t*r%3)%2==0;case f:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new b([1],0),r=0;r<e;r++)t=t.multiply(new b([1,m.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:case r.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)s+c<0||t<=s+c||0==a&&0==c||o==e.isDark(n+a,s+c)&&i++;i>5&&(r+=3+i-5)}for(n=0;n<t-1;n++)for(s=0;s<t-1;s++){var l=0;e.isDark(n,s)&&l++,e.isDark(n+1,s)&&l++,e.isDark(n,s+1)&&l++,e.isDark(n+1,s+1)&&l++,0!=l&&4!=l||(r+=3)}for(n=0;n<t;n++)for(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(s=0;s<t;s++)for(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);var u=0;for(s=0;s<t;s++)for(n=0;n<t;n++)e.isDark(n,s)&&u++;return r+=10*(Math.abs(100*u/t/t-50)/5)}},m={glog:function(e){if(e<1)throw new Error("glog("+e+")");return m.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return m.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},_=0;_<8;_++)m.EXP_TABLE[_]=1<<_;for(_=8;_<256;_++)m.EXP_TABLE[_]=m.EXP_TABLE[_-4]^m.EXP_TABLE[_-5]^m.EXP_TABLE[_-6]^m.EXP_TABLE[_-8];for(_=0;_<255;_++)m.LOG_TABLE[m.EXP_TABLE[_]]=_;function b(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&0==e[r];)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}function y(e,t){this.totalCount=e,this.dataCount=t}function v(){this.buffer=[],this.length=0}b.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]^=m.gexp(m.glog(this.get(r))+m.glog(e.get(n)));return new b(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=m.glog(this.get(0))-m.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<e.getLength();n++)r[n]^=m.gexp(m.glog(e.get(n))+t);return new b(r,0).mod(e)}},y.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
vendor: 6,440 bytes, line 1
1],[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]],y.getRSBlocks=function(e,t){var r=y.getRsBlockTable(e,t);if(null==r)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[3*i+0],a=r[3*i+1],c=r[3*i+2],l=0;l<o;l++)s.push(new y(a,c));return s},y.getRsBlockTable=function(e,t){switch(t){case n:return y.RS_BLOCK_TABLE[4*(e-1)+0];case s:return y.RS_BLOCK_TABLE[4*(e-1)+1];case i:return y.RS_BLOCK_TABLE[4*(e-1)+2];case o:return y.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},v.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var r=0;r<t;r++)this.putBit(1==(e>>>t-r-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 w=[[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 E(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"==typeof e&&(e={content:e}),e)for(var r in e)this.options[r]=e[r];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)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!");var a=this.options.content,c=function(e,t){for(var r=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),n=1,s=0,i=0,o=w.length;i<=o;i++){var a=w[i];if(!a)throw new Error("Content too long: expected "+s+" but got "+r);switch(t){case"L":s=a[0];break;case"M":s=a[1];break;case"Q":s=a[2];break;case"H":s=a[3];break;default:throw new Error("Unknwon error correction level: "+t)}if(r<=s)break;n++}if(n>w.length)throw new Error("Content too long");return n}(a,this.options.ecl),l=function(e){switch(e){case"L":return n;case"M":return s;case"Q":return i;case"H":return o;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new t(c,l),this.qrcode.addData(a),this.qrcode.make()}return E.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;void 0===e&&(e={container:t.container||"svg"});for(var n=void 0===t.pretty||!!t.pretty,s=n?" ":"",i=n?"\r\n":"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),u=a/(c+2*t.padding),d=void 0!==t.join&&!!t.join,h=void 0!==t.swap&&!!t.swap,p=void 0===t.xmlDeclaration||!!t.xmlDeclaration,f=void 0!==t.predefined&&!!t.predefined,g=f?s+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+l+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",m=s+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,_="",b="",y=0;y<c;y++)for(var v=0;v<c;v++){if(r[v][y]){var w=v*l+t.padding*l,E=y*u+t.padding*u;if(h){var k=w;w=E,E=k}if(d){var S=l+w,C=u+E;w=Number.isInteger(w)?Number(w):w.toFixed(2),E=Number.isInteger(E)?Number(E):E.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),b+="M"+w+","+E+" V"+(C=Number.isInteger(C)?Number(C):C.toFixed(2))+" H"
1+S+" V"+E+" H"+w+" Z "}else _+=f?s+'<use x="'+w.toString()+'" y="'+E.toString()+'" href="#qrmodule" />'+i:s+'<rect x="'+w.toString()+'" y="'+E.toString()+'" width="'+l+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}d&&(_=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+b+'" />');let I="";if(void 0!==this.options.image&&this.options.image.svg){const e=o*this.options.image.width/100,t=a*this.options.image.height/100;I+=`<svg x="${o/2-e/2}" y="${a/2-t/2}" width="${e}" height="${t}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,I+=this.options.image.svg+i,I+="</svg>"}var R="";switch(e.container){case"svg":p&&(R+='<?xml version="1.0" standalone="yes"?>'+i),R+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,R+=g+m+_,R+=I,R+="</svg>";break;case"svg-viewbox":p&&(R+='<?xml version="1.0" standalone="yes"?>'+i),R+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,R+=g+m+_,R+=I,R+="</svg>";break;case"g":R+='<g width="'+o+'" height="'+a+'">'+i,R+=g+m+_,R+=I,R+="</g>";break;default:R+=(g+m+_+I).replace(/^\s+/,"")}return R},sr=E}function lr(){if(or)return ar;or=1;var t=ar&&ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ar,"__esModule",{value:!0}),ar.QRCode=void 0;const r=yt,n=Jt,s=t(cr());return ar.QRCode=t=>{const[i,o]=(0,n.useState)("");return(0,n.useEffect)(()=>{var r,n;const i=new s.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(r=t.width)&&void 0!==r?r:256,height:null!==(n=t.height)&&void 0!==n?n:256,padding:0,image:t.image}),a=e.from(i.svg(),"utf8").toString("base64");o(`data:image/svg+xml;base64,${a}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),i?(0,r.h)("img",{src:i,alt:"QR Code"}):null},ar}var ur,dr,hr={},pr={};function fr(){return ur||(ur=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.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)}}")()),pr}function gr(){if(dr)return hr;dr=1;var e=hr&&hr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hr,"__esModule",{value:!0}),hr.Spinner=void 0;const t=yt,r=e(fr());return hr.Spinner=e=>{var n;const s=null!==(n=e.size)&&void 0!==n?n:64,i=e.color||"#000";return(0,t.h)("div",{class:"-cbwsdk-spinner"},(0,t.h)("style",null,r.default),(0,t.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:s,height:s}},(0,t.h)("circle",{style:{cx:50,cy:50,r:45,stroke:i}})))},hr}var mr,_r,br={};function yr(){return mr||(mr=1,Object.defineProperty(br,"__esModule",{value:!0}),br.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;
1color:#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}")()),br}function vr(){if(_r)return Zt;_r=1;var e=Zt&&Zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.CoinbaseWalletSteps=Zt.ConnectContent=void 0;const t=e(wt),r=yt,n=W(),s=F(),i=Yt(),o=er(),a=nr(),c=lr(),l=gr(),u=e(yr()),d="Coinbase Wallet app",h="Connect with your self-custody wallet",p=m,f=e=>"light"===e?"#FFFFFF":"#0A0B0D";function g({title:e,description:n,theme:s}){return(0,r.h)("div",{className:(0,t.default)("-cbwsdk-connect-item",s)},(0,r.h)("div",null,(0,r.h)(o.CoinbaseWalletRound,null)),(0,r.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,r.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,r.h)("p",{className:"-cbwsdk-connect-item-description"},n)))}function m({theme:e}){return(0,r.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,r.h)("li",{className:(0,t.default)("-cbwsdk-wallet-steps-item",e)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,r.h)("li",{className:(0,t.default)("-cbwsdk-wallet-steps-item",e)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,r.h)("span",null,"Tap ",(0,r.h)("strong",null,"Scan")," "),(0,r.h)("span",{className:(0,t.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,r.h)(a.QRCodeIcon,{fill:f(e)})))))}return Zt.ConnectContent=function(e){const{theme:o}=e,a=(0,n.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),f=p;return(0,r.h)("div",{"data-testid":"connect-content",className:(0,t.default)("-cbwsdk-connect-content",o)},(0,r.h)("style",null,u.default),(0,r.h)("div",{className:"-cbwsdk-connect-content-header"},(0,r.h)("h2",{className:(0,t.default)("-cbwsdk-connect-content-heading",o)},"Scan to connect with our mobile app"),e.onCancel&&(0,r.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,r.h)(i.CloseIcon,{fill:"light"===o?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,r.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,r.h)(g,{title:d,description:h,theme:o})),(0,r.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,r.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,r.h)(c.QRCode,{content:a,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,r.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:s.LIB_VERSION}),(0,r.h)("input",{type:"hidden",value:a})),(0,r.h)(f,{theme:o}),!e.isConnected&&(0,r.h)("div",{"data-testid":"connecting-spinner",className:(0,t.default)("-cbwsdk-connect-content-qr-connecting",o)},(0,r.h)(l.Spinner,{size:36,color:"dark"===o?"#FFF":"#000"}),(0,r.h)("p",null,"Connecting...")))))},Zt.CoinbaseWalletSteps=m,Zt}var wr,Er={},kr={};function Sr(){if(wr)return kr;wr=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.ArrowLeftIcon=void 0;const e=yt;return kr.ArrowLeftIcon=function(t){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.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"}))},kr}var Cr,Ir={};function Rr(){if(Cr)return Ir;Cr=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.LaptopIcon=void 0;const e=yt;return Ir.LaptopIcon=function(t){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.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"}))},Ir}var xr,Ar={};function Mr(){if(xr)return Ar;
1xr=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.SafeIcon=void 0;const e=yt;return Ar.SafeIcon=function(t){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,e.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"}))},Ar}var Nr,Lr,Pr={};function Or(){return Nr||(Nr=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.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}")()),Pr}function Tr(){if(Lr)return Er;Lr=1;var e=Er&&Er.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Er,"__esModule",{value:!0}),Er.TryExtensionContent=void 0;const t=e(wt),r=yt,n=Jt,s=Sr(),i=Rr(),o=Mr(),a=e(Or());return Er.TryExtensionContent=function({theme:e}
1){const[c,l]=(0,n.useState)(!1),u=(0,n.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),d=(0,n.useCallback)(()=>{c?window.location.reload():(u(),l(!0))},[u,c]);return(0,r.h)("div",{class:(0,t.default)("-cbwsdk-try-extension",e)},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("h3",{class:(0,t.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,r.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,r.h)("button",{class:(0,t.default)("-cbwsdk-try-extension-cta",e),onClick:d},c?"Refresh":"Install"),(0,r.h)("div",null,!c&&(0,r.h)(s.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===e?"#0052FF":"#588AF5"})))),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,t.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,r.h)(i.LaptopIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,t.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,t.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,r.h)(o.SafeIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,t.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))},Er}var jr,Br,Fr,Dr={};function $r(){return jr||(jr=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.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}
1.-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}")()),Dr}function Ur(){if(Br)return vt;Br=1;var e=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0}),vt.ConnectDialog=void 0;const t=e(wt),r=yt,n=Jt,s=vr(),i=Tr(),o=e($r());return vt.ConnectDialog=e=>{const{isOpen:a,darkMode:c}=e,[l,u]=(0,n.useState)(!a),[d,h]=(0,n.useState)(!a);(0,n.useEffect)(()=>{const e=[window.setTimeout(()=>{h(!a)},10)];return a?u(!1):e.push(window.setTimeout(()=>{u(!0)},360)),()=>{e.forEach(window.clearTimeout)}},[a]);const p=c?"dark":"light";return(0,r.h)("div",{class:(0,t.default)("-cbwsdk-connect-dialog-container",l&&"-cbwsdk-connect-dialog-container-hidden")},(0,r.h)("style",null,o.default),(0,r.h)("div",{class:(0,t.default)("-cbwsdk-connect-dialog-backdrop",p,d&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,r.h)("div",{class:"-cbwsdk-connect-dialog"},(0,r.h)("div",{class:(0,t.default)("-cbwsdk-connect-dialog-box",d&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,r.h)(s.ConnectContent,{theme:p,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,r.h)(i.TryExtensionContent,{theme:p}))))},vt}function Hr(){if(Fr)return He;Fr=1,Object.defineProperty(He,"__esModule",{value:!0}),He.LinkFlow=void 0;const e=yt,t=Ur();return He.LinkFlow=class{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var t;this.root&&((0,e.render)(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(t.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)}},He}var zr,Vr,Wr,qr,Jr={},Gr={};function Zr(){return zr||(zr=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.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;
1cursor: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}")()),Gr}function Qr(){return Vr||(Vr=1,function(e){var t=Jr&&Jr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(wt),n=yt,s=Jt,i=t(Zr());e.Snackbar=class{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),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(([t,r])=>(0,n.h)(e.SnackbarInstance,Object.assign({},r,{key:t}
1))))),this.root)}};e.SnackbarContainer=e=>(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"},e.children));e.SnackbarInstance=({autoExpand:e,message:t,menuItems:i})=>{const[o,a]=(0,s.useState)(!0),[c,l]=(0,s.useState)(null!=e&&e);(0,s.useEffect)(()=>{const e=[window.setTimeout(()=>{a(!1)},1),window.setTimeout(()=>{l(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}});return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",o&&"-cbwsdk-snackbar-instance-hidden",c&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{l(!c)}},(0,n.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,n.h)("div",{class:"-gear-container"},!c&&(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:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((e,t)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,n.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))}}(Jr)),Jr}function Yr(){if(Wr)return we;Wr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.WalletLinkRelayUI=void 0;const e=Ce(),t=Hr(),r=Qr();return we.WalletLinkRelayUI=class{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new r.Snackbar({darkMode:e.darkMode}),this.linkFlow=new t.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.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,e.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.9687
15C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}},we}function Xr(){if(qr)return X;qr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.WalletLinkRelay=void 0;const e=$(),t=V(),r=W(),n=ee(),s=ne(),i=oe(),o=be(),a=P(),c=Yr();let l=class l extends s.RelayAbstract{constructor(e){var t;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=e=>{var t;this.isLinked=e;const r=this.storage.getItem(s.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this.session.linked=e),this.isUnlinkedErrorState=!1,r){const s=r.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==s[0]&&!e&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const e=this.getSessionIdHash();null===(t=this.diagnostic)||void 0===t||t.log(n.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:e})}}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{this.chainCallbackParams.chainId===e&&this.chainCallbackParams.jsonRpcUrl===t||(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(e,t))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),l.accountRequestCallbackIds.size>0&&(Array.from(l.accountRequestCallbackIds.values()).forEach(t=>{const r={type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:[e]}};this.invokeCallback(Object.assign(Object.assign({},r),{id:t}))}),l.accountRequestCallbackIds.clear())},this.connectedUpdated=e=>{this.ui.setConnected(e)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:r,ui:i,connection:o}=this.subscribe();this._session=r,this.connection=o,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=null===(t=e.reloadOnDisconnect)||void 0===t||t,this.ui=i}subscribe(){const e=i.Session.load(this.storage)||new i.Session(this.storage).save(),{linkAPIUrl:t,diagnostic:r}=this,n=new o.WalletLinkConnection({session:e,linkAPIUrl:t,diagnostic:r,listener:this}),{version:s,darkMode:a}=this.options,c=this.options.uiConstructor({linkAPIUrl:t,version:s,darkMode:a,session:e});return n.connect(),{session:e,ui:c,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,t;const r=this.ui.isStandalone();null===(e=this.diagnostic)||void 0===e||e.log(n.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=i.Session.load(this.storage);if((null==s?void 0:s.id)===this._session.id?this.storage.clear():s&&(null===(t=this.diagnostic)||void 0===t||t.log(n.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i.Session.hash(s.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0);const{session:o,ui:a,connection:c}=this.subscribe();this._session=o,this.connection=c,this.ui=a,r&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(n.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,r.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,r.hexStringFromBuffer)(e,!0),signature:(0,r.hexStringFromBuffer)(t,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,r.bigIntStringFromBN)(e.weiValue),data:(0,r.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,r.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,r.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,r.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLim
1it?(0,r.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,r.bigIntStringFromBN)(e.weiValue),data:(0,r.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,r.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,r.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,r.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,r.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,r.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,r.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const n=(0,r.randomBytesHex)(8),s=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,r),null==t||t()};return{promise:new Promise((r,i)=>{this.ui.isStandalone()||(t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,e=>{if(null==t||t(),(0,a.isErrorResponse)(e))return i(new Error(e.errorMessage));r(e)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:s}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof c.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,t){var r;const s={type:"WEB3_REQUEST",id:e,request:t},o=i.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(n.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${t.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?i.Session.hash(o.id):"",isSessionMismatched:((null==o?void 0:o.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(e=>{var r;null===(r=this.diagnostic)||void 0===r||r.log(n.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${t.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?i.Session.hash(o.id):"",isSessionMismatched:((null==o?void 0:o.id)!==this._session.id).toString()})}).catch(e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:t.method,errorMessage:e.message}})})}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){var t;const{response:r}=e;if(null===(t=this.diagnostic)||void 0===t||t.log(n.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),"requestEthereumAccounts"===r.method)return l.accountRequestCallbackIds.forEach(t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t}))),void l.accountRequestCallbackIds.clear();this.invokeCallback(e)}handleErrorResponse(t,r,n,s){var i;const o=null!==(i=null==n?void 0:n.message)&&void 0!==i?i:(0,e.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},n=(0,r.randomBytesHex)(8),s=e=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,e)};return{promise:new Promise((r,i)=>{if(this.relayEventManager.callbacks.set(n,e=>{if(this.ui.hideRequestEthereumAccounts(),(0,a.isErrorResponse)(e))return i(new Error(e.errorMessage));r(e)}),this.ui.inlineAccountsResponse()){const e=e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"requestEthereumAccounts",result:e}})};this.ui.requestEthereumAccounts({onCancel:s,onAccounts:e})}else{const t=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>s(t)})}l.accountRequestCallbackIds.add(n),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(n,t)}),cancel:s}}selectProvider(e){const n="selectProvider",s=(0,r.randomBytesHex)(8);return{cancel:e=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n,e)},promise:new Promise((r,n)=>{this.relayEventManager.callbacks.set(s,e=>{if((0,a.isErrorResponse)(e))return n(new Error(e.errorMessage));r(e)});this.ui.selectProvider&&this.ui.selectProvider({onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:e}})},onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:t.ProviderType.Unselected}})},providerOptions:e})})}}watchAsset(e,t,n,s,i,o){const c={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:s,image:i},chainId:o}};let l=null;const u=(0,r.randomBytesHex)(8),d=e=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,e),null==l||l()};this.ui.inlineWatchAsset()||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));return{cancel:d,promise:new Promise((r,d)=>{this.relayEventManager.callbacks.set(u,e=>{if(null==l||l(),(0,a.isErrorResponse)(e))return d(new Error(e.errorMessage));r(e)});const h=e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},p=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:p,onCancel:h,type:e,address:t,symbol:n,decimals:s,image:i,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,c)})}}addEthereumChain(e,t,n,s,i,o){const c={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let l=null;const u=(0,r.randomBytesHex)(8),d=e=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,e),null==l||l()};this.ui.inlineAddEthereumChain(e)||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));return{promise:new Promise((t,r)=>{this.relayEventManager.callbacks.set(u,e=>{if(null==l||l(),(0,a.isErrorResponse)(e))return r(new Error(e.errorMessage));t(e)});const n=e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},s=e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:e}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:n,onApprove:s,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),this.ui.inlineAddEthereumChain(e)||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,c)}),cancel:d}}switchEthereumChain(t,n){const s={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:n})},i=(0,r.randomBytesHex)(8);return{promise:new Promise((r,n)=>{this.relayEventManager.callbacks.set(i,t=>(0,a.isErrorResponse)(t)&&t.errorCode?n(e.standardErrors.provider.custom({code:t.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):(0,a.isErrorResponse)(t)?n(new Error(t.errorMessage)):void r(t));this.ui.switchEthereumChain({onCancel:r=>{var n;if(r){const s=null!==(n=(0,e.getErrorCode)(r))&&void 0!==n?n:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",r instanceof Error?r:e.standardErrors.provider.unsupportedChain(t),s)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:e}}})},chainId:s.params.chainId,address:s.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(i,s)}),cancel:e=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,e)}}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return i.Session.hash(this._session.id)}sendRequestStandalone(e,t){const r=r=>{this.handleErrorResponse(e,t.method,r)},n=t=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:t})};switch(t.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:t,onSuccess:n,onCancel:r});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:t,onSuccess:n,onCancel:r});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:t,onSuccess:n,onCancel:r});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:n});break;default:r()}}};return X.WalletLinkRelay=l,l.accountRequestCallbackIds=new Set,X}var Kr,en={},tn={},rn={};function nn(){return Kr||(Kr=1,e=rn,t=rn&&rn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);
1s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=rn&&rn.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r(Qr(),e)),rn;var e,t,r}var sn,on,an,cn,ln,un,dn,hn,pn,fn,gn={};function mn(){return sn||(sn=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.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}")()),gn}function _n(){if(on)return tn;on=1;var e=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0}),tn.RedirectDialog=void 0;const t=e(wt),r=yt,n=Ce(),s=nn(),i=e(mn());tn.RedirectDialog=class{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,n.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,r.render)(null,this.root),e&&(0,r.render)((0,r.h)(o,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}};const o=({title:e,buttonText:n,darkMode:o,onButtonClick:a,onDismiss:c})=>{const l=o?"dark":"light";return(0,r.h)(s.SnackbarContainer,{darkMode:o},(0,r.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,r.h)("style",null,i.default),(0,r.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:c}),(0,r.h)("div",{class:(0,t.default)("-cbwsdk-redirect-dialog-box",l)},(0,r.h)("p",null,e),(0,r.h)("button",{onClick:a},n))))};return tn}function bn(){if(an)return en;an=1,Object.defineProperty(en,"__esModule",{value:!0}),en.MobileRelayUI=void 0;const e=_n();return en.MobileRelayUI=class{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.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(e){}redirectToCoinbaseWallet(e){const t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",window.location.href),e&&t.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){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}},en}function yn(){if(cn)return Y;
1cn=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.MobileRelay=void 0;const e=W(),t=Xr(),r=bn();let n=class extends t.WalletLinkRelay{constructor(e){var t;super(e),this._enableMobileWalletLink=null!==(t=e.enableMobileWalletLink)&&void 0!==t&&t}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,e.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,t){if(super.publishWeb3RequestEvent(e,t),!(this._enableMobileWalletLink&&this.ui instanceof r.MobileRelayUI))return;let n=!1;switch(t.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink()}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){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:e.nonce,iat:(new Date).toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}};return Y.MobileRelay=n,Y}function vn(){if(fn)return pn;fn=1;const t=function(){if(un)return ln;un=1;const{Transform:t}=c();return ln=r=>class n extends t{constructor(e,t,n,s,i){super(i),this._rate=e,this._capacity=t,this._delimitedSuffix=n,this._hashBitLength=s,this._options=i,this._state=new r,this._state.initialize(e,t),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(s){n=s}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(r){t=r}e(t)}update(t,r){if(!e.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return e.isBuffer(t)||(t=e.from(t,r)),this._state.absorb(t),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new n(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}}(),r=function(){if(hn)return dn;hn=1;const{Transform:t}=c();return dn=r=>class n extends t{constructor(e,t,n,s){super(s),this._rate=e,this._capacity=t,this._delimitedSuffix=n,this._options=s,this._state=new r,this._state.initialize(e,t),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(s){n=s}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(t,r){if(!e.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return e.isBuffer(t)||(t=e.from(t,r)),this._state.absorb(t),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new n(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}}();return pn=function(e){const n=t(e),s=r(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new n(1152,448,null,224,t);case"keccak256":return new n(1088,512,null,256,t);case"keccak384":return new n(832,768,null,384,t);case"keccak512":return new n(576,1024,null,512,t);case"sha3-224":return new n(1152,448,6,224,t);case"sha3-256":return new n(1088,512,6,256,t);case"sha3-384":return new n(832,768,6,384,t);case"sha3-512":return new n(576,1024,6,512,t);case"shake128":return new s(1344,256,31,t);case"shake256":return new s(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}}var wn,En,kn,Sn,Cn,In,Rn,xn,An,Mn,Nn,Ln={};function Pn(){if(kn)return En;kn=1;const t=function(){if(wn)return Ln;wn=1;const e=[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];return Ln.p1600=function(t){for(let r=0;r<24;++r){const n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[3
16]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let p=d^(i<<1|o>>>31),f=h^(o<<1|i>>>31);const g=t[0]^p,m=t[1]^f,_=t[10]^p,b=t[11]^f,y=t[20]^p,v=t[21]^f,w=t[30]^p,E=t[31]^f,k=t[40]^p,S=t[41]^f;p=n^(a<<1|c>>>31),f=s^(c<<1|a>>>31);const C=t[2]^p,I=t[3]^f,R=t[12]^p,x=t[13]^f,A=t[22]^p,M=t[23]^f,N=t[32]^p,L=t[33]^f,P=t[42]^p,O=t[43]^f;p=i^(l<<1|u>>>31),f=o^(u<<1|l>>>31);const T=t[4]^p,j=t[5]^f,B=t[14]^p,F=t[15]^f,D=t[24]^p,$=t[25]^f,U=t[34]^p,H=t[35]^f,z=t[44]^p,V=t[45]^f;p=a^(d<<1|h>>>31),f=c^(h<<1|d>>>31);const W=t[6]^p,q=t[7]^f,J=t[16]^p,G=t[17]^f,Z=t[26]^p,Q=t[27]^f,Y=t[36]^p,X=t[37]^f,K=t[46]^p,ee=t[47]^f;p=l^(n<<1|s>>>31),f=u^(s<<1|n>>>31);const te=t[8]^p,re=t[9]^f,ne=t[18]^p,se=t[19]^f,ie=t[28]^p,oe=t[29]^f,ae=t[38]^p,ce=t[39]^f,le=t[48]^p,ue=t[49]^f,de=g,he=m,pe=b<<4|_>>>28,fe=_<<4|b>>>28,ge=y<<3|v>>>29,me=v<<3|y>>>29,_e=E<<9|w>>>23,be=w<<9|E>>>23,ye=k<<18|S>>>14,ve=S<<18|k>>>14,we=C<<1|I>>>31,Ee=I<<1|C>>>31,ke=x<<12|R>>>20,Se=R<<12|x>>>20,Ce=A<<10|M>>>22,Ie=M<<10|A>>>22,Re=L<<13|N>>>19,xe=N<<13|L>>>19,Ae=P<<2|O>>>30,Me=O<<2|P>>>30,Ne=j<<30|T>>>2,Le=T<<30|j>>>2,Pe=B<<6|F>>>26,Oe=F<<6|B>>>26,Te=$<<11|D>>>21,je=D<<11|$>>>21,Be=U<<15|H>>>17,Fe=H<<15|U>>>17,De=V<<29|z>>>3,$e=z<<29|V>>>3,Ue=W<<28|q>>>4,He=q<<28|W>>>4,ze=G<<23|J>>>9,Ve=J<<23|G>>>9,We=Z<<25|Q>>>7,qe=Q<<25|Z>>>7,Je=Y<<21|X>>>11,Ge=X<<21|Y>>>11,Ze=ee<<24|K>>>8,Qe=K<<24|ee>>>8,Ye=te<<27|re>>>5,Xe=re<<27|te>>>5,Ke=ne<<20|se>>>12,et=se<<20|ne>>>12,tt=oe<<7|ie>>>25,rt=ie<<7|oe>>>25,nt=ae<<8|ce>>>24,st=ce<<8|ae>>>24,it=le<<14|ue>>>18,ot=ue<<14|le>>>18;t[0]=de^~ke&Te,t[1]=he^~Se&je,t[10]=Ue^~Ke&ge,t[11]=He^~et&me,t[20]=we^~Pe&We,t[21]=Ee^~Oe&qe,t[30]=Ye^~pe&Ce,t[31]=Xe^~fe&Ie,t[40]=Ne^~ze&tt,t[41]=Le^~Ve&rt,t[2]=ke^~Te&Je,t[3]=Se^~je&Ge,t[12]=Ke^~ge&Re,t[13]=et^~me&xe,t[22]=Pe^~We&nt,t[23]=Oe^~qe&st,t[32]=pe^~Ce&Be,t[33]=fe^~Ie&Fe,t[42]=ze^~tt&_e,t[43]=Ve^~rt&be,t[4]=Te^~Je&it,t[5]=je^~Ge&ot,t[14]=ge^~Re&De,t[15]=me^~xe&$e,t[24]=We^~nt&ye,t[25]=qe^~st&ve,t[34]=Ce^~Be&Ze,t[35]=Ie^~Fe&Qe,t[44]=tt^~_e&Ae,t[45]=rt^~be&Me,t[6]=Je^~it&de,t[7]=Ge^~ot&he,t[16]=Re^~De&Ue,t[17]=xe^~$e&He,t[26]=nt^~ye&we,t[27]=st^~ve&Ee,t[36]=Be^~Ze&Ye,t[37]=Fe^~Qe&Xe,t[46]=_e^~Ae&Ne,t[47]=be^~Me&Le,t[8]=it^~de&ke,t[9]=ot^~he&Se,t[18]=De^~Ue&Ke,t[19]=$e^~He&et,t[28]=ye^~we&Pe,t[29]=ve^~Ee&Oe,t[38]=Ze^~Ye&pe,t[39]=Qe^~Xe&fe,t[48]=Ae^~Ne&ze,t[49]=Me^~Le&Ve,t[0]^=e[2*r],t[1]^=e[2*r+1]}},Ln}();function r(){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}return r.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},r.prototype.absorb=function(e){for(let r=0;r<e.length;++r)this.state[~~(this.count/4)]^=e[r]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(t.p1600(this.state),this.count=0)},r.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,128&e&&this.count===this.blockSize-1&&t.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,t.p1600(this.state),this.count=0,this.squeezing=!0},r.prototype.squeeze=function(r){this.squeezing||this.absorbLastFewBits(1);const n=e.alloc(r);for(let e=0;e<r;++e)n[e]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(t.p1600(this.state),this.count=0);return n},r.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},En=r}function On(){if(Rn)return In;Rn=1;const t=Cn?Sn:(Cn=1,Sn=vn()(Pn())),r=o();function n(t){return e.allocUnsafe(t).fill(0)}function s(e,t,r){const s=n(t);return e=i(e),r?e.length<t?(e.copy(s),s):e.slice(0,t):e.length<t?(e.copy(s,t-e.length),s):e.slice(-t)}function i(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t)t=a(t)?e.from((n=c(t)).length%2?"0"+n:n,"hex"):e.from(t);else if("number"==typeof t)t=intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(r.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}var n;return t}function a(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function c(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}return In={zeros:n,setLength:s,setLengthRight:function(e,t){return s(e,t,!0)},isHexString:a,stripHexPrefix:c,toBuffer:i,bufferToHex:function(e){return"0x"+(e=i(e)).toString("hex")},keccak:function(e,r){return e=i(e),r||(r=256),t("keccak"+r).update(e).digest()}}}function Tn(){if(An)return xn;An=1;const t=On(),r=o();function n(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function s(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function i(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function a(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function c(e){var n=typeof e;if("string"===n)return t.isHexString(e)?new r(t.stripHexPrefix(e),16):new r(e,10);if("number"===n)return new r(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function l(n,o){var u,d,h,p;if("address"===n)return l("uint160",c(o));if("bool"===n)return l("uint8",o?1:0);if("string"===n)return l("bytes",new e(o,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(n)){if(void 0===o.length)throw new Error("Not an array?");if("dynamic"!==(u=a(n))&&0!==u&&o.length>u)throw new Error("Elements exceed array size: "+u);for(p in h=[],n=n.slice(0,n.lastIndexOf("[")),"string"==typeof o&&(o=JSON.parse(o)),o)h.push(l(n,o[p]));if("dynamic"===u){var f=l("uint256",o.length);h.unshift(f)}return e.concat(h)}if("bytes"===n)return o=new e(o),h=e.concat([l("uint256",o.length),o]),o.length%32!=0&&(h=e.concat([h,t.zeros(32-o.length%32)])),h;if(n.startsWith("bytes")){if((u=s(n))<1||u>32)throw new Error("Invalid bytes<N> width: "+u);return t.setLengthRight(o,32)}if(n.startsWith("uint")){if((u=s(n))%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);if((d=c(o)).bitLength()>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+d.bitLength());if(d<0)throw new Error("Supplied uint is negative");return d.toArrayLike(e,"be",32)}if(n.startsWith("int")){if((u=s(n))%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);if((d=c(o)).bitLength()>u)throw new Error("Supplied int exceeds width: "+u+" vs "+d.bitLength());return d.toTwos(256).toArrayLike(e,"be",32)}if(n.startsWith("ufixed")){if(u=i(n),(d=c(o))<0)throw new Error("Supplied ufixed is negative");return l("uint256",d.mul(new r(2).pow(new r(u[1]))))}if(n.startsWith("fixed"))return u=i(n),l("int256",c(o).mul(new r(2).pow(new r(u[1]))));throw new Error("Unsupported or invalid type: "+n)}function u(e){return"string"===e||"bytes"===e||"dynamic"===a(e)}function d(r,i){if(r.length!==i.length)throw new Error("Number of types are not matching the values");for(var o,a,l=[],u=0;u<r.length;u++){var d=n(r[u]),h=i[u];if("bytes"===d)l.push(h);else if("string"===d)l.push(new e(h,"utf8"));else if("bool"===d)l.push(new e(h?"01":"00","hex"));else if("address"===d)l.push(t.setLength(h,20));else if(d.startsWith("bytes")){if((o=s(d))<1||o>32)throw new Error("Invalid bytes<N> width: "+o);l.push(t.setLengthRight(h,o))}else if(d.startsWith("uint")){if((o=s(d))%8||o<8||o>256)throw new Error("Invalid uint<N> width: "+o);if((a=c(h)).bitLength()>o)throw new Error("Supplied uint exceeds width: "+o+" vs "+a.bitLength());l.push(a.toArrayLike(e,"be",o/8))}else{if(!d.startsWith("int"))throw new Error("Unsupported or invalid type: "+d);if((o=s(d))%8||o<8||o>256)throw new Error("Invalid int<N> width: "+o);if((a=c(h)).bitLength()>o)throw new Error("Supplied int exceeds width: "+o+" vs "+a.bitLength());l.push(a.toTwos(o).toArrayLike(e,"be",o/8))}}return e.concat(l)}return xn={rawEncode:function(t,r){var s=[],i=[],o=32*t.length;for(var a in t){var c=n(t[a]),d=l(c,r[a]);u(c)?(s.push(l("uint256",o)),i.push(d),o+=d.length):s.push(d)}return e.concat(s.concat(i))},solidityPack:d,soliditySHA3:function(e,r){return t.keccak(d(e,r))}}}function jn(){if(Nn)return Mn;Nn=1;const t=On(),r=Tn(),n={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},s={encodeData(n,s,i,o=!0){const a=["bytes32"],c=[this.hashType(n,i)];if(o){const l=(n,s,a)=>
1{if(void 0!==i[s])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(s,a,i,o))];if(void 0===a)throw new Error(`missing value for field ${n} of type ${s}`);if("bytes"===s)return["bytes32",t.keccak(a)];if("string"===s)return"string"==typeof a&&(a=e.from(a,"utf8")),["bytes32",t.keccak(a)];if(s.lastIndexOf("]")===s.length-1){const e=s.slice(0,s.lastIndexOf("[")),i=a.map(t=>l(n,e,t));return["bytes32",t.keccak(r.rawEncode(i.map(([e])=>e),i.map(([,e])=>e)))]}return[s,a]};for(const e of i[n]){const[t,r]=l(e.name,e.type,s[e.name]);a.push(t),c.push(r)}}else for(const r of i[n]){let n=s[r.name];if(void 0!==n)if("bytes"===r.type)a.push("bytes32"),n=t.keccak(n),c.push(n);else if("string"===r.type)a.push("bytes32"),"string"==typeof n&&(n=e.from(n,"utf8")),n=t.keccak(n),c.push(n);else if(void 0!==i[r.type])a.push("bytes32"),n=t.keccak(this.encodeData(r.type,n,i,o)),c.push(n);else{if(r.type.lastIndexOf("]")===r.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");a.push(r.type),c.push(n)}}return r.rawEncode(a,c)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(t=>t!==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:e,type:t})=>t+" "+e).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;r.push(e);for(const n of t[e])for(const e of this.findTypeDependencies(n.type,t,r))!r.includes(e)&&r.push(e);return r},hashStruct(e,r,n,s=!0){return t.keccak(this.encodeData(e,r,n,s))},hashType(e,r){return t.keccak(this.encodeType(e,r))},sanitizeData(e){const t={};for(const r in n.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(r,n=!0){const s=this.sanitizeData(r),i=[e.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",s.domain,s.types,n)),"EIP712Domain"!==s.primaryType&&i.push(this.hashStruct(s.primaryType,s.message,s.types,n)),t.keccak(e.concat(i))}};return Mn={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:s,hashForSignTypedDataLegacy:function(e){return function(e){const n=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw n;const s=e.map(function(e){return"bytes"===e.type?t.toBuffer(e.value):e.value}),i=e.map(function(e){return e.type}),o=e.map(function(e){if(!e.name)throw n;return e.type+" "+e.name});return r.soliditySHA3(["bytes32","bytes32"],[r.soliditySHA3(new Array(e.length).fill("string"),o),r.soliditySHA3(i,s)])}(e.data)},hashForSignTypedData_v3:function(e){return s.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return s.hash(e.data)}}}var Bn,Fn={};function Dn(){if(Bn)return Fn;Bn=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.filterFromParam=Fn.FilterPolyfill=void 0;const e=V(),t=W(),r={jsonrpc:"2.0",id:0};function n(e){return{fromBlock:i(e.fromBlock),toBlock:i(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function s(e){const t={fromBlock:o(e.fromBlock),toBlock:o(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function i(r){if(void 0===r||"latest"===r||"pending"===r)return"latest";if("earliest"===r)return(0,e.IntNumber)(0);if((0,t.isHexString)(r))return(0,t.intNumberFromHexString)(r);throw new Error(`Invalid block option: ${String(r)}`)}function o(e){return"latest"===e?e:(0,t.hexStringFromIntNumber)(e)}function a(){return Object.assign(Object.assign({},r),{error:{code:-32e3,message:"filter not found"}})}function c(){return Object.assign(Object.assign({},r),{result:[]})}return Fn.FilterPolyfill=class{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,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(e){const r=n(e),s=this.makeFilterId();await this.setInitialCursorPosition(s,r.fromBlock);return this.logFilters.set(s,r),this.setFilterTimeout(s),(0,t.hexStringFromIntNumber)(s)}async newBlockFilter(){const e=this.makeFilterId();await this.setInitialCursorPosition(e,"latest");return this.blockFilters.add(e),this.setFilterTimeout(e),(0,t.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId();await this.setInitialCursorPosition(e,"latest");return this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,t.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,t.intNumberFromHexString)(e);return this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,t.intNumberFromHexString)(e);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):Prom
1ise.resolve(a())}async getFilterLogs(e){const n=(0,t.intNumberFromHexString)(e),i=this.logFilters.get(n);return i?this.sendAsyncPromise(Object.assign(Object.assign({},r),{method:"eth_getLogs",params:[s(i)]})):a()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((t,r)=>{this.provider.sendAsync(e,(e,n)=>e?r(e):Array.isArray(n)||null==n?r(new Error(`unexpected response received: ${JSON.stringify(n)}`)):void t(n))})}deleteFilter(e){this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(n){const i=this.logFilters.get(n),o=this.cursors.get(n);if(!o||!i)return a();const l=await this.getCurrentBlockHeight(),u="latest"===i.toBlock?l:i.toBlock;if(o>l)return c();if(o>Number(i.toBlock))return c();const d=await this.sendAsyncPromise(Object.assign(Object.assign({},r),{method:"eth_getLogs",params:[s(Object.assign(Object.assign({},i),{fromBlock:o,toBlock:u}))]}));if(Array.isArray(d.result)){const r=d.result.map(e=>(0,t.intNumberFromHexString)(e.blockNumber||"0x0")),s=Math.max(...r);if(s&&s>o){const t=(0,e.IntNumber)(s+1);this.cursors.set(n,t)}}return d}async getBlockFilterChanges(n){const s=this.cursors.get(n);if(!s)return a();const i=await this.getCurrentBlockHeight();if(s>i)return c();const o=(await Promise.all((0,t.range)(s,i+1).map(t=>this.getBlockHashByNumber((0,e.IntNumber)(t))))).filter(e=>!!e),l=(0,e.IntNumber)(s+o.length);return this.cursors.set(n,l),Object.assign(Object.assign({},r),{result:o})}async getPendingTransactionFilterChanges(e){return Promise.resolve(c())}async setInitialCursorPosition(e,t){const r=await this.getCurrentBlockHeight(),n="number"==typeof t&&t>r?t:r;return this.cursors.set(e,n),n}setFilterTimeout(e){const t=this.timeouts.get(e);t&&window.clearTimeout(t);const r=window.setTimeout(()=>{this.deleteFilter(e)},3e5);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const t=await this._getCurrentBlockHeight();this.currentBlockHeight=t,this.resolvers.forEach(e=>e(t)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(e=>this.resolvers.push(e))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},r),{method:"eth_blockNumber",params:[]}));return(0,t.intNumberFromHexString)((0,t.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},r),{method:"eth_getBlockByNumber",params:[(0,t.hexStringFromIntNumber)(e),!1]}));return n.result&&"string"==typeof n.result.hash?(0,t.ensureHexString)(n.result.hash):null}},Fn.filterFromParam=n,Fn}var $n,Un,Hn,zn,Vn={},Wn={},qn={};function Jn(){if(Un)return $n;return Un=1,$n=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}}var Gn,Zn,Qn={},Yn={};function Xn(){if(Gn)return Yn;Gn=1,Object.defineProperty(Yn,"__esModule",{value:!0});const e=r();function t(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}class n extends e.EventEmitter{emit(e,...r){let n="error"===e;const s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){let e;if(r.length>0&&([e]=r),e instanceof Error)throw e;const t=new Error("Unhandled error."+(e?` (${e.message})`:""));throw t.context=e,t}const i=s[e];if(void 0===i)return!1;if("function"==typeof i)t(i,this,r);else{const e=i.length,n=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let s=0;s<e;s+=1)t(n[s],this,r)}return!0}}return Yn.default=n,Yn}function Kn(){if(Zn)return Qn;Zn=1;var e=Qn&&Qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.BaseBlockTracker=void 0;const t=e(Xn()),r=(e,t)=>e+t,n=["sync","latest"];let s=class extends t.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||2e4,this._usePastBlocks=e.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(){if(this._currentBlock)return this._currentBlock;return await new Promise(e=>this.once("latest",e))}removeAllListeners(e){return e?super.removeAllListeners(e):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(e){n.includes(e)&&this._maybeStart()}
1_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 n.map(e=>this.listenerCount(e)).reduce(r)}_shouldUseNewBlock(e){const t=this._currentBlock;if(!t)return!0;const r=i(e),n=i(t);return this._usePastBlocks&&r<n||r>n}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_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}};function i(e){return Number.parseInt(e,16)}return Qn.BaseBlockTracker=s,Qn}var es={},ts={},rs={};class ns extends TypeError{constructor(e,t){let r;const{message:n,explanation:s,...i}=e,{path:o}=e,a=0===o.length?n:`At path: ${o.join(".")} -- ${n}`;super(s??a),null!=s&&(this.cause=a),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function ss(e){return"object"==typeof e&&null!=e}function is(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function os(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function as(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${os(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:c}}function*cs(e,t,r,n){var s;ss(s=e)&&"function"==typeof s[Symbol.iterator]||(e=[e]);for(const i of e){const e=as(i,t,r,n);e&&(yield e)}}function*ls(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&&"type"!==t.type&&ss(t.schema)&&ss(e)&&!Array.isArray(e)))for(const l in e)void 0===t.schema[l]&&delete e[l];let c="valid";for(const l of t.validator(e,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,a)){const t=ls(u,d,{path:void 0===l?n:[...n,l],branch:void 0===l?s:[...s,u],coerce:i,mask:o,message:r.message});for(const r of t)r[0]?(c=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):i&&(u=r[1],void 0===l?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):ss(e)&&(void 0!==u||l in e)&&(e[l]=u))}if("not_valid"!==c)for(const l of t.refiner(e,a))l.explanation=r.message,c="not_refined",yield[l,void 0];"valid"===c&&(yield[void 0,e])}class us{constructor(e){const{type:t,schema:r,validator:n,refiner:s,coercer:i=e=>e,entries:o=function*(){}}=e;this.type=t,this.schema=r,this.entries=o,this.coercer=i,this.validator=n?(e,t)=>cs(n(e,t),t,this,e):()=>[],this.refiner=s?(e,t)=>cs(s(e,t),t,this,e):()=>[]}assert(e,t){return ds(e,this,t)}create(e,t){return hs(e,this,t)}is(e){return fs(e,this)}mask(e,t){return ps(e,this,t)}validate(e,t={}){return gs(e,this,t)}}function ds(e,t,r){const n=gs(e,t,{message:r});if(n[0])throw n[0]}function hs(e,t,r){const n=gs(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function ps(e,t,r){const n=gs(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function fs(e,t){return!gs(e,t)[0]}function gs(e,t,r={}){const n=ls(e,t,r),s=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(s[0]){return[new ns(s[0],function*(){for(const e of n)e[0]&&(yield e[0])}),void 0]}return[void 0,s[1]]}function ms(e,t){return new us({type:e,schema:null,validator:t})}function _s(){return ms("never",()=>!1)}function bs(e){const t=e?Object.keys(e):[],r=_s();return new us({type:"object",schema:e||null,*entries(n){if(e&&ss(n)){const s=new Set(Object.keys(n));for(const r of t)s.delete(r),yield[r,n[r],e[r]];for(const e of s)yield[e,n[e],r]}},validator:e=>ss(e)||`Expected an object, but received: ${os(e)}`,coercer:e=>ss(e)?{...e}:e})}function ys(e){return new us({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function vs(){return ms("string",e=>"string"==typeof e||`Expected a string, but received: ${os(e)}`)}function ws(e){const t=Object.keys(e);return new us({type:"type",schema:e,*entries(r){if(ss(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>ss(e)||`Expected an object, but received: ${os(e)}`,coercer:e=>ss(e)?{...e}:e})}function Es(){return ms("unknown",()=>!0)}function ks(e,t,r){return new us({...e,coercer:(n,s)=>fs(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function Ss(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Cs(e,t,r){return new us({...e,*refiner(n,s){yield*e.refiner(n,s);const i=cs(r(n,s),s,e,n);for(const e of i)yield{...e,refinement:t}}})}const Is=t(Object.freeze(Object.defineProperty({__proto__:null,Struct:us,StructError:ns,any:function(){return ms("any",()=>!0)},array:function(e){return new us({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${os(e)}`})},assert:ds,assign:function(...e){const t="type"===e[0].type,r=e.map(e=>e.schema),n=Object.assign({},...r);return t?ws(n):bs(n)},bigint:function(){return ms("bigint",e=>"bigint"==typeof e)},boolean:function(){return ms("boolean",e=>"boolean"==typeof e)},coerce:ks,create:hs,date:function(){return ms("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${os(e)}`)},defaulted:function(e,t,r={}){return ks(e,Es(),e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&is(e)&&is(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e})},define:ms,deprecated:function(e,t){return new us({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})},dynamic:function(e){return new us({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},empty:function(e){return Cs(e,"empty",t=>{const r=Ss(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``})},enums:function(e){const t={},r=e.map(e=>os(e)).join();for(const n of e)t[n]=n;return new us({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${os(t)}`})},func:function(){return ms("func",e=>"function"==typeof e||`Expected a function, but received: ${os(e)}`)},instance:function(e){return ms("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${os(t)}`)},integer:function(){return ms("integer",e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${os(e)}`)},intersection:function(e){return new us({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)}
1,*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)}})},is:fs,lazy:function(e){let t;return new us({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})},literal:function(e){const t=os(e),r=typeof e;return new us({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${os(r)}`})},map:function(e,t){return new us({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:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${os(e)}`})},mask:ps,max:function(e,t,r={}){const{exclusive:n}=r;return Cs(e,"max",r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``)},min:function(e,t,r={}){const{exclusive:n}=r;return Cs(e,"min",r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``)},never:_s,nonempty:function(e){return Cs(e,"nonempty",t=>Ss(t)>0||`Expected a nonempty ${e.type} but received an empty one`)},nullable:function(e){return new us({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},number:function(){return ms("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${os(e)}`)},object:bs,omit:function(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];return"type"===e.type?ws(n):bs(n)},optional:ys,partial:function(e){const t=e instanceof us,r=t?{...e.schema}:{...e};for(const n in r)r[n]=ys(r[n]);return t&&"type"===e.type?ws(r):bs(r)},pattern:function(e,t){return Cs(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)},pick:function(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];return"type"===e.type?ws(n):bs(n)},record:function(e,t){return new us({type:"record",schema:null,*entries(r){if(ss(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator:e=>ss(e)||`Expected an object, but received: ${os(e)}`})},refine:Cs,regexp:function(){return ms("regexp",e=>e instanceof RegExp)},set:function(e){return new us({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${os(e)}`})},size:function(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Cs(e,"size",e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${s} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:i}=e;return t<=i&&i<=r||`${n} with a size ${s} but received one with a size of \`${i}\``}{const{length:i}=e;return t<=i&&i<=r||`${n} with a length ${s} but received one with a length of \`${i}\``}})},string:vs,struct:function(e,t){return ms(e,t)},trimmed:function(e){return ks(e,vs(),e=>e.trim())},tuple:function(e){const t=_s();return new us({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:e=>Array.isArray(e)||`Expected an array, but received: ${os(e)}`})},type:ws,union:function(e){const t=e.map(e=>e.type).join(" | ");return new us({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const s=[];for(const t of e){const[...e]=ls(r,t,n),[i]=e;if(!i[0])return[];for(const[t]of e)t&&s.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${os(r)}`,...s]}})},unknown:Es,validate:gs},Symbol.toStringTag,{value:"Module"})));var Rs;function xs(){if(Rs)return rs;Rs=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.assertExhaustive=rs.assertStruct=rs.assert=rs.AssertionError=void 0;const e=Is;function t(e,t){return r=e,Boolean("string"==typeof(null===(s=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===s?void 0:s.name))?new e({message:t}):e({message:t});var r,n,s}
1class r extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}return rs.AssertionError=r,rs.assert=function(e,n="Assertion failed.",s=r){if(!e){if(n instanceof Error)throw n;throw t(s,n)}},rs.assertStruct=function(n,s,i="Assertion failed",o=r){try{(0,e.assert)(n,s)}catch(a){throw t(o,`${i}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(a)}.`)}},rs.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")},rs}var As,Ms={};function Ns(){if(As)return Ms;As=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.base64=void 0;const e=Is,t=xs();return Ms.base64=(r,n={})=>{var s,i;const o=null!==(s=n.paddingRequired)&&void 0!==s&&s,a=null!==(i=n.characterSet)&&void 0!==i?i:"base64";let c,l;return"base64"===a?c=String.raw`[A-Za-z0-9+\/]`:((0,t.assert)("base64url"===a),c=String.raw`[-_A-Za-z0-9]`),l=o?new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,e.pattern)(r,l)},Ms}var Ls,Ps,Os={},Ts={};function js(){return Ls||(Ls=1,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=Is,r=xs();function n(r){return(0,t.is)(r,e.HexStruct)}function s(r){return(0,t.is)(r,e.StrictHexStruct)}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),e.isHexString=n,e.isStrictHexString=s,e.assertIsHexString=function(e){(0,r.assert)(n(e),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(e){(0,r.assert)(s(e),'Value must be a hexadecimal string, starting with "0x".')},e.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},e.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}}(Ts)),Ts}function Bs(){if(Ps)return Os;Ps=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.createDataView=Os.concatBytes=Os.valueToBytes=Os.stringToBytes=Os.numberToBytes=Os.signedBigIntToBytes=Os.bigIntToBytes=Os.hexToBytes=Os.bytesToString=Os.bytesToNumber=Os.bytesToSignedBigInt=Os.bytesToBigInt=Os.bytesToHex=Os.assertIsBytes=Os.isBytes=void 0;const t=xs(),r=js();const n=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function s(e){return e instanceof Uint8Array}function i(e){(0,t.assert)(s(e),"Value must be a Uint8Array.")}function o(e){if(i(e),0===e.length)return"0x";const t=n(),s=new Array(e.length);for(let r=0;r<e.length;r++)s[r]=t[e[r]];return(0,r.add0x)(s.join(""))}function a(e){i(e);const t=o(e);return BigInt(t)}function c(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,r.assertIsHexString)(e);const n=(0,r.remove0x)(e).toLowerCase(),s=n.length%2==0?n:`0${n}`,i=new Uint8Array(s.length/2);for(let r=0;r<i.length;r++){const e=s.charCodeAt(2*r),t=s.charCodeAt(2*r+1),n=e-(e<58?48:87),o=t-(t<58?48:87);i[r]=16*n+o}return i}function l(e){(0,t.assert)("bigint"==typeof e,"Value must be a bigint."),(0,t.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return c(e.toString(16))}function u(e){(0,t.assert)("number"==typeof e,"Value must be a number."),(0,t.assert)(e>=0,"Value must be a non-negative number."),(0,t.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return c(e.toString(16))}function d(e){return(0,t.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function h(e){if("bigint"==typeof e)return l(e);if("number"==typeof e)return u(e);if("string"==typeof e)return e.startsWith("0x")?c(e):d(e);if(s(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}return Os.isBytes=s,Os.assertIsBytes=i,Os.bytesToHex=o,Os.bytesToBigInt=a,Os.bytesToSignedBigInt=function(e){i(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},Os.bytesToNumber=function(e){i(e);const r=a(e);return(0,t.assert)(r<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(r)},Os.bytesToString=function(e){return i(e),(new TextDecoder).decode(e)},Os.hexToBytes=c,Os.bigIntToBytes=l,Os.signedBigIntToBytes=function(e,r){(0,t.assert)("bigint"==typeof e,"Value must be a bigint."),(0,t.assert)("number"==typeof r,"Byte length must be a number."),(0,t.assert)(r>0,"Byte length must be greater than 0."),(0,t.assert)(function(e,r){(0,t.assert)(r>0);const n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*r-1))}(e,r),"Byte length is too small to represent the given value.");let n=e;const s=new Uint8Array(r);for(let t=0;t<s.length;t++)s[t]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return s.reverse()}
1,Os.numberToBytes=u,Os.stringToBytes=d,Os.valueToBytes=h,Os.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const n=h(e[s]);t[s]=n,r+=n.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},Os.createDataView=function(t){if(void 0!==e&&t instanceof e){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)},Os}var Fs,Ds={};var $s,Us={};var Hs,zs={};var Vs,Ws={};var qs,Js={};var Gs,Zs={};var Qs,Ys,Xs,Ks,ei,ti,ri={},ni={exports:{}};function si(){if(Ys)return Qs;Ys=1;var e=1e3,t=6e4,r=60*t,n=24*r,s=7*n,i=365.25*n;function o(e,t,r,n){var s=t>=1.5*r;return Math.round(e/r)+" "+n+(s?"s":"")}return Qs=function(a,c){c=c||{};var l=typeof a;if("string"===l&&a.length>0)return function(o){if((o=String(o)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===l&&isFinite(a))return c.long?function(s){var i=Math.abs(s);if(i>=n)return o(s,i,n,"day");if(i>=r)return o(s,i,r,"hour");if(i>=t)return o(s,i,t,"minute");if(i>=e)return o(s,i,e,"second");return s+" ms"}(a):function(s){var i=Math.abs(s);if(i>=n)return Math.round(s/n)+"d";if(i>=r)return Math.round(s/r)+"h";if(i>=t)return Math.round(s/t)+"m";if(i>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}function ii(){return ei||(ei=1,function(e,t){var r={};t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))}),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(s){}!e&&void 0!==n&&"env"in n&&(e=r.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0)}})(),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","#F
1F6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(Ks?Xs:(Ks=1,Xs=function(e){function t(e){let n,s,i,o=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),i=s-(n||s);r.diff=i,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";o++;const i=t.formatters[s];if("function"==typeof i){const t=e[o];n=i.call(r,t),e.splice(o,1),o--}return n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==t.namespaces&&(s=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,s=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(s=n,i=r,n++):(r++,n++);else{if(-1===s)return!1;n=s+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const n of r)"-"===n[0]?t.skips.push(n.slice(1)):t.names.push(n)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=si(),t.destroy=function(){},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}))(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(ni,ni.exports)),ni.exports}var oi,ai={};var ci,li={};var ui,di={};var hi,pi={};function fi(){return hi||(hi=1,function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(t=e.Duration||(e.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};e.inMilliseconds=function(e,t){return r(e,"count"),e*t},e.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}}(pi)),pi}var gi,mi={};var _i,bi,yi,vi,wi,Ei,ki,Si,Ci,Ii,Ri,xi,Ai,Mi,Ni,Li,Pi,Oi,Ti,ji,Bi,Fi,Di,$i,Ui,Hi,zi,Vi,Wi,qi,Ji,Gi,Zi,Qi,Yi,Xi,Ki,eo,to,ro,no,so,io,oo,ao,co,lo,uo,ho,po,fo,go,mo,_o,bo,yo,vo,wo,Eo,ko,So,Co,Io,Ro,xo,Ao,Mo,No,Lo,Po,Oo,To,jo,Bo,Fo,Do,$o,Uo,Ho,zo,Vo,Wo,qo,Jo,Go,Zo,Qo,Yo,Xo,Ko,ea,ta,ra,na={},sa={exports:{}};function ia(){if(bi)return _i;bi=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return _i={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function oa(){if(vi)return yi;vi=1;var e={};const t="object"==typeof n&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...e)=>{}:()=>{};return yi=t}function aa(){return wi||(wi=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=ia(),i=oa(),o=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",s],[h,n]],f=(e,t,r)=>{const n=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=d++;i(e,s,t),u[e]=s,c[s]=t,l[s]=n,o[s]=new RegExp(t,r?"g":void 0),a[s]=new RegExp(n,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}
1+`),f("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),f("FULL",`^${c[u.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),f("LOOSE",`^${c[u.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),f("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),f("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[u.COERCE],!0),f("COERCERTLFULL",c[u.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(sa,sa.exports)),sa.exports}function ca(){if(ki)return Ei;ki=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ei=r=>r?"object"!=typeof r?e:r:t}function la(){if(Ci)return Si;Ci=1;const e=/^[0-9]+$/,t=(t,r)=>{if("number"==typeof t&&"number"==typeof r)return t===r?0:t<r?-1:1;const n=e.test(t),s=e.test(r);return n&&s&&(t=+t,r=+r),t===r?0:n&&!s?-1:s&&!n?1:t<r?-1:1};return Si={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}function ua(){if(Ri)return Ii;Ri=1;const e=oa(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=ia(),{safeRe:n,t:s}=aa(),i=ca(),{compareIdentifiers:o}=la();class a{constructor(o,c){if(c=i(c),o instanceof a){if(o.loose===!!c.loose&&o.includePrerelease===!!c.includePrerelease)return o;o=o.version}else if("string"!=typeof o)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",o,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=o.trim().match(c.loose?n[s.LOOSE]:n[s.FULL]);if(!l)throw new TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=l[5]?l[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(e("SemVer.compare",this.version,this.options,t),!(t instanceof a)){if("string"==typeof t&&t===this.version)return 0;t=new a(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof a||(t=new a(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(e("prerelease compare",r,n,s),void 0===n&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===n)return-1;if(n!==s)return o(n,s)}while(++r)}compareBuild(t){t instanceof a||(t=new a(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(e("build compare",r,n,s),void 0===n&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===n)return-1;if(n!==s)return o(n,s)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);
1if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===o(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ii=a}function da(){if(Ai)return xi;Ai=1;const e=ua();return xi=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(s){if(!n)return null;throw s}}}function ha(){if(Ji)return qi;Ji=1;const e=ua();return qi=(t,r,n)=>new e(t,n).compare(new e(r,n))}function pa(){if(Ki)return Xi;Ki=1;const e=ua();return Xi=(t,r,n)=>{const s=new e(t,n),i=new e(r,n);return s.compare(i)||s.compareBuild(i)}}function fa(){if(io)return so;io=1;const e=ha();return so=(t,r,n)=>e(t,r,n)>0}function ga(){if(ao)return oo;ao=1;const e=ha();return oo=(t,r,n)=>e(t,r,n)<0}function ma(){if(lo)return co;lo=1;const e=ha();return co=(t,r,n)=>0===e(t,r,n)}function _a(){if(ho)return uo;ho=1;const e=ha();return uo=(t,r,n)=>0!==e(t,r,n)}function ba(){if(fo)return po;fo=1;const e=ha();return po=(t,r,n)=>e(t,r,n)>=0}function ya(){if(mo)return go;mo=1;const e=ha();return go=(t,r,n)=>e(t,r,n)<=0}function va(){if(bo)return _o;bo=1;const e=ma(),t=_a(),r=fa(),n=ba(),s=ga(),i=ya();return _o=(o,a,c,l)=>{switch(a){case"===":return"object"==typeof o&&(o=o.version),"object"==typeof c&&(c=c.version),o===c;case"!==":return"object"==typeof o&&(o=o.version),"object"==typeof c&&(c=c.version),o!==c;case"":case"=":case"==":return e(o,c,l);case"!=":return t(o,c,l);case">":return r(o,c,l);case">=":return n(o,c,l);case"<":return s(o,c,l);case"<=":return i(o,c,l);default:throw new TypeError(`Invalid operator: ${a}`)}}}function wa(){if(So)return ko;So=1;const e=/\s+/g;class t{constructor(r,i){if(i=n(i),r instanceof t)return r.loose===!!i.loose&&r.includePrerelease===!!i.includePrerelease?r:new t(r.raw,i);if(r instanceof s)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!f(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&g(t[0])){this.set=[t];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+e,n=r.get(t);if(n)return n;const o=this.options.loose,g=o?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(g,R(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),i("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),i("caret trim",e);let m=e.split(" ").map(e=>_(e,this.options)).join(" ").split(/\s+/).map(e=>I(e,this.options));o&&(m=m.filter(e=>(i("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE])))),i("range list",m);const b=new Map,y=m.map(e=>new s(e,this.options));for(const r of y){if(f(r))return[r];b.set(r.value,r)}b.size>1&&b.has("")&&b.delete("");const v=[...b.values()];return r.set(t,v),v}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>m(t,r)&&e.set.some(e=>m(e,r)&&t.every(t=>e.every(e=>t.intersects(e,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new o(e,this.options)}catch(t){return!1}for(let r=0;r<this.set.length;r++)if(x(this.set[r],e,this.options))return!0;return!1}}ko=t;const r=new(Eo?wo:(Eo=1,wo=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>
vendor: 4,139 bytes, line 1
1=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}})),n=ca(),s=Ea(),i=oa(),o=ua(),{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:d}=aa(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=ia(),f=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every(e=>s.intersects(e,t)),s=n.pop();return r},_=(e,t)=>(e=e.replace(a[c.BUILD],""),i("comp",e,t),e=w(e,t),i("caret",e),e=y(e,t),i("tildes",e),e=k(e,t),i("xrange",e),e=C(e,t),i("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map(e=>v(e,t)).join(" "),v=(e,t)=>{const r=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(r,(t,r,n,s,o)=>{let a;return i("tilde",e,t,r,n,s,o),b(r)?a="":b(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:b(s)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(i("replaceTilde pr",o),a=`>=${r}.${n}.${s}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,i("tilde return",a),a})},w=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{i("caret",e,t);const r=t.loose?a[c.CARETLOOSE]:a[c.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,s,o,a)=>{let c;return i("caret",e,t,r,s,o,a),b(r)?c="":b(s)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:b(o)?c="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:a?(i("replaceCaret pr",a),c="0"===r?"0"===s?`>=${r}.${s}.${o}-${a} <${r}.${s}.${+o+1}-0`:`>=${r}.${s}.${o}-${a} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${o}-${a} <${+r+1}.0.0-0`):(i("no pr"),c="0"===r?"0"===s?`>=${r}.${s}.${o}${n} <${r}.${s}.${+o+1}-0`:`>=${r}.${s}.${o}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${o} <${+r+1}.0.0-0`),i("caret return",c),c})},k=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map(e=>S(e,t)).join(" ")),S=(e,t)=>{e=e.trim();const r=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(r,(r,n,s,o,a,c)=>{i("xRange",e,r,n,s,o,a,c);const l=b(s),u=l||b(o),d=u||b(a),h=d;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(o=0),a=0,">"===n?(n=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?s=+s+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+s}.${o}.${a}${c}`):u?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),i("xRange return",r),r})},C=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),I=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),R=e=>(t,r,n,s,i,o,a,c,l,u,d,h)=>`${r=b(n)?"":b(s)?`>=${n}.0.0${e?"-0":""}`:b(i)?`>=${n}.${s}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=b(l)?"":b(u)?`<${+l+1}.0.0-0`:b(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),x=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(i(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return ko}function Ea(){if(Io)return Co;Io=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,s){if(s=r(s),n instanceof t){if(n.loose===!!s.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),o("comparator",n,s),this.options=s,this.loose=!!s.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(t){const r=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==i[1]?i[1]:"","="===this.operator&&(this.operator=""),i[2]?this.semver=new a(i[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(o("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(r){return!1}return i(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,
1n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(i(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(i(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Co=t;const r=ca(),{safeRe:n,t:s}=aa(),i=va(),o=oa(),a=ua(),c=wa();return Co}function ka(){if(xo)return Ro;xo=1;const e=wa();return Ro=(t,r,n)=>{try{r=new e(r,n)}catch(s){return!1}return r.test(t)}}function Sa(){if($o)return Do;$o=1;const e=ua(),t=Ea(),{ANY:r}=t,n=wa(),s=ka(),i=fa(),o=ga(),a=ya(),c=ba();return Do=(l,u,d,h)=>{let p,f,g,m,_;switch(l=new e(l,h),u=new n(u,h),d){case">":p=i,f=a,g=o,m=">",_=">=";break;case"<":p=o,f=c,g=i,m="<",_="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(l,u,h))return!1;for(let e=0;e<u.set.length;++e){const n=u.set[e];let s=null,i=null;if(n.forEach(e=>{e.semver===r&&(e=new t(">=0.0.0")),s=s||e,i=i||e,p(e.semver,s.semver,h)?s=e:g(e.semver,i.semver,h)&&(i=e)}),s.operator===m||s.operator===_)return!1;if((!i.operator||i.operator===m)&&f(l,i.semver))return!1;if(i.operator===_&&g(l,i.semver))return!1}return!0}}function Ca(){if(Xo)return Yo;Xo=1;const e=aa(),t=ia(),r=ua(),n=la(),s=da(),i=function(){if(Ni)return Mi;Ni=1;const e=da();return Mi=(t,r)=>{const n=e(t,r);return n?n.version:null}}(),o=function(){if(Pi)return Li;Pi=1;const e=da();return Li=(t,r)=>{const n=e(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null}}(),a=function(){if(Ti)return Oi;Ti=1;const e=ua();return Oi=(t,r,n,s,i)=>{"string"==typeof n&&(i=s,s=n,n=void 0);try{return new e(t instanceof e?t.version:t,n).inc(r,s,i).version}catch(o){return null}}}(),c=function(){if(Bi)return ji;Bi=1;const e=da();return ji=(t,r)=>{const n=e(t,null,!0),s=e(r,null,!0),i=n.compare(s);if(0===i)return null;const o=i>0,a=o?n:s,c=o?s:n,l=!!a.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const u=l?"pre":"";return n.major!==s.major?u+"major":n.minor!==s.minor?u+"minor":n.patch!==s.patch?u+"patch":"prerelease"}}(),l=function(){if(Di)return Fi;Di=1;const e=ua();return Fi=(t,r)=>new e(t,r).major}(),u=function(){if(Ui)return $i;Ui=1;const e=ua();return $i=(t,r)=>new e(t,r).minor}(),d=function(){if(zi)return Hi;zi=1;const e=ua();return Hi=(t,r)=>new e(t,r).patch}(),h=function(){if(Wi)return Vi;Wi=1;const e=da();return Vi=(t,r)=>{const n=e(t,r);return n&&n.prerelease.length?n.prerelease:null}}(),p=ha(),f=function(){if(Zi)return Gi;Zi=1;const e=ha();return Gi=(t,r,n)=>e(r,t,n)}(),g=function(){if(Yi)return Qi;Yi=1;const e=ha();return Qi=(t,r)=>e(t,r,!0)}(),m=pa(),_=function(){if(to)return eo;to=1;const e=pa();return eo=(t,r)=>t.sort((t,n)=>e(t,n,r))}(),b=function(){if(no)return ro;no=1;const e=pa();return ro=(t,r)=>t.sort((t,n)=>e(n,t,r))}(),y=fa(),v=ga(),w=ma(),E=_a(),k=ba(),S=ya(),C=va(),I=function(){if(vo)return yo;vo=1;const e=ua(),t=da(),{safeRe:r,t:n}=aa();return yo=(s,i)=>{if(s instanceof e)return s;if("number"==typeof s&&(s=String(s)),"string"!=typeof s)return null;let o=null;if((i=i||{}).rtl){const e=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let t;for(;(t=e.exec(s))&&(!o||o.index+o[0].length!==s.length);)o&&t.index+t[0].length===o.index+o[0].length||(o=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else o=s.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);if(null===o)return null;const a=o[2],c=o[3]||"0",l=o[4]||"0",u=i.includePrerelease&&o[5]?`-${o[5]}`:"",d=i.includePrerelease&&o[6]?`+${o[6]}`:"";return t(`${a}.${c}.${l}${u}${d}`,i)}}(),R=Ea(),x=wa(),A=ka(),M=function(){if(Mo)return Ao;Mo=1;const e=wa();return Ao=(t,r)=>new e(t,r).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))}(),N=function(){if(Lo)return No;Lo=1;const e=ua(),t=wa();return No=(r,n,s)=>{let i=null,o=null,a=null;try{a=new t(n,s)}catch(c){return null}return r.forEach(t=>{a.test(t)&&(i&&-1!==o.compare(t)||(i=t,o=new e(i,s)))}),i}}(),L=function(){if(Oo)return Po;Oo=1;const e=ua(),t=wa();return Po=(r,n,s)=>{let i=null,o=null,a=null;try{a=new t(n,s)}catch(c){return null}return r.forEach(t=>{a.test(t)&&(i&&1!==o.compare(t)||(i=t,o=new e(i,s)))}),i}}(),P=function(){if(jo)return To;jo=1;const e=ua(),t=wa(),r=fa();return To=(n,s)=>{n=new t(n,s);let i=new e("0.0.0");if(n.test(i))return i;if(i=new e("0.0.0-0"),n.test(i))return i;i=null;for(let t=0;t<n.set.length;++t){const s=n.set[t];let o=null;
1s.forEach(t=>{const n=new e(t.semver.version);switch(t.operator){case">":0===n.prerelease.length?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":o&&!r(n,o)||(o=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!o||i&&!r(i,o)||(i=o)}return i&&n.test(i)?i:null}}(),O=function(){if(Fo)return Bo;Fo=1;const e=wa();return Bo=(t,r)=>{try{return new e(t,r).range||"*"}catch(n){return null}}}(),T=Sa(),j=function(){if(Ho)return Uo;Ho=1;const e=Sa();return Uo=(t,r,n)=>e(t,r,">",n)}(),B=function(){if(Vo)return zo;Vo=1;const e=Sa();return zo=(t,r,n)=>e(t,r,"<",n)}(),F=function(){if(qo)return Wo;qo=1;const e=wa();return Wo=(t,r,n)=>(t=new e(t,n),r=new e(r,n),t.intersects(r,n))}(),D=function(){if(Go)return Jo;Go=1;const e=ka(),t=ha();return Jo=(r,n,s)=>{const i=[];let o=null,a=null;const c=r.sort((e,r)=>t(e,r,s));for(const t of c)e(t,n,s)?(a=t,o||(o=t)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);const l=[];for(const[e,t]of i)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof n.raw?n.raw:String(n);return u.length<d.length?u:n}}(),$=function(){if(Qo)return Zo;Qo=1;const e=wa(),t=Ea(),{ANY:r}=t,n=ka(),s=ha(),i=[new t(">=0.0.0-0")],o=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===r){if(1===t.length&&t[0].semver===r)return!0;e=a.includePrerelease?i:o}if(1===t.length&&t[0].semver===r){if(a.includePrerelease)return!0;t=o}const u=new Set;let d,h,p,f,g,m,_;for(const r of e)">"===r.operator||">="===r.operator?d=c(d,r,a):"<"===r.operator||"<="===r.operator?h=l(h,r,a):u.add(r.semver);if(u.size>1)return null;if(d&&h){if(p=s(d.semver,h.semver,a),p>0)return null;if(0===p&&(">="!==d.operator||"<="!==h.operator))return null}for(const r of u){if(d&&!n(r,String(d),a))return null;if(h&&!n(r,String(h),a))return null;for(const e of t)if(!n(r,String(e),a))return!1;return!0}let b=!(!h||a.includePrerelease||!h.semver.prerelease.length)&&h.semver,y=!(!d||a.includePrerelease||!d.semver.prerelease.length)&&d.semver;b&&1===b.prerelease.length&&"<"===h.operator&&0===b.prerelease[0]&&(b=!1);for(const r of t){if(_=_||">"===r.operator||">="===r.operator,m=m||"<"===r.operator||"<="===r.operator,d)if(y&&r.semver.prerelease&&r.semver.prerelease.length&&r.semver.major===y.major&&r.semver.minor===y.minor&&r.semver.patch===y.patch&&(y=!1),">"===r.operator||">="===r.operator){if(f=c(d,r,a),f===r&&f!==d)return!1}else if(">="===d.operator&&!n(d.semver,String(r),a))return!1;if(h)if(b&&r.semver.prerelease&&r.semver.prerelease.length&&r.semver.major===b.major&&r.semver.minor===b.minor&&r.semver.patch===b.patch&&(b=!1),"<"===r.operator||"<="===r.operator){if(g=l(h,r,a),g===r&&g!==h)return!1}else if("<="===h.operator&&!n(h.semver,String(r),a))return!1;if(!r.operator&&(h||d)&&0!==p)return!1}return!(d&&m&&!h&&0!==p||h&&_&&!d&&0!==p||y||b)},c=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};return Zo=(t,r,n={})=>{if(t===r)return!0;t=new e(t,n),r=new e(r,n);let s=!1;e:for(const e of t.set){for(const t of r.set){const r=a(e,t,n);if(s=s||null!==r,r)continue e}if(s)return!1}return!0}}();return Yo={parse:s,valid:i,clean:o,inc:a,diff:c,major:l,minor:u,patch:d,prerelease:h,compare:p,rcompare:f,compareLoose:g,compareBuild:m,sort:_,rsort:b,gt:y,lt:v,eq:w,neq:E,gte:k,lte:S,cmp:C,coerce:I,Comparator:R,Range:x,satisfies:A,toComparators:M,maxSatisfying:N,minSatisfying:L,minVersion:P,validRange:O,outside:T,gtr:j,ltr:B,intersects:F,simplifyRange:D,subset:$,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}}function Ia(){return ea||(ea=1,e=ts,t=ts&&ts.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);
1s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=ts&&ts.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r(xs(),e),r(Ns(),e),r(Bs(),e),r(function(){if(Fs)return Ds;Fs=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.ChecksumStruct=void 0;const e=Is,t=Ns();return Ds.ChecksumStruct=(0,e.size)((0,t.base64)((0,e.string)(),{paddingRequired:!0}),44,44),Ds}(),e),r(function(){if($s)return Us;$s=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.createHex=Us.createBytes=Us.createBigInt=Us.createNumber=void 0;const e=Is,t=xs(),r=Bs(),n=js(),s=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),n.StrictHexStruct]),i=(0,e.coerce)((0,e.number)(),s,Number),o=(0,e.coerce)((0,e.bigint)(),s,BigInt);(0,e.union)([n.StrictHexStruct,(0,e.instance)(Uint8Array)]);const a=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([n.StrictHexStruct]),r.hexToBytes),c=(0,e.coerce)(n.StrictHexStruct,(0,e.instance)(Uint8Array),r.bytesToHex);return Us.createNumber=function(r){try{const n=(0,e.create)(r,i);return(0,t.assert)(Number.isFinite(n),`Expected a number-like value, got "${r}".`),n}catch(n){if(n instanceof e.StructError)throw new Error(`Expected a number-like value, got "${r}".`);throw n}},Us.createBigInt=function(t){try{return(0,e.create)(t,o)}catch(r){if(r instanceof e.StructError)throw new Error(`Expected a number-like value, got "${String(r.value)}".`);throw r}},Us.createBytes=function(t){if("string"==typeof t&&"0x"===t.toLowerCase())return new Uint8Array;try{return(0,e.create)(t,a)}catch(r){if(r instanceof e.StructError)throw new Error(`Expected a bytes-like value, got "${String(r.value)}".`);throw r}},Us.createHex=function(t){if(t instanceof Uint8Array&&0===t.length||"string"==typeof t&&"0x"===t.toLowerCase())return"0x";try{return(0,e.create)(t,c)}catch(r){if(r instanceof e.StructError)throw new Error(`Expected a bytes-like value, got "${String(r.value)}".`);throw r}},Us}(),e),r(function(){if(Hs)return zs;Hs=1;var e,t,r=zs&&zs.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},n=zs&&zs.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(zs,"__esModule",{value:!0}),zs.FrozenSet=zs.FrozenMap=void 0;class s{constructor(t){e.set(this,void 0),r(this,e,new Map(t),"f"),Object.freeze(this)}get size(){return n(this,e,"f").size}[(e=new WeakMap,Symbol.iterator)](){return n(this,e,"f")[Symbol.iterator]()}entries(){return n(this,e,"f").entries()}forEach(t,r){return n(this,e,"f").forEach((e,n,s)=>t.call(r,e,n,this))}get(t){return n(this,e,"f").get(t)}has(t){return n(this,e,"f").has(t)}keys(){return n(this,e,"f").keys()}values(){return n(this,e,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,t])=>`${String(e)} => ${String(t)}`).join(", ")} `:""}}`}}zs.FrozenMap=s;class i{constructor(e){t.set(this,void 0),r(this,t,new Set(e),"f"),Object.freeze(this)}get size(){return n(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return n(this,t,"f")[Symbol.iterator]()}entries(){return n(this,t,"f").entries()}forEach(e,r){return n(this,t,"f").forEach((t,n,s)=>e.call(r,t,n,this))}has(e){return n(this,t,"f").has(e)}keys(){return n(this,t,"f").keys()}values(){return n(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}
1return zs.FrozenSet=i,Object.freeze(s),Object.freeze(s.prototype),Object.freeze(i),Object.freeze(i.prototype),zs}(),e),r((Vs||(Vs=1,Object.defineProperty(Ws,"__esModule",{value:!0})),Ws),e),r(js(),e),r((qs||(qs=1,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=Is,r=xs();e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),(0,t.define)("finite number",e=>(0,t.is)(e,(0,t.number)())&&Number.isFinite(e)),(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",(t,r)=>{function n(e,t){const n=[...t.validator(e,r)];return!(n.length>0)||n}try{const r=n(t,e.UnsafeJsonStruct);return!0!==r?r:n(JSON.parse(JSON.stringify(t)),e.UnsafeJsonStruct)}catch(s){return s instanceof RangeError&&"Circular reference detected"}}),e.isValidJson=function(r){return(0,t.is)(r,e.JsonStruct)},e.getJsonSize=function(t){(0,r.assertStruct)(t,e.JsonStruct,"Invalid JSON value");const n=JSON.stringify(t);return(new TextEncoder).encode(n).byteLength},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"]),e.isJsonRpcNotification=function(r){return(0,t.is)(r,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,n){(0,r.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},e.isJsonRpcRequest=function(r){return(0,t.is)(r,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,n){(0,r.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},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]),e.isPendingJsonRpcResponse=function(r){return(0,t.is)(r,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},e.isJsonRpcResponse=function(r){return(0,t.is)(r,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},e.isJsonRpcSuccess=function(r){return(0,t.is)(r,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,n){(0,r.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},e.isJsonRpcFailure=function(r){return(0,t.is)(r,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,n){(0,r.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},e.isJsonRpcError=function(r){return(0,t.is)(r,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,n){(0,r.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},e.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}(Js)),Js),e),r((Gs||(Gs=1,Object.defineProperty(Zs,"__esModule",{value:!0})),Zs),e),r(function(){if(ti)return ri;ti=1;
1var e=ri&&ri.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ri,"__esModule",{value:!0}),ri.createModuleLogger=ri.createProjectLogger=void 0;const t=(0,e(ii()).default)("metamask");return ri.createProjectLogger=function(e){return t.extend(e)},ri.createModuleLogger=function(e,t){return e.extend(t)},ri}(),e),r((oi||(oi=1,function(e){var t;function r(e){return e.charCodeAt(0)<=127}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,e.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},e.isNullOrUndefined=function(e){return null==e},e.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},e.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(t=e.JsonSize||(e.JsonSize={}))[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date",e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(t){return!1}},e.isASCII=r,e.calculateStringSize=function(t){var n;return t.split("").reduce((e,t)=>r(t)?e+1:e+2,0)+(null!==(n=t.match(e.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},e.calculateNumberSize=function(e){return e.toString().length}}(ai)),ai),e),r(function(){if(ci)return li;ci=1,Object.defineProperty(li,"__esModule",{value:!0}),li.hexToBigInt=li.hexToNumber=li.bigIntToHex=li.numberToHex=void 0;const e=xs(),t=js();return li.numberToHex=r=>((0,e.assert)("number"==typeof r,"Value must be a number."),(0,e.assert)(r>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(r),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,t.add0x)(r.toString(16))),li.bigIntToHex=r=>((0,e.assert)("bigint"==typeof r,"Value must be a bigint."),(0,e.assert)(r>=0,"Value must be a non-negative bigint."),(0,t.add0x)(r.toString(16))),li.hexToNumber=r=>{(0,t.assertIsHexString)(r);const n=parseInt(r,16);return(0,e.assert)(Number.isSafeInteger(n),"Value is not a safe integer. Use `hexToBigInt` instead."),n},li.hexToBigInt=e=>((0,t.assertIsHexString)(e),BigInt((0,t.add0x)(e))),li}(),e),r((ui||(ui=1,Object.defineProperty(di,"__esModule",{value:!0})),di),e),r(fi(),e),r((gi||(gi=1,Object.defineProperty(mi,"__esModule",{value:!0})),mi),e),r((Ko||(Ko=1,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=Ca(),r=Is,n=xs();e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",e=>null!==(0,t.valid)(e)||`Expected SemVer version, got "${e}"`),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",e=>null!==(0,t.validRange)(e)||`Expected SemVer range, got "${e}"`),e.isValidSemVerVersion=function(t){return(0,r.is)(t,e.VersionStruct)},e.isValidSemVerRange=function(t){return(0,r.is)(t,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,n.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,n.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(e,r){return(0,t.gt)(e,r)},e.gtRange=function(e,r){return(0,t.gtr)(e,r)},e.satisfiesVersionRange=function(e,r){return(0,t.satisfies)(e,r,{includePrerelease:!0})}}(na)),na),e)),ts;var e,t,r}function Ra(){if(ra)return qn;ra=1;var e=qn&&qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qn,"__esModule",{value:!0}),qn.PollingBlockTracker=void 0;const t=e(Jn()),r=e(function(){if(zn)return Hn;zn=1;const e=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let e=0;e<arguments.length;e++)n[e]=arguments[e];return new r((r,s)=>{t.errorFirst?n.push(function(e,n){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),s(t)):r(t)}else e?s(e):r(n)}):n.push(function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];r(e)}else r(e)}),e.apply(this,n)})};return Hn=(t,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const n=e=>{const t=t=>"string"==typeof t?e===t:t.test(e);return r.include?r.include.some(t):!r.exclude.some(t)};let s;s="function"==typeof t?function(){return r.excludeMain?t.apply(this,arguments):e(t,r).apply(this,arguments)}:Object.create(Object.getPrototypeOf(t));for(const i in t){const o=t[i];s[i]="function"==typeof o&&n(i)?e(o,r):o}return s},Hn}()),n=Kn(),s=(ta||(ta=1,function(e){Object.defineProperty(e,"__esMo
1dule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Ia();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")}(es)),es),i=(0,s.createModuleLogger)(s.projectLogger,"polling-block-tracker"),o=(0,t.default)();let a=class extends n.BaseBlockTracker{constructor(e={}){var t;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:null!==(t=e.blockResetDuration)&&void 0!==t?t:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||2e4,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===e.keepEventLoopActive||e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const e=c(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await e}catch(t){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(e=t.stack)&&void 0!==e?e:t}`);try{this.emit("error",n)}catch(r){}const s=c(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:o(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),i("Making request",e);const t=await(0,r.default)(t=>this._provider.sendAsync(e,t))();if(i("Got response",t),t.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${t.error.message}`);return t.result}};function c(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}return qn.PollingBlockTracker=a,qn}var xa,Aa,Ma={};function Na(){return Aa||(Aa=1,e=Wn,t=Wn&&Wn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Wn&&Wn.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r(Ra(),e),r(function(){if(xa)return Ma;xa=1;var e=Ma&&Ma.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.SubscribeBlockTracker=void 0;const t=e(Jn()),r=Kn(),n=(0,t.default)();let s=class extends r.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}
1async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...t){return new Promise((r,s)=>{this._provider.sendAsync({id:n(),method:e,params:t,jsonrpc:"2.0"},(e,t)=>{e?s(e):r(t.result)})})}_handleSubData(e,t){var r;"eth_subscription"===t.method&&(null===(r=t.params)||void 0===r?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(t.params.result.number)}};return Ma.SubscribeBlockTracker=s,Ma}(),e)),Wn;var e,t,r}var La,Pa,Oa={},Ta={},ja={};function Ba(){if(La)return ja;La=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.getUniqueId=void 0;const e=4294967295;let t=Math.floor(Math.random()*e);return ja.getUniqueId=function(){return t=(t+1)%e,t},ja}var Fa,Da={};var $a,Ua={};var Ha,za={},Va={};function Wa(){if(Ha)return Va;Ha=1,Object.defineProperty(Va,"__esModule",{value:!0});const e=r();function t(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}class n extends e.EventEmitter{emit(e,...r){let n="error"===e;const s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){let e;if(r.length>0&&([e]=r),e instanceof Error)throw e;const t=new Error("Unhandled error."+(e?` (${e.message})`:""));throw t.context=e,t}const i=s[e];if(void 0===i)return!1;if("function"==typeof i)t(i,this,r);else{const e=i.length,n=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let s=0;s<e;s+=1)t(n[s],this,r)}return!0}}return Va.default=n,Va}var qa,Ja,Ga,Za={},Qa={};function Ya(){if(Ja)return qa;Ja=1,qa=i,i.default=i,i.stable=l,i.stableStringify=l;var e="[...]",t="[Circular]",r=[],n=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(e,t,i,o){var c;void 0===o&&(o=s()),a(e,"",0,[],void 0,0,o);try{c=0===n.length?JSON.stringify(e,t,i):JSON.stringify(e,d(t),i)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function o(e,t,s,i){var o=Object.getOwnPropertyDescriptor(i,s);void 0!==o.get?o.configurable?(Object.defineProperty(i,s,{value:e}),r.push([i,s,t,o])):n.push([t,s,e]):(i[s]=e,r.push([i,s,t]))}function a(r,n,s,i,c,l,u){var d;if(l+=1,"object"==typeof r&&null!==r){for(d=0;d<i.length;d++)if(i[d]===r)return void o(t,r,n,c);if(void 0!==u.depthLimit&&l>u.depthLimit)return void o(e,r,n,c);if(void 0!==u.edgesLimit&&s+1>u.edgesLimit)return void o(e,r,n,c);if(i.push(r),Array.isArray(r))for(d=0;d<r.length;d++)a(r[d],d,d,i,r,l,u);else{var h=Object.keys(r);for(d=0;d<h.length;d++){var p=h[d];a(r[p],p,d,i,r,l,u)}}i.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function l(e,t,i,o){void 0===o&&(o=s());var a,c=u(e,"",0,[],void 0,0,o)||e;try{a=0===n.length?JSON.stringify(c,t,i):JSON.stringify(c,d(t),i)}catch(h){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return a}function u(n,s,i,a,l,d,h){var p;if(d+=1,"object"==typeof n&&null!==n){for(p=0;p<a.length;p++)if(a[p]===n)return void o(t,n,s,l);try{if("function"==typeof n.toJSON)return}catch(_){return}if(void 0!==h.depthLimit&&d>h.depthLimit)return void o(e,n,s,l);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void o(e,n,s,l);if(a.push(n),Array.isArray(n))for(p=0;p<n.length;p++)u(n[p],p,p,a,n,d,h);else{var f={},g=Object.keys(n).sort(c);for(p=0;p<g.length;p++){var m=g[p];u(n[m],m,p,a,n,d,h),f[m]=n[m]}if(void 0===l)return f;r.push([l,s,n]),l[s]=f}a.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var s=0;s<n.length;s++){var i=n[s];if(i[1]===t&&i[0]===r){r=i[2],n.splice(s,1);break}}return e.call(this,t,r)}}return qa}function Xa(){if(Ga)return Qa;Ga=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.EthereumProviderError=Qa.EthereumRpcError=void 0;const e=Ya();
1class t extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return e.default(this.serialize(),r,2)}}Qa.EthereumRpcError=t;function r(e,t){if("[Circular]"!==t)return t}return Qa.EthereumProviderError=class extends t{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}},Qa}var Ka,ec,tc={},rc={};function nc(){return Ka||(Ka=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.errorValues=rc.errorCodes=void 0,rc.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}},rc.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."}}),rc}function sc(){return ec||(ec=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=nc(),r=Xa(),n=t.errorCodes.rpc.internal,s={code:n,message:i(n)};function i(r,n="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(r)){const n=r.toString();if(l(t.errorValues,n))return t.errorValues[n].message;if(a(r))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function o(e){if(!Number.isInteger(e))return!1;const r=e.toString();return!!t.errorValues[r]||!!a(e)}function a(e){return e>=-32099&&e<=-32e3}function c(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=i,e.isValidCode=o,e.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:n=!1}={}){var a,u;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Mu
1st provide fallback error with integer number code and string message.");if(e instanceof r.EthereumRpcError)return e.serialize();const d={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&o(e.code)){const t=e;d.code=t.code,t.message&&"string"==typeof t.message?(d.message=t.message,l(t,"data")&&(d.data=t.data)):(d.message=i(d.code),d.data={originalError:c(e)})}else{d.code=t.code;const r=null===(a=e)||void 0===a?void 0:a.message;d.message=r&&"string"==typeof r?r:t.message,d.data={originalError:c(e)}}const h=null===(u=e)||void 0===u?void 0:u.stack;return n&&e&&h&&"string"==typeof h&&(d.stack=h),d}}(tc)),tc}var ic,oc,ac,cc={};function lc(){return oc||(oc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Xa();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=sc();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=function(){if(ic)return cc;ic=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.ethErrors=void 0;const e=Xa(),t=sc(),r=nc();function n(r,n){const[s,o]=i(n);return new e.EthereumRpcError(r,s||t.getMessageFromCode(r),o)}function s(r,n){const[s,o]=i(n);return new e.EthereumProviderError(r,s||t.getMessageFromCode(r),o)}function i(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;
1if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}return cc.ethErrors={rpc:{parse:e=>n(r.errorCodes.rpc.parse,e),invalidRequest:e=>n(r.errorCodes.rpc.invalidRequest,e),invalidParams:e=>n(r.errorCodes.rpc.invalidParams,e),methodNotFound:e=>n(r.errorCodes.rpc.methodNotFound,e),internal:e=>n(r.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||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 n(t,e)},invalidInput:e=>n(r.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>n(r.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>n(r.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>n(r.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>n(r.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>n(r.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>s(r.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>s(r.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>s(r.errorCodes.provider.unsupportedMethod,e),disconnected:e=>s(r.errorCodes.provider.disconnected,e),chainDisconnected:e=>s(r.errorCodes.provider.chainDisconnected,e),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:r,message:n,data:s}=t;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(r,n,s)}}},cc}();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=nc();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})}(Za)),Za}function uc(){if(ac)return za;ac=1;var e=za&&za.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(za,"__esModule",{value:!0}),za.JsonRpcEngine=void 0;const t=e(Wa()),r=lc();let n=class e extends t.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await e._runAllMiddleware(t,r,this._middleware);return o?(await e._runReturnHandlers(a),s(i)):n(async t=>{try{await e._runReturnHandlers(a)}catch(r){return t(r)}return t()})}catch(i){return s(i)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(r){if(t)return t(r);throw r}}_promiseHandle(e){return new Promise(t=>{this._handle(e,(e,r)=>{t(r)})})}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const n=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(n,{id:void 0,jsonrpc:"2.0",error:n})}if("string"!=typeof e.method){const n=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(n,{id:e.id,jsonrpc:"2.0",error:n})}const n=Object.assign({},e),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=r.serializeError(i))),t(i,s)}async _processRequest(t,r){const[n,s,i]=await e._runAllMiddleware(t,r,this._middleware);if(e._checkForCompletion(t,r,s),await e._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 e._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(e,t,n,i){return new Promise(o=>{const a=e=>{const n=e||t.error;n&&(t.error=r.serializeError(n)),o([n,!0])},c=n=>{t.error?a(t.error):(n&&("function"!=typeof n&&a(new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof n}" for request:\n${s(e)}`,{request:e})),i.push(n)),o([null,!1]))};try{n(e,t,c,a)}catch(l){a(l)}})}static async _runReturnHandlers(e){for(const t of e)await new Promise((e,r)=>{t(t=>t?r(t):e())})}static _checkForCompletion(e,t,n){if(!("result"in t)&&!("error"in t))throw new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${s(e)}`,{request:e});if(!n)throw new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${s(e)}`,{request:e})}};function s(e){return JSON.stringify(e,null,2)}return za.JsonRpcEngine=n,za}var dc,hc,pc={};function fc(){return hc||(hc=1,e=Oa,t=Oa&&Oa.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Oa&&Oa.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)}
1,Object.defineProperty(e,"__esModule",{value:!0}),r(function(){if(Pa)return Ta;Pa=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.createIdRemapMiddleware=void 0;const e=Ba();return Ta.createIdRemapMiddleware=function(){return(t,r,n,s)=>{const i=t.id,o=e.getUniqueId();t.id=o,r.id=o,n(e=>{t.id=i,r.id=i,e()})}},Ta}(),e),r((Fa||(Fa=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.createAsyncMiddleware=void 0,Da.createAsyncMiddleware=function(e){return async(t,r,n,s)=>{let i;const o=new Promise(e=>{i=e});let a=null,c=!1;const l=async()=>{c=!0,n(e=>{a=e,i()}),await o};try{await e(t,r,l),c?(await o,a(null)):s(null)}catch(u){a?a(u):s(u)}}}),Da),e),r(($a||($a=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.createScaffoldMiddleware=void 0,Ua.createScaffoldMiddleware=function(e){return(t,r,n,s)=>{const i=e[t.method];return void 0===i?n():"function"==typeof i?i(t,r,n,s):(r.result=i,s())}}),Ua),e),r(Ba(),e),r(uc(),e),r(function(){if(dc)return pc;dc=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.mergeMiddleware=void 0;const e=uc();return pc.mergeMiddleware=function(t){const r=new e.JsonRpcEngine;return t.forEach(e=>r.push(e)),r.asMiddleware()},pc}(),e)),Oa;var e,t,r}var gc={},mc={};const _c=t(s);var bc,yc,vc={};function wc(){if(bc)return vc;bc=1,Object.defineProperty(vc,"__esModule",{value:!0});var e=_c,t=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,t=this.isLocked(),r=new Promise(function(t){return e._queue.push(t)});return t||this._dispatch(),r},t.prototype.runExclusive=function(t){return e.__awaiter(this,void 0,void 0,function(){var r,n,s;return e.__generator(this,function(e){switch(e.label){case 0:return[4,this.acquire()];case 1:r=e.sent(),n=r[0],s=r[1],e.label=2;case 2:return e.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,e.sent()];case 4:return s(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var r=!1;this._currentReleaser=function(){r||(r=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},t}();return vc.default=t,vc}var Ec,kc,Sc,Cc,Ic,Rc,xc,Ac,Mc,Nc,Lc,Pc,Oc,Tc,jc,Bc,Fc,Dc,$c,Uc,Hc,zc,Vc,Wc,qc,Jc,Gc,Zc,Qc={};function Yc(){return kc||(kc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=function(){if(yc)return mc;yc=1,Object.defineProperty(mc,"__esModule",{value:!0});var e=_c,t=wc(),r=function(){function r(){this._semaphore=new t.default(1)}return r.prototype.acquire=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,e.sent()[1]]}})})},r.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},r.prototype.isLocked=function(){return this._semaphore.isLocked()},r.prototype.release=function(){this._semaphore.release()},r}();return mc.default=r,mc}();Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=wc();Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=function(){if(Ec)return Qc;Ec=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.withTimeout=void 0;var e=_c;return Qc.withTimeout=function(t,r,n){var s=this;return void 0===n&&(n=new Error("timeout")),{acquire:function(){return new Promise(function(i,o){return e.__awaiter(s,void 0,void 0,function(){var s,a;return e.__generator(this,function(e){switch(e.label){case 0:return s=!1,setTimeout(function(){s=!0,o(n)},r),[4,t.acquire()];case 1:return a=e.sent(),s?(Array.isArray(a)?a[1]:a)():i(a),[2]}})})})},runExclusive:function(t){return e.__awaiter(this,void 0,void 0,function(){var r,n;return e.__generator(this,function(e){switch(e.label){case 0:r=function(){},e.label=1;case 1:return e.trys.push([1,,7,8]),[4,this.acquire()];case 2:return n=e.sent(),Array.isArray(n)?(r=n[1],[4,t(n[0])]):[3,4];case 3:return[2,e.sent()];case 4:return r=n,[4,t()];case 5:return[2,e.sent()];case 6:return[3,8];case 7:return r(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}},Qc}();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})}(gc)),gc}function Xc(){if(Rc)return Ic;Rc=1;const e=function(){if(Cc)return Sc;Cc=1,Sc=function(){for(var t={},r=0;r<arguments.length;r++){var n=arguments[r];for(var s in n)e.call(n,s)&&(t[s]=n[s])}return t};var e=Object.prototype.hasOwnProperty;return Sc}(),t=Jn()();function r(e){this.currentProvider=e}function n(e){return function(){var t=[].slice.call(arguments),r=t.pop();this.sendAsync({method:e,params:t},r)}}function s(e,t){return function(){var r=[].slice.call(arguments),n=r.pop();r.length<e&&r.push("latest"),this.sendAsync({method:t,params:r},n)}}return Ic=r,r.prototype.getBalance=s(2,"eth_getBalance"),r.prototype.getCode=s(2,"eth_getCode"),r.prototype.getTransactionCount=s(2,"eth_getTransactionCount"),r.prototype.getStorageAt=s(3,"eth_getStorageAt"),r.prototype.call=s(2,"eth_call"),r.prototype.protocolVersion=n("eth_protocolVersion"),r.prototype.syncing=n("eth_syncing"),r.prototype.coinbase=n("eth_coinbase"),r.prototype.mining=n("eth_mining"),r.prototype.hashrate=n("eth_hashrate"),r.prototype.gasPrice=n("eth_gasPrice"),r.prototype.accounts=n("eth_accounts"),r.prototype.blockNumber=n("eth_blockNumber"),r.prototype.getBlockTransactionCountByHash=n("eth_getBlockTransactionCountByHash"),r.prototype.getBlockTransactionCountByNumber=n("eth_getBlockTransactionCountByNumber"),r.prototype.getUncleCountByBlockHash=n("eth_getUncleCountByBlockHash"),r.prototype.getUncleCountByBlockNumber=n("eth_getUncleCountByBlockNumber"),r.prototype.sign=n("eth_sign"),r.prototype.sendTransaction=n("eth_sendTransaction"),r.prototype.sendRawTransaction=n("eth_sendRawTransaction"),r.prototype.estimateGas=n("eth_estimateGas"),r.prototype.getBlockByHash=n("eth_getBlockByHash"),r.prototype.getBlockByNumber=n("eth_getBlockByNumber"),r.prototype.getTransactionByHash=n("eth_getTransactionByHash"),r.prototype.getTransactionByBlockHashAndIndex=n("eth_getTransactionByBlockHashAndIndex"),r.prototype.getTransactionByBlockNumberAndIndex=n("eth_getTransactionByBlockNumberAndIndex"),r.prototype.getTransactionReceipt=n("eth_getTransactionReceipt"),r.prototype.getUncleByBlockHashAndIndex=n("eth_getUncleByBlockHashAndIndex"),r.prototype.getUncleByBlockNumberAndIndex=n("eth_getUncleByBlockNumberAndIndex"),r.prototype.getCompilers=n("eth_getCompilers"),r.prototype.compileLLL=n("eth_compileLLL"),r.prototype.compileSolidity=n("eth_compileSolidity"),r.prototype.compileSerpent=n("eth_compileSerpent"),r.prototype.newFilter=n("eth_newFilter"),r.prototype.newBlockFilter=n("eth_newBlockFilter"),r.prototype.newPendingTransactionFilter=n("eth_newPendingTransactionFilter"),r.prototype.uninstallFilter=n("eth_uninstallFilter"),r.prototype.getFilterChanges=n("eth_getFilterChanges"),r.prototype.getFilterLogs=n("eth_getFilterLogs"),r.prototype.getLogs=n("eth_getLogs"),r.prototype.getWork=n("eth_getWork"),r.prototype.submitWork=n("eth_submitWork"),r.prototype.submitHashrate=n("eth_submitHashrate"),r.prototype.sendAsync=function(r,n){var s;
1this.currentProvider.sendAsync((s=r,e({id:t(),jsonrpc:"2.0",params:[]},s)),function(e,t){if(!e&&t.error&&(e=new Error("EthQuery - RPC Error - "+t.error.message)),e)return n(e);n(null,t.result)})},Ic}function Kc(){if(Ac)return xc;Ac=1;const e=(e,t,r,n)=>function(...s){return new(0,t.promiseModule)((i,o)=>{t.multiArgs?s.push((...e)=>{t.errorFirst?e[0]?o(e):(e.shift(),i(e)):i(e)}):t.errorFirst?s.push((e,t)=>{e?o(e):i(t)}):s.push(i);const a=this===r?n:this;Reflect.apply(e,a,s)})},t=new WeakMap;return xc=(r,n)=>{n={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...n};const s=typeof r;if(null===r||"object"!==s&&"function"!==s)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===r?"null":s}\``);const i=new WeakMap,o=new Proxy(r,{apply(t,r,s){const a=i.get(t);if(a)return Reflect.apply(a,r,s);const c=n.excludeMain?t:e(t,n,o,t);return i.set(t,c),Reflect.apply(c,r,s)},get(r,s){const a=r[s];if(!((e,r)=>{let s=t.get(e);if(s||(s={},t.set(e,s)),r in s)return s[r];const i=e=>"string"==typeof e||"symbol"==typeof r?r===e:e.test(r),o=Reflect.getOwnPropertyDescriptor(e,r),a=void 0===o||o.writable||o.configurable,c=(n.include?n.include.some(i):!n.exclude.some(i))&&a;return s[r]=c,c})(r,s)||a===Function.prototype[s])return a;const c=i.get(a);if(c)return c;if("function"==typeof a){const t=e(a,n,o,r);return i.set(a,t),t}return a}});return o}}function el(){if(Nc)return Mc;Nc=1;const e=Xn().default;return Mc=class extends e{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(e=>this.emit("update",e))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}}}function tl(){if(Tc)return Oc;function e(e){return e.sort((e,r)=>"latest"===e||"earliest"===r?1:"latest"===r||"earliest"===e?-1:t(e)-t(r))}function t(e){return null==e?e:Number.parseInt(e,16)}function r(e){if(null==e)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function n(){return Math.floor(16*Math.random()).toString(16)}return Tc=1,Oc={minBlockRef:function(...t){return e(t)[0]},maxBlockRef:function(...t){const r=e(t);return r[r.length-1]},sortBlockRefs:e,bnToHex:function(e){return"0x"+e.toString(16)},blockRefIsNumber:function(e){return e&&!["earliest","latest","pending"].includes(e)},hexToInt:t,incrementHexInt:function(e){if(null==e)return e;return r(t(e)+1)},intToHex:r,unsafeRandomBytes:function(e){let t="0x";for(let r=0;r<e;r++)t+=n(),t+=n();return t}}}function rl(){if(Bc)return jc;Bc=1;const e=Xc(),t=Kc(),r=function(){if(Pc)return Lc;Pc=1;const e=el();return Lc=class extends e{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}}}(),{bnToHex:n,hexToInt:s,incrementHexInt:i,minBlockRef:o,blockRefIsNumber:a}=tl();return jc=class extends r{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new e(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(e=>e.toLowerCase()))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;const r=o(this.params.toBlock,e),n=Object.assign({},this.params,{toBlock:r}),s=await this._fetchLogs(n);this.addInitialResults(s)}async update({oldBlock:e,newBlock:t}){const r=t;let n;n=e?i(e):t;const s=Object.assign({},this.params,{fromBlock:n,toBlock:r}),o=(await this._fetchLogs(s)).filter(e=>this.matchLog(e));this.addResults(o)}async _fetchLogs(e){return await t(t=>this.ethQuery.getLogs(e,t))()}matchLog(e){if(s(this.params.fromBlock)>=s(e.blockNumber))return!1;if(a(this.params.toBlock)&&s(this.params.toBlock)<=s(e.blockNumber))return!1;const t=e.address&&e.address.toLowerCase();if(this.params.address&&t&&!this.params.address.includes(t))return!1;return this.params.topics.every((t,r)=>{let n=e.topics[r];if(!n)return!1;n=n.toLowerCase();let s=Array.isArray(t)?t:[t];if(s.includes(null))return!0;s=s.map(e=>e.toLowerCase());return s.includes(n)})}}}function nl(){if(Dc)return Fc;function e(e){return null==e?e:Number.parseInt(e,16)}function t(e){if(null==e)return e;return"0x"+e.toString(16)}function r(e,t){return new Promise((r,n)=>{e.sendAsync(t,(e,t)=>{e?n(e):t.error?n(t.error):t.result?r(t.result):n(new Error("Result was empty"))})})}return Dc=1,Fc=async function({provider:n,fromBlock:s,toBlock:i}){s||(s=i);const o=e(s),a=e(i),c=Array(a-o+1).fill().map((e,t)=>o+t).map(t);let l=await Promise.all(c.map(e=>async function(e,t,n){for(let i=0;i<3;i++)try{return await r(e,{id:1,jsonrpc:"2.0",method:t,params:n})}catch(s){}return null}(n,"eth_getBlockByNumber",[e,!1])));return l=l.filter(e=>null!==e),l}}function sl(){if(Wc)return Vc;Wc=1;const e=Yc().Mutex,{createAsyncMiddleware:t,createScaffoldMiddleware:r}=fc(),n=rl(),s=function(){if(Uc)return $c;Uc=1;const e=el(),t=nl(),{incrementHexInt:r}=tl();return $c=class extends e{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:n}){const s=n,i=r(e),o=(await t({provider:this.provider,fromBlock:i,toBlock:s})).map(e=>e.hash);this.addResults(o)}}}(),i=function(){if(zc)return Hc;zc=1;const e=el(),t=nl(),{incrementHexInt:r}=tl();return Hc=class extends e{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const n=e,s=r(e),i=await t({provider:this.provider,fromBlock:s,toBlock:n}),o=[];for(const t of i)o.push(...t.transactions);this.addResults(o)}}}(),{intToHex:o,hexToInt:a}=tl();function c(e){return l(async(...t)=>{const r=await e(...t);return o(r.id)})}function l(e){return t(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function u(e,t){const r=[];for(let n in e)r.push(e[n]);return r}return Vc=function({blockTracker:t,provider:d}){let h=0,p={};const f=new e,g=function({mutex:e}){return t=>async(r,n,s,i)=>{(await e.acquire())(),t(r,n,s,i)}}({mutex:f}),m=r({eth_newFilter:g(c(b)),eth_newBlockFilter:g(c(y)),eth_newPendingTransactionFilter:g(c(v)),eth_uninstallFilter:g(l(k)),eth_getFilterChanges:g(l(w)),eth_getFilterLogs:g(l(E))}),_=async({oldBlock:e,newBlock:t})=>{if(0===p.length)return;const r=await f.acquire();try{await Promise.all(u(p).map(async r=>{try{await r.update({oldBlock:e,newBlock:t})}catch(n){}}))}catch(n){}r()};return m.newLogFilter=b,m.newBlockFilter=y,m.newPendingTransactionFilter=v,m.uninstallFilter=k,m.getFilterChanges=w,m.getFilterLogs=E,m.destroy=()=>{!async function(){const e=u(p).length;p={},C({prevFilterCount:e,newFilterCount:0})}()},m;async function b(e){const t=new n({provider:d,params:e});return await S(t),t}async function y(){const e=new s({provider:d});return await S(e),e}async function v(){const e=new i({provider:d});return await S(e),e}async function w(e){const t=a(e),r=p[t];if(!r)throw new Error(`No filter for index "${t}"`);return r.getChangesAndClear()}async function E(e){const t=a(e),r=p[t];if(!r)throw new Error(`No filter for index "${t}"`);let n=[];return"log"===r.type&&(n=r.getAllResults()),n}async function k(e){const t=a(e),r=p[t],n=Boolean(r);return n&&await async function(e){const t=u(p).length;delete p[e];const r=u(p).length;C({prevFilterCount:t,newFilterCount:r})}(t),n}async function S(e){const r=u(p).length,n=await t.getLatestBlock();await e.initialize({currentBlock:n}),h++,p[h]=e,e.id=h,e.idHex=o(h);return C({prevFilterCount:r,newFilterCount:u(p).length}),h}function C({prevFilterCount:e,newFilterCount:r}){0===e&&r>0?t.on("sync",_):e>0&&0===r&&t.removeListener("sync",_)}}}function il(){if(Gc)return Vn;Gc=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.SubscriptionManager=void 0;const e=Na(),t=function(){if(Jc)return qc;Jc=1;const e=Xn().default,{createAsyncMiddleware:t,createScaffoldMiddleware:r}=fc(),n=sl(),{unsafeRandomBytes:s,incrementHexInt:i}=tl(),o=nl();function a(e){return null==e?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLim
1it:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}return qc=function({blockTracker:c,provider:l}){const u={},d=n({blockTracker:c,provider:l});let h=!1;const p=new e,f=r({eth_subscribe:t(async function(e,t){if(h)throw new Error("SubscriptionManager - attempting to use after destroying");const r=e.params[0],n=s(16);let p;switch(r){case"newHeads":p=f({subId:n});break;case"logs":const t=e.params[1];p=m({subId:n,filter:await d.newLogFilter(t)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${r}"`)}return u[n]=p,void(t.result=n);function f({subId:e}){const t={type:r,destroy:async()=>{c.removeListener("sync",t.update)},update:async({oldBlock:t,newBlock:r})=>{const n=r,s=i(t);(await o({provider:l,fromBlock:s,toBlock:n})).map(a).filter(e=>null!==e).forEach(t=>{g(e,t)})}};return c.on("sync",t.update),t}function m({subId:e,filter:t}){return t.on("update",t=>g(e,t)),{type:r,destroy:async()=>await d.uninstallFilter(t.idHex)}}}),eth_unsubscribe:t(async function(e,t){if(h)throw new Error("SubscriptionManager - attempting to use after destroying");const r=e.params[0],n=u[r];n?(delete u[r],await n.destroy(),t.result=!0):t.result=!1})});return f.destroy=function(){p.removeAllListeners();for(const e in u)u[e].destroy(),delete u[e];h=!0},{events:p,middleware:f};function g(e,t){p.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}}(),r=()=>{};return Vn.SubscriptionManager=class{constructor(r){const n=new e.PollingBlockTracker({provider:r,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:s,middleware:i}=t({blockTracker:n,provider:r});this.events=s,this.subscriptionMiddleware=i}async handleRequest(e){const t={};return await this.subscriptionMiddleware(e,t,r,r),t}destroy(){this.subscriptionMiddleware.destroy()}},Vn}function ol(){if(Zc)return Q;Zc=1;var t=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.CoinbaseWalletProvider=void 0;const r=t(o()),n=l(),s=$(),i=W(),a=yn(),c=ne(),u=oe(),d=P(),h=t(jn()),p=ee(),f=Dn(),g=il(),m="DefaultChainId",_="DefaultJsonRpcUrl";let b=class extends n.EventEmitter{constructor(e){var t,r;super(),this._filterPolyfill=new f.FilterPolyfill(this),this._subscriptionManager=new g.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this.isCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this.qrUrl=e.qrUrl;const n=this.getChainId(),s=(0,i.prepend0x)(n.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(c.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const e=o.split(" ");""!==e[0]&&(this._addresses=e.map(e=>(0,i.ensureAddressString)(e)),this.emit("accountsChanged",e))}this._subscriptionManager.events.on("notification",e=>{this.emit("message",{type:e.method,data:e.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",e=>{var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type&&"dappChainSwitched"===e.data.data.action){const r=e.data.data.chainId,n=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:this.jsonRpcUrl;this.updateProviderInfo(n,Number(r))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,i.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(_))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(_,e)}
1disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,t){this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,t){this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(m,t.toString(10));!((0,i.ensureIntNumber)(t)!==r)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,n,s,i){const o=await this.initializeRelay(),a=await o.watchAsset(e,t,r,n,s,null==i?void 0:i.toString()).promise;return!(0,d.isErrorResponse)(a)&&!!a.result}async addEthereumChain(e,t,r,n,s,o){var a,c;if((0,i.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),u=l.inlineAddEthereumChain(e.toString());this._isAuthorized()||u||await l.requestEthereumAccounts().promise;const h=await l.addEthereumChain(e.toString(),t,s,r,n,o).promise;return!(0,d.isErrorResponse)(h)&&(!0===(null===(a=h.result)||void 0===a?void 0:a.isApproved)&&this.updateProviderInfo(t[0],e),!0===(null===(c=h.result)||void 0===c?void 0:c.isApproved))}async switchEthereumChain(e){const t=await this.initializeRelay(),r=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,d.isErrorResponse)(r)){if(!r.errorCode)return;throw r.errorCode===s.standardErrorCodes.provider.unsupportedChain?s.standardErrors.provider.unsupportedChain():s.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}const n=r.result;n.isApproved&&n.rpcUrl.length>0&&this.updateProviderInfo(n.rpcUrl,e)}setAppInfo(e,t){this.initializeRelay().then(r=>r.setAppInfo(e,t))}async enable(){var e;return null===(e=this.diagnostic)||void 0===e||e.log(p.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?u.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,t){try{const r=this._send(e,t);if(r instanceof Promise)return r.catch(t=>{throw(0,s.serializeError)(t,e)})}catch(r){throw(0,s.serializeError)(r,e)}}_send(e,t){if("string"==typeof e){const r={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(r).then(e=>e.result)}if("function"==typeof t){const r=e,n=t;return this._sendAsync(r,n)}if(Array.isArray(e)){return e.map(e=>this._sendRequest(e))}const r=e;return this._sendRequest(r)}async sendAsync(e,t){try{return this._sendAsync(e,t).catch(t=>{throw(0,s.serializeError)(t,e)})}catch(r){return Promise.reject((0,s.serializeError)(r,e))}}async _sendAsync(e,t){if("function"!=typeof t)throw new Error("callback is required");if(Array.isArray(e)){const r=t;return void this._sendMultipleRequestsAsync(e).then(e=>r(null,e)).catch(e=>r(e,null))}const r=t;return this._sendRequestAsync(e).then(e=>r(null,e)).catch(e=>r(e,null))}async request(e){try{return this._request(e).catch(t=>{throw(0,s.serializeError)(t,e.method)})}catch(t){return Promise.reject((0,s.serializeError)(t,e.method))}}async _request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw s.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw s.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw s.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const n=void 0===r?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:n,jsonrpc:"2.0",id:i})).result}async scanQRCode(e){const t=await this.initializeRelay(),r=await t.scanQRCode((0,i.ensureRegExpString)(e)).promise;if((0,d.isErrorResponse)(r))throw(0,s.serializeError)(r.errorMessage,"scanQRCode");if("string"!=typeof r.result)throw(0,s.serializeError)("result was not a string","scanQ
1RCode");return r.result}async genericRequest(e,t){const r=await this.initializeRelay(),n=await r.genericRequest(e,t).promise;if((0,d.isErrorResponse)(n))throw(0,s.serializeError)(n.errorMessage,"generic");if("string"!=typeof n.result)throw(0,s.serializeError)("result was not a string","generic");return n.result}async connectAndSignIn(e){var t;let r;null===(t=this.diagnostic)||void 0===t||t.log(p.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?u.Session.hash(this._relay.session.id):void 0});try{const t=await this.initializeRelay();if(!(t instanceof a.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(r=await t.connectAndSignIn(e).promise,(0,d.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(i){if("string"==typeof i.message&&i.message.match(/(denied|rejected)/i))throw s.standardErrors.provider.userRejectedRequest("User denied account authorization");throw i}if(!r.result)throw new Error("accounts received is empty");const{accounts:n}=r.result;return this._setAddresses(n),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),r.result}async selectProvider(e){const t=await this.initializeRelay(),r=await t.selectProvider(e).promise;if((0,d.isErrorResponse)(r))throw(0,s.serializeError)(r.errorMessage,"selectProvider");if("string"!=typeof r.result)throw(0,s.serializeError)("result was not a string","selectProvider");return r.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const t={jsonrpc:"2.0",id:e.id},{method:r}=e;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return t}_setAddresses(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(e=>(0,i.ensureAddressString)(e));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(c.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{const n=this._handleSynchronousMethods(e);if(void 0!==n)return t({jsonrpc:"2.0",id:e.id,result:n});const s=this._handleAsynchronousFilterMethods(e);if(void 0!==s)return void s.then(r=>t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e));const i=this._handleSubscriptionMethods(e);if(void 0!==i)return void i.then(r=>t({jsonrpc:"2.0",id:e.id,result:r.result})).catch(e=>r(e))}catch(n){return r(n)}this._handleAsynchronousMethods(e).then(r=>r&&t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(e=>this._sendRequestAsync(e)))}_handleSynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(r);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).cat
1ch(t=>{var r;throw t.code!==s.standardErrorCodes.rpc.methodNotFound&&t.code!==s.standardErrorCodes.rpc.methodNotSupported||null===(r=this.diagnostic)||void 0===r||r.log(p.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?u.Session.hash(this._relay.session.id):void 0}),t})}_handleAsynchronousFilterMethods(e){const{method:t}=e,r=e.params||[];switch(t){case"eth_newFilter":return this._eth_newFilter(r);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(r);case"eth_getFilterLogs":return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const t=(0,i.ensureAddressString)(e);return this._addresses.map(e=>(0,i.ensureAddressString)(e)).includes(t)}catch(t){}return!1}_ensureKnownAddress(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(p.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const n=t.from?(0,i.ensureAddressString)(t.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);return{fromAddress:n,toAddress:t.to?(0,i.ensureAddressString)(t.to):null,weiValue:null!=t.value?(0,i.ensureBN)(t.value):new r.default(0),data:t.data?(0,i.ensureBuffer)(t.data):e.alloc(0),nonce:null!=t.nonce?(0,i.ensureIntNumber)(t.nonce):null,gasPriceInWei:null!=t.gasPrice?(0,i.ensureBN)(t.gasPrice):null,maxFeePerGas:null!=t.maxFeePerGas?(0,i.ensureBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:null!=t.maxPriorityFeePerGas?(0,i.ensureBN)(t.maxPriorityFeePerGas):null,gasLimit:null!=t.gas?(0,i.ensureBN)(t.gas):null,chainId:t.chainId?(0,i.ensureIntNumber)(t.chainId):this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw s.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw s.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,n){this._ensureKnownAddress(t);try{const s=await this.initializeRelay(),i=await s.signEthereumMessage(e,t,r,n).promise;if((0,d.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(i){if("string"==typeof i.message&&i.message.match(/(denied|rejected)/i))throw s.standardErrors.provider.userRejectedRequest("User denied message signature");throw i}}async _ethereumAddressFromSignedMessage(e,t,r){const n=await this.initializeRelay(),s=await n.ethereumAddressFromSignedMessage(e,t,r).promise;if((0,d.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,i.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(m);if(!e)return(0,i.ensureIntNumber)(this._chainIdFromOpts);const t=parseInt(e,10);return(0,i.ensureIntNumber)(t)}async _eth_requestAccounts(){var e;if(null===(e=this.diagnostic)||void 0===e||e.log(p.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?u.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let t;try{const e=await this.initializeRelay();if(t=await e.requestEthereumAccounts().promise,(0,d.isErrorResponse)(t))throw new Error(t.errorMessage)}catch(r){if("string"==typeof r.message&&r.message.match(/(denied|rejected)/i))throw s.standardErrors.provider.userRejectedRequest("User denied account authorization");throw r}if(!t.result)throw new Error("accounts received is empty");return this._setAddresses(t.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,i.ensureAddressString)(e[0]),r=(0,i.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){const t=(0,i.ensureBuffer)(e[0]),r=(0,i.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,i.ensureBuffer)(e[0]),r=(0,i.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){const t=(0,i.ensureBuffer)(e[0]),r=(0,i.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=await this.initializeRelay(),r=await e.signEthereumTransaction(t).promise;if((0,d.isErrorResponse)(r))throw new Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(r){if("string"==typeof r.message&&r.message.match(/(denied|rejected)/i))throw s.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw r}}async _eth_sendRawTransaction(e){const t=(0,i.ensureBuffer)(e[0]),r=await this.initializeRelay(),n=await r.submitEthereumTransaction(t,this.getChainId()).promise;if((0,d.isErrorResponse)(n))throw new Error(n.errorMessage);return{jsonrpc:"2.0",id:0,result:n.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=await this.initializeRelay(),r=await e.signAndSubmitEthereumTransaction(t).promise;if((0,d.isErrorResponse)(r))throw new Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(r){if("string"==typeof r.message&&r.message.match(/(denied|rejected)/i))throw s.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,i.ensureParsedJSONObject)(e[0]),r=(0,i.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const n=h.default.hashForSignTypedDataLegacy({data:t}),s=JSON.stringify(t,null,2);return this._signEthereumMessage(n,r,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,i.ensureAddressString)(e[0]),r=(0,i.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const n=h.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,i.ensureAddressString)(e[0]),r=(0,i.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const n=h.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,s)}async _cbwallet_arbitrary(e){const t=e[0],r=e[1];if("string"!=typeof r)throw new Error("parameter must be a string");if("object"!=typeof t||null===t)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(t,r)}}async _wallet_addEthereumChain(e){var t,r,n,i;const o=e[0];if(0===(null===(t=o.rpcUrls)||void 0===t?void 0:t.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||""===o.chainName.trim())throw s.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw s.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,null!==(r=o.rpcUrls)&&void 0!==r?r:[],null!==(n=o.blockExplorerUrls)&&void 0!==n?n:[],o.chainName,null!==(i=o.iconUrls)&&void 0!==i?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw s.standardErrors.rpc.invalidParams("Type is required");if("ERC20"!==(null==t?void 0:t.type))throw s.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw s.standardErrors.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw s.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:n,symbol:i,image:o,decimals:a}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,n,i,a,o,r)}}_eth_uninstallFilter(e){const t=(0,i.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}async _eth_newFilter(e){const t=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(t)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const t=(0,i.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}_eth_getFilterLogs(e){const t=(0,i.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((e,t)=>this._setAddresses(e,t)),e.setChainCallback((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}};return Q.CoinbaseWalletProvider=b,Q}var al,cl,ll,ul={};function dl(){if(al)return ul;
1al=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.RelayEventManager=void 0;const e=W();return ul.RelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,e.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}},ul}function hl(){if(cl)return p;cl=1,Object.defineProperty(p,"__esModule",{value:!0}),p.CoinbaseWalletSDK=void 0;const e=g(),t=b(),r=W(),n=G(),s=ol(),i=yn(),o=bn(),a=dl(),c=Yr(),l=Xr(),u=F();let d=class d{constructor(e){var s,h,p;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const f=e.linkAPIUrl||t.LINK_API_URL;void 0===e.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(s=e.overrideIsCoinbaseWallet)||void 0===s||s,this._overrideIsCoinbaseBrowser=null!==(h=e.overrideIsCoinbaseBrowser)&&void 0!==h&&h,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=null===(p=e.reloadOnDisconnect)||void 0===p||p;const g=new URL(f),m=`${g.protocol}//${g.host}`;if(this._storage=new n.ScopedLocalStorage(`-walletlink:${m}`),this._storage.setItem("version",d.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new a.RelayEventManager;const _=(0,r.isMobileWeb)(),b=e.uiConstructor||(e=>_?new o.MobileRelayUI(e):new c.WalletLinkRelayUI(e)),y={linkAPIUrl:f,version:u.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:b,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=_?new i.MobileRelay(y):new l.WalletLinkRelay(y),this.setAppInfo(e.appName,e.appLogoUrl),e.headlessMode||this._relay.attachUI()}makeWeb3Provider(e="",t=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"==typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;const n=this.coinbaseBrowser;if(n)return n;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||i.setConnectDisabled(!0),new s.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:t,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,t){var n;this._appName=e||"DApp",this._appLogoUrl=t||(0,r.getFavicon)();const s=this.walletExtension;s?this.isCipherProvider(s)||s.setAppInfo(this._appName,this._appLogoUrl):null===(n=this._relay)||void 0===n||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const t=null==this?void 0:this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}getQrUrl(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}getCoinbaseWalletLogo(t,r=240){return(0,e.walletLogo)(t,r)}get walletExtension(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}get coinbaseBrowser(){var e,t;try{const r=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!r)return;return"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch(r){return}}isCipherProvider(e){return"boolean"==typeof e.isCipher&&e.isCipher}};return p.CoinbaseWalletSDK=d,d.VERSION=u.LIB_VERSION,p}function pl(){return ll||(ll=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=hl(),r=ol();var n=hl();Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var s=ol();Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return s.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)}(h)),h}const fl=i(pl()),gl=Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"}));
1export{gl as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.