1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1493],{69930:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(512);function n(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout(()=>{throw e})}}class i extends s.EventEmitter{emit(e,...t){let r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let r=Error(`Unhandled error.${e?` (${e.message})`:""}`);throw r.context=e,r}let i=s[e];if(void 0===i)return!1;if("function"==typeof i)n(i,this,t);else{let e=i.length,r=function(e){let t=e.length,r=Array(t);for(let s=0;s<t;s+=1)r[s]=e[s];return r}(i);for(let s=0;s<e;s+=1)n(r[s],this,t)}return!0}}t.default=i},65816:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r(50044),n=r(71236),i=function(){function e(){this._semaphore=new n.default(1)}return e.prototype.acquire=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,e.sent()[1]]}})})},e.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();t.default=i},71236:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r(50044),n=function(){function e(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw Error("semaphore must be initialized to a positive value");this._value=e}return e.prototype.acquire=function(){var e=this,t=this.isLocked(),r=new Promise(function(t){return e._queue.push(t)});return t||this._dispatch(),r},e.prototype.runExclusive=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,r,n;return s.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=(t=s.sent())[0],n=t[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(r)];case 3:return[2,s.sent()];case 4:return n(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var r=!1;this._currentReleaser=function(){r||(r=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();t.default=n},72140:function(e,t,r){"use strict";t.WU=void 0;var s=r(65816);Object.defineProperty(t,"WU",{enumerable:!0,get:function(){return s.default}}),r(71236),r(41335)},41335:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=void 0;var s=r(50044);t.withTimeout=function(e,t,r){var n=this;return void 0===r&&(r=Error("timeout")),{acquire:function(){return new Promise(function(i,o){return s.__awaiter(n,void 0,void 0,function(){var n,a;return s.__generator(this,function(s){switch(s.label){case 0:return n=!1,setTimeout(function(){n=!0,o(r)},t),[4,e.acquire()];case 1:return a=s.sent(),n?(Array.isArray(a)?a[1]:a)():i(a),[2]}})})})},runExclusive:function(e){return s.__awaiter(this,void 0,void 0,function(){var t,r;return s.__generator(this,function(s){switch(s.label){case 0:t=function(){},s.label=1;case 1:return s.trys.push([1,,7,8]),[4,this.acquire()];case 2:if(!Array.isArray(r=s.sent()))return[3,4];return t=r[1],[4,e(r[0])];case 3:case 5:return[2,s.sent()];case 4:return t=r,[4,e()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}},41765:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;let s=r(42887),n=r(41753),i=r(85811),o=r(50749),a=r(59443),c=r(51644),l=r(73329),u=r(57098),d=r(45876),h=r(91505),p=r(67124);class f{constructor(e){var t,r,s;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;
1let a=e.linkAPIUrl||n.LINK_API_URL;void 0===e.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this._overrideIsCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=null===(s=e.reloadOnDisconnect)||void 0===s||s;let g=new URL(a),m=`${g.protocol}//${g.host}`;if(this._storage=new o.ScopedLocalStorage(`-walletlink:${m}`),this._storage.setItem("version",f.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new u.RelayEventManager;let b=(0,i.isMobileWeb)(),y=e.uiConstructor||(e=>b?new l.MobileRelayUI(e):new d.WalletLinkRelayUI(e)),v={linkAPIUrl:a,version:p.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:y,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};if(this._relay=b?new c.MobileRelay(v):new h.WalletLinkRelay(v),this.setAppInfo(e.appName,e.appLogoUrl),e.headlessMode)return;this._relay.attachUI()}makeWeb3Provider(e="",t=1){let r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"==typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;let s=this.coinbaseBrowser;if(s)return s;let n=this._relay;if(!n||!this._relayEventManager||!this._storage)throw Error("Relay not initialized, should never happen");return e||n.setConnectDisabled(!0),new a.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(n),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:t,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,t){var r;this._appName=e||"DApp",this._appLogoUrl=t||(0,i.getFavicon)();let s=this.walletExtension;s?this.isCipherProvider(s)||s.setAppInfo(this._appName,this._appLogoUrl):null===(r=this._relay)||void 0===r||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;let t=this===null||void 0===this?void 0:this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}getQrUrl(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}getCoinbaseWalletLogo(e,t=240){return(0,s.walletLogo)(e,t)}get walletExtension(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}get coinbaseBrowser(){var e,t;try{let r=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!r)return;if("isCoinbaseBrowser"in r&&r.isCoinbaseBrowser)return r;return}catch(e){return}}isCipherProvider(e){return"boolean"==typeof e.isCipher&&e.isCipher}}t.CoinbaseWalletSDK=f,f.VERSION=p.LIB_VERSION},42887:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0,t.walletLogo=(e,t)=>{let r;switch(e){case"standard":default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
1V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
1h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}}},41753:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LINK_API_URL=void 0,t.LINK_API_URL="https://www.walletlink.org"},67253:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.standardErrorCodes=void 0,t.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}},55719:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=void 0;let s=r(67253),n=r(51016);function i(e,t){let[r,s]=a(t);return new c(e,r||(0,n.getMessageFromCode)(e),s)}function o(e,t){let[r,s]=a(t);return new l(e,r||(0,n.getMessageFromCode)(e),s)}function a(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,r]}}return[]}t.standardErrors={rpc:{parse:e=>i(s.standardErrorCodes.rpc.parse,e),invalidRequest:e=>i(s.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>i(s.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>i(s.standardErrorCodes.rpc.methodNotFound,e),internal:e=>i(s.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code
1<= -32005');return i(t,e)},invalidInput:e=>i(s.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>i(s.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>i(s.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>i(s.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>i(s.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>i(s.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>o(s.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>o(s.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>o(s.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>o(s.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>o(s.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>o(s.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:s}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new l(t,r,s)}}};class c extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}}class l extends c{constructor(e,t,r){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},36769:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;let s=r(67253);Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return s.standardErrorCodes}});let n=r(55719);Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return n.standardErrors}});let i=r(64251);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}});let o=r(51016);Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return o.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return o.getMessageFromCode}})},64251:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=void 0;let s=r(66529),n=r(67124),i=r(67253),o=r(51016);t.serializeError=function(e,t){let r=(0,o.serialize)("string"==typeof e?{message:e,code:i.standardErrorCodes.rpc.internal}:(0,s.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e,{shouldIncludeStack:!0}),a=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");a.searchParams.set("version",n.LIB_VERSION),a.searchParams.set("code",r.code.toString());let c=function(e,t){let r=null==e?void 0:e.method;if(r)return r;if(void 0===t);else if("string"==typeof t)return t;else if(!Array.isArray(t))return t.method;else if(t.length>0)return t[0].method}(r.data,t);return c&&a.searchParams.set("method",c),a.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:a.href})}},51016:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let s=r(67253),n="Unspecified error message.";function i(e,r=n){if(e&&Number.isInteger(e)){let r=e.toString();if(c(s.errorValues,r))return s.errorValues[r].message;if(e>=-32099&&e<=-32e3)return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function o(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(s.errorValues[t]||e>=-32099&&e<=-32e3)}function a(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=i,t.isValidCode=o,t.getErrorCode=function(e){var t;return"number"==typeof e?e:"object"==typeof e&&null!==e&&("number"==typeof e.code||"number"==typeof e.errorCode)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0},t.serialize=function(e,{shouldIncludeStack:t=!1}={}){let r={};return e&&"object"==typeof e&&!Array.isArray(e)&&c(e,"code")&&o(e.code)?(r.code=e.code,e.message&&"string"==typeof e.message?(r.message=e.message,c(e,"data")&&(r.data=e.data)):(r.message=i(r.code),r.data={originalError:a(e)})):(r.code=s.standardErrorCodes.rpc.internal,r.message=l(e,"message")?e.message:n,r.data={originalError:a(e)}),t&&(r.stack=l(e,"stack")?e.stack:void 0),r}},58749:function(e,t){"use strict";var r,s;function n(){return e=>e}
1Object.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=n(),t.AddressString=n(),t.BigIntString=n(),t.IntNumber=function(e){return Math.floor(e)},t.RegExpString=n(),(s=r||(t.ProviderType=r={})).CoinbaseWallet="CoinbaseWallet",s.MetaMask="MetaMask",s.Unselected=""},85811:function(e,t,r){"use strict";var s=r(67133).Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isMobileWeb=t.getLocation=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;let i=n(r(56662)),o=r(36769),a=r(58749),c=/^[0-9]*$/,l=/^[a-f0-9]*$/;function u(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function d(e){return e.startsWith("0x")||e.startsWith("0X")}function h(e){return d(e)?e.slice(2):e}function p(e){return d(e)?`0x${e.slice(2)}`:`0x${e}`}function f(e){if("string"!=typeof e)return!1;let t=h(e).toLowerCase();return l.test(t)}function g(e,t=!1){if("string"==typeof e){let r=h(e).toLowerCase();if(l.test(r))return(0,a.HexString)(t?`0x${r}`:r)}throw o.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}function m(e,t=!1){let r=g(e,!1);return r.length%2==1&&(r=(0,a.HexString)(`0${r}`)),t?(0,a.HexString)(`0x${r}`):r}function b(e){if("number"==typeof e&&Number.isInteger(e))return(0,a.IntNumber)(e);if("string"==typeof e){if(c.test(e))return(0,a.IntNumber)(Number(e));if(f(e))return(0,a.IntNumber)(new i.default(m(e,!1),16).toNumber())}throw o.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}function y(e){if(null==e||"function"!=typeof e.constructor)return!1;let{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}function v(){try{return null!==window.frameElement}catch(e){return!1}}t.randomBytesHex=function(e){return u(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=u,t.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},t.hexStringFromBuffer=function(e,t=!1){let r=e.toString("hex");return(0,a.HexString)(t?`0x${r}`:r)},t.bigIntStringFromBN=function(e){return(0,a.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,a.IntNumber)(new i.default(m(e,!1),16).toNumber())},t.hexStringFromIntNumber=function(e){return(0,a.HexString)(`0x${new i.default(e).toString(16)}`)},t.has0xPrefix=d,t.strip0x=h,t.prepend0x=p,t.isHexString=f,t.ensureHexString=g,t.ensureEvenLengthHexString=m,t.ensureAddressString=function(e){if("string"==typeof e){let t=h(e).toLowerCase();if(f(t)&&40===t.length)return(0,a.AddressString)(p(t))}throw o.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)},t.ensureBuffer=function(e){if(s.isBuffer(e))return e;if("string"==typeof e){if(f(e)){let t=m(e,!1);return s.from(t,"hex")}return s.from(e,"utf8")}throw o.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)},t.ensureIntNumber=b,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,a.RegExpString)(e.toString());throw o.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)},t.ensureBN=function(e){if(null!==e&&(i.default.isBN(e)||y(e)))return new i.default(e.toString(10),10);if("number"==typeof e)return new i.default(b(e));if("string"==typeof e){if(c.test(e))return new i.default(e,10);if(f(e))return new i.default(m(e,!1),16)}throw o.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)},t.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw o.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)},t.isBigNumber=y,t.range=function(e,t){return Array.from({length:t-e},(t,r)=>e+r)},t.getFavicon=function(){let e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,s=e?e.getAttribute("href"):null;return!s||s.startsWith("javascript:")||s.startsWith("vbscript:")?null:s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")?s:s.startsWith("//")?t+s:`${t}//${r}${s}`},t.createQrUrl=function(e,t,r,s,n,i){let o=new URLSearchParams({[s?"parent-id":"id"]:e,secret:t,server:r,v:n,chainId:i.toString()}).toString();return`${r}/#/link?${o}`},t.isInIFrame=v,t.getLocation=function(){try{if(v()&&window.top)return window.top.location;return window.location}catch(e){return window.location}},t.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(e=null==window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)}},51493:function(e,t,r){"use strict";let s=r(41765),n=r(59443);r(41765),r(59443),t.default=s.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=s.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=s.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)},24020:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Cipher=void 0;let s=r(85811);class n{constructor(e){this.secret=e}async encrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,s.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(e)),a=o.slice(o.byteLength-16),c=o.slice(0,o.byteLength-16),l=new Uint8Array(a),u=new Uint8Array(c),d=new Uint8Array([...r,...l,...u]);return(0,s.uint8ArrayToHex)(d)}async decrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((r,n)=>{!async function(){let i=await crypto.subtle.importKey("raw",(0,s.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,s.hexStringToUint8Array)(e),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{let e=await window.crypto.subtle.decrypt(d,i,u),t=new TextDecoder;r(t.decode(e))}catch(e){n(e)}}()})}}t.Cipher=n},50749:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;class r{constructor(e){this.scope=e}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){let s=localStorage.key(r);"string"==typeof s&&s.startsWith(e)&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return`${this.scope}:${e}`}}t.ScopedLocalStorage=r},66472:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'},10598:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.injectCssReset=void 0;let n=s(r(66472));t.injectCssReset=function(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(n.default)),document.documentElement.appendChild(e)}},59443:function(e,t,r){"use strict";var s=r(67133).Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=void 0;let i=n(r(56662)),o=r(28729),a=r(36769),c=r(85811),l=r(51644),u=r(59561),d=r(8546),h=r(66529),p=n(r(86642)),f=r(99078),g=r(82608),m=r(93772),b="DefaultChainId",y="DefaultJsonRpcUrl";class v extends o.EventEmitter{constructor(e){var t,r;super(),this._filterPolyfill=new g.FilterPolyfill(this),this._subscriptionManager=new m.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this.isCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this.qrUrl=e.qrUrl;let s=this.getChainId(),n=(0,c.prepend0x)(s.toString(16));this.emit("connect",{chainIdStr:n});let i=this._storage.getItem(u.LOCAL_STORAGE_ADDRESSES_KEY);if(i){let e=i.split(" ");""!==e[0]&&(this._addresses=e.map(e=>(0,c.ensureAddressString)(e)),this.emit("accountsChanged",e))}this._subscriptionManager.events.on("notification",e=>{this.emit("message",{type:e.method,data:e.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",e=>{var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type&&"dappChainSwitched"===e.data.data.action){let r=e.data.data.chainId,s=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:this.jsonRpcUrl;this.updateProviderInfo(s,Number(r))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,c.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(y))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(y,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,t){this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,t){this.jsonRpcUrl=e;let r=this.getChainId();this._storage.setItem(b,t.toString(10)),(0,c.ensureIntNumber)(t)===r&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,s,n,i){let o=await this.initializeRelay(),a=await o.watchAsset(e,t,r,s,n,null==i?void 0:i.toString()).promise;return!(0,h.isErrorResponse)(a)&&!!a.result}async addEthereumChain(e,t,r,s,n,i){var o,a;if((0,c.ensureIntNumber)(e)===this.getChainId())return!1;let l=await this.initializeRelay(),u=l.inlineAddEthereumChain(e.toString());this._isAuthorized()||u||await l.requestEthereumAccounts().promise;let d=await l.addEthereumChain(e.toString(),t,n,r,s,i).promise;return!(0,h.isErrorResponse)(d)&&((null===(o=d.result)||void 0===o?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),(null===(a=d.result)||void 0===a?void 0:a.isApproved)===!0)}async switchEthereumChain(e){let t=await this.initializeRelay(),r=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,h.isErrorResponse)(r)){if(!r.errorCode)return;if(r.errorCode===a.standardErrorCodes.provider.unsupportedChain)throw a.standardErrors.provider.unsupportedChain();throw a.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}let s=r.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,e)}setAppInfo(e,t){this.initializeRelay().then(r=>r.setAppInfo(e,t))}async enable(){var e;return(null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,t){try{let r=this._send(e,t);if(r instanceof Promise)return r.catch(t=>
1{throw(0,a.serializeError)(t,e)})}catch(t){throw(0,a.serializeError)(t,e)}}_send(e,t){if("string"==typeof e){let r=Array.isArray(t)?t:void 0!==t?[t]:[];return this._sendRequestAsync({jsonrpc:"2.0",id:0,method:e,params:r}).then(e=>e.result)}return"function"==typeof t?this._sendAsync(e,t):Array.isArray(e)?e.map(e=>this._sendRequest(e)):this._sendRequest(e)}async sendAsync(e,t){try{return this._sendAsync(e,t).catch(t=>{throw(0,a.serializeError)(t,e)})}catch(t){return Promise.reject((0,a.serializeError)(t,e))}}async _sendAsync(e,t){if("function"!=typeof t)throw Error("callback is required");if(Array.isArray(e)){this._sendMultipleRequestsAsync(e).then(e=>t(null,e)).catch(e=>t(e,null));return}return this._sendRequestAsync(e).then(e=>t(null,e)).catch(e=>t(e,null))}async request(e){try{return this._request(e).catch(t=>{throw(0,a.serializeError)(t,e.method)})}catch(t){return Promise.reject((0,a.serializeError)(t,e.method))}}async _request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw a.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw a.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw a.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});let s=void 0===r?[]:r,n=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:s,jsonrpc:"2.0",id:n})).result}async scanQRCode(e){let t=await this.initializeRelay(),r=await t.scanQRCode((0,c.ensureRegExpString)(e)).promise;if((0,h.isErrorResponse)(r))throw(0,a.serializeError)(r.errorMessage,"scanQRCode");if("string"!=typeof r.result)throw(0,a.serializeError)("result was not a string","scanQRCode");return r.result}async genericRequest(e,t){let r=await this.initializeRelay(),s=await r.genericRequest(e,t).promise;if((0,h.isErrorResponse)(s))throw(0,a.serializeError)(s.errorMessage,"generic");if("string"!=typeof s.result)throw(0,a.serializeError)("result was not a string","generic");return s.result}async connectAndSignIn(e){var t;let r;null===(t=this.diagnostic)||void 0===t||t.log(f.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0});try{let t=await this.initializeRelay();if(!(t instanceof l.MobileRelay))throw Error("connectAndSignIn is only supported on mobile");if(r=await t.connectAndSignIn(e).promise,(0,h.isErrorResponse)(r))throw Error(r.errorMessage)}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!r.result)throw Error("accounts received is empty");let{accounts:s}=r.result;return this._setAddresses(s),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),r.result}async selectProvider(e){let t=await this.initializeRelay(),r=await t.selectProvider(e).promise;if((0,h.isErrorResponse)(r))throw(0,a.serializeError)(r.errorMessage,"selectProvider");if("string"!=typeof r.result)throw(0,a.serializeError)("result was not a string","selectProvider");return r.result}supportsSubscriptions(){return!1}subscribe(){throw Error("Subscriptions are not supported")}unsubscribe(){throw Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){let t={jsonrpc:"2.0",id:e.id},{method:r}=e;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return t}_setAddresses(e,t){if(!Array.isArray(e))throw Error("addresses is not an array");let r=e.map(e=>(0,c.ensureAddressString)(e));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(u.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{let s=this._handleSynchronousMethods(e);if(void 0!==s)return t({jsonrpc:"2.0",id:e.id,result:s});let n=this._handleAsynchronousFilterMethods(e);if(void 0!==n){n.then(r=>t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e));return}let i=this._handleSubscriptionMethods(e);if(void 0!==i){i.then(r=>
1t({jsonrpc:"2.0",id:e.id,result:r.result})).catch(e=>r(e));return}}catch(e){return r(e)}this._handleAsynchronousMethods(e).then(r=>r&&t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(e=>this._sendRequestAsync(e)))}_handleSynchronousMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(r);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(t=>{var r;throw(t.code===a.standardErrorCodes.rpc.methodNotFound||t.code===a.standardErrorCodes.rpc.methodNotSupported)&&(null===(r=this.diagnostic)||void 0===r||r.log(f.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0})),t})}_handleAsynchronousFilterMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_newFilter":return this._eth_newFilter(r);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(r);case"eth_getFilterLogs":return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{let t=(0,c.ensureAddressString)(e);return this._addresses.map(e=>(0,c.ensureAddressString)(e)).includes(t)}catch(e){}return!1}_ensureKnownAddress(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(f.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),Error("Unknown Ethereum address")}_prepareTransactionParams(e){let t=e.from?(0,c.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw Error("Ethereum address is unavailable");this._ensureKnownAddress(t);let r=e.to?(0,c.ensureAddressString)(e.to):null,n=null!=e.value?(0,c.ensureBN)(e.value):new i.default(0),o=e.data?(0,c.ensureBuffer)(e.data):s.alloc(0),a=null!=e.nonce?(0,c.ensureIntNumber)(e.nonce):null,l=null!=e.gasPrice?(0,c.ensureBN)(e.gasPrice):null,u=null!=e.maxFeePerGas?(0,c.ensureBN)(e.maxFeePerGas):null;return{fromAddress:t,toAddress:r,weiValue:n,data:o,nonce:a,gasPriceInWei:l,maxFeePerGas:u,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,c.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,c.ensureBN)(e.gas):null,chainId:e.chainId?(0,c.ensureIntNumber)(e.chainId):this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw a.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw a.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,s){this._ensureKnownAddress(t);try{let n=await this.initializeRelay(),i=await n.signEthereumMessage(e,t,r,s).promise;if((0,h.isErrorResponse)(i))throw Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied message signature");throw e}}async _ethereumAddressFromSignedMessage(e,t,r){let s=await this.initializeRelay(),n=await s.ethereumAddressFromSignedMessage(e,t,r).promise;if((0,h.isErrorResponse)(n))throw Error(n.errorMessage);return{jsonrpc:"2.0",id:0,result:n.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,c.hexStringFromIntNumber)(this.getChainId())}getChainId(){let e=this._storage.getItem(b);if(!e)return(0,c.ensureIntNumber)(this._chainIdFromOpts);let t=parseInt(e,10);return(0,c.ensureIntNumber)(t)}async _eth_requestAccounts(){var e;let t;if(null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?d.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});try{let e=await this.initializeRelay();if(t=await e.requestEthereumAccounts().promise,(0,h.isErrorResponse)(t))throw Error(t.errorMessage)}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!t.result)throw Error("accounts received is empty");return this._setAddresses(t.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();let t=(0,c.ensureAddressString)(e[0]),r=(0,c.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){let t=(0,c.ensureBuffer)(e[0]),r=(0,c.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();let t=(0,c.ensureBuffer)(e[0]),r=(0,c.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){let t=(0,c.ensureBuffer)(e[0]),r=(0,c.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();let t=this._prepareTransactionParams(e[0]||{});try{let e=await this.initializeRelay(),r=await e.signEthereumTransaction(t).promise;if((0,h.isErrorResponse)(r))throw Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_sendRawTransaction(e){let t=(0,c.ensureBuffer)(e[0]),r=await this.initializeRelay(),s=await r.submitEthereumTransaction(t,this.getChainId()).promise;if((0,h.isErrorResponse)(s))throw Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(e){this._requireAuthorization();let t=this._prepareTransactionParams(e[0]||{});try{let e=await this.initializeRelay(),r=await e.signAndSubmitEthereumTransaction(t).promise;if((0,h.isErrorResponse)(r))throw Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_signTypedData_v1(e){this._requireAuthorization();let t=(0,c.ensureParsedJSONObject)(e[0]),r=(0,c.ensureAddressString)(e[1]);this._ensureKnownAddress(r);let s=p.default.hashForSignTypedDataLegacy({data:t}),n=JSON.stringify(t,null,2);return this._signEthereumMessage(s,r,!1,n)}async _eth_signTypedData_v3(e){this._requireAuthorization();let t=(0,c.ensureAddressString)(e[0]),r=(0,c.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);let s=p.default.hashForSignTypedData_v3({data:r}),n=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,n)}async _eth_signTypedData_v4(e){this._requireAuthorization();let t=(0,c.ensureAddressString)(e[0]),r=(0,c.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);let s=p.default.hashForSignTypedData_v4({data:r}),n=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,n)}async _cbwallet_arbitrary(e){let t=e[0],r=e[1];if("string"!=typeof r)throw Error("parameter must be a string");if("object"!=typeof t||null===t)throw Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(t,r)}}async _wallet_addEthereumChain(e){var t,r,s,n;let i=e[0];if((null===(t=i.rpcUrls)||void 0===t?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!i.chainName||""===i.chainName.trim())throw a.standardErrors.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw a.standardErrors.rpc.invalidParams("nativeCurrency is a required field");let o=parseInt(i.chainId,16);return await this.addEthereumChain(o,null!==(r=i.rpcUrls)&&void 0!==r?r:[],null!==(s=i.blockExplorerUrls)&&void 0!==s?s:[],i.chainName,null!==(n=i.iconUrls)&&void 0!==n?n:[],i.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){let t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){let t=Array.isArray(e)?e[0]:e;if(!t.type)throw a.standardErrors.rpc.invalidParams("Type is required");if((null==t?void 0:t.type)!=="ERC20")throw a.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw a.standardErrors.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw a.standardErrors.rpc.invalidParams("Address is required");let r=this.getChainId(),{address:s,symbol:n,image:i,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,s,n,o,i,r)}}_eth_uninstallFilter(e){let t=(0,c.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}async _eth_newFilter(e){let t=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(t)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){let t=(0,c.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}_eth_getFilterLogs(e){let t=(0,c.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((e,t)=>this._setAddresses(e,t)),e.setChainCallback((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}t.CoinbaseWalletProvider=v},99078:function(e,t){"use strict";
1Object.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",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}},82608:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterFromParam=t.FilterPolyfill=void 0;let s=r(58749),n=r(85811),i={jsonrpc:"2.0",id:0};class o{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,s.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){let t=a(e),r=this.makeFilterId(),s=await this.setInitialCursorPosition(r,t.fromBlock);return console.info(`Installing new log filter(${r}):`,t,"initial cursor position:",s),this.logFilters.set(r,t),this.setFilterTimeout(r),(0,n.hexStringFromIntNumber)(r)}async newBlockFilter(){let e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,t),this.blockFilters.add(e),this.setFilterTimeout(e),(0,n.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){let e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,t),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,n.hexStringFromIntNumber)(e)}uninstallFilter(e){let t=(0,n.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${t})`),this.deleteFilter(t),!0}getFilterChanges(e){let t=(0,n.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(d())}async getFilterLogs(e){let t=(0,n.intNumberFromHexString)(e),r=this.logFilters.get(t);return r?this.sendAsyncPromise(Object.assign(Object.assign({},i),{method:"eth_getLogs",params:[c(r)]})):d()}makeFilterId(){return(0,s.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((t,r)=>{this.provider.sendAsync(e,(e,s)=>e?r(e):Array.isArray(s)||null==s?r(Error(`unexpected response received: ${JSON.stringify(s)}`)):void t(s))})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){let t=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!t)return d();let o=await this.getCurrentBlockHeight(),a="latest"===t.toBlock?o:t.toBlock;if(r>o||r>Number(t.toBlock))return h();console.info(`Fetching logs from ${r} to ${a} for filter ${e}`);let l=await this.sendAsyncPromise(Object.assign(Object.assign({},i),{method:"eth_getLogs",params:[c(Object.assign(Object.assign({},t),{fromBlock:r,toBlock:a}))]}));if(Array.isArray(l.result)){let t=Math.max(...l.result.map(e=>(0,n.intNumberFromHexString)(e.blockNumber||"0x0")));if(t&&t>r){let n=(0,s.IntNumber)(t+1);console.info(`Moving cursor position for filter (${e}) from ${r} to ${n}`),this.cursors.set(e,n)}}return l}async getBlockFilterChanges(e){let t=this.cursors.get(e);if(!t)return d();let r=await this.getCurrentBlockHeight();if(t>r)return h();console.info(`Fetching blocks from ${t} to ${r} for filter (${e})`);let o=(await Promise.all((0,n.range)(t,r+1).map(e=>this.getBlockHashByNumber((0,s.IntNumber)(e))))).filter(e=>!!e),a=(0,s.IntNumber)(t+o.length);return console.info(`Moving cursor position for filter (${e}) from ${t} to ${a}`),this.cursors.set(e,a),Object.assign(Object.assign({},i),{result:o})}async getPendingTransactionFilterChanges(e){return Promise.resolve(h())}async setInitialCursorPosition(e,t){let r=await this.getCurrentBlockHeight(),s="number"==typeof t&&t>r?t:r;return this.cursors.set(e,s),s}setFilterTimeout(e){let t=this.timeouts.get(e);t&&window.clearTimeout(t);let r=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},3e5);this.timeouts.set(e,r)}async getCurrentBlockHeight(){let e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;let t=await this._getCurrentBlockHeight();
1this.currentBlockHeight=t,this.resolvers.forEach(e=>e(t)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(e=>this.resolvers.push(e))}async _getCurrentBlockHeight(){let{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},i),{method:"eth_blockNumber",params:[]}));return(0,n.intNumberFromHexString)((0,n.ensureHexString)(e))}async getBlockHashByNumber(e){let t=await this.sendAsyncPromise(Object.assign(Object.assign({},i),{method:"eth_getBlockByNumber",params:[(0,n.hexStringFromIntNumber)(e),!1]}));return t.result&&"string"==typeof t.result.hash?(0,n.ensureHexString)(t.result.hash):null}}function a(e){return{fromBlock:l(e.fromBlock),toBlock:l(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function c(e){let t={fromBlock:u(e.fromBlock),toBlock:u(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function l(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,s.IntNumber)(0);if((0,n.isHexString)(e))return(0,n.intNumberFromHexString)(e);throw Error(`Invalid block option: ${String(e)}`)}function u(e){return"latest"===e?e:(0,n.hexStringFromIntNumber)(e)}function d(){return Object.assign(Object.assign({},i),{error:{code:-32e3,message:"filter not found"}})}function h(){return Object.assign(Object.assign({},i),{result:[]})}t.FilterPolyfill=o,t.filterFromParam=a},93772:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;let s=r(2704),n=r(55117),i=()=>{};class o{constructor(e){let{events:t,middleware:r}=n({blockTracker:new s.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),provider:e});this.events=t,this.subscriptionMiddleware=r}async handleRequest(e){let t={};return await this.subscriptionMiddleware(e,t,i,i),t}destroy(){this.subscriptionMiddleware.destroy()}}t.SubscriptionManager=o},59561:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayAbstract=t.APP_VERSION_KEY=t.LOCAL_STORAGE_ADDRESSES_KEY=t.WALLET_USER_NAME_KEY=void 0;let s=r(36769);t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion";class n{async makeEthereumJSONRPCRequest(e,t){if(!t)throw Error("Error: No jsonRpcUrl provided");return window.fetch(t,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(t=>{if(!t)throw s.standardErrors.rpc.parse({});let{error:r}=t;if(r)throw(0,s.serializeError)(r,e.method);return t})}}t.RelayAbstract=n},57098:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayEventManager=void 0;let s=r(85811);class n{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,t=(0,s.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}t.RelayEventManager=n},8546:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;let s=r(71114),n=r(85811),i="session:id",o="session:secret",a="session:linked";
1class c{constructor(e,t,r,i){this._storage=e,this._id=t||(0,n.randomBytesHex)(16),this._secret=r||(0,n.randomBytesHex)(32),this._key=new s.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){let t=e.getItem(i),r=e.getItem(a),s=e.getItem(o);return t&&s?new c(e,t,s,"1"===r):null}static hash(e){return new s.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(i,this._id),this._storage.setItem(o,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(a,this._linked?"1":"0")}}t.Session=c},51644:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MobileRelay=void 0;let s=r(85811),n=r(91505),i=r(73329);class o extends n.WalletLinkRelay{constructor(e){var t;super(e),this._enableMobileWalletLink=null!==(t=e.enableMobileWalletLink)&&void 0!==t&&t}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{let e=(0,s.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,t){if(super.publishWeb3RequestEvent(e,t),!(this._enableMobileWalletLink&&this.ui instanceof i.MobileRelayUI))return;let r=!1;switch(t.method){case"requestEthereumAccounts":case"connectAndSignIn":r=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:r=!0,this.ui.openCoinbaseWalletDeeplink()}r&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}t.MobileRelay=o},73329:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MobileRelayUI=void 0;let s=r(1379);class n{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new s.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){let t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",window.location.href),e&&t.searchParams.append("wl_url",e);let r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}t.MobileRelayUI=n},91505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkRelay=void 0;let s=r(36769),n=r(58749),i=r(85811),o=r(99078),a=r(59561),c=r(8546),l=r(33641),u=r(66529),d=r(45876);class h extends a.RelayAbstract{constructor(e){var t;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=e=>{var t;this.isLinked=e;let r=this.storage.getItem(a.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this.session.linked=e),this.isUnlinkedErrorState=!1,r){let s=r.split(" "),n="true"===this.storage.getItem("IsStandaloneSigning");if(""!==s[0]&&!e&&this.session.linked&&!n){this.isUnlinkedErrorState=!0;let e=this.getSessionIdHash();null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:e})}}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{(this.chainCallbackParams.chainId!==e||this.chainCallbackParams.jsonRpcUrl!==t)&&(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(e,t))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),h.accountRequestCallbackIds.size>
10&&(Array.from(h.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(Object.assign(Object.assign({},{type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:[e]}}),{id:t}))}),h.accountRequestCallbackIds.clear())},this.connectedUpdated=e=>{this.ui.setConnected(e)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;let{session:r,ui:s,connection:n}=this.subscribe();this._session=r,this.connection=n,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=null===(t=e.reloadOnDisconnect)||void 0===t||t,this.ui=s}subscribe(){let e=c.Session.load(this.storage)||new c.Session(this.storage).save(),{linkAPIUrl:t,diagnostic:r}=this,s=new l.WalletLinkConnection({session:e,linkAPIUrl:t,diagnostic:r,listener:this}),{version:n,darkMode:i}=this.options,o=this.options.uiConstructor({linkAPIUrl:t,version:n,darkMode:i,session:e});return s.connect(),{session:e,ui:o,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,t;let r=this.ui.isStandalone();null===(e=this.diagnostic)||void 0===e||e.log(o.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();let s=c.Session.load(this.storage);if((null==s?void 0:s.id)===this._session.id?this.storage.clear():s&&(null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:c.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);let{session:n,ui:i,connection:a}=this.subscribe();this._session=n,this.connection=a,this.ui=i,r&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,i.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,i.hexStringFromBuffer)(e,!0),signature:(0,i.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,i.bigIntStringFromBN)(e.weiValue),data:(0,i.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,i.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,i.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,i.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,i.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,i.bigIntStringFromBN)(e.weiValue),data:(0,i.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,i.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,i.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,i.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,i.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,i.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,i.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null,r=(0,i.randomBytesHex)(8),s=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s),null==t||t()};return{promise:new Promise((n,i)=>{this.ui.isStandalone()||(t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,e=>
1{if(null==t||t(),(0,u.isErrorResponse)(e))return i(Error(e.errorMessage));n(e)}),this.ui.isStandalone()?this.sendRequestStandalone(r,e):this.publishWeb3RequestEvent(r,e)}),cancel:s}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof d.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,t){var r;let s={type:"WEB3_REQUEST",id:e,request:t},n=c.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(o.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${t.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:n?c.Session.hash(n.id):"",isSessionMismatched:((null==n?void 0:n.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(e=>{var r;null===(r=this.diagnostic)||void 0===r||r.log(o.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${t.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:n?c.Session.hash(n.id):"",isSessionMismatched:((null==n?void 0:n.id)!==this._session.id).toString()})}).catch(e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:t.method,errorMessage:e.message}})})}publishWeb3RequestCanceledEvent(e){this.publishEvent("Web3RequestCanceled",{type:"WEB3_REQUEST_CANCELED",id:e},!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){var t;let{response:r}=e;if(null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),"requestEthereumAccounts"===r.method){h.accountRequestCallbackIds.forEach(t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t}))),h.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,r,n){var i;let o=null!==(i=null==r?void 0:r.message)&&void 0!==i?i:(0,s.getMessageFromCode)(n);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:o,errorCode:n}})}invokeCallback(e){let t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){let e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,i.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(t),this.handleErrorResponse(t,e.method,r)};return{promise:new Promise((n,i)=>{if(this.relayEventManager.callbacks.set(t,e=>{if(this.ui.hideRequestEthereumAccounts(),(0,u.isErrorResponse)(e))return i(Error(e.errorMessage));n(e)}),this.ui.inlineAccountsResponse())this.ui.requestEthereumAccounts({onCancel:r,onAccounts:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:e}})}});else{let e=s.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(e)})}h.accountRequestCallbackIds.add(t),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(t,e)}),cancel:r}}selectProvider(e){let t=(0,i.randomBytesHex)(8);return{cancel:e=>{this.publishWeb3RequestCanceledEvent(t),this.handleErrorResponse(t,"selectProvider",e)},promise:new Promise((r,s)=>{this.relayEventManager.callbacks.set(t,e=>{if((0,u.isErrorResponse)(e))return s(Error(e.errorMessage));r(e)}),this.ui.selectProvider&&this.ui.selectProvider({onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:"selectProvider",result:e}})},onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:"selectProvider",result:n.ProviderType.Unselected}})},providerOptions:e})})}}watchAsset(e,t,r,s,n,o){let a={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:s,image:n},chainId:o}},c=null,l=(0,i.randomBytesHex)(8),d=e=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,e),null==c||c()};return this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{cancel:d,promise:new Promise((i,d)=>{this.relayEventManager.callbacks.set(l,e=>
1{if(null==c||c(),(0,u.isErrorResponse)(e))return d(Error(e.errorMessage));i(e)}),this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})},onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},type:e,address:t,symbol:r,decimals:s,image:n,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(l,a)})}}addEthereumChain(e,t,r,s,n,o){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:n,iconUrls:r,nativeCurrency:o}},c=null,l=(0,i.randomBytesHex)(8),d=e=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,e),null==c||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{promise:new Promise((t,r)=>{this.relayEventManager.callbacks.set(l,e=>{if(null==c||c(),(0,u.isErrorResponse)(e))return r(Error(e.errorMessage));t(e)}),this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:e}}})},chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),this.ui.inlineAddEthereumChain(e)||this.ui.isStandalone()||this.publishWeb3RequestEvent(l,a)}),cancel:d}}switchEthereumChain(e,t){let r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},n=(0,i.randomBytesHex)(8);return{promise:new Promise((t,i)=>{this.relayEventManager.callbacks.set(n,e=>(0,u.isErrorResponse)(e)&&e.errorCode?i(s.standardErrors.provider.custom({code:e.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):(0,u.isErrorResponse)(e)?i(Error(e.errorMessage)):void t(e)),this.ui.switchEthereumChain({onCancel:t=>{var r;if(t){let i=null!==(r=(0,s.getErrorCode)(t))&&void 0!==r?r:s.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(n,"switchEthereumChain",t instanceof Error?t:s.standardErrors.provider.unsupportedChain(e),i)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:e}}})},chainId:r.params.chainId,address:r.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(n,r)}),cancel:e=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,e)}}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return c.Session.hash(this._session.id)}sendRequestStandalone(e,t){let r=r=>{this.handleErrorResponse(e,t.method,r)},s=t=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:t})};switch(t.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:t,onSuccess:s,onCancel:r});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:t,onSuccess:s,onCancel:r});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:t,onSuccess:s,onCancel:r});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:s});break;default:r()}}}t.WalletLinkRelay=h,h.accountRequestCallbackIds=new Set},33641:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkConnection=void 0;let s=r(58749),n=r(24020),i=r(99078),o=r(59561),a=r(8546),c=r(62838),l=r(22899);class u{constructor({session:e,linkAPIUrl:t,listener:r,diagnostic:u,WebSocketClass:d=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,s.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{e&&new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>
1e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,r)=>{let s=e[r];void 0!==s&&t(s)})},this.handleDestroyed=e=>{var t,r;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload(),null===(r=this.diagnostic)||void 0===r||r.log(i.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:a.Session.hash(this.session.id)}))},this.handleAccountUpdated=async e=>{var t,r;try{let r=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(r)}catch(e){null===(r=this.diagnostic)||void 0===r||r.log(i.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(e,t)=>{var r,s;try{let s=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.metadataUpdated(e,s)}catch(t){null===(s=this.diagnostic)||void 0===s||s.log(i.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:e})}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated(o.WALLET_USER_NAME_KEY,e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated(o.APP_VERSION_KEY,e)},this.handleChainUpdated=async(e,t)=>{var r,s;try{let s=await this.cipher.decrypt(e),n=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.chainUpdated(s,n)}catch(e){null===(s=this.diagnostic)||void 0===s||s.log(i.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new n.Cipher(e.secret),this.diagnostic=u,this.listener=r;let h=new l.WalletLinkWebSocket(`${t}/rpc`,d);h.setConnectionStateListener(async t=>{var r;null===(r=this.diagnostic)||void 0===r||r.log(i.EVENTS.CONNECTED_STATE_CHANGE,{state:t,sessionIdHash:a.Session.hash(e.id)});let s=!1;switch(t){case l.ConnectionState.DISCONNECTED:if(!this.destroyed){let e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||h.connect().catch(()=>{e()})};e()}break;case l.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),s=!0}catch(e){}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case l.ConnectionState.CONNECTING:}this.connected!==s&&(this.connected=s)}),h.setIncomingDataListener(t=>{var r,s,n;switch(t.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let s="IsLinkedOK"===t.type?t.linked:void 0;null===(r=this.diagnostic)||void 0===r||r.log(i.EVENTS.LINKED,{sessionIdHash:a.Session.hash(e.id),linked:s,type:t.type,onlineGuests:t.onlineGuests}),this.linked=s||t.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":null===(s=this.diagnostic)||void 0===s||s.log(i.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:a.Session.hash(e.id),metadata_keys:t&&t.metadata?Object.keys(t.metadata):void 0}),this.handleSessionMetadataUpdated(t.metadata);break;case"Event":this.handleIncomingEvent(t)}void 0!==t.id&&(null===(n=this.requestResolutions.get(t.id))||void 0===n||n(t))}),this.ws=h,this.http=new c.WalletLinkHTTP(t,e.id,e.key)}connect(){var e;if(this.destroyed)throw Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(i.EVENTS.STARTED_CONNECTING,{sessionIdHash:a.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(i.EVENTS.DISCONNECTED,{sessionIdHash:a.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t,r;this._connected=e,e&&(null===(t=this.onceConnected)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.connectedUpdated(e)}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t,r;if("Event"===e.type&&"Web3Response"===e.event)try{let r=await this.cipher.decrypt(e.data),s=JSON.parse(r);if("WEB3_RESPONSE"!==s.type)return;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(s)}catch(e){null===(r=this.diagnostic)||void 0===r||r.log(i.EVENTS.GENERAL_ER
1ROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(e=>this.handleIncomingEvent(e))}async setSessionMetadata(e,t){let r={type:"SetSessionConfig",id:(0,s.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{let e=await this.makeRequest(r);if("Fail"===e.type)throw Error(e.error||"failed to set session metadata")})}async publishEvent(e,t,r=!1){let n=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,s.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:n,callWebhook:r};return this.setOnceLinked(async()=>{let e=await this.makeRequest(i);if("Fail"===e.type)throw Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4){this.ws.disconnect();return}try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t=6e4){let r;let s=e.id;return this.sendData(e),Promise.race([new Promise((e,n)=>{r=window.setTimeout(()=>{n(Error(`request ${s} timed out`))},t)}),new Promise(e=>{this.requestResolutions.set(s,t=>{clearTimeout(r),e(t),this.requestResolutions.delete(s)})})])}async authenticate(){let e={type:"HostSession",id:(0,s.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if("Fail"===t.type)throw Error(t.error||"failed to authentcate")}sendIsLinked(){let e={type:"IsLinked",id:(0,s.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){let e={type:"GetSessionConfig",id:(0,s.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}t.WalletLinkConnection=u},62838:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkHTTP=void 0;class r{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;let s=`${t}:${r}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>console.error("Unabled to mark event as failed:",e))}async fetchUnseenEvents(){var e;let t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){let{events:r,error:s}=await t.json();if(s)throw Error(`Check unseen events failed: ${s}`);let n=null!==(e=null==r?void 0:r.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(n),n}throw Error(`Check unseen events failed: ${t.status}`)}}t.WalletLinkHTTP=r},22899:function(e,t){"use strict";var r,s;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkWebSocket=t.ConnectionState=void 0,(s=r||(t.ConnectionState=r={}))[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED";class n{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw Error("webSocket object is not null");return new Promise((e,t)=>{var s;let n;try{this.webSocket=n=new this.WebSocketClass(this.url)}catch(e){t(e);return}null===(s=this.connectionStateListener)||void 0===s||s.call(this,r.CONNECTING),n.onclose
1=e=>{var s;this.clearWebSocket(),t(Error(`websocket error ${e.code}: ${e.reason}`)),null===(s=this.connectionStateListener)||void 0===s||s.call(this,r.DISCONNECTED)},n.onopen=t=>{var s;e(),null===(s=this.connectionStateListener)||void 0===s||s.call(this,r.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[])},n.onmessage=e=>{var t,r;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{let t=JSON.parse(e.data);null===(r=this.incomingDataListener)||void 0===r||r.call(this,t)}catch(e){}}})}disconnect(){var e;let{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){let{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}t.WalletLinkWebSocket=n},66529:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorResponse=void 0,t.isErrorResponse=function(e){return void 0!==e.errorMessage}},45876:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkRelayUI=void 0;let s=r(10598),n=r(14381),i=r(21282);class o{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new i.Snackbar({darkMode:e.darkMode}),this.linkFlow=new n.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");let 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)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.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",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}}t.WalletLinkRelayUI=o}
1,89469: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;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"},5507:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSteps=t.ConnectContent=void 0;let n=s(r(50348)),i=r(88049),o=r(85811),a=r(67124),c=r(26456),l=r(15588),u=r(89906),d=r(98829),h=r(12838),p=s(r(89469)),f={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:b},g=e=>"light"===e?"#FFFFFF":"#0A0B0D";function m({title:e,description:t,theme:r}){return(0,i.h)("div",{className:(0,n.default)("-cbwsdk-connect-item",r)},(0,i.h)("div",null,(0,i.h)(l.CoinbaseWalletRound,null)),(0,i.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,i.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,i.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function b({theme:e}){return(0,i.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,i.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",e)},(0,i.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,i.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",e)},(0,i.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,i.h)("span",null,"Tap ",(0,i.h)("strong",null,"Scan")," "),(0,i.h)("span",{className:(0,n.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,i.h)(u.QRCodeIcon,{fill:g(e)})))))}t.ConnectContent=function(e){let{theme:t}=e,r=(0,o.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),s=f.steps;return(0,i.h)("div",{"data-testid":"connect-content",className:(0,n.default)("-cbwsdk-connect-content",t)},(0,i.h)("style",null,p.default),(0,i.h)("div",{className:"-cbwsdk-connect-content-header"},(0,i.h)("h2",{className:(0,n.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,i.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,i.h)(c.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,i.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,i.h)("div",{className:"-cbwsdk-connect-content-column-left"}
1,(0,i.h)(m,{title:f.title,description:f.description,theme:t})),(0,i.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,i.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,i.h)(d.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,i.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:a.LIB_VERSION}),(0,i.h)("input",{type:"hidden",value:r})),(0,i.h)(s,{theme:t}),!e.isConnected&&(0,i.h)("div",{"data-testid":"connecting-spinner",className:(0,n.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,i.h)(h.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,i.h)("p",null,"Connecting...")))))},t.CoinbaseWalletSteps=b},68818: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}
1.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"},71600:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectDialog=void 0;let n=s(r(50348)),i=r(88049),o=r(87060),a=r(5507),c=r(23225),l=s(r(68818));t.ConnectDialog=e=>{let{isOpen:t,darkMode:r}=e,[s,u]=(0,o.useState)(!t),[d,h]=(0,o.useState)(!t);(0,o.useEffect)(()=>{let e=[window.setTimeout(()=>{h(!t)},10)];return t?u(!1):e.push(window.setTimeout(()=>{u(!0)},360)),()=>{e.forEach(window.clearTimeout)}},[t]);let p=r?"dark":"light";return(0,i.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-container",s&&"-cbwsdk-connect-dialog-container-hidden")},(0,i.h)("style",null,l.default),(0,i.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-backdrop",p,d&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,i.h)("div",{class:"-cbwsdk-connect-dialog"},(0,i.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-box",d&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,i.h)(a.ConnectContent,{theme:p,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,i.h)(c.TryExtensionContent,{theme:p}))))}},14381:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkFlow=void 0;let s=r(88049),n=r(71600);class i{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,s.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,s.render)((0,s.h)(n.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}t.LinkFlow=i},98829:function(e,t,r){"use strict";var s=r(67133).Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.QRCode=void 0;let i=r(88049),o=r(87060),a=n(r(24864));t.QRCode=e=>{let[t,r]=(0,o.useState)("");return(0,o.useEffect)(()=>{var t,n;let i=new a.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}),o=s.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,i.h)("img",{src:t,alt:"QR Code"}):null}},24678:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
1.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"},1379:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectDialog=void 0;let n=s(r(50348)),i=r(88049),o=r(10598),a=r(62011),c=s(r(24678));class l{constructor(){this.root=null}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,o.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,i.render)(null,this.root),e&&(0,i.render)((0,i.h)(u,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}t.RedirectDialog=l;let u=({title:e,buttonText:t,darkMode:r,onButtonClick:s,onDismiss:o})=>(0,i.h)(a.SnackbarContainer,{darkMode:r},(0,i.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,i.h)("style",null,c.default),(0,i.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:o}),(0,i.h)("div",{class:(0,n.default)("-cbwsdk-redirect-dialog-box",r?"dark":"light")},(0,i.h)("p",null,e),(0,i.h)("button",{onClick:s},t))))},67298: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}
1.-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}"},21282:function(e,t,r){"use strict";var s=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;let n=s(r(50348)),i=r(88049),o=r(87060),a=s(r(67298));class c{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,i.render)((0,i.h)("div",null,(0,i.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>(0,i.h)(t.SnackbarInstance,Object.assign({},r,{key:e}))))),this.root)}}t.Snackbar=c,t.SnackbarContainer=e=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,i.h)("style",null,a.default),(0,i.h)("div",{class:"-cbwsdk-snackbar"},e.children)),t.SnackbarInstance=({autoExpand:e,message:t,menuItems:r})=>{let[s,a]=(0,o.useState)(!0),[c,l]=(0,o.useState)(null!=e&&e);return(0,o.useEffect)(()=>{let e=[window.setTimeout(()=>{a(!1)},1),window.setTimeout(()=>{l(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}}),(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",s&&"-cbwsdk-snackbar-instance-hidden",c&&"-cbwsdk-snackbar-instance-expanded")},(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{l(!c)}},(0,i.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,i.h)("div",{class:"-gear-container"},!c&&(0,i.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,i.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
1NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((e,t)=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,i.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,i.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))}},62011:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(21282),t)},64323: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)}}"},12838:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;let n=r(88049),i=s(r(64323));t.Spinner=e=>{var t;let r=null!==(t=e.size)&&void 0!==t?t:64,s=e.color||"#000";return(0,n.h)("div",{class:"-cbwsdk-spinner"},(0,n.h)("style",null,i.default),(0,n.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,n.h)("circle",{style:{cx:50,cy:50,r:45,stroke:s}})))}},9916: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}"},23225:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TryExtensionContent=void 0;let n=s(r(50348)),i=r(88049),o=r(87060),a=r(58788),c=r(67964),l=r(33694),u=s(r(9916));t.TryExtensionContent=function({theme:e}){let[t,r]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),d=(0,o.useCallback)(()=>{t?window.location.reload():(s(),r(!0))},[s,t]);return(0,i.h)("div",{class:(0,n.default)("-cbwsdk-try-extension",e)},(0,i.h)("style",null,u.default),(0,i.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,i.h)("h3",{class:(0,n.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,i.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,i.h)("button",{class:(0,n.default)("-cbwsdk-try-extension-cta",e),onClick:d},t?"Refresh":"Install"),(0,i.h)("div",null,!t&&(0,i.h)(a.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===e?"#0052FF":"#588AF5"})))),(0,i.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,i.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,i.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,i.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,i.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,i.h)(c.LaptopIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,i.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,i.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,i.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,i.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,i.h)(l.SafeIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,i.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}},58788:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowLeftIcon=void 0;let s=r(88049);t.ArrowLeftIcon=function(e){return(0,s.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,s.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"}))}},26456:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloseIcon=void 0;let s=r(88049);t.CloseIcon=function(e){return(0,s.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,s.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"}))}},15588:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletRound=void 0;let s=r(88049);t.CoinbaseWalletRound=function(e){return(0,s.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,s.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,s.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,s.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}},67964:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.LaptopIcon=void 0;let s=r(88049);t.LaptopIcon=function(e){return(0,s.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,s.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,s.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"}))}},89906:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QRCodeIcon=void 0;let s=r(88049);t.QRCodeIcon=function(e){return(0,s.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,s.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,s.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,s.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,s.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}},33694:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeIcon=void 0;let s=r(88049);t.SafeIcon=function(e){return(0,s.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,s.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"}))}},82341:function(e,t,r){var s=r(67133).Buffer;let n=r(17783),i=r(56662);function o(e){if(e.startsWith("int["))return"int256"+e.slice(3);if("int"===e)return"int256";if(e.startsWith("uint["))return"uint256"+e.slice(4);if("uint"===e)return"uint256";if(e.startsWith("fixed["))return"fixed128x128"+e.slice(5);if("fixed"===e)return"fixed128x128";if(e.startsWith("ufixed["))return"ufixed128x128"+e.slice(6);else if("ufixed"===e)return"ufixed128x128";return e}function a(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function c(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function l(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function u(e){var t=typeof e;if("string"===t)return n.isHexString(e)?new i(n.stripHexPrefix(e),16):new i(e,10);if("number"===t)return new i(e);if(e.toArray)return e;throw Error("Argument is not a number")}function d(e,t){if("address"===e)return d("uint160",u(t));if("bool"===e)return d("uint8",t?1:0);if("string"===e)return d("bytes",new s(t,"utf8"));if((f=e).lastIndexOf("]")===f.length-1){if(void 0===t.length)throw Error("Not an array?");if("dynamic"!==(r=l(e))&&0!==r&&t.length>r)throw Error("Elements exceed array size: "+r);for(p in h=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)h.push(d(e,t[p]));if("dynamic"===r){var r,o,h,p,f,g=d("uint256",t.length);h.unshift(g)}return s.concat(h)}if("bytes"===e)return t=new s(t),h=s.concat([d("uint256",t.length),t]),t.length%32!=0&&(h=s.concat([h,n.zeros(32-t.length%32)])),h;if(e.startsWith("bytes")){if((r=a(e))<1||r>32)throw Error("Invalid bytes<N> width: "+r);return n.setLengthRight(t,32)}else if(e.startsWith("uint")){if((r=a(e))%8||r<8||r>256)throw Error("Invalid uint<N> width: "+r);if((o=u(t)).bitLength()>r)throw Error("Supplied uint exceeds width: "+r+" vs "+o.bitLength());if(o<0)throw Error("Supplied uint is negative");return o.toArrayLike(s,"be",32)}else if(e.startsWith("int")){if((r=a(e))%8||r<8||r>256)throw Error("Invalid int<N> width: "+r);if((o=u(t)).bitLength()>r)throw Error("Supplied int exceeds width: "+r+" vs "+o.bitLength());return o.toTwos(256).toArrayLike(s,"be",32)}else if(e.startsWith("ufixed")){if(r=c(e),(o=u(t))<0)throw Error("Supplied ufixed is negative");
1return d("uint256",o.mul(new i(2).pow(new i(r[1]))))}else if(e.startsWith("fixed"))return r=c(e),d("int256",u(t).mul(new i(2).pow(new i(r[1]))));throw Error("Unsupported or invalid type: "+e)}function h(e,t){if(e.length!==t.length)throw Error("Number of types are not matching the values");for(var r,i,c=[],l=0;l<e.length;l++){var d=o(e[l]),h=t[l];if("bytes"===d)c.push(h);else if("string"===d)c.push(new s(h,"utf8"));else if("bool"===d)c.push(new s(h?"01":"00","hex"));else if("address"===d)c.push(n.setLength(h,20));else if(d.startsWith("bytes")){if((r=a(d))<1||r>32)throw Error("Invalid bytes<N> width: "+r);c.push(n.setLengthRight(h,r))}else if(d.startsWith("uint")){if((r=a(d))%8||r<8||r>256)throw Error("Invalid uint<N> width: "+r);if((i=u(h)).bitLength()>r)throw Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());c.push(i.toArrayLike(s,"be",r/8))}else if(d.startsWith("int")){if((r=a(d))%8||r<8||r>256)throw Error("Invalid int<N> width: "+r);if((i=u(h)).bitLength()>r)throw Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());c.push(i.toTwos(r).toArrayLike(s,"be",r/8))}else throw Error("Unsupported or invalid type: "+d)}return s.concat(c)}e.exports={rawEncode:function(e,t){var r=[],n=[],i=32*e.length;for(var a in e){var c=o(e[a]),u=d(c,t[a]);"string"===c||"bytes"===c||"dynamic"===l(c)?(r.push(d("uint256",i)),n.push(u),i+=u.length):r.push(u)}return s.concat(r.concat(n))},solidityPack:h,soliditySHA3:function(e,t){return n.keccak(h(e,t))}}},86642:function(e,t,r){var s=r(67133).Buffer;let n=r(17783),i=r(82341),o={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"]},a={encodeData(e,t,r,o=!0){let a=["bytes32"],c=[this.hashType(e,r)];if(o){let l=(e,t,a)=>{if(void 0!==r[t])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":n.keccak(this.encodeData(t,a,r,o))];if(void 0===a)throw Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",n.keccak(a)];if("string"===t)return"string"==typeof a&&(a=s.from(a,"utf8")),["bytes32",n.keccak(a)];if(t.lastIndexOf("]")===t.length-1){let r=t.slice(0,t.lastIndexOf("[")),s=a.map(t=>l(e,r,t));return["bytes32",n.keccak(i.rawEncode(s.map(([e])=>e),s.map(([,e])=>e)))]}return[t,a]};for(let s of r[e]){let[e,r]=l(s.name,s.type,t[s.name]);a.push(e),c.push(r)}}else for(let i of r[e]){let e=t[i.name];if(void 0!==e){if("bytes"===i.type)a.push("bytes32"),e=n.keccak(e),c.push(e);else if("string"===i.type)a.push("bytes32"),"string"==typeof e&&(e=s.from(e,"utf8")),e=n.keccak(e),c.push(e);else if(void 0!==r[i.type])a.push("bytes32"),e=n.keccak(this.encodeData(i.type,e,r,o)),c.push(e);else if(i.type.lastIndexOf("]")===i.type.length-1)throw Error("Arrays currently unimplemented in encodeData");else a.push(i.type),c.push(e)}}return i.rawEncode(a,c)},encodeType(e,t){let r="",s=this.findTypeDependencies(e,t).filter(t=>t!==e);for(let n of s=[e].concat(s.sort())){if(!t[n])throw Error("No type definition specified: "+n);r+=n+"("+t[n].map(({name:e,type:t})=>t+" "+e).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;for(let s of(r.push(e),t[e]))for(let e of this.findTypeDependencies(s.t
1ype,t,r))r.includes(e)||r.push(e);return r},hashStruct(e,t,r,s=!0){return n.keccak(this.encodeData(e,t,r,s))},hashType(e,t){return n.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let r in o.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let r=this.sanitizeData(e),i=[s.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&i.push(this.hashStruct(r.primaryType,r.message,r.types,t)),n.keccak(s.concat(i))}};e.exports={TYPED_MESSAGE_SCHEMA:o,TypedDataUtils:a,hashForSignTypedDataLegacy:function(e){return function(e){let t=Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;let r=e.map(function(e){return"bytes"===e.type?n.toBuffer(e.value):e.value}),s=e.map(function(e){return e.type}),o=e.map(function(e){if(!e.name)throw t;return e.type+" "+e.name});return i.soliditySHA3(["bytes32","bytes32"],[i.soliditySHA3(Array(e.length).fill("string"),o),i.soliditySHA3(s,r)])}(e.data)},hashForSignTypedData_v3:function(e){return a.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return a.hash(e.data)}}},17783:function(e,t,r){var s=r(67133).Buffer;let n=r(26961),i=r(56662);function o(e){return s.allocUnsafe(e).fill(0)}function a(e,t,r){let s=o(t);return(e=c(e),r)?e.length<t?(e.copy(s),s):e.slice(0,t):e.length<t?(e.copy(s,t-e.length),s):e.slice(-t)}function c(e){if(!s.isBuffer(e)){if(Array.isArray(e))e=s.from(e);else if("string"==typeof e){var t;e=l(e)?s.from((t=u(e)).length%2?"0"+t:t,"hex"):s.from(e)}else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=s.allocUnsafe(0);else if(i.isBN(e))e=e.toArrayLike(s);else if(e.toArray)e=s.from(e.toArray());else throw Error("invalid type")}return e}function l(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function u(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}e.exports={zeros:o,setLength:a,setLengthRight:function(e,t){return a(e,t,!0)},isHexString:l,stripHexPrefix:u,toBuffer:c,bufferToHex:function(e){return"0x"+(e=c(e)).toString("hex")},keccak:function(e,t){return e=c(e),t||(t=256),n("keccak"+t).update(e).digest()}}},24864:function(e){function t(e){this.mode=s.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(1835008&i)>>>18,n[1]=128|(258048&i)>>>12,n[2]=128|(4032&i)>>>6,n[3]=128|63&i):i>2048?(n[0]=224|(61440&i)>>>12,n[1]=128|(4032&i)>>>6,n[2]=128|63&i):i>128?(n[0]=192|(1984&i)>>>6,n[1]=128|63&i):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function r(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,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}},r.prototype={addData:function(e){var r=new t(e);this.dataList.push(r),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=Array(this.moduleCount);for(var s=0;s<this.moduleCount;s++){this.modules[s]=Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[s][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1)&&!(this.moduleCount<=e+r))for(var s=-1;s<=7;s++)t+s<=-1||this.moduleCount<=t+s||(0<=r&&r<=6&&(0==s||6==s)||0<=s&&s<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=s&&s<=4?this.modules[e+r][t+s]=!0:this.modules[e+r][t+s]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var s=o.getLostPoint(this);(0==r||e>s)&&(e=s,t=r)}return t},createMovieClip:function(e,t,r){var s=e.createEmptyMovieClip(t,r);this.make();for(var n=0;n<this.modules.length;n++)for(var i=1*n,o=0;o<this.modules[n].length;o++){var a=1*o;this.modules[n][o]&&(s.beginFill(0,100),s.moveTo(a,i),s.lineTo(a+1,i),s.lineTo(a+1,i+1),s.lineTo(a,i+1),s.endFill())}return s},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=o.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var s=e[t],n=e[r];if(null==this.modules[s][n])for(var i=-2;i<=2;i++)for(var a=-2;a<=2;a++)-2==i||2==i||-2==a||2==a||0==i&&0==a?this.modules[s+i][n+a]=!0:this.modules[s+i][n+a]=!1}},setupTypeNumber:function(e){for(var t=o.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var s=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=s}for(var r=0;r<18;r++){var s=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=s}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,s=o.getBCHTypeInfo(r),n=0;n<15;n++){var i=!e&&(s>>n&1)==1;n<6?this.modules[n][8]=i:n<8?this.modules[n+1][8]=i:this.modules[this.moduleCount-15+n][8]=i}for(var n=0;n<15;n++){var i=!e&&(s>>n&1)==1;n<8?this.modules[8][this.moduleCount-n-1]=i:n<9?this.modules[8][15-n-1+1]=i:this.modules[8][15-n-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,s=this.moduleCount-1,n=7,i=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var c=0;c<2;
1c++)if(null==this.modules[s][a-c]){var l=!1;i<e.length&&(l=(e[i]>>>n&1)==1),o.getMask(t,s,a-c)&&(l=!l),this.modules[s][a-c]=l,-1==--n&&(i++,n=7)}if((s+=r)<0||this.moduleCount<=s){s-=r,r=-r;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(e,t,s){for(var n=u.getRSBlocks(e,t),i=new d,a=0;a<s.length;a++){var c=s[a];i.put(c.mode,4),i.put(c.getLength(),o.getLengthInBits(c.mode,e)),c.write(i)}for(var l=0,a=0;a<n.length;a++)l+=n[a].dataCount;if(i.getLengthInBits()>8*l)throw Error("code length overflow. ("+i.getLengthInBits()+">"+8*l+")");for(i.getLengthInBits()+4<=8*l&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*l)&&(i.put(r.PAD0,8),!(i.getLengthInBits()>=8*l));)i.put(r.PAD1,8);return r.createBytes(i,n)},r.createBytes=function(e,t){for(var r=0,s=0,n=0,i=Array(t.length),a=Array(t.length),c=0;c<t.length;c++){var u=t[c].dataCount,d=t[c].totalCount-u;s=Math.max(s,u),n=Math.max(n,d),i[c]=Array(u);for(var h=0;h<i[c].length;h++)i[c][h]=255&e.buffer[h+r];r+=u;var p=o.getErrorCorrectPolynomial(d),f=new l(i[c],p.getLength()-1).mod(p);a[c]=Array(p.getLength()-1);for(var h=0;h<a[c].length;h++){var g=h+f.getLength()-a[c].length;a[c][h]=g>=0?f.get(g):0}}for(var m=0,h=0;h<t.length;h++)m+=t[h].totalCount;for(var b=Array(m),y=0,h=0;h<s;h++)for(var c=0;c<t.length;c++)h<i[c].length&&(b[y++]=i[c][h]);for(var h=0;h<n;h++)for(var c=0;c<t.length;c++)h<a[c].length&&(b[y++]=a[c][h]);return b};for(var s={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},i={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;o.getBCHDigit(t)-o.getBCHDigit(o.G15)>=0;)t^=o.G15<<o.getBCHDigit(t)-o.getBCHDigit(o.G15);return(e<<10|t)^o.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;o.getBCHDigit(t)-o.getBCHDigit(o.G18)>=0;)t^=o.G18<<o.getBCHDigit(t)-o.getBCHDigit(o.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return o.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case i.PATTERN000:return(t+r)%2==0;case i.PATTERN001:return t%2==0;case i.PATTERN010:return r%3==0;case i.PATTERN011:return(t+r)%3==0;case i.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case i.PATTERN101:return t*r%2+t*r%3==0;case i.PATTERN110:return(t*r%2+t*r%3)%2==0;case i.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new l([1],0),r=0;r<e;r++)t=t.multiply(new l([1,a.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case s.MODE_NUMBER:return 10;case s.MODE_ALPHA_NUM:return 9;case s.MODE_8BIT_BYTE:case s.MODE_KANJI:return 8;default:throw Error("mode:"+e)}else if(t<27)switch(e){case s.MODE_NUMBER:return 12;case s.MODE_ALPHA_NUM:return 11;case s.MODE_8BIT_BYTE:return 16;case s.MODE_KANJI:return 10;default:throw Error("mode:"+e)}else if(t<41)switch(e){case s.MODE_NUMBER:return 14;case s.MODE_ALPHA_NUM:return 13;case s.MODE_8BIT_BYTE:return 16;case s.MODE_KANJI:return 12;default:throw Error("mode:"+e)}else throw Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,s=0;s<t;s++)for(var n=0;n<t;n++){for(var i=0,o=e.isDark(s,n),a=-1;a<=1;a++)if(!(s+a<0)&&!(t<=s+a))for(var c=-1;c<=1;c++)!(n+c<0)&&!(t<=n+c)&&(0!=a||0!=c)&&o==e.isDark(s+a,n+c)&&i++;i>5&&(r+=3+i-5)}for(var s=0;s<t-1;s++)for(var n=0;n<t-1;n++){var l=0;e.isDark(s,n)&&l++,e.isDark(s+1,n)&&l++,e.isDark(s,n+1)&&l++,e.isDark(s+1,n+1)&&l++,
1(0==l||4==l)&&(r+=3)}for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(s,n)&&!e.isDark(s,n+1)&&e.isDark(s,n+2)&&e.isDark(s,n+3)&&e.isDark(s,n+4)&&!e.isDark(s,n+5)&&e.isDark(s,n+6)&&(r+=40);for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(s,n)&&!e.isDark(s+1,n)&&e.isDark(s+2,n)&&e.isDark(s+3,n)&&e.isDark(s+4,n)&&!e.isDark(s+5,n)&&e.isDark(s+6,n)&&(r+=40);for(var u=0,n=0;n<t;n++)for(var s=0;s<t;s++)e.isDark(s,n)&&u++;return r+Math.abs(100*u/t/t-50)/5*10}},a={glog:function(e){if(e<1)throw Error("glog("+e+")");return a.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return a.EXP_TABLE[e]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},c=0;c<8;c++)a.EXP_TABLE[c]=1<<c;for(var c=8;c<256;c++)a.EXP_TABLE[c]=a.EXP_TABLE[c-4]^a.EXP_TABLE[c-5]^a.EXP_TABLE[c-6]^a.EXP_TABLE[c-8];for(var c=0;c<255;c++)a.LOG_TABLE[a.EXP_TABLE[c]]=c;function l(e,t){if(void 0==e.length)throw Error(e.length+"/"+t);for(var r=0;r<e.length&&0==e[r];)r++;this.num=Array(e.length-r+t);for(var s=0;s<e.length-r;s++)this.num[s]=e[s+r]}function u(e,t){this.totalCount=e,this.dataCount=t}function d(){this.buffer=[],this.length=0}l.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var s=0;s<e.getLength();s++)t[r+s]^=a.gexp(a.glog(this.get(r))+a.glog(e.get(s)));return new l(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=a.glog(this.get(0))-a.glog(e.get(0)),r=Array(this.getLength()),s=0;s<this.getLength();s++)r[s]=this.get(s);for(var s=0;s<e.getLength();s++)r[s]^=a.gexp(a.glog(e.get(s))+t);return new l(r,0).mod(e)}},u.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],u.getRSBlocks=function(e,t){var r=u.getRsBlockTable(e,t);if(void 0==r)throw Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var s=r.length/3,n=[],i=0;i<s;i++)for(var o=r[3*i+0],a=r[3*i+1],c=r[3*i+2],l=0;l<o;l++)n.push(new u(a,c));return n},u.getRsBlockTable=function(e,t){switch(t){case n.L:return u.RS_BLOCK_TABLE[(e-1)*4+0];case n.M:return u.RS_BLOCK_TABLE[(e-1)*4+1];case n.Q:return u.RS_BLOCK_TABLE[(e-1)*4+2];case n.H:return u.RS_BLOCK_TABLE[(e-1)*4+3];default:return}},d.prototype={get:function(e){return(this.buffer[Math.floor(e/8)]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var h=[[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,8
16,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 p(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 Error("Expected 'content' as string!");if(0===this.options.content.length)throw Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw Error("Expected 'width' or 'height' value to be higher than zero!");var s=this.options.content,i=function(e,t){for(var r,s=(r=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a")).length+(r.length!=e?3:0),n=1,i=0,o=0,a=h.length;o<=a;o++){var c=h[o];if(!c)throw Error("Content too long: expected "+i+" but got "+s);switch(t){case"L":i=c[0];break;case"M":i=c[1];break;case"Q":i=c[2];break;case"H":i=c[3];break;default:throw Error("Unknwon error correction level: "+t)}if(s<=i)break;n++}if(n>h.length)throw Error("Content too long");return n}(s,this.options.ecl),o=function(e){switch(e){case"L":return n.L;case"M":return n.M;case"Q":return n.Q;case"H":return n.H;default:throw Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new r(i,o),this.qrcode.addData(s),this.qrcode.make()}p.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;void 0===e&&(e={container:t.container||"svg"});for(var s=void 0===t.pretty||!!t.pretty,n=s?" ":"",i=s?"\r\n":"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),u=a/(c+2*t.padding),d=void 0!==t.join&&!!t.join,h=void 0!==t.swap&&!!t.swap,p=void 0===t.xmlDeclaration||!!t.xmlDeclaration,f=void 0!==t.predefined&&!!t.predefined,g=f?n+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+l+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",m=n+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,b="",y="",v=0;v<c;v++)for(var w=0;w<c;w++)if(r[w][v]){var E=w*l+t.padding*l,_=v*u+t.padding*u;if(h){var k=E;E=_,_=k}if(d){var C=l+E,S=u+_;E=Number.isInteger(E)?Number(E):E.toFixed(2),_=Number.isInteger(_)?Number(_):_.toFixed(2),C=Number.isInteger(C)?Number(C):C.toFixed(2),y+="M"+E+","+_+" V"+(S=Number.isInteger(S)?Number(S):S.toFixed(2))+" H"+C+" V"+_+" H"+E+" Z "}else f?b+=n+'<use x="'+E.toString()+'" y="'+_.toString()+'" href="#qrmodule" />'+i:b+=n+'<rect x="'+E.toString()+'" y="'+_.toString()+'" width="'+l+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}d&&(b=n+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+y+'" />');let R="";if(void 0!==this.options.image&&this.options.image.svg){let e=o*this.options.image.width/100,t=a*this.options.image.height/100;R+=`<svg x="${o/2-e/2}" y="${a/2-t/2}" width="${e}" height="${t}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`+(this.options.image.svg+i)+"</svg>"}var I="";switch(e.container){case"svg":p&&(I+='<?xml version="1.0" standalone="yes"?>'+i),I+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i+(g+m+b)+R+"</svg>";break;case"svg-viewbox":p&&(I+='<?xml version="1.0" standalone="yes"?>'+i),I+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i+(g+m+b)+R+"</svg>";break;case"g":I+='<g width="'+o+'" height="'+a+'">'+i+(g+m+b)+R+"</g>";break;default:I+=(g+m+b+R).replace(/^\s+/,"")}return I},e.exports=p},67124:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0,t.LIB_VERSION="3.9.3"},4461:function(e,t,r){let s;var n=r(25566);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0,n=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(s++,"%c"===e&&(n=s))}),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){let e;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(s=!1,()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(84239)(t);let{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},84239:function(e,t,r){e.exports=function(e){function t(e){let r,n,i;let o=null;function a(...e){if(!a.enabled)return;let s=Number(new Date),n=s-(r||s);a.diff=n,a.prev=r,a.curr=s,r=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,s)=>{if("%%"===r)return"%";i++;let n=t.formatters[s];if("function"==typeof n){let t=e[i];r=n.call(a,t),e.splice(i,1),i--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==t.namespaces&&(n=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function s(e,r){let s=t(this.namespace+(void 0===r?":":r)+e);return s.log=this.log,s}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names.map(n),...t.skips.map(n).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];let s=("string"==typeof e?e:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?t.skips.push(RegExp("^"+e.slice(1)+"$")):t.names.push(RegExp("^"+e+"$")))},t.enabled=function(e){let r,s;if("*"===e[e.length-1])return!0;for(r=0,s=t.skips.length;r<s;r++)if(t.skips[r].test(e))return!1;for(r=0,s=t.names.length;r<s;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(60438),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},68590:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBlockTracker=void 0;let n=s(r(69930)),i=(e,t)=>e+t,o=["sync","latest"];class a extends n.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||2e4,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(e=>this.once("latest",e))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){o.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return o.map(e=>this.listenerCount(e)).reduce(i)}_shouldUseNewBlock(e){let t=this._currentBlock;if(!t)return!0;let r=c(e),s=c(t);return this._usePastBlocks&&r<s||r>s}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){let t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function c(e){return Number.parseInt(e,16)}t.BaseBlockTracker=a},42399:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingBlockTracker=void 0;let n=s(r(21192)),i=s(r(81044)),o=r(68590),a=r(58378),c=(0,a.createModuleLogger)(a.projectLogger,"polling-block-tracker"),l=(0,n.default)();class u extends o.BaseBlockTracker{constructor(e={}){var t;if(!e.provider)throw Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:null!==(t=e.blockResetDuration)&&void 0!==t?t:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||2e4,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===e.keepEventLoopActive||e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();let e=d(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await e}catch(s){let t=Error(`PollingBlockTracker - encountered an error while attempting to update latest block: 2${null!==(e=s.stack)&&void 0!==e?e:s}`);try{this.emit("error",t)}catch(e){console.error(t)}let r=d(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}}async _updateLatestBlock(){let e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){let e={jsonrpc:"2.0",id:l(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),c("Making request",e);let t=await (0,i.default)(t=>this._provider.sendAsync(e,t))();if(c("Got response",t),t.error)throw Error(`PollingBlockTracker - encountered error fetching block: 3${t.error.message}`);return t.result}}function d(e,t){return new Promise(r=>{let s=setTimeout(r,e);s.unref&&t&&s.unref()})}t.PollingBlockTracker=u}
3,57826:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscribeBlockTracker=void 0;let n=s(r(21192)),i=r(68590),o=(0,n.default)();class a extends i.BaseBlockTracker{constructor(e={}){if(!e.provider)throw Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{let e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...t){return new Promise((r,s)=>{this._provider.sendAsync({id:o(),method:e,params:t,jsonrpc:"2.0"},(e,t)=>{e?s(e):r(t.result)})})}_handleSubData(e,t){var r;"eth_subscription"===t.method&&(null===(r=t.params)||void 0===r?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(t.params.result.number)}}t.SubscribeBlockTracker=a},2704:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(42399),t),n(r(57826),t)},58378:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;let s=r(98502);Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return s.createModuleLogger}}),t.projectLogger=(0,s.createProjectLogger)("eth-block-tracker")},10944:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExhaustive=t.assertStruct=t.assert=t.AssertionError=void 0;let s=r(13142);function n(e,t){var r,s;return"string"==typeof(null===(s=null===(r=null==e?void 0:e.prototype)||void 0===r?void 0:r.constructor)||void 0===s?void 0:s.name)?new e({message:t}):e({message:t})}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}t.AssertionError=i,t.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw n(r,t)}},t.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,s.assert)(e,t)}catch(e){throw n(o,`${r}: ${function(e){let t="object"==typeof e&&null!==e&&"message"in e?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},t.assertExhaustive=function(e){throw Error("Invalid branch reached. Should be detected during compilation.")}},74755:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;let s=r(13142),n=r(10944);t.base64=(e,t={})=>{var r,i;let o,a;let c=null!==(r=t.paddingRequired)&&void 0!==r&&r,l=null!==(i=t.characterSet)&&void 0!==i?i:"base64";return"base64"===l?o=String.raw`[A-Za-z0-9+\/]`:((0,n.assert)("base64url"===l),o=String.raw`[-_A-Za-z0-9]`),a=c?RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,s.pattern)(e,a)}},26411:function(e,t,r){"use strict";var s=r(67133).Buffer;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;let n=r(10944),i=r(68096),o=function(){let e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function a(e){return e instanceof Uint8Array}function c(e){(0,n.assert)(a(e),"Value must be a Uint8Array.")}function l(e){if(c(e),0===e.length)return"0x";let t=o(),r=Array(e.length);for(let s=0;s<e.length;s++)r[s]=t[e[s]];return(0,i.add0x)(r.join(""))}function u(e){return c(e),BigInt(l(e))}function d(e){var t;if((null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e))==="0x")return new Uint8Array;(0,i.assertIsHexString)(e);let r=(0,i.remove0x)(e).toLowerCase(),s=r.length%2==0?r:`0${r}`,n=new Uint8Array(s.length/2);for(let e=0;e<n.length;e++){let t=s.charCodeAt(2*e),r=s.charCodeAt(2*e+1),i=t-(t<58?48:87),o=r-(r<58?48:87);n[e]=16*i+o}return n}function h(e){return(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=BigInt(0),"Value must be a non-negative bigint."),d(e.toString(16))}function p(e){return(0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),d(e.toString(16))}function f(e){return(0,n.assert)("string"==typeof e,"Value must be a string."),new TextEncoder().encode(e)}function g(e){if("bigint"==typeof e)return h(e);if("number"==typeof e)return p(e);if("string"==typeof e)return e.startsWith("0x")?d(e):f(e);if(a(e))return e;throw TypeError(`Unsupported value type: "${typeof e}".`)}t.isBytes=a,t.assertIsBytes=c,t.bytesToHex=l,t.bytesToBigInt=u,t.bytesToSignedBigInt=function(e){c(e);let t=BigInt(0);for(let r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},t.bytesToNumber=function(e){c(e);let t=u(e);return(0,n.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},t.bytesToString=function(e){return c(e),new TextDecoder().decode(e)},t.hexToBytes=d,t.bigIntToBytes=h,t.signedBigIntToBytes=function(e,t){(0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)("number"==typeof t,"Byte length must be a number."),(0,n.assert)(t>0,"Byte length must be greater than 0."),(0,n.assert)(function(e,t){(0,n.assert)(t>0);let r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t+-1))}(e,t),"Byte length is too small to represent the given value.");let r=e,s=new Uint8Array(t);for(let e=0;e<s.length;e++)s[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return s.reverse()},t.numberToBytes=p,t.stringToBytes=f,t.valueToBytes=g,t.concatBytes=function(e){let t=Array(e.length),r=0;for(let s=0;s<e.length;s++){let n=g(e[s]);t[s]=n,r+=n.length}let s=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)s.set(t[e],r),r+=t[e].length;return s},t.createDataView=function(e){if(void 0!==s&&e instanceof s){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}},66763:function(e,t,r){"use strict";
3Object.defineProperty(t,"__esModule",{value:!0}),t.ChecksumStruct=void 0;let s=r(13142),n=r(74755);t.ChecksumStruct=(0,s.size)((0,n.base64)((0,s.string)(),{paddingRequired:!0}),44,44)},51786:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=t.createBytes=t.createBigInt=t.createNumber=void 0;let s=r(13142),n=r(10944),i=r(26411),o=r(68096),a=(0,s.union)([(0,s.number)(),(0,s.bigint)(),(0,s.string)(),o.StrictHexStruct]),c=(0,s.coerce)((0,s.number)(),a,Number),l=(0,s.coerce)((0,s.bigint)(),a,BigInt);(0,s.union)([o.StrictHexStruct,(0,s.instance)(Uint8Array)]);let u=(0,s.coerce)((0,s.instance)(Uint8Array),(0,s.union)([o.StrictHexStruct]),i.hexToBytes),d=(0,s.coerce)(o.StrictHexStruct,(0,s.instance)(Uint8Array),i.bytesToHex);t.createNumber=function(e){try{let t=(0,s.create)(e,c);return(0,n.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof s.StructError)throw Error(`Expected a number-like value, got "${e}".`);throw t}},t.createBigInt=function(e){try{return(0,s.create)(e,l)}catch(e){if(e instanceof s.StructError)throw Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},t.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,s.create)(e,u)}catch(e){if(e instanceof s.StructError)throw Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},t.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,s.create)(e,d)}catch(e){if(e instanceof s.StructError)throw Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},46411:function(e,t){"use strict";var r,s,n=this&&this.__classPrivateFieldSet||function(e,t,r,s,n){if("m"===s)throw TypeError("Private method is not writable");if("a"===s&&!n)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,s){if("a"===r&&!s)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.FrozenSet=t.FrozenMap=void 0;class o{constructor(e){r.set(this,void 0),n(this,r,new Map(e),"f"),Object.freeze(this)}get size(){return i(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return i(this,r,"f")[Symbol.iterator]()}entries(){return i(this,r,"f").entries()}forEach(e,t){return i(this,r,"f").forEach((r,s,n)=>e.call(t,r,s,this))}get(e){return i(this,r,"f").get(e)}has(e){return i(this,r,"f").has(e)}keys(){return i(this,r,"f").keys()}values(){return i(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,t])=>`${String(e)} => ${String(t)}`).join(", ")} `:""}}`}}t.FrozenMap=o;class a{constructor(e){s.set(this,void 0),n(this,s,new Set(e),"f"),Object.freeze(this)}get size(){return i(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return i(this,s,"f")[Symbol.iterator]()}entries(){return i(this,s,"f").entries()}forEach(e,t){return i(this,s,"f").forEach((r,s,n)=>e.call(t,r,s,this))}has(e){return i(this,s,"f").has(e)}keys(){return i(this,s,"f").keys()}values(){return i(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}t.FrozenSet=a,Object.freeze(o),Object.freeze(o.prototype),Object.freeze(a),Object.freeze(a.prototype)},27047:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68096:function(e,t,r){"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;let s=r(13142),n=r(10944);function i(e){return(0,s.is)(e,t.HexStruct)}function o(e){return(0,s.is)(e,t.StrictHexStruct)}t.HexStruct=(0,s.pattern)((0,s.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,s.pattern)((0,s.string)(),/^0x[0-9a-f]+$/iu),t.isHexString=i,t.isStrictHexString=o,t.assertIsHexString=function(e){(0,n.assert)(i(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,n.assert)(o(e),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},t.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},98502:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);
3(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(10944),t),n(r(74755),t),n(r(26411),t),n(r(66763),t),n(r(51786),t),n(r(46411),t),n(r(27047),t),n(r(68096),t),n(r(40023),t),n(r(50848),t),n(r(8741),t),n(r(88550),t),n(r(31824),t),n(r(52298),t),n(r(33649),t),n(r(9663),t),n(r(73544),t)},40023:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),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.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;let s=r(13142),n=r(10944);t.UnsafeJsonStruct=(0,s.union)([(0,s.literal)(null),(0,s.boolean)(),(0,s.define)("finite number",e=>(0,s.is)(e,(0,s.number)())&&Number.isFinite(e)),(0,s.string)(),(0,s.array)((0,s.lazy)(()=>t.UnsafeJsonStruct)),(0,s.record)((0,s.string)(),(0,s.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,s.define)("Json",(e,r)=>{function s(e,t){let s=[...t.validator(e,r)];return!(s.length>0)||s}try{let r=s(e,t.UnsafeJsonStruct);if(!0!==r)return r;return s(JSON.parse(JSON.stringify(e)),t.UnsafeJsonStruct)}catch(e){if(e instanceof RangeError)return"Circular reference detected";return!1}}),t.isValidJson=function(e){return(0,s.is)(e,t.JsonStruct)},t.getJsonSize=function(e){(0,n.assertStruct)(e,t.JsonStruct,"Invalid JSON value");let r=JSON.stringify(e);return new TextEncoder().encode(r).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,s.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,s.nullable)((0,s.union)([(0,s.number)(),(0,s.string)()])),t.JsonRpcErrorStruct=(0,s.object)({code:(0,s.integer)(),message:(0,s.string)(),data:(0,s.optional)(t.JsonStruct),stack:(0,s.optional)((0,s.string)())}),t.JsonRpcParamsStruct=(0,s.optional)((0,s.union)([(0,s.record)((0,s.string)(),t.JsonStruct),(0,s.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,s.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,s.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,s.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(e){return(0,s.is)(e,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,r){(0,n.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},t.isJsonRpcRequest=function(e){return(0,s.is)(e,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,r){(0,n.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},t.PendingJsonRpcResponseStruct=(0,s.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,s.optional)((0,s.unknown)()),error:(0,s.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,s.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,s.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,s.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(e){return(0,s.is)(e,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,r){(0,n.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},t.isJsonRpcResponse=function(e){return(0,s.is)(e,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,r){(0,n.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},t.isJsonRpcSuccess=function(e){return(0,s.is)(e,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,r){(0,n.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},t.isJsonRpcFailure=function(e){return(0,s.is)(e,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,r){(0,n.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},t.isJsonRpcError=function(e){return(0,s.is)(e,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,r){(0,n.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},t.getJsonRpcIdValidator=function(e){let{permitEmptyString:t,permitFractions:r,permitNull:s}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>!!("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||s&&null===e)}},50848:function(e,t){"use strict";
3Object.defineProperty(t,"__esModule",{value:!0})},8741:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;let n=(0,s(r(4461)).default)("metamask");t.createProjectLogger=function(e){return n.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},88550:function(e,t){"use strict";var r;function s(e){return 127>=e.charCodeAt(0)}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},t.isObject=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)},t.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(r=t.JsonSize||(t.JsonSize={}))[r.Null=4]="Null",r[r.Comma=1]="Comma",r[r.Wrapper=1]="Wrapper",r[r.True=4]="True",r[r.False=5]="False",r[r.Quote=1]="Quote",r[r.Colon=1]="Colon",r[r.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},t.isASCII=s,t.calculateStringSize=function(e){var r;return e.split("").reduce((e,t)=>s(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}},31824:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;let s=r(10944),n=r(68096);t.numberToHex=e=>((0,s.assert)("number"==typeof e,"Value must be a number."),(0,s.assert)(e>=0,"Value must be a non-negative number."),(0,s.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,n.add0x)(e.toString(16))),t.bigIntToHex=e=>((0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)(e>=0,"Value must be a non-negative bigint."),(0,n.add0x)(e.toString(16))),t.hexToNumber=e=>{(0,n.assertIsHexString)(e);let t=parseInt(e,16);return(0,s.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},t.hexToBigInt=e=>((0,n.assertIsHexString)(e),BigInt((0,n.add0x)(e)))},52298:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},33649:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(r=t.Duration||(t.Duration={}))[r.Millisecond=1]="Millisecond",r[r.Second=1e3]="Second",r[r.Minute=6e4]="Minute",r[r.Hour=36e5]="Hour",r[r.Day=864e5]="Day",r[r.Week=6048e5]="Week",r[r.Year=31536e6]="Year";let s=e=>Number.isInteger(e)&&e>=0,n=(e,t)=>{if(!s(e))throw Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.inMilliseconds=function(e,t){return n(e,"count"),e*t},t.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}},9663:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},73544:function(e,t,r){"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;let s=r(84076),n=r(13142),i=r(10944);t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",e=>null!==(0,s.valid)(e)||`Expected SemVer version, got "${e}"`),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",e=>null!==(0,s.validRange)(e)||`Expected SemVer range, got "${e}"`),t.isValidSemVerVersion=function(e){return(0,n.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,n.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,i.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,i.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,s.gt)(e,t)},t.gtRange=function(e,t){return(0,s.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,s.satisfies)(e,t,{includePrerelease:!0})}},81044:function(e){"use strict";let t=(e,t)=>function(){let r=t.promiseModule,s=Array(arguments.length);for(let e=0;e<arguments.length;e++)s[e]=arguments[e];return new r((r,n)=>{t.errorFirst?s.push(function(e,s){if(t.multiArgs){let t=Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),n(t)):r(t)}else e?n(e):r(s)}):s.push(function(e){if(t.multiArgs){let e=Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];r(e)}else r(e)}),e.apply(this,s)})};e.exports=(e,r)=>{let s;r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);let n=e=>{let t=t=>"string"==typeof t?e===t:t.test(e);return r.include?r.include.some(t):!r.exclude.some(t)};for(let i in s="function"==typeof e?function(){return r.excludeMain?e.apply(this,arguments):t(e,r).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e)),e){let o=e[i];s[i]="function"==typeof o&&n(i)?t(o,r):o}return s}},44907:function(e,t,r){let s=r(12928);class n extends s{constructor(){super(),this.allResults=[]}
3async update(){throw Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}}e.exports=n},12928:function(e,t,r){let s=r(69930).default;class n extends s{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(e=>this.emit("update",e))}addInitialResults(e){}getChangesAndClear(){let e=this.updates;return this.updates=[],e}}e.exports=n},28500:function(e,t,r){let s=r(12928),n=r(53936),{incrementHexInt:i}=r(19691);class o extends s{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){let r=i(e),s=(await n({provider:this.provider,fromBlock:r,toBlock:t})).map(e=>e.hash);this.addResults(s)}}e.exports=o},53936:function(e){async function t({provider:e,fromBlock:t,toBlock:i}){t||(t=i);let o=r(t),a=Array(r(i)-o+1).fill().map((e,t)=>o+t).map(s);return(await Promise.all(a.map(t=>n(e,"eth_getBlockByNumber",[t,!1])))).filter(e=>null!==e)}function r(e){return null==e?e:Number.parseInt(e,16)}function s(e){return null==e?e:"0x"+e.toString(16)}async function n(e,t,r){for(let s=0;s<3;s++)try{return await function(e,t){return new Promise((r,s)=>{e.sendAsync(t,(e,t)=>{e?s(e):t.error?s(t.error):t.result?r(t.result):s(Error("Result was empty"))})})}(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(e){console.error(`provider.sendAsync failed: ${e.stack||e.message||e}`)}return null}e.exports=t},19691:function(e){function t(e){return e.sort((e,t)=>"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:r(e)-r(t))}function r(e){return null==e?e:Number.parseInt(e,16)}function s(e){if(null==e)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function n(){return Math.floor(16*Math.random()).toString(16)}e.exports={minBlockRef:function(...e){return t(e)[0]},maxBlockRef:function(...e){let r=t(e);return r[r.length-1]},sortBlockRefs:t,bnToHex:function(e){return"0x"+e.toString(16)},blockRefIsNumber:function(e){return e&&!["earliest","latest","pending"].includes(e)},hexToInt:r,incrementHexInt:function(e){return null==e?e:s(r(e)+1)},intToHex:s,unsafeRandomBytes:function(e){let t="0x";for(let r=0;r<e;r++)t+=n()+n();return t}}},51018:function(e,t,r){let s=r(72140).WU,{createAsyncMiddleware:n,createScaffoldMiddleware:i}=r(49116),o=r(26723),a=r(28500),c=r(78575),{intToHex:l,hexToInt:u}=r(19691);function d(e){return h(async(...t)=>l((await e(...t)).id))}function h(e){return n(async(t,r)=>{let s=await e.apply(null,t.params);r.result=s})}function p(e,t){let r=[];for(let t in e)r.push(e[t]);return r}e.exports=function({blockTracker:e,provider:t}){let r=0,n={},f=new s,g=function({mutex:e}){return t=>async(r,s,n,i)=>{(await e.acquire())(),t(r,s,n,i)}}({mutex:f}),m=i({eth_newFilter:g(d(y)),eth_newBlockFilter:g(d(v)),eth_newPendingTransactionFilter:g(d(w)),eth_uninstallFilter:g(h(k)),eth_getFilterChanges:g(h(E)),eth_getFilterLogs:g(h(_))}),b=async({oldBlock:e,newBlock:t})=>{if(0===n.length)return;let r=await f.acquire();try{await Promise.all(p(n).map(async r=>{try{await r.update({oldBlock:e,newBlock:t})}catch(e){console.error(e)}}))}catch(e){console.error(e)}r()};return m.newLogFilter=y,m.newBlockFilter=v,m.newPendingTransactionFilter=w,m.uninstallFilter=k,m.getFilterChanges=E,m.getFilterLogs=_,m.destroy=()=>{R()},m;async function y(e){let r=new o({provider:t,params:e});return await C(r),r}async function v(){let e=new a({provider:t});return await C(e),e}async function w(){let e=new c({provider:t});return await C(e),e}async function E(e){let t=u(e),r=n[t];if(!r)throw Error(`No filter for index "${t}"`);return r.getChangesAndClear()}async function _(e){let t=u(e),r=n[t];if(!r)throw Error(`No filter for index "${t}"`);let s=[];return"log"===r.type&&(s=r.getAllResults()),s}async function k(e){let t=u(e),r=!!n[t];return r&&await S(t),r}async function C(t){let s=p(n).length,i=await e.getLatestBlock();return await t.initialize({currentBlock:i}),n[++r]=t,t.id=r,t.idHex=l(r),I({prevFilterCount:s,newFilterCount:p(n).length}),r}async function S(e){let t=p(n).length;delete n[e],I({prevFilterCount:t,newFilterCount:p(n).length})}async function R(){let e=p(n).length;n={},I({prevFilterCount:e,newFilterCount:0})}function I({prevFilterCount:t,newFilterCount:r}){if(0===t&&r>0){e.on("sync",b);return}if(t>0&&0===r){e.removeListener("sync",b);return}}}},26723:function(e,t,r){let s=r(81972),n=r(743),i=r(44907),{bnToHex:o,hexToInt:a,incrementHexInt:c,minBlockRef:l,blockRefIsNumber:u}=r(19691);class d extends i{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new s(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(e=>e.toLowerCase()))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;let r=l(this.params.toBlock,e),s=Object.assign({},this.params,{toBlock:r}),n=await this._fetchLogs(s);this.addInitialResults(n)}async update({oldBlock:e,newBlock:t}){let r;r=e?c(e):t;let s=Object.assign({},this.params,{fromBlock:r,toBlock:t}),n=(await this._fetchLogs(s)).filter(e=>this.matchLog(e));this.addResults(n)}async _fetchLogs(e){return await n(t=>this.ethQuery.getLogs(e,t))()}matchLog(e){if(a(this.params.fromBlock)>=a(e.blockNumber)||u(this.params.toBlock)&&a(this.params.toBlock)<=a(e.blockNumber))return!1;let t=e.address&&e.address.toLowerCase();return(!this.params.address||!t||!!this.params.address.includes(t))&&this.params.topics.every((t,r)=>{let s=e.topics[r];if(!s)return!1;s=s.toLowerCase();let n=Array.isArray(t)?t:[t];return!!n.includes(null)||(n=n.map(e=>e.toLowerCase())).includes(s)})}}e.exports=d},743:function(e){"use strict";let t=(e,t,r,s)=>function(...n){return new t.promiseModule((i,o)=>{t.multiArgs?n.push((...e)=>{t.errorFirst?e[0]?o(e):(e.shift(),i(e)):i(e)}):t.errorFirst?n.push((e,t)=>{e?o(e):i(t)}):n.push(i),Reflect.apply(e,this===r?s:this,n)})},r=new WeakMap;e.exports=(e,s)=>{s={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...s};let n=typeof e;if(!(null!==e&&("object"===n||"function"===n)))throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":n}\``);let i=(e,t)=>{let n=r.get(e);if(n||(n={},r.set(e,n)),t in n)return n[t];let i=e=>"string"==typeof e||"symbol"==typeof t?t===e:e.test(t),o=Reflect.getOwnPropertyDescriptor(e,t),a=void 0===o||o.writable||o.configurable,c=(s.include?s.include.some(i):!s.exclude.some(i))&&a;return n[t]=c,c},o=new WeakMap,a=new Proxy(e,{apply(e,r,n){let i=o.get(e);if(i)return Reflect.apply(i,r,n);let c=s.excludeMain?e:t(e,s,a,e);return o.set(e,c),Reflect.apply(c,r,n)},get(e,r){let n=e[r];if(!i(e,r)||n===Function.prototype[r])return n;let c=o.get(n);if(c)return c;if("function"==typeof n){let r=t(n,s,a,e);return o.set(n,r),r}return n}});return a}},55117:function(e,t,r){let s=r(69930).default,{createAsyncMiddleware:n,createScaffoldMiddleware:i}=r(49116),o=r(51018),{unsafeRandomBytes:a,incrementHexInt:c}=r(19691),l=r(53936);function u(e){return null==e?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLim
3it:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}e.exports=function({blockTracker:e,provider:t}){let r={},d=o({blockTracker:e,provider:t}),h=!1,p=new s,f=i({eth_subscribe:n(g),eth_unsubscribe:n(m)});return f.destroy=function(){for(let e in p.removeAllListeners(),r)r[e].destroy(),delete r[e];h=!0},{events:p,middleware:f};async function g(s,n){let i;if(h)throw Error("SubscriptionManager - attempting to use after destroying");let o=s.params[0],p=a(16);switch(o){case"newHeads":i=function({subId:r}){let s={type:o,destroy:async()=>{e.removeListener("sync",s.update)},update:async({oldBlock:e,newBlock:s})=>{let n=c(e);(await l({provider:t,fromBlock:n,toBlock:s})).map(u).filter(e=>null!==e).forEach(e=>{b(r,e)})}};return e.on("sync",s.update),s}({subId:p});break;case"logs":let f=s.params[1];i=function({subId:e,filter:t}){return t.on("update",t=>b(e,t)),{type:o,destroy:async()=>await d.uninstallFilter(t.idHex)}}({subId:p,filter:await d.newLogFilter(f)});break;default:throw Error(`SubscriptionManager - unsupported subscription type "${o}"`)}r[p]=i,n.result=p}async function m(e,t){if(h)throw Error("SubscriptionManager - attempting to use after destroying");let s=e.params[0],n=r[s];if(!n){t.result=!1;return}delete r[s],await n.destroy(),t.result=!0}function b(e,t){p.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}},78575:function(e,t,r){let s=r(12928),n=r(53936),{incrementHexInt:i}=r(19691);class o extends s{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){let t=i(e),r=await n({provider:this.provider,fromBlock:t,toBlock:e}),s=[];for(let e of r)s.push(...e.transactions);this.addResults(s)}}e.exports=o},81972:function(e,t,r){let s=r(49820),n=r(21192)();function i(e){this.currentProvider=e}function o(e){return function(){var t=[].slice.call(arguments),r=t.pop();this.sendAsync({method:e,params:t},r)}}function a(e,t){return function(){var r=[].slice.call(arguments),s=r.pop();r.length<e&&r.push("latest"),this.sendAsync({method:t,params:r},s)}}e.exports=i,i.prototype.getBalance=a(2,"eth_getBalance"),i.prototype.getCode=a(2,"eth_getCode"),i.prototype.getTransactionCount=a(2,"eth_getTransactionCount"),i.prototype.getStorageAt=a(3,"eth_getStorageAt"),i.prototype.call=a(2,"eth_call"),i.prototype.protocolVersion=o("eth_protocolVersion"),i.prototype.syncing=o("eth_syncing"),i.prototype.coinbase=o("eth_coinbase"),i.prototype.mining=o("eth_mining"),i.prototype.hashrate=o("eth_hashrate"),i.prototype.gasPrice=o("eth_gasPrice"),i.prototype.accounts=o("eth_accounts"),i.prototype.blockNumber=o("eth_blockNumber"),i.prototype.getBlockTransactionCountByHash=o("eth_getBlockTransactionCountByHash"),i.prototype.getBlockTransactionCountByNumber=o("eth_getBlockTransactionCountByNumber"),i.prototype.getUncleCountByBlockHash=o("eth_getUncleCountByBlockHash"),i.prototype.getUncleCountByBlockNumber=o("eth_getUncleCountByBlockNumber"),i.prototype.sign=o("eth_sign"),i.prototype.sendTransaction=o("eth_sendTransaction"),i.prototype.sendRawTransaction=o("eth_sendRawTransaction"),i.prototype.estimateGas=o("eth_estimateGas"),i.prototype.getBlockByHash=o("eth_getBlockByHash"),i.prototype.getBlockByNumber=o("eth_getBlockByNumber"),i.prototype.getTransactionByHash=o("eth_getTransactionByHash"),i.prototype.getTransactionByBlockHashAndIndex=o("eth_getTransactionByBlockHashAndIndex"),i.prototype.getTransactionByBlockNumberAndIndex=o("eth_getTransactionByBlockNumberAndIndex"),i.prototype.getTransactionReceipt=o("eth_getTransactionReceipt"),i.prototype.getUncleByBlockHashAndIndex=o("eth_getUncleByBlockHashAndIndex"),i.prototype.getUncleByBlockNumberAndIndex=o("eth_getUncleByBlockNumberAndIndex"),i.prototype.getCompilers=o("eth_getCompilers"),i.prototype.compileLLL=o("eth_compileLLL"),i.prototype.compileSolidity=o("eth_compileSolidity"),i.prototype.compileSerpent=o("eth_compileSerpent"),i.prototype.newFilter=o("eth_newFilter"),i.prototype.newBlockFilter=o("eth_newBlockFilter"),i.prototype.newPendingTransactionFilter=o("eth_newPendingTransactionFilter"),i.prototype.uninstallFilter=o("eth_uninstallFilter"),i.prototype.getFilterChanges=o("eth_getFilterChanges"),i.prototype.getFilterLogs=o("eth_getFilterLogs"),i.prototype.getLogs=o("eth_getLogs"),i.prototype.getWork=o("eth_getWork"),i.prototype.submitWork=o("eth_submitWork"),i.prototype.submitHashrate=o("eth_submitHashrate"),i.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(s({id:n(),jsonrpc:"2.0",params:[]},e),function(e,r){if(!e&&r.error&&(e=Error("EthQuery - RPC Error - "+r.error.message)),e)return t(e);t(null,r.result)})}},62096:function(e,t,r){"use strict";
3Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;let s=r(28534);class n extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){let e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return s.default(this.serialize(),o,2)}}t.EthereumRpcError=n;class i extends n{constructor(e,t,r){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=i},58519:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},71984:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;let s=r(62096),n=r(81199),i=r(58519);function o(e,t){let[r,i]=c(t);return new s.EthereumRpcError(e,r||n.getMessageFromCode(e),i)}function a(e,t){let[r,i]=c(t);return new s.EthereumProviderError(e,r||n.getMessageFromCode(e),i)}function c(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>o(i.errorCodes.rpc.parse,e),invalidRequest:e=>o(i.errorCodes.rpc.invalidRequest,e),invalidParams:e=>o(i.errorCodes.rpc.invalidParams,e),methodNotFound:e=>o(i.errorCodes.rpc.methodNotFound,e),internal:e=>o(i.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code
3<= -32005');return o(t,e)},invalidInput:e=>o(i.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>o(i.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>o(i.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>o(i.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>o(i.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>o(i.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(i.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(i.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(i.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(i.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(i.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new s.EthereumProviderError(t,r,n)}}}},46281:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;let s=r(62096);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return s.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return s.EthereumProviderError}});let n=r(81199);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});let i=r(71984);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return i.ethErrors}});let o=r(58519);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})},81199:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let s=r(58519),n=r(62096),i=s.errorCodes.rpc.internal,o={code:i,message:a(i)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){let r=e.toString();if(u(s.errorValues,r))return s.errorValues[r].message;if(e>=-32099&&e<=-32e3)return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function c(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(s.errorValues[t]||e>=-32099&&e<=-32e3)}function l(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=c,t.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:r=!1}={}){if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw Error("Must provide fallback error with integer number code and string message.");if(e instanceof n.EthereumRpcError)return e.serialize();let s={};if(e&&"object"==typeof e&&!Array.isArray(e)&&u(e,"code")&&c(e.code))s.code=e.code,e.message&&"string"==typeof e.message?(s.message=e.message,u(e,"data")&&(s.data=e.data)):(s.message=a(s.code),s.data={originalError:l(e)});else{s.code=t.code;let r=null==e?void 0:e.message;s.message=r&&"string"==typeof r?r:t.message,s.data={originalError:l(e)}}let i=null==e?void 0:e.stack;return r&&e&&i&&"string"==typeof i&&(s.stack=i),s}},28534:function(e){e.exports=o,o.default=o,o.stable=l,o.stableStringify=l;var t="[...]",r="[Circular]",s=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,o,c,l){void 0===l&&(l=i()),function e(s,n,i,o,c,l,u){if(l+=1,"object"==typeof s&&null!==s){for(d=0;d<o.length;d++)if(o[d]===s){a(r,s,n,c);return}if(void 0!==u.depthLimit&&l>u.depthLimit||void 0!==u.edgesLimit&&i+1>u.edgesLimit){a(t,s,n,c);return}if(o.push(s),Array.isArray(s))for(d=0;d<s.length;d++)e(s[d],d,d,o,s,l,u);else{var d,h=Object.keys(s);for(d=0;d<h.length;d++){var p=h[d];e(s[p],p,d,o,s,l,u)}}o.pop()}}(e,"",0,[],void 0,0,l);try{d=0===n.length?JSON.stringify(e,o,c):JSON.stringify(e,u(o),c)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==s.length;){var d,h=s.pop();4===h.length?Object.defineProperty(h[0],h[1],h[3]):h[0][h[1]]=h[2]}}return d}function a(e,t,r,i){var o=Object.getOwnPropertyDescriptor(i,r);void 0!==o.get?o.configurable?(Object.defineProperty(i,r,{value:e}),s.push([i,r,t,o])):n.push([t,r,e]):(i[r]=e,s.push([i,r,t]))}function c(e,t){return e<t?-1:e>t?1:0}function l(e,o,l,d){void 0===d&&(d=i());var h,p=function e(n,i,o,l,u,d,h){if(d+=1,"object"==typeof n&&null!==n){for(p=0;p<l.length;p++)if(l[p]===n){a(r,n,i,u);return}try{if("function"==typeof n.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&d>h.depthLimit||void 0!==h.edgesLimit&&o+1>h.edgesLimit){a(t,n,i,u);return}if(l.push(n),Array.isArray(n))for(p=0;p<n.length;p++)e(n[p],p,p,l,n,d,h);else{var p,f={},g=Object.keys(n).sort(c);for(p=0;p<g.length;p++){var m=g[p];e(n[m],m,p,l,n,d,h),f[m]=n[m]}if(void 0===u)return f;s.push([u,i,n]),u[i]=f}l.pop()}}(e,"",0,[],void 0,0,d)||e;try{h=0===n.length?JSON.stringify(p,o,l):JSON.stringify(p,u(o),l)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==s.length;){var f=s.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return h}function u(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var s=0;s<n.length;s++){var i=n[s];if(i[1]===t&&i[0]===r){r=i[2],n.splice(s,1);break}}return e.call(this,t,r)}}},8566:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esMo
3dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcEngine=void 0;let n=s(r(75077)),i=r(46281);class o extends n.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,s)=>{try{let[n,i,a]=await o._runAllMiddleware(e,t,this._middleware);if(i)return await o._runReturnHandlers(a),s(n);return r(async e=>{try{await o._runReturnHandlers(a)}catch(t){return e(t)}return e()})}catch(e){return s(e)}}}async _handleBatch(e,t){try{let r=await Promise.all(e.map(this._promiseHandle.bind(this)));if(t)return t(null,r);return r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise(t=>{this._handle(e,(e,r)=>{t(r)})})}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){let r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return t(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof e.method){let r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}let r=Object.assign({},e),s={id:r.id,jsonrpc:r.jsonrpc},n=null;try{await this._processRequest(r,s)}catch(e){n=e}return n&&(delete s.result,s.error||(s.error=i.serializeError(n))),t(n,s)}async _processRequest(e,t){let[r,s,n]=await o._runAllMiddleware(e,t,this._middleware);if(o._checkForCompletion(e,t,s),await o._runReturnHandlers(n),r)throw r}static async _runAllMiddleware(e,t,r){let s=[],n=null,i=!1;for(let a of r)if([n,i]=await o._runMiddleware(e,t,a,s),i)break;return[n,i,s.reverse()]}static _runMiddleware(e,t,r,s){return new Promise(n=>{let o=e=>{let r=e||t.error;r&&(t.error=i.serializeError(r)),n([r,!0])};try{r(e,t,r=>{t.error?o(t.error):(r&&("function"!=typeof r&&o(new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request: 4${a(e)}`,{request:e})),s.push(r)),n([null,!1]))},o)}catch(e){o(e)}})}static async _runReturnHandlers(e){for(let t of e)await new Promise((e,r)=>{t(t=>t?r(t):e())})}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: 5${a(e)}`,{request:e});if(!r)throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: 6${a(e)}`,{request:e})}}function a(e){return JSON.stringify(e,null,2)}t.JsonRpcEngine=o},4029:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsyncMiddleware=void 0,t.createAsyncMiddleware=function(e){return async(t,r,s,n)=>{let i;let o=new Promise(e=>{i=e}),a=null,c=!1,l=async()=>{c=!0,s(e=>{a=e,i()}),await o};try{await e(t,r,l),c?(await o,a(null)):n(null)}catch(e){a?a(e):n(e)}}}},74386:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createScaffoldMiddleware=void 0,t.createScaffoldMiddleware=function(e){return(t,r,s,n)=>{let i=e[t.method];return void 0===i?s():"function"==typeof i?i(t,r,s,n):(r.result=i,n())}}},74719:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;let r=Math.floor(4294967295*Math.random());t.getUniqueId=function(){return r=(r+1)%4294967295}},94449:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdRemapMiddleware=void 0;let s=r(74719);t.createIdRemapMiddleware=function(){return(e,t,r,n)=>{let i=e.id,o=s.getUniqueId();e.id=o,t.id=o,r(r=>{e.id=i,t.id=i,r()})}}},49116:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};
6Object.defineProperty(t,"__esModule",{value:!0}),n(r(94449),t),n(r(4029),t),n(r(74386),t),n(r(74719),t),n(r(8566),t),n(r(13592),t)},13592:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMiddleware=void 0;let s=r(8566);t.mergeMiddleware=function(e){let t=new s.JsonRpcEngine;return e.forEach(e=>t.push(e)),t.asMiddleware()}},75077:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(512);function n(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout(()=>{throw e})}}class i extends s.EventEmitter{emit(e,...t){let r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let r=Error(`Unhandled error.${e?` (${e.message})`:""}`);throw r.context=e,r}let i=s[e];if(void 0===i)return!1;if("function"==typeof i)n(i,this,t);else{let e=i.length,r=function(e){let t=e.length,r=Array(t);for(let s=0;s<t;s+=1)r[s]=e[s];return r}(i);for(let s=0;s<e;s+=1)n(r[s],this,t)}return!0}}t.default=i},21192:function(e){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}},60438:function(e){function t(e,t,r,s){return Math.round(e/r)+" "+s+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var s,n,i=typeof e;if("string"===i&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===i&&isFinite(e))return r.long?(s=Math.abs(e))>=864e5?t(e,s,864e5,"day"):s>=36e5?t(e,s,36e5,"hour"):s>=6e4?t(e,s,6e4,"minute"):s>=1e3?t(e,s,1e3,"second"):e+" ms":(n=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":n>=36e5?Math.round(e/36e5)+"h":n>=6e4?Math.round(e/6e4)+"m":n>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},48394:function(e,t,r){let s=Symbol("SemVer ANY");class n{static get ANY(){return s}constructor(e,t){if(t=i(t),e instanceof n){if(!!t.loose===e.loose)return e;e=e.value}l("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===s?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){let t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof n))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=n;let i=r(52887),{safeRe:o,t:a}
6=r(19678),c=r(25212),l=r(21628),u=r(24642),d=r(64070)},64070:function(e,t,r){let s=/\s+/g;class n{constructor(e,t){if(t=o(t),e instanceof n){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;return new n(e.raw,t)}if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!b(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=i.get(t);if(r)return r;let s=this.options.loose,n=s?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];c("hyphen replace",e=e.replace(n,M(this.options.includePrerelease))),c("comparator trim",e=e.replace(u[d.COMPARATORTRIM],h)),c("tilde trim",e=e.replace(u[d.TILDETRIM],p)),c("caret trim",e=e.replace(u[d.CARETTRIM],f));let o=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options));s&&(o=o.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c("range list",o);let l=new Map;for(let e of o.map(e=>new a(e,this.options))){if(b(e))return[e];l.set(e.value,e)}l.size>1&&l.has("")&&l.delete("");let y=[...l.values()];return i.set(t,y),y}intersects(e,t){if(!(e instanceof n))throw TypeError("a Range is required");return this.set.some(r=>v(r,t)&&e.set.some(e=>v(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(N(this.set[t],e,this.options))return!0;return!1}}e.exports=n;let i=new(r(919)),o=r(52887),a=r(48394),c=r(21628),l=r(24642),{safeRe:u,t:d,comparatorTrimReplace:h,tildeTrimReplace:p,caretTrimReplace:f}=r(19678),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:m}=r(90323),b=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,v=(e,t)=>{let r=!0,s=e.slice(),n=s.pop();for(;r&&s.length;)r=s.every(e=>n.intersects(e,t)),n=s.pop();return r},w=(e,t)=>(c("comp",e,t),c("caret",e=C(e,t)),c("tildes",e=_(e,t)),c("xrange",e=R(e,t)),c("stars",e=x(e,t)),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map(e=>k(e,t)).join(" "),k=(e,t)=>{let r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,s,n,i)=>{let o;return c("tilde",e,t,r,s,n,i),E(r)?o="":E(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:E(n)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:i?(c("replaceTilde pr",i),o=`>=${r}.${s}.${n}-${i} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${n} <${r}.${+s+1}.0-0`,c("tilde return",o),o})},C=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{c("caret",e,t);let r=t.loose?u[d.CARETLOOSE]:u[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,n,i,o)=>{let a;return c("caret",e,t,r,n,i,o),E(r)?a="":E(n)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:E(i)?a="0"===r?`>=${r}.${n}.0${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${s} <${+r+1}.0.0-0`:o?(c("replaceCaret pr",o),a="0"===r?"0"===n?`>=${r}.${n}.${i}-${o} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i}-${o} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===n?`>=${r}.${n}.${i}${s} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i} <${+r+1}.0.0-0`),c("caret return",a),a})},R=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>I(e,t)).join(" ")),I=(e,t)=>{e=e.trim();let r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,s,n,i,o,a)=>{c("xRange",e,r,s,n,i,o,a);let l=E(n),u=l||E(i),d=u||E(o);return"="===s&&d&&(s=""),a=t.includePrerelease?"-0":"",l?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&d?(u&&(i=0),o=0,">"===s?(s=">=",u?(n=+n+1,i=0):i=+i+1,o=0):"<="===s&&(s="<",u?n=+n+1:i=+i+1),"<"===s&&(a="-0"),r=`${s+n}.${i}.${o}${a}`):u?r=`>=${n}.0.0${a} <${+n+1}.0.0-0`:d&&(r=`>=${n}.${i}.0${a} <${n}.${+i+1}.0-0`),c("xRange return",r),r})},x=(e,t)=>(c("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),A=(e,t)=>
6(c("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),M=e=>(t,r,s,n,i,o,a,c,l,u,d,h)=>(r=E(s)?"":E(n)?`>=${s}.0.0${e?"-0":""}`:E(i)?`>=${s}.${n}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`,c=E(l)?"":E(u)?`<${+l+1}.0.0-0`:E(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${r} ${c}`.trim()),N=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(c(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){let s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},24642:function(e,t,r){let s=r(21628),{MAX_LENGTH:n,MAX_SAFE_INTEGER:i}=r(90323),{safeRe:o,t:a}=r(19678),c=r(52887),{compareIdentifiers:l}=r(82569);class u{constructor(e,t){if(t=c(t),e instanceof u){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>n)throw TypeError(`version is longer than ${n} characters`);s("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(s("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),l(this.major,e.major)||l(this.minor,e.minor)||l(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(s("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return -1;if(r===n)continue;else return l(r,n)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(s("build compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return -1;if(r===n)continue;else return l(r,n)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(r)?1:0;if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}
6e.exports=u},13304:function(e,t,r){let s=r(28881);e.exports=(e,t)=>{let r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},25212:function(e,t,r){let s=r(60748),n=r(77901),i=r(99649),o=r(35135),a=r(95422),c=r(70998);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,l);case"!=":return n(e,r,l);case">":return i(e,r,l);case">=":return o(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw TypeError(`Invalid operator: ${t}`)}}},65945:function(e,t,r){let s=r(24642),n=r(28881),{safeRe:i,t:o}=r(19678);e.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let s;let n=t.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL];for(;(s=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&s.index+s[0].length===r.index+r[0].length||(r=s),n.lastIndex=s.index+s[1].length+s[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?i[o.COERCEFULL]:i[o.COERCE]);if(null===r)return null;let a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return n(`${a}.${c}.${l}${u}${d}`,t)}},44081:function(e,t,r){let s=r(24642);e.exports=(e,t,r)=>{let n=new s(e,r),i=new s(t,r);return n.compare(i)||n.compareBuild(i)}},96388:function(e,t,r){let s=r(34066);e.exports=(e,t)=>s(e,t,!0)},34066:function(e,t,r){let s=r(24642);e.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},6461:function(e,t,r){let s=r(28881);e.exports=(e,t)=>{let r=s(e,null,!0),n=s(t,null,!0),i=r.compare(n);if(0===i)return null;let o=i>0,a=o?r:n,c=o?n:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";let u=l?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"}},60748:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>0===s(e,t,r)},99649:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>s(e,t,r)>0},35135:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>s(e,t,r)>=0},72811:function(e,t,r){let s=r(24642);e.exports=(e,t,r,n,i)=>{"string"==typeof r&&(i=n,n=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,n,i).version}catch(e){return null}}},95422:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>0>s(e,t,r)},70998:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>0>=s(e,t,r)},82048:function(e,t,r){let s=r(24642);e.exports=(e,t)=>new s(e,t).major},80145:function(e,t,r){let s=r(24642);e.exports=(e,t)=>new s(e,t).minor},77901:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>0!==s(e,t,r)},28881:function(e,t,r){let s=r(24642);e.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},83382:function(e,t,r){let s=r(24642);e.exports=(e,t)=>new s(e,t).patch},94797:function(e,t,r){let s=r(28881);e.exports=(e,t)=>{let r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},68271:function(e,t,r){let s=r(34066);e.exports=(e,t,r)=>s(t,e,r)},34879:function(e,t,r){let s=r(44081);e.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},93796:function(e,t,r){let s=r(64070);e.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},73433:function(e,t,r){let s=r(44081);e.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},54984:function(e,t,r){let s=r(28881);e.exports=(e,t)=>{let r=s(e,t);return r?r.version:null}},84076:function(e,t,r){let s=r(19678),n=r(90323),i=r(24642),o=r(82569),a=r(28881),c=r(54984),l=r(13304),u=r(72811),d=r(6461),h=r(82048),p=r(80145),f=r(83382),g=r(94797),m=r(34066),b=r(68271),y=r(96388),v=r(44081),w=r(73433),E=r(34879),_=r(99649),k=r(95422),C=r(60748),S=r(77901),R=r(35135),I=r(70998),x=r(25212),A=r(65945),M=r(48394),N=r(64070),L=r(93796),P=r(77285),O=r(37987),T=r(61451),j=r(27465),B=r(38686),F=r(70754),D=r(70077),$=r(9823),U=r(7701),H=r(30442),V=r(72640);e.exports={parse:a,valid:c,clean:l,inc:u,diff:d,major:h,minor:p,patch:f,prerelease:g,compare:m,rcompare:b,compareLoose:y,compareBuild:v,sort:w,rsort:E,gt:_,lt:k,eq:C,neq:S,gte:R,lte:I,cmp:x,coerce:A,Comparator:M,Range:N,satisfies:L,toComparators:P,maxSatisfying:O,minSatisfying:T,minVersion:j,validRange:B,outside:F,gtr:D,ltr:$,intersects:U,simplifyRange:H,subset:V,SemVer:i,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},90323:function(e){let t=Number.MAX_SAFE_INTEGER||9007199254740991;
6e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,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}},21628:function(e,t,r){var s=r(25566);let n="object"==typeof s&&s.env&&s.env.NODE_DEBUG&&/\bsemver\b/i.test(s.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=n},82569:function(e){let t=/^[0-9]+$/,r=(e,r)=>{let s=t.test(e),n=t.test(r);return s&&n&&(e=+e,r=+r),e===r?0:s&&!n?-1:n&&!s?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},919:function(e){class t{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}e.exports=t},52887:function(e){let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},19678:function(e,t,r){let{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=r(90323),o=r(21628),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.t={},d=0,h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[h,n]],f=e=>{for(let[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},g=(e,t,r)=>{let s=f(t),n=d++;o(e,n,t),u[e]=n,l[n]=t,a[n]=new RegExp(t,r?"g":void 0),c[n]=new RegExp(s,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${h}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),g("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?`+"(?:$|[^\\d])"),g("COERCERTL",l[u.COERCE],!0),g("COERCERTLFULL",l[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]}
6)\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},70077:function(e,t,r){let s=r(70754);e.exports=(e,t,r)=>s(e,t,">",r)},7701:function(e,t,r){let s=r(64070);e.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},9823:function(e,t,r){let s=r(70754);e.exports=(e,t,r)=>s(e,t,"<",r)},37987:function(e,t,r){let s=r(24642),n=r(64070);e.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!i||-1===o.compare(e))&&(o=new s(i=e,r))}),i}},61451:function(e,t,r){let s=r(24642),n=r(64070);e.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!i||1===o.compare(e))&&(o=new s(i=e,r))}),i}},27465:function(e,t,r){let s=r(24642),n=r(64070),i=r(99649);e.exports=(e,t)=>{e=new n(e,t);let r=new s("0.0.0");if(e.test(r)||(r=new s("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let n=e.set[t],o=null;
6n.forEach(e=>{let t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!o||i(t,o))&&(o=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!r||i(r,o))&&(r=o)}return r&&e.test(r)?r:null}},70754:function(e,t,r){let s=r(24642),n=r(48394),{ANY:i}=n,o=r(64070),a=r(93796),c=r(99649),l=r(95422),u=r(70998),d=r(35135);e.exports=(e,t,r,h)=>{let p,f,g,m,b;switch(e=new s(e,h),t=new o(t,h),r){case">":p=c,f=u,g=l,m=">",b=">=";break;case"<":p=l,f=d,g=c,m="<",b="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){let s=t.set[r],o=null,a=null;if(s.forEach(e=>{e.semver===i&&(e=new n(">=0.0.0")),o=o||e,a=a||e,p(e.semver,o.semver,h)?o=e:g(e.semver,a.semver,h)&&(a=e)}),o.operator===m||o.operator===b||(!a.operator||a.operator===m)&&f(e,a.semver)||a.operator===b&&g(e,a.semver))return!1}return!0}},30442:function(e,t,r){let s=r(93796),n=r(34066);e.exports=(e,t,r)=>{let i=[],o=null,a=null,c=e.sort((e,t)=>n(e,t,r));for(let e of c)s(e,t,r)?(a=e,o||(o=e)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);let l=[];for(let[e,t]of i)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");let u=l.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},72640:function(e,t,r){let s=r(64070),n=r(48394),{ANY:i}=n,o=r(93796),a=r(34066),c=[new n(">=0.0.0-0")],l=[new n(">=0.0.0")],u=(e,t,r)=>{let s,n,u,p,f,g,m;if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=l}let b=new Set;for(let t of e)">"===t.operator||">="===t.operator?s=d(s,t,r):"<"===t.operator||"<="===t.operator?n=h(n,t,r):b.add(t.semver);if(b.size>1||s&&n&&((u=a(s.semver,n.semver,r))>0||0===u&&(">="!==s.operator||"<="!==n.operator)))return null;for(let e of b){if(s&&!o(e,String(s),r)||n&&!o(e,String(n),r))return null;for(let s of t)if(!o(e,String(s),r))return!1;return!0}let y=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver,v=!!s&&!r.includePrerelease&&!!s.semver.prerelease.length&&s.semver;for(let e of(y&&1===y.prerelease.length&&"<"===n.operator&&0===y.prerelease[0]&&(y=!1),t)){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,s){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if((p=d(s,e,r))===e&&p!==s)return!1}else if(">="===s.operator&&!o(s.semver,String(e),r))return!1}if(n){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if((f=h(n,e,r))===e&&f!==n)return!1}else if("<="===n.operator&&!o(n.semver,String(e),r))return!1}if(!e.operator&&(n||s)&&0!==u)return!1}return(!s||!g||!!n||0===u)&&(!n||!m||!!s||0===u)&&!v&&!y},d=(e,t,r)=>{if(!e)return t;let s=a(e.semver,t.semver,r);return s>0?e:s<0?t:">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;let s=a(e.semver,t.semver,r);return s<0?e:s>0?t:"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let n=!1;e:for(let s of e.set){for(let e of t.set){let t=u(s,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0}},77285:function(e,t,r){let s=r(64070);e.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},38686:function(e,t,r){let s=r(64070);e.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},49820:function(e){e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var s=arguments[r];for(var n in s)t.call(s,n)&&(e[n]=s[n])}return e};var t=Object.prototype.hasOwnProperty},13142:function(e,t,r){"use strict";r.r(t),r.d(t,{Struct:function(){return l},StructError:function(){return s},any:function(){return C},array:function(){return S},assert:function(){return u},assign:function(){return g},bigint:function(){return R},boolean:function(){return I},coerce:function(){return Z},create:function(){return d},date:function(){return x},defaulted:function(){return Q},define:function(){return m},deprecated:function(){return b},dynamic:function(){return y},empty:function(){return X},enums:function(){return A},func:function(){return M},instance:function(){return N},integer:function(){return L},intersection:function(){return P},is:function(){return p},lazy:function(){return v},literal:function(){return O},map:function(){return T},mask:function(){return h},max:function(){return ee},min:function(){return et},never:function(){return j},nonempty:function(){return er},nullable:function(){return B},number:function(){return F},object:function(){return D},omit:function(){return w},optional:function(){return $},partial:function(){return E},pattern:function(){return es},pick:function(){return _},record:function(){return U},refine:function(){return ei},regexp:function(){return H},set:function(){return V},size:function(){return en},string:function(){return W},struct:function(){return k},trimmed:function(){return Y},tuple:function(){return q},type:function(){return z},union:function(){return J},unknown:function(){return G},validate:function(){return f}});class s extends TypeError{constructor(e,t){let r;let{message:s,explanation:n,...i}=e,{path:o}=e,a=0===o.length?s:`At path: ${o.join(".")} -- ${s}`;super(n??a),null!=n&&(this.cause=a),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function n(e){return"object"==typeof e&&null!=e}function i(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function o(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function*a(e,t,r,s){var i;for(let a of(n(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]),e)){let e=function(e,t,r,s){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});let{path:n,branch:i}=t,{type:a}=r,{refinement:c,message:l=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${o(s)}\``}=e;return{value:s,type:a,refinement:c,key:n[n.length-1],path:n,branch:i,...e,message:l}}(a,t,r,s);e&&(yield e)}}function*c(e,t,r={}){let{path:s=[],branch:i=[e],coerce:o=!1,mask:a=!1}=r,l={path:s,branch:i};if(o&&(e=t.coercer(e,l),a&&"type"!==t.type&&n(t.schema)&&n(e)&&!Array.isArray(e)))for(let r in e)void 0===t.schema[r]&&delete e[r];let u="valid";for(let s of t.validator(e,l))s.explanation=r.message,u="not_val
6id",yield[s,void 0];for(let[d,h,p]of t.entries(e,l))for(let t of c(h,p,{path:void 0===d?s:[...s,d],branch:void 0===d?i:[...i,h],coerce:o,mask:a,message:r.message}))t[0]?(u=null!=t[0].refinement?"not_refined":"not_valid",yield[t[0],void 0]):o&&(h=t[1],void 0===d?e=h:e instanceof Map?e.set(d,h):e instanceof Set?e.add(h):n(e)&&(void 0!==h||d in e)&&(e[d]=h));if("not_valid"!==u)for(let s of t.refiner(e,l))s.explanation=r.message,u="not_refined",yield[s,void 0];"valid"===u&&(yield[void 0,e])}class l{constructor(e){let{type:t,schema:r,validator:s,refiner:n,coercer:i=e=>e,entries:o=function*(){}}=e;this.type=t,this.schema=r,this.entries=o,this.coercer=i,s?this.validator=(e,t)=>a(s(e,t),t,this,e):this.validator=()=>[],n?this.refiner=(e,t)=>a(n(e,t),t,this,e):this.refiner=()=>[]}assert(e,t){return u(e,this,t)}create(e,t){return d(e,this,t)}is(e){return p(e,this)}mask(e,t){return h(e,this,t)}validate(e,t={}){return f(e,this,t)}}function u(e,t,r){let s=f(e,t,{message:r});if(s[0])throw s[0]}function d(e,t,r){let s=f(e,t,{coerce:!0,message:r});if(!s[0])return s[1];throw s[0]}function h(e,t,r){let s=f(e,t,{coerce:!0,mask:!0,message:r});if(!s[0])return s[1];throw s[0]}function p(e,t){return!f(e,t)[0]}function f(e,t,r={}){let n=c(e,t,r),i=function(e){let{done:t,value:r}=e.next();return t?void 0:r}(n);return i[0]?[new s(i[0],function*(){for(let e of n)e[0]&&(yield e[0])}),void 0]:[void 0,i[1]]}function g(...e){let t="type"===e[0].type,r=Object.assign({},...e.map(e=>e.schema));return t?z(r):D(r)}function m(e,t){return new l({type:e,schema:null,validator:t})}function b(e,t){return new l({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,s)=>void 0===r||(t(r,s),e.validator(r,s))})}function y(e){return new l({type:"dynamic",schema:null,*entries(t,r){let s=e(t,r);yield*s.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})}function v(e){let t;return new l({type:"lazy",schema:null,*entries(r,s){t??(t=e()),yield*t.entries(r,s)},validator:(r,s)=>(t??(t=e()),t.validator(r,s)),coercer:(r,s)=>(t??(t=e()),t.coercer(r,s)),refiner:(r,s)=>(t??(t=e()),t.refiner(r,s))})}function w(e,t){let{schema:r}=e,s={...r};for(let e of t)delete s[e];return"type"===e.type?z(s):D(s)}function E(e){let t=e instanceof l,r=t?{...e.schema}:{...e};for(let e in r)r[e]=$(r[e]);return t&&"type"===e.type?z(r):D(r)}function _(e,t){let{schema:r}=e,s={};for(let e of t)s[e]=r[e];return"type"===e.type?z(s):D(s)}function k(e,t){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),m(e,t)}function C(){return m("any",()=>!0)}function S(e){return new l({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(let[r,s]of t.entries())yield[r,s,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${o(e)}`})}function R(){return m("bigint",e=>"bigint"==typeof e)}function I(){return m("boolean",e=>"boolean"==typeof e)}function x(){return m("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${o(e)}`)}function A(e){let t={},r=e.map(e=>o(e)).join();for(let r of e)t[r]=r;return new l({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${o(t)}`})}function M(){return m("func",e=>"function"==typeof e||`Expected a function, but received: ${o(e)}`)}function N(e){return m("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${o(t)}`)}function L(){return m("integer",e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${o(e)}`)}function P(e){return new l({type:"intersection",schema:null,*entries(t,r){for(let s of e)yield*s.entries(t,r)},*validator(t,r){for(let s of e)yield*s.validator(t,r)},*refiner(t,r){for(let s of e)yield*s.refiner(t,r)}})}function O(e){let t=o(e),r=typeof e;return new l({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${o(r)}`})}function T(e,t){return new l({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(let[s,n]of r.entries())yield[s,s,e],yield[s,n,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${o(e)}`})}function j(){return m("never",()=>!1)}function B(e){return new l({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function F(){return m("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${o(e)}`)}function D(e){let t=e?Object.keys(e):[],r=j();return new l({type:"object",schema:e||null,*entries(s){if(e&&n(s)){let n=new Set(Object.keys(s));for(let r of t)n.delete(r),yield[r,s[r],e[r]];for(let e of n)yield[e,s[e],r]}},validator:e=>n(e)||`Expected an object, but received: ${o(e)}`,coercer:e=>n(e)?{...e}:e})}function $(e){return new l({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function U(e,t){return new l({type:"record",schema:null,*entries(r){if(n(r))for(let s in r){let n=r[s];yield[s,s,e],yield[s,n,t]}},validator:e=>n(e)||`Expected an object, but received: ${o(e)}`})}function H(){return m("regexp",e=>e instanceof RegExp)}function V(e){return new l({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(let r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${o(e)}`})}function W(){return m("string",e=>"string"==typeof e||`Expected a string, but received: ${o(e)}`)}function q(e){let t=j();return new l({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let s=Math.max(e.length,r.length);for(let n=0;n<s;n++)yield[n,r[n],e[n]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${o(e)}`})}function z(e){let t=Object.keys(e);return new l({type:"type",schema:e,*entries(r){if(n(r))for(let s of t)yield[s,r[s],e[s]]},validator:e=>n(e)||`Expected an object, but received: ${o(e)}`,coercer:e=>n(e)?{...e}:e})}function J(e){let t=e.map(e=>e.type).join(" | ");return new l({type:"union",schema:null,coercer(t){for(let r of e){let[e,s]=r.validate(t,{coerce:!0});if(!e)return s}return t},validator(r,s){let n=[];for(let t of e){let[...e]=c(r,t,s),[i]=e;if(!i[0])return[];for(let[t]of e)t&&n.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${o(r)}`,...n]}})}function G(){return m("unknown",()=>!0)}function Z(e,t,r){return new l({...e,coercer:(s,n)=>p(s,t)?e.coercer(r(s,n),n):e.coercer(s,n)})}function Q(e,t,r={}){return Z(e,G(),e=>{let s="function"==typeof t?t():t;if(void 0===e)return s;if(!r.strict&&i(e)&&i(s)){let t={...e},r=!1;for(let e in s)void 0===t[e]&&(t[e]=s[e],r=!0);if(r)return t}return e})}function Y(e){return Z(e,W(),e=>e.trim())}function X(e){return ei(e,"empty",t=>{let r=K(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function K(e){return e instanceof Map||e instanceof Set?e.size:e.length}function ee(e,t,r={}){let{exclusive:s}=r;return ei(e,"max",r=>s?r<t:r<=t||`Expected a ${e.type} less than ${s?"":"or equal to "}${t} but received \`${r}\``)}function et(e,t,r={}){let{exclusive:s}=r;return ei(e,"min",r=>s?r>t:r>=t||`Expected a ${e.type} greater than ${s?"":"or equal to "}${t} but received \`${r}\``)}function er(e){return ei(e,"nonempty",t=>K(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function es(e,t){return ei(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function en(e,t,r=t){let s=`Expected a ${e.type}`,n=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return ei(e,"size",e=>
6{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${s} ${n} but received \`${e}\``;if(e instanceof Map||e instanceof Set){let{size:i}=e;return t<=i&&i<=r||`${s} with a size ${n} but received one with a size of \`${i}\``}{let{length:i}=e;return t<=i&&i<=r||`${s} with a length ${n} but received one with a length of \`${i}\``}})}function ei(e,t,r){return new l({...e,*refiner(s,n){for(let i of(yield*e.refiner(s,n),a(r(s,n),n,e,s)))yield{...i,refinement:t}}})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.