diff --git a/asset-manifest.json b/asset-manifest.json
index 590a77bef..8f4ca7232 100644
--- a/asset-manifest.json
+++ b/asset-manifest.json
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "./static/css/main.f9ea61fb.css",
- "main.js": "./static/js/main.32b0fa15.js",
+ "main.js": "./static/js/main.50539af4.js",
"static/js/514.71647b34.chunk.js": "./static/js/514.71647b34.chunk.js",
"static/js/726.a6fa00bf.chunk.js": "./static/js/726.a6fa00bf.chunk.js",
"static/js/199.7a2f7ff7.chunk.js": "./static/js/199.7a2f7ff7.chunk.js",
@@ -91,6 +91,6 @@
},
"entrypoints": [
"static/css/main.f9ea61fb.css",
- "static/js/main.32b0fa15.js"
+ "static/js/main.50539af4.js"
]
}
\ No newline at end of file
diff --git a/index.html b/index.html
index c3985eb47..463e38246 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
Trisolaris
\ No newline at end of file
+Trisolaris
\ No newline at end of file
diff --git a/static/js/main.32b0fa15.js b/static/js/main.32b0fa15.js
deleted file mode 100644
index e67c558b5..000000000
--- a/static/js/main.32b0fa15.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see main.32b0fa15.js.LICENSE.txt */
-!function(){var e={11395:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;var o=n(10080),a=n(55550),s=n(81689),u=n(34405),c=n(47993),l=n(16642),f=n(81107),d={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.LINK_API_URL||"https://www.walletlink.org",p={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.SDK_VERSION||n(40626).i8||"unknown",h=function(){function e(t){var n,i,o;r(this,e),this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;var s,f=t.linkAPIUrl||d;if(s=t.uiConstructor?t.uiConstructor:function(e){return new u.WalletSDKUI(e)},"undefined"===typeof t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(n=t.overrideIsCoinbaseWallet)||void 0===n||n,this._overrideIsCoinbaseBrowser=null!==(i=t.overrideIsCoinbaseBrowser)&&void 0!==i&&i,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(o=t.reloadOnDisconnect)||void 0===o||o;var h=new URL(f),v="".concat(h.protocol,"//").concat(h.host);this._storage=new a.ScopedLocalStorage("-walletlink:".concat(v)),this._storage.setItem("version",e.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new l.WalletSDKRelayEventManager,this._relay=new c.WalletSDKRelay({linkAPIUrl:f,version:p,darkMode:!!t.darkMode,uiConstructor:s,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}return i(e,[{key:"makeWeb3Provider",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"===typeof n.disableReloadOnDisconnect&&n.disableReloadOnDisconnect(),n;var r=this.coinbaseBrowser;if(r)return r;var 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:function(){return 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})}},{key:"setAppInfo",value:function(e,t){var n;this._appName=e||"DApp",this._appLogoUrl=t||(0,f.getFavicon)();var r=this.walletExtension;r?this.isCipherProvider(r)||r.setAppInfo(this._appName,this._appLogoUrl):null===(n=this._relay)||void 0===n||n.setAppInfo(this._appName,this._appLogoUrl)}},{key:"disconnect",value:function(){var e,t=this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}},{key:"getQrUrl",value:function(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}},{key:"getCoinbaseWalletLogo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:240;return(0,o.walletLogo)(e,t)}},{key:"walletExtension",get:function(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}},{key:"coinbaseBrowser",get:function(){var e,t;try{var n=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!n)return;return"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch(r){return}}},{key:"isCipherProvider",value:function(e){return"boolean"===typeof e.isCipher&&e.isCipher}}]),e}();t.CoinbaseWalletSDK=h,h.VERSION=p},10080:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0;t.walletLogo=function(e,t){var n;switch(e){case"standard":default:return n=t,"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E ");case"circle":return n=t,"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='".concat(t,"' height='").concat(n,"' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E");case"text":return n=(.1*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E");case"textWithLogo":return n=(.25*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E");case"textLight":return n=(.1*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E");case"textWithLogoLight":return n=(.25*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E")}}},98470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-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}"},44296:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseAppSteps=t.CoinbaseWalletSteps=t.ConnectItem=t.ConnectContent=void 0;var o=i(n(83061)),a=n(73856),s=n(98944),u=n(81107),c=n(27865),l=n(24662),f=i(n(24479)),d=i(n(20658)),p=n(96038),h=i(n(11541)),v=i(n(14206)),m=n(17993),g=n(52179),y=n(91807),b=i(n(98470)),w={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:d.default,steps:_},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:f.default,steps:E}},x=function(e){return"light"===e?"#FFFFFF":"#0A0B0D"};function k(e){var t=e.title,n=e.description,r=e.icon,i=e.selected,s=e.theme,u=e.onClick;return(0,a.h)("div",{onClick:u,class:(0,o.default)("-cbwsdk-connect-item",s,{selected:i})},(0,a.h)("div",null,(0,a.h)("img",{src:r,alt:t})),(0,a.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,a.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,a.h)("p",{class:"-cbwsdk-connect-item-description"},n)))}function _(e){var t=e.theme;return(0,a.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,a.h)("span",null,"Tap ",(0,a.h)("strong",null,"Scan")," "),(0,a.h)("span",{class:(0,o.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,a.h)(p.QRCodeIcon,{fill:x(t)})))))}function E(e){var t=e.theme;return(0,a.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,a.h)("span",null,"Tap ",(0,a.h)("strong",null,"More")),(0,a.h)("span",{class:(0,o.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,a.h)(m.StatusDotIcon,{fill:x(t)})),(0,a.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,a.h)("strong",null,"Scan")),(0,a.h)("span",{class:(0,o.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,a.h)(p.QRCodeIcon,{fill:x(t)})))))}t.ConnectContent=function(e){var t=e.theme,n=(0,s.useState)("coinbase-wallet-app"),i=r(n,2),f=i[0],d=i[1],p=(0,s.useCallback)((function(e){d(e)}),[]),m=(0,u.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId);if(!f)return null;var x,_=w[f].steps,E="coinbase-app"===f;return(0,a.h)("div",{"data-testid":"connect-content",class:(0,o.default)("-cbwsdk-connect-content",t)},(0,a.h)("style",null,b.default),(0,a.h)("div",{class:"-cbwsdk-connect-content-header"},(0,a.h)("h2",{class:(0,o.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,a.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,a.h)(l.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,a.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,a.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,a.h)("div",null,Object.entries(w).map((function(e){var n=r(e,2),i=n[0],o=n[1];return(0,a.h)(k,{key:i,title:o.title,description:o.description,icon:o.icon,selected:f===i,onClick:function(){return p(i)},theme:t})}))),E&&(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-content-update-app",t)},"Don\u2019t see a ",(0,a.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,a.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,a.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,a.h)(g.QRCode,{content:m,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(x=f,"coinbase-app"===x?h.default:v.default),width:25,height:25}}),(0,a.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:c.LIB_VERSION}),(0,a.h)("input",{type:"hidden",value:m})),(0,a.h)(_,{theme:t}),!e.isConnected&&(0,a.h)("div",{"data-testid":"connecting-spinner",class:(0,o.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,a.h)(y.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,a.h)("p",null,"Connecting...")))))},t.ConnectItem=k,t.CoinbaseWalletSteps=_,t.CoinbaseAppSteps=E},99763:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"},19236:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectDialog=void 0;var o=i(n(83061)),a=n(73856),s=n(98944),u=n(44296),c=n(69691),l=i(n(99763));t.ConnectDialog=function(e){var t=e.isOpen,n=e.darkMode,i=(0,s.useState)(!t),f=r(i,2),d=f[0],p=f[1],h=(0,s.useState)(!t),v=r(h,2),m=v[0],g=v[1];(0,s.useEffect)((function(){var e=[window.setTimeout((function(){g(!t)}),10)];return t?p(!1):e.push(window.setTimeout((function(){p(!0)}),360)),function(){e.forEach(window.clearTimeout)}}),[e.isOpen]);var y=n?"dark":"light";return(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-dialog-container",d&&"-cbwsdk-connect-dialog-container-hidden")},(0,a.h)("style",null,l.default),(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-dialog-backdrop",y,m&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,a.h)("div",{class:"-cbwsdk-connect-dialog"},(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-dialog-box",m&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,a.h)(u.ConnectContent,{theme:y,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,a.h)(c.TryExtensionContent,{theme:y}))))}},247:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.LinkFlow=void 0;var o=n(73856),a=n(40623),s=n(19236),u=function(){function e(t){r(this,e),this.extensionUI$=new a.BehaviorSubject({}),this.subscriptions=new a.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}return i(e,[{key:"attach",value:function(e){var t=this;this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((function(e){t.isConnected!==e&&(t.isConnected=e,t.render())}))),this.subscriptions.add(this.chainId$.subscribe((function(e){t.chainId!==e&&(t.chainId=e,t.render())})))}},{key:"detach",value:function(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,o.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}},{key:"setConnectDisabled",value:function(e){this.connectDisabled=e}},{key:"open",value:function(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}},{key:"close",value:function(){this.isOpen=!1,this.onCancel=null,this.render()}},{key:"render",value:function(){var e=this;if(this.root){var t=this.extensionUI$.subscribe((function(){e.root&&(0,o.render)((0,o.h)(s.ConnectDialog,{darkMode:e.darkMode,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isOpen:e.isOpen,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel,connectDisabled:e.connectDisabled}),e.root)}));this.subscriptions.add(t)}}}]),e}();t.LinkFlow=u},52179:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.QRCode=void 0;var o=n(73856),a=n(98944),s=i(n(16134));t.QRCode=function(e){var t=(0,a.useState)(""),n=r(t,2),i=n[0],u=n[1];return(0,a.useEffect)((function(){var t,n,r=new s.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(t=e.width)&&void 0!==t?t:256,height:null!==(n=e.height)&&void 0!==n?n:256,padding:0,image:e.image}),i=Buffer.from(r.svg(),"utf8").toString("base64");u("data:image/svg+xml;base64,".concat(i))})),i?(0,o.h)("img",{src:i,alt:"QR Code"}):null}},16627:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"},64620:function(e,t,n){"use strict";var r=n(27424).default,i=n(56690).default,o=n(89728).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;var s=a(n(83061)),u=n(73856),c=n(98944),l=a(n(16627));function f(e){return"coinbase-app"===e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}var d=function(){function e(t){i(this,e),this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}return o(e,[{key:"attach",value:function(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}},{key:"presentItem",value:function(e){var t=this,n=this.nextItemKey++;return this.items.set(n,e),this.render(),function(){t.items.delete(n),t.render()}}},{key:"clear",value:function(){this.items.clear(),this.render()}},{key:"render",value:function(){this.root&&(0,u.render)((0,u.h)("div",null,(0,u.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((function(e){var n=r(e,2),i=n[0],o=n[1];return(0,u.h)(t.SnackbarInstance,Object.assign({},o,{key:i}))})))),this.root)}}]),e}();t.Snackbar=d;t.SnackbarContainer=function(e){return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-container")},(0,u.h)("style",null,l.default),(0,u.h)("div",{class:"-cbwsdk-snackbar"},e.children))};t.SnackbarInstance=function(e){var t=e.autoExpand,n=e.message,i=e.menuItems,o=e.appSrc,a=(0,c.useState)(!0),l=r(a,2),d=l[0],p=l[1],h=(0,c.useState)(null!==t&&void 0!==t&&t),v=r(h,2),m=v[0],g=v[1];(0,c.useEffect)((function(){var e=[window.setTimeout((function(){p(!1)}),1),window.setTimeout((function(){g(!0)}),1e4)];return function(){e.forEach(window.clearTimeout)}}));return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-instance",d&&"-cbwsdk-snackbar-instance-hidden",m&&"-cbwsdk-snackbar-instance-expanded")},(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:function(){g(!m)}},(0,u.h)("img",{src:f(o),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},n),(0,u.h)("div",{class:"-gear-container"},!m&&(0,u.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,u.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,u.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((function(e,t){return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,u.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,u.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,u.h)("span",{class:(0,s.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))}))))}},57470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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)}}"},91807:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;var i=n(73856),o=r(n(57470));t.Spinner=function(e){var t,n=null!==(t=e.size)&&void 0!==t?t:64,r=e.color||"#000";return(0,i.h)("div",{class:"-cbwsdk-spinner"},(0,i.h)("style",null,o.default),(0,i.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,i.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))}},64980:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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}"},69691:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TryExtensionContent=void 0;var o=i(n(83061)),a=n(73856),s=n(98944),u=n(31834),c=n(76642),l=n(83404),f=i(n(64980));t.TryExtensionContent=function(e){var t=e.theme,n=(0,s.useState)(!1),i=r(n,2),d=i[0],p=i[1],h=(0,s.useCallback)((function(){window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),v=(0,s.useCallback)((function(){d?window.location.reload():(h(),p(!0))}),[h,d]);return(0,a.h)("div",{class:(0,o.default)("-cbwsdk-try-extension",t)},(0,a.h)("style",null,f.default),(0,a.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,a.h)("h3",{class:(0,o.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,a.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,a.h)("button",{class:(0,o.default)("-cbwsdk-try-extension-cta",t),onClick:v},d?"Refresh":"Install"),(0,a.h)("div",null,!d&&(0,a.h)(u.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,a.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,a.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,a.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,a.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,a.h)("span",{class:(0,o.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,a.h)(c.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,a.h)("div",{class:(0,o.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,a.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,a.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,a.h)("span",{class:(0,o.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,a.h)(l.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,a.h)("div",{class:(0,o.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}},31834:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowLeftIcon=void 0;var r=n(73856);t.ArrowLeftIcon=function(e){return(0,r.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.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"}))}},24662:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloseIcon=void 0;var r=n(73856);t.CloseIcon=function(e){return(0,r.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.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"}))}},76642:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaptopIcon=void 0;var r=n(73856);t.LaptopIcon=function(e){return(0,r.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,r.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"}))}},96038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QRCodeIcon=void 0;var r=n(73856);t.QRCodeIcon=function(e){return(0,r.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,r.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,r.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,r.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,r.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,r.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,r.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,r.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,r.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}},11541:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default='\n \n'},14206:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='\n \n'},83404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeIcon=void 0;var r=n(73856);t.SafeIcon=function(e){return(0,r.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.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"}))}},17993:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusDotIcon=void 0;var r=n(73856);t.StatusDotIcon=function(e){return(0,r.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}},24479:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="},20658:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg=="},70732:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientMessagePublishEvent=t.ClientMessageSetSessionConfig=t.ClientMessageGetSessionConfig=t.ClientMessageIsLinked=t.ClientMessageHostSession=void 0,t.ClientMessageHostSession=function(e){return Object.assign({type:"HostSession"},e)},t.ClientMessageIsLinked=function(e){return Object.assign({type:"IsLinked"},e)},t.ClientMessageGetSessionConfig=function(e){return Object.assign({type:"GetSessionConfig"},e)},t.ClientMessageSetSessionConfig=function(e){return Object.assign({type:"SetSessionConfig"},e)},t.ClientMessagePublishEvent=function(e){return Object.assign({type:"PublishEvent"},e)}},56171:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EVENTS=void 0,t.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",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}},10680:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;var o,a=n(40623),s=n(21807);!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(o=t.ConnectionState||(t.ConnectionState={}));var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;r(this,e),this.WebSocketClass=n,this.webSocket=null,this.connectionStateSubject=new a.BehaviorSubject(o.DISCONNECTED),this.incomingDataSubject=new a.Subject,this.url=t.replace(/^http/,"ws")}return i(e,[{key:"connect",value:function(){var e=this;return this.webSocket?(0,a.throwError)(new Error("webSocket object is not null")):new a.Observable((function(t){var n;try{e.webSocket=n=new e.WebSocketClass(e.url)}catch(r){return void t.error(r)}e.connectionStateSubject.next(o.CONNECTING),n.onclose=function(n){e.clearWebSocket(),t.error(new Error("websocket error ".concat(n.code,": ").concat(n.reason))),e.connectionStateSubject.next(o.DISCONNECTED)},n.onopen=function(n){t.next(),t.complete(),e.connectionStateSubject.next(o.CONNECTED)},n.onmessage=function(t){e.incomingDataSubject.next(t.data)}})).pipe((0,s.take)(1))}},{key:"disconnect",value:function(){var e=this.webSocket;if(e){this.clearWebSocket(),this.connectionStateSubject.next(o.DISCONNECTED);try{e.close()}catch(t){}}}},{key:"connectionState$",get:function(){return this.connectionStateSubject.asObservable()}},{key:"incomingData$",get:function(){return this.incomingDataSubject.asObservable()}},{key:"incomingJSONData$",get:function(){return this.incomingData$.pipe((0,s.flatMap)((function(e){var t;try{t=JSON.parse(e)}catch(n){return(0,a.empty)()}return(0,a.of)(t)})))}},{key:"sendData",value:function(e){var t=this.webSocket;if(!t)throw new Error("websocket is not connected");t.send(e)}},{key:"clearWebSocket",value:function(){var e=this.webSocket;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}]),e}();t.RxWebSocket=u},82747:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isServerMessageFail=void 0,t.isServerMessageFail=function(e){return e&&"Fail"===e.type&&"number"===typeof e.id&&"string"===typeof e.sessionId&&"string"===typeof e.error}},62569:function(e,t,n){"use strict";var r=n(38416).default,i=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKConnection=void 0;var a=n(40623),s=n(21807),u=n(35836),c=n(99306),l=n(70732),f=n(56171),d=n(10680),p=n(82747),h=function(){function e(t,n,r,o){var l=this,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:WebSocket;i(this,e),this.sessionId=t,this.sessionKey=n,this.diagnostic=o,this.subscriptions=new a.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,c.IntNumber)(1),this.connectedSubject=new a.BehaviorSubject(!1),this.linkedSubject=new a.BehaviorSubject(!1),this.sessionConfigSubject=new a.ReplaySubject(1);var h=new d.RxWebSocket(r+"/rpc",p);this.ws=h,this.subscriptions.add(h.connectionState$.pipe((0,s.tap)((function(e){var n;return null===(n=l.diagnostic)||void 0===n?void 0:n.log(f.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:u.Session.hash(t)})})),(0,s.skip)(1),(0,s.filter)((function(e){return e===d.ConnectionState.DISCONNECTED&&!l.destroyed})),(0,s.delay)(5e3),(0,s.filter)((function(e){return!l.destroyed})),(0,s.flatMap)((function(e){return h.connect()})),(0,s.retry)()).subscribe()),this.subscriptions.add(h.connectionState$.pipe((0,s.skip)(2),(0,s.switchMap)((function(e){return(0,a.iif)((function(){return e===d.ConnectionState.CONNECTED}),l.authenticate().pipe((0,s.tap)((function(e){return l.sendIsLinked()})),(0,s.tap)((function(e){return l.sendGetSessionConfig()})),(0,s.map)((function(e){return!0}))),(0,a.of)(!1))})),(0,s.distinctUntilChanged)(),(0,s.catchError)((function(e){return(0,a.of)(!1)}))).subscribe((function(e){return l.connectedSubject.next(e)}))),this.subscriptions.add(h.connectionState$.pipe((0,s.skip)(1),(0,s.switchMap)((function(e){return(0,a.iif)((function(){return e===d.ConnectionState.CONNECTED}),(0,a.timer)(0,1e4))}))).subscribe((function(e){return 0===e?l.updateLastHeartbeat():l.heartbeat()}))),this.subscriptions.add(h.incomingData$.pipe((0,s.filter)((function(e){return"h"===e}))).subscribe((function(e){return l.updateLastHeartbeat()}))),this.subscriptions.add(h.incomingJSONData$.pipe((0,s.filter)((function(e){return["IsLinkedOK","Linked"].includes(e.type)}))).subscribe((function(e){var n,r=e;null===(n=l.diagnostic)||void 0===n||n.log(f.EVENTS.LINKED,{sessionIdHash:u.Session.hash(t),linked:r.linked,type:e.type,onlineGuests:r.onlineGuests}),l.linkedSubject.next(r.linked||r.onlineGuests>0)}))),this.subscriptions.add(h.incomingJSONData$.pipe((0,s.filter)((function(e){return["GetSessionConfigOK","SessionConfigUpdated"].includes(e.type)}))).subscribe((function(e){var n,r=e;null===(n=l.diagnostic)||void 0===n||n.log(f.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:u.Session.hash(t),metadata_keys:r&&r.metadata?Object.keys(r.metadata):void 0}),l.sessionConfigSubject.next({webhookId:r.webhookId,webhookUrl:r.webhookUrl,metadata:r.metadata})})))}return o(e,[{key:"connect",value:function(){var e;if(this.destroyed)throw new Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.STARTED_CONNECTING,{sessionIdHash:u.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}},{key:"destroy",value:function(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.DISCONNECTED,{sessionIdHash:u.Session.hash(this.sessionId)}),this.destroyed=!0}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"connected$",get:function(){return this.connectedSubject.asObservable()}},{key:"onceConnected$",get:function(){return this.connected$.pipe((0,s.filter)((function(e){return e})),(0,s.take)(1),(0,s.map)((function(){})))}},{key:"linked$",get:function(){return this.linkedSubject.asObservable()}},{key:"onceLinked$",get:function(){return this.linked$.pipe((0,s.filter)((function(e){return e})),(0,s.take)(1),(0,s.map)((function(){})))}},{key:"sessionConfig$",get:function(){return this.sessionConfigSubject.asObservable()}},{key:"incomingEvent$",get:function(){return this.ws.incomingJSONData$.pipe((0,s.filter)((function(e){if("Event"!==e.type)return!1;var t=e;return"string"===typeof t.sessionId&&"string"===typeof t.eventId&&"string"===typeof t.event&&"string"===typeof t.data})),(0,s.map)((function(e){return e})))}},{key:"setSessionMetadata",value:function(e,t){var n=this,i=(0,l.ClientMessageSetSessionConfig)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:r({},e,t)});return this.onceConnected$.pipe((0,s.flatMap)((function(e){return n.makeRequest(i)})),(0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to set session metadata")})))}},{key:"publishEvent",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(0,l.ClientMessagePublishEvent)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:t,callWebhook:r});return this.onceLinked$.pipe((0,s.flatMap)((function(e){return n.makeRequest(i)})),(0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to publish event");return e.eventId})))}},{key:"sendData",value:function(e){this.ws.sendData(JSON.stringify(e))}},{key:"updateLastHeartbeat",value:function(){this.lastHeartbeatResponse=Date.now()}},{key:"heartbeat",value:function(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}},{key:"makeRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,n=e.id;try{this.sendData(e)}catch(r){return(0,a.throwError)(r)}return this.ws.incomingJSONData$.pipe((0,s.timeoutWith)(t,(0,a.throwError)(new Error("request ".concat(n," timed out")))),(0,s.filter)((function(e){return e.id===n})),(0,s.take)(1))}},{key:"authenticate",value:function(){var e=(0,l.ClientMessageHostSession)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to authentcate")})))}},{key:"sendIsLinked",value:function(){var e=(0,l.ClientMessageIsLinked)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}},{key:"sendGetSessionConfig",value:function(){var e=(0,l.ClientMessageGetSessionConfig)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}]),e}();t.WalletSDKConnection=h},27312:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;var r=n(98689),i=n(87734),o=n(27865);t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},r.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},r.errorCodes.provider),{unsupportedChain:4902}))})),t.standardErrorMessage=function(e){return void 0!==e?(0,r.getMessageFromCode)(e):"Unknown error"},t.standardErrors=Object.freeze(Object.assign(Object.assign({},r.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},r.ethErrors.provider),{unsupportedChain:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:"Unrecognized chain ID ".concat(e,". Try adding the chain using wallet_addEthereumChain first.")})}}))})),t.serializeError=function(e,n){var a=(0,r.serializeError)(function(e){return"string"===typeof e?{message:e,code:t.standardErrorCodes.rpc.internal}:(0,i.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method,result:e.result}}):e}(e),{shouldIncludeStack:!0}),s=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");s.searchParams.set("version",o.LIB_VERSION),s.searchParams.set("code",a.code.toString());var u=function(e,t){var n,r=null===(n=e)||void 0===n?void 0:n.method;if(r)return r;return void 0===t?void 0:"string"===typeof t?t:Array.isArray(t)?t.length>0?t[0].method:void 0:t.method}(a.data,n);return u&&s.searchParams.set("method",u),s.searchParams.set("message",a.message),Object.assign(Object.assign({},a),{docUrl:s.href})},t.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}},52836:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;var r=n(11395),i=n(81689),o=n(11395);Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return o.CoinbaseWalletSDK}});var a=n(81689);Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return a.CoinbaseWalletProvider}}),t.default=r.CoinbaseWalletSDK,"undefined"!==typeof window&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=i.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=i.CoinbaseWalletProvider)},55550:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;var o=function(){function e(t){r(this,e),this.scope=t}return i(e,[{key:"setItem",value:function(e,t){localStorage.setItem(this.scopedKey(e),t)}},{key:"getItem",value:function(e){return localStorage.getItem(this.scopedKey(e))}},{key:"removeItem",value:function(e){localStorage.removeItem(this.scopedKey(e))}},{key:"clear",value:function(){for(var e=this.scopedKey(""),t=[],n=0;n0&&r.initializeRelay(),window.addEventListener("message",(function(e){var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type){if("defaultChainChanged"===e.data.data.action||"dappChainSwitched"===e.data.data.action){var n=e.data.data.chainId,i=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:r.jsonRpcUrl;r.updateProviderInfo(i,Number(n))}"addressChanged"===e.data.data.action&&r._setAddresses([e.data.data.address])}})),r}return s(n,[{key:"selectedAddress",get:function(){return this._addresses[0]||void 0}},{key:"networkVersion",get:function(){return this.getChainId().toString(10)}},{key:"chainId",get:function(){return(0,w.prepend0x)(this.getChainId().toString(16))}},{key:"isWalletLink",get:function(){return!0}},{key:"isMetaMask",get:function(){return this._overrideIsMetaMask}},{key:"host",get:function(){return this.jsonRpcUrl}},{key:"connected",get:function(){return!0}},{key:"isConnected",value:function(){return!0}},{key:"jsonRpcUrl",get:function(){var e;return null!==(e=this._storage.getItem(S))&&void 0!==e?e:this._jsonRpcUrlFromOpts},set:function(e){this._storage.setItem(S,e)}},{key:"disableReloadOnDisconnect",value:function(){this.reloadOnDisconnect=!1}},{key:"setProviderInfo",value:function(e,t){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}},{key:"updateProviderInfo",value:function(e,t){this.jsonRpcUrl=e;var n=this.getChainId();this._storage.setItem(A,t.toString(10)),!((0,w.ensureIntNumber)(t)!==n)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}},{key:"watchAsset",value:function(){var e=o(i().mark((function e(t,n,r,o,a,s){var u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return u=e.sent,e.next=5,u.watchAsset(t,n,r,o,a,null===s||void 0===s?void 0:s.toString()).promise;case 5:return c=e.sent,e.abrupt("return",!!c.result);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}()},{key:"addEthereumChain",value:function(){var e=o(i().mark((function e(t,n,r,o,a,s){var u,c,l,f,d;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,w.ensureIntNumber)(t)!==this.getChainId()){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.initializeRelay();case 4:if(l=e.sent,f=l.inlineAddEthereumChain(t.toString()),this._isAuthorized()||f){e.next=9;break}return e.next=9,l.requestEthereumAccounts().promise;case 9:return e.next=11,l.addEthereumChain(t.toString(),n,a,r,o,s).promise;case 11:return d=e.sent,!0===(null===(u=d.result)||void 0===u?void 0:u.isApproved)&&this.updateProviderInfo(n[0],t),e.abrupt("return",!0===(null===(c=d.result)||void 0===c?void 0:c.isApproved));case 14:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}()},{key:"switchEthereumChain",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return n=e.sent,e.next=5,n.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;case 5:if(r=e.sent,!(0,b.isErrorResponse)(r)||!r.errorCode){e.next=12;break}if(r.errorCode!==v.standardErrorCodes.provider.unsupportedChain){e.next=11;break}throw v.standardErrors.provider.unsupportedChain(t);case 11:throw v.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode});case 12:(o=r.result).isApproved&&o.rpcUrl.length>0&&this.updateProviderInfo(o.rpcUrl,t);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setAppInfo",value:function(e,t){this.initializeRelay().then((function(n){return n.setAppInfo(e,t)}))}},{key:"enable",value:function(){var e=o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?m.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",r(this._addresses));case 3:return e.next=5,this.send(_.JSONRPCMethod.eth_requestAccounts);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:e.sent.resetAndReload();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(e,t){try{var n=this._send(e,t);if(n instanceof Promise)return n.catch((function(t){throw(0,v.serializeError)(t,e)}))}catch(r){throw(0,v.serializeError)(r,e)}}},{key:"_send",value:function(e,t){var n=this;if("string"===typeof e){var r={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(r).then((function(e){return e.result}))}if("function"===typeof t){var i=e,o=t;return this._sendAsync(i,o)}if(Array.isArray(e))return e.map((function(e){return n._sendRequest(e)}));var a=e;return this._sendRequest(a)}},{key:"sendAsync",value:function(){var e=o(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._sendAsync(t,n).catch((function(e){throw(0,v.serializeError)(e,t)})));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",Promise.reject((0,v.serializeError)(e.t0,t)));case 7:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_sendAsync",value:function(){var e=o(i().mark((function e(t,n){var r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"===typeof n){e.next=2;break}throw new Error("callback is required");case 2:if(!Array.isArray(t)){e.next=6;break}return r=n,this._sendMultipleRequestsAsync(t).then((function(e){return r(null,e)})).catch((function(e){return r(e,null)})),e.abrupt("return");case 6:return o=n,e.abrupt("return",this._sendRequestAsync(t).then((function(e){return o(null,e)})).catch((function(e){return o(e,null)})));case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"request",value:function(){var e=o(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._request(t).catch((function(e){throw(0,v.serializeError)(e,t.method)})));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",Promise.reject((0,v.serializeError)(e.t0,t.method)));case 7:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_request",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"object"===typeof t&&!Array.isArray(t)){e.next=2;break}throw v.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});case 2:if(n=t.method,r=t.params,"string"===typeof n&&0!==n.length){e.next=5;break}throw v.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});case 5:if(void 0===r||Array.isArray(r)||"object"===typeof r&&null!==r){e.next=7;break}throw v.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});case 7:return o=void 0===r?[]:r,a=this._relayEventManager.makeRequestId(),e.next=11,this._sendRequestAsync({method:n,params:o,jsonrpc:"2.0",id:a});case 11:return s=e.sent,e.abrupt("return",s.result);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"scanQRCode",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return r=e.sent,e.next=5,r.scanQRCode((0,w.ensureRegExpString)(t)).promise;case 5:if("string"===typeof(o=e.sent).result){e.next=8;break}throw(0,v.serializeError)(null!==(n=o.errorMessage)&&void 0!==n?n:"result was not a string",y.Web3Method.scanQRCode);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"genericRequest",value:function(){var e=o(i().mark((function e(t,n){var r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return o=e.sent,e.next=5,o.genericRequest(t,n).promise;case 5:if("string"===typeof(a=e.sent).result){e.next=8;break}throw(0,v.serializeError)(null!==(r=a.errorMessage)&&void 0!==r?r:"result was not a string",y.Web3Method.generic);case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"selectProvider",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return r=e.sent,e.next=5,r.selectProvider(t).promise;case 5:if("string"===typeof(o=e.sent).result){e.next=8;break}throw(0,v.serializeError)(null!==(n=o.errorMessage)&&void 0!==n?n:"result was not a string",y.Web3Method.selectProvider);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"supportsSubscriptions",value:function(){return!1}},{key:"subscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"unsubscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"disconnect",value:function(){return!0}},{key:"_sendRequest",value:function(e){var t={jsonrpc:"2.0",id:e.id},n=e.method;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error("Coinbase Wallet does not support calling ".concat(n," synchronously without ")+"a callback. Please provide a callback parameter to call ".concat(n," ")+"asynchronously.");return t}},{key:"_setAddresses",value:function(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");var n=e.map((function(e){return(0,w.ensureAddressString)(e)}));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!t||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(g.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}},{key:"_sendRequestAsync",value:function(e){var t=this;return new Promise((function(n,r){try{var i=t._handleSynchronousMethods(e);if(void 0!==i)return n({jsonrpc:"2.0",id:e.id,result:i});var o=t._handleAsynchronousFilterMethods(e);if(void 0!==o)return void o.then((function(t){return n(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return r(e)}));var a=t._handleSubscriptionMethods(e);if(void 0!==a)return void a.then((function(t){return n({jsonrpc:"2.0",id:e.id,result:t.result})})).catch((function(e){return r(e)}))}catch(s){return r(s)}t._handleAsynchronousMethods(e).then((function(t){return t&&n(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return r(e)}))}))}},{key:"_sendMultipleRequestsAsync",value:function(e){var t=this;return Promise.all(e.map((function(e){return t._sendRequestAsync(e)})))}},{key:"_handleSynchronousMethods",value:function(e){var t=e.method,n=e.params||[];switch(t){case _.JSONRPCMethod.eth_accounts:return this._eth_accounts();case _.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case _.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case _.JSONRPCMethod.net_version:return this._net_version();case _.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}},{key:"_handleAsynchronousMethods",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.method,r=t.params||[],e.t0=n,e.next=e.t0===_.JSONRPCMethod.eth_requestAccounts?5:e.t0===_.JSONRPCMethod.eth_sign?6:e.t0===_.JSONRPCMethod.eth_ecRecover?7:e.t0===_.JSONRPCMethod.personal_sign?8:e.t0===_.JSONRPCMethod.personal_ecRecover?9:e.t0===_.JSONRPCMethod.eth_signTransaction?10:e.t0===_.JSONRPCMethod.eth_sendRawTransaction?11:e.t0===_.JSONRPCMethod.eth_sendTransaction?12:e.t0===_.JSONRPCMethod.eth_signTypedData_v1?13:e.t0===_.JSONRPCMethod.eth_signTypedData_v2?14:e.t0===_.JSONRPCMethod.eth_signTypedData_v3?15:e.t0===_.JSONRPCMethod.eth_signTypedData_v4||e.t0===_.JSONRPCMethod.eth_signTypedData?16:e.t0===_.JSONRPCMethod.cbWallet_arbitrary?17:e.t0===_.JSONRPCMethod.wallet_addEthereumChain?18:e.t0===_.JSONRPCMethod.wallet_switchEthereumChain?19:e.t0===_.JSONRPCMethod.wallet_watchAsset?20:21;break;case 5:return e.abrupt("return",this._eth_requestAccounts());case 6:return e.abrupt("return",this._eth_sign(r));case 7:return e.abrupt("return",this._eth_ecRecover(r));case 8:return e.abrupt("return",this._personal_sign(r));case 9:return e.abrupt("return",this._personal_ecRecover(r));case 10:return e.abrupt("return",this._eth_signTransaction(r));case 11:return e.abrupt("return",this._eth_sendRawTransaction(r));case 12:return e.abrupt("return",this._eth_sendTransaction(r));case 13:return e.abrupt("return",this._eth_signTypedData_v1(r));case 14:return e.abrupt("return",this._throwUnsupportedMethodError());case 15:return e.abrupt("return",this._eth_signTypedData_v3(r));case 16:return e.abrupt("return",this._eth_signTypedData_v4(r));case 17:return e.abrupt("return",this._cbwallet_arbitrary(r));case 18:return e.abrupt("return",this._wallet_addEthereumChain(r));case 19:return e.abrupt("return",this._wallet_switchEthereumChain(r));case 20:return e.abrupt("return",this._wallet_watchAsset(r));case 21:return e.next=23,this.initializeRelay();case 23:return o=e.sent,e.abrupt("return",o.makeEthereumJSONRPCRequest(t,this.jsonRpcUrl));case 25:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_handleAsynchronousFilterMethods",value:function(e){var t=e.method,n=e.params||[];switch(t){case _.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case _.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case _.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case _.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case _.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}},{key:"_handleSubscriptionMethods",value:function(e){switch(e.method){case _.JSONRPCMethod.eth_subscribe:case _.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}},{key:"_isKnownAddress",value:function(e){try{var t=(0,w.ensureAddressString)(e);return this._addresses.map((function(e){return(0,w.ensureAddressString)(e)})).includes(t)}catch(n){}return!1}},{key:"_ensureKnownAddress",value:function(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}},{key:"_prepareTransactionParams",value:function(e){var t=e.from?(0,w.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");return this._ensureKnownAddress(t),{fromAddress:t,toAddress:e.to?(0,w.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,w.ensureBN)(e.value):new p.default(0),data:e.data?(0,w.ensureBuffer)(e.data):Buffer.alloc(0),nonce:null!=e.nonce?(0,w.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,w.ensureBN)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,w.ensureBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,w.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,w.ensureBN)(e.gas):null,chainId:this.getChainId()}}},{key:"_isAuthorized",value:function(){return this._addresses.length>0}},{key:"_requireAuthorization",value:function(){if(!this._isAuthorized())throw v.standardErrors.provider.unauthorized({})}},{key:"_throwUnsupportedMethodError",value:function(){throw v.standardErrors.provider.unsupportedMethod({})}},{key:"_signEthereumMessage",value:function(){var e=o(i().mark((function e(t,n,r,o){var a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._ensureKnownAddress(n),e.prev=1,e.next=4,this.initializeRelay();case 4:return a=e.sent,e.next=7,a.signEthereumMessage(t,n,r,o).promise;case 7:return s=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:s.result});case 11:if(e.prev=11,e.t0=e.catch(1),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=15;break}throw v.standardErrors.provider.userRejectedRequest("User denied message signature");case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,this,[[1,11]])})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"_ethereumAddressFromSignedMessage",value:function(){var e=o(i().mark((function e(t,n,r){var o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return o=e.sent,e.next=5,o.ethereumAddressFromSignedMessage(t,n,r).promise;case 5:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.result});case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_eth_accounts",value:function(){return r(this._addresses)}},{key:"_eth_coinbase",value:function(){return this.selectedAddress||null}},{key:"_net_version",value:function(){return this.getChainId().toString(10)}},{key:"_eth_chainId",value:function(){return(0,w.hexStringFromIntNumber)(this.getChainId())}},{key:"getChainId",value:function(){var e=this._storage.getItem(A);if(!e)return(0,w.ensureIntNumber)(this._chainIdFromOpts);var t=parseInt(e,10);return(0,w.ensureIntNumber)(t)}},{key:"_eth_requestAccounts",value:function(){var e=o(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?m.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses}));case 3:return e.prev=3,e.next=6,this.initializeRelay();case 6:return r=e.sent,e.next=9,r.requestEthereumAccounts().promise;case 9:n=e.sent,e.next=17;break;case 12:if(e.prev=12,e.t0=e.catch(3),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw v.standardErrors.provider.userRejectedRequest("User denied account authorization");case 16:throw e.t0;case 17:if(n.result){e.next=19;break}throw new Error("accounts received is empty");case 19:if(this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser){e.next=23;break}return e.next=23,this.switchEthereumChain(this.getChainId());case 23:return e.abrupt("return",{jsonrpc:"2.0",id:0,result:this._addresses});case 24:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_sign",value:function(e){this._requireAuthorization();var t=(0,w.ensureAddressString)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}},{key:"_eth_ecRecover",value:function(e){var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}},{key:"_personal_sign",value:function(e){this._requireAuthorization();var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}},{key:"_personal_ecRecover",value:function(e){var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}},{key:"_eth_signTransaction",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return r=e.sent,e.next=8,r.signEthereumTransaction(n).promise;case 8:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 12:if(e.prev=12,e.t0=e.catch(2),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw v.standardErrors.provider.userRejectedRequest("User denied transaction signature");case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_sendRawTransaction",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,w.ensureBuffer)(t[0]),e.next=3,this.initializeRelay();case 3:return r=e.sent,e.next=6,r.submitEthereumTransaction(n,this.getChainId()).promise;case 6:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_sendTransaction",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return r=e.sent,e.next=8,r.signAndSubmitEthereumTransaction(n).promise;case 8:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 12:if(e.prev=12,e.t0=e.catch(2),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw v.standardErrors.provider.userRejectedRequest("User denied transaction signature");case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v1",value:function(){var e=o(i().mark((function e(t){var n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureParsedJSONObject)(t[0]),r=(0,w.ensureAddressString)(t[1]),this._ensureKnownAddress(r),o=x.default.hashForSignTypedDataLegacy({data:n}),a=JSON.stringify(n,null,2),e.abrupt("return",this._signEthereumMessage(o,r,!1,a));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v3",value:function(){var e=o(i().mark((function e(t){var n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureAddressString)(t[0]),r=(0,w.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(n),o=x.default.hashForSignTypedData_v3({data:r}),a=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(o,n,!1,a));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v4",value:function(){var e=o(i().mark((function e(t){var n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureAddressString)(t[0]),r=(0,w.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(n),o=x.default.hashForSignTypedData_v4({data:r}),a=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(o,n,!1,a));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_cbwallet_arbitrary",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t[0],"string"===typeof(r=t[1])){e.next=4;break}throw new Error("parameter must be a string");case 4:if("object"===typeof n&&null!==n){e.next=6;break}throw new Error("parameter must be an object");case 6:return e.next=8,this.genericRequest(n,r);case 8:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o});case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_addEthereumChain",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t[0],0!==(null===(n=s.rpcUrls)||void 0===n?void 0:n.length)){e.next=3;break}return e.abrupt("return",{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}});case 3:if(s.chainName&&""!==s.chainName.trim()){e.next=5;break}throw v.standardErrors.rpc.invalidParams("chainName is a required field");case 5:if(s.nativeCurrency){e.next=7;break}throw v.standardErrors.rpc.invalidParams("nativeCurrency is a required field");case 7:return u=parseInt(s.chainId,16),e.next=10,this.addEthereumChain(u,null!==(r=s.rpcUrls)&&void 0!==r?r:[],null!==(o=s.blockExplorerUrls)&&void 0!==o?o:[],s.chainName,null!==(a=s.iconUrls)&&void 0!==a?a:[],s.nativeCurrency);case 10:if(!e.sent){e.next=15;break}return e.abrupt("return",{jsonrpc:"2.0",id:0,result:null});case 15:return e.abrupt("return",{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_switchEthereumChain",value:function(){var e=o(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[0],e.next=3,this.switchEthereumChain(parseInt(n.chainId,16));case 3:return e.abrupt("return",{jsonrpc:"2.0",id:0,result:null});case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_watchAsset",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=Array.isArray(t)?t[0]:t).type){e.next=3;break}throw v.standardErrors.rpc.invalidParams("Type is required");case 3:if("ERC20"===(null===n||void 0===n?void 0:n.type)){e.next=5;break}throw v.standardErrors.rpc.invalidParams("Asset of type '".concat(n.type,"' is not supported"));case 5:if(null===n||void 0===n?void 0:n.options){e.next=7;break}throw v.standardErrors.rpc.invalidParams("Options are required");case 7:if(null===n||void 0===n?void 0:n.options.address){e.next=9;break}throw v.standardErrors.rpc.invalidParams("Address is required");case 9:return r=this.getChainId(),o=n.options,a=o.address,s=o.symbol,u=o.image,c=o.decimals,e.next=13,this.watchAsset(n.type,a,s,c,u,r);case 13:return l=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:l});case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_uninstallFilter",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}},{key:"_eth_newFilter",value:function(){var e=o(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[0],e.next=3,this._filterPolyfill.newFilter(n);case 3:return r=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:r});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_newBlockFilter",value:function(){var e=o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._filterPolyfill.newBlockFilter();case 2:return t=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_newPendingTransactionFilter",value:function(){var e=o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._filterPolyfill.newPendingTransactionFilter();case 2:return t=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_getFilterChanges",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}},{key:"_eth_getFilterLogs",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}},{key:"initializeRelay",value:function(){var e=this;return this._relay?Promise.resolve(this._relay):this._relayProvider().then((function(t){return t.setAccountsCallback((function(t,n){return e._setAddresses(t,n)})),t.setChainCallback((function(t,n){e.updateProviderInfo(n,parseInt(t,10))})),t.setDappDefaultChainCallback(e._chainIdFromOpts),e._relay=t,t}))}}]),n}(d.default);t.CoinbaseWalletProvider=O},43122:function(e,t,n){"use strict";var r=n(861).default,i=n(17061).default,o=n(17156).default,a=n(56690).default,s=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.filterFromParam=t.FilterPolyfill=void 0;var u=n(99306),c=n(81107),l={jsonrpc:"2.0",id:0},f=function(){function e(t){a(this,e),this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,u.IntNumber)(1),this.provider=t}return s(e,[{key:"newFilter",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d(t),r=this.makeFilterId(),e.next=4,this.setInitialCursorPosition(r,n.fromBlock);case 4:return o=e.sent,console.log("Installing new log filter(".concat(r,"):"),n,"initial cursor position:",o),this.logFilters.set(r,n),this.setFilterTimeout(r),e.abrupt("return",(0,c.hexStringFromIntNumber)(r));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"newBlockFilter",value:function(){var e=o(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.makeFilterId(),e.next=3,this.setInitialCursorPosition(t,"latest");case 3:return n=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),n),this.blockFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,c.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"newPendingTransactionFilter",value:function(){var e=o(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.makeFilterId(),e.next=3,this.setInitialCursorPosition(t,"latest");case 3:return n=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),n),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,c.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"uninstallFilter",value:function(e){var t=(0,c.intNumberFromHexString)(e);return console.log("Uninstalling filter (".concat(t,")")),this.deleteFilter(t),!0}},{key:"getFilterChanges",value:function(e){var t=(0,c.intNumberFromHexString)(e);return this.timeouts.has(t)&&this.setFilterTimeout(t),this.logFilters.has(t)?this.getLogFilterChanges(t):this.blockFilters.has(t)?this.getBlockFilterChanges(t):this.pendingTransactionFilters.has(t)?this.getPendingTransactionFilterChanges(t):Promise.resolve(m())}},{key:"getFilterLogs",value:function(){var e=o(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(0,c.intNumberFromHexString)(t),r=this.logFilters.get(n)){e.next=4;break}return e.abrupt("return",m());case 4:return e.abrupt("return",this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getLogs",params:[p(r)]})));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"makeFilterId",value:function(){return(0,u.IntNumber)(++this.nextFilterId)}},{key:"sendAsyncPromise",value:function(e){var t=this;return new Promise((function(n,r){t.provider.sendAsync(e,(function(e,t){return e?r(e):Array.isArray(t)||null==t?r(new Error("unexpected response received: ".concat(JSON.stringify(t)))):void n(t)}))}))}},{key:"deleteFilter",value:function(e){console.log("Deleting filter (".concat(e,")")),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}},{key:"getLogFilterChanges",value:function(){var e=o(i().mark((function e(t){var n,o,a,s,f,d,h,v;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.logFilters.get(t),(o=this.cursors.get(t))&&n){e.next=4;break}return e.abrupt("return",m());case 4:return e.next=6,this.getCurrentBlockHeight();case 6:if(a=e.sent,s="latest"===n.toBlock?a:n.toBlock,!(o>a)){e.next=10;break}return e.abrupt("return",g());case 10:if(!(o>n.toBlock)){e.next=12;break}return e.abrupt("return",g());case 12:return console.log("Fetching logs from ".concat(o," to ").concat(s," for filter ").concat(t)),e.next=15,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getLogs",params:[p(Object.assign(Object.assign({},n),{fromBlock:o,toBlock:s}))]}));case 15:return f=e.sent,Array.isArray(f.result)&&(d=f.result.map((function(e){return(0,c.intNumberFromHexString)(e.blockNumber||"0x0")})),(h=Math.max.apply(Math,r(d)))&&h>o&&(v=(0,u.IntNumber)(h+1),console.log("Moving cursor position for filter (".concat(t,") from ").concat(o," to ").concat(v)),this.cursors.set(t,v))),e.abrupt("return",f);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getBlockFilterChanges",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.cursors.get(t)){e.next=3;break}return e.abrupt("return",m());case 3:return e.next=5,this.getCurrentBlockHeight();case 5:if(r=e.sent,!(n>r)){e.next=8;break}return e.abrupt("return",g());case 8:return console.log("Fetching blocks from ".concat(n," to ").concat(r," for filter (").concat(t,")")),e.next=11,Promise.all((0,c.range)(n,r+1).map((function(e){return s.getBlockHashByNumber((0,u.IntNumber)(e))})));case 11:return o=e.sent.filter((function(e){return!!e})),a=(0,u.IntNumber)(n+o.length),console.log("Moving cursor position for filter (".concat(t,") from ").concat(n," to ").concat(a)),this.cursors.set(t,a),e.abrupt("return",Object.assign(Object.assign({},l),{result:o}));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPendingTransactionFilterChanges",value:function(){var e=o(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve(g()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setInitialCursorPosition",value:function(){var e=o(i().mark((function e(t,n){var r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCurrentBlockHeight();case 2:return r=e.sent,o="number"===typeof n&&n>r?n:r,this.cursors.set(t,o),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setFilterTimeout",value:function(e){var t=this,n=this.timeouts.get(e);n&&window.clearTimeout(n);var r=window.setTimeout((function(){console.log("Filter (".concat(e,") timed out")),t.deleteFilter(e)}),3e5);this.timeouts.set(e,r)}},{key:"getCurrentBlockHeight",value:function(){var e=o(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_blockNumber",params:[]}));case 2:return t=e.sent,n=t.result,e.abrupt("return",(0,c.intNumberFromHexString)((0,c.ensureHexString)(n)));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBlockHashByNumber",value:function(){var e=o(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getBlockByNumber",params:[(0,c.hexStringFromIntNumber)(t),!1]}));case 2:if(!(n=e.sent).result||"string"!==typeof n.result.hash){e.next=5;break}return e.abrupt("return",(0,c.ensureHexString)(n.result.hash));case 5:return e.abrupt("return",null);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function d(e){return{fromBlock:h(e.fromBlock),toBlock:h(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function p(e){var t={fromBlock:v(e.fromBlock),toBlock:v(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function h(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,u.IntNumber)(0);if((0,c.isHexString)(e))return(0,c.intNumberFromHexString)(e);throw new Error("Invalid block option: ".concat(String(e)))}function v(e){return"latest"===e?e:(0,c.hexStringFromIntNumber)(e)}function m(){return Object.assign(Object.assign({},l),{error:{code:-32e3,message:"filter not found"}})}function g(){return Object.assign(Object.assign({},l),{result:[]})}t.FilterPolyfill=f,t.filterFromParam=d},27566:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))},49023:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;var s=n(28371),u=n(68286),c=function(){},l=function(){function e(t){o(this,e);var n=new s.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),r=u({blockTracker:n,provider:t}),i=r.events,a=r.middleware;this.events=i,this.subscriptionMiddleware=a}return a(e,[{key:"handleRequest",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},e.next=3,this.subscriptionMiddleware(t,n,c,c);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){this.subscriptionMiddleware.destroy()}}]),e}();t.SubscriptionManager=l},34405:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKUI=void 0;var o=n(247),a=n(64620),s=n(31665),u=function(){function e(t){r(this,e),this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new a.Snackbar({darkMode:t.darkMode}),this.linkFlow=new o.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}return i(e,[{key:"attach",value:function(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");var e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.linkFlow.attach(t),this.snackbar.attach(t),this.attached=!0,(0,s.injectCssReset)()}},{key:"setConnectDisabled",value:function(e){this.linkFlow.setConnectDisabled(e)}},{key:"addEthereumChain",value:function(e){}},{key:"watchAsset",value:function(e){}},{key:"switchEthereumChain",value:function(e){}},{key:"requestEthereumAccounts",value:function(e){this.linkFlow.open({onCancel:e.onCancel})}},{key:"hideRequestEthereumAccounts",value:function(){this.linkFlow.close()}},{key:"signEthereumMessage",value:function(e){}},{key:"signEthereumTransaction",value:function(e){}},{key:"submitEthereumTransaction",value:function(e){}},{key:"ethereumAddressFromSignedMessage",value:function(e){}},{key:"showConnecting",value:function(e){var t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,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)}},{key:"setAppSrc",value:function(e){this.appSrc=e}},{key:"reloadUI",value:function(){document.location.reload()}},{key:"inlineAccountsResponse",value:function(){return!1}},{key:"inlineAddEthereumChain",value:function(e){return!1}},{key:"inlineWatchAsset",value:function(){return!1}},{key:"inlineSwitchEthereumChain",value:function(){return!1}},{key:"setStandalone",value:function(e){this.standalone=e}},{key:"isStandalone",value:function(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}}]),e}();t.WalletSDKUI=u},94100:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))},35836:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;var o=n(90590),a=n(81107),s="session:id",u="session:secret",c="session:linked",l=function(){function e(t,n,i,s){r(this,e),this._storage=t,this._id=n||(0,a.randomBytesHex)(16),this._secret=i||(0,a.randomBytesHex)(32),this._key=(new o.sha256).update("".concat(this._id,", ").concat(this._secret," WalletLink")).digest("hex"),this._linked=!!s}return i(e,[{key:"id",get:function(){return this._id}},{key:"secret",get:function(){return this._secret}},{key:"key",get:function(){return this._key}},{key:"linked",get:function(){return this._linked},set:function(e){this._linked=e,this.persistLinked()}},{key:"save",value:function(){return this._storage.setItem(s,this._id),this._storage.setItem(u,this._secret),this.persistLinked(),this}},{key:"persistLinked",value:function(){this._storage.setItem(c,this._linked?"1":"0")}}],[{key:"load",value:function(t){var n=t.getItem(s),r=t.getItem(c),i=t.getItem(u);return n&&i?new e(t,n,i,"1"===r):null}},{key:"hash",value:function(e){return(new o.sha256).update(e).digest("hex")}}]),e}();t.Session=l},47993:function(e,t,n){"use strict";var r=n(27424).default,i=n(56690).default,o=n(89728).default,a=n(61655).default,s=n(26389).default,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&u(t,e,n);return c(t,e),t},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelay=void 0;var p=d(n(45590)),h=n(40623),v=n(21807),m=n(56171),g=n(62569),y=n(27312),b=n(99306),w=n(81107),x=f(n(71572)),k=n(35836),_=n(731),E=n(50194),A=n(90429),S=n(14107),O=n(87734),T=n(12202),P=function(e){a(n,e);var t=s(n);function n(e){var r,o;i(this,n),(r=t.call(this)).accountsCallback=null,r.chainCallback=null,r.dappDefaultChainSubject=new h.BehaviorSubject(1),r.dappDefaultChain=1,r.appName="",r.appLogoUrl=null,r.subscriptions=new h.Subscription,r.linkAPIUrl=e.linkAPIUrl,r.storage=e.storage,r.options=e;var a=r.subscribe(),s=a.session,u=a.ui,c=a.connection;if(r._session=s,r.connection=c,r.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");return e.eventListener?r.diagnostic={log:e.eventListener.onEvent}:r.diagnostic=e.diagnosticLogger,r._reloadOnDisconnect=null===(o=e.reloadOnDisconnect)||void 0===o||o,r.ui=u,r}return o(n,[{key:"subscribe",value:function(){var e=this;this.subscriptions.add(this.dappDefaultChainSubject.subscribe((function(t){e.dappDefaultChain!==t&&(e.dappDefaultChain=t)})));var t=k.Session.load(this.storage)||new k.Session(this.storage).save(),i=new g.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(i.sessionConfig$.subscribe({next:function(t){e.onSessionConfigChanged(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(i.incomingEvent$.pipe((0,v.filter)((function(e){return"Web3Response"===e.event}))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(i.linked$.pipe((0,v.skip)(1),(0,v.tap)((function(t){var n;e.isLinked=t;var r=e.storage.getItem(_.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(e.session.linked=t),e.isUnlinkedErrorState=!1,r){var i=r.split(" "),o="true"===e.storage.getItem("IsStandaloneSigning");if(""!==i[0]&&!t&&e.session.linked&&!o){e.isUnlinkedErrorState=!0;var a=e.getSessionIdHash();null===(n=e.diagnostic)||void 0===n||n.log(m.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:a})}}}))).subscribe()),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return!!e.metadata&&"1"===e.metadata.__destroyed}))).subscribe((function(){var t,n=i.isDestroyed;return null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:n,sessionIdHash:e.getSessionIdHash()}),e.resetAndReload()}))),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.WalletUsername}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.WalletUsername,t.secret)}))).subscribe({next:function(t){e.storage.setItem(_.WALLET_USER_NAME_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppVersion}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.AppVersion,t.secret)}))).subscribe({next:function(t){e.storage.setItem(_.APP_VERSION_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.ChainId&&void 0!==e.metadata.JsonRpcUrl}))).pipe((0,v.mergeMap)((function(e){return(0,h.zip)(x.decrypt(e.metadata.ChainId,t.secret),x.decrypt(e.metadata.JsonRpcUrl,t.secret))}))).pipe((0,v.distinctUntilChanged)()).subscribe({next:function(t){var n=r(t,2),i=n[0],o=n[1];e.chainCallback&&e.chainCallback(i,o)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.EthereumAddress}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.EthereumAddress,t.secret)}))).subscribe({next:function(t){e.accountsCallback&&e.accountsCallback([t]),n.accountRequestCallbackIds.size>0&&(Array.from(n.accountRequestCallbackIds.values()).forEach((function(n){var r=(0,T.Web3ResponseMessage)({id:n,response:(0,O.RequestEthereumAccountsResponse)([t])});e.invokeCallback(Object.assign(Object.assign({},r),{id:n}))})),n.accountRequestCallbackIds.clear())},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppSrc}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.AppSrc,t.secret)}))).subscribe({next:function(t){e.ui.setAppSrc(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));var o=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:i.connected$,chainId$:this.dappDefaultChainSubject});return i.connect(),{session:t,ui:o,connection:i}}},{key:"attachUI",value:function(){this.ui.attach()}},{key:"resetAndReload",value:function(){var e=this;this.connection.setSessionMetadata("__destroyed","1").pipe((0,v.timeout)(1e3),(0,v.catchError)((function(e){return(0,h.of)(null)}))).subscribe((function(t){var n,r,i,o=e.ui.isStandalone();try{e.subscriptions.unsubscribe()}catch(f){null===(n=e.diagnostic)||void 0===n||n.log(m.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(r=e.diagnostic)||void 0===r||r.log(m.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:e.getSessionIdHash()}),e.connection.destroy();var a=k.Session.load(e.storage);if((null===a||void 0===a?void 0:a.id)===e._session.id?e.storage.clear():a&&(null===(i=e.diagnostic)||void 0===i||i.log(m.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:e.getSessionIdHash(),storedSessionIdHash:k.Session.hash(a.id)})),e._reloadOnDisconnect)e.ui.reloadUI();else{e.accountsCallback&&e.accountsCallback([],!0),e.subscriptions=new h.Subscription;var s=e.subscribe(),u=s.session,c=s.ui,l=s.connection;e._session=u,e.connection=l,e.ui=c,o&&e.ui.setStandalone&&e.ui.setStandalone(!0),e.attachUI()}}),(function(t){var n;null===(n=e.diagnostic)||void 0===n||n.log(m.EVENTS.FAILURE,{method:"relay::resetAndReload",message:"failed to reset and reload with ".concat(t),sessionIdHash:e.getSessionIdHash()})}))}},{key:"setAppInfo",value:function(e,t){this.appName=e,this.appLogoUrl=t}},{key:"getStorageItem",value:function(e){return this.storage.getItem(e)}},{key:"session",get:function(){return this._session}},{key:"setStorageItem",value:function(e,t){this.storage.setItem(e,t)}},{key:"signEthereumMessage",value:function(e,t,n,r){return this.sendRequest({method:E.Web3Method.signEthereumMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:r||null}})}},{key:"ethereumAddressFromSignedMessage",value:function(e,t,n){return this.sendRequest({method:E.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),signature:(0,w.hexStringFromBuffer)(t,!0),addPrefix:n}})}},{key:"signEthereumTransaction",value:function(e){return this.sendRequest({method:E.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,w.bigIntStringFromBN)(e.weiValue),data:(0,w.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,w.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}},{key:"signAndSubmitEthereumTransaction",value:function(e){return this.sendRequest({method:E.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,w.bigIntStringFromBN)(e.weiValue),data:(0,w.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,w.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,w.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,w.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}},{key:"submitEthereumTransaction",value:function(e,t){return this.sendRequest({method:E.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,w.hexStringFromBuffer)(e,!0),chainId:t}})}},{key:"scanQRCode",value:function(e){return this.sendRequest({method:E.Web3Method.scanQRCode,params:{regExp:e}})}},{key:"getQRCodeUrl",value:function(){return(0,w.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}},{key:"genericRequest",value:function(e,t){return this.sendRequest({method:E.Web3Method.generic,params:{action:t,data:e}})}},{key:"sendGenericMessage",value:function(e){return this.sendRequest(e)}},{key:"sendRequest",value:function(e){var t=this,n=null,r=(0,w.randomBytesHex)(8),i=function(i){t.publishWeb3RequestCanceledEvent(r),t.handleErrorResponse(r,e.method,i),null===n||void 0===n||n()};return{promise:new Promise((function(o,a){t.ui.isStandalone()||(n=t.ui.showConnecting({isUnlinkedErrorState:t.isUnlinkedErrorState,onCancel:i,onResetConnection:t.resetAndReload})),t.relayEventManager.callbacks.set(r,(function(e){if(null===n||void 0===n||n(),e.errorMessage)return a(new Error(e.errorMessage));o(e)})),t.ui.isStandalone()?t.sendRequestStandalone(r,e):t.publishWeb3RequestEvent(r,e)})),cancel:i}}},{key:"setConnectDisabled",value:function(e){this.ui.setConnectDisabled(e)}},{key:"setAccountsCallback",value:function(e){this.accountsCallback=e}},{key:"setChainCallback",value:function(e){this.chainCallback=e}},{key:"setDappDefaultChainCallback",value:function(e){this.dappDefaultChainSubject.next(e)}},{key:"publishWeb3RequestEvent",value:function(e,t){var n,r=this,i=(0,S.Web3RequestMessage)({id:e,request:t}),o=k.Session.load(this.storage);null===(n=this.diagnostic)||void 0===n||n.log(m.EVENTS.WEB3_REQUEST,{eventId:i.id,method:"relay::".concat(i.request.method),sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?k.Session.hash(o.id):"",isSessionMismatched:((null===o||void 0===o?void 0:o.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:function(e){var t;null===(t=r.diagnostic)||void 0===t||t.log(m.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:"relay::".concat(i.request.method),sessionIdHash:r.getSessionIdHash(),storedSessionIdHash:o?k.Session.hash(o.id):"",isSessionMismatched:((null===o||void 0===o?void 0:o.id)!==r._session.id).toString()})},error:function(e){r.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:e.message}}))}}))}},{key:"publishWeb3RequestCanceledEvent",value:function(e){var t=(0,A.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",t,!1).subscribe())}},{key:"publishEvent",value:function(e,t,n){var r=this,i=this.session.secret;return new h.Observable((function(e){x.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin})),i).then((function(t){e.next(t),e.complete()}))})).pipe((0,v.mergeMap)((function(t){return r.connection.publishEvent(e,t,n)})))}},{key:"handleIncomingEvent",value:function(e){var t=this;try{this.subscriptions.add((0,h.from)(x.decrypt(e.data,this.session.secret)).pipe((0,v.map)((function(e){return JSON.parse(e)}))).subscribe({next:function(e){var n=(0,T.isWeb3ResponseMessage)(e)?e:null;n&&t.handleWeb3ResponseMessage(n)},error:function(){var e;null===(e=t.diagnostic)||void 0===e||e.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(n){return}}},{key:"handleWeb3ResponseMessage",value:function(e){var t,r=this,i=e.response;if(null===(t=this.diagnostic)||void 0===t||t.log(m.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:"relay::".concat(i.method),sessionIdHash:this.getSessionIdHash()}),(0,O.isRequestEthereumAccountsResponse)(i))return n.accountRequestCallbackIds.forEach((function(t){return r.invokeCallback(Object.assign(Object.assign({},e),{id:t}))})),void n.accountRequestCallbackIds.clear();this.invokeCallback(e)}},{key:"handleErrorResponse",value:function(e,t,n,r){var i,o=null!==(i=null===n||void 0===n?void 0:n.message)&&void 0!==i?i:(0,y.standardErrorMessage)(r);this.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:e,response:{method:t,errorMessage:o,errorCode:r}}))}},{key:"invokeCallback",value:function(e){var t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}},{key:"requestEthereumAccounts",value:function(){var e=this,t={method:E.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,w.randomBytesHex)(8),i=function(n){e.publishWeb3RequestCanceledEvent(r),e.handleErrorResponse(r,t.method,n)};return{promise:new Promise((function(o,a){var s;e.relayEventManager.callbacks.set(r,(function(t){if(e.ui.hideRequestEthereumAccounts(),t.errorMessage)return a(new Error(t.errorMessage));o(t)}));var u=(null===(s=null===window||void 0===window?void 0:window.navigator)||void 0===s?void 0:s.userAgent)||null;if(u&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u)){var c;try{c=(0,w.isInIFrame)()&&window.top?window.top.location:window.location}catch(f){c=window.location}c.href="https://www.coinbase.com/connect-dapp?uri=".concat(encodeURIComponent(c.href))}else{if(e.ui.inlineAccountsResponse()){e.ui.requestEthereumAccounts({onCancel:i,onAccounts:function(t){e.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:r,response:(0,O.RequestEthereumAccountsResponse)(t)}))}})}else{var l=y.standardErrors.provider.userRejectedRequest("User denied account authorization");e.ui.requestEthereumAccounts({onCancel:function(){return i(l)}})}n.accountRequestCallbackIds.add(r),e.ui.inlineAccountsResponse()||e.ui.isStandalone()||e.publishWeb3RequestEvent(r,t)}})),cancel:i}}},{key:"selectProvider",value:function(e){var t=this,n={method:E.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,w.randomBytesHex)(8);return{cancel:function(e){t.publishWeb3RequestCanceledEvent(r),t.handleErrorResponse(r,n.method,e)},promise:new Promise((function(n,i){t.relayEventManager.callbacks.set(r,(function(e){if(e.errorMessage)return i(new Error(e.errorMessage));n(e)}));t.ui.selectProvider&&t.ui.selectProvider({onApprove:function(e){t.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:r,response:(0,O.SelectProviderResponse)(e)}))},onCancel:function(e){t.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:r,response:(0,O.SelectProviderResponse)(b.ProviderType.Unselected)}))},providerOptions:e})}))}}},{key:"watchAsset",value:function(e,t,n,r,i,o){var a=this,s={method:E.Web3Method.watchAsset,params:{type:e,options:{address:t,symbol:n,decimals:r,image:i},chainId:o}},u=null,c=(0,w.randomBytesHex)(8),l=function(e){a.publishWeb3RequestCanceledEvent(c),a.handleErrorResponse(c,s.method,e),null===u||void 0===u||u()};return this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{cancel:l,promise:new Promise((function(l,f){a.relayEventManager.callbacks.set(c,(function(e){if(null===u||void 0===u||u(),e.errorMessage)return f(new Error(e.errorMessage));l(e)}));a.ui.inlineWatchAsset()&&a.ui.watchAsset({onApprove:function(){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.WatchAssetReponse)(!0)}))},onCancel:function(e){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.WatchAssetReponse)(!1)}))},type:e,address:t,symbol:n,decimals:r,image:i,chainId:o}),a.ui.inlineWatchAsset()||a.ui.isStandalone()||a.publishWeb3RequestEvent(c,s)}))}}},{key:"addEthereumChain",value:function(e,t,n,r,i,o){var a=this,s={method:E.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:o}},u=null,c=(0,w.randomBytesHex)(8),l=function(e){a.publishWeb3RequestCanceledEvent(c),a.handleErrorResponse(c,s.method,e),null===u||void 0===u||u()};return this.ui.inlineAddEthereumChain(e)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((function(t,n){a.relayEventManager.callbacks.set(c,(function(e){if(null===u||void 0===u||u(),e.errorMessage)return n(new Error(e.errorMessage));t(e)}));a.ui.inlineAddEthereumChain(e)&&a.ui.addEthereumChain({onCancel:function(e){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.AddEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:s.params.chainId,rpcUrls:s.params.rpcUrls,blockExplorerUrls:s.params.blockExplorerUrls,chainName:s.params.chainName,iconUrls:s.params.iconUrls,nativeCurrency:s.params.nativeCurrency}),a.ui.inlineAddEthereumChain(e)||a.ui.isStandalone()||a.publishWeb3RequestEvent(c,s)})),cancel:l}}},{key:"switchEthereumChain",value:function(e,t){var n=this,r={method:E.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:t})},i=(0,w.randomBytesHex)(8);return{promise:new Promise((function(t,o){n.relayEventManager.callbacks.set(i,(function(e){return(0,O.isErrorResponse)(e)&&e.errorCode?o(y.standardErrors.provider.custom({code:e.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):e.errorMessage?o(new Error(e.errorMessage)):void t(e)}));n.ui.switchEthereumChain({onCancel:function(t){var r;if(t){var o=null!==(r=(0,y.getErrorCode)(t))&&void 0!==r?r:y.standardErrorCodes.provider.unsupportedChain;n.handleErrorResponse(i,E.Web3Method.switchEthereumChain,t instanceof Error?t:y.standardErrors.provider.unsupportedChain(e),o)}else n.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:i,response:(0,O.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){n.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:i,response:(0,O.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:r.params.chainId,address:r.params.address}),n.ui.inlineSwitchEthereumChain()||n.ui.isStandalone()||n.publishWeb3RequestEvent(i,r)})),cancel:function(e){n.publishWeb3RequestCanceledEvent(i),n.handleErrorResponse(i,r.method,e)}}}},{key:"inlineAddEthereumChain",value:function(e){return this.ui.inlineAddEthereumChain(e)}},{key:"getSessionIdHash",value:function(){return k.Session.hash(this._session.id)}},{key:"sendRequestStandalone",value:function(e,t){var n=this,r=function(r){n.handleErrorResponse(e,t.method,r)},i=function(t){n.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:e,response:t}))};switch(t.method){case E.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:i});break;default:r()}}},{key:"onSessionConfigChanged",value:function(e){}}]),n}(_.WalletSDKRelayAbstract);P.accountRequestCallbackIds=new Set,l([p.default],P.prototype,"resetAndReload",null),l([p.default],P.prototype,"handleIncomingEvent",null),t.WalletSDKRelay=P},731:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayAbstract=t.APP_VERSION_KEY=t.LOCAL_STORAGE_ADDRESSES_KEY=t.WALLET_USER_NAME_KEY=void 0;var s=n(27312);t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion";var u=function(){function e(){o(this,e)}return a(e,[{key:"makeEthereumJSONRPCRequest",value:function(){var e=i(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Error: No jsonRpcUrl provided");case 2:return e.abrupt("return",window.fetch(n,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((function(e){return e.json()})).then((function(e){if(!e)throw s.standardErrors.rpc.parse({});var n=e,r=n.error;if(r)throw(0,s.serializeError)(r,t.method);return n})));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();t.WalletSDKRelayAbstract=u},16642:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayEventManager=void 0;var o=n(81107),a=function(){function e(){r(this,e),this._nextRequestId=0,this.callbacks=new Map}return i(e,[{key:"makeRequestId",value:function(){this._nextRequestId=(this._nextRequestId+1)%2147483647;var e=this._nextRequestId,t=(0,o.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}]),e}();t.WalletSDKRelayEventManager=a},50194:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))},90429:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestCanceledMessage=void 0;var r=n(94100);t.Web3RequestCanceledMessage=function(e){return{type:r.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}}},14107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestMessage=void 0;var r=n(94100);t.Web3RequestMessage=function(e){return Object.assign({type:r.RelayMessageType.WEB3_REQUEST},e)}},87734:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumAddressFromSignedMessageResponse=t.SubmitEthereumTransactionResponse=t.SignEthereumTransactionResponse=t.SignEthereumMessageResponse=t.isRequestEthereumAccountsResponse=t.SelectProviderResponse=t.WatchAssetReponse=t.RequestEthereumAccountsResponse=t.SwitchEthereumChainResponse=t.AddEthereumChainResponse=t.isErrorResponse=void 0;var r=n(50194);t.isErrorResponse=function(e){var t,n;return void 0!==(null===(t=e)||void 0===t?void 0:t.method)&&void 0!==(null===(n=e)||void 0===n?void 0:n.errorMessage)},t.AddEthereumChainResponse=function(e){return{method:r.Web3Method.addEthereumChain,result:e}},t.SwitchEthereumChainResponse=function(e){return{method:r.Web3Method.switchEthereumChain,result:e}},t.RequestEthereumAccountsResponse=function(e){return{method:r.Web3Method.requestEthereumAccounts,result:e}},t.WatchAssetReponse=function(e){return{method:r.Web3Method.watchAsset,result:e}},t.SelectProviderResponse=function(e){return{method:r.Web3Method.selectProvider,result:e}},t.isRequestEthereumAccountsResponse=function(e){return e&&e.method===r.Web3Method.requestEthereumAccounts},t.SignEthereumMessageResponse=function(e){return{method:r.Web3Method.signEthereumMessage,result:e}},t.SignEthereumTransactionResponse=function(e){return{method:r.Web3Method.signEthereumTransaction,result:e}},t.SubmitEthereumTransactionResponse=function(e){return{method:r.Web3Method.submitEthereumTransaction,result:e}},t.EthereumAddressFromSignedMessageResponse=function(e){return{method:r.Web3Method.ethereumAddressFromSignedMessage,result:e}}},12202:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWeb3ResponseMessage=t.Web3ResponseMessage=void 0;var r=n(94100);t.Web3ResponseMessage=function(e){return Object.assign({type:r.RelayMessageType.WEB3_RESPONSE},e)},t.isWeb3ResponseMessage=function(e){return e&&e.type===r.RelayMessageType.WEB3_RESPONSE}},71572:function(e,t,n){"use strict";var r=n(17061).default,i=n(861).default,o=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;var a=n(81107);function s(){return(s=o(r().mark((function e(t,n){var o,s,u,c,l,f,d,p,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64===n.length){e.next=2;break}throw Error("secret must be 256 bits");case 2:return o=crypto.getRandomValues(new Uint8Array(12)),e.next=5,crypto.subtle.importKey("raw",(0,a.hexStringToUint8Array)(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 5:return s=e.sent,u=new TextEncoder,e.next=9,window.crypto.subtle.encrypt({name:"AES-GCM",iv:o},s,u.encode(t));case 9:return c=e.sent,16,l=c.slice(c.byteLength-16),f=c.slice(0,c.byteLength-16),d=new Uint8Array(l),p=new Uint8Array(f),h=new Uint8Array([].concat(i(o),i(d),i(p))),e.abrupt("return",(0,a.uint8ArrayToHex)(h));case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.encrypt=function(e,t){return s.apply(this,arguments)},t.decrypt=function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((function(n,s){o(r().mark((function o(){var u,c,l,f,d,p,h,v,m;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,crypto.subtle.importKey("raw",(0,a.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 2:return u=r.sent,c=(0,a.hexStringToUint8Array)(e),l=c.slice(0,12),f=c.slice(12,28),d=c.slice(28),p=new Uint8Array([].concat(i(d),i(f))),h={name:"AES-GCM",iv:new Uint8Array(l)},r.prev=9,r.next=12,window.crypto.subtle.decrypt(h,u,p);case 12:v=r.sent,m=new TextDecoder,n(m.decode(v)),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(9),s(r.t0);case 20:case"end":return r.stop()}}),o,null,[[9,17]])})))()}))}},99306:function(e,t){"use strict";function n(){return function(e){return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=n,t.HexString=function(e){return e},t.AddressString=function(e){return e},t.BigIntString=function(e){return e},t.IntNumber=function(e){return Math.floor(e)},t.RegExpString=function(e){return e},function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""}(t.ProviderType||(t.ProviderType={}))},81107:function(e,t,n){"use strict";var r=n(38416).default,i=n(861).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isInIFrame=t.createQrUrl=t.getFavicon=t.range=t.isBigNumber=t.ensureParsedJSONObject=t.ensureBN=t.ensureRegExpString=t.ensureIntNumber=t.ensureBuffer=t.ensureAddressString=t.ensureEvenLengthHexString=t.ensureHexString=t.isHexString=t.prepend0x=t.strip0x=t.has0xPrefix=t.hexStringFromIntNumber=t.intNumberFromHexString=t.bigIntStringFromBN=t.hexStringFromBuffer=t.hexStringToUint8Array=t.uint8ArrayToHex=t.randomBytesHex=void 0;var a=o(n(7465)),s=n(74776),u=n(27312),c=n(99306),l=/^[0-9]*$/,f=/^[a-f0-9]*$/;function d(e){return i(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}function p(e){return e.startsWith("0x")||e.startsWith("0X")}function h(e){return p(e)?e.slice(2):e}function v(e){return p(e)?"0x"+e.slice(2):"0x"+e}function m(e){if("string"!==typeof e)return!1;var t=h(e).toLowerCase();return f.test(t)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof e){var n=h(e).toLowerCase();if(f.test(n))return(0,c.HexString)(t?"0x"+n:n)}throw u.standardErrors.rpc.invalidParams('"'.concat(String(e),'" is not a hexadecimal string'))}function y(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=g(e,!1);return n.length%2===1&&(n=(0,c.HexString)("0"+n)),t?(0,c.HexString)("0x"+n):n}function b(e){if("number"===typeof e&&Number.isInteger(e))return(0,c.IntNumber)(e);if("string"===typeof e){if(l.test(e))return(0,c.IntNumber)(Number(e));if(m(e))return(0,c.IntNumber)(new a.default(y(e,!1),16).toNumber())}throw u.standardErrors.rpc.invalidParams("Not an integer: ".concat(String(e)))}function w(e){if(null==e||"function"!==typeof e.constructor)return!1;var t=e.constructor;return"function"===typeof t.config&&"number"===typeof t.EUCLID}t.randomBytesHex=function(e){return d(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=d,t.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map((function(e){return parseInt(e,16)})))},t.hexStringFromBuffer=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString("hex");return(0,c.HexString)(t?"0x"+n:n)},t.bigIntStringFromBN=function(e){return(0,c.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,c.IntNumber)(new a.default(y(e,!1),16).toNumber())},t.hexStringFromIntNumber=function(e){return(0,c.HexString)("0x"+new a.default(e).toString(16))},t.has0xPrefix=p,t.strip0x=h,t.prepend0x=v,t.isHexString=m,t.ensureHexString=g,t.ensureEvenLengthHexString=y,t.ensureAddressString=function(e){if("string"===typeof e){var t=h(e).toLowerCase();if(m(t)&&40===t.length)return(0,c.AddressString)(v(t))}throw u.standardErrors.rpc.invalidParams("Invalid Ethereum address: ".concat(String(e)))},t.ensureBuffer=function(e){if(Buffer.isBuffer(e))return e;if("string"===typeof e){if(m(e)){var t=y(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw u.standardErrors.rpc.invalidParams("Not binary data: ".concat(String(e)))},t.ensureIntNumber=b,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,c.RegExpString)(e.toString());throw u.standardErrors.rpc.invalidParams("Not a RegExp: ".concat(String(e)))},t.ensureBN=function(e){if(null!==e&&(a.default.isBN(e)||w(e)))return new a.default(e.toString(10),10);if("number"===typeof e)return new a.default(b(e));if("string"===typeof e){if(l.test(e))return new a.default(e,10);if(m(e))return new a.default(y(e,!1),16)}throw u.standardErrors.rpc.invalidParams("Not an integer: ".concat(String(e)))},t.ensureParsedJSONObject=function(e){if("string"===typeof e)return JSON.parse(e);if("object"===typeof e)return e;throw u.standardErrors.rpc.invalidParams("Not a JSON string or an object: ".concat(String(e)))},t.isBigNumber=w,t.range=function(e,t){return Array.from({length:t-e},(function(t,n){return e+n}))},t.getFavicon=function(){var e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),t=document.location,n=t.protocol,r=t.host,i=e?e.getAttribute("href"):null;return!i||i.startsWith("javascript:")?null:i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")?i:i.startsWith("//")?n+i:"".concat(n,"//").concat(r).concat(i)},t.createQrUrl=function(e,t,n,i,o,a){var u,c=i?"parent-id":"id",l=(0,s.stringify)((r(u={},c,e),r(u,"secret",t),r(u,"server",n),r(u,"v",o),r(u,"chainId",a),u));return"".concat(n,"/#/link?").concat(l)},t.isInIFrame=function(){try{return null!==window.frameElement}catch(e){return!1}}},65396:function(e,t,n){var r=n(55313),i=n(7465);function o(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 a(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function s(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function u(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function c(e){var t=typeof e;if("string"===t)return r.isHexString(e)?new i(r.stripHexPrefix(e),16):new i(e,10);if("number"===t)return new i(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function l(e,t){var n,o,f,d;if("address"===e)return l("uint160",c(t));if("bool"===e)return l("uint8",t?1:0);if("string"===e)return l("bytes",new Buffer(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if("undefined"===typeof t.length)throw new Error("Not an array?");if("dynamic"!==(n=u(e))&&0!==n&&t.length>n)throw new Error("Elements exceed array size: "+n);for(d in f=[],e=e.slice(0,e.lastIndexOf("[")),"string"===typeof t&&(t=JSON.parse(t)),t)f.push(l(e,t[d]));if("dynamic"===n){var p=l("uint256",t.length);f.unshift(p)}return Buffer.concat(f)}if("bytes"===e)return t=new Buffer(t),f=Buffer.concat([l("uint256",t.length),t]),t.length%32!==0&&(f=Buffer.concat([f,r.zeros(32-t.length%32)])),f;if(e.startsWith("bytes")){if((n=a(e))<1||n>32)throw new Error("Invalid bytes width: "+n);return r.setLengthRight(t,32)}if(e.startsWith("uint")){if((n=a(e))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((o=c(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+o.bitLength());if(o<0)throw new Error("Supplied uint is negative");return o.toArrayLike(Buffer,"be",32)}if(e.startsWith("int")){if((n=a(e))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((o=c(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+o.bitLength());return o.toTwos(256).toArrayLike(Buffer,"be",32)}if(e.startsWith("ufixed")){if(n=s(e),(o=c(t))<0)throw new Error("Supplied ufixed is negative");return l("uint256",o.mul(new i(2).pow(new i(n[1]))))}if(e.startsWith("fixed"))return n=s(e),l("int256",c(t).mul(new i(2).pow(new i(n[1]))));throw new Error("Unsupported or invalid type: "+e)}function f(e){return"string"===e||"bytes"===e||"dynamic"===u(e)}function d(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var n,i,s=[],u=0;u32)throw new Error("Invalid bytes width: "+n);s.push(r.setLengthRight(f,n))}else if(l.startsWith("uint")){if((n=a(l))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((i=c(f)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());s.push(i.toArrayLike(Buffer,"be",n/8))}else{if(!l.startsWith("int"))throw new Error("Unsupported or invalid type: "+l);if((n=a(l))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((i=c(f)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());s.push(i.toTwos(n).toArrayLike(Buffer,"be",n/8))}}return Buffer.concat(s)}e.exports={rawEncode:function(e,t){var n=[],r=[],i=32*e.length;for(var a in e){var s=o(e[a]),u=l(s,t[a]);f(s)?(n.push(l("uint256",i)),r.push(u),i+=u.length):n.push(u)}return Buffer.concat(n.concat(r))},solidityPack:d,soliditySHA3:function(e,t){return r.keccak(d(e,t))}}},36810:function(e,t,n){var r=n(74704).default,i=n(27424).default,o=n(55313),a=n(65396),s={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"]},u={encodeData:function(e,t,n){var s=this,u=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],c=["bytes32"],l=[this.hashType(e,n)];if(u){var f,d=function e(t,r,c){if(void 0!==n[r])return["bytes32",null==c?"0x0000000000000000000000000000000000000000000000000000000000000000":o.keccak(s.encodeData(r,c,n,u))];if(void 0===c)throw new Error("missing value for field ".concat(t," of type ").concat(r));if("bytes"===r)return["bytes32",o.keccak(c)];if("string"===r)return"string"===typeof c&&(c=Buffer.from(c,"utf8")),["bytes32",o.keccak(c)];if(r.lastIndexOf("]")===r.length-1){var l=r.slice(0,r.lastIndexOf("[")),f=c.map((function(n){return e(t,l,n)}));return["bytes32",o.keccak(a.rawEncode(f.map((function(e){return i(e,1)[0]})),f.map((function(e){return i(e,2)[1]}))))]}return[r,c]},p=r(n[e]);try{for(p.s();!(f=p.n()).done;){var h=f.value,v=d(h.name,h.type,t[h.name]),m=i(v,2),g=m[0],y=m[1];c.push(g),l.push(y)}}catch(_){p.e(_)}finally{p.f()}}else{var b,w=r(n[e]);try{for(w.s();!(b=w.n()).done;){var x=b.value,k=t[x.name];if(void 0!==k)if("bytes"===x.type)c.push("bytes32"),k=o.keccak(k),l.push(k);else if("string"===x.type)c.push("bytes32"),"string"===typeof k&&(k=Buffer.from(k,"utf8")),k=o.keccak(k),l.push(k);else if(void 0!==n[x.type])c.push("bytes32"),k=o.keccak(this.encodeData(x.type,k,n,u)),l.push(k);else{if(x.type.lastIndexOf("]")===x.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");c.push(x.type),l.push(k)}}}catch(_){w.e(_)}finally{w.f()}}return a.rawEncode(c,l)},encodeType:function(e,t){var n="",i=this.findTypeDependencies(e,t).filter((function(t){return t!==e}));i=[e].concat(i.sort());var o,a=r(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!t[s])throw new Error("No type definition specified: "+s);n+=s+"("+t[s].map((function(e){var t=e.name;return e.type+" "+t})).join(",")+")"}}catch(u){a.e(u)}finally{a.f()}return n},findTypeDependencies:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;n.push(e);var i,o=r(t[e]);try{for(o.s();!(i=o.n()).done;){var a,s=i.value,u=r(this.findTypeDependencies(s.type,t,n));try{for(u.s();!(a=u.n()).done;){var c=a.value;!n.includes(c)&&n.push(c)}}catch(l){u.e(l)}finally{u.f()}}}catch(l){o.e(l)}finally{o.f()}return n},hashStruct:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return o.keccak(this.encodeData(e,t,n,r))},hashType:function(e,t){return o.keccak(this.encodeType(e,t))},sanitizeData:function(e){var t={};for(var n in s.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.sanitizeData(e),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,t)),o.keccak(Buffer.concat(r))}};e.exports={TYPED_MESSAGE_SCHEMA:s,TypedDataUtils:u,hashForSignTypedDataLegacy:function(e){return function(e){var t=new Error("Expect argument to be non-empty array");if("object"!==typeof e||!e.length)throw t;var n=e.map((function(e){return"bytes"===e.type?o.toBuffer(e.value):e.value})),r=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return a.soliditySHA3(["bytes32","bytes32"],[a.soliditySHA3(new Array(e.length).fill("string"),i),a.soliditySHA3(r,n)])}(e.data)},hashForSignTypedData_v3:function(e){return u.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return u.hash(e.data)}}},55313:function(e,t,n){var r=n(98094),i=n(7465);function o(e){return Buffer.allocUnsafe(e).fill(0)}function a(e,t,n){var r=o(t);return e=s(e),n?e.length65536?(i[0]=240|(1835008&o)>>>18,i[1]=128|(258048&o)>>>12,i[2]=128|(4032&o)>>>6,i[3]=128|63&o):o>2048?(i[0]=224|(61440&o)>>>12,i[1]=128|(4032&o)>>>6,i[2]=128|63&o):o>128?(i[0]=192|(1984&o)>>>6,i[1]=128|63&o):i[0]=o,this.parsedData.push(i)}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 n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}t.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=m.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var i=0;i>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=m.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var u=!1;o>>i&1)),m.getMask(t,r,a-s)&&(u=!u),this.modules[r][a-s]=u,-1==--i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,r){for(var i=w.getRSBlocks(e,t),o=new x,a=0;a8*u)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+8*u+")");for(o.getLengthInBits()+4<=8*u&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*u)&&(o.put(n.PAD0,8),!(o.getLengthInBits()>=8*u));)o.put(n.PAD1,8);return n.createBytes(o,i)},n.createBytes=function(e,t){for(var n=0,r=0,i=0,o=new Array(t.length),a=new Array(t.length),s=0;s=0?d.get(p):0}}var h=0;for(l=0;l=0;)t^=m.G15<=0;)t^=m.G18<>>=1;return t},getPatternPosition:function(e){return m.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case u:return(t+n)%2==0;case c:return t%2==0;case l:return n%3==0;case f:return(t+n)%3==0;case d:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case p:return t*n%2+t*n%3==0;case h:return(t*n%2+t*n%3)%2==0;case v:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new b([1],0),n=0;n5&&(n+=3+o-5)}for(r=0;r=256;)e-=255;return g.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},y=0;y<8;y++)g.EXP_TABLE[y]=1<>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-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 k=[[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){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 t in e)this.options[t]=e[t];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 r=this.options.content,u=function(e,t){for(var n=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),r=1,i=0,o=0,a=k.length;o<=a;o++){var s=k[o];if(!s)throw new Error("Content too long: expected "+i+" but got "+n);switch(t){case"L":i=s[0];break;case"M":i=s[1];break;case"Q":i=s[2];break;case"H":i=s[3];break;default:throw new Error("Unknwon error correction level: "+t)}if(n<=i)break;r++}if(r>k.length)throw new Error("Content too long");return r}(r,this.options.ecl),c=function(e){switch(e){case"L":return i;case"M":return o;case"Q":return a;case"H":return s;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new n(u,c),this.qrcode.addData(r),this.qrcode.make()}_.prototype.svg=function(e){var t=this.options||{},n=this.qrcode.modules;"undefined"==typeof e&&(e={container:t.container||"svg"});for(var r="undefined"==typeof t.pretty||!!t.pretty,i=r?" ":"",o=r?"\r\n":"",a=t.width,s=t.height,u=n.length,c=a/(u+2*t.padding),l=s/(u+2*t.padding),f="undefined"!=typeof t.join&&!!t.join,d="undefined"!=typeof t.swap&&!!t.swap,p="undefined"==typeof t.xmlDeclaration||!!t.xmlDeclaration,h="undefined"!=typeof t.predefined&&!!t.predefined,v=h?i+''+o:"",m=i+''+o,g="",y="",b=0;b'+o:i+''+o}}f&&(g=i+'');var S="";if(void 0!==this.options.image&&this.options.image.svg){var O=a*this.options.image.width/100,T=s*this.options.image.height/100,P=s/2-T/2;S+='"}var C="";switch(e.container){case"svg":p&&(C+=''+o),C+='";break;case"svg-viewbox":p&&(C+=''+o),C+='";break;case"g":C+=''+o,C+=v+m+g,C+=S,C+="";break;default:C+=(v+m+g+S).replace(/^\s+/,"")}return C},e.exports=_},27865:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0,t.LIB_VERSION="3.7.1"},7465:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(12769).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(T){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(a=(i=0|e.words[h])*(o=0|t.words[p])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,x=b>>>13,k=0|a[4],_=8191&k,E=k>>>13,A=0|a[5],S=8191&A,O=A>>>13,T=0|a[6],P=8191&T,C=T>>>13,I=0|a[7],R=8191&I,j=I>>>13,N=0|a[8],M=8191&N,L=N>>>13,U=0|a[9],D=8191&U,B=U>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(v,Z)|0,o=Math.imul(v,z);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,Z),i=(i=Math.imul(g,z))+Math.imul(y,Z)|0,o=Math.imul(y,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,o=Math.imul(x,z),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0;var be=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,Z),i=(i=Math.imul(_,z))+Math.imul(E,Z)|0,o=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,Z),i=(i=Math.imul(S,z))+Math.imul(O,Z)|0,o=Math.imul(O,z),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((o=o+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,Z),i=(i=Math.imul(P,z))+Math.imul(C,Z)|0,o=Math.imul(C,z),r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0;var ke=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(j,Z)|0,o=Math.imul(j,z),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var _e=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,z))+Math.imul(L,Z)|0,o=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,z))+Math.imul(B,Z)|0,o=Math.imul(B,z),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Q)|0,r=r+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Ae=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(B,q)|0,o=Math.imul(B,V),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(B,G)|0,o=Math.imul(B,Y),r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Oe=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(D,J),i=(i=Math.imul(D,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Te=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,r=r+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Pe=(c+(r=r+Math.imul(_,he)|0)|0)+((8191&(i=(i=i+Math.imul(_,ve)|0)+Math.imul(E,he)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,de)|0;var Ce=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(O,he)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Ie=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,he)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(j,he)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var je=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(L,he)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Ne=(c+(r=Math.imul(D,he))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(B,he)|0))<<13)|0;return c=((o=Math.imul(B,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=ke,u[7]=_e,u[8]=Ee,u[9]=Ae,u[10]=Se,u[11]=Oe,u[12]=Te,u[13]=Pe,u[14]=Ce,u[15]=Ie,u[16]=Re,u[17]=je,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var h=0,v=1;0===(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=a;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},9872:function(e,t,n){"use strict";var r=n(4230),i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=(0,r.Z)((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.Z=o},4230:function(e,t){"use strict";t.Z=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},43473:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Z}});var r=n(4942),i=n(47313),o=n(9872);var a=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;tp)&&(B=(z=z.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],0=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},v=n(62017),m=n(4230),g=/[A-Z]|^ms/g,y=/_EMO_([^_]+?)_([^]*?)_EMO_/g,b=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!==typeof e},x=(0,m.Z)((function(e){return b(e)?e:e.replace(g,"-$&").toLowerCase()})),k=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(y,(function(e,t,n){return E={name:t,styles:n,next:E},t}))}return 1===v.Z[e]||b(e)||"number"!==typeof t||0===t?t:t+"px"};function _(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return E={name:n.name,styles:n.styles,next:E},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)E={name:i.name,styles:i.styles,next:E},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i96?N:M};function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var D=function(){return null},B=function e(t,n){var o,a,s;void 0!==n&&(o=n.label,s=n.target,a=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var u=t.__emotion_real===t,c=u&&t.__emotion_base||t;"function"!==typeof a&&u&&(a=t.__emotion_forwardProp);var l=a||L(c),f=!l("as");return function(){var d=arguments,p=u&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)p.push.apply(p,d);else{0,p.push(d[0][0]);for(var h=d.length,v=1;v=0)throw e;return d.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",l.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:n})}))),null==n.chainId?n.chainId=this.getChainId():n.chainId=Promise.all([Promise.resolve(n.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&d.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,(0,c.mE)(n);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||d.throwError("missing provider",l.Yd.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),m=function(e){(0,i.Z)(n,e);var t=(0,o.Z)(n);function n(e,i){var o;return(0,s.Z)(this,n),o=t.call(this),(0,c.zG)((0,r.Z)(o),"address",e),(0,c.zG)((0,r.Z)(o),"provider",i||null),o}return(0,u.Z)(n,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){d.throwError(e,l.Yd.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new n(this.address,e)}}]),n}(v)},28552:function(e,t,n){"use strict";n.r(t),n.d(t,{getAddress:function(){return v},getContractAddress:function(){return y},getCreate2Address:function(){return b},getIcapAddress:function(){return g},isAddress:function(){return m}});var r=n(52009),i=n(19560),o=n(11291),a=n(80807),s=new(n(2735).Yd)("address/5.7.0");function u(e){(0,r.A7)(e,20)||s.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40),i=0;i<40;i++)n[i]=t[i].charCodeAt(0);for(var a=(0,r.lE)((0,o.w)(n)),u=0;u<40;u+=2)a[u>>1]>>4>=8&&(t[u]=t[u].toUpperCase()),(15&a[u>>1])>=8&&(t[u+1]=t[u+1].toUpperCase());return"0x"+t.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(var f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);var d,p=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return c[e]})).join("");t.length>=p;){var n=t.substring(0,p);t=parseInt(n,10)%97+t.substring(n.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function v(e){var t=null;if("string"!==typeof e&&s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&s.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&s.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=u("0x"+t)}else s.throwArgumentError("invalid address","address",e);return t}function m(e){try{return v(e),!0}catch(t){}return!1}function g(e){for(var t=(0,i.t2)(v(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+h("XE00"+t)+t}function y(e){var t=null;try{t=v(e.from)}catch(u){s.throwArgumentError("missing from address","transaction",e)}var n=(0,r.G1)((0,r.lE)(i.O$.from(e.nonce).toHexString()));return v((0,r.p3)((0,o.w)((0,a.c)([t,n])),12))}function b(e,t,n){return 32!==(0,r.E1)(t)&&s.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,r.E1)(n)&&s.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),v((0,r.p3)((0,o.w)((0,r.zo)(["0xff",v(e),t,n])),12))}},44227:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});var r="bignumber/5.7.0"},19560:function(e,t,n){"use strict";n.d(t,{O$:function(){return m},Zm:function(){return h},g$:function(){return x},t2:function(){return k}});var r=n(15671),i=n(43144),o=n(48725),a=n.n(o),s=n(52009),u=n(2735),c=n(44227),l=a().BN,f=new u.Yd(c.i),d={},p=9007199254740991;function h(e){return null!=e&&(m.isBigNumber(e)||"number"===typeof e&&e%1===0||"string"===typeof e&&!!e.match(/^-?[0-9]+$/)||(0,s.A7)(e)||"bigint"===typeof e||(0,s._t)(e))}var v=!1,m=function(){function e(t,n){(0,r.Z)(this,e),t!==d&&f.throwError("cannot call constructor directly; use BigNumber.from",u.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=n,this._isBigNumber=!0,Object.freeze(this)}return(0,i.Z)(e,[{key:"fromTwos",value:function(e){return y(b(this).fromTwos(e))}},{key:"toTwos",value:function(e){return y(b(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return y(b(this).add(b(e)))}},{key:"sub",value:function(e){return y(b(this).sub(b(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&w("division-by-zero","div"),y(b(this).div(b(t)))}},{key:"mul",value:function(e){return y(b(this).mul(b(e)))}},{key:"mod",value:function(e){var t=b(e);return t.isNeg()&&w("division-by-zero","mod"),y(b(this).umod(t))}},{key:"pow",value:function(e){var t=b(e);return t.isNeg()&&w("negative-power","pow"),y(b(this).pow(t))}},{key:"and",value:function(e){var t=b(e);return(this.isNegative()||t.isNeg())&&w("unbound-bitwise-result","and"),y(b(this).and(t))}},{key:"or",value:function(e){var t=b(e);return(this.isNegative()||t.isNeg())&&w("unbound-bitwise-result","or"),y(b(this).or(t))}},{key:"xor",value:function(e){var t=b(e);return(this.isNegative()||t.isNeg())&&w("unbound-bitwise-result","xor"),y(b(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&w("negative-width","mask"),y(b(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&w("negative-width","shl"),y(b(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&w("negative-width","shr"),y(b(this).shrn(e))}},{key:"eq",value:function(e){return b(this).eq(b(e))}},{key:"lt",value:function(e){return b(this).lt(b(e))}},{key:"lte",value:function(e){return b(this).lte(b(e))}},{key:"gt",value:function(e){return b(this).gt(b(e))}},{key:"gte",value:function(e){return b(this).gte(b(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return b(this).isZero()}},{key:"toNumber",value:function(){try{return b(this).toNumber()}catch(e){w("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return f.throwError("this platform does not support BigInt",u.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?v||(v=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.Yd.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",u.Yd.errors.UNEXPECTED_ARGUMENT,{})),b(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(d,g(t)):t.match(/^-?[0-9]+$/)?new e(d,g(new l(t))):f.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=p||t<=-p)&&w("overflow","BigNumber.from",t),e.from(String(t));var n=t;if("bigint"===typeof n)return e.from(n.toString());if((0,s._t)(n))return e.from((0,s.Dv)(n));if(n)if(n.toHexString){var r=n.toHexString();if("string"===typeof r)return e.from(r)}else{var i=n._hex;if(null==i&&"BigNumber"===n.type&&(i=n.hex),"string"===typeof i&&((0,s.A7)(i)||"-"===i[0]&&(0,s.A7)(i.substring(1))))return e.from(i)}return f.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function g(e){if("string"!==typeof e)return g(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&f.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function y(e){return m.from(g(e))}function b(e){var t=m.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function w(e,t,n){var r={fault:e,operation:t};return null!=n&&(r.value=n),f.throwError(e,u.Yd.errors.NUMERIC_FAULT,r)}function x(e){return new l(e,36).toString(16)}function k(e){return new l(e,16).toString(36)}},48725:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(88677).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(T){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(a=(i=0|e.words[h])*(o=0|t.words[p])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,x=b>>>13,k=0|a[4],_=8191&k,E=k>>>13,A=0|a[5],S=8191&A,O=A>>>13,T=0|a[6],P=8191&T,C=T>>>13,I=0|a[7],R=8191&I,j=I>>>13,N=0|a[8],M=8191&N,L=N>>>13,U=0|a[9],D=8191&U,B=U>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(v,Z)|0,o=Math.imul(v,z);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,Z),i=(i=Math.imul(g,z))+Math.imul(y,Z)|0,o=Math.imul(y,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,o=Math.imul(x,z),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0;var be=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,Z),i=(i=Math.imul(_,z))+Math.imul(E,Z)|0,o=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,Z),i=(i=Math.imul(S,z))+Math.imul(O,Z)|0,o=Math.imul(O,z),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((o=o+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,Z),i=(i=Math.imul(P,z))+Math.imul(C,Z)|0,o=Math.imul(C,z),r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0;var ke=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(j,Z)|0,o=Math.imul(j,z),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var _e=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,z))+Math.imul(L,Z)|0,o=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,z))+Math.imul(B,Z)|0,o=Math.imul(B,z),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Q)|0,r=r+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Ae=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(B,q)|0,o=Math.imul(B,V),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(B,G)|0,o=Math.imul(B,Y),r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Oe=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(D,J),i=(i=Math.imul(D,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Te=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,r=r+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Pe=(c+(r=r+Math.imul(_,he)|0)|0)+((8191&(i=(i=i+Math.imul(_,ve)|0)+Math.imul(E,he)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,de)|0;var Ce=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(O,he)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Ie=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,he)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(j,he)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var je=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(L,he)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Ne=(c+(r=Math.imul(D,he))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(B,he)|0))<<13)|0;return c=((o=Math.imul(B,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=ke,u[7]=_e,u[8]=Ee,u[9]=Ae,u[10]=Se,u[11]=Oe,u[12]=Te,u[13]=Pe,u[14]=Ce,u[15]=Ie,u[16]=Re,u[17]=je,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var h=0,v=1;0===(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=a;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},52009:function(e,t,n){"use strict";n.d(t,{lE:function(){return c},zo:function(){return l},xs:function(){return y},E1:function(){return m},p3:function(){return g},$P:function(){return b},$m:function(){return w},Dv:function(){return v},_t:function(){return u},Zq:function(){return a},A7:function(){return p},N:function(){return x},G1:function(){return f},Bu:function(){return d}});var r=new(n(2735).Yd)("bytes/5.7.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return p(e)&&!(e.length%2)||u(e)}function s(e){return"number"===typeof e&&e==e&&e%1===0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");for(var n=[];e;)n.unshift(255&e),e=parseInt(String(e/256));return 0===n.length&&n.push(0),o(new Uint8Array(n))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),p(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":r.throwArgumentError("hex data is odd-length","value",e));for(var s=[],c=0;ct&&r.throwArgumentError("value out of range","value",arguments[0]);var n=new Uint8Array(t);return n.set(e,t-e.length),o(n)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var h="0123456789abcdef";function v(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");for(var n="";e;)n=h[15&e]+n,e=Math.floor(e/16);return n.length?(n.length%2&&(n="0"+n),"0x"+n):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){for(var o="0x",a=0;a>4]+h[15&s]}return o}return r.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!==typeof e)e=v(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,n){return"string"!==typeof e?e=v(e):(!p(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function y(e){var t="0x";return e.forEach((function(e){t+=v(e).substring(2)})),t}function b(e){var t=function(e){"string"!==typeof e&&(e=v(e));p(e)||r.throwArgumentError("invalid hex string","value",e);e=e.substring(2);var t=0;for(;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function x(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){var n=c(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=v(n.slice(0,32)),t.s=v(n.slice(32,64))):65===n.length?(t.r=v(n.slice(0,32)),t.s=v(n.slice(32,64)),t.v=n[64]):r.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=v(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=d(c(t._vs),32);t._vs=v(i);var o=i[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;var s=v(i);null==t.s?t.s=s:t.s!==s&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=w(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=w(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);var l=c(t.s);l[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);var f=v(l);t._vs&&(p(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}},81895:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r="0x0000000000000000000000000000000000000000"},6321:function(e,t,n){"use strict";n.d(t,{Bz:function(){return s},_Y:function(){return o},fh:function(){return a},tL:function(){return i}});var r=n(19560),i=r.O$.from(-1),o=r.O$.from(0),a=r.O$.from(1),s=r.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},93358:function(e,t,n){"use strict";n.d(t,{id:function(){return o}});var r=n(11291),i=n(91953);function o(e){return(0,r.w)((0,i.Y0)(e))}},11291:function(e,t,n){"use strict";n.d(t,{w:function(){return a}});var r=n(37676),i=n.n(r),o=n(52009);function a(e){return"0x"+i().keccak_256((0,o.lE)(e))}},2735:function(e,t,n){"use strict";n.d(t,{Yd:function(){return h}});var r=n(15671),i=n(43144),o=!1,a=!1,s={debug:1,default:2,info:2,warning:3,error:4,off:5},u=s.default,c=null;var l,f,d=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(l||(l={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));var p="0123456789abcdef",h=function(){function e(t){(0,r.Z)(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}return(0,i.Z)(e,[{key:"_log",value:function(e,t){var n=e.toLowerCase();null==s[n]&&this.throwArgumentError("invalid log level name","logLevel",e),u>s[n]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r>4],n+=p[15&t[o]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(c){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push("code=".concat(n)),i.push("version=".concat(this.version));var o=t,s="";switch(n){case f.NUMERIC_FAULT:s="NUMERIC_FAULT";var u=t;switch(u){case"overflow":case"underflow":case"division-by-zero":s+="-"+u;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break;case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:s=n}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");var c=new Error(t);return c.reason=o,c.code=n,Object.keys(r).forEach((function(e){c[e]=r[e]})),c}},{key:"throwError",value:function(e,t,n){throw this.makeError(e,t,n)}},{key:"throwArgumentError",value:function(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}},{key:"assert",value:function(e,t,n,r){e||this.throwError(t,n,r)}},{key:"assertArgument",value:function(e,t,n,r){e||this.throwArgumentError(t,n,r)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),d&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:d})}},{key:"checkSafeUint53",value:function(t,n){"number"===typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,n,r){r=r?": "+r:"",tn&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}},{key:"checkNew",value:function(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}},{key:"checkAbstract",value:function(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}}],[{key:"globalLogger",value:function(){return c||(c=new e("logger/5.7.0")),c}},{key:"setCensorship",value:function(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!t,o=!!n}},{key:"setLogLevel",value:function(t){var n=s[t.toLowerCase()];null!=n?u=n:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();h.errors=f,h.levels=l},54812:function(e,t,n){"use strict";n.d(t,{dk:function(){return y},uj:function(){return d},p$:function(){return g},zG:function(){return c},tu:function(){return l},mE:function(){return f},DC:function(){return p}});var r=n(43144),i=n(15671),o=n(74165),a=n(2735),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},u=new a.Yd("properties/5.7.0");function c(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function l(e,t){for(var n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function f(e){return s(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object.keys(e).map((function(t){var n=e[t];return Promise.resolve(n).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(n);case 3:return r=t.sent,t.abrupt("return",r.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function d(e,t){e&&"object"===typeof e||u.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(n){t[n]||u.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function p(e){var t={};for(var n in e)t[n]=e[n];return t}var h={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function v(e){if(void 0===e||null===e||h[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),n=0;n0;)n.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s=0;--u)a+=this.alphabet[n[u]];return a}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a0&&Array.isArray(t)?e(t,i-1):n.push(t)}))}(e,t),n}function R(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function n(){return e[t++]<<8|e[t++]}for(var r=n(),i=1,o=[0,1],a=1;a>--c&1}for(var d=Math.pow(2,31),p=d>>>1,h=p>>1,v=d-1,m=0,g=0;g<31;g++)m=m<<1|f();for(var y=[],b=0,w=d;;){for(var x=Math.floor(((m-b+1)*i-1)/w),k=0,_=r;_-k>1;){var E=k+_>>>1;x>>1|f(),A=A<<1^p,S=(S^p)<<1|p|1;b=A,w=1+S-A}var O=r-4;return y.map((function(t){switch(t-O){case 3:return O+65792+(e[u++]<<16|e[u++]<<8|e[u++]);case 2:return O+256+(e[u++]<<8|e[u++]);case 1:return O+e[u++];default:return t-1}}))}(e))}function j(e){return 1&e?~e>>1:e>>1}function N(e,t){for(var n=Array(e),r=0,i=-1;r>=1),check:2==o}}()}(F),V=45,W=95;function G(e){return(0,S.XL)(e)}function Y(e){return e.filter((function(e){return 65039!=e}))}function K(e){var t,n=(0,C.Z)(e.split("."));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=G(r);try{for(var o=i.lastIndexOf(W)-1;o>=0;o--)if(i[o]!==W)throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&i[2]===V&&i[3]===V)throw new Error("invalid label extension")}catch(a){throw new Error('Invalid label "'.concat(r,'": ').concat(a.message))}}}catch(a){n.e(a)}finally{n.f()}return e}function J(e){return K(function(e,t){var n=G(e).reverse(),r=[];for(;n.length;){var i=Q(n);if(i)r.push.apply(r,(0,P.Z)(t(i)));else{var o=n.pop();if(Z.has(o))r.push(o);else if(!z.has(o)){var a=H[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));r.push.apply(r,(0,P.Z)(a))}}}return K((s=String.fromCodePoint.apply(String,r),s.normalize("NFC")));var s}(e,Y))}function Q(e,t){var n,r,i,o=q,a=[],s=e.length;t&&(t.length=0);for(var u=function(){var u=e[--s];if(!(o=null===(n=o.branches.find((function(e){return e.set.has(u)})))||void 0===n?void 0:n.node))return"break";if(o.save)i=u;else if(o.check&&u===i)return"break";a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(r=a.slice(),2==o.valid&&r.splice(1,1),t&&t.push.apply(t,(0,P.Z)(e.slice(s).reverse())),e.length=s)};s;){if("break"===u())break}return r}var X=new i.Yd(T),$=new Uint8Array(32);function ee(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function te(e){var t=(0,S.Y0)(J(e)),n=[];if(0===e.length)return n;for(var r=0,i=0;i=t.length)throw new Error("invalid ENS name; empty component");return n.push(ee(t.slice(r))),n}function ne(e){"string"!==typeof e&&X.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=$,n=te(e);n.length;)t=(0,O.w)((0,b.zo)([t,(0,O.w)(n.pop())]));return(0,b.Dv)(t)}$.fill(0);var re=n(37553),ie=n.n(re);new i.Yd("sha2/5.7.0");function oe(e){return"0x"+ie().sha256().update((0,b.lE)(e)).digest("hex")}var ae=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function se(e,t){return ae(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,i,o,a,s;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t={}),r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions&&((i=t.fetchOptions).mode&&(r.mode=i.mode),i.cache&&(r.cache=i.cache),i.credentials&&(r.credentials=i.credentials),i.redirect&&(r.redirect=i.redirect),i.referrer&&(r.referrer=i.referrer)),n.next=7,fetch(e,r);case 7:return o=n.sent,n.next=10,o.arrayBuffer();case 10:return a=n.sent,s={},o.headers.forEach?o.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):o.headers.keys().forEach((function(e){s[e.toLowerCase()]=o.headers.get(e)})),n.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:(0,b.lE)(new Uint8Array(a))});case 14:case"end":return n.stop()}}),n)})))}var ue=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ce=new i.Yd("web/5.7.1");function le(e){return new Promise((function(t){setTimeout(t,e)}))}function fe(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,b.Zq)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,S.ZN)(e)}catch(n){}return(0,b.Dv)(e)}return e}function de(e,t,n){var r=null;if(null!=t){r=(0,S.Y0)(t);var o="string"===typeof e?{url:e}:(0,k.DC)(e);if(o.headers)0!==Object.keys(o.headers).filter((function(e){return"content-type"===e.toLowerCase()})).length||(o.headers=(0,k.DC)(o.headers),o.headers["content-type"]="application/json");else o.headers={"content-type":"application/json"};e=o}return function(e,t,n){var r="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;ce.assertArgument(r>0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);var o="object"===typeof e?e.throttleCallback:null,a="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;ce.assertArgument(a>0&&a%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);var s="object"===typeof e&&!!e.errorPassThrough,u={},c=null,l={method:"GET"},f=!1,d=12e4;if("string"===typeof e)c=e;else if("object"===typeof e){if(null!=e&&null!=e.url||ce.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"===typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(var p in e.headers)u[p.toLowerCase()]={key:p,value:String(e.headers[p])},["if-none-match","if-modified-since"].indexOf(p.toLowerCase())>=0&&(f=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&ce.throwError("basic authentication requires a secure https url",i.Yd.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});var h=e.user+":"+e.password;u.authorization={key:"Authorization",value:"Basic "+x((0,S.Y0)(h))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=(0,k.DC)(e.fetchOptions))}var v,g=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=c?c.match(g):null;if(y)try{var b={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?w(y[3]):(v=y[3],(0,S.Y0)(v.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},_=b.body;return n&&(_=n(b.body,b)),Promise.resolve(_)}catch(T){ce.throwError("processing response error",i.Yd.errors.SERVER_ERROR,{body:fe(y[1],y[2]),error:T,requestBody:null,requestMethod:"GET",url:c})}t&&(l.method="POST",l.body=t,null==u["content-type"]&&(u["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==u["content-length"]&&(u["content-length"]={key:"Content-Length",value:String(t.length)}));var E={};Object.keys(u).forEach((function(e){var t=u[e];E[t.key]=t.value})),l.headers=E;var A=function(){var e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((function(){null!=e&&(e=null,n(ce.makeError("timeout",i.Yd.errors.TIMEOUT,{requestBody:fe(l.body,E["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),O=function(){return ue(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,u,d,p,h,v,g,y,b,w;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(A.cancel(),ce.throwError("bad response",i.Yd.errors.SERVER_ERROR,{status:u.statusCode,headers:u.headers,body:fe(g,u.headers?u.headers["content-type"]:null),requestBody:fe(l.body,E["content-type"]),requestMethod:l.method,url:c})),!n){e.next=60;break}return e.prev=37,e.next=40,n(g,u);case 40:return y=e.sent,A.cancel(),e.abrupt("return",y);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(a()&&r(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&r(e)}))}()}))}var he=n(65109),ve=n.n(he),me="providers/5.7.2",ge=n(28552),ye=n(81895),be=n(14046),we=new i.Yd(me),xe=function(){function e(){(0,g.Z)(this,e),this.formats=this.getDefaultFormats()}return(0,y.Z)(e,[{key:"getDefaultFormats",value:function(){var t=this,n={},r=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),u=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this);return n.transaction={hash:s,type:l,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:r,gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),gasLimit:i,to:e.allowNull(r,null),value:i,nonce:c,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(r,null),raw:e.allowNull(a)},n.transactionRequest={from:e.allowNull(r),nonce:e.allowNull(c),gasLimit:e.allowNull(i),gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),to:e.allowNull(r),value:e.allowNull(i),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},n.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:r,topics:e.arrayOf(s),data:a,logIndex:c,blockHash:s},n.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(r,null),transactionIndex:c,root:e.allowNull(u),gasUsed:i,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:e.allowNull(i),status:e.allowNull(c),type:l},n.block={hash:e.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:e.allowNull(u),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:e.allowNull(r),extraData:a,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(i)},n.blockWithTransactions=(0,k.DC)(n.block),n.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),n.filter={fromBlock:e.allowNull(o,void 0),toBlock:e.allowNull(o,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(r,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},n.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:r,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},n}},{key:"accessList",value:function(e){return(0,be.z7)(e||[])}},{key:"number",value:function(e){return"0x"===e?0:A.O$.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:A.O$.from(e).toNumber()}},{key:"bigNumber",value:function(e){return A.O$.from(e)}},{key:"boolean",value:function(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,b.A7)(e))?e.toLowerCase():we.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var n=this.hex(e,t);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}},{key:"address",value:function(e){return(0,ge.getAddress)(e)}},{key:"callAddress",value:function(e){if(!(0,b.A7)(e,32))return null;var t=(0,ge.getAddress)((0,b.p3)(e,12));return t===ye.d?null:t}},{key:"contractAddress",value:function(e){return(0,ge.getContractAddress)(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,b.A7)(e))return(0,b.$P)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var n=this.hex(e,t);return 32!==(0,b.E1)(n)?we.throwArgumentError("invalid hash","value",e):n}},{key:"difficulty",value:function(e){if(null==e)return null;var t=A.O$.from(e);try{return t.toNumber()}catch(n){}return null}},{key:"uint256",value:function(e){if(!(0,b.A7)(e))throw new Error("invalid uint256");return(0,b.$m)(e,32)}},{key:"_block",value:function(t,n){null!=t.author&&null==t.miner&&(t.miner=t.author);var r=null!=t._difficulty?t._difficulty:t.difficulty,i=e.check(n,t);return i._difficulty=null==r?null:A.O$.from(r),i}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&A.O$.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var n=e.check(this.formats.transaction,t);if(null!=t.chainId){var r=t.chainId;(0,b.A7)(r)&&(r=A.O$.from(r).toNumber()),n.chainId=r}else{var i=t.networkId;null==i&&null==n.v&&(i=t.chainId),(0,b.A7)(i)&&(i=A.O$.from(i).toNumber()),"number"!==typeof i&&null!=n.v&&((i=(n.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!==typeof i&&(i=0),n.chainId=i}return n.blockHash&&"x"===n.blockHash.replace(/0/g,"")&&(n.blockHash=null),n}},{key:"transaction",value:function(e){return(0,be.Qc)(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var n=e.check(this.formats.receipt,t);if(null!=n.root)if(n.root.length<=4){var r=A.O$.from(n.root).toNumber();0===r||1===r?(null!=n.status&&n.status!==r&&we.throwArgumentError("alt-root-status/status mismatch","value",{root:n.root,status:n.status}),n.status=r,delete n.root):we.throwArgumentError("invalid alt-root-status","value.root",n.root)}else 66!==n.root.length&&we.throwArgumentError("invalid root hash","value.root",n.root);return null!=n.status&&(n.byzantium=!0),n}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}],[{key:"check",value:function(e,t){var n={};for(var r in e)try{var i=e[r](t[r]);void 0!==i&&(n[r]=i)}catch(o){throw o.checkKey=r,o.checkValue=t[r],o}return n}},{key:"allowNull",value:function(e,t){return function(n){return null==n?t:e(n)}}},{key:"allowFalsish",value:function(e,t){return function(n){return n?e(n):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var n=[];return t.forEach((function(t){n.push(e(t))})),n}}}]),e}();function ke(e){return e&&"function"===typeof e.isCommunityResource}function _e(e){return ke(e)&&e.isCommunityResource()}var Ee=!1;function Ae(){Ee||(Ee=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Se=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Oe=new i.Yd(me);function Te(e){return null==e?"null":(32!==(0,b.E1)(e)&&Oe.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Pe(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[Te(e)]=!0}));var n=Object.keys(t);return n.sort(),n.join("|")}return Te(e)})).join("&")}function Ce(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,b.E1)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Pe(e);if(r.Sg.isForkEvent(e))throw Oe.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+Pe(e.topics||[])}throw new Error("invalid event - "+e)}function Ie(){return(new Date).getTime()}function Re(e){return new Promise((function(t){setTimeout(t,e)}))}var je=["block","network","pending","poll"],Ne=function(){function e(t,n,r){(0,g.Z)(this,e),(0,k.zG)(this,"tag",t),(0,k.zG)(this,"listener",n),(0,k.zG)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}return(0,y.Z)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,n=e[1],r=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return r.length>0&&(i.topics=r),n&&"*"!==n&&(i.address=n),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||je.indexOf(this.tag)>=0}}]),e}(),Me={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Le(e){return(0,b.$m)(A.O$.from(e).toHexString(),32)}function Ue(e){return E.encode((0,b.zo)([e,(0,b.p3)(oe(oe(e)),0,4)]))}var De=new RegExp("^(ipfs)://(.*)$","i"),Be=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),De,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Fe(e,t){try{return(0,S.ZN)(Ze(e,t))}catch(n){}return null}function Ze(e,t){if("0x"===e)return null;var n=A.O$.from((0,b.p3)(e,t,t+32)).toNumber(),r=A.O$.from((0,b.p3)(e,n,n+32)).toNumber();return(0,b.p3)(e,n+32,n+32+r)}function ze(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Oe.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function He(e){var t=(0,b.lE)(e);if(t.length>32)throw new Error("internal; should not happen");var n=new Uint8Array(32);return n.set(t,32-t.length),n}function qe(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ve(e){for(var t=[],n=0,r=0;r63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]);case 7:return n.prev=7,n.next=10,this.provider.call(r);case 10:return a=n.sent,(0,b.lE)(a).length%32===4&&Oe.throwError("resolver threw error",i.Yd.errors.CALL_EXCEPTION,{transaction:r,data:a}),o&&(a=Ze(a,0)),n.abrupt("return",a);case 16:if(n.prev=16,n.t0=n.catch(7),n.t0.code!==i.Yd.errors.CALL_EXCEPTION){n.next=20;break}return n.abrupt("return",null);case 20:throw n.t0;case 21:case"end":return n.stop()}var s}),n,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this._fetch(e,t);case 2:if(null==(r=n.sent)){n.next=5;break}return n.abrupt("return",Ze(r,0));case 5:return n.abrupt("return",null);case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_getAddress",value:function(e,t){var n=Me[String(e)];if(null==n&&Oe.throwError("unsupported coin type: ".concat(e),i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===n.ilk)return this.provider.formatter.address(t);var r=(0,b.lE)(t);if(null!=n.p2pkh){var o=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){var a=parseInt(o[1],16);if(o[2].length===2*a&&a>=1&&a<=75)return Ue((0,b.zo)([[n.p2pkh],"0x"+o[2]]))}}if(null!=n.p2sh){var s=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){var u=parseInt(s[1],16);if(s[2].length===2*u&&u>=1&&u<=75)return Ue((0,b.zo)([[n.p2sh],"0x"+s[2]]))}}if(null!=n.prefix){var c=r[1],l=r[0];if(0===l?20!==c&&32!==c&&(l=-1):l=-1,l>=0&&r.length===2+c&&c>=1&&c<=75){var f=ve().toWords(r.slice(2));return f.unshift(l),ve().encode(n.prefix,f)}}return null}},{key:"getAddress",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,o;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(n=t.sent)&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(n));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==i.Yd.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",Le(e));case 18:if(null!=(r=t.sent)&&"0x"!==r){t.next=21;break}return t.abrupt("return",null);case 21:return null==(o=this._getAddress(e,r))&&Oe.throwError("invalid or unsupported coin data",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:r}),t.abrupt("return",o);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,n,r,i,o,a,s,u,c,l,f,d,p,h,v,g;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(n=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:r=0;case 8:if(!(r=0?null:JSON.stringify({data:a,sender:o}),r.next=12,de({url:l,errorPassThrough:!0},f,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(d=r.sent).data){r.next=15;break}return r.abrupt("return",d.data);case 15:if(p=d.message||"unknown error",!(d.status>=400&&d.status<500)){r.next=18;break}return r.abrupt("return",Oe.throwError("response not found during CCIP fetch: ".concat(p),i.Yd.errors.SERVER_ERROR,{url:c,errorMessage:p}));case 18:s.push(p);case 19:u++,r.next=6;break;case 22:return r.abrupt("return",Oe.throwError("error encountered during CCIP fetch: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),i.Yd.errors.SERVER_ERROR,{urls:n,errorMessages:s}));case 23:case"end":return r.stop()}}),r,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i,o,a=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return n=this._internalBlockNumber,t.prev=5,t.next=8,n;case 8:if(r=t.sent,!(Ie()-r.respTime<=e)){t.next=11;break}return t.abrupt("return",r.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==n){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=Ie(),o=(0,k.mE)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,n=e.networkError;if(n)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),n;var r=Ie();return(t=A.O$.from(t).toNumber())1e3)Oe.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",Oe.makeError("network block skew detected",i.Yd.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(o=this._emitted.block+1;o<=r;o++)this.emit("block",o);return this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=a._emitted[e];"pending"!==t&&r-t>12&&delete a._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=a.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(a._emitted["t:"+t]=e.blockNumber,a.emit(t,e),null):null})).catch((function(e){a.emit("error",e)}));n.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);var o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=r;var s=o.toBlock-a._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);var u=a.getLogs(o).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),a._emitted["b:"+t.blockHash]=t.blockNumber,a._emitted["t:"+t.transactionHash]=t.blockNumber,a.emit(o,t)}))})).catch((function(t){a.emit("error",t),e._inflight=!1}));n.push(u)}}})),this._lastBlockNumber=r,Promise.all(n).then((function(){a.emit("didPoll",t)})).catch((function(e){a.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Oe.throwError("provider does not support network detection",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,n,r;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(n=e.sent,t.chainId===n.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=n,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",n,t),e.next=19,Re(0);case 19:return e.abrupt("return",this._network);case 20:throw r=Oe.makeError("underlying network changed",i.Yd.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:n}),this.emit("error",r),r;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=Ie();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&ðis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,n){return Se(this,void 0,void 0,(0,m.Z)().mark((function r(){return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._waitForTransaction(e,null==t?1:t,n||0,null));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"_waitForTransaction",value:function(e,t,n,r){return Se(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,s=this;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getTransactionReceipt(e);case 2:if(!(((a=o.sent)?a.confirmations:0)>=t)){o.next=5;break}return o.abrupt("return",a);case 5:return o.abrupt("return",new Promise((function(o,a){var u=[],c=!1,l=function(){return!!c||(c=!0,u.forEach((function(e){e()})),!1)},f=function(e){e.confirmations0){var v=setTimeout((function(){l()||a(Oe.makeError("timeout exceeded",i.Yd.errors.TIMEOUT,{timeout:n}))}),n);v.unref&&v.unref(),u.push((function(){clearTimeout(v)}))}})));case 6:case"end":return o.stop()}}),o,this)})))}},{key:"getBlockNumber",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",A.O$.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getBalance",r);case 7:return o=n.sent,n.prev=8,n.abrupt("return",A.O$.from(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getBalance",params:r,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getTransactionCount",r);case 7:return o=n.sent,n.prev=8,n.abrupt("return",A.O$.from(o).toNumber());case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getCode",r);case 7:return o=n.sent,n.prev=8,n.abrupt("return",(0,b.Dv)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getCode",params:r,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,n){return Se(this,void 0,void 0,(0,m.Z)().mark((function r(){var o,a;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((function(e){return(0,b.$P)(e)}))});case 4:return o=r.sent,r.next=7,this.perform("getStorageAt",o);case 7:return a=r.sent,r.prev=8,r.abrupt("return",(0,b.Dv)(a));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getStorageAt",params:o,result:a,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,n){var r=this;if(null!=t&&32!==(0,b.E1)(t))throw new Error("invalid response - sendTransaction");var o=e;return null!=t&&e.hash!==t&&Oe.throwError("Transaction hash mismatch from Provider.sendTransaction.",i.Yd.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),o.wait=function(t,o){return Se(r,void 0,void 0,(0,m.Z)().mark((function r(){var a,s;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t=1),null==o&&(o=0),a=void 0,0!==t&&null!=n&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n}),r.next=6,this._waitForTransaction(e.hash,t,o,a);case 6:if(null!=(s=r.sent)||0!==t){r.next=9;break}return r.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&Oe.throwError("transaction failed",i.Yd.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),r.abrupt("return",s);case 12:case"end":return r.stop()}}),r,this)})))},o}},{key:"sendTransaction",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i,o;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return(0,b.Dv)(e)}));case 4:return n=t.sent,null==(r=this.formatter.transaction(e)).confirmations&&(r.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:n});case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(r,o,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=r,t.t0.transactionHash=r.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return n=t.sent,r={},["from","to"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?A.O$.from(e):null})))})),["type"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return null!=e?e:null})))})),n.accessList&&(r.accessList=this.formatter.accessList(n.accessList)),["data"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?(0,b.Dv)(e):null})))})),t.t0=this.formatter,t.next=12,(0,k.mE)(r);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,n={},null!=e.address&&(n.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(n[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(n[t]=r._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,(0,k.mE)(n);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,n){return Se(this,void 0,void 0,(0,m.Z)().mark((function r(){var o,a,s,u,c,l,f,d,p,h,v,g,y,w,x;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n>=10&&Oe.throwError("CCIP read exceeded maximum redirections",i.Yd.errors.SERVER_ERROR,{redirects:n,transaction:e}),o=e.to,r.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(a=r.sent,!(n>=0&&"latest"===t&&null!=o&&"0x556f1830"===a.substring(0,10)&&(0,b.E1)(a)%32===4)){r.next=31;break}for(r.prev=6,s=(0,b.p3)(a,4),u=(0,b.p3)(s,0,32),A.O$.from(u).eq(o)||Oe.throwError("CCIP Read sender did not match",i.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a}),c=[],l=A.O$.from((0,b.p3)(s,32,64)).toNumber(),f=A.O$.from((0,b.p3)(s,l,l+32)).toNumber(),d=(0,b.p3)(s,l+32),p=0;pthis._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}o=null,a=0;case 14:if(!(a0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,n){var r=new Ne(Ce(e),t,n);return this._events.push(r),this._startEvent(r),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i256||t[2]&&t[2]!==String(r))&&nt.throwArgumentError("invalid numeric width","type",e);var i=st.mask(n?r-1:r),o=n?i.add(at).mul(it):ot;return function(t){var n=A.O$.from(t);return(n.lt(o)||n.gt(i))&&nt.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,b.$m)(n.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&nt.throwArgumentError("invalid bytes width","type",e),function(t){return(0,b.lE)(t).length!==s&&nt.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,b.lE)(e),n=t.length%32;return n?(0,b.xs)([t,rt.slice(n)]):(0,b.Dv)(t)}(t)}}switch(e){case"address":return function(e){return(0,b.$m)((0,ge.getAddress)(e),32)};case"bool":return function(e){return e?ut:ct};case"bytes":return function(e){return(0,O.w)(e)};case"string":return function(e){return(0,et.id)(e)}}return null}function vt(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var mt=function(){function e(t){(0,g.Z)(this,e),(0,k.zG)(this,"types",Object.freeze((0,k.p$)(t))),(0,k.zG)(this,"_encoderCache",{}),(0,k.zG)(this,"_types",{});var n={},r={},i={};Object.keys(t).forEach((function(e){n[e]={},r[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&nt.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&nt.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),ht(a)||(r[a]||nt.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),r[a].push(e),n[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(r).filter((function(e){return 0===r[e].length}));for(var u in 0===s.length?nt.throwArgumentError("missing primary type","types",t):s.length>1&&nt.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,k.zG)(this,"primaryType",s[0]),function e(o,a){a[o]&&nt.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(n[o]).forEach((function(t){r[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[u]);c.sort(),this._types[u]=vt(u,t[u])+c.map((function(e){return vt(e,t[e])})).join("")}}return(0,y.Z)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,n=ht(e);if(n)return n;var r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){var i=r[1],o=this.getEncoder(i),a=parseInt(r[3]);return function(e){a>=0&&e.length!==a&&nt.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var n=e.map(o);return t._types[i]&&(n=n.map(O.w)),(0,O.w)((0,b.xs)(n))}}var s=this.types[e];if(s){var u=(0,et.id)(this._types[e]);return function(e){var n=s.map((function(n){var r=n.name,i=n.type,o=t.getEncoder(i)(e[r]);return t._types[i]?(0,O.w)(o):o}));return n.unshift(u),(0,b.xs)(n)}}return nt.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||nt.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return(0,O.w)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,n){var r=this;if(ht(e))return n(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&nt.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return r._visit(o,e,n)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=r._visit(a,t[o],n),e}),{}):nt.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,n,r){return e.from(n).hashStruct(t,r)}},{key:"hashDomain",value:function(t){var n=[];for(var r in t){var i=lt[r];i||nt.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",t),n.push({name:r,type:i})}return n.sort((function(e,t){return ft.indexOf(e.name)-ft.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:n},t)}},{key:"encode",value:function(t,n,r){return(0,b.xs)(["0x1901",e.hashDomain(t),e.from(n).hash(r)])}},{key:"hash",value:function(t,n,r){return(0,O.w)(e.encode(t,n,r))}},{key:"resolveNames",value:function(t,n,r,i){return tt(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,s,u;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=(0,k.DC)(t),a={},t.verifyingContract&&!(0,b.A7)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(n)).visit(r,(function(e,t){return"address"!==e||(0,b.A7)(t,20)||(a[t]="0x"),t})),o.t0=(0,m.Z)().keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return u=o.t1.value,o.next=10,i(u);case 10:a[u]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=s.visit(r,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:r});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,n,r){e.hashDomain(t);var i={},o=[];ft.forEach((function(e){var n=t[e];null!=n&&(i[e]=pt[e](n),o.push({name:e,type:lt[e]}))}));var a=e.from(n),s=(0,k.DC)(n);return s.EIP712Domain?nt.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",n):s.EIP712Domain=o,a.encode(r),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(r,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,b.Dv)((0,b.lE)(t));if(e.match(/^u?int/))return A.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&nt.throwArgumentError("invalid string","value",t),t}return nt.throwArgumentError("unsupported type","type",e)}))}}}]),e}(),gt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},yt=new i.Yd(me),bt=["call","estimateGas"];function wt(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){var n=(0,b.A7)(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"===typeof e){for(var r in e){var i=wt(e[r],t);if(i)return i}return null}if("string"===typeof e)try{return wt(JSON.parse(e),t)}catch(o){}return null}function xt(e,t,n){var r=n.transaction||n.signedTransaction;if("call"===e){var o=wt(t,!0);if(o)return o.data;yt.throwError("missing revert data in call exception; Transaction reverted without a reason string",i.Yd.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){var a=wt(t.body,!1);null==a&&(a=wt(t,!1)),a&&yt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{reason:a.message,method:e,transaction:r,error:t})}var s=t.message;throw t.code===i.Yd.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?s=t.error.message:"string"===typeof t.body?s=t.body:"string"===typeof t.responseText&&(s=t.responseText),(s=(s||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&yt.throwError("insufficient funds for intrinsic transaction cost",i.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),s.match(/nonce (is )?too low/i)&&yt.throwError("nonce has already been used",i.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),s.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&yt.throwError("replacement fee too low",i.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),s.match(/only replay-protected/i)&&yt.throwError("legacy pre-eip-155 transactions not supported",i.Yd.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),bt.indexOf(e)>=0&&s.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&yt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function kt(e){return new Promise((function(t){setTimeout(t,e)}))}function _t(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Et(e){return e?e.toLowerCase():e}var At={},St=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r,i){var o;if((0,g.Z)(this,n),o=t.call(this),e!==At)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return(0,k.zG)((0,p.Z)(o),"provider",r),null==i&&(i=0),"string"===typeof i?((0,k.zG)((0,p.Z)(o),"_address",o.provider.formatter.address(i)),(0,k.zG)((0,p.Z)(o),"_index",null)):"number"===typeof i?((0,k.zG)((0,p.Z)(o),"_index",i),(0,k.zG)((0,p.Z)(o),"_address",null)):yt.throwArgumentError("invalid address or index","addressOrIndex",i),o}return(0,y.Z)(n,[{key:"connect",value:function(e){return yt.throwError("cannot alter JSON-RPC Signer connection",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Ot(At,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&yt.throwError("unknown account #"+e._index,i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=(0,k.DC)(e);var n=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var r=(0,k.DC)(e);r.from=n,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return gt(t,void 0,void 0,(0,m.Z)().mark((function t(){var n;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(n=t.sent)&&yt.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)})))}))),(0,k.mE)({tx:(0,k.mE)(e),sender:n}).then((function(n){var r=n.tx,o=n.sender;null!=r.from?r.from.toLowerCase()!==o&&yt.throwArgumentError("from address mismatch","transaction",e):r.from=o;var a=t.provider.constructor.hexlifyTransaction(r,{from:!0});return t.provider.send("eth_sendTransaction",[a]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&yt.throwError("user rejected transaction",i.Yd.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),xt("sendTransaction",e,a)}))}))}},{key:"signTransaction",value:function(e){return yt.throwError("signing transactions is unsupported",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return n=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return r=t.sent,t.prev=6,t.next=9,pe((function(){return gt(i,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(r);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,r,n));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=r,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?(0,S.Y0)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[(0,b.Dv)(n),r.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&yt.throwError("user rejected signing",i.Yd.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?(0,S.Y0)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[r.toLowerCase(),(0,b.Dv)(n)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&yt.throwError("user rejected signing",i.Yd.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,n){return gt(this,void 0,void 0,(0,m.Z)().mark((function r(){var o,a,s=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,mt.resolveNames(e,t,n,(function(e){return s.provider.resolveName(e)}));case 2:return o=r.sent,r.next=5,this.getAddress();case 5:return a=r.sent,r.prev=6,r.next=9,this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(mt.getPayload(o.domain,t,o.value))]);case 9:return r.abrupt("return",r.sent);case 12:throw r.prev=12,r.t0=r.catch(6),"string"===typeof r.t0.message&&r.t0.message.match(/user denied/i)&&yt.throwError("user rejected signing",i.Yd.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:o.domain,types:t,value:o.value}}),r.t0;case 16:case"end":return r.stop()}}),r,this,[[6,12]])})))}},{key:"unlock",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.provider,t.next=3,this.getAddress();case 3:return r=t.sent,t.abrupt("return",n.send("personal_unlockAccount",[r.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),n}($e.E),Ot=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(n){return t.provider.waitForTransaction(e,n)}}}))}}]),n}(St),Tt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Pt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;(0,g.Z)(this,n);var o=r;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=(0,k.tu)(i.constructor,"defaultUrl")()),"string"===typeof e?(0,k.zG)((0,p.Z)(i),"connection",Object.freeze({url:e})):(0,k.zG)((0,p.Z)(i),"connection",Object.freeze((0,k.DC)(e))),i._nextId=42,i}return(0,y.Z)(n,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return gt(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,n;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kt(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return n=(0,k.tu)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",n(A.O$.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",yt.throwError("could not detect network",i.Yd.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",yt.throwError("could not detect network",i.Yd.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new St(At,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var n=this,r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,k.p$)(r),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=de(this.connection,JSON.stringify(r),_t).then((function(e){return n.emit("debug",{action:"response",request:r,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",error:e,request:r,provider:n}),e}));return i&&(this._cache[e]=o,setTimeout((function(){n._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Et(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Et(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Et(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Et(t.address),(0,b.$m)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,k.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,k.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Et(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return gt(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o,a;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("call"!==e&&"estimateGas"!==e){n.next=8;break}if(!(r=t.transaction)||null==r.type||!A.O$.from(r.type).isZero()){n.next=8;break}if(null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas){n.next=8;break}return n.next=6,this.getFeeData();case 6:null==(o=n.sent).maxFeePerGas&&null==o.maxPriorityFeePerGas&&((t=(0,k.DC)(t)).transaction=(0,k.DC)(r),delete t.transaction.type);case 8:return null==(a=this.prepareRequest(e,t))&&yt.throwError(e+" not implemented",i.Yd.errors.NOT_IMPLEMENTED,{operation:e}),n.prev=10,n.next=13,this.send(a[0],a[1]);case 13:return n.abrupt("return",n.sent);case 16:return n.prev=16,n.t0=n.catch(10),n.abrupt("return",xt(e,n.t0,t));case 19:case"end":return n.stop()}}),n,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),(0,Qe.Z)((0,Xe.Z)(n.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;var r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return kt(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((function(e){}))}(),n})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),(0,Qe.Z)((0,Xe.Z)(n.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var n=(0,k.DC)(Tt);if(t)for(var r in t)t[r]&&(n[r]=!0);(0,k.uj)(e,n);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var n=(0,b.$P)(A.O$.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=n}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=(0,b.Dv)(e[t]))})),e.accessList&&(i.accessList=(0,be.z7)(e.accessList)),i}}]),n}(Ke),Ct=null;try{if(null==(Ct=WebSocket))throw new Error("inject please")}catch(Bn){var It=new i.Yd(me);Ct=function(){It.throwError("WebSockets not supported in this environment",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Rt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},jt=new i.Yd(me),Nt=1,Mt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var o,a;(0,g.Z)(this,n),"any"===r&&jt.throwError("WebSocketProvider does not support 'any' network yet",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(a="string"===typeof e?t.call(this,e,r):t.call(this,"_websocket",r))._pollingInterval=-1,a._wsReady=!1,"string"===typeof e?(0,k.zG)((0,p.Z)(a),"_websocket",new Ct(a.connection.url)):(0,k.zG)((0,p.Z)(a),"_websocket",e),(0,k.zG)((0,p.Z)(a),"_requests",{}),(0,k.zG)((0,p.Z)(a),"_subs",{}),(0,k.zG)((0,p.Z)(a),"_subIds",{}),(0,k.zG)((0,p.Z)(a),"_detectNetwork",(0,Qe.Z)((o=(0,p.Z)(a),(0,Xe.Z)(n.prototype)),"detectNetwork",o).call(o)),a.websocket.onopen=function(){a._wsReady=!0,Object.keys(a._requests).forEach((function(e){a.websocket.send(a._requests[e].payload)}))},a.websocket.onmessage=function(e){var t=e.data,n=JSON.parse(t);if(null!=n.id){var r=String(n.id),i=a._requests[r];if(delete a._requests[r],void 0!==n.result)i.callback(null,n.result),a.emit("debug",{action:"response",request:JSON.parse(i.payload),response:n.result,provider:(0,p.Z)(a)});else{var o=null;n.error?(o=new Error(n.error.message||"unknown error"),(0,k.zG)(o,"code",n.error.code||null),(0,k.zG)(o,"response",t)):o=new Error("unknown error"),i.callback(o,void 0),a.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:(0,p.Z)(a)})}}else if("eth_subscription"===n.method){var s=a._subs[n.params.subscription];s&&s.processFunc(n.params.result)}else console.warn("this should not happen")};var s=setInterval((function(){a.emit("poll")}),1e3);return s.unref&&s.unref(),(0,Je.Z)(a)}return(0,y.Z)(n,[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){jt.throwError("cannot set polling interval on WebSocketProvider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){jt.throwError("cannot reset events block on WebSocketProvider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return Rt(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&jt.throwError("cannot set polling on WebSocketProvider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var n=this,r=Nt++;return new Promise((function(i,o){var a=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});n.emit("debug",{action:"request",request:JSON.parse(a),provider:n}),n._requests[String(r)]={callback:function(e,t){return e?o(e):i(t)},payload:a},n._wsReady&&n.websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,n){return Rt(this,void 0,void 0,(0,m.Z)().mark((function r(){var i,o,a=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=i),r.next=4,i;case 4:o=r.sent,this._subs[o]={tag:e,processFunc:n};case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var n=A.O$.from(e.number).toNumber();t._emitted.block=n,t.emit("block",n)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(n){null==n.removed&&(n.removed=!1),t.emit(e.filter,t.formatter.filterLog(n))}));break;case"tx":var n=function(e){var n=e.hash;t.getTransactionReceipt(n).then((function(e){e&&t.emit(n,e)}))};n(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(n)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,n=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;n="tx"}else if(this.listenerCount(e.event))return;var r=this._subIds[n];r&&(delete this._subIds[n],r.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return Rt(this,void 0,void 0,(0,m.Z)().mark((function e(){var t=this;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==Ct.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t.websocket.onopen=function(){e(!0)},t.websocket.onerror=function(){e(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}],[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}]),n}(Pt),Lt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Ut=new i.Yd(me),Dt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return(0,Qe.Z)((0,Xe.Z)(n.prototype),"detectNetwork",e)}}});return Lt(this,void 0,void 0,(0,m.Z)().mark((function e(){var n;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(n=e.sent)||Ut.throwError("no network detected",i.Yd.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,k.zG)(this,"_network",n),this.emit("network",n,null));case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}}]),n}(Pt),Bt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;(0,g.Z)(this,n),Ut.checkAbstract(this instanceof n?this.constructor:void 0,n),e=(0,k.tu)(this instanceof n?this.constructor:void 0,"getNetwork")(e),r=(0,k.tu)(this instanceof n?this.constructor:void 0,"getApiKey")(r);var o=(0,k.tu)(this instanceof n?this.constructor:void 0,"getUrl")(e,r);return i=t.call(this,o,e),"string"===typeof r?(0,k.zG)((0,p.Z)(i),"apiKey",r):null!=r&&Object.keys(r).forEach((function(e){(0,k.zG)((0,p.Z)(i),e,r[e])})),i}return(0,y.Z)(n,[{key:"_startPending",value:function(){Ut.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return Ut.throwError("API provider does not support signing",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return Ut.throwError("not implemented; sub-classes must override getUrl",i.Yd.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),n}(Dt),Ft=new i.Yd(me),Zt="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",zt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;(0,g.Z)(this,n);var o=new Ht(e,r),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return i=t.call(this,a,o.network),(0,k.zG)((0,p.Z)(i),"apiKey",o.apiKey),i}return(0,y.Z)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Zt}}]),n}(Mt),Ht=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Zt}}],[{key:"getWebSocketProvider",value:function(e,t){return new zt(e,t)}},{key:"getApiKey",value:function(e){return null==e?Zt:(e&&"string"!==typeof e&&Ft.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:Ft.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+t,throttleCallback:function(e,n){return t===Zt&&Ae(),Promise.resolve(!0)}}}}]),n}(Bt),qt=new i.Yd(me),Vt="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Wt(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return qt.throwArgumentError("unsupported network","name",e)}var Gt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Vt}}],[{key:"getApiKey",value:function(e){return null==e?Vt:e}},{key:"getUrl",value:function(e,t){null==t&&(t=Vt);var n={allowGzip:!0,url:"https://"+Wt(e.name)+t,throttleCallback:function(e,n){return t.apiKey===Vt&&Ae(),Promise.resolve(!0)}};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}]),n}(Bt),Yt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Kt=new i.Yd(me),Jt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"perform",value:function(e,t){var r=this,i=Object.create(null,{perform:{get:function(){return(0,Qe.Z)((0,Xe.Z)(n.prototype),"perform",r)}}});return Yt(this,void 0,void 0,(0,m.Z)().mark((function n(){var r;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("getBlockNumber"!==e){n.next=5;break}return n.next=3,i.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return r=n.sent,n.abrupt("return",r.number);case 5:return n.abrupt("return",i.perform.call(this,e,t));case 6:case"end":return n.stop()}}),n,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&Kt.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var n=null;if("homestead"===e.name)n="https://cloudflare-eth.com/";else Kt.throwArgumentError("unsupported network","network",arguments[0]);return n}}]),n}(Bt),Qt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Xt=new i.Yd(me);function $t(e){var t={};for(var n in e)if(null!=e[n]){var r=e[n];"type"===n&&0===r||(r={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n]?(0,b.$P)((0,b.Dv)(r)):"accessList"===n?"["+(0,be.z7)(r).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":(0,b.Dv)(r),t[n]=r)}return t}function en(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function tn(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var n=new Error("invalid response");throw n.result=JSON.stringify(e),n}if(e.error){var r=new Error(e.error.message||"unknown error");throw e.error.code&&(r.code=e.error.code),e.error.data&&(r.data=e.error.data),r}return e.result}function nn(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function rn(e,t,n){if("call"===e&&t.code===i.Yd.errors.SERVER_ERROR){var r=t.error;if(r&&(r.message.match(/reverted/i)||r.message.match(/VM execution error/i))){var o=r.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),(0,b.A7)(o))return o;Xt.throwError("missing revert data in call exception",i.Yd.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var a=t.message;throw t.code===i.Yd.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?a=t.error.message:"string"===typeof t.body?a=t.body:"string"===typeof t.responseText&&(a=t.responseText)),(a=(a||"").toLowerCase()).match(/insufficient funds/)&&Xt.throwError("insufficient funds for intrinsic transaction cost",i.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Xt.throwError("nonce has already been used",i.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/another transaction with same nonce/)&&Xt.throwError("replacement fee too low",i.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/execution failed due to an exception|execution reverted/)&&Xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}var on=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this,e),(0,k.zG)((0,p.Z)(i),"baseUrl",i.getBaseUrl()),(0,k.zG)((0,p.Z)(i),"apiKey",r||null),i}return(0,y.Z)(n,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Xt.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var n=Object.keys(t).reduce((function(e,n){var r=t[n];return null!=r&&(e+="&".concat(n,"=").concat(r)),e}),""),r=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(n).concat(r)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,n){return Qt(this,void 0,void 0,(0,m.Z)().mark((function r(){var i,o,a,s,u,c,l=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=n?this.getPostUrl():this.getUrl(e,t),o=n?this.getPostData(e,t):null,a="proxy"===e?tn:en,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&Ae(),Promise.resolve(!0)}},u=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),r.next=9,de(s,u,a||tn);case 9:return c=r.sent,this.emit("debug",{action:"response",request:i,response:(0,k.p$)(c),provider:this}),r.abrupt("return",c);case 12:case"end":return r.stop()}}),r,this)})))}},{key:"detectNetwork",value:function(){return Qt(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,o=Object.create(null,{perform:{get:function(){return(0,Qe.Z)((0,Xe.Z)(n.prototype),"perform",r)}}});return Qt(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,a,s,u,c,l,f,d,p;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=e,n.next="getBlockNumber"===n.t0?3:"getGasPrice"===n.t0?4:"getBalance"===n.t0?5:"getTransactionCount"===n.t0?6:"getCode"===n.t0?7:"getStorageAt"===n.t0?8:"sendTransaction"===n.t0?9:"getBlock"===n.t0?10:"getTransaction"===n.t0?13:"getTransactionReceipt"===n.t0?14:"call"===n.t0?15:"estimateGas"===n.t0?29:"getLogs"===n.t0?41:"getEtherPrice"===n.t0?65:72;break;case 3:return n.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return n.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return n.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return n.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return n.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return n.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return rn("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){n.next=12;break}return n.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){n.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(r=$t(t.transaction)).module="proxy",r.action="eth_call",n.prev=20,n.next=23,this.fetch("proxy",r,!0);case 23:return n.abrupt("return",n.sent);case 26:return n.prev=26,n.t1=n.catch(20),n.abrupt("return",rn("call",n.t1,t.transaction));case 29:return(a=$t(t.transaction)).module="proxy",a.action="eth_estimateGas",n.prev=32,n.next=35,this.fetch("proxy",a,!0);case 35:return n.abrupt("return",n.sent);case 38:return n.prev=38,n.t2=n.catch(32),n.abrupt("return",rn("estimateGas",n.t2,t.transaction));case 41:return s={action:"getLogs"},t.filter.fromBlock&&(s.fromBlock=nn(t.filter.fromBlock)),t.filter.toBlock&&(s.toBlock=nn(t.filter.toBlock)),t.filter.address&&(s.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Xt.throwError("unsupported topic count",i.Yd.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(u=t.filter.topics[0])&&66===u.length||Xt.throwError("unsupported topic format",i.Yd.errors.UNSUPPORTED_OPERATION,{topic0:u}),s.topic0=u)),n.next=48,this.fetch("logs",s);case 48:c=n.sent,l={},f=0;case 51:if(!(f0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}var sn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},un=new i.Yd(me);function cn(){return(new Date).getTime()}function ln(e){for(var t=null,n=0;nt?null:(r+i)/2}function dn(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(A.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return dn(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var n=e[t];return n="function"===typeof n?"[function]":dn(n),JSON.stringify(t)+":"+n})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var pn=1;function hn(e){var t=null,n=null,r=new Promise((function(r){t=function(){n&&(clearTimeout(n),n=null),r()},n=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:function(e){return r=r.then(e)}}}var vn=[i.Yd.errors.CALL_EXCEPTION,i.Yd.errors.INSUFFICIENT_FUNDS,i.Yd.errors.NONCE_EXPIRED,i.Yd.errors.REPLACEMENT_UNDERPRICED,i.Yd.errors.UNPREDICTABLE_GAS_LIMIT],mn=["address","args","errorArgs","errorSignature","method","transaction"];function gn(e,t){var n={weight:e.weight};return Object.defineProperty(n,"provider",{get:function(){return e.provider}}),e.start&&(n.start=e.start),t&&(n.duration=t-e.start),e.done&&(e.error?n.error=e.error:n.result=e.result||null),n}function yn(e,t,n){var r=dn;switch(t){case"getBlockNumber":return function(t){var n=t.map((function(e){return e.result})),r=fn(t.map((function(e){return e.result})),2);if(null!=r)return r=Math.ceil(r),n.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return fn(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=(0,k.DC)(e)).confirmations=-1,dn(e))};break;case"getBlock":r=n.includeTransactions?function(e){return null==e?null:((e=(0,k.DC)(e)).transactions=e.transactions.map((function(e){return(e=(0,k.DC)(e)).confirmations=-1,e})),dn(e))}:function(e){return null==e?null:dn(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(n){var r={};n.forEach((function(t){var n=e(t.result);r[n]||(r[n]={count:0,result:t.result}),r[n].count++}));for(var i=Object.keys(r),o=0;o=t)return a.result}}}(r,e.quorum)}function bn(e,t){return sn(this,void 0,void 0,(0,m.Z)().mark((function n(){var r;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(null!=(r=e.provider).blockNumber&&r.blockNumber>=t||-1===t)){n.next=3;break}return n.abrupt("return",r);case 3:return n.abrupt("return",pe((function(){return new Promise((function(n,i){setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))}),{oncePoll:r}));case 4:case"end":return n.stop()}}),n)})))}function wn(e,t,n,r){return sn(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,s;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:a=e.provider,o.t0=n,o.next="getBlockNumber"===o.t0||"getGasPrice"===o.t0?4:"getEtherPrice"===o.t0?5:"getBalance"===o.t0||"getTransactionCount"===o.t0||"getCode"===o.t0?8:"getStorageAt"===o.t0?13:"getBlock"===o.t0?18:"call"===o.t0||"estimateGas"===o.t0?23:"getTransaction"===o.t0||"getTransactionReceipt"===o.t0?30:"getLogs"===o.t0?31:37;break;case 4:return o.abrupt("return",a[n]());case 5:if(!a.getEtherPrice){o.next=7;break}return o.abrupt("return",a.getEtherPrice());case 7:return o.abrupt("break",37);case 8:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=12;break}return o.next=11,bn(e,t);case 11:a=o.sent;case 12:return o.abrupt("return",a[n](r.address,r.blockTag||"latest"));case 13:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=17;break}return o.next=16,bn(e,t);case 16:a=o.sent;case 17:return o.abrupt("return",a.getStorageAt(r.address,r.position,r.blockTag||"latest"));case 18:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=22;break}return o.next=21,bn(e,t);case 21:a=o.sent;case 22:return o.abrupt("return",a[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash));case 23:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=27;break}return o.next=26,bn(e,t);case 26:a=o.sent;case 27:if("call"!==n||!r.blockTag){o.next=29;break}return o.abrupt("return",a[n](r.transaction,r.blockTag));case 29:return o.abrupt("return",a[n](r.transaction));case 30:return o.abrupt("return",a[n](r.transactionHash));case 31:if(!((s=r.filter).fromBlock&&(0,b.A7)(s.fromBlock)||s.toBlock&&(0,b.A7)(s.toBlock))){o.next=36;break}return o.next=35,bn(e,t);case 35:a=o.sent;case 36:return o.abrupt("return",a.getLogs(s));case 37:return o.abrupt("return",un.throwError("unknown method error",i.Yd.errors.UNKNOWN_ERROR,{method:n,params:r}));case 38:case"end":return o.stop()}}),o)})))}var xn=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,i){var o;(0,g.Z)(this,n),0===e.length&&un.throwArgumentError("missing providers","providers",e);var a=e.map((function(e,t){if(r.zt.isProvider(e)){var n=_e(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:n,priority:1})}var i=(0,k.DC)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=_e(e)?2e3:750),null==i.weight&&(i.weight=1);var o=i.weight;return(o%1||o>512||o<1)&&un.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),o),Object.freeze(i)})),s=a.reduce((function(e,t){return e+t.weight}),0);null==i?i=s/2:i>s&&un.throwArgumentError("quorum will always fail; larger than total weight","quorum",i);var u=ln(a.map((function(e){return e.provider.network})));return null==u&&(u=new Promise((function(e,t){setTimeout((function(){o.detectNetwork().then(e,t)}),0)}))),o=t.call(this,u),(0,k.zG)((0,p.Z)(o),"providerConfigs",Object.freeze(a)),(0,k.zG)((0,p.Z)(o),"quorum",i),o._highestBlockNumber=-1,o}return(0,y.Z)(n,[{key:"detectNetwork",value:function(){return sn(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",ln(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return sn(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o,a,s,u,c,l,f,d,p,h=this;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("sendTransaction"!==e){n.next=13;break}return n.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:r=n.sent,o=0;case 5:if(!(o=h.quorum)){n.next=22;break}if(void 0===(p=s(d))){n.next=18;break}return u.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),n.abrupt("return",{v:p});case 18:if(f){n.next=21;break}return n.next=21,hn(100).getPromise();case 21:f=!1;case 22:if(v=u.reduce((function(e,t){if(!t.done||null==t.error)return e;var n=t.error.code;return vn.indexOf(n)>=0&&(e[n]||(e[n]={error:t.error,weight:0}),e[n].weight+=t.weight),e}),{}),Object.keys(v).forEach((function(e){var t=v[e];if(!(t.weight>=8;return t}function s(e,t,n){for(var r=0,i=0;it+1+r&&o.throwError("child data too short",i.Yd.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:a}}function f(e,t){if(0===e.length&&o.throwError("data too short",i.Yd.errors.BUFFER_OVERRUN,{}),e[t]>=248){var n=e[t]-247;t+1+n>e.length&&o.throwError("data short segment too short",i.Yd.errors.BUFFER_OVERRUN,{});var a=s(e,t+1,n);return t+1+n+a>e.length&&o.throwError("data long segment too short",i.Yd.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+n,n+a)}if(e[t]>=192){var u=e[t]-192;return t+1+u>e.length&&o.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,u)}if(e[t]>=184){var c=e[t]-183;t+1+c>e.length&&o.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{});var f=s(e,t+1,c);return t+1+c+f>e.length&&o.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{}),{consumed:1+c+f,result:(0,r.Dv)(e.slice(t+1+c,t+1+c+f))}}if(e[t]>=128){var d=e[t]-128;return t+1+d>e.length&&o.throwError("data too short",i.Yd.errors.BUFFER_OVERRUN,{}),{consumed:1+d,result:(0,r.Dv)(e.slice(t+1,t+1+d))}}return{consumed:1,result:(0,r.Dv)(e[t])}}function d(e){var t=(0,r.lE)(e),n=f(t,0);return n.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),n.result}},83431:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(62808).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(T){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(a=(i=0|e.words[h])*(o=0|t.words[p])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,x=b>>>13,k=0|a[4],_=8191&k,E=k>>>13,A=0|a[5],S=8191&A,O=A>>>13,T=0|a[6],P=8191&T,C=T>>>13,I=0|a[7],R=8191&I,j=I>>>13,N=0|a[8],M=8191&N,L=N>>>13,U=0|a[9],D=8191&U,B=U>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(v,Z)|0,o=Math.imul(v,z);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,Z),i=(i=Math.imul(g,z))+Math.imul(y,Z)|0,o=Math.imul(y,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,o=Math.imul(x,z),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0;var be=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,Z),i=(i=Math.imul(_,z))+Math.imul(E,Z)|0,o=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,Z),i=(i=Math.imul(S,z))+Math.imul(O,Z)|0,o=Math.imul(O,z),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((o=o+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,Z),i=(i=Math.imul(P,z))+Math.imul(C,Z)|0,o=Math.imul(C,z),r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0;var ke=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(j,Z)|0,o=Math.imul(j,z),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var _e=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,z))+Math.imul(L,Z)|0,o=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,z))+Math.imul(B,Z)|0,o=Math.imul(B,z),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Q)|0,r=r+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Ae=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(B,q)|0,o=Math.imul(B,V),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(B,G)|0,o=Math.imul(B,Y),r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Oe=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(D,J),i=(i=Math.imul(D,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Te=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,r=r+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Pe=(c+(r=r+Math.imul(_,he)|0)|0)+((8191&(i=(i=i+Math.imul(_,ve)|0)+Math.imul(E,he)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,de)|0;var Ce=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(O,he)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Ie=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,he)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(j,he)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var je=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(L,he)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Ne=(c+(r=Math.imul(D,he))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(B,he)|0))<<13)|0;return c=((o=Math.imul(B,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=ke,u[7]=_e,u[8]=Ee,u[9]=Ae,u[10]=Se,u[11]=Oe,u[12]=Te,u[13]=Pe,u[14]=Ce,u[15]=Ie,u[16]=Re,u[17]=je,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var h=0,v=1;0===(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=a;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},91953:function(e,t,n){"use strict";n.d(t,{Y0:function(){return l},XL:function(){return d},ZN:function(){return f}});var r,i,o=n(52009),a=new(n(2735).Yd)("strings/5.7.0");function s(e,t,n,r,o){if(e===i.BAD_PREFIX||e===i.UNEXPECTED_CONTINUE){for(var a=0,s=t+1;s>6===2;s++)a++;return a}return e===i.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(r||(r={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(i||(i={}));var u=Object.freeze({error:function(e,t,n,r,i){return a.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",n)},ignore:s,replace:function(e,t,n,r,o){return e===i.OVERLONG?(r.push(o),0):(r.push(65533),s(e,t,n))}});function c(e,t){null==t&&(t=u.error),e=(0,o.lE)(e);for(var n=[],r=0;r>7!==0){var s=null,c=null;if(192===(224&a))s=1,c=127;else if(224===(240&a))s=2,c=2047;else{if(240!==(248&a)){r+=t(128===(192&a)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,r-1,e,n);continue}s=3,c=65535}if(r-1+s>=e.length)r+=t(i.OVERRUN,r-1,e,n);else{for(var l=a&(1<<8-s-1)-1,f=0;f1114111?r+=t(i.OUT_OF_RANGE,r-1-s,e,n,l):l>=55296&&l<=57343?r+=t(i.UTF16_SURROGATE,r-1-s,e,n,l):l<=c?r+=t(i.OVERLONG,r-1-s,e,n,l):n.push(l))}}else n.push(a)}return n}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current;t!=r.current&&(a.checkNormalize(),e=e.normalize(t));for(var n=[],i=0;i>6|192),n.push(63&s|128);else if(55296==(64512&s)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!==(64512&u))throw new Error("invalid utf-8 string");var c=65536+((1023&s)<<10)+(1023&u);n.push(c>>18|240),n.push(c>>12&63|128),n.push(c>>6&63|128),n.push(63&c|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(63&s|128)}return(0,o.lE)(n)}function f(e,t){return c(e,t).map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function d(e){return c(l(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current))}},14046:function(e,t,n){"use strict";n.d(t,{z7:function(){return fe},Qc:function(){return me}});var r=n(28552),i=n(19560),o=n(52009),a=n(6321),s=n(11291),u=n(80807),c=n(15671),l=n(43144),f=n(83431),d=n.n(f),p=n(37553),h=n.n(p);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self&&self;function v(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&n.path)}},e(n,n.exports),n.exports}var m=g;function g(e,t){if(!e)throw new Error(t||"Assertion failed")}g.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var y=v((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),b=v((function(e,t){var n=t;n.assert=m,n.toArray=y.toArray,n.zero2=y.zero2,n.toHex=y.toHex,n.encode=y.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0===(1&c)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new(d())(e,"hex","le")}})),w=b.getNAF,x=b.getJSF,k=b.assert;function _(e,t){this.type=e,this.p=new(d())(t.p,16),this.red=t.prime?d().red(t.prime):d().mont(this.p),this.zero=new(d())(0).toRed(this.red),this.one=new(d())(1).toRed(this.red),this.two=new(d())(2).toRed(this.red),this.n=t.n&&new(d())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var E=_;function A(e,t){this.curve=e,this.type=t,this.precomputed=null}_.prototype.point=function(){throw new Error("Not implemented")},_.prototype.validate=function(){throw new Error("Not implemented")},_.prototype._fixedNafMul=function(e,t){k(e.precomputed);var n=e._getDoubles(),r=w(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+r[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];k(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},_.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o=1;o-=2){var p=o-1,h=o;if(1===u[p]&&1===u[h]){var v=[t[p],null,null,t[h]];0===t[p].y.cmp(t[h].y)?(v[1]=t[p].add(t[h]),v[2]=t[p].toJ().mixedAdd(t[h].neg())):0===t[p].y.cmp(t[h].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[h]),v[2]=t[p].add(t[h].neg())):(v[1]=t[p].toJ().mixedAdd(t[h]),v[2]=t[p].toJ().mixedAdd(t[h].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=x(n[p],n[h]);for(f=Math.max(g[0].length,f),l[p]=new Array(f),l[h]=new Array(f),a=0;a=0;o--){for(var E=0;o>=0;){var A=!0;for(a=0;a=0&&E++,k=k.dblp(E),o<0)break;for(a=0;a0?s=c[a][S-1>>1]:S<0&&(s=c[a][-S-1>>1].neg()),k="affine"===s.type?k.mixedAdd(s):k.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},A.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},T.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},T.prototype.pointFromX=function(e,t){(e=new(d())(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},T.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},T.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},C.prototype.isInfinity=function(){return this.inf},C.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},C.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},C.prototype.getX=function(){return this.x.fromRed()},C.prototype.getY=function(){return this.y.fromRed()},C.prototype.mul=function(e){return e=new(d())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},C.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},C.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},C.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},C.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},C.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},S(I,E.BasePoint),T.prototype.jpoint=function(e,t,n){return new I(this,e,t,n)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=r.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),p=u.redMul(f.redISub(d)).redISub(o.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,p,h)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(i.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(f,d,p)},I.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var R=v((function(e,t){var n=t;n.base=E,n.short=P,n.mont=null,n.edwards=null})),j=v((function(e,t){var n,r=t,i=b.assert;function o(e){"short"===e.type?this.curve=new R.short(e):"edwards"===e.type?this.curve=new R.edwards(e):this.curve=new R.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:h().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:h().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:h().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:h().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:h().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:h().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:h().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(s){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:h().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function N(e){if(!(this instanceof N))return new N(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=y.toArray(e.entropy,e.entropyEnc||"hex"),n=y.toArray(e.nonce,e.nonceEnc||"hex"),r=y.toArray(e.pers,e.persEnc||"hex");m(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var M=N;N.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},N.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=y.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var B=b.assert;function F(e,t){if(e instanceof F)return e;this._importDER(e,t)||(B(e.r&&e.s,"Signature without r or s"),this.r=new(d())(e.r,16),this.s=new(d())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Z=F;function z(){this.place=0}function H(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function q(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}F.prototype._importDER=function(e,t){e=b.toArray(e,t);var n=new z;if(48!==e[n.place++])return!1;var r=H(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=H(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=H(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(d())(o),this.s=new(d())(s),this.recoveryParam=null,!0},F.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=q(t),n=q(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];V(r,t.length),(r=r.concat(t)).push(2),V(r,n.length);var i=r.concat(n),o=[48];return V(o,i.length),o=o.concat(i),b.encode(o,e)};var W=function(){throw new Error("unsupported")},G=b.assert;function Y(e){if(!(this instanceof Y))return new Y(e);"string"===typeof e&&(G(Object.prototype.hasOwnProperty.call(j,e),"Unknown curve "+e),e=j[e]),e instanceof j.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var K=Y;Y.prototype.keyPair=function(e){return new D(this,e)},Y.prototype.keyFromPrivate=function(e,t){return D.fromPrivate(this,e,t)},Y.prototype.keyFromPublic=function(e,t){return D.fromPublic(this,e,t)},Y.prototype.genKeyPair=function(e){e||(e={});for(var t=new M({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||W(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new(d())(2));;){var i=new(d())(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Y.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Y.prototype.sign=function(e,t,n,r){"object"===typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new(d())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new M({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new(d())(1)),c=0;;c++){var l=r.k?r.k(c):new(d())(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var p=f.getX(),h=p.umod(this.n);if(0!==h.cmpn(0)){var v=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var m=(f.getY().isOdd()?1:0)|(0!==p.cmp(h)?2:0);return r.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new Z({r:h,s:v,recoveryParam:m})}}}}}},Y.prototype.verify=function(e,t,n,r){e=this._truncateToN(new(d())(e,16)),n=this.keyFromPublic(n,r);var i=(t=new Z(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Y.prototype.recoverPubKey=function(e,t,n,r){G((3&n)===n,"The recovery param is more than two bits"),t=new Z(t,r);var i=this.n,o=new(d())(e),a=t.r,s=t.s,u=1&n,c=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),f=i.sub(o).mul(l).umod(i),p=s.mul(l).umod(i);return this.g.mulAdd(f,a,p)},Y.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new Z(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var J=v((function(e,t){var n=t;n.version="6.5.4",n.utils=b,n.rand=function(){throw new Error("unsupported")},n.curve=R,n.curves=j,n.ec=K,n.eddsa=null})).ec,Q=n(54812),X=n(2735),$=new X.Yd("signing-key/5.7.0"),ee=null;function te(){return ee||(ee=new J("secp256k1")),ee}var ne=function(){function e(t){(0,c.Z)(this,e),(0,Q.zG)(this,"curve","secp256k1"),(0,Q.zG)(this,"privateKey",(0,o.Dv)(t)),32!==(0,o.E1)(this.privateKey)&&$.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var n=te().keyFromPrivate((0,o.lE)(this.privateKey));(0,Q.zG)(this,"publicKey","0x"+n.getPublic(!1,"hex")),(0,Q.zG)(this,"compressedPublicKey","0x"+n.getPublic(!0,"hex")),(0,Q.zG)(this,"_isSigningKey",!0)}return(0,l.Z)(e,[{key:"_addPoint",value:function(e){var t=te().keyFromPublic((0,o.lE)(this.publicKey)),n=te().keyFromPublic((0,o.lE)(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=te().keyFromPrivate((0,o.lE)(this.privateKey)),n=(0,o.lE)(e);32!==n.length&&$.throwArgumentError("bad digest length","digest",e);var r=t.sign(n,{canonical:!0});return(0,o.N)({recoveryParam:r.recoveryParam,r:(0,o.$m)("0x"+r.r.toString(16),32),s:(0,o.$m)("0x"+r.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=te().keyFromPrivate((0,o.lE)(this.privateKey)),n=te().keyFromPublic((0,o.lE)(re(e)));return(0,o.$m)("0x"+t.derive(n.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function re(e,t){var n=(0,o.lE)(e);if(32===n.length){var r=new ne(n);return t?"0x"+te().keyFromPrivate(n).getPublic(!0,"hex"):r.publicKey}return 33===n.length?t?(0,o.Dv)(n):"0x"+te().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+te().keyFromPublic(n).getPublic(!0,"hex"):(0,o.Dv)(n):$.throwArgumentError("invalid public or private key","key","[REDACTED]")}var ie,oe=new X.Yd("transactions/5.7.0");function ae(e){return"0x"===e?null:(0,r.getAddress)(e)}function se(e){return"0x"===e?a._Y:i.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(ie||(ie={}));function ue(e,t){return function(e){var t=re(e);return(0,r.getAddress)((0,o.p3)((0,s.w)((0,o.p3)(t,1)),12))}(function(e,t){var n=(0,o.N)(t),r={r:(0,o.lE)(n.r),s:(0,o.lE)(n.s)};return"0x"+te().recoverPubKey((0,o.lE)(e),r,n.recoveryParam).encode("hex",!1)}((0,o.lE)(e),t))}function ce(e,t){var n=(0,o.G1)(i.O$.from(e).toHexString());return n.length>32&&oe.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function le(e,t){return{address:(0,r.getAddress)(e),storageKeys:(t||[]).map((function(t,n){return 32!==(0,o.E1)(t)&&oe.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(n,"]"),t),t.toLowerCase()}))}}function fe(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&oe.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),le(e[0],e[1])):le(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var n=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return le(t,Object.keys(n).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function de(e){return fe(e).map((function(e){return[e.address,e.storageKeys]}))}function pe(e,t){if(null!=e.gasPrice){var n=i.O$.from(e.gasPrice),a=i.O$.from(e.maxFeePerGas||0);n.eq(a)||oe.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:a})}var s=[ce(e.chainId||0,"chainId"),ce(e.nonce||0,"nonce"),ce(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ce(e.maxFeePerGas||0,"maxFeePerGas"),ce(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",ce(e.value||0,"value"),e.data||"0x",de(e.accessList||[])];if(t){var c=(0,o.N)(t);s.push(ce(c.recoveryParam,"recoveryParam")),s.push((0,o.G1)(c.r)),s.push((0,o.G1)(c.s))}return(0,o.xs)(["0x02",u.c(s)])}function he(e,t){var n=[ce(e.chainId||0,"chainId"),ce(e.nonce||0,"nonce"),ce(e.gasPrice||0,"gasPrice"),ce(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",ce(e.value||0,"value"),e.data||"0x",de(e.accessList||[])];if(t){var i=(0,o.N)(t);n.push(ce(i.recoveryParam,"recoveryParam")),n.push((0,o.G1)(i.r)),n.push((0,o.G1)(i.s))}return(0,o.xs)(["0x01",u.c(n)])}function ve(e,t,n){try{var r=se(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(a){oe.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.$m)(t[1],32),e.s=(0,o.$m)(t[2],32);try{var i=(0,s.w)(n(e));e.from=ue(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(a){}}function me(e){var t=(0,o.lE)(e);if(t[0]>127)return function(e){var t=u.J(e);9!==t.length&&6!==t.length&&oe.throwArgumentError("invalid raw transaction","rawTransaction",e);var n={nonce:se(t[0]).toNumber(),gasPrice:se(t[1]),gasLimit:se(t[2]),to:ae(t[3]),value:se(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=i.O$.from(t[6]).toNumber()}catch(l){return n}if(n.r=(0,o.$m)(t[7],32),n.s=(0,o.$m)(t[8],32),i.O$.from(n.r).isZero()&&i.O$.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);var r=n.v-27,a=t.slice(0,6);0!==n.chainId&&(a.push((0,o.Dv)(n.chainId)),a.push("0x"),a.push("0x"),r-=2*n.chainId+8);var c=(0,s.w)(u.c(a));try{n.from=ue(c,{r:(0,o.Dv)(n.r),s:(0,o.Dv)(n.s),recoveryParam:r})}catch(l){}n.hash=(0,s.w)(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){var t=u.J(e.slice(1));8!==t.length&&11!==t.length&&oe.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.Dv)(e));var n={type:1,chainId:se(t[0]).toNumber(),nonce:se(t[1]).toNumber(),gasPrice:se(t[2]),gasLimit:se(t[3]),to:ae(t[4]),value:se(t[5]),data:t[6],accessList:fe(t[7])};return 8===t.length||(n.hash=(0,s.w)(e),ve(n,t.slice(8),he)),n}(t);case 2:return function(e){var t=u.J(e.slice(1));9!==t.length&&12!==t.length&&oe.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.Dv)(e));var n=se(t[2]),r=se(t[3]),i={type:2,chainId:se(t[0]).toNumber(),nonce:se(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:se(t[4]),to:ae(t[5]),value:se(t[6]),data:t[7],accessList:fe(t[8])};return 9===t.length||(i.hash=(0,s.w)(e),ve(i,t.slice(9),pe)),i}(t)}return oe.throwError("unsupported transaction type: ".concat(t[0]),X.Yd.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},63811:function(e){"use strict";e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mustBeMetaMask,n=void 0!==t&&t,r=e.silent,i=void 0!==r&&r,o=e.timeout,a=void 0===o?3e3:o;!function(){if("boolean"!==typeof n)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!==typeof i)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!==typeof a)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();var s=!1;return new Promise((function(e){function t(){if(!s){s=!0,window.removeEventListener("ethereum#initialized",t);var r=window.ethereum;if(!r||n&&!r.isMetaMask){var o=n&&r?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!i&&console.error("@metamask/detect-provider:",o),e(null)}else e(r)}}window.ethereum?t():(window.addEventListener("ethereum#initialized",t,{once:!0}),setTimeout((function(){t()}),a))}))}},4609:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,o=n(61655).default,a=n(26389).default;function s(e,t,n){try{Reflect.apply(e,t,n)}catch(r){setTimeout((function(){throw r}))}}Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){o(n,e);var t=a(n);function n(){return r(this,n),t.apply(this,arguments)}return i(n,[{key:"emit",value:function(e){var t="error"===e,n=this._events;if(void 0!==n)t=t&&void 0===n.error;else if(!t)return!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o0&&(a=i[0]),a instanceof Error)throw a;var u=new Error("Unhandled error.".concat(a?" (".concat(a.message,")"):""));throw u.context=a,u}var c=n[e];if(void 0===c)return!1;if("function"===typeof c)s(c,this,i);else for(var l=c.length,f=function(e){for(var t=e.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:"Assertion failed.";if(!e){if(t instanceof Error)throw t;throw c(arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,t)}},t.assertStruct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Assertion failed",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l;try{(0,u.assert)(e,t)}catch(i){throw c(r,"".concat(n,": ").concat(function(e){var 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}(i),"."))}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},12802:function(e,t,n){"use strict";var r,i,o=n(59400).default;Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;var a=n(62746),s=n(35517);t.base64=function(e){var t,n,u,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=null!==(t=l.paddingRequired)&&void 0!==t&&t,d=null!==(n=l.characterSet)&&void 0!==n?n:"base64";return"base64"===d?u=String.raw(r||(r=o(["[A-Za-z0-9+/]"],["[A-Za-z0-9+\\/]"]))):((0,s.assert)("base64url"===d),u=String.raw(i||(i=o(["[-_A-Za-z0-9]"])))),c=f?new RegExp("^(?:".concat(u,"{4})*(?:").concat(u,"{3}=|").concat(u,"{2}==)?$"),"u"):new RegExp("^(?:".concat(u,"{4})*(?:").concat(u,"{2,3}|").concat(u,"{3}=|").concat(u,"{2}==)?$"),"u"),(0,a.pattern)(e,c)}},53310:function(e,t,n){"use strict";var r=n(74704).default;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;var i=n(35517),o=n(26135),a=48,s=58,u=87;var c=function(){var e=[];return function(){if(0===e.length)for(var t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function f(e){(0,i.assert)(l(e),"Value must be a Uint8Array.")}function d(e){if(f(e),0===e.length)return"0x";for(var t=c(),n=new Array(e.length),r=0;r=BigInt(0),"Value must be a non-negative bigint."),h(e.toString(16))}function m(e){return(0,i.assert)("number"===typeof e,"Value must be a number."),(0,i.assert)(e>=0,"Value must be a non-negative number."),(0,i.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),h(e.toString(16))}function g(e){return(0,i.assert)("string"===typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function y(e){if("bigint"===typeof e)return v(e);if("number"===typeof e)return m(e);if("string"===typeof e)return e.startsWith("0x")?h(e):g(e);if(l(e))return e;throw new TypeError('Unsupported value type: "'.concat(typeof e,'".'))}t.isBytes=l,t.assertIsBytes=f,t.bytesToHex=d,t.bytesToBigInt=p,t.bytesToSignedBigInt=function(e){f(e);var t,n=BigInt(0),i=r(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;n=(n<0,"Byte length must be greater than 0."),(0,i.assert)(function(e,t){(0,i.assert)(t>0);var n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");for(var n=e,r=new Uint8Array(t),o=0;o>=BigInt(8);return r.reverse()},t.numberToBytes=m,t.stringToBytes=g,t.valueToBytes=y,t.concatBytes=function(e){for(var t=new Array(e.length),n=0,r=0;r0?" ".concat(a(this.entries()).map((function(e){var t=o(e,2),n=t[0],r=t[1];return"".concat(String(n)," => ").concat(String(r))})).join(", ")," "):"","}")}}]),t}((r=new WeakMap,Symbol.iterator));t.FrozenMap=f;var d=function(e){function t(e){s(this,t),i.set(this,void 0),c(this,i,new Set(e),"f"),Object.freeze(this)}return u(t,[{key:"size",get:function(){return l(this,i,"f").size}},{key:e,value:function(){return l(this,i,"f")[Symbol.iterator]()}},{key:"entries",value:function(){return l(this,i,"f").entries()}},{key:"forEach",value:function(e,t){var n=this;return l(this,i,"f").forEach((function(r,i,o){return e.call(t,r,i,n)}))}},{key:"has",value:function(e){return l(this,i,"f").has(e)}},{key:"keys",value:function(){return l(this,i,"f").keys()}},{key:"values",value:function(){return l(this,i,"f").values()}},{key:"toString",value:function(){return"FrozenSet(".concat(this.size,") {").concat(this.size>0?" ".concat(a(this.values()).map((function(e){return String(e)})).join(", ")," "):"","}")}}]),t}((i=new WeakMap,Symbol.iterator));t.FrozenSet=d,Object.freeze(f),Object.freeze(f.prototype),Object.freeze(d),Object.freeze(d.prototype)},26135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;var r=n(62746),i=n(35517);function o(e){return(0,r.is)(e,t.HexStruct)}function a(e){return(0,r.is)(e,t.StrictHexStruct)}t.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/i),t.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/i),t.isHexString=o,t.isStrictHexString=a,t.assertIsHexString=function(e){(0,i.assert)(o(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,i.assert)(a(e),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?"0x".concat(e.substring(2)):"0x".concat(e)},t.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},95533:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35517),t),i(n(12802),t),i(n(53310),t),i(n(78531),t),i(n(70854),t),i(n(72465),t),i(n(26135),t),i(n(18420),t),i(n(88859),t),i(n(96013),t),i(n(3913),t),i(n(70304),t),i(n(57519),t),i(n(81482),t)},18420:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;var i=n(62746),o=n(35517),a=n(96013);function s(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Set;return function e(t,i){if(void 0===t)return[!1,0];if(null===t)return[!0,i?0:a.JsonSize.Null];var o=typeof t;try{if("function"===o)return[!1,0];if("string"===o||t instanceof String)return[!0,i?0:(0,a.calculateStringSize)(t)+2*a.JsonSize.Quote];if("boolean"===o||t instanceof Boolean)return i?[!0,0]:[!0,1==t?a.JsonSize.True:a.JsonSize.False];if("number"===o||t instanceof Number)return i?[!0,0]:[!0,(0,a.calculateNumberSize)(t)];if(t instanceof Date)return i?[!0,0]:[!0,isNaN(t.getDate())?a.JsonSize.Null:a.JsonSize.Date+2*a.JsonSize.Quote]}catch(s){return[!1,0]}if(!(0,a.isPlainObject)(t)&&!Array.isArray(t))return[!1,0];if(n.has(t))return[!1,0];n.add(t);try{return[!0,Object.entries(t).reduce((function(o,s,u,c){var l=r(s,2),f=l[0],d=e(l[1],i),p=r(d,2),h=p[0],v=p[1];if(!h)throw new Error("JSON validation did not pass. Validation process stopped.");return n.delete(t),i?0:o+(Array.isArray(t)?0:f.length+a.JsonSize.Comma+2*a.JsonSize.Colon)+v+(u0)||i&&null===e)}},t.validateJsonAndGetSize=s},88859:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;var i=(0,r(n(44054)).default)("metamask");t.createProjectLogger=function(e){return i.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},96013:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.isNullOrUndefined=function(e){return null===e||void 0===e},t.isObject=function(e){return Boolean(e)&&"object"===typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}t.hasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/g,t.isPlainObject=function(e){if("object"!==typeof e||null===e)return!1;try{for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(n){return!1}},t.isASCII=n,t.calculateStringSize=function(e){var r;return e.split("").reduce((function(e,t){return n(t)?e+1:e+2}),0)+(null!==(r=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==r?r:[]).length},t.calculateNumberSize=function(e){return e.toString().length}},3913:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;var r=n(35517),i=n(26135);t.numberToHex=function(e){return(0,r.assert)("number"===typeof e,"Value must be a number."),(0,r.assert)(e>=0,"Value must be a non-negative number."),(0,r.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(e.toString(16))};t.bigIntToHex=function(e){return(0,r.assert)("bigint"===typeof e,"Value must be a bigint."),(0,r.assert)(e>=0,"Value must be a non-negative bigint."),(0,i.add0x)(e.toString(16))};t.hexToNumber=function(e){(0,i.assertIsHexString)(e);var t=parseInt(e,16);return(0,r.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};t.hexToBigInt=function(e){return(0,i.assertIsHexString)(e),BigInt((0,i.add0x)(e))}},70304:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57519:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));var n=function(e,t){if(!function(e){return Number.isInteger(e)&&e>=0}(e))throw new Error('"'.concat(t,'" must be a non-negative integer. Received: "').concat(e,'".'))};t.inMilliseconds=function(e,t){return n(e,"count"),e*t},t.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}},81482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;var r=n(26931),i=n(62746),o=n(35517);t.VersionStruct=(0,i.refine)((0,i.string)(),"Version",(function(e){return null!==(0,r.valid)(e)||'Expected SemVer version, got "'.concat(e,'"')})),t.VersionRangeStruct=(0,i.refine)((0,i.string)(),"Version range",(function(e){return null!==(0,r.validRange)(e)||'Expected SemVer range, got "'.concat(e,'"')})),t.isValidSemVerVersion=function(e){return(0,i.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,i.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,o.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,o.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,r.gt)(e,t)},t.gtRange=function(e,t){return(0,r.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}},76756:function(e,t,n){var r=n(56690).default,i=n(89728).default,o=Symbol("SemVer ANY"),a=function(){"use strict";function e(t,n){if(r(this,e),n=s(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}d("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===o?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}return i(e,[{key:"parse",value:function(e){var t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new p(n[2],this.options.loose):this.semver=o}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(e){if(d("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"===typeof e)try{e=new p(e,this.options)}catch(t){return!1}return f(e,this.operator,this.semver,this.options)}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new h(t.value,n).test(this.value):""===t.operator?""===t.value||new h(this.value,n).test(t.semver):(!(n=s(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||(!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||(!!(f(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(f(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))))))}}],[{key:"ANY",get:function(){return o}}]),e}();e.exports=a;var s=n(45505),u=n(60997),c=u.re,l=u.t,f=n(24671),d=n(91050),p=n(95210),h=n(84999)},84999:function(e,t,n){var r=n(861).default,i=n(74704).default,o=n(56690).default,a=n(89728).default,s=function(){"use strict";function e(t,n){var r=this;if(o(this,e),n=c(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof l)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split("||").map((function(e){return r.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(t));if(this.set.length>1){var a=this.set[0];if(this.set=this.set.filter((function(e){return!k(e[0])})),0===this.set.length)this.set=[a];else if(this.set.length>1){var s,u=i(this.set);try{for(u.s();!(s=u.n()).done;){var f=s.value;if(1===f.length&&_(f[0])){this.set=[f];break}}}catch(d){u.e(d)}finally{u.f()}}}this.format()}return a(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this;e=e.trim();var n=((this.options.includePrerelease&&w)|(this.options.loose&&x))+":"+e,o=u.get(n);if(o)return o;var a=this.options.loose,s=a?h[v.HYPHENRANGELOOSE]:h[v.HYPHENRANGE];e=e.replace(s,M(this.options.includePrerelease)),f("hyphen replace",e),e=e.replace(h[v.COMPARATORTRIM],m),f("comparator trim",e);var c=(e=(e=(e=e.replace(h[v.TILDETRIM],g)).replace(h[v.CARETTRIM],y)).split(/\s+/).join(" ")).split(" ").map((function(e){return A(e,t.options)})).join(" ").split(/\s+/).map((function(e){return N(e,t.options)}));a&&(c=c.filter((function(e){return f("loose invalid filter",e,t.options),!!e.match(h[v.COMPARATORLOOSE])}))),f("range list",c);var d,p=new Map,b=c.map((function(e){return new l(e,t.options)})),_=i(b);try{for(_.s();!(d=_.n()).done;){var E=d.value;if(k(E))return[E];p.set(E.value,E)}}catch(O){_.e(O)}finally{_.f()}p.size>1&&p.has("")&&p.delete("");var S=r(p.values());return u.set(n,S),S}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((function(e){return E(e,n)&&t.set.some((function(t){return E(t,n)&&e.every((function(e){return t.every((function(t){return e.intersects(t,n)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"===typeof e)try{e=new d(e,this.options)}catch(n){return!1}for(var t=0;t=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):S(i)?a=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(f("replaceTilde pr",o),a=">=".concat(n,".").concat(r,".").concat(i,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):a=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),f("tilde return",a),a}))},P=function(e,t){return e.trim().split(/\s+/).map((function(e){return C(e,t)})).join(" ")},C=function(e,t){f("caret",e,t);var n=t.loose?h[v.CARETLOOSE]:h[v.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(function(t,n,i,o,a){var s;return f("caret",e,t,n,i,o,a),S(n)?s="":S(i)?s=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):S(o)?s="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):a?(f("replaceCaret pr",a),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(+n+1,".0.0-0")):(f("no pr"),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),f("caret return",s),s}))},I=function(e,t){return f("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return R(e,t)})).join(" ")},R=function(e,t){e=e.trim();var n=t.loose?h[v.XRANGELOOSE]:h[v.XRANGE];return e.replace(n,(function(n,r,i,o,a,s){f("xRange",e,n,r,i,o,a,s);var u=S(i),c=u||S(o),l=c||S(a),d=l;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(o=0),a=0,">"===r?(r=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===r&&(r="<",c?i=+i+1:o=+o+1),"<"===r&&(s="-0"),n="".concat(r+i,".").concat(o,".").concat(a).concat(s)):c?n=">=".concat(i,".0.0").concat(s," <").concat(+i+1,".0.0-0"):l&&(n=">=".concat(i,".").concat(o,".0").concat(s," <").concat(i,".").concat(+o+1,".0-0")),f("xRange return",n),n}))},j=function(e,t){return f("replaceStars",e,t),e.trim().replace(h[v.STAR],"")},N=function(e,t){return f("replaceGTE0",e,t),e.trim().replace(h[t.includePrerelease?v.GTE0PRE:v.GTE0],"")},M=function(e){return function(t,n,r,i,o,a,s,u,c,l,f,d,p){return n=S(r)?"":S(i)?">=".concat(r,".0.0").concat(e?"-0":""):S(o)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):a?">=".concat(n):">=".concat(n).concat(e?"-0":""),u=S(c)?"":S(l)?"<".concat(+c+1,".0.0-0"):S(f)?"<".concat(c,".").concat(+l+1,".0-0"):d?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(d):e?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(u),"".concat(n," ").concat(u).trim()}},L=function(e,t,n){for(var r=0;r0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}},95210:function(e,t,n){var r=n(56690).default,i=n(89728).default,o=n(91050),a=n(12319),s=a.MAX_LENGTH,u=a.MAX_SAFE_INTEGER,c=n(60997),l=c.re,f=c.t,d=n(45505),p=n(61068).compareIdentifiers,h=function(){"use strict";function e(t,n){if(r(this,e),n=d(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!==typeof t)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof t,'".'));if(t.length>s)throw new TypeError("version is longer than ".concat(s," characters"));o("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=t.trim().match(n.loose?l[f.LOOSE]:l[f.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){var o=[t,r];!1===n&&(o=[t]),0===p(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();e.exports=h},51976:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},24671:function(e,t,n){var r=n(90416),i=n(33962),o=n(18930),a=n(50316),s=n(93991),u=n(94838);e.exports=function(e,t,n,c){switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e===n;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return i(e,n,c);case">":return o(e,n,c);case">=":return a(e,n,c);case"<":return s(e,n,c);case"<=":return u(e,n,c);default:throw new TypeError("Invalid operator: ".concat(t))}}},47021:function(e,t,n){var r=n(95210),i=n(84342),o=n(60997),a=o.re,s=o.t;e.exports=function(e,t){if(e instanceof r)return e;if("number"===typeof e&&(e=String(e)),"string"!==typeof e)return null;var n=null;if((t=t||{}).rtl){for(var o;(o=a[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),a[s.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;a[s.COERCERTL].lastIndex=-1}else n=e.match(a[s.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},24046:function(e,t,n){var r=n(95210);e.exports=function(e,t,n){var i=new r(e,n),o=new r(t,n);return i.compare(o)||i.compareBuild(o)}},76858:function(e,t,n){var r=n(34324);e.exports=function(e,t){return r(e,t,!0)}},34324:function(e,t,n){var r=n(95210);e.exports=function(e,t,n){return new r(e,n).compare(new r(t,n))}},82190:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,null,!0),i=r(t,null,!0),o=n.compare(i);if(0===o)return null;var a=o>0,s=a?i:n,u=!!(a?n:i).prerelease.length,c=u?"pre":"";return n.major!==i.major?c+"major":n.minor!==i.minor?c+"minor":n.patch!==i.patch?c+"patch":u?"prerelease":s.patch?"patch":s.minor?"minor":"major"}},90416:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return 0===r(e,t,n)}},18930:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)>0}},50316:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)>=0}},75950:function(e,t,n){var r=n(95210);e.exports=function(e,t,n,i,o){"string"===typeof n&&(o=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,o).version}catch(a){return null}}},93991:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)<0}},94838:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)<=0}},99881:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).major}},36925:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).minor}},33962:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return 0!==r(e,t,n)}},84342:function(e,t,n){var r=n(95210);e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e instanceof r)return e;try{return new r(e,t)}catch(i){if(!n)return null;throw i}}},99149:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).patch}},36090:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},35008:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(t,e,n)}},13536:function(e,t,n){var r=n(24046);e.exports=function(e,t){return e.sort((function(e,n){return r(n,e,t)}))}},25656:function(e,t,n){var r=n(84999);e.exports=function(e,t,n){try{t=new r(t,n)}catch(i){return!1}return t.test(e)}},9210:function(e,t,n){var r=n(24046);e.exports=function(e,t){return e.sort((function(e,n){return r(e,n,t)}))}},16038:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,t);return n?n.version:null}},26931:function(e,t,n){var r=n(60997),i=n(12319),o=n(95210),a=n(61068),s=n(84342),u=n(16038),c=n(51976),l=n(75950),f=n(82190),d=n(99881),p=n(36925),h=n(99149),v=n(36090),m=n(34324),g=n(35008),y=n(76858),b=n(24046),w=n(9210),x=n(13536),k=n(18930),_=n(93991),E=n(90416),A=n(33962),S=n(50316),O=n(94838),T=n(24671),P=n(47021),C=n(76756),I=n(84999),R=n(25656),j=n(32212),N=n(46395),M=n(80213),L=n(34869),U=n(40857),D=n(65704),B=n(7566),F=n(52928),Z=n(22480),z=n(50772),H=n(99180);e.exports={parse:s,valid:u,clean:c,inc:l,diff:f,major:d,minor:p,patch:h,prerelease:v,compare:m,rcompare:g,compareLoose:y,compareBuild:b,sort:w,rsort:x,gt:k,lt:_,eq:E,neq:A,gte:S,lte:O,cmp:T,coerce:P,Comparator:C,Range:I,satisfies:R,toComparators:j,maxSatisfying:N,minSatisfying:M,minVersion:L,validRange:U,outside:D,gtr:B,ltr:F,intersects:Z,simplifyRange:z,subset:H,SemVer:o,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},12319:function(e){var t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},91050:function(e){var t="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.NODE_DEBUG)?function(){for(var e,t=arguments.length,n=new Array(t),r=0;r)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(a[s.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(a[s.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:".concat(a[s.PRERELEASE],")?").concat(a[s.BUILD],"?")+")?)?"),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(a[s.PRERELEASELOOSE],")?").concat(a[s.BUILD],"?")+")?)?"),c("XRANGE","^".concat(a[s.GTLT],"\\s*").concat(a[s.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(a[s.GTLT],"\\s*").concat(a[s.XRANGEPLAINLOOSE],"$")),c("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])"),c("COERCERTL",a[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(a[s.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",c("TILDE","^".concat(a[s.LONETILDE]).concat(a[s.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(a[s.LONETILDE]).concat(a[s.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(a[s.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",c("CARET","^".concat(a[s.LONECARET]).concat(a[s.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(a[s.LONECARET]).concat(a[s.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(a[s.GTLT],"\\s*(").concat(a[s.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(a[s.GTLT],"\\s*(").concat(a[s.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(a[s.GTLT],"\\s*(").concat(a[s.LOOSEPLAIN],"|").concat(a[s.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(a[s.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(a[s.XRANGEPLAIN],")")+"\\s*$"),c("HYPHENRANGELOOSE","^\\s*(".concat(a[s.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(a[s.XRANGEPLAINLOOSE],")")+"\\s*$"),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7566:function(e,t,n){var r=n(65704);e.exports=function(e,t,n){return r(e,t,">",n)}},22480:function(e,t,n){var r=n(84999);e.exports=function(e,t,n){return e=new r(e,n),t=new r(t,n),e.intersects(t,n)}},52928:function(e,t,n){var r=n(65704);e.exports=function(e,t,n){return r(e,t,"<",n)}},46395:function(e,t,n){var r=n(95210),i=n(84999);e.exports=function(e,t,n){var o=null,a=null,s=null;try{s=new i(t,n)}catch(u){return null}return e.forEach((function(e){s.test(e)&&(o&&-1!==a.compare(e)||(a=new r(o=e,n)))})),o}},80213:function(e,t,n){var r=n(95210),i=n(84999);e.exports=function(e,t,n){var o=null,a=null,s=null;try{s=new i(t,n)}catch(u){return null}return e.forEach((function(e){s.test(e)&&(o&&1!==a.compare(e)||(a=new r(o=e,n)))})),o}},34869:function(e,t,n){var r=n(95210),i=n(84999),o=n(18930);e.exports=function(e,t){e=new i(e,t);var n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(var a=function(){var t=e.set[s],i=null;t.forEach((function(e){var t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!o(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}})),!i||n&&!o(n,i)||(n=i)},s=0;s":p=u,h=l,v=c,m=">",g=">=";break;case"<":p=c,h=f,v=u,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,d))return!1;for(var y=function(){var n=t.set[b],r=null,a=null;return n.forEach((function(e){e.semver===o&&(e=new i(">=0.0.0")),r=r||e,a=a||e,p(e.semver,r.semver,d)?r=e:v(e.semver,a.semver,d)&&(a=e)})),r.operator===m||r.operator===g?{v:!1}:a.operator&&a.operator!==m||!h(e,a.semver)?a.operator===g&&v(e,a.semver)?{v:!1}:void 0:{v:!1}},b=0;b=".concat(y)):h.push("*")}var w=h.join(" || "),x="string"===typeof t.raw?t.raw:String(t);return w.length=0.0.0-0")],l=[new o(">=0.0.0")],f=function(e,t,n){if(e===t)return!0;if(1===e.length&&e[0].semver===a){if(1===t.length&&t[0].semver===a)return!0;e=n.includePrerelease?c:l}if(1===t.length&&t[0].semver===a){if(n.includePrerelease)return!0;t=l}var i,o,f,h,v=new Set,m=r(e);try{for(m.s();!(f=m.n()).done;){var g=f.value;">"===g.operator||">="===g.operator?i=d(i,g,n):"<"===g.operator||"<="===g.operator?o=p(o,g,n):v.add(g.semver)}}catch(j){m.e(j)}finally{m.f()}if(v.size>1)return null;if(i&&o){if((h=u(i.semver,o.semver,n))>0)return null;if(0===h&&(">="!==i.operator||"<="!==o.operator))return null}var y,b,w,x,k,_=r(v);try{for(_.s();!(y=_.n()).done;){var E=y.value;if(i&&!s(E,String(i),n))return null;if(o&&!s(E,String(o),n))return null;var A,S=r(t);try{for(S.s();!(A=S.n()).done;){var O=A.value;if(!s(E,String(O),n))return!1}}catch(j){S.e(j)}finally{S.f()}return!0}}catch(j){_.e(j)}finally{_.f()}var T=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,P=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;T&&1===T.prerelease.length&&"<"===o.operator&&0===T.prerelease[0]&&(T=!1);var C,I=r(t);try{for(I.s();!(C=I.n()).done;){var R=C.value;if(k=k||">"===R.operator||">="===R.operator,x=x||"<"===R.operator||"<="===R.operator,i)if(P&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===P.major&&R.semver.minor===P.minor&&R.semver.patch===P.patch&&(P=!1),">"===R.operator||">="===R.operator){if((b=d(i,R,n))===R&&b!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(R),n))return!1;if(o)if(T&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===T.major&&R.semver.minor===T.minor&&R.semver.patch===T.patch&&(T=!1),"<"===R.operator||"<="===R.operator){if((w=p(o,R,n))===R&&w!==o)return!1}else if("<="===o.operator&&!s(o.semver,String(R),n))return!1;if(!R.operator&&(o||i)&&0!==h)return!1}}catch(j){I.e(j)}finally{I.f()}return!(i&&x&&!o&&0!==h)&&(!(o&&k&&!i&&0!==h)&&(!P&&!T))},d=function(e,t,n){if(!e)return t;var r=u(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},p=function(e,t,n){if(!e)return t;var r=u(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return!0;e=new i(e,n),t=new i(t,n);var o,a=!1,s=r(e.set);try{e:for(s.s();!(o=s.n()).done;){var u,c=o.value,l=r(t.set);try{for(l.s();!(u=l.n()).done;){var d=u.value,p=f(c,d,n);if(a=a||null!==p,p)continue e}}catch(h){l.e(h)}finally{l.f()}if(a)return!1}}catch(h){s.e(h)}finally{s.f()}return!0}},32212:function(e,t,n){var r=n(84999);e.exports=function(e,t){return new r(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))}},40857:function(e,t,n){var r=n(84999);e.exports=function(e,t){try{return new r(e,t).range||"*"}catch(n){return null}}},17391:function(e){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var f=0,d=o-1;(0!==l||f